VirtualBox

Changeset 26434 in vbox


Ignore:
Timestamp:
Feb 11, 2010 2:34:26 PM (15 years ago)
Author:
vboxsync
Message:

Use MmAllocateContiguousMemorySpecifyCache for specifying the allocation boundary.

File:
1 edited

Legend:

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

    r26430 r26434  
    344344    AssertMsgReturn(cb <= _1G, ("%#x\n", cb), VERR_OUT_OF_RANGE); /* for safe size_t -> ULONG */
    345345
    346     /* @todo */
    347     if (    uAlignment != 0
    348         &&  uAlignment != PAGE_SIZE)
    349         return VERR_NOT_SUPPORTED;
    350 
    351346    /*
    352347     * Allocate the memory and create an MDL for it.
    353348     */
    354     PHYSICAL_ADDRESS PhysAddrHighest;
    355     PhysAddrHighest.QuadPart = PhysHighest;
    356     void *pv = MmAllocateContiguousMemory(cb, PhysAddrHighest);
     349    PHYSICAL_ADDRESS PhysAddrHighest, PhysAddrLowest, PhysAddrBoundary;
     350    PhysAddrHighest.QuadPart  = PhysHighest;
     351    PhysAddrLowest.QuadPart   = 0;
     352    PhysAddrBoundary.QuadPart = uAlignment;
     353    void *pv = MmAllocateContiguousMemorySpecifyCache(cb, PhysAddrLowest, PhysAddrHighest, PhysAddrBoundary, MmCached);
    357354    if (!pv)
    358355        return VERR_NO_MEMORY;
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