VirtualBox

Changeset 91479 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Sep 29, 2021 11:43:57 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/memobj: Passing pszTag around...

Location:
trunk/src/VBox/Runtime/r0drv
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp

    r91478 r91479  
    11041104
    11051105DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    1106                                           unsigned fProt, size_t offSub, size_t cbSub)
     1106                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    11071107{
    11081108    RT_NOREF(fProt);
     
    12001200                         */
    12011201                        PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING,
    1202                                                                                         pv, cbSub ? cbSub : pMemToMap->cb, NULL);
     1202                                                                                        pv, cbSub ? cbSub : pMemToMap->cb, pszTag);
    12031203                        if (pMemDarwin)
    12041204                        {
     
    12381238
    12391239DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    1240                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     1240                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    12411241{
    12421242    RT_NOREF(fProt);
     
    12921292                 */
    12931293                PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), RTR0MEMOBJTYPE_MAPPING,
    1294                                                                                 pv, cbSub ? cbSub : pMemToMap->cb, NULL);
     1294                                                                                pv, cbSub ? cbSub : pMemToMap->cb, pszTag);
    12951295                if (pMemDarwin)
    12961296                {
  • trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

    r91478 r91479  
    647647
    648648DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    649                                           unsigned fProt, size_t offSub, size_t cbSub)
     649                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    650650{
    651651//  AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED);
     
    693693    if (rc == KERN_SUCCESS)
    694694    {
    695         rc = vm_map_wire(kernel_map, Addr, Addr + cbSub, VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES);
     695        rc = vm_map_wire(kernel_map, Addr, Addr + cbSub, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES);
    696696        AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc));
    697697
    698698        PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), RTR0MEMOBJTYPE_MAPPING,
    699                                                                            (void *)Addr, cbSub, NULL);
     699                                                                           (void *)Addr, cbSub, pszTag);
    700700        if (pMemFreeBSD)
    701701        {
     
    716716
    717717DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    718                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     718                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    719719{
    720720    /*
     
    785785         */
    786786        PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), RTR0MEMOBJTYPE_MAPPING,
    787                                                                            (void *)AddrR3, pMemToMap->cb, NULL);
     787                                                                           (void *)AddrR3, pMemToMap->cb, pszTag);
    788788        if (pMemFreeBSD)
    789789        {
  • trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c

    r91478 r91479  
    406406
    407407int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    408                               unsigned fProt, size_t offSub, size_t cbSub)
     408                              unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    409409{
    410410    PRTR0MEMOBJHAIKU pMemToMapHaiku = (PRTR0MEMOBJHAIKU)pMemToMap;
     
    465465        /* Create the object. */
    466466        pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), RTR0MEMOBJTYPE_MAPPING, pvMap,
    467                                                     pMemToMapHaiku->Core.cb, NULL);
     467                                                    pMemToMapHaiku->Core.cb, pszTag);
    468468        if (RT_UNLIKELY(!pMemHaiku))
    469469            return VERR_NO_MEMORY;
     
    485485
    486486int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    487                             unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     487                            unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    488488{
    489489#if 0
     
    573573         * Create a mapping object for it.
    574574         */
    575         PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU),
    576                                                                      RTR0MEMOBJTYPE_MAPPING,
    577                                                                      (void *)AddrR3,
    578                                                                      pMemToMap->cb);
     575        PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), RTR0MEMOBJTYPE_MAPPING,
     576                                                                     (void *)AddrR3, pMemToMap->cb, pszTag);
    579577        if (pMemHaiku)
    580578        {
     
    588586        AssertMsg(rc == KERN_SUCCESS, ("Deleting mapping failed\n"));
    589587    }
     588#else
     589    RT_NOREF(ppMem, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag);
    590590#endif
    591591    return VERR_NOT_SUPPORTED;
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r91478 r91479  
    15411541
    15421542
    1543 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap,
    1544                                           void *pvFixed, size_t uAlignment,
    1545                                           unsigned fProt, size_t offSub, size_t cbSub)
     1543DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
     1544                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    15461545{
    15471546    int rc = VERR_NO_MEMORY;
     
    15601559    if (!cbSub)
    15611560        cbSub = pMemLnxToMap->Core.cb - offSub;
    1562     pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, NULL);
     1561    pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, pszTag);
    15631562    if (pMemLnx)
    15641563    {
     
    16941693
    16951694DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    1696                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     1695                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    16971696{
    16981697    struct task_struct *pTask        = rtR0ProcessToLinuxTask(R0Process);
     
    17341733    if (cbSub == 0)
    17351734        cbSub = pMemLnxToMap->Core.cb;
    1736     pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, NULL);
     1735    pMemLnx = (PRTR0MEMOBJLNX)rtR0MemObjNew(sizeof(*pMemLnx), RTR0MEMOBJTYPE_MAPPING, NULL, cbSub, pszTag);
    17371736    if (pMemLnx)
    17381737    {
  • trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp

    r91478 r91479  
    746746    RT_ASSERT_PREEMPTIBLE();
    747747
    748     RT_NOREF_PV(pszTag);
    749 
    750748    /* adjust the request to simplify the native code. */
    751749    if (offSub == 0 && cbSub == pMemToMap->cb)
     
    753751
    754752    /* do the mapping. */
    755     rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt, offSub, cbSub);
     753    rc = rtR0MemObjNativeMapKernel(&pNew, pMemToMap, pvFixed, uAlignment, fProt, offSub, cbSub, pszTag);
    756754    if (RT_SUCCESS(rc))
    757755    {
     
    815813    RT_ASSERT_PREEMPTIBLE();
    816814
    817     RT_NOREF_PV(pszTag);
    818 
    819815    /* adjust the request to simplify the native code. */
    820816    if (offSub == 0 && cbSub == pMemToMap->cb)
     
    822818
    823819    /* do the mapping. */
    824     rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub);
     820    rc = rtR0MemObjNativeMapUser(&pNew, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag);
    825821    if (RT_SUCCESS(rc))
    826822    {
  • trunk/src/VBox/Runtime/r0drv/netbsd/memobj-r0drv-netbsd.c

    r91478 r91479  
    440440
    441441DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    442                                           unsigned fProt, size_t offSub, size_t cbSub)
     442                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    443443{
    444444    if (pvFixed != (void *)-1)
     
    458458    size_t sz = cbSub > 0 ? cbSub : pMemNetBSD0->Core.cb;
    459459
    460     PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), RTR0MEMOBJTYPE_MAPPING, NULL, sz, NULL);
     460    PRTR0MEMOBJNETBSD pMemNetBSD = (PRTR0MEMOBJNETBSD)rtR0MemObjNew(sizeof(*pMemNetBSD), RTR0MEMOBJTYPE_MAPPING, NULL, sz, pszTag);
    461461
    462462    vaddr_t virt = uvm_km_alloc(kernel_map, sz, uAlignment,
     
    502502
    503503DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    504                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
    505 {
     504                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
     505{
     506    RT_NOREF(ppMem, pMemToMap, R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag);
    506507    printf("NativeMapUser\n");
    507508    return VERR_NOT_SUPPORTED;
  • trunk/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp

    r91478 r91479  
    917917 *                      we're to map everything. Non-zero if @a offSub is
    918918 *                      non-zero.
     919 * @param   pszTag      Allocation tag used for statistics and such.
    919920 */
    920921static int rtR0MemObjNtMap(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    921                            unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     922                           unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    922923{
    923924    int rc = VERR_MAP_FAILED;
     
    10021003                PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(  !offSub && !cbSub
    10031004                                                                    ? sizeof(*pMemNt) : RT_UOFFSETOF_DYN(RTR0MEMOBJNT, apMdls[1]),
    1004                                                                     RTR0MEMOBJTYPE_MAPPING, pv, pMemNtToMap->Core.cb, NULL);
     1005                                                                    RTR0MEMOBJTYPE_MAPPING, pv, pMemNtToMap->Core.cb, pszTag);
    10051006                if (pMemNt)
    10061007                {
     
    10571058        {
    10581059            PRTR0MEMOBJNT pMemNt = (PRTR0MEMOBJNT)rtR0MemObjNew(sizeof(*pMemNt), RTR0MEMOBJTYPE_MAPPING, pv,
    1059                                                                 pMemNtToMap->Core.cb, NULL);
     1060                                                                pMemNtToMap->Core.cb, pszTag);
    10601061            if (pMemNt)
    10611062            {
     
    10761077
    10771078DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    1078                                           unsigned fProt, size_t offSub, size_t cbSub)
    1079 {
    1080     return rtR0MemObjNtMap(ppMem, pMemToMap, pvFixed, uAlignment, fProt, NIL_RTR0PROCESS, offSub, cbSub);
     1079                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
     1080{
     1081    return rtR0MemObjNtMap(ppMem, pMemToMap, pvFixed, uAlignment, fProt, NIL_RTR0PROCESS, offSub, cbSub, pszTag);
    10811082}
    10821083
    10831084
    10841085DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    1085                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     1086                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    10861087{
    10871088    AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_NOT_SUPPORTED);
    1088     return rtR0MemObjNtMap(ppMem, pMemToMap, (void *)R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub);
     1089    return rtR0MemObjNtMap(ppMem, pMemToMap, (void *)R3PtrFixed, uAlignment, fProt, R0Process, offSub, cbSub, pszTag);
    10891090}
    10901091
  • trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp

    r91478 r91479  
    353353
    354354DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    355                                           unsigned fProt, size_t offSub, size_t cbSub)
     355                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    356356{
    357357    AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED);
     
    423423        cbSub = pMemToMapOs2->Core.cb - offSub;
    424424    PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING,
    425                                                            (uint8_t *)pvR0 + offSub, cbSub, NULL);
     425                                                           (uint8_t *)pvR0 + offSub, cbSub, pszTag);
    426426    if (pMemOs2)
    427427    {
     
    435435
    436436DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
    437                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     437                                        unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub, const char *pszTag)
    438438{
    439439    AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED);
     
    513513     */
    514514    PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_UOFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING,
    515                                                            pvR3, pMemToMapOs2->Core.cb, NULL);
     515                                                           pvR3, pMemToMapOs2->Core.cb, pszTag);
    516516    if (pMemOs2)
    517517    {
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r91478 r91479  
    954954
    955955DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
    956                                           unsigned fProt, size_t offSub, size_t cbSub)
     956                                          unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
    957957{
    958958    /* Fail if requested to do something we can't. */
     
    10021002         * Create a memory object for the mapping.
    10031003         */
    1004         PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, cbSub, NULL);
     1004        PRTR0MEMOBJSOL pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING,
     1005                                                                   pv, cbSub, pszTag);
    10051006        if (pMemSolaris)
    10061007        {
     
    10221023
    10231024DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed,
    1024                                         size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
     1025                                        size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub,
     1026                                        const char *pszTag)
    10251027{
    10261028    /*
     
    10461048     */
    10471049    PRTR0MEMOBJSOL pMemSolaris;
    1048     pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pb, cb, NULL);
     1050    pMemSolaris = (PRTR0MEMOBJSOL)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pb, cb, pszTag);
    10491051    if (RT_UNLIKELY(!pMemSolaris))
    10501052        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