VirtualBox

Changeset 81468 in vbox


Ignore:
Timestamp:
Oct 23, 2019 1:24:09 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134193
Message:

DevE1000: Use device helers for critical sections (pDevIns will be needed later). bugref:9218

File:
1 edited

Legend:

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

    r81465 r81468  
    16551655#endif /* IN_RING3 */
    16561656
    1657 #define e1kCsEnter(ps, rc) PDMCritSectEnter(&ps->cs, rc)
    1658 #define e1kCsLeave(ps) PDMCritSectLeave(&ps->cs)
    1659 
    1660 #define e1kCsRxEnter(ps, rc) PDMCritSectEnter(&ps->csRx, rc)
    1661 #define e1kCsRxLeave(ps) PDMCritSectLeave(&ps->csRx)
    1662 #define e1kCsRxIsOwner(ps) PDMCritSectIsOwner(&ps->csRx)
     1657#define e1kCsEnter(ps, rc) PDMDevHlpCritSectEnter(pDevIns, &ps->cs, rc)
     1658#define e1kCsLeave(ps) PDMDevHlpCritSectLeave(pDevIns, &ps->cs)
     1659
     1660#define e1kCsRxEnter(ps, rc) PDMDevHlpCritSectEnter(pDevIns, &ps->csRx, rc)
     1661#define e1kCsRxLeave(ps) PDMDevHlpCritSectLeave(pDevIns, &ps->csRx)
     1662#define e1kCsRxIsOwner(ps) PDMDevHlpCritSectIsOwner(pDevIns, &ps->csRx)
    16631663
    16641664#ifndef E1K_WITH_TX_CS
     
    16661666# define e1kCsTxLeave(ps) do { } while (0)
    16671667#else /* E1K_WITH_TX_CS */
    1668 # define e1kCsTxEnter(ps, rc) PDMCritSectEnter(&ps->csTx, rc)
    1669 # define e1kCsTxLeave(ps) PDMCritSectLeave(&ps->csTx)
     1668# define e1kCsTxEnter(ps, rc) PDMDevHlpCritSectEnter(pDevIns, &ps->csTx, rc)
     1669# define e1kCsTxLeave(ps) PDMDevHlpCritSectLeave(pDevIns, &ps->csTx)
    16701670#endif /* E1K_WITH_TX_CS */
    16711671
     
    17891789 * Dump a packet to debug log.
    17901790 *
     1791 * @param   pDevIns     The device instance.
    17911792 * @param   pThis       The device state structure.
    17921793 * @param   cpPacket    The packet.
     
    17951796 * @thread  E1000_TX
    17961797 */
    1797 DECLINLINE(void) e1kPacketDump(PE1KSTATE pThis, const uint8_t *cpPacket, size_t cb, const char *pszText)
     1798DECLINLINE(void) e1kPacketDump(PPDMDEVINS pDevIns, PE1KSTATE pThis, const uint8_t *cpPacket, size_t cb, const char *pszText)
    17981799{
    17991800#ifdef DEBUG
     
    40894090    if (pSg && pSg->pvAllocator != pThis)
    40904091    {
    4091         e1kPacketDump(pThis, (uint8_t const *)pSg->aSegs[0].pvSeg, cbFrame, "--> Outgoing");
     4092        e1kPacketDump(pDevIns, pThis, (uint8_t const *)pSg->aSegs[0].pvSeg, cbFrame, "--> Outgoing");
    40924093
    40934094        pThisCC->CTX_SUFF(pTxSg) = NULL;
     
    41064107    {
    41074108        Assert(pSg->aSegs[0].pvSeg == pThis->aTxPacketFallback);
    4108         e1kPacketDump(pThis, (uint8_t const *)pSg->aSegs[0].pvSeg, cbFrame, "--> Loopback");
     4109        e1kPacketDump(pDevIns, pThis, (uint8_t const *)pSg->aSegs[0].pvSeg, cbFrame, "--> Loopback");
    41094110
    41104111        /** @todo do we actually need to check that we're in loopback mode here? */
     
    67086709    //    return VERR_PERMISSION_DENIED;
    67096710
    6710     e1kPacketDump(pThis, (const uint8_t*)pvBuf, cb, "<-- Incoming");
     6711    e1kPacketDump(pDevIns, pThis, (const uint8_t*)pvBuf, cb, "<-- Incoming");
    67116712
    67126713    /* Update stats */
     
    74457446    AssertLogRelReturnVoid(iLUN == 0);
    74467447
    7447     PDMCritSectEnter(&pThis->cs, VERR_SEM_BUSY);
     7448    PDMDevHlpCritSectEnter(pDevIns, &pThis->cs, VERR_SEM_BUSY);
    74487449
    74497450    /** @todo r=pritesh still need to check if i missed
     
    74617462#endif
    74627463
    7463     PDMCritSectLeave(&pThis->cs);
     7464    PDMDevHlpCritSectLeave(pDevIns, &pThis->cs);
    74647465}
    74657466
     
    74857486    AssertLogRelReturn(iLUN == 0, VERR_PDM_NO_SUCH_LUN);
    74867487
    7487     PDMCritSectEnter(&pThis->cs, VERR_SEM_BUSY);
     7488    PDMDevHlpCritSectEnter(pDevIns, &pThis->cs, VERR_SEM_BUSY);
    74887489
    74897490    /*
     
    75297530        e1kR3LinkDownTemp(pDevIns, pThis, pThisCC);
    75307531
    7531     PDMCritSectLeave(&pThis->cs);
     7532    PDMDevHlpCritSectLeave(pDevIns, &pThis->cs);
    75327533    return rc;
    7533 
    75347534}
    75357535
     
    76157615    e1kDumpState(pThis);
    76167616    E1kLog(("%s Destroying instance\n", pThis->szPrf));
    7617     if (PDMCritSectIsInitialized(&pThis->cs))
     7617    if (PDMDevHlpCritSectIsInitialized(pDevIns, &pThis->cs))
    76187618    {
    76197619        if (pThis->hEventMoreRxDescAvail != NIL_SUPSEMEVENT)
     
    76257625        }
    76267626#ifdef E1K_WITH_TX_CS
    7627         PDMR3CritSectDelete(&pThis->csTx);
     7627        PDMDevHlpCritSectDelete(pDevIns, &pThis->csTx);
    76287628#endif /* E1K_WITH_TX_CS */
    7629         PDMR3CritSectDelete(&pThis->csRx);
    7630         PDMR3CritSectDelete(&pThis->cs);
     7629        PDMDevHlpCritSectDelete(pDevIns, &pThis->csRx);
     7630        PDMDevHlpCritSectDelete(pDevIns, &pThis->cs);
    76317631    }
    76327632    return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

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