Changeset 91481 in vbox for trunk/src/VBox
- Timestamp:
- Sep 30, 2021 12:06:31 AM (3 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/memobj.h
r91480 r91481 383 383 * @param uAlignment The alignment of the reserved memory. 384 384 * Supported values are PAGE_SIZE, _2M, _4M and _1G. 385 */ 386 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment); 385 * @param pszTag Allocation tag used for statistics and such. 386 */ 387 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 388 const char *pszTag); 387 389 388 390 /** … … 396 398 * @param PhysHighest The highest permitable address (inclusive). 397 399 * NIL_RTHCPHYS if any address is acceptable. 398 */ 399 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest); 400 * @param pszTag Allocation tag used for statistics and such. 401 */ 402 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag); 400 403 401 404 /** -
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r91480 r91481 98 98 RTR0MEMOBJTYPE enmType; 99 99 size_t uAlignment; 100 const char *pszTag; 100 101 } RTR0MEMOBJDARWINALLOCARGS; 101 102 … … 555 556 * @param enmType The object type. 556 557 * @param uAlignment The allocation alignment (in bytes). 558 * @param pszTag Allocation tag used for statistics and such. 557 559 * @param fOnKernelThread Set if we're already on the kernel thread. 558 560 */ … … 560 562 bool fExecutable, bool fContiguous, 561 563 mach_vm_address_t PhysMask, uint64_t MaxPhysAddr, 562 RTR0MEMOBJTYPE enmType, size_t uAlignment, bool fOnKernelThread)564 RTR0MEMOBJTYPE enmType, size_t uAlignment, const char *pszTag, bool fOnKernelThread) 563 565 { 564 566 int rc; … … 591 593 Args.enmType = enmType; 592 594 Args.uAlignment = uAlignment; 595 Args.pszTag = pszTag; 593 596 return rtR0MemObjDarwinDoInKernelTaskThread(rtR0MemObjNativeAllockWorkerOnKernelThread, &Args.Core); 594 597 } … … 738 741 * Create the IPRT memory object. 739 742 */ 740 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, NULL);743 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, pszTag); 741 744 if (pMemDarwin) 742 745 { … … 821 824 RTR0MEMOBJDARWINALLOCARGS volatile *pArgs = (RTR0MEMOBJDARWINALLOCARGS volatile *)pvUser0; 822 825 int rc = rtR0MemObjNativeAllocWorker(pArgs->ppMem, pArgs->cb, pArgs->fExecutable, pArgs->fContiguous, pArgs->PhysMask, 823 pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, true /*fOnKernelThread*/); 826 pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, pArgs->pszTag, 827 true /*fOnKernelThread*/); 824 828 rtR0MemObjDarwinSignalThreadWaitinOnTask(&pArgs->Core, rc); 825 829 } … … 831 835 832 836 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, UINT64_MAX, 833 RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, false /*fOnKernelThread*/);837 RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 834 838 835 839 IPRT_DARWIN_RESTORE_EFL_AC(); … … 857 861 */ 858 862 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, ~(uint32_t)PAGE_OFFSET_MASK, 859 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/);863 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 860 864 if (rc == VERR_ADDRESS_TOO_BIG) 861 865 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, 862 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/);866 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 863 867 864 868 IPRT_DARWIN_RESTORE_EFL_AC(); … … 873 877 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, true /* fContiguous */, 874 878 ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, 875 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);879 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 876 880 877 881 /* … … 882 886 rc = rtR0MemObjNativeAllocWorker(ppMem, cb + PAGE_SIZE, fExecutable, true /* fContiguous */, 883 887 ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, 884 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);888 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 885 889 IPRT_DARWIN_RESTORE_EFL_AC(); 886 890 return rc; … … 888 892 889 893 890 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 894 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 895 const char *pszTag) 891 896 { 892 897 if (uAlignment != PAGE_SIZE) … … 906 911 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, 907 912 uAlignment <= PAGE_SIZE ? 0 : ~(mach_vm_address_t)(uAlignment - 1) /* PhysMask*/, 908 UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/);913 UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); 909 914 else 910 915 { … … 917 922 918 923 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, 919 PhysMask, PhysHighest, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/); 924 PhysMask, PhysHighest, 925 RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); 920 926 } 921 927 … … 925 931 926 932 927 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )933 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 928 934 { 929 935 /** @todo rtR0MemObjNativeAllocPhys / darwin. … … 932 938 * Estimate is 2-3 days. 933 939 */ 934 RT_NOREF(ppMem, cb, PhysHighest );940 RT_NOREF(ppMem, cb, PhysHighest, pszTag); 935 941 return VERR_NOT_SUPPORTED; 936 942 } -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r91480 r91481 424 424 425 425 426 static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, 427 size_t cb, 428 RTHCPHYS PhysHighest, size_t uAlignment, 429 bool fContiguous, int rcNoMem) 426 static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb, RTHCPHYS PhysHighest, 427 size_t uAlignment, bool fContiguous, int rcNoMem, const char *pszTag) 430 428 { 431 429 uint32_t cPages = atop(cb); … … 433 431 434 432 /* create the object. */ 435 PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb, NULL);433 PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb, pszTag); 436 434 if (!pMemFreeBSD) 437 435 return VERR_NO_MEMORY; … … 469 467 470 468 471 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 472 { 473 return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, VERR_NO_MEMORY); 474 } 475 476 477 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) 478 { 479 return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, VERR_NO_PHYS_MEMORY); 469 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 470 const char *pszTag) 471 { 472 return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, VERR_NO_MEMORY, pszTag); 473 } 474 475 476 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 477 { 478 return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, 479 VERR_NO_PHYS_MEMORY, pszTag); 480 480 } 481 481 -
trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
r91480 r91481 152 152 153 153 154 static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, 155 bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment)154 static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTR0MEMOBJTYPE enmType, 155 RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) 156 156 { 157 157 NOREF(fExecutable); … … 162 162 uint32 addressSpec = B_ANY_KERNEL_ADDRESS; 163 163 uint32 fLock = ~0U; 164 LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb,165 fExecutable ? "true" : "false", type, PhysHighest,(unsigned)uAlignment));166 167 switch ( type)164 LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, enmType=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb, 165 fExecutable ? "true" : "false", enmType, PhysHighest,(unsigned)uAlignment)); 166 167 switch (enmType) 168 168 { 169 169 case RTR0MEMOBJTYPE_PAGE: … … 204 204 /* Create the object. */ 205 205 PRTR0MEMOBJHAIKU pMemHaiku; 206 pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), type, NULL, cb, NULL);206 pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), enmType, NULL, cb, pszTag); 207 207 if (RT_UNLIKELY(!pMemHaiku)) 208 208 return VERR_NO_MEMORY; … … 213 213 physical_entry physMap[2]; 214 214 pMemHaiku->Core.pv = pvMap; /* store start address */ 215 switch ( type)215 switch (enmType) 216 216 { 217 217 case RTR0MEMOBJTYPE_CONT: … … 250 250 int rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) 251 251 { 252 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_PAGE, 0 /* PhysHighest */, 0 /* uAlignment */ );252 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_PAGE, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); 253 253 } 254 254 … … 263 263 int rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) 264 264 { 265 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_LOW, 0 /* PhysHighest */, 0 /* uAlignment */ );265 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_LOW, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); 266 266 } 267 267 … … 269 269 int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) 270 270 { 271 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_CONT, 0 /* PhysHighest */, 0 /* uAlignment */ );272 } 273 274 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment )275 { 276 return rtR0MemObjNativeAllocArea(ppMem, cb, false, RTR0MEMOBJTYPE_PHYS, PhysHighest, uAlignment );277 } 278 279 280 int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )281 { 282 return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE );271 return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_CONT, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); 272 } 273 274 int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) 275 { 276 return rtR0MemObjNativeAllocArea(ppMem, cb, false, RTR0MEMOBJTYPE_PHYS, PhysHighest, uAlignment, pszTag); 277 } 278 279 280 int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 281 { 282 return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE, pszTag); 283 283 } 284 284 -
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r91480 r91481 335 335 * @param fExecutable Whether the memory must be executable. 336 336 * @param rcNoMem What to return when we're out of pages. 337 * @param pszTag Allocation tag used for statistics and such. 337 338 */ 338 339 static int rtR0MemObjLinuxAllocPages(PRTR0MEMOBJLNX *ppMemLnx, RTR0MEMOBJTYPE enmType, size_t cb, 339 size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, bool fExecutable, int rcNoMem) 340 size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, bool fExecutable, int rcNoMem, 341 const char *pszTag) 340 342 { 341 343 size_t iPage; … … 348 350 */ 349 351 PRTR0MEMOBJLNX pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(RT_UOFFSETOF_DYN(RTR0MEMOBJLNX, apPages[cPages]), enmType, 350 NULL, cb, NULL);352 NULL, cb, pszTag); 351 353 if (!pMemLnx) 352 354 return VERR_NO_MEMORY; … … 806 808 #if RTLNX_VER_MIN(2,4,22) 807 809 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_HIGHUSER, 808 false /* non-contiguous */, fExecutable, VERR_NO_MEMORY );810 false /* non-contiguous */, fExecutable, VERR_NO_MEMORY, NULL); 809 811 #else 810 812 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_USER, 811 false /* non-contiguous */, fExecutable, VERR_NO_MEMORY );813 false /* non-contiguous */, fExecutable, VERR_NO_MEMORY, NULL); 812 814 #endif 813 815 if (RT_SUCCESS(rc)) … … 847 849 /* ZONE_DMA32: 0-4GB */ 848 850 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA32, 849 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY );851 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); 850 852 if (RT_FAILURE(rc)) 851 853 #endif … … 853 855 /* ZONE_DMA: 0-16MB */ 854 856 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA, 855 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY );857 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); 856 858 #else 857 859 # ifdef CONFIG_X86_PAE … … 859 861 /* ZONE_NORMAL: 0-896MB */ 860 862 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_USER, 861 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY );863 false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); 862 864 #endif 863 865 if (RT_SUCCESS(rc)) … … 889 891 /* ZONE_DMA32: 0-4GB */ 890 892 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA32, 891 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY );893 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); 892 894 if (RT_FAILURE(rc)) 893 895 #endif … … 895 897 /* ZONE_DMA: 0-16MB */ 896 898 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA, 897 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY );899 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); 898 900 #else 899 901 /* ZONE_NORMAL (32-bit hosts): 0-896MB */ 900 902 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_USER, 901 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY );903 true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); 902 904 #endif 903 905 if (RT_SUCCESS(rc)) … … 936 938 * Only valid for fContiguous == true, ignored otherwise. 937 939 * @param PhysHighest See rtR0MemObjNativeAllocPhys. 940 * @param pszTag Allocation tag used for statistics and such. 938 941 * @param fGfp The Linux GFP flags to use for the allocation. 939 942 */ 940 943 static int rtR0MemObjLinuxAllocPhysSub2(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, 941 size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, gfp_t fGfp)944 size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, const char *pszTag, gfp_t fGfp) 942 945 { 943 946 PRTR0MEMOBJLNX pMemLnx; 944 int rc; 945 946 rc = rtR0MemObjLinuxAllocPages(&pMemLnx, enmType, cb, uAlignment, fGfp, 947 enmType == RTR0MEMOBJTYPE_PHYS /* contiguous / non-contiguous */, 948 false /*fExecutable*/, VERR_NO_PHYS_MEMORY); 947 int rc = rtR0MemObjLinuxAllocPages(&pMemLnx, enmType, cb, uAlignment, fGfp, 948 enmType == RTR0MEMOBJTYPE_PHYS /* contiguous / non-contiguous */, 949 false /*fExecutable*/, VERR_NO_PHYS_MEMORY, pszTag); 949 950 if (RT_FAILURE(rc)) 950 951 return rc; … … 988 989 * Only valid for enmType == RTR0MEMOBJTYPE_PHYS, ignored otherwise. 989 990 * @param PhysHighest See rtR0MemObjNativeAllocPhys. 991 * @param pszTag Allocation tag used for statistics and such. 990 992 */ 991 993 static int rtR0MemObjLinuxAllocPhysSub(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, 992 size_t cb, size_t uAlignment, RTHCPHYS PhysHighest )994 size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, const char *pszTag) 993 995 { 994 996 int rc; … … 1007 1009 if (PhysHighest == NIL_RTHCPHYS) 1008 1010 /* ZONE_HIGHMEM: the whole physical memory */ 1009 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_HIGHUSER);1011 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_HIGHUSER); 1010 1012 else if (PhysHighest <= _1M * 16) 1011 1013 /* ZONE_DMA: 0-16MB */ 1012 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA);1014 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA); 1013 1015 else 1014 1016 { … … 1016 1018 if (RT_FAILURE(rc)) 1017 1019 /* ZONE_HIGHMEM: the whole physical memory */ 1018 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_HIGHUSER);1020 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_HIGHUSER); 1019 1021 if (RT_FAILURE(rc)) 1020 1022 /* ZONE_NORMAL: 0-896MB */ 1021 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_USER);1023 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_USER); 1022 1024 #ifdef GFP_DMA32 1023 1025 if (RT_FAILURE(rc)) 1024 1026 /* ZONE_DMA32: 0-4GB */ 1025 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA32);1027 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA32); 1026 1028 #endif 1027 1029 if (RT_FAILURE(rc)) 1028 1030 /* ZONE_DMA: 0-16MB */ 1029 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA);1031 rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA); 1030 1032 } 1031 1033 IPRT_LINUX_RESTORE_EFL_AC(); … … 1144 1146 1145 1147 1146 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 1147 { 1148 return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS, cb, uAlignment, PhysHighest); 1149 } 1150 1151 1152 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) 1153 { 1154 return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PAGE_SIZE, PhysHighest); 1148 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 1149 const char *pszTag) 1150 { 1151 return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS, cb, uAlignment, PhysHighest, pszTag); 1152 } 1153 1154 1155 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 1156 { 1157 return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PAGE_SIZE, PhysHighest, pszTag); 1155 1158 } 1156 1159 -
trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
r91480 r91481 479 479 RT_NOREF(pszTag, fFlags); 480 480 if (cb == cbLargePage) 481 return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage );481 return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage, pszTag); 482 482 return VERR_NOT_SUPPORTED; 483 483 } … … 577 577 RT_ASSERT_PREEMPTIBLE(); 578 578 579 RT_NOREF_PV(pszTag);580 581 579 /* do the allocation. */ 582 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */ );580 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */, pszTag); 583 581 } 584 582 RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysTag); … … 609 607 RT_ASSERT_PREEMPTIBLE(); 610 608 611 RT_NOREF_PV(pszTag);612 613 609 /* do the allocation. */ 614 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment );610 return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment, pszTag); 615 611 } 616 612 RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysExTag); … … 628 624 RT_ASSERT_PREEMPTIBLE(); 629 625 630 RT_NOREF_PV(pszTag);631 632 626 /* do the allocation. */ 633 return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest );627 return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest, pszTag); 634 628 } 635 629 RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysNCTag); -
trunk/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c
r91480 r91481 298 298 299 299 300 static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, 301 size_t cb, 302 RTHCPHYS PhysHighest, size_t uAlignment, 303 bool fContiguous) 300 static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb, 301 RTHCPHYS PhysHighest, size_t uAlignment, bool fContiguous, const char *pszTag) 304 302 { 305 303 paddr_t VmPhysAddrHigh; 306 304 307 305 /* create the object. */ 308 PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), enmType, NULL, cb, NULL);306 PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), enmType, NULL, cb, pszTag); 309 307 if (!pMemNetBSD) 310 308 return VERR_NO_MEMORY; … … 337 335 338 336 339 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 340 { 341 return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true); 337 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 338 const char *pszTag) 339 { 340 return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, pszTag); 342 341 } 343 342 … … 345 344 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) 346 345 { 347 return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false );346 return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, pszTag); 348 347 } 349 348 -
trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
r91480 r91481 626 626 627 627 628 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 628 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 629 const char *pszTag) 629 630 { 630 631 /* … … 663 664 if (iPage >= cPages) 664 665 { 665 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL);666 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag); 666 667 if (pMemNt) 667 668 { … … 685 686 686 687 687 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )688 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 688 689 { 689 690 if (g_pfnrtMmAllocatePagesForMdl && g_pfnrtMmFreePagesFromMdl) 690 691 { 692 /** @todo use the Ex version with the fail-if-not-all-requested-pages flag 693 * when possible. */ 691 694 PHYSICAL_ADDRESS Zero; 692 695 Zero.QuadPart = 0; … … 698 701 if (MmGetMdlByteCount(pMdl) >= cb) 699 702 { 700 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, NULL);703 PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, pszTag); 701 704 if (pMemNt) 702 705 { -
trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
r91480 r91481 228 228 229 229 230 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 230 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 231 const char *pszTag) 231 232 { 232 233 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED); … … 237 238 238 239 /* create the object. */ 239 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL); 240 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, 241 NULL, cb, pszTag); 240 242 if (!pMemOs2) 241 243 return VERR_NO_MEMORY; … … 257 259 258 260 259 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )260 { 261 /** @todo rtR0MemObjNativeAllocPhys / darwin. */262 return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE );261 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 262 { 263 /** @todo rtR0MemObjNativeAllocPhysNC / os2. */ 264 return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE, pszTag); 263 265 } 264 266 -
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r91480 r91481 705 705 { 706 706 NOREF(fExecutable); 707 return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */ );708 } 709 710 711 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )707 return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */, NULL); 708 } 709 710 711 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 712 712 { 713 713 #if HC_ARCH_BITS == 64 714 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, NULL);714 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, pszTag); 715 715 if (RT_UNLIKELY(!pMemSolaris)) 716 716 return VERR_NO_MEMORY; … … 765 765 766 766 767 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 767 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 768 const char *pszTag) 768 769 { 769 770 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED); 770 771 771 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL);772 PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag); 772 773 if (RT_UNLIKELY(!pMemSolaris)) 773 774 return VERR_NO_MEMORY;
Note:
See TracChangeset
for help on using the changeset viewer.