VirtualBox

Changeset 82147 in vbox for trunk/src


Ignore:
Timestamp:
Nov 24, 2019 11:56:38 AM (5 years ago)
Author:
vboxsync
Message:

DevPCNet: PDMCritSect -> PDMDevHlpCritSect. bugref:9218

File:
1 edited

Legend:

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

    r82146 r82147  
    12211221            uint32_t offsetTDRA = (GCPhysFault - pThis->GCTDRA);
    12221222
    1223             int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     1223            int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    12241224            if (RT_SUCCESS(rc))
    12251225            {
     
    12301230                pcnetUpdateIrq(pDevIns, pThis);
    12311231
    1232                 PDMCritSectLeave(&pThis->CritSect);
     1232                PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    12331233                return VINF_SUCCESS;
    12341234            }
     
    12681268
    12691269    /* Writes done by our code don't require polling of course */
    1270     if (PDMCritSectIsOwner(&pThis->CritSect) == false)
     1270    if (PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect) == false)
    12711271    {
    12721272        if (    (GCPhys >= pThis->GCTDRA && GCPhys + cbBuf < pcnetTdraAddr(pThis, 0))
     
    12761276           )
    12771277        {
    1278             int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     1278            int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    12791279            AssertReleaseRC(rc);
    12801280            /* Check if we can do something now */
    12811281            pcnetPollRxTx(pDevIns, pThis, pThisCC);
    12821282            pcnetUpdateIrq(pDevIns, pThis);
    1283             PDMCritSectLeave(&pThis->CritSect);
     1283            PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    12841284        }
    12851285    }
     
    20262026             *  - we don't cache any register state beyond this point
    20272027             */
    2028             PDMCritSectLeave(&pThis->CritSect);
     2028            PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    20292029            pcnetPhysWrite(pDevIns, pThis, rbadr, src, cbBuf);
    2030             int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     2030            int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    20312031            AssertReleaseRC(rc);
    20322032
     
    20732073                 * with EMT when the write is to an unallocated page or has an access
    20742074                 * handler associated with it. See above for additional comments. */
    2075                 PDMCritSectLeave(&pThis->CritSect);
     2075                PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    20762076                pcnetPhysWrite(pDevIns, pThis, rbadr2, src, cbBuf);
    2077                 rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     2077                rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    20782078                AssertReleaseRC(rc);
    20792079
     
    23652365                                  PPDMSCATTERGATHER pSgBuf)
    23662366{
    2367     Assert(PDMCritSectIsOwner(&pThis->CritSect)); RT_NOREF(pThis);
     2367    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect)); RT_NOREF(pThis);
    23682368    Assert(pSgBuf->cbAvailable >= cbFrame);
    23692369
     
    24742474static int pcnetAsyncTransmit(PPDMDEVINS pDevIns, PPCNETSTATE pThis, PPCNETSTATECC pThisCC, bool fOnWorkerThread)
    24752475{
    2476     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     2476    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    24772477
    24782478    /*
     
    27742774            return rc;
    27752775    }
    2776     rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     2776    rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    27772777    if (RT_SUCCESS(rc))
    27782778    {
     
    27872787         * Release the locks.
    27882788         */
    2789         PDMCritSectLeave(&pThis->CritSect);
     2789        PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    27902790    }
    27912791    else
     
    35183518    VBOXSTRICTRC    rc    = VINF_SUCCESS;
    35193519    STAM_PROFILE_ADV_START(&pThis->StatAPROMRead, a);
    3520     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3520    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    35213521    RT_NOREF_PV(pvUser);
    35223522
     
    35533553    PPCNETSTATE     pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE);
    35543554    VBOXSTRICTRC    rc    = VINF_SUCCESS;
    3555     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3555    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    35563556    RT_NOREF_PV(pvUser);
    35573557
     
    37663766    VBOXSTRICTRC    rc      = VINF_SUCCESS;
    37673767    STAM_PROFILE_ADV_START(&pThis->CTX_SUFF_Z(StatIORead), a);
    3768     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3768    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    37693769    RT_NOREF_PV(pvUser);
    37703770
     
    37933793    VBOXSTRICTRC    rc;
    37943794    STAM_PROFILE_ADV_START(&pThis->CTX_SUFF_Z(StatIOWrite), a);
    3795     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3795    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    37963796    RT_NOREF_PV(pvUser);
    37973797
     
    39163916    PPCNETSTATECC   pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PPCNETSTATECC);
    39173917    VBOXSTRICTRC    rc      = VINF_SUCCESS;
    3918     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3918    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    39193919    RT_NOREF_PV(pvUser);
    39203920
     
    39523952    PPCNETSTATECC   pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PPCNETSTATECC);
    39533953    VBOXSTRICTRC    rc      = VINF_SUCCESS;
    3954     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3954    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    39553955    RT_NOREF_PV(pvUser);
    39563956
     
    39883988    PPCNETSTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE);
    39893989    PPCNETSTATECC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PPCNETSTATECC);
    3990     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     3990    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    39913991    RT_NOREF(pvUser, pTimer);
    39923992
     
    40044004{
    40054005    PPCNETSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE);
    4006     Assert(PDMCritSectIsOwner(&pThis->CritSect));
     4006    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    40074007    RT_NOREF(pvUser, pTimer);
    40084008
     
    40254025    RT_NOREF(pTimer, pvUser);
    40264026
    4027     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4027    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    40284028    AssertReleaseRC(rc);
    40294029
     
    40504050             pDevIns->iInstance, pThis->cLinkDownReported));
    40514051
    4052     PDMCritSectLeave(&pThis->CritSect);
     4052    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    40534053}
    40544054
     
    41314131                    &pThis->MacConfigured, pcszModel, pDevIns->fRCEnabled ? " RC" : "", pDevIns->fR0Enabled ? " R0" : "");
    41324132
    4133     PDMCritSectEnter(&pThis->CritSect, VERR_INTERNAL_ERROR); /* Take it here so we know why we're hanging... */
     4133    PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_INTERNAL_ERROR); /* Take it here so we know why we're hanging... */
    41344134
    41354135    pHlp->pfnPrintf(pHlp,
     
    43534353    }
    43544354
    4355     PDMCritSectLeave(&pThis->CritSect);
     4355    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    43564356}
    43574357
     
    44224422    PPCNETSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE);
    44234423
    4424     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4424    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    44254425    AssertRC(rc);
    4426     PDMCritSectLeave(&pThis->CritSect);
     4426    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    44274427
    44284428    return VINF_SUCCESS;
     
    44754475    PCPDMDEVHLPR3   pHlp  = pDevIns->pHlpR3;
    44764476
    4477     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4477    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    44784478    AssertRC(rc);
    44794479
     
    44914491        pThis->fSharedRegion = true;
    44924492    }
    4493     PDMCritSectLeave(&pThis->CritSect);
     4493    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    44944494
    44954495    return rc;
     
    46334633static int pcnetR3CanReceive(PPDMDEVINS pDevIns, PPCNETSTATE pThis)
    46344634{
    4635     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4635    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    46364636    AssertReleaseRC(rc);
    46374637
     
    46534653    }
    46544654
    4655     PDMCritSectLeave(&pThis->CritSect);
     4655    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    46564656    return rc;
    46574657}
     
    46894689        /* Start the poll timer once which will remain active as long fMaybeOutOfSpace
    46904690         * is true -- even if (transmit) polling is disabled (CSR_DPOLL). */
    4691         rc2 = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4691        rc2 = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    46924692        AssertReleaseRC(rc2);
    46934693#ifndef PCNET_NO_POLLING
    46944694        pcnetPollTimerStart(pDevIns, pThis);
    46954695#endif
    4696         PDMCritSectLeave(&pThis->CritSect);
     4696        PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    46974697        PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->hEventOutOfRxSpace, cMillies);
    46984698    }
     
    47144714
    47154715    STAM_PROFILE_ADV_START(&pThis->StatReceive, a);
    4716     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4716    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    47174717    AssertReleaseRC(rc);
    47184718
     
    47524752#endif /* LOG_ENABLED */
    47534753
    4754     PDMCritSectLeave(&pThis->CritSect);
     4754    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    47554755    STAM_PROFILE_ADV_STOP(&pThis->StatReceive, a);
    47564756
     
    48504850            pThis->Led.Asserted.s.fError = pThis->Led.Actual.s.fError = 1;
    48514851        }
    4852         Assert(!PDMCritSectIsOwner(&pThis->CritSect));
     4852        Assert(!PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
    48534853        if (pThisCC->pDrv)
    48544854            pThisCC->pDrv->pfnNotifyLinkChanged(pThisCC->pDrv, enmState);
     
    49204920    AssertLogRelReturnVoid(iLUN == 0);
    49214921
    4922     PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4922    PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    49234923
    49244924    /** @todo r=pritesh still need to check if i missed
     
    49364936    //pThis->pDrvRC = NIL_RTRCPTR;
    49374937
    4938     PDMCritSectLeave(&pThis->CritSect);
     4938    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    49394939}
    49404940
     
    49534953    AssertLogRelReturn(iLUN == 0, VERR_PDM_NO_SUCH_LUN);
    49544954
    4955     PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4955    PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_SEM_BUSY);
    49564956
    49574957    /*
     
    49854985        pcnetR3TempLinkDown(pDevIns, pThis);
    49864986
    4987     PDMCritSectLeave(&pThis->CritSect);
     4987    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    49884988    return rc;
    49894989
     
    50475047    }
    50485048
    5049     if (PDMCritSectIsInitialized(&pThis->CritSect))
    5050         PDMR3CritSectDelete(&pThis->CritSect);
     5049    if (PDMDevHlpCritSectIsInitialized(pDevIns, &pThis->CritSect))
     5050        PDMDevHlpCritSectDelete(pDevIns, &pThis->CritSect);
    50515051    return VINF_SUCCESS;
    50525052}
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