VirtualBox

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


Ignore:
Timestamp:
Apr 7, 2018 9:29:18 PM (7 years ago)
Author:
vboxsync
Message:

DevHDA: Use hdaR3 as prefix for ring-3 only methods to make it less complicated to follow code.

Location:
trunk/src/VBox/Devices/Audio
Files:
11 edited

Legend:

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

    r71735 r71736  
    297297#ifndef VBOX_DEVICE_STRUCT_TESTCASE
    298298#ifdef IN_RING3
    299 static void hdaGCTLReset(PHDASTATE pThis);
     299static void hdaR3GCTLReset(PHDASTATE pThis);
    300300#endif
    301301
     
    360360 */
    361361#ifdef IN_RING3
    362 static int                        hdaAddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
    363 static int                        hdaRemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
     362static int                        hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
     363static int                        hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
    364364# ifdef HDA_USE_DMA_ACCESS_HANDLER
    365 static DECLCALLBACK(VBOXSTRICTRC) hdaDMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
     365static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
     366                                                        void *pvBuf, size_t cbBuf,
     367                                                        PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
    366368# endif
    367369#endif /* IN_RING3 */
     
    570572 * @param   pThis               The HDA device state.
    571573 */
    572 static void hdaReschedulePendingInterrupts(PHDASTATE pThis)
     574static void hdaR3ReschedulePendingInterrupts(PHDASTATE pThis)
    573575{
    574576    bool fInterrupt = false;
     
    580582            continue;
    581583
    582         if (   hdaStreamPeriodIsComplete    (&pStream->State.Period)
    583             && hdaStreamPeriodNeedsInterrupt(&pStream->State.Period)
    584             && hdaWalClkSet(pThis, hdaStreamPeriodGetAbsElapsedWalClk(&pStream->State.Period), false /* fForce */))
     584        if (   hdaR3StreamPeriodIsComplete    (&pStream->State.Period)
     585            && hdaR3StreamPeriodNeedsInterrupt(&pStream->State.Period)
     586            && hdaR3WalClkSet(pThis, hdaR3StreamPeriodGetAbsElapsedWalClk(&pStream->State.Period), false /* fForce */))
    585587        {
    586588            fInterrupt = true;
     
    658660 * @param   offReg              The register offset.
    659661 */
    660 static int hdaRegLookupWithin(uint32_t offReg)
     662static int hdaR3RegLookupWithin(uint32_t offReg)
    661663{
    662664    /*
     
    10101012        HDA_REG(pThis, GCTL) &= ~HDA_GCTL_CRST;
    10111013
    1012         hdaGCTLReset(pThis);
     1014        hdaR3GCTLReset(pThis);
    10131015#else
    10141016        AssertFailedReturnStmt(DEVHDA_UNLOCK(pThis), VINF_IOM_R3_MMIO_WRITE);
     
    10671069 * @remark  Does not actually set the wall clock counter.
    10681070 */
    1069 static uint64_t hdaWalClkGetMax(PHDASTATE pThis)
     1071static uint64_t hdaR3WalClkGetMax(PHDASTATE pThis)
    10701072{
    10711073    const uint64_t u64WalClkCur       = ASMAtomicReadU64(&pThis->u64WalClk);
    10721074    const uint64_t u64FrontAbsWalClk  = pThis->SinkFront.pStream
    1073                                       ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkFront.pStream->State.Period) : 0;
     1075                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkFront.pStream->State.Period) : 0;
    10741076# ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    10751077#  error "Implement me!"
    10761078# endif
    10771079    const uint64_t u64LineInAbsWalClk = pThis->SinkLineIn.pStream
    1078                                       ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkLineIn.pStream->State.Period) : 0;
     1080                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkLineIn.pStream->State.Period) : 0;
    10791081# ifdef VBOX_WITH_HDA_MIC_IN
    10801082    const uint64_t u64MicInAbsWalClk  = pThis->SinkMicIn.pStream
    1081                                       ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkMicIn.pStream->State.Period) : 0;
     1083                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkMicIn.pStream->State.Period) : 0;
    10821084# endif
    10831085
     
    11071109    *pu32Value = RT_LO_U32(ASMAtomicReadU64(&pThis->u64WalClk));
    11081110
    1109     Log3Func(("%RU32 (max @ %RU64)\n",*pu32Value, hdaWalClkGetMax(pThis)));
     1111    Log3Func(("%RU32 (max @ %RU64)\n",*pu32Value, hdaR3WalClkGetMax(pThis)));
    11101112
    11111113    DEVHDA_UNLOCK(pThis);
     
    13531355        LogFunc(("[SD%RU8] Reset enter\n", uSD));
    13541356
    1355         hdaStreamLock(pStream);
     1357        hdaR3StreamLock(pStream);
    13561358
    13571359# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    1358         hdaStreamAsyncIOLock(pStream);
    1359         hdaStreamAsyncIOEnable(pStream, false /* fEnable */);
     1360        hdaR3StreamAsyncIOLock(pStream);
     1361        hdaR3StreamAsyncIOEnable(pStream, false /* fEnable */);
    13601362# endif
    13611363        /* Make sure to remove the run bit before doing the actual stream reset. */
    13621364        HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN;
    13631365
    1364         hdaStreamReset(pThis, pStream, pStream->u8SD);
     1366        hdaR3StreamReset(pThis, pStream, pStream->u8SD);
    13651367
    13661368# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    1367         hdaStreamAsyncIOUnlock(pStream);
     1369        hdaR3StreamAsyncIOUnlock(pStream);
    13681370# endif
    1369         hdaStreamUnlock(pStream);
     1371        hdaR3StreamUnlock(pStream);
    13701372    }
    13711373    else
     
    13791381            LogFunc(("[SD%RU8] State changed (fRun=%RTbool)\n", uSD, fRun));
    13801382
    1381             hdaStreamLock(pStream);
     1383            hdaR3StreamLock(pStream);
    13821384
    13831385            int rc2;
     
    13851387# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    13861388            if (fRun)
    1387                 rc2 = hdaStreamAsyncIOCreate(pStream);
    1388 
    1389             hdaStreamAsyncIOLock(pStream);
     1389                rc2 = hdaR3StreamAsyncIOCreate(pStream);
     1390
     1391            hdaR3StreamAsyncIOLock(pStream);
    13901392# endif
    13911393            if (fRun)
    13921394            {
    13931395# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    1394                 hdaStreamAsyncIOEnable(pStream, fRun /* fEnable */);
     1396                hdaR3StreamAsyncIOEnable(pStream, fRun /* fEnable */);
    13951397# endif
    13961398                /* (Re-)initialize the stream with current values. */
    1397                 rc2 = hdaStreamInit(pStream, pStream->u8SD);
     1399                rc2 = hdaR3StreamInit(pStream, pStream->u8SD);
    13981400                AssertRC(rc2);
    13991401
    14001402                /* Remove the old stream from the device setup. */
    1401                 hdaRemoveStream(pThis, &pStream->State.Cfg);
     1403                hdaR3RemoveStream(pThis, &pStream->State.Cfg);
    14021404
    14031405                /* Add the stream to the device setup. */
    1404                 rc2 = hdaAddStream(pThis, &pStream->State.Cfg);
     1406                rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg);
    14051407                AssertRC(rc2);
    14061408            }
    14071409
    14081410            /* Enable/disable the stream. */
    1409             rc2 = hdaStreamEnable(pStream, fRun /* fEnable */);
     1411            rc2 = hdaR3StreamEnable(pStream, fRun /* fEnable */);
    14101412            AssertRC(rc2);
    14111413
     
    14161418
    14171419                /* (Re-)init the stream's period. */
    1418                 hdaStreamPeriodInit(&pStream->State.Period,
    1419                                     pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
     1420                hdaR3StreamPeriodInit(&pStream->State.Period,
     1421                                      pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
    14201422
    14211423                /* Begin a new period for this stream. */
    1422                 rc2 = hdaStreamPeriodBegin(&pStream->State.Period, hdaWalClkGetCurrent(pThis)/* Use current wall clock time */);
     1424                rc2 = hdaR3StreamPeriodBegin(&pStream->State.Period, hdaWalClkGetCurrent(pThis)/* Use current wall clock time */);
    14231425                AssertRC(rc2);
    14241426
    1425                 rc2 = hdaTimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, false /* fForce */);
     1427                rc2 = hdaR3TimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, false /* fForce */);
    14261428                AssertRC(rc2);
    14271429            }
     
    14341436
    14351437                /* Make sure to (re-)schedule outstanding (delayed) interrupts. */
    1436                 hdaReschedulePendingInterrupts(pThis);
     1438                hdaR3ReschedulePendingInterrupts(pThis);
    14371439
    14381440                /* Reset the period. */
    1439                 hdaStreamPeriodReset(&pStream->State.Period);
     1441                hdaR3StreamPeriodReset(&pStream->State.Period);
    14401442            }
    14411443
    14421444# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    1443             hdaStreamAsyncIOUnlock(pStream);
     1445            hdaR3StreamAsyncIOUnlock(pStream);
    14441446# endif
    14451447            /* Make sure to leave the lock before (eventually) starting the timer. */
    1446             hdaStreamUnlock(pStream);
     1448            hdaR3StreamUnlock(pStream);
    14471449        }
    14481450    }
     
    14771479    }
    14781480
    1479     hdaStreamLock(pStream);
     1481    hdaR3StreamLock(pStream);
    14801482
    14811483    uint32_t v = HDA_REG_IND(pThis, iReg);
     
    14921494    PHDASTREAMPERIOD pPeriod = &pStream->State.Period;
    14931495
    1494     if (hdaStreamPeriodLock(pPeriod))
    1495     {
    1496         const bool fNeedsInterrupt = hdaStreamPeriodNeedsInterrupt(pPeriod);
     1496    if (hdaR3StreamPeriodLock(pPeriod))
     1497    {
     1498        const bool fNeedsInterrupt = hdaR3StreamPeriodNeedsInterrupt(pPeriod);
    14971499        if (fNeedsInterrupt)
    1498             hdaStreamPeriodReleaseInterrupt(pPeriod);
    1499 
    1500         if (hdaStreamPeriodIsComplete(pPeriod))
     1500            hdaR3StreamPeriodReleaseInterrupt(pPeriod);
     1501
     1502        if (hdaR3StreamPeriodIsComplete(pPeriod))
    15011503        {
    15021504            /* Make sure to try to update the WALCLK register if a period is complete.
    15031505             * Use the maximum WALCLK value all (active) streams agree to. */
    1504             const uint64_t uWalClkMax = hdaWalClkGetMax(pThis);
     1506            const uint64_t uWalClkMax = hdaR3WalClkGetMax(pThis);
    15051507            if (uWalClkMax > hdaWalClkGetCurrent(pThis))
    1506                 hdaWalClkSet(pThis, uWalClkMax, false /* fForce */);
    1507 
    1508             hdaStreamPeriodEnd(pPeriod);
     1508                hdaR3WalClkSet(pThis, uWalClkMax, false /* fForce */);
     1509
     1510            hdaR3StreamPeriodEnd(pPeriod);
    15091511
    15101512            if (fRunning)
    1511                 hdaStreamPeriodBegin(pPeriod, hdaWalClkGetCurrent(pThis) /* Use current wall clock time */);
    1512         }
    1513 
    1514         hdaStreamPeriodUnlock(pPeriod); /* Unlock before processing interrupt. */
     1513                hdaR3StreamPeriodBegin(pPeriod, hdaWalClkGetCurrent(pThis) /* Use current wall clock time */);
     1514        }
     1515
     1516        hdaR3StreamPeriodUnlock(pPeriod); /* Unlock before processing interrupt. */
    15151517    }
    15161518
     
    15691571            /* Re-arm the timer. */
    15701572            LogFunc(("Timer set SD%RU8\n", pStream->u8SD));
    1571             hdaTimerSet(pThis, pStream, tsNow + cTicksToNext, false /* fForce */);
    1572         }
    1573     }
    1574 
    1575     hdaStreamUnlock(pStream);
     1573            hdaR3TimerSet(pThis, pStream, tsNow + cTicksToNext, false /* fForce */);
     1574        }
     1575    }
     1576
     1577    hdaR3StreamUnlock(pStream);
    15761578
    15771579    DEVHDA_UNLOCK_BOTH(pThis, uSD);
     
    16041606                /* Try registering the DMA handlers.
    16051607                 * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */
    1606                 if (hdaStreamRegisterDMAHandlers(pThis, pStream))
     1608                if (hdaR3StreamRegisterDMAHandlers(pThis, pStream))
    16071609                    LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD));
    16081610            }
     
    17461748 * @param   pCfg                Stream configuration to use for adding a stream.
    17471749 */
    1748 static int hdaAddStreamOut(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
     1750static int hdaR3AddStreamOut(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
    17491751{
    17501752    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    18831885 * @param   pCfg                Stream configuration to use for adding a stream.
    18841886 */
    1885 static int hdaAddStreamIn(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
     1887static int hdaR3AddStreamIn(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
    18861888{
    18871889    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    19241926 * @param   pCfg                Stream configuration to use for adding a stream.
    19251927 */
    1926 static int hdaAddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
     1928static int hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
    19271929{
    19281930    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    19361938    {
    19371939        case PDMAUDIODIR_OUT:
    1938             rc = hdaAddStreamOut(pThis, pCfg);
     1940            rc = hdaR3AddStreamOut(pThis, pCfg);
    19391941            break;
    19401942
    19411943        case PDMAUDIODIR_IN:
    1942             rc = hdaAddStreamIn(pThis, pCfg);
     1944            rc = hdaR3AddStreamIn(pThis, pCfg);
    19431945            break;
    19441946
     
    19611963 * @param   pCfg                Stream configuration to use for removing a stream.
    19621964 */
    1963 static int hdaRemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
     1965static int hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
    19641966{
    19651967    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    20762078        /* Try registering the DMA handlers.
    20772079         * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */
    2078         if (hdaStreamRegisterDMAHandlers(pThis, pStream))
     2080        if (hdaR3StreamRegisterDMAHandlers(pThis, pStream))
    20792081            LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD));
    20802082    }
     
    23072309 * @param   enmMixerCtl         Mixer control to get the corresponding sink for.
    23082310 */
    2309 static PHDAMIXERSINK hdaMixerControlToSink(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
     2311static PHDAMIXERSINK hdaR3MixerControlToSink(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
    23102312{
    23112313    PHDAMIXERSINK pSink;
     
    23522354 * @param   pDrv                Driver stream to add.
    23532355 */
    2354 static int hdaMixerAddDrvStream(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PHDADRIVER pDrv)
     2356static int hdaR3MixerAddDrvStream(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PHDADRIVER pDrv)
    23552357{
    23562358    AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
     
    24452447 * @param   pCfg                Audio stream configuration to use for the audio streams to add.
    24462448 */
    2447 static int hdaMixerAddDrvStreams(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
     2449static int hdaR3MixerAddDrvStreams(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
    24482450{
    24492451    AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
     
    24632465    RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node)
    24642466    {
    2465         int rc2 = hdaMixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
     2467        int rc2 = hdaR3MixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
    24662468        if (RT_FAILURE(rc2))
    24672469            LogFunc(("Attaching stream failed with %Rrc\n", rc2));
     
    24872489 * @param   pCfg                Stream configuration for the new stream.
    24882490 */
    2489 static DECLCALLBACK(int) hdaMixerAddStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg)
     2491static DECLCALLBACK(int) hdaR3MixerAddStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg)
    24902492{
    24912493    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    24942496    int rc;
    24952497
    2496     PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
     2498    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
    24972499    if (pSink)
    24982500    {
    2499         rc = hdaMixerAddDrvStreams(pThis, pSink->pMixSink, pCfg);
     2501        rc = hdaR3MixerAddDrvStreams(pThis, pSink->pMixSink, pCfg);
    25002502
    25012503        AssertPtr(pSink->pMixSink);
     
    25202522 * @remarks Can be called as a callback by the HDA codec.
    25212523 */
    2522 static DECLCALLBACK(int) hdaMixerRemoveStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
     2524static DECLCALLBACK(int) hdaR3MixerRemoveStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
    25232525{
    25242526    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    25262528    int rc;
    25272529
    2528     PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
     2530    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
    25292531    if (pSink)
    25302532    {
     
    26032605 * @remarks Can be called as a callback by the HDA codec.
    26042606 */
    2605 static DECLCALLBACK(int) hdaMixerControl(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel)
     2607static DECLCALLBACK(int) hdaR3MixerControl(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel)
    26062608{
    26072609    LogFunc(("enmMixerCtl=%s, uSD=%RU8, uChannel=%RU8\n", DrvAudioHlpAudMixerCtlToStr(enmMixerCtl), uSD, uChannel));
     
    26302632    int rc = VINF_SUCCESS;
    26312633
    2632     PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
     2634    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
    26332635    if (pSink)
    26342636    {
     
    26512653                     pSink->pMixSink->pszName, pSink->pStream->u8SD, pSink->pStream->u8Channel));
    26522654
    2653             hdaStreamLock(pSink->pStream);
     2655            hdaR3StreamLock(pSink->pStream);
    26542656
    26552657            /* Only disable the stream if the stream descriptor # has changed. */
    26562658            if (pSink->pStream->u8SD != uSD)
    2657                 hdaStreamEnable(pSink->pStream, false);
     2659                hdaR3StreamEnable(pSink->pStream, false);
    26582660
    26592661            pSink->pStream->pMixSink = NULL;
    26602662
    2661             hdaStreamUnlock(pSink->pStream);
     2663            hdaR3StreamUnlock(pSink->pStream);
    26622664
    26632665            pSink->pStream = NULL;
     
    26762678            if (pStream)
    26772679            {
    2678                 hdaStreamLock(pStream);
     2680                hdaR3StreamLock(pStream);
    26792681
    26802682                pSink->pStream = pStream;
     
    26832685                pStream->pMixSink  = pSink;
    26842686
    2685                 hdaStreamUnlock(pStream);
     2687                hdaR3StreamUnlock(pStream);
    26862688
    26872689                rc = VINF_SUCCESS;
     
    27142716 * @remarks Can be called as a callback by the HDA codec.
    27152717 */
    2716 static DECLCALLBACK(int) hdaMixerSetVolume(PHDASTATE pThis,
    2717                                            PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol)
     2718static DECLCALLBACK(int) hdaR3MixerSetVolume(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol)
    27182719{
    27192720    int rc;
    27202721
    2721     PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
     2722    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
    27222723    if (   pSink
    27232724        && pSink->pMixSink)
     
    27442745 * @param   pvUser              Pointer to associated HDASTREAM.
    27452746 */
    2746 static DECLCALLBACK(void) hdaTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
     2747static DECLCALLBACK(void) hdaR3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
    27472748{
    27482749    RT_NOREF(pDevIns, pTimer);
     
    27552756    DEVHDA_LOCK_BOTH_RETURN_VOID(pStream->pHDAState, pStream->u8SD);
    27562757
    2757     hdaStreamUpdate(pStream, true /* fInTimer */);
     2758    hdaR3StreamUpdate(pStream, true /* fInTimer */);
    27582759
    27592760    /* Flag indicating whether to kick the timer again for a
     
    27622763    if (fSinkActive)
    27632764    {
    2764         const bool fTimerScheduled = hdaStreamTransferIsScheduled(pStream);
     2765        const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(pStream);
    27652766        Log3Func(("fSinksActive=%RTbool, fTimerScheduled=%RTbool\n", fSinkActive, fTimerScheduled));
    27662767        if (!fTimerScheduled)
    2767             hdaTimerSet(pThis, pStream,
    2768                           TMTimerGet(pThis->pTimer[pStream->u8SD])
    2769                         + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->u16TimerHz,
    2770                         true /* fForce */);
     2768            hdaR3TimerSet(pThis, pStream,
     2769                            TMTimerGet(pThis->pTimer[pStream->u8SD])
     2770                          + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->u16TimerHz,
     2771                          true /* fForce */);
    27712772    }
    27722773    else
     
    27922793 * @param   pvUser          User argument.
    27932794 */
    2794 static DECLCALLBACK(VBOXSTRICTRC) hdaDMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
    2795                                                       void *pvBuf, size_t cbBuf,
    2796                                                       PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
     2795static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
     2796                                                        void *pvBuf, size_t cbBuf,
     2797                                                        PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
    27972798{
    27982799    RT_NOREF(pVM, pVCpu, pvPhys, pvBuf, enmOrigin);
     
    29152916 *
    29162917 */
    2917 static void hdaGCTLReset(PHDASTATE pThis)
     2918static void hdaR3GCTLReset(PHDASTATE pThis)
    29182919{
    29192920    LogFlowFuncEnter();
     
    29752976     */
    29762977# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    2977     hdaMixerControl(pThis, PDMAUDIOMIXERCTL_MIC_IN    , 1 /* SD0 */, 0 /* Channel */);
     2978    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_MIC_IN    , 1 /* SD0 */, 0 /* Channel */);
    29782979# endif
    2979     hdaMixerControl(pThis, PDMAUDIOMIXERCTL_LINE_IN   , 1 /* SD0 */, 0 /* Channel */);
    2980 
    2981     hdaMixerControl(pThis, PDMAUDIOMIXERCTL_FRONT     , 5 /* SD4 */, 0 /* Channel */);
     2980    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_LINE_IN   , 1 /* SD0 */, 0 /* Channel */);
     2981
     2982    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_FRONT     , 5 /* SD4 */, 0 /* Channel */);
    29822983# ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    2983     hdaMixerControl(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */);
    2984     hdaMixerControl(pThis, PDMAUDIOMIXERCTL_REAR      , 5 /* SD4 */, 0 /* Channel */);
     2984    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */);
     2985    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_REAR      , 5 /* SD4 */, 0 /* Channel */);
    29852986# endif
    29862987
     
    29982999    for (uint8_t uSD = 0; uSD < HDA_MAX_STREAMS; ++uSD)
    29993000    {
    3000         int rc2 = hdaStreamEnable(&pThis->aStreams[uSD], false /* fEnable */);
     3001        int rc2 = hdaR3StreamEnable(&pThis->aStreams[uSD], false /* fEnable */);
    30013002        if (RT_SUCCESS(rc2))
    30023003        {
    30033004            /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */
    30043005            HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN;
    3005             hdaStreamReset(pThis, &pThis->aStreams[uSD], uSD);
     3006            hdaR3StreamReset(pThis, &pThis->aStreams[uSD], uSD);
    30063007        }
    30073008    }
     
    32673268         * shifting out input values.
    32683269         */
    3269         if (idxRegDsc == -1 && (idxRegDsc = hdaRegLookupWithin(offReg)) != -1)
     3270        if (idxRegDsc == -1 && (idxRegDsc = hdaR3RegLookupWithin(offReg)) != -1)
    32703271        {
    32713272            uint32_t const cbBefore = offReg - g_aHdaRegMap[idxRegDsc].offset; Assert(cbBefore > 0 && cbBefore < 4);
     
    33423343 * @callback_method_impl{FNPCIIOREGIONMAP}
    33433344 */
    3344 static DECLCALLBACK(int)  hdaPciIoRegionMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
    3345                                             RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
     3345static DECLCALLBACK(int) hdaR3PciIoRegionMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
     3346                                             RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
    33463347{
    33473348    RT_NOREF(iRegion, enmType);
    3348     PHDASTATE   pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev);
     3349    PHDASTATE pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev);
    33493350
    33503351    /*
     
    33813382
    33823383
    3383 /* Saved state callbacks. */
    3384 
    3385 static int hdaSaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStream)
     3384/* Saved state workers and callbacks. */
     3385
     3386static int hdaR3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStream)
    33863387{
    33873388    RT_NOREF(pDevIns);
     
    34303431
    34313432        HDABDLE curBDLE;
    3432         rc = hdaBDLEFetch(pThis, &curBDLE, u64BaseDMA, pStream->State.uCurBDLE);
     3433        rc = hdaR3BDLEFetch(pThis, &curBDLE, u64BaseDMA, pStream->State.uCurBDLE);
    34333434        AssertRC(rc);
    34343435
     
    35063507
    35073508#ifdef LOG_ENABLED
    3508     hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
     3509    hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
    35093510#endif
    35103511
     
    35153516 * @callback_method_impl{FNSSMDEVSAVEEXEC}
    35163517 */
    3517 static DECLCALLBACK(int) hdaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
     3518static DECLCALLBACK(int) hdaR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    35183519{
    35193520    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    35363537    for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++)
    35373538    {
    3538         int rc = hdaSaveStream(pDevIns, pSSM, &pThis->aStreams[i]);
     3539        int rc = hdaR3SaveStream(pDevIns, pSSM, &pThis->aStreams[i]);
    35393540        AssertRCReturn(rc, rc);
    35403541    }
     
    35483549 * @param   pThis               Pointer to HDA state.
    35493550 */
    3550 static int hdaLoadExecPost(PHDASTATE pThis)
     3551static int hdaR3LoadExecPost(PHDASTATE pThis)
    35513552{
    35523553    int rc = VINF_SUCCESS;
     
    35673568#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    35683569                /* Make sure to also create the async I/O thread before actually enabling the stream. */
    3569                 rc2 = hdaStreamAsyncIOCreate(pStream);
     3570                rc2 = hdaR3StreamAsyncIOCreate(pStream);
    35703571                AssertRC(rc2);
    35713572
    35723573                /* ... and enabling it. */
    3573                 hdaStreamAsyncIOEnable(pStream, true /* fEnable */);
     3574                hdaR3StreamAsyncIOEnable(pStream, true /* fEnable */);
    35743575#endif
    35753576                /* Resume the stream's period. */
    3576                 hdaStreamPeriodResume(&pStream->State.Period);
     3577                hdaR3StreamPeriodResume(&pStream->State.Period);
    35773578
    35783579                /* (Re-)enable the stream. */
    3579                 rc2 = hdaStreamEnable(pStream, true /* fEnable */);
     3580                rc2 = hdaR3StreamEnable(pStream, true /* fEnable */);
    35803581                AssertRC(rc2);
    35813582
    35823583                /* Add the stream to the device setup. */
    3583                 rc2 = hdaAddStream(pThis, &pStream->State.Cfg);
     3584                rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg);
    35843585                AssertRC(rc2);
    35853586
    35863587#ifdef HDA_USE_DMA_ACCESS_HANDLER
    35873588                /* (Re-)install the DMA handler. */
    3588                 hdaStreamRegisterDMAHandlers(pThis, pStream);
     3589                hdaR3StreamRegisterDMAHandlers(pThis, pStream);
    35893590#endif
    3590                 if (hdaStreamTransferIsScheduled(pStream))
    3591                     hdaTimerSet(pThis, pStream, hdaStreamTransferGetNext(pStream), true /* fForce */);
     3591                if (hdaR3StreamTransferIsScheduled(pStream))
     3592                    hdaR3TimerSet(pThis, pStream, hdaR3StreamTransferGetNext(pStream), true /* fForce */);
    35923593
    35933594                /* Also keep track of the currently active streams. */
     
    36103611 * @param   uPass               Loading stage to handle.
    36113612 */
    3612 static int hdaLoadExecLegacy(PHDASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     3613static int hdaR3LoadExecLegacy(PHDASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    36133614{
    36143615    RT_NOREF(uPass);
     
    37273728            /* Output */
    37283729            PHDASTREAM pStream = &pThis->aStreams[4];
    3729             rc = hdaStreamInit(pStream, 4 /* Stream descriptor, hardcoded */);
     3730            rc = hdaR3StreamInit(pStream, 4 /* Stream descriptor, hardcoded */);
    37303731            if (RT_FAILURE(rc))
    37313732                break;
     
    37353736            /* Microphone-In */
    37363737            pStream = &pThis->aStreams[2];
    3737             rc = hdaStreamInit(pStream, 2 /* Stream descriptor, hardcoded */);
     3738            rc = hdaR3StreamInit(pStream, 2 /* Stream descriptor, hardcoded */);
    37383739            if (RT_FAILURE(rc))
    37393740                break;
     
    37433744            /* Line-In */
    37443745            pStream = &pThis->aStreams[0];
    3745             rc = hdaStreamInit(pStream, 0 /* Stream descriptor, hardcoded */);
     3746            rc = hdaR3StreamInit(pStream, 0 /* Stream descriptor, hardcoded */);
    37463747            if (RT_FAILURE(rc))
    37473748                break;
     
    37803781                }
    37813782
    3782                 rc = hdaStreamInit(pStream, uStreamID);
     3783                rc = hdaR3StreamInit(pStream, uStreamID);
    37833784                if (RT_FAILURE(rc))
    37843785                {
     
    38683869                              HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID)));
    38693870#ifdef LOG_ENABLED
    3870                     hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
     3871                    hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
    38713872#endif
    38723873                }
     
    38833884 * @callback_method_impl{FNSSMDEVLOADEXEC}
    38843885 */
    3885 static DECLCALLBACK(int) hdaLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     3886static DECLCALLBACK(int) hdaR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    38863887{
    38873888    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    38893890    Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
    38903891
    3891     LogRel2(("hdaLoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));
     3892    LogRel2(("hdaR3LoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));
    38923893
    38933894    /*
     
    39033904    if (uVersion < HDA_SSM_VERSION) /* Handle older saved states? */
    39043905    {
    3905         rc = hdaLoadExecLegacy(pThis, pSSM, uVersion, uPass);
     3906        rc = hdaR3LoadExecLegacy(pThis, pSSM, uVersion, uPass);
    39063907        if (RT_SUCCESS(rc))
    3907             rc = hdaLoadExecPost(pThis);
     3908            rc = hdaR3LoadExecPost(pThis);
    39083909
    39093910        return rc;
     
    39763977        }
    39773978
    3978         rc = hdaStreamInit(pStream, uStreamID);
     3979        rc = hdaR3StreamInit(pStream, uStreamID);
    39793980        if (RT_FAILURE(rc))
    39803981        {
     
    40054006         * Don't annoy other team mates (forgot this for state v7).
    40064007         */
    4007         hdaStreamPeriodInit(&pStream->State.Period,
    4008                             pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
     4008        hdaR3StreamPeriodInit(&pStream->State.Period,
     4009                              pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
    40094010
    40104011        if (   SSMR3HandleRevision(pSSM) >= 116273
     
    40724073                  HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID)));
    40734074#ifdef LOG_ENABLED
    4074         hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
     4075        hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
    40754076#endif
    40764077        /** @todo (Re-)initialize active periods? */
     
    40784079    } /* for cStreams */
    40794080
    4080     rc = hdaLoadExecPost(pThis);
     4081    rc = hdaR3LoadExecPost(pThis);
    40814082    AssertRC(rc);
    40824083
     
    40854086}
    40864087
    4087 /* Debug and log type formatters. */
     4088/* IPRT format type handlers. */
    40884089
    40894090/**
    40904091 * @callback_method_impl{FNRTSTRFORMATTYPE}
    40914092 */
    4092 static DECLCALLBACK(size_t) hdaDbgFmtBDLE(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    4093                                           const char *pszType, void const *pvValue,
    4094                                           int cchWidth, int cchPrecision, unsigned fFlags,
    4095                                           void *pvUser)
     4093static DECLCALLBACK(size_t) hdaR3StrFmtBDLE(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     4094                                            const char *pszType, void const *pvValue,
     4095                                            int cchWidth, int cchPrecision, unsigned fFlags,
     4096                                            void *pvUser)
    40964097{
    40974098    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
     
    41064107 * @callback_method_impl{FNRTSTRFORMATTYPE}
    41074108 */
    4108 static DECLCALLBACK(size_t) hdaDbgFmtSDCTL(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    4109                                            const char *pszType, void const *pvValue,
    4110                                            int cchWidth, int cchPrecision, unsigned fFlags,
    4111                                            void *pvUser)
     4109static DECLCALLBACK(size_t) hdaR3StrFmtSDCTL(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     4110                                             const char *pszType, void const *pvValue,
     4111                                             int cchWidth, int cchPrecision, unsigned fFlags,
     4112                                             void *pvUser)
    41124113{
    41134114    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
     
    41294130 * @callback_method_impl{FNRTSTRFORMATTYPE}
    41304131 */
    4131 static DECLCALLBACK(size_t) hdaDbgFmtSDFIFOS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     4132static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     4133                                               const char *pszType, void const *pvValue,
     4134                                               int cchWidth, int cchPrecision, unsigned fFlags,
     4135                                               void *pvUser)
     4136{
     4137    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
     4138    uint32_t uSDFIFOS = (uint32_t)(uintptr_t)pvValue;
     4139    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOS(raw:%#x, sdfifos:%RU8 B)", uSDFIFOS, uSDFIFOS ? uSDFIFOS + 1 : 0);
     4140}
     4141
     4142/**
     4143 * @callback_method_impl{FNRTSTRFORMATTYPE}
     4144 */
     4145static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOW(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     4146                                               const char *pszType, void const *pvValue,
     4147                                               int cchWidth, int cchPrecision, unsigned fFlags,
     4148                                               void *pvUser)
     4149{
     4150    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
     4151    uint32_t uSDFIFOW = (uint32_t)(uintptr_t)pvValue;
     4152    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOW(raw: %#0x, sdfifow:%d B)", uSDFIFOW, hdaSDFIFOWToBytes(uSDFIFOW));
     4153}
     4154
     4155/**
     4156 * @callback_method_impl{FNRTSTRFORMATTYPE}
     4157 */
     4158static DECLCALLBACK(size_t) hdaR3StrFmtSDSTS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    41324159                                             const char *pszType, void const *pvValue,
    41334160                                             int cchWidth, int cchPrecision, unsigned fFlags,
    41344161                                             void *pvUser)
    4135 {
    4136     RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
    4137     uint32_t uSDFIFOS = (uint32_t)(uintptr_t)pvValue;
    4138     return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOS(raw:%#x, sdfifos:%RU8 B)", uSDFIFOS, uSDFIFOS ? uSDFIFOS + 1 : 0);
    4139 }
    4140 
    4141 /**
    4142  * @callback_method_impl{FNRTSTRFORMATTYPE}
    4143  */
    4144 static DECLCALLBACK(size_t) hdaDbgFmtSDFIFOW(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    4145                                              const char *pszType, void const *pvValue,
    4146                                              int cchWidth, int cchPrecision, unsigned fFlags,
    4147                                              void *pvUser)
    4148 {
    4149     RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
    4150     uint32_t uSDFIFOW = (uint32_t)(uintptr_t)pvValue;
    4151     return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOW(raw: %#0x, sdfifow:%d B)", uSDFIFOW, hdaSDFIFOWToBytes(uSDFIFOW));
    4152 }
    4153 
    4154 /**
    4155  * @callback_method_impl{FNRTSTRFORMATTYPE}
    4156  */
    4157 static DECLCALLBACK(size_t) hdaDbgFmtSDSTS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    4158                                            const char *pszType, void const *pvValue,
    4159                                            int cchWidth, int cchPrecision, unsigned fFlags,
    4160                                            void *pvUser)
    41614162{
    41624163    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
     
    41714172}
    41724173
    4173 static int hdaDbgLookupRegByName(const char *pszArgs)
     4174/* Debug info dumpers */
     4175
     4176static int hdaR3DbgLookupRegByName(const char *pszArgs)
    41744177{
    41754178    int iReg = 0;
     
    41814184
    41824185
    4183 static void hdaDbgPrintRegister(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iHdaIndex)
     4186static void hdaR3DbgPrintRegister(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iHdaIndex)
    41844187{
    41854188    Assert(   pThis
     
    41924195 * @callback_method_impl{FNDBGFHANDLERDEV}
    41934196 */
    4194 static DECLCALLBACK(void) hdaDbgInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4197static DECLCALLBACK(void) hdaR3DbgInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    41954198{
    41964199    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
    4197     int iHdaRegisterIndex = hdaDbgLookupRegByName(pszArgs);
     4200    int iHdaRegisterIndex = hdaR3DbgLookupRegByName(pszArgs);
    41984201    if (iHdaRegisterIndex != -1)
    4199         hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
     4202        hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
    42004203    else
    42014204    {
    42024205        for(iHdaRegisterIndex = 0; (unsigned int)iHdaRegisterIndex < HDA_NUM_REGS; ++iHdaRegisterIndex)
    4203             hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
    4204     }
    4205 }
    4206 
    4207 static void hdaDbgPrintStream(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
     4206            hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
     4207    }
     4208}
     4209
     4210static void hdaR3DbgPrintStream(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
    42084211{
    42094212    Assert(   pThis
     
    42214224}
    42224225
    4223 static void hdaDbgPrintBDLE(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
     4226static void hdaR3DbgPrintBDLE(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
    42244227{
    42254228    Assert(   pThis
     
    42784281}
    42794282
    4280 static int hdaDbgLookupStrmIdx(PHDASTATE pThis, const char *pszArgs)
     4283static int hdaR3DbgLookupStrmIdx(PHDASTATE pThis, const char *pszArgs)
    42814284{
    42824285    RT_NOREF(pThis, pszArgs);
     
    42884291 * @callback_method_impl{FNDBGFHANDLERDEV}
    42894292 */
    4290 static DECLCALLBACK(void) hdaDbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4293static DECLCALLBACK(void) hdaR3DbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    42914294{
    42924295    PHDASTATE   pThis         = PDMINS_2_DATA(pDevIns, PHDASTATE);
    4293     int         iHdaStreamdex = hdaDbgLookupStrmIdx(pThis, pszArgs);
     4296    int         iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs);
    42944297    if (iHdaStreamdex != -1)
    4295         hdaDbgPrintStream(pThis, pHlp, iHdaStreamdex);
     4298        hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex);
    42964299    else
    42974300        for(iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
    4298             hdaDbgPrintStream(pThis, pHlp, iHdaStreamdex);
     4301            hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex);
    42994302}
    43004303
     
    43024305 * @callback_method_impl{FNDBGFHANDLERDEV}
    43034306 */
    4304 static DECLCALLBACK(void) hdaDbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4307static DECLCALLBACK(void) hdaR3DbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    43054308{
    43064309    PHDASTATE   pThis         = PDMINS_2_DATA(pDevIns, PHDASTATE);
    4307     int         iHdaStreamdex = hdaDbgLookupStrmIdx(pThis, pszArgs);
     4310    int         iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs);
    43084311    if (iHdaStreamdex != -1)
    4309         hdaDbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
     4312        hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
    43104313    else
    4311         for(iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
    4312             hdaDbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
     4314        for (iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
     4315            hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
    43134316}
    43144317
     
    43164319 * @callback_method_impl{FNDBGFHANDLERDEV}
    43174320 */
    4318 static DECLCALLBACK(void) hdaDbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4321static DECLCALLBACK(void) hdaR3DbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    43194322{
    43204323    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    43294332 * @callback_method_impl{FNDBGFHANDLERDEV}
    43304333 */
    4331 static DECLCALLBACK(void) hdaDbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4334static DECLCALLBACK(void) hdaR3DbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    43324335{
    43334336    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    43424345 * @callback_method_impl{FNDBGFHANDLERDEV}
    43434346 */
    4344 static DECLCALLBACK(void) hdaDbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     4347static DECLCALLBACK(void) hdaR3DbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    43454348{
    43464349    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    43584361 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    43594362 */
    4360 static DECLCALLBACK(void *) hdaQueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
     4363static DECLCALLBACK(void *) hdaR3QueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
    43614364{
    43624365    PHDASTATE pThis = RT_FROM_MEMBER(pInterface, HDASTATE, IBase);
     
    43834386 * @param   ppDrv       Attached driver instance on success. Optional.
    43844387 */
    4385 static int hdaAttachInternal(PHDASTATE pThis, unsigned uLUN, uint32_t fFlags, PHDADRIVER *ppDrv)
     4388static int hdaR3AttachInternal(PHDASTATE pThis, unsigned uLUN, uint32_t fFlags, PHDADRIVER *ppDrv)
    43864389{
    43874390    RT_NOREF(fFlags);
     
    44554458 * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
    44564459 */
    4457 static int hdaDetachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint32_t fFlags)
     4460static int hdaR3DetachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint32_t fFlags)
    44584461{
    44594462    RT_NOREF(fFlags);
     
    44924495 * @interface_method_impl{PDMDEVREG,pfnAttach}
    44934496 */
    4494 static DECLCALLBACK(int) hdaAttach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
     4497static DECLCALLBACK(int) hdaR3Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
    44954498{
    44964499    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    45014504
    45024505    PHDADRIVER pDrv;
    4503     int rc2 = hdaAttachInternal(pThis, uLUN, fFlags, &pDrv);
     4506    int rc2 = hdaR3AttachInternal(pThis, uLUN, fFlags, &pDrv);
    45044507    if (RT_SUCCESS(rc2))
    45054508    {
    4506         PHDASTREAM pStream = hdaGetStreamFromSink(pThis, &pThis->SinkFront);
     4509        PHDASTREAM pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkFront);
    45074510        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4508             hdaMixerAddDrvStream(pThis, pThis->SinkFront.pMixSink,     &pStream->State.Cfg, pDrv);
     4511            hdaR3MixerAddDrvStream(pThis, pThis->SinkFront.pMixSink,     &pStream->State.Cfg, pDrv);
    45094512
    45104513#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    4511         pStream = hdaGetStreamFromSink(pThis, &pThis->SinkCenterLFE);
     4514        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkCenterLFE);
    45124515        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4513             hdaMixerAddDrvStream(pThis, pThis->SinkCenterLFE.pMixSink, &pStream->State.Cfg, pDrv);
    4514 
    4515         pStream = hdaGetStreamFromSink(pThis, &pThis->SinkRear);
     4516            hdaR3MixerAddDrvStream(pThis, pThis->SinkCenterLFE.pMixSink, &pStream->State.Cfg, pDrv);
     4517
     4518        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkRear);
    45164519        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4517             hdaMixerAddDrvStream(pThis, pThis->SinkRear.pMixSink,      &pStream->State.Cfg, pDrv);
     4520            hdaR3MixerAddDrvStream(pThis, pThis->SinkRear.pMixSink,      &pStream->State.Cfg, pDrv);
    45184521#endif
    4519         pStream = hdaGetStreamFromSink(pThis, &pThis->SinkLineIn);
     4522        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn);
    45204523        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4521             hdaMixerAddDrvStream(pThis, pThis->SinkLineIn.pMixSink,    &pStream->State.Cfg, pDrv);
     4524            hdaR3MixerAddDrvStream(pThis, pThis->SinkLineIn.pMixSink,    &pStream->State.Cfg, pDrv);
    45224525
    45234526#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    4524         pStream = hdaGetStreamFromSink(pThis, &pThis->SinkMicIn);
     4527        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn);
    45254528        if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
    4526             hdaMixerAddDrvStream(pThis, pThis->SinkMicIn.pMixSink,     &pStream->State.Cfg, pDrv);
     4529            hdaR3MixerAddDrvStream(pThis, pThis->SinkMicIn.pMixSink,     &pStream->State.Cfg, pDrv);
    45274530#endif
    45284531    }
     
    45364539 * @interface_method_impl{PDMDEVREG,pfnDetach}
    45374540 */
    4538 static DECLCALLBACK(void) hdaDetach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
     4541static DECLCALLBACK(void) hdaR3Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
    45394542{
    45404543    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    45494552        if (pDrv->uLUN == uLUN)
    45504553        {
    4551             int rc2 = hdaDetachInternal(pThis, pDrv, fFlags);
     4554            int rc2 = hdaR3DetachInternal(pThis, pDrv, fFlags);
    45524555            if (RT_SUCCESS(rc2))
    45534556            {
     
    45684571 * @param   pDevIns             Device instance to power off.
    45694572 */
    4570 static DECLCALLBACK(void) hdaPowerOff(PPDMDEVINS pDevIns)
     4573static DECLCALLBACK(void) hdaR3PowerOff(PPDMDEVINS pDevIns)
    45714574{
    45724575    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    45804583
    45814584    /*
    4582      * Note: Destroy the mixer while powering off and *not* in hdaDestruct,
     4585     * Note: Destroy the mixer while powering off and *not* in hdaR3Destruct,
    45834586     *       giving the mixer the chance to release any references held to
    45844587     *       PDM audio streams it maintains.
     
    46084611 * @param   pszDriver   New driver name to attach.
    46094612 */
    4610 static int hdaReattachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint8_t uLUN, const char *pszDriver)
     4613static int hdaR3ReattachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint8_t uLUN, const char *pszDriver)
    46114614{
    46124615    AssertPtrReturn(pThis,     VERR_INVALID_POINTER);
     
    46174620    if (pDrv)
    46184621    {
    4619         rc = hdaDetachInternal(pThis, pDrv, 0 /* fFlags */);
     4622        rc = hdaR3DetachInternal(pThis, pDrv, 0 /* fFlags */);
    46204623        if (RT_SUCCESS(rc))
    46214624            rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */);
     
    46534656
    46544657    if (RT_SUCCESS(rc))
    4655         rc = hdaAttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
     4658        rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
    46564659
    46574660    LogFunc(("pThis=%p, uLUN=%u, pszDriver=%s, rc=%Rrc\n", pThis, uLUN, pszDriver, rc));
     
    46664669 * @interface_method_impl{PDMDEVREG,pfnReset}
    46674670 */
    4668 static DECLCALLBACK(void) hdaReset(PPDMDEVINS pDevIns)
     4671static DECLCALLBACK(void) hdaR3Reset(PPDMDEVINS pDevIns)
    46694672{
    46704673    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
     
    46764679     /*
    46774680     * 18.2.6,7 defines that values of this registers might be cleared on power on/reset
    4678      * hdaReset shouldn't affects these registers.
     4681     * hdaR3Reset shouldn't affects these registers.
    46794682     */
    46804683    HDA_REG(pThis, WAKEEN)  = 0x0;
    46814684
    4682     hdaGCTLReset(pThis);
     4685    hdaR3GCTLReset(pThis);
    46834686
    46844687    /* Indicate that HDA is not in reset. The firmware is supposed to (un)reset HDA,
     
    46944697 * @interface_method_impl{PDMDEVREG,pfnRelocate}
    46954698 */
    4696 static DECLCALLBACK(void) hdaRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
     4699static DECLCALLBACK(void) hdaR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    46974700{
    46984701    NOREF(offDelta);
     
    47054708 * @interface_method_impl{PDMDEVREG,pfnDestruct}
    47064709 */
    4707 static DECLCALLBACK(int) hdaDestruct(PPDMDEVINS pDevIns)
     4710static DECLCALLBACK(int) hdaR3Destruct(PPDMDEVINS pDevIns)
    47084711{
    47094712    PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
     
    47354738
    47364739    for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++)
    4737         hdaStreamDestroy(&pThis->aStreams[i]);
     4740        hdaR3StreamDestroy(&pThis->aStreams[i]);
    47384741
    47394742    DEVHDA_UNLOCK(pThis);
     
    47454748 * @interface_method_impl{PDMDEVREG,pfnConstruct}
    47464749 */
    4747 static DECLCALLBACK(int) hdaConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
     4750static DECLCALLBACK(int) hdaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
    47484751{
    47494752    RT_NOREF(iInstance);
     
    48394842    pThis->pDevInsRC                = PDMDEVINS_2_RCPTR(pDevIns);
    48404843    /* IBase */
    4841     pThis->IBase.pfnQueryInterface  = hdaQueryInterface;
     4844    pThis->IBase.pfnQueryInterface  = hdaR3QueryInterface;
    48424845
    48434846    /* PCI Device */
     
    49254928        return rc;
    49264929
    4927     rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaPciIoRegionMap);
     4930    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaR3PciIoRegionMap);
    49284931    if (RT_FAILURE(rc))
    49294932        return rc;
     
    49434946#endif
    49444947
    4945     rc = PDMDevHlpSSMRegister(pDevIns, HDA_SSM_VERSION, sizeof(*pThis), hdaSaveExec, hdaLoadExec);
     4948    rc = PDMDevHlpSSMRegister(pDevIns, HDA_SSM_VERSION, sizeof(*pThis), hdaR3SaveExec, hdaR3LoadExec);
    49464949    if (RT_FAILURE(rc))
    49474950        return rc;
     
    49554958    {
    49564959        LogFunc(("Trying to attach driver for LUN #%RU32 ...\n", uLUN));
    4957         rc = hdaAttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
     4960        rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
    49584961        if (RT_FAILURE(rc))
    49594962        {
     
    49624965            else if (rc == VERR_AUDIO_BACKEND_INIT_FAILED)
    49634966            {
    4964                 hdaReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
     4967                hdaR3ReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
    49654968                PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
    49664969                    N_("Host audio backend initialization has failed. Selecting the NULL audio backend "
     
    50425045        {
    50435046            /* Set codec callbacks to this controller. */
    5044             pThis->pCodec->pfnCbMixerAddStream    = hdaMixerAddStream;
    5045             pThis->pCodec->pfnCbMixerRemoveStream = hdaMixerRemoveStream;
    5046             pThis->pCodec->pfnCbMixerControl      = hdaMixerControl;
    5047             pThis->pCodec->pfnCbMixerSetVolume    = hdaMixerSetVolume;
     5047            pThis->pCodec->pfnCbMixerAddStream    = hdaR3MixerAddStream;
     5048            pThis->pCodec->pfnCbMixerRemoveStream = hdaR3MixerRemoveStream;
     5049            pThis->pCodec->pfnCbMixerControl      = hdaR3MixerControl;
     5050            pThis->pCodec->pfnCbMixerSetVolume    = hdaR3MixerSetVolume;
    50485051
    50495052            pThis->pCodec->pHDAState = pThis; /* Assign HDA controller state to codec. */
     
    50795082            RTStrPrintf2(szTimer, sizeof(szTimer), "HDA SD%RU8", i);
    50805083
    5081             rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaTimer, &pThis->aStreams[i],
     5084            rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaR3Timer, &pThis->aStreams[i],
    50825085                                        TMTIMER_FLAGS_NO_CRIT_SECT, szTimer, &pThis->pTimer[i]);
    50835086            AssertRCReturn(rc, rc);
     
    50885091            AssertRCReturn(rc, rc);
    50895092
    5090             rc = hdaStreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */);
     5093            rc = hdaR3StreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */);
    50915094            AssertRC(rc);
    50925095        }
     
    51265129                LogRel(("HDA: Falling back to NULL backend (no sound audible)\n"));
    51275130
    5128                 hdaReset(pDevIns);
    5129                 hdaReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
     5131                hdaR3Reset(pDevIns);
     5132                hdaR3ReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
    51305133
    51315134                PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     
    52095212    if (RT_SUCCESS(rc))
    52105213    {
    5211         hdaReset(pDevIns);
     5214        hdaR3Reset(pDevIns);
    52125215
    52135216        /*
    52145217         * Debug and string formatter types.
    52155218         */
    5216         PDMDevHlpDBGFInfoRegister(pDevIns, "hda",         "HDA info. (hda [register case-insensitive])",     hdaDbgInfo);
    5217         PDMDevHlpDBGFInfoRegister(pDevIns, "hdabdle",     "HDA stream BDLE info. (hdabdle [stream number])", hdaDbgInfoBDLE);
    5218         PDMDevHlpDBGFInfoRegister(pDevIns, "hdastream",   "HDA stream info. (hdastream [stream number])",    hdaDbgInfoStream);
    5219         PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes",    "HDA codec nodes.",                                hdaDbgInfoCodecNodes);
    5220         PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].",      hdaDbgInfoCodecSelector);
    5221         PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer",    "HDA mixer state.",                                hdaDbgInfoMixer);
    5222 
    5223         rc = RTStrFormatTypeRegister("bdle",    hdaDbgFmtBDLE,    NULL);
     5219        PDMDevHlpDBGFInfoRegister(pDevIns, "hda",         "HDA info. (hda [register case-insensitive])",     hdaR3DbgInfo);
     5220        PDMDevHlpDBGFInfoRegister(pDevIns, "hdabdle",     "HDA stream BDLE info. (hdabdle [stream number])", hdaR3DbgInfoBDLE);
     5221        PDMDevHlpDBGFInfoRegister(pDevIns, "hdastream",   "HDA stream info. (hdastream [stream number])",    hdaR3DbgInfoStream);
     5222        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes",    "HDA codec nodes.",                                hdaR3DbgInfoCodecNodes);
     5223        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].",      hdaR3DbgInfoCodecSelector);
     5224        PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer",    "HDA mixer state.",                                hdaR3DbgInfoMixer);
     5225
     5226        rc = RTStrFormatTypeRegister("bdle",    hdaR3StrFmtBDLE,    NULL);
    52245227        AssertRC(rc);
    5225         rc = RTStrFormatTypeRegister("sdctl",   hdaDbgFmtSDCTL,   NULL);
     5228        rc = RTStrFormatTypeRegister("sdctl",   hdaR3StrFmtSDCTL,   NULL);
    52265229        AssertRC(rc);
    5227         rc = RTStrFormatTypeRegister("sdsts",   hdaDbgFmtSDSTS,   NULL);
     5230        rc = RTStrFormatTypeRegister("sdsts",   hdaR3StrFmtSDSTS,   NULL);
    52285231        AssertRC(rc);
    5229         rc = RTStrFormatTypeRegister("sdfifos", hdaDbgFmtSDFIFOS, NULL);
     5232        rc = RTStrFormatTypeRegister("sdfifos", hdaR3StrFmtSDFIFOS, NULL);
    52305233        AssertRC(rc);
    5231         rc = RTStrFormatTypeRegister("sdfifow", hdaDbgFmtSDFIFOW, NULL);
     5234        rc = RTStrFormatTypeRegister("sdfifow", hdaR3StrFmtSDFIFOW, NULL);
    52325235        AssertRC(rc);
    52335236
     
    52855288         * Register statistics.
    52865289         */
    5287         PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer,            STAMTYPE_PROFILE, "/Devices/HDA/Timer",             STAMUNIT_TICKS_PER_CALL, "Profiling hdaTimer.");
     5290        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer,            STAMTYPE_PROFILE, "/Devices/HDA/Timer",             STAMUNIT_TICKS_PER_CALL, "Profiling hdaR3Timer.");
    52885291        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatIn,               STAMTYPE_PROFILE, "/Devices/HDA/Input",             STAMUNIT_TICKS_PER_CALL, "Profiling input.");
    52895292        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatOut,              STAMTYPE_PROFILE, "/Devices/HDA/Output",            STAMUNIT_TICKS_PER_CALL, "Profiling output.");
     
    53215324    sizeof(HDASTATE),
    53225325    /* pfnConstruct */
    5323     hdaConstruct,
     5326    hdaR3Construct,
    53245327    /* pfnDestruct */
    5325     hdaDestruct,
     5328    hdaR3Destruct,
    53265329    /* pfnRelocate */
    5327     hdaRelocate,
     5330    hdaR3Relocate,
    53285331    /* pfnMemSetup */
    53295332    NULL,
     
    53315334    NULL,
    53325335    /* pfnReset */
    5333     hdaReset,
     5336    hdaR3Reset,
    53345337    /* pfnSuspend */
    53355338    NULL,
     
    53375340    NULL,
    53385341    /* pfnAttach */
    5339     hdaAttach,
     5342    hdaR3Attach,
    53405343    /* pfnDetach */
    5341     hdaDetach,
     5344    hdaR3Detach,
    53425345    /* pfnQueryInterface. */
    53435346    NULL,
     
    53455348    NULL,
    53465349    /* pfnPowerOff */
    5347     hdaPowerOff,
     5350    hdaR3PowerOff,
    53485351    /* pfnSoftReset */
    53495352    NULL,
  • trunk/src/VBox/Devices/Audio/DevHDACommon.cpp

    r71735 r71736  
    113113 * @param   fForce              Whether to force setting the wall clock value or not.
    114114 */
    115 bool hdaWalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce)
    116 {
    117     const bool     fFrontPassed       = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkFront)->State.Period,
     115bool hdaR3WalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce)
     116{
     117    const bool     fFrontPassed       = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkFront)->State.Period,
    118118                                                                           u64WalClk);
    119     const uint64_t u64FrontAbsWalClk  = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkFront)->State.Period);
     119    const uint64_t u64FrontAbsWalClk  = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkFront)->State.Period);
    120120# ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    121121#  error "Implement me!"
    122122# endif
    123123
    124     const bool     fLineInPassed      = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period, u64WalClk);
    125     const uint64_t u64LineInAbsWalClk = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period);
     124    const bool     fLineInPassed      = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period, u64WalClk);
     125    const uint64_t u64LineInAbsWalClk = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period);
    126126# ifdef VBOX_WITH_HDA_MIC_IN
    127     const bool     fMicInPassed       = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period,  u64WalClk);
    128     const uint64_t u64MicInAbsWalClk  = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period);
     127    const bool     fMicInPassed       = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period,  u64WalClk);
     128    const uint64_t u64MicInAbsWalClk  = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period);
    129129# endif
    130130
     
    196196 *                              NULL if not found / handled.
    197197 */
    198 PHDAMIXERSINK hdaGetDefaultSink(PHDASTATE pThis, uint8_t uSD)
     198PHDAMIXERSINK hdaR3GetDefaultSink(PHDASTATE pThis, uint8_t uSD)
    199199{
    200200    if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN)
     
    229229}
    230230
    231 #endif /* IN_RING */
     231#endif /* IN_RING3 */
    232232
    233233/**
     
    279279 * @return  Pointer to HDA stream, or NULL if none found.
    280280 */
    281 PHDASTREAM hdaGetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink)
     281PHDASTREAM hdaR3GetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink)
    282282{
    283283    AssertPtrReturn(pThis, NULL);
     
    298298 * @param   pcbRead             Returns read bytes from DMA. Optional.
    299299 */
    300 int hdaDMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
     300int hdaR3DMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
    301301{
    302302    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
     
    383383 * @param   pcbWritten          Returns written bytes on success. Optional.
    384384 */
    385 int hdaDMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
     385int hdaR3DMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
    386386{
    387387    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
     
    477477}
    478478
     479#ifdef IN_RING3
     480
    479481/**
    480482 * Converts an HDA stream's SDFMT register into a given PCM properties structure.
     
    484486 * @param   pProps              PCM properties structure to hold converted result on success.
    485487 */
    486 int hdaSDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps)
     488int hdaR3SDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps)
    487489{
    488490    AssertPtrReturn(pProps, VERR_INVALID_POINTER);
    489491
    490 #define EXTRACT_VALUE(v, mask, shift) ((v & ((mask) << (shift))) >> (shift))
     492# define EXTRACT_VALUE(v, mask, shift) ((v & ((mask) << (shift))) >> (shift))
    491493
    492494    int rc = VINF_SUCCESS;
     
    556558    }
    557559
    558 #undef EXTRACT_VALUE
     560# undef EXTRACT_VALUE
    559561    return rc;
    560562}
    561563
    562 #ifdef IN_RING3
    563 
    564564# ifdef LOG_ENABLED
    565 void hdaBDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE)
     565void hdaR3BDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE)
    566566{
    567567    LogFlowFunc(("BDLEs @ 0x%x (%RU16):\n", u64BDLBase, cBDLE));
     
    607607 * @param   u16Entry                BDLE entry to fetch.
    608608 */
    609 int hdaBDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry)
     609int hdaR3BDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry)
    610610{
    611611    AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
     
    642642 * @param   pBDLE               BDLE to retrieve status for.
    643643 */
    644 bool hdaBDLEIsComplete(PHDABDLE pBDLE)
     644bool hdaR3BDLEIsComplete(PHDABDLE pBDLE)
    645645{
    646646    bool fIsComplete = false;
     
    664664 * @param   pBDLE               BDLE to retrieve status for.
    665665 */
    666 bool hdaBDLENeedsInterrupt(PHDABDLE pBDLE)
     666bool hdaR3BDLENeedsInterrupt(PHDABDLE pBDLE)
    667667{
    668668    return (pBDLE->Desc.fFlags & HDA_BDLE_FLAG_IOC);
     
    687687 *          Forcing a new expiration time will override the above mechanism.
    688688 */
    689 bool hdaTimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce)
     689bool hdaR3TimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce)
    690690{
    691691    AssertPtr(pThis);
     
    696696    if (!fForce)
    697697    {
    698         if (hdaStreamTransferIsScheduled(pStream))
    699             tsExpireMin = RT_MIN(tsExpireMin, hdaStreamTransferGetNext(pStream));
     698        if (hdaR3StreamTransferIsScheduled(pStream))
     699            tsExpireMin = RT_MIN(tsExpireMin, hdaR3StreamTransferGetNext(pStream));
    700700    }
    701701
  • trunk/src/VBox/Devices/Audio/DevHDACommon.h

    r71735 r71736  
    7676#define HDA_NUM_GENERAL_REGS        34
    7777/** Number of total registers in the HDA's register map. */
    78 #define HDA_NUM_REGS                                       (HDA_NUM_GENERAL_REGS + (HDA_MAX_STREAMS * 10 /* Each stream descriptor has 10 registers */))
     78#define HDA_NUM_REGS                (HDA_NUM_GENERAL_REGS + (HDA_MAX_STREAMS * 10 /* Each stream descriptor has 10 registers */))
    7979/** Total number of stream tags (channels). Index 0 is reserved / invalid. */
    8080#define HDA_MAX_TAGS                16
     
    517517
    518518
    519 /*********************************************************************************************************************************
    520 *   Prototypes                                                                                                                 *
    521 *********************************************************************************************************************************/
    522519
    523520/** The HDA controller. */
     
    580577 * @{
    581578 */
    582 PHDAMIXERSINK hdaGetDefaultSink(PHDASTATE pThis, uint8_t uSD);
     579#ifdef IN_RING3
     580PHDAMIXERSINK hdaR3GetDefaultSink(PHDASTATE pThis, uint8_t uSD);
     581#endif
    583582PDMAUDIODIR   hdaGetDirFromSD(uint8_t uSD);
    584583PHDASTREAM    hdaGetStreamFromSD(PHDASTATE pThis, uint8_t uSD);
    585 PHDASTREAM    hdaGetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink);
     584#ifdef IN_RING3
     585PHDASTREAM    hdaR3GetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink);
     586#endif
    586587/** @} */
    587588
     
    601602uint64_t      hdaWalClkGetCurrent(PHDASTATE pThis);
    602603#ifdef IN_RING3
    603 bool          hdaWalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce);
     604bool          hdaR3WalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce);
    604605#endif
    605606/** @} */
     
    608609 * @{
    609610 */
    610 int           hdaDMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
    611 int           hdaDMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
     611#ifdef IN_RING3
     612int           hdaR3DMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
     613int           hdaR3DMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
     614#endif
    612615/** @} */
    613616
     
    617620uint32_t      hdaGetINTSTS(PHDASTATE pThis);
    618621#ifdef IN_RING3
    619 int           hdaSDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps);
     622int           hdaR3SDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps);
    620623#endif /* IN_RING3 */
    621624/** @} */
     
    626629#ifdef IN_RING3
    627630# ifdef LOG_ENABLED
    628 void          hdaBDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE);
     631void          hdaR3BDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE);
    629632# endif
    630 int           hdaBDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry);
    631 bool          hdaBDLEIsComplete(PHDABDLE pBDLE);
    632 bool          hdaBDLENeedsInterrupt(PHDABDLE pBDLE);
     633int           hdaR3BDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry);
     634bool          hdaR3BDLEIsComplete(PHDABDLE pBDLE);
     635bool          hdaR3BDLENeedsInterrupt(PHDABDLE pBDLE);
    633636#endif /* IN_RING3 */
    634637/** @} */
     
    638641 */
    639642#ifdef IN_RING3
    640 bool          hdaTimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce);
     643bool          hdaR3TimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce);
    641644#endif /* IN_RING3 */
    642645/** @} */
  • trunk/src/VBox/Devices/Audio/HDAStream.cpp

    r71735 r71736  
    4545 * @param   u8SD                Stream descriptor number to assign.
    4646 */
    47 int hdaStreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD)
     47int hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD)
    4848{
    4949    RT_NOREF(pThis);
     
    6868    AssertRCReturn(rc, rc);
    6969
    70     rc = hdaStreamPeriodCreate(&pStream->State.Period);
     70    rc = hdaR3StreamPeriodCreate(&pStream->State.Period);
    7171    AssertRCReturn(rc, rc);
    7272
     
    119119 * @param   pStream             HDA stream to destroy.
    120120 */
    121 void hdaStreamDestroy(PHDASTREAM pStream)
     121void hdaR3StreamDestroy(PHDASTREAM pStream)
    122122{
    123123    AssertPtrReturnVoid(pStream);
     
    125125    LogFlowFunc(("[SD%RU8]: Destroying ...\n", pStream->u8SD));
    126126
    127     hdaStreamMapDestroy(&pStream->State.Mapping);
     127    hdaR3StreamMapDestroy(&pStream->State.Mapping);
    128128
    129129    int rc2;
    130130
    131131#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    132     rc2 = hdaStreamAsyncIODestroy(pStream);
     132    rc2 = hdaR3StreamAsyncIODestroy(pStream);
    133133    AssertRC(rc2);
    134134#endif
     
    146146    }
    147147
    148     hdaStreamPeriodDestroy(&pStream->State.Period);
     148    hdaR3StreamPeriodDestroy(&pStream->State.Period);
    149149
    150150#ifdef DEBUG
     
    175175 * @param   uSD                 SD (stream descriptor) number to assign the HDA stream to.
    176176 */
    177 int hdaStreamInit(PHDASTREAM pStream, uint8_t uSD)
     177int hdaR3StreamInit(PHDASTREAM pStream, uint8_t uSD)
    178178{
    179179    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
     
    191191    PPDMAUDIOSTREAMCFG pCfg = &pStream->State.Cfg;
    192192
    193     int rc = hdaSDFMTToPCMProps(HDA_STREAM_REG(pThis, FMT, uSD), &pCfg->Props);
     193    int rc = hdaR3SDFMTToPCMProps(HDA_STREAM_REG(pThis, FMT, uSD), &pCfg->Props);
    194194    if (RT_FAILURE(rc))
    195195    {
     
    246246     * number of channels in a single audio stream.
    247247     */
    248     rc = hdaStreamMapInit(&pStream->State.Mapping, &pCfg->Props);
     248    rc = hdaR3StreamMapInit(&pStream->State.Mapping, &pCfg->Props);
    249249    AssertRCReturn(rc, rc);
    250250
     
    284284            RT_ZERO(BDLE);
    285285
    286             int rc2 = hdaBDLEFetch(pThis, &BDLE, pStream->u64BDLBase, 0 /* Entry */);
     286            int rc2 = hdaR3BDLEFetch(pThis, &BDLE, pStream->u64BDLBase, 0 /* Entry */);
    287287            AssertRC(rc2);
    288288
     
    299299            if (   !pThis->cPosAdjustFrames
    300300            /* Position adjustmenet buffer *must* have the IOC bit set! */
    301                 && hdaBDLENeedsInterrupt(&BDLE))
     301                && hdaR3BDLENeedsInterrupt(&BDLE))
    302302            {
    303303                /** @todo Implement / use a (dynamic) table once this gets more complicated. */
     
    387387
    388388        /* Make sure to also update the stream's DMA counter (based on its current LPIB value). */
    389         hdaStreamSetPosition(pStream, HDA_STREAM_REG(pThis, LPIB, pStream->u8SD));
     389        hdaR3StreamSetPosition(pStream, HDA_STREAM_REG(pThis, LPIB, pStream->u8SD));
    390390
    391391#ifdef LOG_ENABLED
    392         hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
     392        hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
    393393#endif
    394394    }
     
    407407 * @param   uSD                 Stream descriptor (SD) number to use for this stream.
    408408 */
    409 void hdaStreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD)
     409void hdaR3StreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD)
    410410{
    411411    AssertPtrReturnVoid(pThis);
     
    444444
    445445#ifdef HDA_USE_DMA_ACCESS_HANDLER
    446     hdaStreamUnregisterDMAHandlers(pThis, pStream);
     446    hdaR3StreamUnregisterDMAHandlers(pThis, pStream);
    447447#endif
    448448
    449449    /* Assign the default mixer sink to the stream. */
    450     pStream->pMixSink             = hdaGetDefaultSink(pThis, uSD);
     450    pStream->pMixSink             = hdaR3GetDefaultSink(pThis, uSD);
    451451
    452452    pStream->State.tsTransferLast = 0;
     
    460460
    461461    /* Reset stream map. */
    462     hdaStreamMapReset(&pStream->State.Mapping);
     462    hdaR3StreamMapReset(&pStream->State.Mapping);
    463463
    464464    /* (Re-)initialize the stream with current values. */
    465     int rc2 = hdaStreamInit(pStream, uSD);
     465    int rc2 = hdaR3StreamInit(pStream, uSD);
    466466    AssertRC(rc2);
    467467
    468468    /* Reset the stream's period. */
    469     hdaStreamPeriodReset(&pStream->State.Period);
     469    hdaR3StreamPeriodReset(&pStream->State.Period);
    470470
    471471#ifdef DEBUG
     
    496496 * @param   fEnable             Whether to enable or disble the stream.
    497497 */
    498 int hdaStreamEnable(PHDASTREAM pStream, bool fEnable)
     498int hdaR3StreamEnable(PHDASTREAM pStream, bool fEnable)
    499499{
    500500    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
     
    545545}
    546546
    547 uint32_t hdaStreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream)
     547uint32_t hdaR3StreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream)
    548548{
    549549    return HDA_STREAM_REG(pThis, LPIB, pStream->u8SD);
     
    557557 * @param   u32LPIB             Absolute position (in bytes) to set current read / write position to.
    558558 */
    559 void hdaStreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB)
     559void hdaR3StreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB)
    560560{
    561561    AssertPtrReturnVoid(pStream);
     
    583583 * @param   pStream             HDA stream to retrieve size for.
    584584 */
    585 uint32_t hdaStreamGetUsed(PHDASTREAM pStream)
     585uint32_t hdaR3StreamGetUsed(PHDASTREAM pStream)
    586586{
    587587    AssertPtrReturn(pStream, 0);
     
    599599 * @param   pStream             HDA stream to retrieve size for.
    600600 */
    601 uint32_t hdaStreamGetFree(PHDASTREAM pStream)
     601uint32_t hdaR3StreamGetFree(PHDASTREAM pStream)
    602602{
    603603    AssertPtrReturn(pStream, 0);
     
    617617 * @param   pStream             HDA stream to retrieve schedule status for.
    618618 */
    619 bool hdaStreamTransferIsScheduled(PHDASTREAM pStream)
     619bool hdaR3StreamTransferIsScheduled(PHDASTREAM pStream)
    620620{
    621621    if (pStream)
     
    649649 * @param   pStream             HDA stream to retrieve timestamp for.
    650650 */
    651 uint64_t hdaStreamTransferGetNext(PHDASTREAM pStream)
     651uint64_t hdaR3StreamTransferGetNext(PHDASTREAM pStream)
    652652{
    653653    return pStream->State.tsTransferNext;
     
    664664 * @param   pcbWritten          Number of bytes written. Optional.
    665665 */
    666 int hdaStreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
     666int hdaR3StreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
    667667{
    668668    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
     
    731731 * @param   pcbRead             Number of bytes read. Optional.
    732732 */
    733 int hdaStreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead)
     733int hdaR3StreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead)
    734734{
    735735    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
     
    806806 * @param   cbToProcessMax      How much data (in bytes) to process as maximum.
    807807 */
    808 int hdaStreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax)
     808int hdaR3StreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax)
    809809{
    810810    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
    811811
    812     hdaStreamLock(pStream);
     812    hdaR3StreamLock(pStream);
    813813
    814814    PHDASTATE pThis = pStream->pHDAState;
     
    816816
    817817    PHDASTREAMPERIOD pPeriod = &pStream->State.Period;
    818     if (!hdaStreamPeriodLock(pPeriod))
     818    if (!hdaR3StreamPeriodLock(pPeriod))
    819819        return VERR_ACCESS_DENIED;
    820820
     
    835835    if (!fProceed)
    836836    {
    837         hdaStreamPeriodUnlock(pPeriod);
    838         hdaStreamUnlock(pStream);
     837        hdaR3StreamPeriodUnlock(pPeriod);
     838        hdaR3StreamUnlock(pStream);
    839839        return VINF_SUCCESS;
    840840    }
     
    866866    /* Fetch first / next BDL entry. */
    867867    PHDABDLE pBDLE = &pStream->State.BDLE;
    868     if (hdaBDLEIsComplete(pBDLE))
    869     {
    870         rc = hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
     868    if (hdaR3BDLEIsComplete(pBDLE))
     869    {
     870        rc = hdaR3BDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
    871871        AssertRC(rc);
    872872    }
     
    956956            }
    957957
    958             rc = hdaDMAWrite(pThis, pStream, abChunk, cbDMAWritten, &cbDMA /* pcbWritten */);
     958            rc = hdaR3DMAWrite(pThis, pStream, abChunk, cbDMAWritten, &cbDMA /* pcbWritten */);
    959959            if (RT_FAILURE(rc))
    960960                LogRel(("HDA: Writing to stream #%RU8 DMA failed with %Rrc\n", pStream->u8SD, rc));
     
    966966            STAM_PROFILE_START(&pThis->StatOut, a);
    967967
    968             rc = hdaDMARead(pThis, pStream, abChunk, cbChunk, &cbDMA /* pcbRead */);
     968            rc = hdaR3DMARead(pThis, pStream, abChunk, cbChunk, &cbDMA /* pcbRead */);
    969969            if (RT_SUCCESS(rc))
    970970            {
     
    999999                else
    10001000                {
    1001                     /**
     1001                    /*
    10021002                     * The following code extracts the required audio stream (channel) data
    10031003                     * of non-interleaved *and* interleaved audio streams.
     
    10101010                     * and just discard the other channel's data.
    10111011                     *
    1012                      * @todo Optimize this stuff -- copying only one frame a time is expensive.
    10131012                     */
     1013                    /** @todo Optimize this stuff -- copying only one frame a time is expensive. */
    10141014                    uint32_t cbDMARead = pStream->State.cbDMALeft ? pStream->State.cbFrameSize - pStream->State.cbDMALeft : 0;
    10151015                    uint32_t cbDMALeft = RT_MIN(cbDMA, (uint32_t)RTCircBufFree(pCircBuf));
     
    10701070            }
    10711071
    1072             /**
     1072            /*
    10731073             * Update the stream's current position.
    10741074             * Do this as accurate and close to the actual data transfer as possible.
    10751075             * All guetsts rely on this, depending on the mechanism they use (LPIB register or DMA counters).
    10761076             */
    1077             uint32_t cbStreamPos = hdaStreamGetPosition(pThis, pStream);
     1077            uint32_t cbStreamPos = hdaR3StreamGetPosition(pThis, pStream);
    10781078            if (cbStreamPos == pStream->u32CBL)
    10791079                cbStreamPos = 0;
    10801080
    1081             hdaStreamSetPosition(pStream, cbStreamPos + cbDMA);
    1082         }
    1083 
    1084         if (hdaBDLEIsComplete(pBDLE))
     1081            hdaR3StreamSetPosition(pStream, cbStreamPos + cbDMA);
     1082        }
     1083
     1084        if (hdaR3BDLEIsComplete(pBDLE))
    10851085        {
    10861086            Log3Func(("[SD%RU8] Complete: %R[bdle]\n", pStream->u8SD, pBDLE));
    10871087
    10881088                /* Does the current BDLE require an interrupt to be sent? */
    1089             if (   hdaBDLENeedsInterrupt(pBDLE)
     1089            if (   hdaR3BDLENeedsInterrupt(pBDLE)
    10901090                /* Are we done doing the position adjustment?
    10911091                 * It can happen that a BDLE which is handled while doing the
     
    11161116
    11171117            /* Fetch the next BDLE entry. */
    1118             hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
     1118            hdaR3BDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
    11191119        }
    11201120
     
    11371137    if (pStream->State.cPosAdjustFramesLeft == 0)
    11381138    {
    1139         hdaStreamPeriodInc(pPeriod, RT_MIN(cbProcessed / pStream->State.cbFrameSize, hdaStreamPeriodGetRemainingFrames(pPeriod)));
     1139        hdaR3StreamPeriodInc(pPeriod, RT_MIN(cbProcessed / pStream->State.cbFrameSize,
     1140                                             hdaR3StreamPeriodGetRemainingFrames(pPeriod)));
    11401141
    11411142        pStream->State.cbTransferProcessed += cbProcessed;
     
    11521153    if (fTransferComplete)
    11531154    {
    1154         /**
     1155        /*
    11551156         * Try updating the wall clock.
    11561157         *
     
    11641165         *         sound output. Running VLC on the guest will tell!
    11651166         */
    1166         const bool fWalClkSet = hdaWalClkSet(pThis,
    1167                                                hdaWalClkGetCurrent(pThis)
    1168                                              + hdaStreamPeriodFramesToWalClk(pPeriod, pStream->State.cbTransferProcessed / pStream->State.cbFrameSize),
    1169                                              false /* fForce */);
     1167        const bool fWalClkSet = hdaR3WalClkSet(pThis,
     1168                                                 hdaWalClkGetCurrent(pThis)
     1169                                               + hdaR3StreamPeriodFramesToWalClk(pPeriod,
     1170                                                                                   pStream->State.cbTransferProcessed
     1171                                                                                 / pStream->State.cbFrameSize),
     1172                                               false /* fForce */);
    11701173        RT_NOREF(fWalClkSet);
    11711174    }
     
    11761179        Log3Func(("[SD%RU8] Scheduling interrupt\n", pStream->u8SD));
    11771180
    1178         /**
     1181        /*
    11791182         * Set the stream's BCIS bit.
    11801183         *
     
    12111214        tsTransferNext = tsNow + (cbTransferNext * pStream->State.cTicksPerByte);
    12121215
    1213         /**
     1216        /*
    12141217         * If the current transfer is complete, reset our counter.
    12151218         *
     
    12301233
    12311234        LogFunc(("Timer set SD%RU8\n", pStream->u8SD));
    1232         hdaTimerSet(pStream->pHDAState, pStream, tsTransferNext, false /* fForce */);
     1235        hdaR3TimerSet(pStream->pHDAState, pStream, tsTransferNext, false /* fForce */);
    12331236
    12341237        TMTimerLock(pStream->pTimer, VINF_SUCCESS);
     
    12461249              pStream->u8SD, tsNow, tsTransferNext, tsTransferNext - tsNow));
    12471250
    1248     hdaStreamPeriodUnlock(pPeriod);
    1249     hdaStreamUnlock(pStream);
     1251    hdaR3StreamPeriodUnlock(pPeriod);
     1252    hdaR3StreamUnlock(pStream);
    12501253
    12511254    return VINF_SUCCESS;
     
    12621265 *                              context or an asynchronous I/O stream thread (if supported).
    12631266 */
    1264 void hdaStreamUpdate(PHDASTREAM pStream, bool fInTimer)
     1267void hdaR3StreamUpdate(PHDASTREAM pStream, bool fInTimer)
    12651268{
    12661269    if (!pStream)
     
    12821285    {
    12831286        /* Is the HDA stream ready to be written (guest output data) to? If so, by how much? */
    1284         const uint32_t cbFree = hdaStreamGetFree(pStream);
     1287        const uint32_t cbFree = hdaR3StreamGetFree(pStream);
    12851288
    12861289        if (   fInTimer
     
    12901293
    12911294            /* Do the DMA transfer. */
    1292             rc2 = hdaStreamTransfer(pStream, cbFree);
     1295            rc2 = hdaR3StreamTransfer(pStream, cbFree);
    12931296            AssertRC(rc2);
    12941297        }
    12951298
    12961299        /* How much (guest output) data is available at the moment for the HDA stream? */
    1297         uint32_t cbUsed = hdaStreamGetUsed(pStream);
     1300        uint32_t cbUsed = hdaR3StreamGetUsed(pStream);
    12981301
    12991302#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     
    13011304            && cbUsed)
    13021305        {
    1303             rc2 = hdaStreamAsyncIONotify(pStream);
     1306            rc2 = hdaR3StreamAsyncIONotify(pStream);
    13041307            AssertRC(rc2);
    13051308        }
     
    13171320            {
    13181321                /* Read (guest output) data and write it to the stream's sink. */
    1319                 rc2 = hdaStreamRead(pStream, cbUsed, NULL /* pcbRead */);
     1322                rc2 = hdaR3StreamRead(pStream, cbUsed, NULL /* pcbRead */);
    13201323                AssertRC(rc2);
    13211324            }
     
    13431346
    13441347            /* How much (guest input) data is available for writing at the moment for the HDA stream? */
    1345             const uint32_t cbFree = hdaStreamGetFree(pStream);
     1348            const uint32_t cbFree = hdaR3StreamGetFree(pStream);
    13461349
    13471350            Log3Func(("[SD%RU8] cbReadable=%RU32, cbFree=%RU32\n", pStream->u8SD, cbReadable, cbFree));
     
    13701373                    /* Write (guest input) data to the stream which was read from stream's sink before. */
    13711374                    uint32_t cbWritten;
    1372                     rc2 = hdaStreamWrite(pStream, abFIFO, cbRead, &cbWritten);
     1375                    rc2 = hdaR3StreamWrite(pStream, abFIFO, cbRead, &cbWritten);
    13731376                    AssertRCBreak(rc2);
    13741377
     
    13921395                if (cbReadable)
    13931396                {
    1394                     rc2 = hdaStreamWrite(pStream, NULL /* Silence */, cbReadable, NULL /* pcbWritten */);
     1397                    rc2 = hdaR3StreamWrite(pStream, NULL /* Silence */, cbReadable, NULL /* pcbWritten */);
    13951398                    AssertRC(rc2);
    13961399                }
     
    14091412            if (tsNow - s_lasti >= 10) /** @todo Fix this properly. */
    14101413            {
    1411                 rc2 = hdaStreamAsyncIONotify(pStream);
     1414                rc2 = hdaR3StreamAsyncIONotify(pStream);
    14121415                AssertRC(rc2);
    14131416
     
    14151418            }
    14161419
    1417             const uint32_t cbToTransfer = hdaStreamGetUsed(pStream);
     1420            const uint32_t cbToTransfer = hdaR3StreamGetUsed(pStream);
    14181421            if (cbToTransfer)
    14191422            {
    1420                 rc2 = hdaStreamTransfer(pStream, cbToTransfer);
     1423                rc2 = hdaR3StreamTransfer(pStream, cbToTransfer);
    14211424                AssertRC(rc2);
    14221425            }
     
    14331436 * @param   pStream             HDA stream to lock.
    14341437 */
    1435 void hdaStreamLock(PHDASTREAM pStream)
     1438void hdaR3StreamLock(PHDASTREAM pStream)
    14361439{
    14371440    AssertPtrReturnVoid(pStream);
     
    14461449 * @param   pStream             HDA stream to unlock.
    14471450 */
    1448 void hdaStreamUnlock(PHDASTREAM pStream)
     1451void hdaR3StreamUnlock(PHDASTREAM pStream)
    14491452{
    14501453    AssertPtrReturnVoid(pStream);
     
    14611464 * @param   u32LPIB             New LPIB (position) value to set.
    14621465 */
    1463 uint32_t hdaStreamUpdateLPIB(PHDASTREAM pStream, uint32_t u32LPIB)
     1466uint32_t hdaR3StreamUpdateLPIB(PHDASTREAM pStream, uint32_t u32LPIB)
    14641467{
    14651468    AssertPtrReturn(pStream, 0);
     
    14971500 * @param   pStream             HDA stream to register BDLE access handlers for.
    14981501 */
    1499 bool hdaStreamRegisterDMAHandlers(PHDASTREAM pStream)
     1502bool hdaR3StreamRegisterDMAHandlers(PHDASTREAM pStream)
    15001503{
    15011504    /* At least LVI and the BDL base must be set. */
     
    15061509    }
    15071510
    1508     hdaStreamUnregisterDMAHandlers(pStream);
     1511    hdaR3StreamUnregisterDMAHandlers(pStream);
    15091512
    15101513    LogFunc(("Registering ...\n"));
     
    15271530    {
    15281531        HDABDLE BDLE;
    1529         rc = hdaBDLEFetch(pThis, &BDLE, pStream->u64BDLBase, i /* Index */);
     1532        rc = hdaR3BDLEFetch(pThis, &BDLE, pStream->u64BDLBase, i /* Index */);
    15301533        if (RT_FAILURE(rc))
    15311534            break;
     
    16341637 * @param   pStream             HDA stream to unregister BDLE access handlers for.
    16351638 */
    1636 void hdaStreamUnregisterDMAHandlers(PHDASTREAM pStream)
     1639void hdaR3StreamUnregisterDMAHandlers(PHDASTREAM pStream)
    16371640{
    16381641    LogFunc(("\n"));
     
    16701673 * @param   pvUser              User argument. Must be of type PHDASTREAMTHREADCTX.
    16711674 */
    1672 DECLCALLBACK(int) hdaStreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
     1675DECLCALLBACK(int) hdaR3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
    16731676{
    16741677    PHDASTREAMTHREADCTX pCtx = (PHDASTREAMTHREADCTX)pvUser;
     
    17041707            }
    17051708
    1706             hdaStreamUpdate(pStream, false /* fInTimer */);
     1709            hdaR3StreamUpdate(pStream, false /* fInTimer */);
    17071710
    17081711            int rc3 = RTCritSectLeave(&pAIO->CritSect);
     
    17261729 * @param   pStream             HDA audio stream to create the async I/O thread for.
    17271730 */
    1728 int hdaStreamAsyncIOCreate(PHDASTREAM pStream)
     1731int hdaR3StreamAsyncIOCreate(PHDASTREAM pStream)
    17291732{
    17301733    PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
     
    17471750                RTStrPrintf2(szThreadName, sizeof(szThreadName), "hdaAIO%RU8", pStream->u8SD);
    17481751
    1749                 rc = RTThreadCreate(&pAIO->Thread, hdaStreamAsyncIOThread, &Ctx,
     1752                rc = RTThreadCreate(&pAIO->Thread, hdaR3StreamAsyncIOThread, &Ctx,
    17501753                                    0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, szThreadName);
    17511754                if (RT_SUCCESS(rc))
     
    17671770 * @param   pStream             HDA audio stream to destroy the async I/O thread for.
    17681771 */
    1769 int hdaStreamAsyncIODestroy(PHDASTREAM pStream)
     1772int hdaR3StreamAsyncIODestroy(PHDASTREAM pStream)
    17701773{
    17711774    PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
     
    17761779    ASMAtomicWriteBool(&pAIO->fShutdown, true);
    17771780
    1778     int rc = hdaStreamAsyncIONotify(pStream);
     1781    int rc = hdaR3StreamAsyncIONotify(pStream);
    17791782    AssertRC(rc);
    17801783
     
    18061809 * @param   pStream             HDA stream to notify async I/O thread for.
    18071810 */
    1808 int hdaStreamAsyncIONotify(PHDASTREAM pStream)
     1811int hdaR3StreamAsyncIONotify(PHDASTREAM pStream)
    18091812{
    18101813    return RTSemEventSignal(pStream->State.AIO.Event);
     
    18161819 * @param   pStream             HDA stream to lock async I/O thread for.
    18171820 */
    1818 void hdaStreamAsyncIOLock(PHDASTREAM pStream)
     1821void hdaR3StreamAsyncIOLock(PHDASTREAM pStream)
    18191822{
    18201823    PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
     
    18321835 * @param   pStream             HDA stream to unlock async I/O thread for.
    18331836 */
    1834 void hdaStreamAsyncIOUnlock(PHDASTREAM pStream)
     1837void hdaR3StreamAsyncIOUnlock(PHDASTREAM pStream)
    18351838{
    18361839    PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
     
    18511854 * @remarks Does not do locking.
    18521855 */
    1853 void hdaStreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable)
     1856void hdaR3StreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable)
    18541857{
    18551858    PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
  • trunk/src/VBox/Devices/Audio/HDAStream.h

    r71733 r71736  
    243243 * @{
    244244 */
    245 int               hdaStreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD);
    246 void              hdaStreamDestroy(PHDASTREAM pStream);
    247 int               hdaStreamInit(PHDASTREAM pStream, uint8_t uSD);
    248 void              hdaStreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD);
    249 int               hdaStreamEnable(PHDASTREAM pStream, bool fEnable);
    250 uint32_t          hdaStreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream);
    251 void              hdaStreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB);
    252 uint32_t          hdaStreamGetFree(PHDASTREAM pStream);
    253 uint32_t          hdaStreamGetUsed(PHDASTREAM pStream);
    254 bool              hdaStreamTransferIsScheduled(PHDASTREAM pStream);
    255 uint64_t          hdaStreamTransferGetNext(PHDASTREAM pStream);
    256 int               hdaStreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax);
    257 void              hdaStreamLock(PHDASTREAM pStream);
    258 void              hdaStreamUnlock(PHDASTREAM pStream);
    259 int               hdaStreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead);
    260 int               hdaStreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
    261 void              hdaStreamUpdate(PHDASTREAM pStream, bool fAsync);
     245int               hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD);
     246void              hdaR3StreamDestroy(PHDASTREAM pStream);
     247int               hdaR3StreamInit(PHDASTREAM pStream, uint8_t uSD);
     248void              hdaR3StreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD);
     249int               hdaR3StreamEnable(PHDASTREAM pStream, bool fEnable);
     250uint32_t          hdaR3StreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream);
     251void              hdaR3StreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB);
     252uint32_t          hdaR3StreamGetFree(PHDASTREAM pStream);
     253uint32_t          hdaR3StreamGetUsed(PHDASTREAM pStream);
     254bool              hdaR3StreamTransferIsScheduled(PHDASTREAM pStream);
     255uint64_t          hdaR3StreamTransferGetNext(PHDASTREAM pStream);
     256int               hdaR3StreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax);
     257void              hdaR3StreamLock(PHDASTREAM pStream);
     258void              hdaR3StreamUnlock(PHDASTREAM pStream);
     259int               hdaR3StreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead);
     260int               hdaR3StreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
     261void              hdaR3StreamUpdate(PHDASTREAM pStream, bool fAsync);
    262262# ifdef HDA_USE_DMA_ACCESS_HANDLER
    263 bool              hdaStreamRegisterDMAHandlers(PHDASTREAM pStream);
    264 void              hdaStreamUnregisterDMAHandlers(PHDASTREAM pStream);
     263bool              hdaR3StreamRegisterDMAHandlers(PHDASTREAM pStream);
     264void              hdaR3StreamUnregisterDMAHandlers(PHDASTREAM pStream);
    265265# endif /* HDA_USE_DMA_ACCESS_HANDLER */
    266266/** @} */
     
    269269 * @{
    270270 */
    271 DECLCALLBACK(void) hdaStreamTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
     271DECLCALLBACK(void) hdaR3StreamTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
    272272/** @} */
    273273
     
    277277 */
    278278# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    279 DECLCALLBACK(int) hdaStreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
    280 int               hdaStreamAsyncIOCreate(PHDASTREAM pStream);
    281 int               hdaStreamAsyncIODestroy(PHDASTREAM pStream);
    282 int               hdaStreamAsyncIONotify(PHDASTREAM pStream);
    283 void              hdaStreamAsyncIOLock(PHDASTREAM pStream);
    284 void              hdaStreamAsyncIOUnlock(PHDASTREAM pStream);
    285 void              hdaStreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable);
     279DECLCALLBACK(int) hdaR3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
     280int               hdaR3StreamAsyncIOCreate(PHDASTREAM pStream);
     281int               hdaR3StreamAsyncIODestroy(PHDASTREAM pStream);
     282int               hdaR3StreamAsyncIONotify(PHDASTREAM pStream);
     283void              hdaR3StreamAsyncIOLock(PHDASTREAM pStream);
     284void              hdaR3StreamAsyncIOUnlock(PHDASTREAM pStream);
     285void              hdaR3StreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable);
    286286# endif /* VBOX_WITH_AUDIO_HDA_ASYNC_IO */
    287287/** @} */
  • trunk/src/VBox/Devices/Audio/HDAStreamChannel.cpp

    r69118 r71736  
    3535 * @param   fFlags
    3636 */
    37 int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags)
     37int hdaR3StreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags)
    3838{
    3939    int rc = RTCircBufCreate(&pChanData->pCircBuf, 256); /** @todo Make this configurable? */
     
    5151 * @param   pChanData           Channel data to destroy.
    5252 */
    53 void hdaStreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData)
     53void hdaR3StreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData)
    5454{
    5555    if (!pChanData)
     
    7373 * @param   cbBuf               Size (in bytes) of audio data to extract.
    7474 */
    75 int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
     75int hdaR3StreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
    7676{
    7777    AssertPtrReturn(pChan, VERR_INVALID_POINTER);
     
    130130 * @remark  Currently not used / implemented.
    131131 */
    132 int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv)
     132int hdaR3StreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv)
    133133{
    134134    AssertPtrReturn(pChan, VERR_INVALID_POINTER);
     
    142142/**
    143143 * Acquires (reads) audio channel data.
    144  * Must be released when done with hdaStreamChannelReleaseData().
     144 * Must be released when done with hdaR3StreamChannelReleaseData().
    145145 *
    146146 * @returns IPRT status code.
     
    149149 * @param   pcbData             Size (in bytes) of acquired data.
    150150 */
    151 int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void **ppvData, size_t *pcbData)
     151int hdaR3StreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void **ppvData, size_t *pcbData)
    152152{
    153153    AssertPtrReturn(pChanData, VERR_INVALID_POINTER);
     
    162162
    163163/**
    164  * Releases formerly acquired data by hdaStreamChannelAcquireData().
     164 * Releases formerly acquired data by hdaR3StreamChannelAcquireData().
    165165 *
    166166 * @returns IPRT status code.
    167167 * @param   pChanData           Channel data to release formerly acquired data for.
    168168 */
    169 int hdaStreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData)
     169int hdaR3StreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData)
    170170{
    171171    AssertPtrReturn(pChanData, VERR_INVALID_POINTER);
  • trunk/src/VBox/Devices/Audio/HDAStreamChannel.h

    r67908 r71736  
    1919#define HDA_STREAMCHANNEL_H
    2020
    21 int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags);
    22 void hdaStreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData);
    23 int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf);
    24 int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv);
    25 int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *ppvData, size_t *pcbData);
    26 int hdaStreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData);
     21int  hdaR3StreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags);
     22void hdaR3StreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData);
     23int  hdaR3StreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf);
     24int  hdaR3StreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv);
     25int  hdaR3StreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *ppvData, size_t *pcbData);
     26int  hdaR3StreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData);
    2727
    2828#endif /* !HDA_STREAMCHANNEL_H */
  • trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp

    r71724 r71736  
    4242 * @param   pProps              Pointer to PCM properties to use for initialization.
    4343 */
    44 int hdaStreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps)
     44int hdaR3StreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps)
    4545{
    4646    AssertPtrReturn(pMapping, VERR_INVALID_POINTER);
     
    5050        return VERR_INVALID_PARAMETER;
    5151
    52     hdaStreamMapReset(pMapping);
     52    hdaR3StreamMapReset(pMapping);
    5353
    5454    pMapping->paChannels = (PPDMAUDIOSTREAMCHANNEL)RTMemAlloc(sizeof(PDMAUDIOSTREAMCHANNEL) * pProps->cChannels);
     
    7070        pChan->cbOff    = pChan->cbFirst;
    7171
    72         int rc2 = hdaStreamChannelDataInit(&pChan->Data, PDMAUDIOSTREAMCHANNELDATA_FLAG_NONE);
     72        int rc2 = hdaR3StreamChannelDataInit(&pChan->Data, PDMAUDIOSTREAMCHANNELDATA_FLAG_NONE);
    7373        if (RT_SUCCESS(rc))
    7474            rc = rc2;
     
    106106 * @param   pMapping            Pointer to mapping to destroy.
    107107 */
    108 void hdaStreamMapDestroy(PHDASTREAMMAPPING pMapping)
     108void hdaR3StreamMapDestroy(PHDASTREAMMAPPING pMapping)
    109109{
    110     hdaStreamMapReset(pMapping);
     110    hdaR3StreamMapReset(pMapping);
    111111
    112112    if (pMapping->pCircBuf)
     
    123123 * @param   pMapping            Pointer to mapping to reset.
    124124 */
    125 void hdaStreamMapReset(PHDASTREAMMAPPING pMapping)
     125void hdaR3StreamMapReset(PHDASTREAMMAPPING pMapping)
    126126{
    127127    AssertPtrReturnVoid(pMapping);
     
    132132    {
    133133        for (uint8_t i = 0; i < pMapping->cChannels; i++)
    134             hdaStreamChannelDataDestroy(&pMapping->paChannels[i].Data);
     134            hdaR3StreamChannelDataDestroy(&pMapping->paChannels[i].Data);
    135135
    136136        AssertPtr(pMapping->paChannels);
  • trunk/src/VBox/Devices/Audio/HDAStreamMap.h

    r67698 r71736  
    3838 */
    3939#ifdef IN_RING3
    40 int  hdaStreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps);
    41 void hdaStreamMapDestroy(PHDASTREAMMAPPING pMapping);
    42 void hdaStreamMapReset(PHDASTREAMMAPPING pMapping);
     40int  hdaR3StreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps);
     41void hdaR3StreamMapDestroy(PHDASTREAMMAPPING pMapping);
     42void hdaR3StreamMapReset(PHDASTREAMMAPPING pMapping);
    4343#endif /* IN_RING3 */
    4444/** @} */
  • trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp

    r71733 r71736  
    4848 * @param   pPeriod             Stream period to initialize.
    4949 */
    50 int hdaStreamPeriodCreate(PHDASTREAMPERIOD pPeriod)
     50int hdaR3StreamPeriodCreate(PHDASTREAMPERIOD pPeriod)
    5151{
    5252    Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_VALID));
     
    6464 * @param   pPeriod             Stream period to destroy.
    6565 */
    66 void hdaStreamPeriodDestroy(PHDASTREAMPERIOD pPeriod)
     66void hdaR3StreamPeriodDestroy(PHDASTREAMPERIOD pPeriod)
    6767{
    6868    if (pPeriod->fStatus & HDASTREAMPERIOD_FLAG_VALID)
     
    7878 *
    7979 * @return  VBox status code.
    80  * @param   pPeriod             Stream period to (re-)initialize. Must be created with hdaStreamPeriodCreate() first.
     80 * @param   pPeriod             Stream period to (re-)initialize. Must be created with hdaR3StreamPeriodCreate() first.
    8181 * @param   u8SD                Stream descriptor (serial data #) number to assign this stream period to.
    8282 * @param   u16LVI              The HDA stream's LVI value to use for the period calculation.
     
    8484 * @param   pStreamCfg          Audio stream configuration to use for this period.
    8585 */
    86 int hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod,
    87                         uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
     86int hdaR3StreamPeriodInit(PHDASTREAMPERIOD pPeriod,
     87                          uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
    8888{
    8989    if (   !u16LVI
     
    111111    pPeriod->u64StartWalClk    = 0;
    112112    pPeriod->u32Hz             = pStreamCfg->Props.uHz;
    113     pPeriod->u64DurationWalClk = hdaStreamPeriodFramesToWalClk(pPeriod, framesToTransfer);
     113    pPeriod->u64DurationWalClk = hdaR3StreamPeriodFramesToWalClk(pPeriod, framesToTransfer);
    114114    pPeriod->u64ElapsedWalClk  = 0;
    115115    pPeriod->i64DelayWalClk    = 0;
     
    130130 * @param   pPeriod             Stream period to reset.
    131131 */
    132 void hdaStreamPeriodReset(PHDASTREAMPERIOD pPeriod)
     132void hdaR3StreamPeriodReset(PHDASTREAMPERIOD pPeriod)
    133133{
    134134    Log3Func(("[SD%RU8]\n", pPeriod->u8SD));
     
    155155 * @param   u64WalClk           Wall clock (WALCLK) value to set for the period's starting point.
    156156 */
    157 int hdaStreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
     157int hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
    158158{
    159159    Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE)); /* No nested calls. */
     
    177177 * @param   pPeriod             Stream period to end life span for.
    178178 */
    179 void hdaStreamPeriodEnd(PHDASTREAMPERIOD pPeriod)
     179void hdaR3StreamPeriodEnd(PHDASTREAMPERIOD pPeriod)
    180180{
    181181    Log3Func(("[SD%RU8] Took %zuus\n", pPeriod->u8SD, (RTTimeNanoTS() - pPeriod->Dbg.tsStartNs) / 1000));
     
    188188              ("%RU8 interrupts for stream #%RU8 still pending -- so ending a period might trigger audio hangs\n",
    189189               pPeriod->cIntPending, pPeriod->u8SD));
    190     Assert(hdaStreamPeriodIsComplete(pPeriod));
     190    Assert(hdaR3StreamPeriodIsComplete(pPeriod));
    191191
    192192    pPeriod->fStatus &= ~HDASTREAMPERIOD_FLAG_ACTIVE;
     
    198198 * @param   pPeriod             Stream period to pause.
    199199 */
    200 void hdaStreamPeriodPause(PHDASTREAMPERIOD pPeriod)
     200void hdaR3StreamPeriodPause(PHDASTREAMPERIOD pPeriod)
    201201{
    202202    AssertMsg((pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE), ("Period %p already in inactive state\n", pPeriod));
     
    212212 * @param   pPeriod             Stream period to resume.
    213213 */
    214 void hdaStreamPeriodResume(PHDASTREAMPERIOD pPeriod)
     214void hdaR3StreamPeriodResume(PHDASTREAMPERIOD pPeriod)
    215215{
    216216    AssertMsg(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE), ("Period %p already in active state\n", pPeriod));
     
    227227 * @param   pPeriod             Stream period to lock.
    228228 */
    229 bool hdaStreamPeriodLock(PHDASTREAMPERIOD pPeriod)
     229bool hdaR3StreamPeriodLock(PHDASTREAMPERIOD pPeriod)
    230230{
    231231    return RT_SUCCESS(RTCritSectEnter(&pPeriod->CritSect));
     
    237237 * @param   pPeriod             Stream period to unlock.
    238238 */
    239 void hdaStreamPeriodUnlock(PHDASTREAMPERIOD pPeriod)
     239void hdaR3StreamPeriodUnlock(PHDASTREAMPERIOD pPeriod)
    240240{
    241241    int rc2 = RTCritSectLeave(&pPeriod->CritSect);
     
    252252 * @remark  Calculation depends on the given stream period and assumes a 24 MHz wall clock counter (WALCLK).
    253253 */
    254 uint64_t hdaStreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames)
     254uint64_t hdaR3StreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames)
    255255{
    256256    /* Prevent division by zero. */
     
    268268 * @param   pPeriod             Stream period to use.
    269269 */
    270 uint64_t hdaStreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod)
     270uint64_t hdaR3StreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod)
    271271{
    272272    return pPeriod->u64StartWalClk
     
    282282 * @param   pPeriod             Stream period to use.
    283283 */
    284 uint64_t hdaStreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod)
     284uint64_t hdaR3StreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod)
    285285{
    286286    return pPeriod->u64StartWalClk + pPeriod->u64DurationWalClk;
     
    293293 * @param   pPeriod             Stream period to return value for.
    294294 */
    295 uint32_t hdaStreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod)
     295uint32_t hdaR3StreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod)
    296296{
    297297    Assert(pPeriod->framesToTransfer >= pPeriod->framesTransferred);
     
    305305 * @param   pPeriod             Stream period to get status for.
    306306 */
    307 bool hdaStreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod)
     307bool hdaR3StreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod)
    308308{
    309309    return (pPeriod->u64ElapsedWalClk >= pPeriod->u64DurationWalClk);
     
    318318 * @param   u64WalClk           Absolute wall clock (WALCLK) time to check for.
    319319 */
    320 bool hdaStreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
     320bool hdaR3StreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
    321321{
    322322    /* Period not in use? */
     
    324324        return true; /* ... implies that it has passed. */
    325325
    326     if (hdaStreamPeriodHasElapsed(pPeriod))
     326    if (hdaR3StreamPeriodHasElapsed(pPeriod))
    327327        return true; /* Period already has elapsed. */
    328328
     
    336336 * @param   pPeriod             Stream period to get status for.
    337337 */
    338 bool hdaStreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod)
     338bool hdaR3StreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod)
    339339{
    340340    return pPeriod->cIntPending > 0;
     
    349349 *          keeps track of the required (pending) interrupts for a stream period.
    350350 */
    351 void hdaStreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod)
     351void hdaR3StreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod)
    352352{
    353353    uint32_t cIntPending = pPeriod->cIntPending;
     
    368368 * @param   pPeriod             Stream period to release pending interrupt for.
    369369 */
    370 void hdaStreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod)
     370void hdaR3StreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod)
    371371{
    372372    Assert(pPeriod->cIntPending);
     
    383383 * @param   framesInc           Audio frames to add.
    384384 */
    385 void hdaStreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc)
     385void hdaR3StreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc)
    386386{
    387387    pPeriod->framesTransferred += framesInc;
    388388    Assert(pPeriod->framesTransferred <= pPeriod->framesToTransfer);
    389389
    390     pPeriod->u64ElapsedWalClk   = hdaStreamPeriodFramesToWalClk(pPeriod, pPeriod->framesTransferred);
     390    pPeriod->u64ElapsedWalClk   = hdaR3StreamPeriodFramesToWalClk(pPeriod, pPeriod->framesTransferred);
    391391    Assert(pPeriod->u64ElapsedWalClk <= pPeriod->u64DurationWalClk);
    392392
     
    404404 *          and 2) processed all required audio frames.
    405405 */
    406 bool hdaStreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod)
     406bool hdaR3StreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod)
    407407{
    408408    const bool fIsComplete = /* Has the period elapsed time-wise? */
    409                                 hdaStreamPeriodHasElapsed(pPeriod)
     409                                hdaR3StreamPeriodHasElapsed(pPeriod)
    410410                             /* All frames transferred? */
    411411                             && pPeriod->framesTransferred >= pPeriod->framesToTransfer;
     
    422422              fIsComplete ? "COMPLETE" : "NOT COMPLETE YET",
    423423              pPeriod->u64ElapsedWalClk, pPeriod->u64DurationWalClk,
    424               hdaStreamPeriodGetAbsElapsedWalClk(pPeriod), pPeriod->u64StartWalClk,
    425               hdaStreamPeriodGetAbsEndWalClk(pPeriod), pPeriod->cIntPending));
     424              hdaR3StreamPeriodGetAbsElapsedWalClk(pPeriod), pPeriod->u64StartWalClk,
     425              hdaR3StreamPeriodGetAbsEndWalClk(pPeriod), pPeriod->cIntPending));
    426426
    427427    return fIsComplete;
  • trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h

    r71733 r71736  
    8484
    8585#ifdef IN_RING3
    86 int      hdaStreamPeriodCreate(PHDASTREAMPERIOD pPeriod);
    87 void     hdaStreamPeriodDestroy(PHDASTREAMPERIOD pPeriod);
    88 int      hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
    89 void     hdaStreamPeriodReset(PHDASTREAMPERIOD pPeriod);
    90 int      hdaStreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
    91 void     hdaStreamPeriodEnd(PHDASTREAMPERIOD pPeriod);
    92 void     hdaStreamPeriodPause(PHDASTREAMPERIOD pPeriod);
    93 void     hdaStreamPeriodResume(PHDASTREAMPERIOD pPeriod);
    94 bool     hdaStreamPeriodLock(PHDASTREAMPERIOD pPeriod);
    95 void     hdaStreamPeriodUnlock(PHDASTREAMPERIOD pPeriod);
    96 uint64_t hdaStreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames);
    97 uint64_t hdaStreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod);
    98 uint64_t hdaStreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod);
    99 uint32_t hdaStreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod);
    100 bool     hdaStreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod);
    101 bool     hdaStreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
    102 bool     hdaStreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod);
    103 void     hdaStreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod);
    104 void     hdaStreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod);
    105 void     hdaStreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc);
    106 bool     hdaStreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod);
     86int      hdaR3StreamPeriodCreate(PHDASTREAMPERIOD pPeriod);
     87void     hdaR3StreamPeriodDestroy(PHDASTREAMPERIOD pPeriod);
     88int      hdaR3StreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
     89void     hdaR3StreamPeriodReset(PHDASTREAMPERIOD pPeriod);
     90int      hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
     91void     hdaR3StreamPeriodEnd(PHDASTREAMPERIOD pPeriod);
     92void     hdaR3StreamPeriodPause(PHDASTREAMPERIOD pPeriod);
     93void     hdaR3StreamPeriodResume(PHDASTREAMPERIOD pPeriod);
     94bool     hdaR3StreamPeriodLock(PHDASTREAMPERIOD pPeriod);
     95void     hdaR3StreamPeriodUnlock(PHDASTREAMPERIOD pPeriod);
     96uint64_t hdaR3StreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames);
     97uint64_t hdaR3StreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod);
     98uint64_t hdaR3StreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod);
     99uint32_t hdaR3StreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod);
     100bool     hdaR3StreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod);
     101bool     hdaR3StreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
     102bool     hdaR3StreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod);
     103void     hdaR3StreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod);
     104void     hdaR3StreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod);
     105void     hdaR3StreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc);
     106bool     hdaR3StreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod);
    107107#endif /* IN_RING3 */
    108108
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