VirtualBox

Changeset 82344 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Dec 3, 2019 12:55:43 PM (5 years ago)
Author:
vboxsync
Message:

DevIchAc97: Eliminated pDevInsR0 and pDevInsRC as well as the relocation function. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r82343 r82344  
    501501    /** R3 pointer to the device instance. */
    502502    PPDMDEVINSR3            pDevInsR3;
    503     /** R0 pointer to the device instance. */
    504     PPDMDEVINSR0            pDevInsR0;
    505     /** RC pointer to the device instance. */
    506     PPDMDEVINSRC            pDevInsRC;
    507     bool                    afPadding0[4];
     503//    /** R0 pointer to the device instance. */
     504//    PPDMDEVINSR0            pDevInsR0;
     505//    /** RC pointer to the device instance. */
     506//    PPDMDEVINSRC            pDevInsRC;
     507//    bool                    afPadding0[4];
    508508    /** Global Control (Bus Master Control Register). */
    509509    uint32_t                glob_cnt;
     
    631631static uint32_t           ichac97R3StreamGetUsed(PAC97STREAM pStream);
    632632static uint32_t           ichac97R3StreamGetFree(PAC97STREAM pStream);
    633 static int                ichac97R3StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax);
    634 static void               ichac97R3StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer);
     633static int                ichac97R3StreamTransfer(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax);
     634static void               ichac97R3StreamUpdate(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer);
    635635
    636636static DECLCALLBACK(void) ichac97R3Reset(PPDMDEVINS pDevIns);
     
    734734 * Updates the status register (SR) of an AC'97 audio stream.
    735735 *
     736 * @param   pDevIns             The device instance.
    736737 * @param   pThis               AC'97 state.
    737738 * @param   pStream             AC'97 stream to update SR for.
    738739 * @param   new_sr              New value for status register (SR).
    739740 */
    740 static void ichac97StreamUpdateSR(PAC97STATE pThis, PAC97STREAM pStream, uint32_t new_sr)
    741 {
    742     PPDMDEVINS  pDevIns = ICHAC97STATE_2_DEVINS(pThis);
     741static void ichac97StreamUpdateSR(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, uint32_t new_sr)
     742{
    743743    PAC97BMREGS pRegs   = &pStream->Regs;
    744744
     
    791791 * Writes a new value to a stream's status register (SR).
    792792 *
     793 * @param   pDevIns             The device instance.
    793794 * @param   pThis               AC'97 device state.
    794795 * @param   pStream             Stream to update SR for.
    795796 * @param   u32Val              New value to set the stream's SR to.
    796797 */
    797 static void ichac97StreamWriteSR(PAC97STATE pThis, PAC97STREAM pStream, uint32_t u32Val)
     798static void ichac97StreamWriteSR(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, uint32_t u32Val)
    798799{
    799800    PAC97BMREGS pRegs = &pStream->Regs;
     
    802803
    803804    pRegs->sr |= u32Val & ~(AC97_SR_RO_MASK | AC97_SR_WCLEAR_MASK);
    804     ichac97StreamUpdateSR(pThis, pStream, pRegs->sr & ~(u32Val & AC97_SR_WCLEAR_MASK));
     805    ichac97StreamUpdateSR(pDevIns, pThis, pStream, pRegs->sr & ~(u32Val & AC97_SR_WCLEAR_MASK));
    805806}
    806807
     
    12451246            }
    12461247
    1247             ichac97R3StreamUpdate(pThis, pStream, false /* fInTimer */);
     1248            ichac97R3StreamUpdate(pDevIns, pThis, pStream, false /* fInTimer */);
    12481249
    12491250            int rc3 = RTCritSectLeave(&pAIO->CritSect);
     
    14701471 * (with fInTimer set to @c false).
    14711472 *
     1473 * @param   pDevIns             The device instance.
    14721474 * @param   pThis               AC'97 state.
    14731475 * @param   pStream             AC'97 stream to update.
     
    14751477 *                              context or an asynchronous I/O stream thread (if supported).
    14761478 */
    1477 static void ichac97R3StreamUpdate(PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer)
     1479static void ichac97R3StreamUpdate(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, bool fInTimer)
    14781480{
    14791481    RT_NOREF(fInTimer);
     
    15031505
    15041506                /* Do the DMA transfer. */
    1505                 rc2 = ichac97R3StreamTransfer(pThis, pStream, RT_MIN(pStream->State.cbTransferChunk, cbStreamFree));
     1507                rc2 = ichac97R3StreamTransfer(pDevIns, pThis, pStream, RT_MIN(pStream->State.cbTransferChunk, cbStreamFree));
    15061508                AssertRC(rc2);
    15071509
     
    15911593                /* When running synchronously, do the DMA data transfers here.
    15921594                 * Otherwise this will be done in the stream's async I/O thread. */
    1593                 rc2 = ichac97R3StreamTransfer(pThis, pStream, cbStreamUsed);
     1595                rc2 = ichac97R3StreamTransfer(pDevIns, pThis, pStream, cbStreamUsed);
    15941596                AssertRC(rc2);
    15951597            }
     
    26262628    Assert(PDMDevHlpTimerIsLockOwner(pDevIns, RT_SAFE_SUBSCRIPT8(pThis->ahTimers, pStream->u8SD)));
    26272629
    2628     ichac97R3StreamUpdate(pThis, pStream, true /* fInTimer */);
     2630    ichac97R3StreamUpdate(pDevIns, pThis, pStream, true /* fInTimer */);
    26292631
    26302632    PAUDMIXSINK pSink = ichac97R3IndexToSink(pThis, pStream->u8SD);
     
    26672669 *
    26682670 * @returns IPRT status code.
     2671 * @param   pDevIns             The device instance.
    26692672 * @param   pThis               AC'97 state.
    26702673 * @param   pStream             AC'97 stream to update.
    26712674 * @param   cbToProcessMax      Maximum of data (in bytes) to process.
    26722675 */
    2673 static int ichac97R3StreamTransfer(PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax)
     2676static int ichac97R3StreamTransfer(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STREAM pStream, uint32_t cbToProcessMax)
    26742677{
    26752678    AssertPtrReturn(pThis,       VERR_INVALID_POINTER);
     
    28522855            }
    28532856
    2854             ichac97StreamUpdateSR(pThis, pStream, new_sr);
     2857            ichac97StreamUpdateSR(pDevIns, pThis, pStream, new_sr);
    28552858        }
    28562859
     
    31093112                        ichac97R3StreamReset(pThis, pStream);
    31103113
    3111                         ichac97StreamUpdateSR(pThis, pStream, AC97_SR_DCH); /** @todo Do we need to do that? */
     3114                        ichac97StreamUpdateSR(pDevIns, pThis, pStream, AC97_SR_DCH); /** @todo Do we need to do that? */
    31123115                    }
    31133116                    else
     
    31573160                case MC_SR:
    31583161                {
    3159                     ichac97StreamWriteSR(pThis, pStream, u32);
     3162                    ichac97StreamWriteSR(pDevIns, pThis, pStream, u32);
    31603163                    break;
    31613164                }
     
    31753178                case PO_SR:
    31763179                case MC_SR:
    3177                     ichac97StreamWriteSR(pThis, pStream, u32);
     3180                    ichac97StreamWriteSR(pDevIns, pThis, pStream, u32);
    31783181                    break;
    31793182                default:
     
    39333936
    39343937/**
    3935  * @interface_method_impl{PDMDEVREG,pfnRelocate}
    3936  */
    3937 static DECLCALLBACK(void) ichac97R3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    3938 {
    3939     NOREF(offDelta);
    3940     PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE);
    3941     pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    3942 }
    3943 
    3944 /**
    39453938 * @interface_method_impl{PDMDEVREG,pfnDestruct}
    39463939 */
     
    39803973     */
    39813974    pThis->pDevInsR3                = pDevIns;
    3982     pThis->pDevInsR0                = PDMDEVINS_2_R0PTR(pDevIns);
    3983     pThis->pDevInsRC                = PDMDEVINS_2_RCPTR(pDevIns);
    39843975    pThis->IBase.pfnQueryInterface  = ichac97R3QueryInterface;
    39853976    RTListInit(&pThis->lstDrv);
     
    43374328    /* .pfnConstruct = */           ichac97R3Construct,
    43384329    /* .pfnDestruct = */            ichac97R3Destruct,
    4339     /* .pfnRelocate = */            ichac97R3Relocate,
     4330    /* .pfnRelocate = */            NULL,
    43404331    /* .pfnMemSetup = */            NULL,
    43414332    /* .pfnPowerOn = */             NULL,
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