VirtualBox

Changeset 91481 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 30, 2021 12:06:31 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/memobj: Passing pszTag around...

Location:
trunk/src/VBox/Runtime
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/memobj.h

    r91480 r91481  
    383383 * @param   uAlignment      The alignment of the reserved memory.
    384384 *                          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 */
     387DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment,
     388                                          const char *pszTag);
    387389
    388390/**
     
    396398 * @param   PhysHighest     The highest permitable address (inclusive).
    397399 *                          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 */
     402DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag);
    400403
    401404/**
  • trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp

    r91480 r91481  
    9898    RTR0MEMOBJTYPE          enmType;
    9999    size_t                  uAlignment;
     100    const char             *pszTag;
    100101} RTR0MEMOBJDARWINALLOCARGS;
    101102
     
    555556 * @param   enmType         The object type.
    556557 * @param   uAlignment      The allocation alignment (in bytes).
     558 * @param   pszTag          Allocation tag used for statistics and such.
    557559 * @param   fOnKernelThread Set if we're already on the kernel thread.
    558560 */
     
    560562                                       bool fExecutable, bool fContiguous,
    561563                                       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)
    563565{
    564566    int rc;
     
    591593        Args.enmType        = enmType;
    592594        Args.uAlignment     = uAlignment;
     595        Args.pszTag         = pszTag;
    593596        return rtR0MemObjDarwinDoInKernelTaskThread(rtR0MemObjNativeAllockWorkerOnKernelThread, &Args.Core);
    594597    }
     
    738741                 * Create the IPRT memory object.
    739742                 */
    740                 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, NULL);
     743                PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, pszTag);
    741744                if (pMemDarwin)
    742745                {
     
    821824    RTR0MEMOBJDARWINALLOCARGS volatile *pArgs = (RTR0MEMOBJDARWINALLOCARGS volatile *)pvUser0;
    822825    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*/);
    824828    rtR0MemObjDarwinSignalThreadWaitinOnTask(&pArgs->Core, rc);
    825829}
     
    831835
    832836    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*/);
    834838
    835839    IPRT_DARWIN_RESTORE_EFL_AC();
     
    857861     */
    858862    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*/);
    860864    if (rc == VERR_ADDRESS_TOO_BIG)
    861865        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*/);
    863867
    864868    IPRT_DARWIN_RESTORE_EFL_AC();
     
    873877    int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, true /* fContiguous */,
    874878                                         ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE,
    875                                          RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);
     879                                         RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/);
    876880
    877881    /*
     
    882886        rc = rtR0MemObjNativeAllocWorker(ppMem, cb + PAGE_SIZE, fExecutable, true /* fContiguous */,
    883887                                         ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE,
    884                                          RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);
     888                                         RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/);
    885889    IPRT_DARWIN_RESTORE_EFL_AC();
    886890    return rc;
     
    888892
    889893
    890 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
     894DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment,
     895                                          const char *pszTag)
    891896{
    892897    if (uAlignment != PAGE_SIZE)
     
    906911        rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */,
    907912                                         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*/);
    909914    else
    910915    {
     
    917922
    918923        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*/);
    920926    }
    921927
     
    925931
    926932
    927 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
     933DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
    928934{
    929935    /** @todo rtR0MemObjNativeAllocPhys / darwin.
     
    932938     * Estimate is 2-3 days.
    933939     */
    934     RT_NOREF(ppMem, cb, PhysHighest);
     940    RT_NOREF(ppMem, cb, PhysHighest, pszTag);
    935941    return VERR_NOT_SUPPORTED;
    936942}
  • trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

    r91480 r91481  
    424424
    425425
    426 static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType,
    427                                            size_t cb,
    428                                            RTHCPHYS PhysHighest, size_t uAlignment,
    429                                            bool fContiguous, int rcNoMem)
     426static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb,  RTHCPHYS PhysHighest,
     427                                           size_t uAlignment, bool fContiguous, int rcNoMem, const char *pszTag)
    430428{
    431429    uint32_t   cPages = atop(cb);
     
    433431
    434432    /* 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);
    436434    if (!pMemFreeBSD)
    437435        return VERR_NO_MEMORY;
     
    469467
    470468
    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);
     469DECLHIDDEN(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
     476DECLHIDDEN(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);
    480480}
    481481
  • trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c

    r91480 r91481  
    152152
    153153
    154 static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb,
    155                                      bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment)
     154static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, RTR0MEMOBJTYPE enmType,
     155                                     RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag)
    156156{
    157157    NOREF(fExecutable);
     
    162162    uint32 addressSpec  = B_ANY_KERNEL_ADDRESS;
    163163    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)
    168168    {
    169169        case RTR0MEMOBJTYPE_PAGE:
     
    204204    /* Create the object. */
    205205    PRTR0MEMOBJHAIKU pMemHaiku;
    206     pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), type, NULL, cb, NULL);
     206    pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), enmType, NULL, cb, pszTag);
    207207    if (RT_UNLIKELY(!pMemHaiku))
    208208        return VERR_NO_MEMORY;
     
    213213        physical_entry physMap[2];
    214214        pMemHaiku->Core.pv = pvMap;   /* store start address */
    215         switch (type)
     215        switch (enmType)
    216216        {
    217217            case RTR0MEMOBJTYPE_CONT:
     
    250250int rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
    251251{
    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);
    253253}
    254254
     
    263263int rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
    264264{
    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);
    266266}
    267267
     
    269269int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
    270270{
    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
     274int 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
     280int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
     281{
     282    return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE, pszTag);
    283283}
    284284
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r91480 r91481  
    335335 * @param   fExecutable Whether the memory must be executable.
    336336 * @param   rcNoMem     What to return when we're out of pages.
     337 * @param   pszTag      Allocation tag used for statistics and such.
    337338 */
    338339static 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)
    340342{
    341343    size_t          iPage;
     
    348350     */
    349351    PRTR0MEMOBJLNX  pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(RT_UOFFSETOF_DYN(RTR0MEMOBJLNX, apPages[cPages]), enmType,
    350                                                             NULL, cb, NULL);
     352                                                            NULL, cb, pszTag);
    351353    if (!pMemLnx)
    352354        return VERR_NO_MEMORY;
     
    806808#if RTLNX_VER_MIN(2,4,22)
    807809    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);
    809811#else
    810812    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);
    812814#endif
    813815    if (RT_SUCCESS(rc))
     
    847849    /* ZONE_DMA32: 0-4GB */
    848850    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);
    850852    if (RT_FAILURE(rc))
    851853#endif
     
    853855        /* ZONE_DMA: 0-16MB */
    854856        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);
    856858#else
    857859# ifdef CONFIG_X86_PAE
     
    859861        /* ZONE_NORMAL: 0-896MB */
    860862        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);
    862864#endif
    863865    if (RT_SUCCESS(rc))
     
    889891    /* ZONE_DMA32: 0-4GB */
    890892    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);
    892894    if (RT_FAILURE(rc))
    893895#endif
     
    895897        /* ZONE_DMA: 0-16MB */
    896898        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);
    898900#else
    899901        /* ZONE_NORMAL (32-bit hosts): 0-896MB */
    900902        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);
    902904#endif
    903905    if (RT_SUCCESS(rc))
     
    936938 *                      Only valid for fContiguous == true, ignored otherwise.
    937939 * @param   PhysHighest See rtR0MemObjNativeAllocPhys.
     940 * @param   pszTag      Allocation tag used for statistics and such.
    938941 * @param   fGfp        The Linux GFP flags to use for the allocation.
    939942 */
    940943static 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)
    942945{
    943946    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);
    949950    if (RT_FAILURE(rc))
    950951        return rc;
     
    988989 *                      Only valid for enmType == RTR0MEMOBJTYPE_PHYS, ignored otherwise.
    989990 * @param   PhysHighest See rtR0MemObjNativeAllocPhys.
     991 * @param   pszTag      Allocation tag used for statistics and such.
    990992 */
    991993static 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)
    993995{
    994996    int rc;
     
    10071009    if (PhysHighest == NIL_RTHCPHYS)
    10081010        /* 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);
    10101012    else if (PhysHighest <= _1M * 16)
    10111013        /* 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);
    10131015    else
    10141016    {
     
    10161018        if (RT_FAILURE(rc))
    10171019            /* 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);
    10191021        if (RT_FAILURE(rc))
    10201022            /* 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);
    10221024#ifdef GFP_DMA32
    10231025        if (RT_FAILURE(rc))
    10241026            /* 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);
    10261028#endif
    10271029        if (RT_FAILURE(rc))
    10281030            /* 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);
    10301032    }
    10311033    IPRT_LINUX_RESTORE_EFL_AC();
     
    11441146
    11451147
    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);
     1148DECLHIDDEN(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
     1155DECLHIDDEN(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);
    11551158}
    11561159
  • trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp

    r91480 r91481  
    479479    RT_NOREF(pszTag, fFlags);
    480480    if (cb == cbLargePage)
    481         return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage);
     481        return rtR0MemObjNativeAllocPhys(ppMem, cb, NIL_RTHCPHYS, cbLargePage, pszTag);
    482482    return VERR_NOT_SUPPORTED;
    483483}
     
    577577    RT_ASSERT_PREEMPTIBLE();
    578578
    579     RT_NOREF_PV(pszTag);
    580 
    581579    /* do the allocation. */
    582     return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */);
     580    return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, PAGE_SIZE /* page aligned */, pszTag);
    583581}
    584582RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysTag);
     
    609607    RT_ASSERT_PREEMPTIBLE();
    610608
    611     RT_NOREF_PV(pszTag);
    612 
    613609    /* do the allocation. */
    614     return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment);
     610    return rtR0MemObjNativeAllocPhys(pMemObj, cbAligned, PhysHighest, uAlignment, pszTag);
    615611}
    616612RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysExTag);
     
    628624    RT_ASSERT_PREEMPTIBLE();
    629625
    630     RT_NOREF_PV(pszTag);
    631 
    632626    /* do the allocation. */
    633     return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest);
     627    return rtR0MemObjNativeAllocPhysNC(pMemObj, cbAligned, PhysHighest, pszTag);
    634628}
    635629RT_EXPORT_SYMBOL(RTR0MemObjAllocPhysNCTag);
  • trunk/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c

    r91480 r91481  
    298298
    299299
    300 static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType,
    301                                            size_t cb,
    302                                            RTHCPHYS PhysHighest, size_t uAlignment,
    303                                            bool fContiguous)
     300static int rtR0MemObjNetBSDAllocPhysPages(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJTYPE enmType, size_t cb,
     301                                          RTHCPHYS PhysHighest, size_t uAlignment, bool fContiguous, const char *pszTag)
    304302{
    305303    paddr_t VmPhysAddrHigh;
    306304
    307305    /* 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);
    309307    if (!pMemNetBSD)
    310308        return VERR_NO_MEMORY;
     
    337335
    338336
    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);
     337DECLHIDDEN(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);
    342341}
    343342
     
    345344DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
    346345{
    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);
    348347}
    349348
  • trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp

    r91480 r91481  
    626626
    627627
    628 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
     628DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment,
     629                                          const char *pszTag)
    629630{
    630631    /*
     
    663664                if (iPage >= cPages)
    664665                {
    665                     PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL);
     666                    PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag);
    666667                    if (pMemNt)
    667668                    {
     
    685686
    686687
    687 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
     688DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
    688689{
    689690    if (g_pfnrtMmAllocatePagesForMdl && g_pfnrtMmFreePagesFromMdl)
    690691    {
     692        /** @todo use the Ex version with the fail-if-not-all-requested-pages flag
     693         *        when possible. */
    691694        PHYSICAL_ADDRESS Zero;
    692695        Zero.QuadPart = 0;
     
    698701            if (MmGetMdlByteCount(pMdl) >= cb)
    699702            {
    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);
    701704                if (pMemNt)
    702705                {
  • trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp

    r91480 r91481  
    228228
    229229
    230 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
     230DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment,
     231                                          const char *pszTag)
    231232{
    232233    AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED);
     
    237238
    238239    /* 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);
    240242    if (!pMemOs2)
    241243        return VERR_NO_MEMORY;
     
    257259
    258260
    259 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
    260 {
    261     /** @todo rtR0MemObjNativeAllocPhys / darwin. */
    262     return rtR0MemObjNativeAllocPhys(ppMem, cb, PhysHighest, PAGE_SIZE);
     261DECLHIDDEN(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);
    263265}
    264266
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r91480 r91481  
    705705{
    706706    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
     711DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
    712712{
    713713#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);
    715715    if (RT_UNLIKELY(!pMemSolaris))
    716716        return VERR_NO_MEMORY;
     
    765765
    766766
    767 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
     767DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment,
     768                                          const char *pszTag)
    768769{
    769770    AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_SUPPORTED);
    770771
    771     PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, NULL);
     772    PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb, pszTag);
    772773    if (RT_UNLIKELY(!pMemSolaris))
    773774        return VERR_NO_MEMORY;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette