Changeset 91479 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Sep 29, 2021 11:43:57 PM (3 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r91478 r91479 1104 1104 1105 1105 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 1106 unsigned fProt, size_t offSub, size_t cbSub )1106 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 1107 1107 { 1108 1108 RT_NOREF(fProt); … … 1200 1200 */ 1201 1201 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING, 1202 pv, cbSub ? cbSub : pMemToMap->cb, NULL);1202 pv, cbSub ? cbSub : pMemToMap->cb, pszTag); 1203 1203 if (pMemDarwin) 1204 1204 { … … 1238 1238 1239 1239 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 1240 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )1240 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 1241 1241 { 1242 1242 RT_NOREF(fProt); … … 1292 1292 */ 1293 1293 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING, 1294 pv, cbSub ? cbSub : pMemToMap->cb, NULL);1294 pv, cbSub ? cbSub : pMemToMap->cb, pszTag); 1295 1295 if (pMemDarwin) 1296 1296 { -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r91478 r91479 647 647 648 648 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 649 unsigned fProt, size_t offSub, size_t cbSub )649 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 650 650 { 651 651 // AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); … … 693 693 if (rc == KERN_SUCCESS) 694 694 { 695 rc = vm_map_wire(kernel_map, Addr, Addr + cbSub, VM_MAP_WIRE_SYSTEM |VM_MAP_WIRE_NOHOLES);695 rc = vm_map_wire(kernel_map, Addr, Addr + cbSub, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); 696 696 AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); 697 697 698 698 PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), RTR0MEMOBJTYPE_MAPPING, 699 (void *)Addr, cbSub, NULL);699 (void *)Addr, cbSub, pszTag); 700 700 if (pMemFreeBSD) 701 701 { … … 716 716 717 717 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 718 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )718 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 719 719 { 720 720 /* … … 785 785 */ 786 786 PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), RTR0MEMOBJTYPE_MAPPING, 787 (void *)AddrR3, pMemToMap->cb, NULL);787 (void *)AddrR3, pMemToMap->cb, pszTag); 788 788 if (pMemFreeBSD) 789 789 { -
trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
r91478 r91479 406 406 407 407 int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 408 unsigned fProt, size_t offSub, size_t cbSub )408 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 409 409 { 410 410 PRTR0MEMOBJHAIKU pMemToMapHaiku = (PRTR0MEMOBJHAIKU)pMemToMap; … … 465 465 /* Create the object. */ 466 466 pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), RTR0MEMOBJTYPE_MAPPING, pvMap, 467 pMemToMapHaiku->Core.cb, NULL);467 pMemToMapHaiku->Core.cb, pszTag); 468 468 if (RT_UNLIKELY(!pMemHaiku)) 469 469 return VERR_NO_MEMORY; … … 485 485 486 486 int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 487 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )487 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 488 488 { 489 489 #if 0 … … 573 573 * Create a mapping object for it. 574 574 */ 575 PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), 576 RTR0MEMOBJTYPE_MAPPING, 577 (void *)AddrR3, 578 pMemToMap->cb); 575 PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), RTR0MEMOBJTYPE_MAPPING, 576 (void *)AddrR3, pMemToMap->cb, pszTag); 579 577 if (pMemHaiku) 580 578 { … … 588 586 AssertMsg(rc == KERN_SUCCESS, ("Deleting mapping failed\n")); 589 587 } 588 #else 589 RT_NOREF(ppMem, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag); 590 590 #endif 591 591 return VERR_NOT_SUPPORTED; -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r91478 r91479 1541 1541 1542 1542 1543 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, 1544 void *pvFixed, size_t uAlignment, 1545 unsigned fProt, size_t offSub, size_t cbSub) 1543 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 1544 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 1546 1545 { 1547 1546 int rc = VERR_NO_MEMORY; … … 1560 1559 if (!cbSub) 1561 1560 cbSub = pMemLnxToMap->Core.cb - offSub; 1562 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, NULL);1561 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, pszTag); 1563 1562 if (pMemLnx) 1564 1563 { … … 1694 1693 1695 1694 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 1696 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )1695 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 1697 1696 { 1698 1697 struct task_struct *pTask = rtR0ProcessToLinuxTask(R0Process); … … 1734 1733 if (cbSub == 0) 1735 1734 cbSub = pMemLnxToMap->Core.cb; 1736 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, NULL);1735 pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, pszTag); 1737 1736 if (pMemLnx) 1738 1737 { -
trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
r91478 r91479 746 746 RT_ASSERT_PREEMPTIBLE(); 747 747 748 RT_NOREF_PV(pszTag);749 750 748 /* adjust the request to simplify the native code. */ 751 749 if (offSub == 0 && cbSub == pMemToMap->cb) … … 753 751 754 752 /* do the mapping. */ 755 rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt, offSub, cbSub );753 rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt, offSub, cbSub, pszTag); 756 754 if (RT_SUCCESS(rc)) 757 755 { … … 815 813 RT_ASSERT_PREEMPTIBLE(); 816 814 817 RT_NOREF_PV(pszTag);818 819 815 /* adjust the request to simplify the native code. */ 820 816 if (offSub == 0 && cbSub == pMemToMap->cb) … … 822 818 823 819 /* do the mapping. */ 824 rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub );820 rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag); 825 821 if (RT_SUCCESS(rc)) 826 822 { -
trunk/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c
r91478 r91479 440 440 441 441 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 442 unsigned fProt, size_t offSub, size_t cbSub )442 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 443 443 { 444 444 if (pvFixed != (void *)-1) … … 458 458 size_t sz = cbSub > 0 ? cbSub : pMemNetBSD0->Core.cb; 459 459 460 PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), RTR0MEMOBJTYPE_MAPPING, NULL, sz, NULL);460 PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), RTR0MEMOBJTYPE_MAPPING, NULL, sz, pszTag); 461 461 462 462 vaddr_t virt = uvm_km_alloc(kernel_map, sz, uAlignment, … … 502 502 503 503 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 504 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 505 { 504 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 505 { 506 RT_NOREF(ppMem, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag); 506 507 printf("NativeMapUser\n"); 507 508 return VERR_NOT_SUPPORTED; -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r91478 r91479 917 917 * we're to map everything. Non-zero if @a offSub is 918 918 * non-zero. 919 * @param pszTag Allocation tag used for statistics and such. 919 920 */ 920 921 static int rtR0MemObjNtMap(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 921 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )922 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 922 923 { 923 924 int rc = VERR_MAP_FAILED; … … 1002 1003 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew( !offSub && !cbSub 1003 1004 ? sizeof(*pMemNt) : RT_UOFFSETOF_DYN(RTR0MEMOBJNT, apMdls[1]), 1004 RTR0MEMOBJTYPE_MAPPING, pv, pMemNtToMap->Core.cb, NULL);1005 RTR0MEMOBJTYPE_MAPPING, pv, pMemNtToMap->Core.cb, pszTag); 1005 1006 if (pMemNt) 1006 1007 { … … 1057 1058 { 1058 1059 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_MAPPING, pv, 1059 pMemNtToMap->Core.cb, NULL);1060 pMemNtToMap->Core.cb, pszTag); 1060 1061 if (pMemNt) 1061 1062 { … … 1076 1077 1077 1078 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 1078 unsigned fProt, size_t offSub, size_t cbSub )1079 { 1080 return rtR0MemObjNtMap(ppMem, pMemToMap, pvFixed, uAlignment, fProt, NIL_RTR0PROCESS, offSub, cbSub );1079 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 1080 { 1081 return rtR0MemObjNtMap(ppMem, pMemToMap, pvFixed, uAlignment, fProt, NIL_RTR0PROCESS, offSub, cbSub, pszTag); 1081 1082 } 1082 1083 1083 1084 1084 1085 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 1085 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )1086 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 1086 1087 { 1087 1088 AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_NOT_SUPPORTED); 1088 return rtR0MemObjNtMap(ppMem, pMemToMap, (void *)R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub );1089 return rtR0MemObjNtMap(ppMem, pMemToMap, (void *)R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag); 1089 1090 } 1090 1091 -
trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
r91478 r91479 353 353 354 354 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 355 unsigned fProt, size_t offSub, size_t cbSub )355 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 356 356 { 357 357 AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); … … 423 423 cbSub = pMemToMapOs2->Core.cb - offSub; 424 424 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING, 425 (uint8_t *)pvR0 + offSub, cbSub, NULL);425 (uint8_t *)pvR0 + offSub, cbSub, pszTag); 426 426 if (pMemOs2) 427 427 { … … 435 435 436 436 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, 437 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub )437 unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag) 438 438 { 439 439 AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED); … … 513 513 */ 514 514 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING, 515 pvR3, pMemToMapOs2->Core.cb, NULL);515 pvR3, pMemToMapOs2->Core.cb, pszTag); 516 516 if (pMemOs2) 517 517 { -
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r91478 r91479 954 954 955 955 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, 956 unsigned fProt, size_t offSub, size_t cbSub )956 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 957 957 { 958 958 /* Fail if requested to do something we can't. */ … … 1002 1002 * Create a memory object for the mapping. 1003 1003 */ 1004 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, cbSub, NULL); 1004 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, 1005 pv, cbSub, pszTag); 1005 1006 if (pMemSolaris) 1006 1007 { … … 1022 1023 1023 1024 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed, 1024 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) 1025 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, 1026 const char *pszTag) 1025 1027 { 1026 1028 /* … … 1046 1048 */ 1047 1049 PRTR0MEMOBJSOL pMemSolaris; 1048 pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pb, cb, NULL);1050 pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pb, cb, pszTag); 1049 1051 if (RT_UNLIKELY(!pMemSolaris)) 1050 1052 return VERR_NO_MEMORY;
Note:
See TracChangeset
for help on using the changeset viewer.