Changeset 78120 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Apr 12, 2019 1:20:50 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130012
- Location:
- trunk/src/VBox/Runtime/r0drv
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r76553 r78120 893 893 if (uAlignment > PAGE_SIZE) 894 894 return VERR_NOT_SUPPORTED; 895 Assert(!offSub || cbSub); 895 896 896 897 IPRT_DARWIN_SAVE_EFL_AC(); … … 959 960 */ 960 961 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING, 961 pv, cbSub );962 pv, cbSub ? cbSub : pMemToMap->cb); 962 963 if (pMemDarwin) 963 964 { … … 995 996 996 997 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 997 unsigned fProt, RTR0PROCESS R0Process )998 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 998 999 { 999 1000 RT_NOREF(fProt); … … 1005 1006 if (uAlignment > PAGE_SIZE) 1006 1007 return VERR_NOT_SUPPORTED; 1008 Assert(!offSub || cbSub); 1007 1009 1008 1010 IPRT_DARWIN_SAVE_EFL_AC(); … … 1019 1021 0, 1020 1022 kIOMapAnywhere | kIOMapDefaultCache, 1021 0 /* offset */,1022 0 /* length */);1023 offSub, 1024 cbSub); 1023 1025 #else 1024 1026 IOMemoryMap *pMemMap = pMemToMapDarwin->pMemDesc->map((task_t)R0Process, 1025 1027 0, 1026 kIOMapAnywhere | kIOMapDefaultCache); 1028 kIOMapAnywhere | kIOMapDefaultCache, 1029 offSub, 1030 cbSub); 1027 1031 #endif 1028 1032 if (pMemMap) … … 1036 1040 */ 1037 1041 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING, 1038 pv, pMemToMapDarwin->Core.cb);1042 pv, cbSub ? cbSub : pMemToMap->cb); 1039 1043 if (pMemDarwin) 1040 1044 { -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r77131 r78120 651 651 if (uAlignment > PAGE_SIZE) 652 652 return VERR_NOT_SUPPORTED; 653 Assert(!offSub || cbSub); 653 654 654 655 int rc; … … 711 712 712 713 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 713 unsigned fProt, RTR0PROCESS R0Process )714 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 714 715 { 715 716 /* … … 719 720 if (uAlignment > PAGE_SIZE) 720 721 return VERR_NOT_SUPPORTED; 722 Assert(!offSub || cbSub); 721 723 722 724 int rc; … … 748 750 AddrR3 = (vm_offset_t)R3PtrFixed; 749 751 752 if (cbSub == 0) 753 cbSub = pMemToMap->cb - offSub; 754 750 755 /* Insert the pObject in the map. */ 751 756 vm_object_reference(pMemToMapFreeBSD->pObject); 752 757 rc = vm_map_find(pProcMap, /* Map to insert the object in */ 753 758 pMemToMapFreeBSD->pObject, /* Object to map */ 754 0,/* Start offset in the object */759 offSub, /* Start offset in the object */ 755 760 &AddrR3, /* Start address IN/OUT */ 756 pMemToMap->cb,/* Size of the mapping */761 cbSub, /* Size of the mapping */ 757 762 #if __FreeBSD_version >= 1000055 758 763 0, /* Upper bound of the mapping */ -
trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
r76553 r78120 478 478 479 479 int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 480 unsigned fProt, RTR0PROCESS R0Process )480 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 481 481 { 482 482 #if 0 … … 487 487 AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED); 488 488 if (uAlignment > PAGE_SIZE) 489 return VERR_NOT_SUPPORTED; 489 return VERR_NOT_SUPPORTED; 490 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */ 490 491 491 492 int rc; -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r77730 r78120 1530 1530 1531 1531 1532 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, 1533 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)1532 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 1533 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 1534 1534 { 1535 1535 struct task_struct *pTask = rtR0ProcessToLinuxTask(R0Process); … … 1550 1550 if (uAlignment > PAGE_SIZE) 1551 1551 return VERR_NOT_SUPPORTED; 1552 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */ 1552 1553 1553 1554 #ifdef VBOX_USE_PAE_HACK -
trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
r76553 r78120 730 730 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag) 731 731 { 732 return RTR0MemObjMapUserExTag(pMemObj, MemObjToMap, R3PtrFixed, uAlignment, fProt, R0Process, 0, 0, pszTag); 733 } 734 RT_EXPORT_SYMBOL(RTR0MemObjMapUserTag); 735 736 737 RTR0DECL(int) RTR0MemObjMapUserExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 738 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 739 { 732 740 /* sanity checks. */ 733 741 PRTR0MEMOBJINTERNAL pMemToMap; … … 749 757 AssertReturn(fProt != RTMEM_PROT_NONE, VERR_INVALID_PARAMETER); 750 758 AssertReturn(!(fProt & ~(RTMEM_PROT_READ | RTMEM_PROT_WRITE | RTMEM_PROT_EXEC)), VERR_INVALID_PARAMETER); 759 AssertReturn(!(offSub & PAGE_OFFSET_MASK), VERR_INVALID_PARAMETER); 760 AssertReturn(offSub < pMemToMap->cb, VERR_INVALID_PARAMETER); 761 AssertReturn(!(cbSub & PAGE_OFFSET_MASK), VERR_INVALID_PARAMETER); 762 AssertReturn(cbSub <= pMemToMap->cb, VERR_INVALID_PARAMETER); 763 AssertReturn((!offSub && !cbSub) || (offSub + cbSub) <= pMemToMap->cb, VERR_INVALID_PARAMETER); 751 764 if (R0Process == NIL_RTR0PROCESS) 752 765 R0Process = RTR0ProcHandleSelf(); … … 755 768 RT_NOREF_PV(pszTag); 756 769 770 /* adjust the request to simplify the native code. */ 771 if (offSub == 0 && cbSub == pMemToMap->cb) 772 cbSub = 0; 773 757 774 /* do the mapping. */ 758 rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process );775 rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub); 759 776 if (RT_SUCCESS(rc)) 760 777 { … … 776 793 return rc; 777 794 } 778 RT_EXPORT_SYMBOL(RTR0MemObjMapUser Tag);795 RT_EXPORT_SYMBOL(RTR0MemObjMapUserExTag); 779 796 780 797 -
trunk/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c
r77120 r78120 499 499 500 500 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 501 unsigned fProt, RTR0PROCESS R0Process )501 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 502 502 { 503 503 printf("NativeMapUser\n"); -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r76553 r78120 835 835 836 836 837 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, 838 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)837 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 838 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 839 839 { 840 840 AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_NOT_SUPPORTED); 841 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */ 841 842 return rtR0MemObjNtMap(ppMem, pMemToMap, (void *)R3PtrFixed, uAlignment, fProt, R0Process); 842 843 } -
trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
r77120 r78120 428 428 429 429 430 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process) 430 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 431 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 431 432 { 432 433 AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED); … … 434 435 if (uAlignment > PAGE_SIZE) 435 436 return VERR_NOT_SUPPORTED; 437 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */ 436 438 437 439 int rc; -
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r76553 r78120 1012 1012 1013 1013 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed, 1014 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process )1014 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 1015 1015 { 1016 1016 /* … … 1021 1021 if (uAlignment != PAGE_SIZE) 1022 1022 return VERR_NOT_SUPPORTED; 1023 AssertMsgReturn(!offSub && !cbSub, ("%#zx %#zx\n", offSub, cbSub), VERR_NOT_SUPPORTED); /** @todo implement sub maps */ 1023 1024 1024 1025 /*
Note:
See TracChangeset
for help on using the changeset viewer.