Changeset 27352 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 14, 2010 11:27:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r26847 r27352 338 338 * @param PhysHighest The highest physical address for the pages in allocation. 339 339 * @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. 341 341 */ 342 static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest, size_t uAlignment) 342 static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest, 343 size_t uAlignment) 343 344 { 344 345 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 345 350 346 351 /* 347 352 * Allocate the memory and create an MDL for it. 348 353 */ 349 PHYSICAL_ADDRESS PhysAddrHighest , PhysAddrLowest, PhysAddrBoundary;354 PHYSICAL_ADDRESS PhysAddrHighest; 350 355 PhysAddrHighest.QuadPart = PhysHighest; 356 #ifndef TARGET_NT4 357 PHYSICAL_ADDRESS PhysAddrLowest, PhysAddrBoundary; 351 358 PhysAddrLowest.QuadPart = 0; 352 359 PhysAddrBoundary.QuadPart = (uAlignment == PAGE_SIZE) ? 0 : uAlignment; 353 360 void *pv = MmAllocateContiguousMemorySpecifyCache(cb, PhysAddrLowest, PhysAddrHighest, PhysAddrBoundary, MmCached); 361 #else 362 void *pv = MmAllocateContiguousMemory(cb, PhysAddrHighest); 363 #endif 354 364 if (!pv) 355 365 return VERR_NO_MEMORY;
Note:
See TracChangeset
for help on using the changeset viewer.