VirtualBox

Changeset 26771 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Feb 24, 2010 9:36:49 PM (15 years ago)
Author:
vboxsync
Message:

IPRT/memobj-r0drv-freebsd: Do not use vtophys to get the physical address for virtual userspace addresses. pmap_extract is the correct function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

    r26430 r26771  
    740740            /* fall thru*/
    741741        case RTR0MEMOBJTYPE_PAGE:
     742        {
     743            vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + (iPage << PAGE_SHIFT);
     744            return vtophys(pb);
     745        }
    742746        case RTR0MEMOBJTYPE_MAPPING:
    743747        {
    744             uint8_t *pb = (uint8_t *)pMemFreeBSD->Core.pv + (iPage << PAGE_SHIFT);
    745             return vtophys(pb);
     748            vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + (iPage << PAGE_SHIFT);
     749
     750            if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS)
     751            {
     752                struct proc    *pProc     = (struct proc *)pMemFreeBSD->Core.u.Mapping.R0Process;
     753                struct vm_map  *pProcMap  = &pProc->p_vmspace->vm_map;
     754                pmap_t pPhysicalMap       = pProcMap->pmap;
     755
     756                return pmap_extract(pPhysicalMap, pb);
     757            }
     758            else
     759                return vtophys(pb);
    746760        }
    747761
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