Changeset 26430 in vbox
- Timestamp:
- Feb 11, 2010 2:23:01 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/memobj.h
r23610 r26430 191 191 192 192 /** 193 * Allocates contiguous page aligned physical memory without (necessarily) any kernel mapping. 194 * 195 * @returns IPRT status code. 196 * @param pMemObj Where to store the ring-0 memory object handle. 197 * @param cb Number of bytes to allocate. This is rounded up to nearest page. 198 * @param PhysHighest The highest permittable address (inclusive). 199 * Pass NIL_RTHCPHYS if any address is acceptable. 200 * @param uAlignment The alignment of the reserved memory. 201 * Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G. 202 */ 203 RTR0DECL(int) RTR0MemObjAllocPhysEx(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment); 204 205 /** 193 206 * Allocates non-contiguous page aligned physical memory without (necessarily) any kernel mapping. 194 207 * -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r25744 r26430 191 191 { "RTR0MemObjAllocPage", (void *)RTR0MemObjAllocPage }, 192 192 { "RTR0MemObjAllocPhys", (void *)RTR0MemObjAllocPhys }, 193 { "RTR0MemObjAllocPhysEx", (void *)RTR0MemObjAllocPhysEx }, 193 194 { "RTR0MemObjAllocPhysNC", (void *)RTR0MemObjAllocPhysNC }, 194 195 { "RTR0MemObjAllocCont", (void *)RTR0MemObjAllocCont }, -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r25528 r26430 197 197 * - Nothing. 198 198 */ 199 #define SUPDRV_IOC_VERSION 0x0014000 0199 #define SUPDRV_IOC_VERSION 0x00140001 200 200 201 201 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r25528 r26430 273 273 CookieReq.u.In.u32ReqVersion = SUPDRV_IOC_VERSION; 274 274 const uint32_t uMinVersion = (SUPDRV_IOC_VERSION & 0xffff0000) == 0x00140000 275 ? 0x0014000 0275 ? 0x00140001 276 276 : SUPDRV_IOC_VERSION & 0xffff0000; 277 277 CookieReq.u.In.u32MinVersion = uMinVersion; -
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r23610 r26430 568 568 569 569 570 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) 571 { 570 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 571 { 572 /** @todo */ 573 if ( uAlignment != 0 574 && uAlignment != PAGE_SIZE) 575 return VERR_NOT_SUPPORTED; 576 572 577 /* 573 578 * Translate the PhysHighest address into a mask. -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r23610 r26430 327 327 328 328 329 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )329 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 330 330 { 331 331 /** @todo check if there is a more appropriate API somewhere.. */ 332 333 /** @todo */ 334 if ( uAlignment != 0 335 && uAlignment != PAGE_SIZE) 336 return VERR_NOT_SUPPORTED; 332 337 333 338 /* create the object. */ -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r23611 r26430 700 700 701 701 702 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) 703 { 702 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 703 { 704 /* @todo */ 705 if ( uAlignment != 0 706 && uAlignment != PAGE_SIZE) 707 return VERR_NOT_SUPPORTED; 708 704 709 return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest); 705 710 } -
trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
r23610 r26430 583 583 584 584 /* do the allocation. */ 585 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest );585 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */); 586 586 } 587 587 RT_EXPORT_SYMBOL(RTR0MemObjAllocPhys); 588 589 /** 590 * Allocates contiguous page aligned physical memory without (necessarily) any kernel mapping. 591 * 592 * @returns IPRT status code. 593 * @param pMemObj Where to store the ring-0 memory object handle. 594 * @param cb Number of bytes to allocate. This is rounded up to nearest page. 595 * @param PhysHighest The highest permittable address (inclusive). 596 * Pass NIL_RTHCPHYS if any address is acceptable. 597 * @param uAlignment The alignment of the physical memory to allocate. 598 * Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M, _4M and _1G. 599 */ 600 RTR0DECL(int) RTR0MemObjAllocPhysEx(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 601 { 602 /* sanity checks. */ 603 const size_t cbAligned = RT_ALIGN_Z(cb, PAGE_SIZE); 604 AssertPtrReturn(pMemObj, VERR_INVALID_POINTER); 605 *pMemObj = NIL_RTR0MEMOBJ; 606 AssertReturn(cb > 0, VERR_INVALID_PARAMETER); 607 AssertReturn(cb <= cbAligned, VERR_INVALID_PARAMETER); 608 AssertReturn(PhysHighest >= cb, VERR_INVALID_PARAMETER); 609 AssertReturn(( uAlignment == 0 610 || uAlignment == PAGE_SIZE 611 || uAlignment == _2M 612 || uAlignment == _4M 613 || uAlignment == _1G), VERR_INVALID_PARAMETER); 614 RT_ASSERT_PREEMPTIBLE(); 615 616 /* do the allocation. */ 617 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment); 618 } 619 RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysEx); 588 620 589 621 -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r23610 r26430 337 337 * @param fExecutable Whether the mapping should be executable or not. 338 338 * @param PhysHighest The highest physical address for the pages in allocation. 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. 339 341 */ 340 static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest )342 static int rtR0MemObjNativeAllocContEx(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTHCPHYS PhysHighest, size_t uAlignment) 341 343 { 342 344 AssertMsgReturn(cb <= _1G, ("%#x\n", cb), VERR_OUT_OF_RANGE); /* for safe size_t -> ULONG */ 345 346 /* @todo */ 347 if ( uAlignment != 0 348 && uAlignment != PAGE_SIZE) 349 return VERR_NOT_SUPPORTED; 343 350 344 351 /* … … 378 385 int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) 379 386 { 380 return rtR0MemObjNativeAllocContEx(ppMem, cb, fExecutable, _4G-1 );381 } 382 383 384 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )387 return rtR0MemObjNativeAllocContEx(ppMem, cb, fExecutable, _4G-1, PAGE_SIZE /* alignment */); 388 } 389 390 391 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 385 392 { 386 393 #ifndef IPRT_TARGET_NT4 … … 436 443 #endif /* !IPRT_TARGET_NT4 */ 437 444 438 return rtR0MemObjNativeAllocContEx(ppMem, cb, false, PhysHighest );445 return rtR0MemObjNativeAllocContEx(ppMem, cb, false, PhysHighest, uAlignment); 439 446 } 440 447 -
trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
r23610 r26430 195 195 196 196 197 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )197 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 198 198 { 199 199 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_IMPLEMENTED); 200 201 /** @todo */ 202 if ( uAlignment != 0 203 && uAlignment != PAGE_SIZE) 204 return VERR_NOT_SUPPORTED; 200 205 201 206 /* create the object. */ -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c
r24426 r26430 192 192 193 193 194 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )194 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 195 195 { 196 196 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_IMPLEMENTED); 197 198 /** @todo */ 199 if ( uAlignment != 0 200 && uAlignment != PAGE_SIZE) 201 return VERR_NOT_SUPPORTED; 197 202 198 203 return rtR0MemObjNativeAllocCont(ppMem, cb, false);
Note:
See TracChangeset
for help on using the changeset viewer.