VirtualBox

Changeset 27352 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 14, 2010 11:27:45 PM (15 years ago)
Author:
vboxsync
Message:

memobj-r0drv-nt.cpp: NT4 (vanilla, didn't check sp6) doesn't have MmAllocateContiguousMemorySpecifyCache. Hope this works...

File:
1 edited

Legend:

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

    r26847 r27352  
    338338 * @param   PhysHighest     The highest physical address for the pages in allocation.
    339339 * @param   uAlignment      The alignment of the physical memory to allocate.
    340  *                          Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G.
     340 *                          Supported values are PAGE_SIZE, _2M, _4M and _1G.
    341341 */
    342 static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest, size_t uAlignment)
     342static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest,
     343                                       size_t uAlignment)
    343344{
    344345    AssertMsgReturn(cb <= _1G, ("%#x\n", cb), VERR_OUT_OF_RANGE); /* for safe size_t -> ULONG */
     346#ifdef TARGET_NT4
     347    if (uAlignment != PAGE_SIZE)
     348        return VERR_NOT_SUPPORTED;
     349#endif
    345350
    346351    /*
    347352     * Allocate the memory and create an MDL for it.
    348353     */
    349     PHYSICAL_ADDRESS PhysAddrHighest, PhysAddrLowest, PhysAddrBoundary;
     354    PHYSICAL_ADDRESS PhysAddrHighest;
    350355    PhysAddrHighest.QuadPart  = PhysHighest;
     356#ifndef TARGET_NT4
     357    PHYSICAL_ADDRESS PhysAddrLowest, PhysAddrBoundary;
    351358    PhysAddrLowest.QuadPart   = 0;
    352359    PhysAddrBoundary.QuadPart = (uAlignment == PAGE_SIZE) ? 0 : uAlignment;
    353360    void *pv = MmAllocateContiguousMemorySpecifyCache(cb, PhysAddrLowest, PhysAddrHighest, PhysAddrBoundary, MmCached);
     361#else
     362    void *pv = MmAllocateContiguousMemory(cb, PhysAddrHighest);
     363#endif
    354364    if (!pv)
    355365        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