VirtualBox

Ignore:
Timestamp:
May 4, 2010 2:33:41 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61067
Message:

RTR0MemObjEnterPhys/rtR0MemObjNativeEnterPhys: Validate the cache policy in the common code. Use uint32_t as parameter type. All native implementations must set the policy member.

File:
1 edited

Legend:

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

    r28800 r29027  
    743743
    744744
    745 int rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, unsigned CachePolicy)
     745int rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy)
    746746{
    747747    /*
     
    759759    pMemLnx->Core.u.Phys.PhysBase = PhysAddr;
    760760    pMemLnx->Core.u.Phys.fAllocated = false;
    761     pMemLnx->Core.u.Phys.CachePolicy = CachePolicy;
     761    pMemLnx->Core.u.Phys.uCachePolicy = uCachePolicy;
    762762    Assert(!pMemLnx->cPages);
    763763    *ppMem = &pMemLnx->Core;
     
    11661166             */
    11671167            Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
    1168             pMemLnx->Core.pv = (pMemLnxToMap->Core.u.Phys.CachePolicy == RTMEM_CACHE_POLICY_MMIO)
    1169                                    ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase, pMemLnxToMap->Core.cb)
    1170                                    : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase, pMemLnxToMap->Core.cb);
     1168            pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
     1169                             ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase, pMemLnxToMap->Core.cb)
     1170                             : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase, pMemLnxToMap->Core.cb);
    11711171            if (pMemLnx->Core.pv)
    11721172            {
Note: See TracChangeset for help on using the changeset viewer.

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