Changeset 14824 in vbox for trunk/src/VBox
- Timestamp:
- Nov 30, 2008 7:52:59 AM (16 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/memobj.h
r8245 r14824 380 380 * 381 381 * @returns IPRT status code. 382 * @retval VERR_NOT_SUPPORTED see RTR0MemObjMapKernelEx. 383 * 382 384 * @param ppMem Where to store the ring-0 memory object handle of the mapping object. 383 385 * @param pMemToMap The object to be map. … … 385 387 * @param uAlignment The alignment of the reserved memory; PAGE_SIZE, _2M or _4M. 386 388 * @param fProt Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE). 387 */ 388 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt); 389 * @param offSub Where in the object to start mapping. If non-zero 390 * the value must be page aligned and cbSub must be 391 * non-zero as well. 392 * @param cbSub The size of the part of the object to be mapped. If 393 * zero the entire object is mapped. The value must be 394 * page aligned. 395 */ 396 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 397 unsigned fProt, size_t offSub, size_t cbSub); 389 398 390 399 /** -
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r13839 r14824 44 44 #include "internal/memobj.h" 45 45 46 #define USE_VM_MAP_WIRE 46 /*#define USE_VM_MAP_WIRE - may re-enable later when non-mapped allocations are added. */ 47 47 48 48 … … 542 542 543 543 544 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 544 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 545 unsigned fProt, size_t offSub, size_t cbSub) 545 546 { 546 547 /* … … 549 550 int rc = VERR_INVALID_PARAMETER; 550 551 PRTR0MEMOBJDARWIN pMemToMapDarwin = (PRTR0MEMOBJDARWIN)pMemToMap; 552 printf("rtR0MemObjNativeMapKernel: pMemDesc=%p\n", pMemToMapDarwin->pMemDesc); 551 553 if (pMemToMapDarwin->pMemDesc) 552 554 { 553 555 IOMemoryMap *pMemMap = pMemToMapDarwin->pMemDesc->map(kernel_task, kIOMapAnywhere, 554 kIOMapAnywhere | kIOMapDefaultCache); 556 kIOMapAnywhere | kIOMapDefaultCache, 557 offSub, cbSub); 555 558 if (pMemMap) 556 559 { -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r8245 r14824 468 468 469 469 470 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 471 { 470 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 471 unsigned fProt, size_t offSub, size_t cbSub) 472 { 473 AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); 472 474 AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); 473 475 -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r13994 r14824 940 940 941 941 942 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 942 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 943 unsigned fProt, size_t offSub, size_t cbSub) 943 944 { 944 945 int rc = VERR_NO_MEMORY; … … 947 948 948 949 /* Fail if requested to do something we can't. */ 950 AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); 949 951 AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); 950 952 AssertMsgReturn(uAlignment <= PAGE_SIZE, ("%#x\n", uAlignment), VERR_NOT_SUPPORTED); -
trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
r14518 r14824 670 670 RTR0DECL(int) RTR0MemObjMapKernel(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 671 671 { 672 return RTR0MemObjMapKernelEx(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, 0, 0); 673 } 674 675 676 /** 677 * Maps a memory object into kernel virtual address space. 678 * 679 * The ability to map subsections of the object into kernel space is currently 680 * not implemented on all platforms. All/Most of platforms supports mapping the 681 * whole object into kernel space. 682 * 683 * @returns IPRT status code. 684 * @retval VERR_NOT_SUPPORTED if it's not possible to map a subsection of a 685 * memory object on this platform. When you hit this, try implement it. 686 * 687 * @param pMemObj Where to store the ring-0 memory object handle of the mapping object. 688 * @param MemObjToMap The object to be map. 689 * @param pvFixed Requested address. (void *)-1 means any address. This must match the alignment. 690 * @param uAlignment The alignment of the reserved memory. 691 * Supported values are 0 (alias for PAGE_SIZE), PAGE_SIZE, _2M and _4M. 692 * @param fProt Combination of RTMEM_PROT_* flags (except RTMEM_PROT_NONE). 693 * @param offSub Where in the object to start mapping. If non-zero 694 * the value must be page aligned and cbSub must be 695 * non-zero as well. 696 * @param cbSub The size of the part of the object to be mapped. If 697 * zero the entire object is mapped. The value must be 698 * page aligned. 699 */ 700 RTR0DECL(int) RTR0MemObjMapKernelEx(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, 701 unsigned fProt, size_t offSub, size_t cbSub) 702 { 672 703 PRTR0MEMOBJINTERNAL pMemToMap; 673 704 PRTR0MEMOBJINTERNAL pNew; … … 690 721 AssertReturn(fProt != RTMEM_PROT_NONE, VERR_INVALID_PARAMETER); 691 722 AssertReturn(!(fProt & ~(RTMEM_PROT_READ | RTMEM_PROT_WRITE | RTMEM_PROT_EXEC)), VERR_INVALID_PARAMETER); 692 723 AssertReturn(!(offSub & PAGE_OFFSET_MASK), VERR_INVALID_PARAMETER); 724 AssertReturn(offSub < pMemToMap->cb, VERR_INVALID_PARAMETER); 725 AssertReturn(!(cbSub & PAGE_OFFSET_MASK), VERR_INVALID_PARAMETER); 726 AssertReturn(cbSub <= pMemToMap->cb, VERR_INVALID_PARAMETER); 727 AssertReturn((!offSub && !cbSub) || (offSub + cbSub) <= pMemToMap->cb, VERR_INVALID_PARAMETER); 728 729 /* adjust the request to simplify the native code. */ 730 if (offSub == 0 && cbSub == pMemToMap->cb) 731 cbSub = 0; 693 732 694 733 /* do the mapping. */ 695 rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt );734 rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt, offSub, cbSub); 696 735 if (RT_SUCCESS(rc)) 697 736 { -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r8245 r14824 746 746 747 747 748 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 749 { 748 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 749 unsigned fProt, size_t offSub, size_t cbSub) 750 { 751 AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); 750 752 return rtR0MemObjNtMap(ppMem, pMemToMap, pvFixed, uAlignment, fProt, NIL_RTR0PROCESS); 751 753 } -
trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
r13839 r14824 304 304 305 305 306 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 307 { 306 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 307 unsigned fProt, size_t offSub, size_t cbSub) 308 { 309 AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); 308 310 AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); 309 311 -
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r13839 r14824 320 320 } 321 321 322 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 322 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 323 unsigned fProt, size_t offSub, size_t cbSub) 323 324 { 324 325 /* @todo rtR0MemObjNativeMapKernel / Solaris - Should be fairly simple alloc kernel memory and memload it. */ -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c
r13839 r14824 254 254 } 255 255 256 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt) 256 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 257 unsigned fProt, size_t offSub, size_t cbSub) 257 258 { 258 259 /* @todo rtR0MemObjNativeMapKernel / Solaris - Should be fairly simple alloc kernel memory and memload it. */
Note:
See TracChangeset
for help on using the changeset viewer.