VirtualBox

Changeset 1309 in vbox


Ignore:
Timestamp:
Mar 7, 2007 8:05:32 PM (18 years ago)
Author:
vboxsync
Message:

r=bird: RTR0UINTREG -> RTR0UINTPTR. created defect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/MMAll.cpp

    r1238 r1309  
    103103DECLINLINE(PMMLOOKUPHYPER) mmHyperLookupR0(PVM pVM, RTR0PTR R0Ptr, uint32_t *poff)
    104104{
    105     RTR3PTR R3Ptr;
    106 
    107105    AssertCompile(sizeof(RTR0PTR) == sizeof(RTR3PTR));
    108106
    109     /** @todo fix this properly; the ring 0 pVM address differs from the R3 one. */
    110     if (R0Ptr >= pVM->pVMR0 && (RTR0UINTREG)R0Ptr < (RTR0UINTREG)pVM->pVMR0 + sizeof(*pVM))
    111         R3Ptr = (RTR3PTR)((RTR0UINTREG)R0Ptr - (RTR0UINTREG)pVM->pVMR0 + (RTR0UINTREG)pVM->pVMR3);
    112     else
    113         R3Ptr = (RTR3PTR)R0Ptr;
     107    /*
     108     * Translate Ring-0 VM addresses into Ring-3 VM addresses before feeding it to mmHyperLookupR3.
     109     */
     110    /** @todo fix this properly; the ring 0 pVM address differs from the R3 one. (#1865) */
     111    RTR0UINTPTR offVM = (RTR0UINTPTR)R0Ptr - (RTR0UINTPTR)pVM->pVMR0;
     112    RTR3PTR R3Ptr = offVM < sizeof(*pVM)
     113                  ? (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + offVM)
     114                  : (RTR3PTR)R0Ptr;
    114115
    115116    return mmHyperLookupR3(pVM, R3Ptr, poff);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette