- Timestamp:
- Nov 1, 2019 2:39:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r81587 r81621 1412 1412 * Create the IPRT memory object. 1413 1413 */ 1414 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, pMemLnxToMap->Core.cb); 1414 if (!cbSub) 1415 cbSub = pMemLnxToMap->Core.cb - offSub; 1416 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub); 1415 1417 if (pMemLnx) 1416 1418 { … … 1422 1424 */ 1423 1425 pgprot_t fPg = rtR0MemObjLinuxConvertProt(fProt, true /* kernel */); 1426 Assert(((offSub + cbSub) >> PAGE_SHIFT) <= pMemLnxToMap->cPages); 1424 1427 # ifdef VM_MAP 1425 pMemLnx->Core.pv = vmap(&pMemLnxToMap->apPages[ 0], pMemLnxToMap->cPages, VM_MAP, fPg);1428 pMemLnx->Core.pv = vmap(&pMemLnxToMap->apPages[offSub >> PAGE_SHIFT], cbSub >> PAGE_SHIFT, VM_MAP, fPg); 1426 1429 # else 1427 pMemLnx->Core.pv = vmap(&pMemLnxToMap->apPages[ 0], pMemLnxToMap->cPages, VM_ALLOC, fPg);1430 pMemLnx->Core.pv = vmap(&pMemLnxToMap->apPages[offSub >> PAGE_SHIFT], cbSub >> PAGE_SHIFT, VM_ALLOC, fPg); 1428 1431 # endif 1429 1432 if (pMemLnx->Core.pv) … … 1449 1452 { 1450 1453 Assert(pMemLnxToMap->Core.pv); 1451 pMemLnx->Core.pv = pMemLnxToMap->Core.pv;1454 pMemLnx->Core.pv = (uint8_t *)pMemLnxToMap->Core.pv + offSub; 1452 1455 } 1453 1456 } … … 1461 1464 Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated); 1462 1465 pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO 1463 ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase , pMemLnxToMap->Core.cb)1464 : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase , pMemLnxToMap->Core.cb);1466 ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub) 1467 : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub); 1465 1468 if (pMemLnx->Core.pv) 1466 1469 {
Note:
See TracChangeset
for help on using the changeset viewer.