VirtualBox

Changeset 4155 in vbox for trunk/src/VBox/Runtime/r0drv/os2


Ignore:
Timestamp:
Aug 15, 2007 7:41:26 PM (17 years ago)
Author:
vboxsync
Message:

RTR0MemGetAddressR3 & RTR0MemObjLockUser. Linux memobj impl.

File:
1 edited

Legend:

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

    r4136 r4155  
    242242
    243243
    244 int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, RTR0PROCESS R0Process)
     244int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, RTR0PROCESS R0Process)
    245245{
    246246    AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED);
     
    248248    /* create the object. */
    249249    const ULONG cPages = cb >> PAGE_SHIFT;
    250     PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_LOCK, pv, cb);
     250    PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_LOCK, (void *)R3Ptr, cb);
    251251    if (!pMemOs2)
    252252        return VERR_NO_MEMORY;
     
    254254    /* lock it. */
    255255    ULONG cPagesRet = cPages;
    256     int rc = KernVMLock(VMDHL_LONG | VMDHL_WRITE, pv, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
     256    int rc = KernVMLock(VMDHL_LONG | VMDHL_WRITE, (void *)R3Ptr, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
    257257    if (!rc)
    258258    {
    259259        rtR0MemObjFixPageList(&pMemOs2->aPages[0], cPages, cPagesRet);
    260260        Assert(cb == pMemOs2->Core.cb);
    261         Assert(pv == pMemOs2->Core.pv);
     261        Assert(R3Ptr == (RTR3PTR)pMemOs2->Core.pv);
    262262        pMemOs2->Core.u.Lock.R0Process = R0Process;
    263263        *ppMem = &pMemOs2->Core;
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