Changeset 80321 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Aug 16, 2019 9:20:57 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r78120 r80321 1550 1550 if (uAlignment > PAGE_SIZE) 1551 1551 return VERR_NOT_SUPPORTED; 1552 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */1553 1552 1554 1553 #ifdef VBOX_USE_PAE_HACK … … 1569 1568 * Create the IPRT memory object. 1570 1569 */ 1571 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, pMemLnxToMap->Core.cb); 1570 if (cbSub == 0) 1571 cbSub = pMemLnxToMap->Core.cb; 1572 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub); 1572 1573 if (pMemLnx) 1573 1574 { … … 1576 1577 */ 1577 1578 void *pv; 1578 pv = rtR0MemObjLinuxDoMmap(R3PtrFixed, pMemLnxToMap->Core.cb, uAlignment, pTask, fProt);1579 pv = rtR0MemObjLinuxDoMmap(R3PtrFixed, cbSub, uAlignment, pTask, fProt); 1579 1580 if (pv != (void *)-1) 1580 1581 { … … 1583 1584 * This is generic, paranoid and not very efficient. 1584 1585 */ 1585 pgprot_t fPg = rtR0MemObjLinuxConvertProt(fProt, false /* user */);1586 pgprot_t fPg = rtR0MemObjLinuxConvertProt(fProt, false /* user */); 1586 1587 unsigned long ulAddrCur = (unsigned long)pv; 1587 const size_t cPages = pMemLnxToMap->Core.cb>> PAGE_SHIFT;1588 const size_t cPages = (offSub + cbSub) >> PAGE_SHIFT; 1588 1589 size_t iPage; 1589 1590 … … 1593 1594 if (pMemLnxToMap->cPages) 1594 1595 { 1595 for (iPage = 0; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE)1596 for (iPage = offSub >> PAGE_SHIFT; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE) 1596 1597 { 1597 1598 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) … … 1648 1649 if (Phys != NIL_RTHCPHYS) 1649 1650 { 1650 for (iPage = 0; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE, Phys += PAGE_SIZE)1651 for (iPage = offSub >> PAGE_SHIFT; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE, Phys += PAGE_SIZE) 1651 1652 { 1652 1653 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE) … … 1722 1723 * Bail out. 1723 1724 */ 1724 rtR0MemObjLinuxDoMunmap(pv, pMemLnxToMap->Core.cb, pTask);1725 rtR0MemObjLinuxDoMunmap(pv, cbSub, pTask); 1725 1726 } 1726 1727 rtR0MemObjDelete(&pMemLnx->Core);
Note:
See TracChangeset
for help on using the changeset viewer.