VirtualBox

Changeset 90330 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jul 26, 2021 12:50:05 PM (4 years ago)
Author:
vboxsync
Message:

Drv*: Access PDMCritSect API via PDMDrvHlp. bugref:10074

Location:
trunk/src/VBox/Devices/Network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r90103 r90330  
    292292DECLINLINE(int) drvIntNetProcessXmit(PDRVINTNET pThis)
    293293{
    294     Assert(PDMCritSectIsOwner(&pThis->XmitLock));
     294    Assert(PDMDrvHlpCritSectIsOwner(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock));
    295295
    296296#ifdef IN_RING3
     
    325325#endif
    326326
    327     int rc = PDMCritSectTryEnter(&pThis->XmitLock);
     327    int rc = PDMDrvHlpCritSectTryEnter(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock);
    328328    if (RT_SUCCESS(rc))
    329329    {
     
    367367    int         rc    = VINF_SUCCESS;
    368368    Assert(cbMin < UINT32_MAX / 2);
    369     Assert(PDMCritSectIsOwner(&pThis->XmitLock));
     369    Assert(PDMDrvHlpCritSectIsOwner(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock));
    370370
    371371    /*
     
    468468    Assert(   pHdr->u8Type == INTNETHDR_TYPE_FRAME
    469469           || pHdr->u8Type == INTNETHDR_TYPE_GSO);
    470     Assert(PDMCritSectIsOwner(&pThis->XmitLock));
     470    Assert(PDMDrvHlpCritSectIsOwner(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock));
    471471
    472472    /** @todo LATER: try unalloc the frame. */
     
    495495    Assert(pSgBuf->fFlags == (PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1));
    496496    Assert(pSgBuf->cbUsed <= pSgBuf->cbAvailable);
    497     Assert(PDMCritSectIsOwner(&pThis->XmitLock));
     497    Assert(PDMDrvHlpCritSectIsOwner(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock));
    498498
    499499    if (pSgBuf->pvUser)
     
    528528    PDRVINTNET pThis = RT_FROM_MEMBER(pInterface, DRVINTNET, CTX_SUFF(INetworkUp));
    529529    ASMAtomicUoWriteBool(&pThis->fXmitOnXmitThread, false);
    530     PDMCritSectLeave(&pThis->XmitLock);
     530    PDMDrvHlpCritSectLeave(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock);
    531531}
    532532
     
    606606        {
    607607            STAM_REL_COUNTER_INC(&pThis->StatXmitProcessRing);
    608             PDMCritSectEnter(&pThis->XmitLock, VERR_IGNORED);
     608            PDMDrvHlpCritSectEnter(pDrvIns, &pThis->XmitLock, VERR_IGNORED);
    609609            drvIntNetProcessXmit(pThis);
    610             PDMCritSectLeave(&pThis->XmitLock);
     610            PDMDrvHlpCritSectLeave(pDrvIns, &pThis->XmitLock);
    611611        }
    612612
     
    616616        {
    617617            STAM_REL_COUNTER_INC(&pThis->StatXmitProcessRing);
    618             PDMCritSectEnter(&pThis->XmitLock, VERR_IGNORED);
     618            PDMDrvHlpCritSectEnter(pDrvIns, &pThis->XmitLock, VERR_IGNORED);
    619619            drvIntNetProcessXmit(pThis);
    620             PDMCritSectLeave(&pThis->XmitLock);
     620            PDMDrvHlpCritSectLeave(pDrvIns, &pThis->XmitLock);
    621621        }
    622622
     
    12731273    pThis->hSgCache = NIL_RTMEMCACHE;
    12741274
    1275     if (PDMCritSectIsInitialized(&pThis->XmitLock))
    1276         PDMR3CritSectDelete(&pThis->XmitLock);
     1275    if (PDMDrvHlpCritSectIsInitialized(pDrvIns, &pThis->XmitLock))
     1276        PDMDrvHlpCritSectDelete(pDrvIns, &pThis->XmitLock);
    12771277}
    12781278
  • trunk/src/VBox/Devices/Network/DrvNetShaper.cpp

    r82968 r90330  
    108108    if (RT_UNLIKELY(!pThis->CTX_SUFF(pIBelowNet)))
    109109    {
    110         int rc = PDMCritSectTryEnter(&pThis->XmitLock);
     110        int rc = PDMDrvHlpCritSectTryEnter(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock);
    111111        if (RT_UNLIKELY(rc == VERR_SEM_BUSY))
    112112            rc = VERR_TRY_AGAIN;
     
    179179        pThis->CTX_SUFF(pIBelowNet)->pfnEndXmit(pThis->CTX_SUFF(pIBelowNet));
    180180    else
    181         PDMCritSectLeave(&pThis->XmitLock);
     181        PDMDrvHlpCritSectLeave(pThis->CTX_SUFF(pDrvIns), &pThis->XmitLock);
    182182}
    183183
     
    343343
    344344    LogFlow(("drvNetShaperDetach: pDrvIns: %p, fFlags: %u\n", pDrvIns, fFlags));
    345     PDMCritSectEnter(&pThis->XmitLock, VERR_IGNORED);
     345    PDMDrvHlpCritSectEnter(pDrvIns, &pThis->XmitLock, VERR_IGNORED);
    346346    pThis->pIBelowNetR3 = NULL;
    347347    pThis->pIBelowNetR0 = NIL_RTR0PTR;
    348     PDMCritSectLeave(&pThis->XmitLock);
     348    PDMDrvHlpCritSectLeave(pDrvIns, &pThis->XmitLock);
    349349}
    350350
     
    357357    PDRVNETSHAPER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSHAPER);
    358358    LogFlow(("drvNetShaperAttach/#%#x: fFlags=%#x\n", pDrvIns->iInstance, fFlags));
    359     PDMCritSectEnter(&pThis->XmitLock, VERR_IGNORED);
     359    PDMDrvHlpCritSectEnter(pDrvIns, &pThis->XmitLock, VERR_IGNORED);
    360360
    361361    /*
     
    389389        AssertMsgFailed(("Failed to attach to driver below! rc=%Rrc\n", rc));
    390390
    391     PDMCritSectLeave(&pThis->XmitLock);
     391    PDMDrvHlpCritSectLeave(pDrvIns, &pThis->XmitLock);
    392392    return VINF_SUCCESS;
    393393}
     
    404404    PDMDrvHlpNetShaperDetach(pDrvIns, &pThis->Filter);
    405405
    406     if (PDMCritSectIsInitialized(&pThis->XmitLock))
    407         PDMR3CritSectDelete(&pThis->XmitLock);
     406    if (PDMDrvHlpCritSectIsInitialized(pDrvIns, &pThis->XmitLock))
     407        PDMDrvHlpCritSectDelete(pDrvIns, &pThis->XmitLock);
    408408}
    409409
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