diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-09-30 00:06:31 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-09-30 00:06:31 +0000 |
commit | 05f57cb334f80a002818b41c9304e2bd4e1d1fdd (patch) | |
tree | 9e1fdb0356f55c892a2fd8303e078a890c74e9cc | |
parent | ed9881db55f8103c93ceac7dfd9aa8c1cc48731c (diff) | |
download | VirtualBox-svn-05f57cb334f80a002818b41c9304e2bd4e1d1fdd.tar.gz |
IPRT/memobj: Passing pszTag around...
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@91481 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r-- | src/VBox/Runtime/include/internal/memobj.h | 7 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp | 32 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c | 18 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c | 28 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c | 57 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/memobj-r0drv.cpp | 14 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c | 15 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp | 11 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp | 12 | ||||
-rw-r--r-- | src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c | 11 |
10 files changed, 108 insertions, 97 deletions
diff --git a/src/VBox/Runtime/include/internal/memobj.h b/src/VBox/Runtime/include/internal/memobj.h index fea8fcf6d33..42395900a9d 100644 --- a/src/VBox/Runtime/include/internal/memobj.h +++ b/src/VBox/Runtime/include/internal/memobj.h @@ -382,8 +382,10 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, * NIL_RTHCPHYS if any address is acceptable. * @param uAlignment The alignment of the reserved memory. * Supported values are PAGE_SIZE, _2M, _4M and _1G. + * @param pszTag Allocation tag used for statistics and such. */ -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment); +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag); /** * Allocates non-contiguous page aligned physical memory without (necessarily) any kernel mapping. @@ -395,8 +397,9 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, * @param cb Number of bytes to allocate, page aligned. * @param PhysHighest The highest permitable address (inclusive). * NIL_RTHCPHYS if any address is acceptable. + * @param pszTag Allocation tag used for statistics and such. */ -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest); +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag); /** * Creates a page aligned, contiguous, physical memory object. diff --git a/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp index d6b6d60b798..2aca2a43652 100644 --- a/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp +++ b/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp @@ -97,6 +97,7 @@ typedef struct RTR0MEMOBJDARWINALLOCARGS uint64_t MaxPhysAddr; RTR0MEMOBJTYPE enmType; size_t uAlignment; + const char *pszTag; } RTR0MEMOBJDARWINALLOCARGS; /** @@ -554,12 +555,13 @@ static void rtR0MemObjDarwinSignalThreadWaitinOnTask(RTR0MEMOBJDARWINTHREADARGS * UINT64_MAX if it doesn't matter. * @param enmType The object type. * @param uAlignment The allocation alignment (in bytes). + * @param pszTag Allocation tag used for statistics and such. * @param fOnKernelThread Set if we're already on the kernel thread. */ static int rtR0MemObjNativeAllocWorker(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, bool fContiguous, mach_vm_address_t PhysMask, uint64_t MaxPhysAddr, - RTR0MEMOBJTYPE enmType, size_t uAlignment, bool fOnKernelThread) + RTR0MEMOBJTYPE enmType, size_t uAlignment, const char *pszTag, bool fOnKernelThread) { int rc; @@ -590,6 +592,7 @@ static int rtR0MemObjNativeAllocWorker(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, Args.MaxPhysAddr = MaxPhysAddr; Args.enmType = enmType; Args.uAlignment = uAlignment; + Args.pszTag = pszTag; return rtR0MemObjDarwinDoInKernelTaskThread(rtR0MemObjNativeAllockWorkerOnKernelThread, &Args.Core); } @@ -737,7 +740,7 @@ static int rtR0MemObjNativeAllocWorker(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, /* * Create the IPRT memory object. */ - PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, NULL); + PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, pszTag); if (pMemDarwin) { if (fContiguous) @@ -820,7 +823,8 @@ static void rtR0MemObjNativeAllockWorkerOnKernelThread(void *pvUser0, void *pvUs AssertPtr(pvUser0); Assert(pvUser1 == NULL); NOREF(pvUser1); RTR0MEMOBJDARWINALLOCARGS volatile *pArgs = (RTR0MEMOBJDARWINALLOCARGS volatile *)pvUser0; int rc = rtR0MemObjNativeAllocWorker(pArgs->ppMem, pArgs->cb, pArgs->fExecutable, pArgs->fContiguous, pArgs->PhysMask, - pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, true /*fOnKernelThread*/); + pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, pArgs->pszTag, + true /*fOnKernelThread*/); rtR0MemObjDarwinSignalThreadWaitinOnTask(&pArgs->Core, rc); } @@ -830,7 +834,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, IPRT_DARWIN_SAVE_EFL_AC(); int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, UINT64_MAX, - RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, false /*fOnKernelThread*/); + RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, NULL, false /*fOnKernelThread*/); IPRT_DARWIN_RESTORE_EFL_AC(); return rc; @@ -856,10 +860,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, * (See bug comment in the worker and IOBufferMemoryDescriptor::initWithPhysicalMask.) */ int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, ~(uint32_t)PAGE_OFFSET_MASK, - _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/); + _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); if (rc == VERR_ADDRESS_TOO_BIG) rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, - _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/); + _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); IPRT_DARWIN_RESTORE_EFL_AC(); return rc; @@ -872,7 +876,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, true /* fContiguous */, ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, - RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/); + RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); /* * Workaround for bogus IOKernelAllocateContiguous behavior, just in case. @@ -881,13 +885,14 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, if (RT_FAILURE(rc) && cb <= PAGE_SIZE) rc = rtR0MemObjNativeAllocWorker(ppMem, cb + PAGE_SIZE, fExecutable, true /* fContiguous */, ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, - RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/); + RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); IPRT_DARWIN_RESTORE_EFL_AC(); return rc; } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { if (uAlignment != PAGE_SIZE) { @@ -905,7 +910,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, if (PhysHighest == NIL_RTHCPHYS) rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, uAlignment <= PAGE_SIZE ? 0 : ~(mach_vm_address_t)(uAlignment - 1) /* PhysMask*/, - UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/); + UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); else { mach_vm_address_t PhysMask = 0; @@ -916,7 +921,8 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, PhysMask &= ~(mach_vm_address_t)(uAlignment - 1); rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, - PhysMask, PhysHighest, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/); + PhysMask, PhysHighest, + RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); } IPRT_DARWIN_RESTORE_EFL_AC(); @@ -924,14 +930,14 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { /** @todo rtR0MemObjNativeAllocPhys / darwin. * This might be a bit problematic and may very well require having to create our own * object which we populate with pages but without mapping it into any address space. * Estimate is 2-3 days. */ - RT_NOREF(ppMem, cb, PhysHighest); + RT_NOREF(ppMem, cb, PhysHighest, pszTag); return VERR_NOT_SUPPORTED; } diff --git a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c index 1a0bf37656e..c910ddc6b30 100644 --- a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c +++ b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c @@ -423,16 +423,14 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, - size_t cb, - RTHCPHYS PhysHighest, size_t uAlignment, - bool fContiguous, int rcNoMem) +static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb, RTHCPHYS PhysHighest, + size_t uAlignment, bool fContiguous, int rcNoMem, const char *pszTag) { uint32_t cPages = atop(cb); vm_paddr_t VmPhysAddrHigh; /* create the object. */ - PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb, NULL); + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb, pszTag); if (!pMemFreeBSD) return VERR_NO_MEMORY; @@ -468,15 +466,17 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOB } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { - return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, VERR_NO_MEMORY); + return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, VERR_NO_MEMORY, pszTag); } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { - return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, VERR_NO_PHYS_MEMORY); + return rtR0MemObjFreeBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, + VERR_NO_PHYS_MEMORY, pszTag); } diff --git a/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c index 044919ffa76..fb676c104e2 100644 --- a/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c +++ b/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c @@ -151,8 +151,8 @@ int rtR0MemObjNativeFree(RTR0MEMOBJ pMem) } -static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, - bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment) +static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTR0MEMOBJTYPE enmType, + RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) { NOREF(fExecutable); @@ -161,10 +161,10 @@ static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, const char *pszName = NULL; uint32 addressSpec = B_ANY_KERNEL_ADDRESS; uint32 fLock = ~0U; - LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb, - fExecutable ? "true" : "false", type, PhysHighest,(unsigned)uAlignment)); + LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, enmType=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb, + fExecutable ? "true" : "false", enmType, PhysHighest,(unsigned)uAlignment)); - switch (type) + switch (enmType) { case RTR0MEMOBJTYPE_PAGE: pszName = "IPRT R0MemObj Alloc"; @@ -203,7 +203,7 @@ static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, /* Create the object. */ PRTR0MEMOBJHAIKU pMemHaiku; - pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), type, NULL, cb, NULL); + pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), enmType, NULL, cb, pszTag); if (RT_UNLIKELY(!pMemHaiku)) return VERR_NO_MEMORY; @@ -212,7 +212,7 @@ static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, { physical_entry physMap[2]; pMemHaiku->Core.pv = pvMap; /* store start address */ - switch (type) + switch (enmType) { case RTR0MEMOBJTYPE_CONT: rc = get_memory_map(pvMap, cb, physMap, 2); @@ -249,7 +249,7 @@ static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, int rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { - return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_PAGE, 0 /* PhysHighest */, 0 /* uAlignment */); + return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_PAGE, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); } @@ -262,24 +262,24 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLarge(PPRTR0MEMOBJINTERNAL ppMem, size_t cb int rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { - return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_LOW, 0 /* PhysHighest */, 0 /* uAlignment */); + return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_LOW, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); } int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { - return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_CONT, 0 /* PhysHighest */, 0 /* uAlignment */); + return rtR0MemObjNativeAllocArea(ppMem, cb, fExecutable, RTR0MEMOBJTYPE_CONT, 0 /* PhysHighest */, 0 /* uAlignment */, NULL); } -int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) { - return rtR0MemObjNativeAllocArea(ppMem, cb, false, RTR0MEMOBJTYPE_PHYS, PhysHighest, uAlignment); + return rtR0MemObjNativeAllocArea(ppMem, cb, false, RTR0MEMOBJTYPE_PHYS, PhysHighest, uAlignment, pszTag); } -int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { - return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE); + return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE, pszTag); } diff --git a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c index ffd78126064..7b4a666a566 100644 --- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c @@ -334,9 +334,11 @@ static void rtR0MemObjLinuxDoMunmap(void *pv, size_t cb, struct task_struct *pTa * @param fContiguous Whether the allocation must be contiguous. * @param fExecutable Whether the memory must be executable. * @param rcNoMem What to return when we're out of pages. + * @param pszTag Allocation tag used for statistics and such. */ static int rtR0MemObjLinuxAllocPages(PRTR0MEMOBJLNX *ppMemLnx, RTR0MEMOBJTYPE enmType, size_t cb, - size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, bool fExecutable, int rcNoMem) + size_t uAlignment, gfp_t fFlagsLnx, bool fContiguous, bool fExecutable, int rcNoMem, + const char *pszTag) { size_t iPage; size_t const cPages = cb >> PAGE_SHIFT; @@ -347,7 +349,7 @@ static int rtR0MemObjLinuxAllocPages(PRTR0MEMOBJLNX *ppMemLnx, RTR0MEMOBJTYPE en * the page pointer array. */ PRTR0MEMOBJLNX pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(RT_UOFFSETOF_DYN(RTR0MEMOBJLNX, apPages[cPages]), enmType, - NULL, cb, NULL); + NULL, cb, pszTag); if (!pMemLnx) return VERR_NO_MEMORY; pMemLnx->cPages = cPages; @@ -805,10 +807,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, #if RTLNX_VER_MIN(2,4,22) rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_HIGHUSER, - false /* non-contiguous */, fExecutable, VERR_NO_MEMORY); + false /* non-contiguous */, fExecutable, VERR_NO_MEMORY, NULL); #else rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_USER, - false /* non-contiguous */, fExecutable, VERR_NO_MEMORY); + false /* non-contiguous */, fExecutable, VERR_NO_MEMORY, NULL); #endif if (RT_SUCCESS(rc)) { @@ -846,19 +848,19 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) /* ZONE_DMA32: 0-4GB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA32, - false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY); + false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); if (RT_FAILURE(rc)) #endif #ifdef RT_ARCH_AMD64 /* ZONE_DMA: 0-16MB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_DMA, - false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY); + false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); #else # ifdef CONFIG_X86_PAE # endif /* ZONE_NORMAL: 0-896MB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_LOW, cb, PAGE_SIZE, GFP_USER, - false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY); + false /* non-contiguous */, fExecutable, VERR_NO_LOW_MEMORY, NULL); #endif if (RT_SUCCESS(rc)) { @@ -888,17 +890,17 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) /* ZONE_DMA32: 0-4GB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA32, - true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY); + true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); if (RT_FAILURE(rc)) #endif #ifdef RT_ARCH_AMD64 /* ZONE_DMA: 0-16MB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_DMA, - true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY); + true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); #else /* ZONE_NORMAL (32-bit hosts): 0-896MB */ rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_CONT, cb, PAGE_SIZE, GFP_USER, - true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY); + true /* contiguous */, fExecutable, VERR_NO_CONT_MEMORY, NULL); #endif if (RT_SUCCESS(rc)) { @@ -935,17 +937,16 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, * @param uAlignment The alignment of the physical memory. * Only valid for fContiguous == true, ignored otherwise. * @param PhysHighest See rtR0MemObjNativeAllocPhys. + * @param pszTag Allocation tag used for statistics and such. * @param fGfp The Linux GFP flags to use for the allocation. */ static int rtR0MemObjLinuxAllocPhysSub2(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, - size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, gfp_t fGfp) + size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, const char *pszTag, gfp_t fGfp) { PRTR0MEMOBJLNX pMemLnx; - int rc; - - rc = rtR0MemObjLinuxAllocPages(&pMemLnx, enmType, cb, uAlignment, fGfp, - enmType == RTR0MEMOBJTYPE_PHYS /* contiguous / non-contiguous */, - false /*fExecutable*/, VERR_NO_PHYS_MEMORY); + int rc = rtR0MemObjLinuxAllocPages(&pMemLnx, enmType, cb, uAlignment, fGfp, + enmType == RTR0MEMOBJTYPE_PHYS /* contiguous / non-contiguous */, + false /*fExecutable*/, VERR_NO_PHYS_MEMORY, pszTag); if (RT_FAILURE(rc)) return rc; @@ -987,9 +988,10 @@ static int rtR0MemObjLinuxAllocPhysSub2(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTY * @param uAlignment The alignment of the physical memory. * Only valid for enmType == RTR0MEMOBJTYPE_PHYS, ignored otherwise. * @param PhysHighest See rtR0MemObjNativeAllocPhys. + * @param pszTag Allocation tag used for statistics and such. */ static int rtR0MemObjLinuxAllocPhysSub(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, - size_t cb, size_t uAlignment, RTHCPHYS PhysHighest) + size_t cb, size_t uAlignment, RTHCPHYS PhysHighest, const char *pszTag) { int rc; IPRT_LINUX_SAVE_EFL_AC(); @@ -1006,27 +1008,27 @@ static int rtR0MemObjLinuxAllocPhysSub(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYP */ if (PhysHighest == NIL_RTHCPHYS) /* ZONE_HIGHMEM: the whole physical memory */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_HIGHUSER); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_HIGHUSER); else if (PhysHighest <= _1M * 16) /* ZONE_DMA: 0-16MB */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA); else { rc = VERR_NO_MEMORY; if (RT_FAILURE(rc)) /* ZONE_HIGHMEM: the whole physical memory */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_HIGHUSER); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_HIGHUSER); if (RT_FAILURE(rc)) /* ZONE_NORMAL: 0-896MB */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_USER); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_USER); #ifdef GFP_DMA32 if (RT_FAILURE(rc)) /* ZONE_DMA32: 0-4GB */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA32); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA32); #endif if (RT_FAILURE(rc)) /* ZONE_DMA: 0-16MB */ - rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, GFP_DMA); + rc = rtR0MemObjLinuxAllocPhysSub2(ppMem, enmType, cb, uAlignment, PhysHighest, pszTag, GFP_DMA); } IPRT_LINUX_RESTORE_EFL_AC(); return rc; @@ -1143,15 +1145,16 @@ RTDECL(struct page *) rtR0MemObjLinuxVirtToPage(void *pv) RT_EXPORT_SYMBOL(rtR0MemObjLinuxVirtToPage); -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { - return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS, cb, uAlignment, PhysHighest); + return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS, cb, uAlignment, PhysHighest, pszTag); } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { - return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PAGE_SIZE, PhysHighest); + return rtR0MemObjLinuxAllocPhysSub(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PAGE_SIZE, PhysHighest, pszTag); } diff --git a/src/VBox/Runtime/r0drv/memobj-r0drv.cpp b/src/VBox/Runtime/r0drv/memobj-r0drv.cpp index 205f8488900..006ca81d063 100644 --- a/src/VBox/Runtime/r0drv/memobj-r0drv.cpp +++ b/src/VBox/Runtime/r0drv/memobj-r0drv.cpp @@ -478,7 +478,7 @@ DECLHIDDEN(int) rtR0MemObjFallbackAllocLarge(PPRTR0MEMOBJINTERNAL ppMem, size_t { RT_NOREF(pszTag, fFlags); if (cb == cbLargePage) - return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage); + return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage, pszTag); return VERR_NOT_SUPPORTED; } @@ -576,10 +576,8 @@ RTR0DECL(int) RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS Ph AssertReturn(PhysHighest >= cb, VERR_INVALID_PARAMETER); RT_ASSERT_PREEMPTIBLE(); - RT_NOREF_PV(pszTag); - /* do the allocation. */ - return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */); + return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */, pszTag); } RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysTag); @@ -608,10 +606,8 @@ RTR0DECL(int) RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS #endif RT_ASSERT_PREEMPTIBLE(); - RT_NOREF_PV(pszTag); - /* do the allocation. */ - return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment); + return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment, pszTag); } RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysExTag); @@ -627,10 +623,8 @@ RTR0DECL(int) RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS AssertReturn(PhysHighest >= cb, VERR_INVALID_PARAMETER); RT_ASSERT_PREEMPTIBLE(); - RT_NOREF_PV(pszTag); - /* do the allocation. */ - return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest); + return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest, pszTag); } RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysNCTag); diff --git a/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c b/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c index 9b10683fa1e..e12bd3c305a 100644 --- a/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c +++ b/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c @@ -297,15 +297,13 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, - size_t cb, - RTHCPHYS PhysHighest, size_t uAlignment, - bool fContiguous) +static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb, + RTHCPHYS PhysHighest, size_t uAlignment, bool fContiguous, const char *pszTag) { paddr_t VmPhysAddrHigh; /* create the object. */ - PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), enmType, NULL, cb, NULL); + PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), enmType, NULL, cb, pszTag); if (!pMemNetBSD) return VERR_NO_MEMORY; @@ -336,15 +334,16 @@ static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { - return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true); + return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS, cb, PhysHighest, uAlignment, true, pszTag); } DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) { - return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false); + return rtR0MemObjNetBSDAllocPhysPages(ppMem, RTR0MEMOBJTYPE_PHYS_NC, cb, PhysHighest, PAGE_SIZE, false, pszTag); } diff --git a/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp index ff8914a5943..2abde335c70 100644 --- a/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp +++ b/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp @@ -625,7 +625,8 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { /* * Try and see if we're lucky and get a contiguous chunk from MmAllocatePagesForMdl. @@ -662,7 +663,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, break; if (iPage >= cPages) { - PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL); + PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag); if (pMemNt) { pMemNt->Core.u.Phys.fAllocated = true; @@ -684,10 +685,12 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { if (g_pfnrtMmAllocatePagesForMdl && g_pfnrtMmFreePagesFromMdl) { + /** @todo use the Ex version with the fail-if-not-all-requested-pages flag + * when possible. */ PHYSICAL_ADDRESS Zero; Zero.QuadPart = 0; PHYSICAL_ADDRESS HighAddr; @@ -697,7 +700,7 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t c { if (MmGetMdlByteCount(pMdl) >= cb) { - PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, NULL); + PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, pszTag); if (pMemNt) { pMemNt->fAllocatedPagesForMdl = true; diff --git a/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp index 80516bfeb9f..b23e94459ee 100644 --- a/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp +++ b/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp @@ -227,7 +227,8 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED); @@ -236,7 +237,8 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, return VERR_NOT_SUPPORTED; /* create the object. */ - PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL); + PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, + NULL, cb, pszTag); if (!pMemOs2) return VERR_NO_MEMORY; @@ -256,10 +258,10 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { - /** @todo rtR0MemObjNativeAllocPhys / darwin. */ - return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE); + /** @todo rtR0MemObjNativeAllocPhysNC / os2. */ + return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE, pszTag); } diff --git a/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c index 161b7b3d6c4..23c511d23fb 100644 --- a/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c +++ b/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c @@ -704,14 +704,14 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { NOREF(fExecutable); - return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */); + return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */, NULL); } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { #if HC_ARCH_BITS == 64 - PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, NULL); + PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb, pszTag); if (RT_UNLIKELY(!pMemSolaris)) return VERR_NO_MEMORY; @@ -764,11 +764,12 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t c } -DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) +DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, + const char *pszTag) { AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED); - PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL); + PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag); if (RT_UNLIKELY(!pMemSolaris)) return VERR_NO_MEMORY; |