VirtualBox

Ignore:
Timestamp:
Jan 7, 2009 3:18:17 PM (16 years ago)
Author:
vboxsync
Message:

rtR0MemObjNativeEnterPhys: Use method supporting 64-bit physical addresses. Should fix VERR_ADDRESS_TOO_BIG error (#3485).

File:
1 edited

Legend:

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

    r14836 r15835  
    405405{
    406406    /*
    407      * Validate the address range and create a descriptor for it.
     407     * Create a descriptor for it (the validation is always true on intel macs, but
     408     * as it doesn't harm us keep it in).
    408409     */
    409410    int rc = VERR_ADDRESS_TOO_BIG;
    410     IOPhysicalAddress PhysAddr = Phys;
    411     if (PhysAddr == Phys)
    412     {
    413         IOMemoryDescriptor *pMemDesc = IOMemoryDescriptor::withPhysicalAddress(PhysAddr, cb, kIODirectionInOut);
     411    IOAddressRange aRanges[1] = { Phys, cb };
     412    if (    aRanges[0].address == Phys
     413        &&  aRanges[0].length == cb)
     414    {
     415        IOMemoryDescriptor *pMemDesc = IOMemoryDescriptor::withAddressRanges(&aRanges[0], RT_ELEMENTS(aRanges),
     416                                                                             kIODirectionInOut, NULL /*task*/);
    414417        if (pMemDesc)
    415418        {
    416             Assert(PhysAddr == pMemDesc->getPhysicalAddress());
     419            Assert(Phys == pMemDesc->getPhysicalAddress());
    417420
    418421            /*
     
    422425            if (pMemDarwin)
    423426            {
    424                 pMemDarwin->Core.u.Phys.PhysBase = PhysAddr;
     427                pMemDarwin->Core.u.Phys.PhysBase = Phys;
    425428                pMemDarwin->Core.u.Phys.fAllocated = false;
    426429                pMemDarwin->pMemDesc = pMemDesc;
     
    432435            pMemDesc->release();
    433436        }
     437        else
     438            rc = VERR_MEMOBJ_INIT_FAILED;
    434439    }
    435440    else
    436         AssertMsgFailed(("%#llx\n", (unsigned long long)Phys));
     441        AssertMsgFailed(("%#llx %llx\n", (unsigned long long)Phys, (unsigned long long)cb));
    437442    return rc;
    438443}
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