VirtualBox

Changeset 75578 in vbox for trunk/src/VBox/Runtime/r0drv/nt


Ignore:
Timestamp:
Nov 19, 2018 3:31:04 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/memobj-r0drv-nt.cpp: Allow mapping RTR0MEMOBJTYPE_PHYS_NC allocations into kernel space.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp

    r73097 r75578  
    733733        if (    pMemNtToMap->Core.uRel.Parent.cMappings
    734734            &&  R0Process == NIL_RTR0PROCESS)
    735             return VERR_NOT_SUPPORTED;
     735        {
     736            if (pMemNtToMap->Core.enmType != RTR0MEMOBJTYPE_PHYS_NC)
     737                return VERR_NOT_SUPPORTED;
     738            uint32_t iMapping = pMemNtToMap->Core.uRel.Parent.cMappings;
     739            while (iMapping-- > 0)
     740            {
     741                PRTR0MEMOBJNT pMapping = (PRTR0MEMOBJNT)pMemNtToMap->Core.uRel.Parent.papMappings[iMapping];
     742                if (   pMapping->Core.enmType != RTR0MEMOBJTYPE_MAPPING
     743                    || pMapping->Core.u.Mapping.R0Process == NIL_RTR0PROCESS)
     744                    return VERR_NOT_SUPPORTED;
     745            }
     746        }
    736747
    737748        __try
     
    816827
    817828DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    818                               unsigned fProt, size_t offSub, size_t cbSub)
     829                                          unsigned fProt, size_t offSub, size_t cbSub)
    819830{
    820831    AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED);
     
    823834
    824835
    825 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)
     836DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed,
     837                                        size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)
    826838{
    827839    AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_NOT_SUPPORTED);
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