Index: /trunk/src/VBox/Devices/Audio/DevHDA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 71736)
@@ -297,5 +297,5 @@
 #ifndef VBOX_DEVICE_STRUCT_TESTCASE
 #ifdef IN_RING3
-static void hdaGCTLReset(PHDASTATE pThis);
+static void hdaR3GCTLReset(PHDASTATE pThis);
 #endif
 
@@ -360,8 +360,10 @@
  */
 #ifdef IN_RING3
-static int                        hdaAddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
-static int                        hdaRemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
+static int                        hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
+static int                        hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
 # ifdef HDA_USE_DMA_ACCESS_HANDLER
-static DECLCALLBACK(VBOXSTRICTRC) hdaDMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
+static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
+                                                        void *pvBuf, size_t cbBuf,
+                                                        PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
 # endif
 #endif /* IN_RING3 */
@@ -570,5 +572,5 @@
  * @param   pThis               The HDA device state.
  */
-static void hdaReschedulePendingInterrupts(PHDASTATE pThis)
+static void hdaR3ReschedulePendingInterrupts(PHDASTATE pThis)
 {
     bool fInterrupt = false;
@@ -580,7 +582,7 @@
             continue;
 
-        if (   hdaStreamPeriodIsComplete    (&pStream->State.Period)
-            && hdaStreamPeriodNeedsInterrupt(&pStream->State.Period)
-            && hdaWalClkSet(pThis, hdaStreamPeriodGetAbsElapsedWalClk(&pStream->State.Period), false /* fForce */))
+        if (   hdaR3StreamPeriodIsComplete    (&pStream->State.Period)
+            && hdaR3StreamPeriodNeedsInterrupt(&pStream->State.Period)
+            && hdaR3WalClkSet(pThis, hdaR3StreamPeriodGetAbsElapsedWalClk(&pStream->State.Period), false /* fForce */))
         {
             fInterrupt = true;
@@ -658,5 +660,5 @@
  * @param   offReg              The register offset.
  */
-static int hdaRegLookupWithin(uint32_t offReg)
+static int hdaR3RegLookupWithin(uint32_t offReg)
 {
     /*
@@ -1010,5 +1012,5 @@
         HDA_REG(pThis, GCTL) &= ~HDA_GCTL_CRST;
 
-        hdaGCTLReset(pThis);
+        hdaR3GCTLReset(pThis);
 #else
         AssertFailedReturnStmt(DEVHDA_UNLOCK(pThis), VINF_IOM_R3_MMIO_WRITE);
@@ -1067,17 +1069,17 @@
  * @remark  Does not actually set the wall clock counter.
  */
-static uint64_t hdaWalClkGetMax(PHDASTATE pThis)
+static uint64_t hdaR3WalClkGetMax(PHDASTATE pThis)
 {
     const uint64_t u64WalClkCur       = ASMAtomicReadU64(&pThis->u64WalClk);
     const uint64_t u64FrontAbsWalClk  = pThis->SinkFront.pStream
-                                      ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkFront.pStream->State.Period) : 0;
+                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkFront.pStream->State.Period) : 0;
 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
 #  error "Implement me!"
 # endif
     const uint64_t u64LineInAbsWalClk = pThis->SinkLineIn.pStream
-                                      ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkLineIn.pStream->State.Period) : 0;
+                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkLineIn.pStream->State.Period) : 0;
 # ifdef VBOX_WITH_HDA_MIC_IN
     const uint64_t u64MicInAbsWalClk  = pThis->SinkMicIn.pStream
-                                      ? hdaStreamPeriodGetAbsElapsedWalClk(&pThis->SinkMicIn.pStream->State.Period) : 0;
+                                      ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkMicIn.pStream->State.Period) : 0;
 # endif
 
@@ -1107,5 +1109,5 @@
     *pu32Value = RT_LO_U32(ASMAtomicReadU64(&pThis->u64WalClk));
 
-    Log3Func(("%RU32 (max @ %RU64)\n",*pu32Value, hdaWalClkGetMax(pThis)));
+    Log3Func(("%RU32 (max @ %RU64)\n",*pu32Value, hdaR3WalClkGetMax(pThis)));
 
     DEVHDA_UNLOCK(pThis);
@@ -1353,19 +1355,19 @@
         LogFunc(("[SD%RU8] Reset enter\n", uSD));
 
-        hdaStreamLock(pStream);
+        hdaR3StreamLock(pStream);
 
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-        hdaStreamAsyncIOLock(pStream);
-        hdaStreamAsyncIOEnable(pStream, false /* fEnable */);
+        hdaR3StreamAsyncIOLock(pStream);
+        hdaR3StreamAsyncIOEnable(pStream, false /* fEnable */);
 # endif
         /* Make sure to remove the run bit before doing the actual stream reset. */
         HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN;
 
-        hdaStreamReset(pThis, pStream, pStream->u8SD);
+        hdaR3StreamReset(pThis, pStream, pStream->u8SD);
 
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-        hdaStreamAsyncIOUnlock(pStream);
+        hdaR3StreamAsyncIOUnlock(pStream);
 # endif
-        hdaStreamUnlock(pStream);
+        hdaR3StreamUnlock(pStream);
     }
     else
@@ -1379,5 +1381,5 @@
             LogFunc(("[SD%RU8] State changed (fRun=%RTbool)\n", uSD, fRun));
 
-            hdaStreamLock(pStream);
+            hdaR3StreamLock(pStream);
 
             int rc2;
@@ -1385,27 +1387,27 @@
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
             if (fRun)
-                rc2 = hdaStreamAsyncIOCreate(pStream);
-
-            hdaStreamAsyncIOLock(pStream);
+                rc2 = hdaR3StreamAsyncIOCreate(pStream);
+
+            hdaR3StreamAsyncIOLock(pStream);
 # endif
             if (fRun)
             {
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-                hdaStreamAsyncIOEnable(pStream, fRun /* fEnable */);
+                hdaR3StreamAsyncIOEnable(pStream, fRun /* fEnable */);
 # endif
                 /* (Re-)initialize the stream with current values. */
-                rc2 = hdaStreamInit(pStream, pStream->u8SD);
+                rc2 = hdaR3StreamInit(pStream, pStream->u8SD);
                 AssertRC(rc2);
 
                 /* Remove the old stream from the device setup. */
-                hdaRemoveStream(pThis, &pStream->State.Cfg);
+                hdaR3RemoveStream(pThis, &pStream->State.Cfg);
 
                 /* Add the stream to the device setup. */
-                rc2 = hdaAddStream(pThis, &pStream->State.Cfg);
+                rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg);
                 AssertRC(rc2);
             }
 
             /* Enable/disable the stream. */
-            rc2 = hdaStreamEnable(pStream, fRun /* fEnable */);
+            rc2 = hdaR3StreamEnable(pStream, fRun /* fEnable */);
             AssertRC(rc2);
 
@@ -1416,12 +1418,12 @@
 
                 /* (Re-)init the stream's period. */
-                hdaStreamPeriodInit(&pStream->State.Period,
-                                    pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
+                hdaR3StreamPeriodInit(&pStream->State.Period,
+                                      pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
 
                 /* Begin a new period for this stream. */
-                rc2 = hdaStreamPeriodBegin(&pStream->State.Period, hdaWalClkGetCurrent(pThis)/* Use current wall clock time */);
+                rc2 = hdaR3StreamPeriodBegin(&pStream->State.Period, hdaWalClkGetCurrent(pThis)/* Use current wall clock time */);
                 AssertRC(rc2);
 
-                rc2 = hdaTimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, false /* fForce */);
+                rc2 = hdaR3TimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, false /* fForce */);
                 AssertRC(rc2);
             }
@@ -1434,15 +1436,15 @@
 
                 /* Make sure to (re-)schedule outstanding (delayed) interrupts. */
-                hdaReschedulePendingInterrupts(pThis);
+                hdaR3ReschedulePendingInterrupts(pThis);
 
                 /* Reset the period. */
-                hdaStreamPeriodReset(&pStream->State.Period);
+                hdaR3StreamPeriodReset(&pStream->State.Period);
             }
 
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-            hdaStreamAsyncIOUnlock(pStream);
+            hdaR3StreamAsyncIOUnlock(pStream);
 # endif
             /* Make sure to leave the lock before (eventually) starting the timer. */
-            hdaStreamUnlock(pStream);
+            hdaR3StreamUnlock(pStream);
         }
     }
@@ -1477,5 +1479,5 @@
     }
 
-    hdaStreamLock(pStream);
+    hdaR3StreamLock(pStream);
 
     uint32_t v = HDA_REG_IND(pThis, iReg);
@@ -1492,25 +1494,25 @@
     PHDASTREAMPERIOD pPeriod = &pStream->State.Period;
 
-    if (hdaStreamPeriodLock(pPeriod))
-    {
-        const bool fNeedsInterrupt = hdaStreamPeriodNeedsInterrupt(pPeriod);
+    if (hdaR3StreamPeriodLock(pPeriod))
+    {
+        const bool fNeedsInterrupt = hdaR3StreamPeriodNeedsInterrupt(pPeriod);
         if (fNeedsInterrupt)
-            hdaStreamPeriodReleaseInterrupt(pPeriod);
-
-        if (hdaStreamPeriodIsComplete(pPeriod))
+            hdaR3StreamPeriodReleaseInterrupt(pPeriod);
+
+        if (hdaR3StreamPeriodIsComplete(pPeriod))
         {
             /* Make sure to try to update the WALCLK register if a period is complete.
              * Use the maximum WALCLK value all (active) streams agree to. */
-            const uint64_t uWalClkMax = hdaWalClkGetMax(pThis);
+            const uint64_t uWalClkMax = hdaR3WalClkGetMax(pThis);
             if (uWalClkMax > hdaWalClkGetCurrent(pThis))
-                hdaWalClkSet(pThis, uWalClkMax, false /* fForce */);
-
-            hdaStreamPeriodEnd(pPeriod);
+                hdaR3WalClkSet(pThis, uWalClkMax, false /* fForce */);
+
+            hdaR3StreamPeriodEnd(pPeriod);
 
             if (fRunning)
-                hdaStreamPeriodBegin(pPeriod, hdaWalClkGetCurrent(pThis) /* Use current wall clock time */);
-        }
-
-        hdaStreamPeriodUnlock(pPeriod); /* Unlock before processing interrupt. */
+                hdaR3StreamPeriodBegin(pPeriod, hdaWalClkGetCurrent(pThis) /* Use current wall clock time */);
+        }
+
+        hdaR3StreamPeriodUnlock(pPeriod); /* Unlock before processing interrupt. */
     }
 
@@ -1569,9 +1571,9 @@
             /* Re-arm the timer. */
             LogFunc(("Timer set SD%RU8\n", pStream->u8SD));
-            hdaTimerSet(pThis, pStream, tsNow + cTicksToNext, false /* fForce */);
-        }
-    }
-
-    hdaStreamUnlock(pStream);
+            hdaR3TimerSet(pThis, pStream, tsNow + cTicksToNext, false /* fForce */);
+        }
+    }
+
+    hdaR3StreamUnlock(pStream);
 
     DEVHDA_UNLOCK_BOTH(pThis, uSD);
@@ -1604,5 +1606,5 @@
                 /* Try registering the DMA handlers.
                  * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */
-                if (hdaStreamRegisterDMAHandlers(pThis, pStream))
+                if (hdaR3StreamRegisterDMAHandlers(pThis, pStream))
                     LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD));
             }
@@ -1746,5 +1748,5 @@
  * @param   pCfg                Stream configuration to use for adding a stream.
  */
-static int hdaAddStreamOut(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
+static int hdaR3AddStreamOut(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -1883,5 +1885,5 @@
  * @param   pCfg                Stream configuration to use for adding a stream.
  */
-static int hdaAddStreamIn(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
+static int hdaR3AddStreamIn(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -1924,5 +1926,5 @@
  * @param   pCfg                Stream configuration to use for adding a stream.
  */
-static int hdaAddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
+static int hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -1936,9 +1938,9 @@
     {
         case PDMAUDIODIR_OUT:
-            rc = hdaAddStreamOut(pThis, pCfg);
+            rc = hdaR3AddStreamOut(pThis, pCfg);
             break;
 
         case PDMAUDIODIR_IN:
-            rc = hdaAddStreamIn(pThis, pCfg);
+            rc = hdaR3AddStreamIn(pThis, pCfg);
             break;
 
@@ -1961,5 +1963,5 @@
  * @param   pCfg                Stream configuration to use for removing a stream.
  */
-static int hdaRemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
+static int hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -2076,5 +2078,5 @@
         /* Try registering the DMA handlers.
          * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */
-        if (hdaStreamRegisterDMAHandlers(pThis, pStream))
+        if (hdaR3StreamRegisterDMAHandlers(pThis, pStream))
             LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD));
     }
@@ -2307,5 +2309,5 @@
  * @param   enmMixerCtl         Mixer control to get the corresponding sink for.
  */
-static PHDAMIXERSINK hdaMixerControlToSink(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
+static PHDAMIXERSINK hdaR3MixerControlToSink(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
 {
     PHDAMIXERSINK pSink;
@@ -2352,5 +2354,5 @@
  * @param   pDrv                Driver stream to add.
  */
-static int hdaMixerAddDrvStream(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PHDADRIVER pDrv)
+static int hdaR3MixerAddDrvStream(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PHDADRIVER pDrv)
 {
     AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
@@ -2445,5 +2447,5 @@
  * @param   pCfg                Audio stream configuration to use for the audio streams to add.
  */
-static int hdaMixerAddDrvStreams(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
+static int hdaR3MixerAddDrvStreams(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis,    VERR_INVALID_POINTER);
@@ -2463,5 +2465,5 @@
     RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node)
     {
-        int rc2 = hdaMixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
+        int rc2 = hdaR3MixerAddDrvStream(pThis, pMixSink, pCfg, pDrv);
         if (RT_FAILURE(rc2))
             LogFunc(("Attaching stream failed with %Rrc\n", rc2));
@@ -2487,5 +2489,5 @@
  * @param   pCfg                Stream configuration for the new stream.
  */
-static DECLCALLBACK(int) hdaMixerAddStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg)
+static DECLCALLBACK(int) hdaR3MixerAddStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -2494,8 +2496,8 @@
     int rc;
 
-    PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
+    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
     if (pSink)
     {
-        rc = hdaMixerAddDrvStreams(pThis, pSink->pMixSink, pCfg);
+        rc = hdaR3MixerAddDrvStreams(pThis, pSink->pMixSink, pCfg);
 
         AssertPtr(pSink->pMixSink);
@@ -2520,5 +2522,5 @@
  * @remarks Can be called as a callback by the HDA codec.
  */
-static DECLCALLBACK(int) hdaMixerRemoveStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
+static DECLCALLBACK(int) hdaR3MixerRemoveStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl)
 {
     AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -2526,5 +2528,5 @@
     int rc;
 
-    PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
+    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
     if (pSink)
     {
@@ -2603,5 +2605,5 @@
  * @remarks Can be called as a callback by the HDA codec.
  */
-static DECLCALLBACK(int) hdaMixerControl(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel)
+static DECLCALLBACK(int) hdaR3MixerControl(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel)
 {
     LogFunc(("enmMixerCtl=%s, uSD=%RU8, uChannel=%RU8\n", DrvAudioHlpAudMixerCtlToStr(enmMixerCtl), uSD, uChannel));
@@ -2630,5 +2632,5 @@
     int rc = VINF_SUCCESS;
 
-    PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
+    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
     if (pSink)
     {
@@ -2651,13 +2653,13 @@
                      pSink->pMixSink->pszName, pSink->pStream->u8SD, pSink->pStream->u8Channel));
 
-            hdaStreamLock(pSink->pStream);
+            hdaR3StreamLock(pSink->pStream);
 
             /* Only disable the stream if the stream descriptor # has changed. */
             if (pSink->pStream->u8SD != uSD)
-                hdaStreamEnable(pSink->pStream, false);
+                hdaR3StreamEnable(pSink->pStream, false);
 
             pSink->pStream->pMixSink = NULL;
 
-            hdaStreamUnlock(pSink->pStream);
+            hdaR3StreamUnlock(pSink->pStream);
 
             pSink->pStream = NULL;
@@ -2676,5 +2678,5 @@
             if (pStream)
             {
-                hdaStreamLock(pStream);
+                hdaR3StreamLock(pStream);
 
                 pSink->pStream = pStream;
@@ -2683,5 +2685,5 @@
                 pStream->pMixSink  = pSink;
 
-                hdaStreamUnlock(pStream);
+                hdaR3StreamUnlock(pStream);
 
                 rc = VINF_SUCCESS;
@@ -2714,10 +2716,9 @@
  * @remarks Can be called as a callback by the HDA codec.
  */
-static DECLCALLBACK(int) hdaMixerSetVolume(PHDASTATE pThis,
-                                           PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol)
+static DECLCALLBACK(int) hdaR3MixerSetVolume(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol)
 {
     int rc;
 
-    PHDAMIXERSINK pSink = hdaMixerControlToSink(pThis, enmMixerCtl);
+    PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl);
     if (   pSink
         && pSink->pMixSink)
@@ -2744,5 +2745,5 @@
  * @param   pvUser              Pointer to associated HDASTREAM.
  */
-static DECLCALLBACK(void) hdaTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
+static DECLCALLBACK(void) hdaR3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
 {
     RT_NOREF(pDevIns, pTimer);
@@ -2755,5 +2756,5 @@
     DEVHDA_LOCK_BOTH_RETURN_VOID(pStream->pHDAState, pStream->u8SD);
 
-    hdaStreamUpdate(pStream, true /* fInTimer */);
+    hdaR3StreamUpdate(pStream, true /* fInTimer */);
 
     /* Flag indicating whether to kick the timer again for a
@@ -2762,11 +2763,11 @@
     if (fSinkActive)
     {
-        const bool fTimerScheduled = hdaStreamTransferIsScheduled(pStream);
+        const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(pStream);
         Log3Func(("fSinksActive=%RTbool, fTimerScheduled=%RTbool\n", fSinkActive, fTimerScheduled));
         if (!fTimerScheduled)
-            hdaTimerSet(pThis, pStream,
-                          TMTimerGet(pThis->pTimer[pStream->u8SD])
-                        + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->u16TimerHz,
-                        true /* fForce */);
+            hdaR3TimerSet(pThis, pStream,
+                            TMTimerGet(pThis->pTimer[pStream->u8SD])
+                          + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->u16TimerHz,
+                          true /* fForce */);
     }
     else
@@ -2792,7 +2793,7 @@
  * @param   pvUser          User argument.
  */
-static DECLCALLBACK(VBOXSTRICTRC) hdaDMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
-                                                      void *pvBuf, size_t cbBuf,
-                                                      PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
+static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
+                                                        void *pvBuf, size_t cbBuf,
+                                                        PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
 {
     RT_NOREF(pVM, pVCpu, pvPhys, pvBuf, enmOrigin);
@@ -2915,5 +2916,5 @@
  *
  */
-static void hdaGCTLReset(PHDASTATE pThis)
+static void hdaR3GCTLReset(PHDASTATE pThis)
 {
     LogFlowFuncEnter();
@@ -2975,12 +2976,12 @@
      */
 # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
-    hdaMixerControl(pThis, PDMAUDIOMIXERCTL_MIC_IN    , 1 /* SD0 */, 0 /* Channel */);
+    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_MIC_IN    , 1 /* SD0 */, 0 /* Channel */);
 # endif
-    hdaMixerControl(pThis, PDMAUDIOMIXERCTL_LINE_IN   , 1 /* SD0 */, 0 /* Channel */);
-
-    hdaMixerControl(pThis, PDMAUDIOMIXERCTL_FRONT     , 5 /* SD4 */, 0 /* Channel */);
+    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_LINE_IN   , 1 /* SD0 */, 0 /* Channel */);
+
+    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_FRONT     , 5 /* SD4 */, 0 /* Channel */);
 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
-    hdaMixerControl(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */);
-    hdaMixerControl(pThis, PDMAUDIOMIXERCTL_REAR      , 5 /* SD4 */, 0 /* Channel */);
+    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */);
+    hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_REAR      , 5 /* SD4 */, 0 /* Channel */);
 # endif
 
@@ -2998,10 +2999,10 @@
     for (uint8_t uSD = 0; uSD < HDA_MAX_STREAMS; ++uSD)
     {
-        int rc2 = hdaStreamEnable(&pThis->aStreams[uSD], false /* fEnable */);
+        int rc2 = hdaR3StreamEnable(&pThis->aStreams[uSD], false /* fEnable */);
         if (RT_SUCCESS(rc2))
         {
             /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */
             HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN;
-            hdaStreamReset(pThis, &pThis->aStreams[uSD], uSD);
+            hdaR3StreamReset(pThis, &pThis->aStreams[uSD], uSD);
         }
     }
@@ -3267,5 +3268,5 @@
          * shifting out input values.
          */
-        if (idxRegDsc == -1 && (idxRegDsc = hdaRegLookupWithin(offReg)) != -1)
+        if (idxRegDsc == -1 && (idxRegDsc = hdaR3RegLookupWithin(offReg)) != -1)
         {
             uint32_t const cbBefore = offReg - g_aHdaRegMap[idxRegDsc].offset; Assert(cbBefore > 0 && cbBefore < 4);
@@ -3342,9 +3343,9 @@
  * @callback_method_impl{FNPCIIOREGIONMAP}
  */
-static DECLCALLBACK(int)  hdaPciIoRegionMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
-                                            RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
+static DECLCALLBACK(int) hdaR3PciIoRegionMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion,
+                                             RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
 {
     RT_NOREF(iRegion, enmType);
-    PHDASTATE   pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev);
+    PHDASTATE pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev);
 
     /*
@@ -3381,7 +3382,7 @@
 
 
-/* Saved state callbacks. */
-
-static int hdaSaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStream)
+/* Saved state workers and callbacks. */
+
+static int hdaR3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStream)
 {
     RT_NOREF(pDevIns);
@@ -3430,5 +3431,5 @@
 
         HDABDLE curBDLE;
-        rc = hdaBDLEFetch(pThis, &curBDLE, u64BaseDMA, pStream->State.uCurBDLE);
+        rc = hdaR3BDLEFetch(pThis, &curBDLE, u64BaseDMA, pStream->State.uCurBDLE);
         AssertRC(rc);
 
@@ -3506,5 +3507,5 @@
 
 #ifdef LOG_ENABLED
-    hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
+    hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
 #endif
 
@@ -3515,5 +3516,5 @@
  * @callback_method_impl{FNSSMDEVSAVEEXEC}
  */
-static DECLCALLBACK(int) hdaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
+static DECLCALLBACK(int) hdaR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -3536,5 +3537,5 @@
     for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++)
     {
-        int rc = hdaSaveStream(pDevIns, pSSM, &pThis->aStreams[i]);
+        int rc = hdaR3SaveStream(pDevIns, pSSM, &pThis->aStreams[i]);
         AssertRCReturn(rc, rc);
     }
@@ -3548,5 +3549,5 @@
  * @param   pThis               Pointer to HDA state.
  */
-static int hdaLoadExecPost(PHDASTATE pThis)
+static int hdaR3LoadExecPost(PHDASTATE pThis)
 {
     int rc = VINF_SUCCESS;
@@ -3567,27 +3568,27 @@
 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
                 /* Make sure to also create the async I/O thread before actually enabling the stream. */
-                rc2 = hdaStreamAsyncIOCreate(pStream);
+                rc2 = hdaR3StreamAsyncIOCreate(pStream);
                 AssertRC(rc2);
 
                 /* ... and enabling it. */
-                hdaStreamAsyncIOEnable(pStream, true /* fEnable */);
+                hdaR3StreamAsyncIOEnable(pStream, true /* fEnable */);
 #endif
                 /* Resume the stream's period. */
-                hdaStreamPeriodResume(&pStream->State.Period);
+                hdaR3StreamPeriodResume(&pStream->State.Period);
 
                 /* (Re-)enable the stream. */
-                rc2 = hdaStreamEnable(pStream, true /* fEnable */);
+                rc2 = hdaR3StreamEnable(pStream, true /* fEnable */);
                 AssertRC(rc2);
 
                 /* Add the stream to the device setup. */
-                rc2 = hdaAddStream(pThis, &pStream->State.Cfg);
+                rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg);
                 AssertRC(rc2);
 
 #ifdef HDA_USE_DMA_ACCESS_HANDLER
                 /* (Re-)install the DMA handler. */
-                hdaStreamRegisterDMAHandlers(pThis, pStream);
+                hdaR3StreamRegisterDMAHandlers(pThis, pStream);
 #endif
-                if (hdaStreamTransferIsScheduled(pStream))
-                    hdaTimerSet(pThis, pStream, hdaStreamTransferGetNext(pStream), true /* fForce */);
+                if (hdaR3StreamTransferIsScheduled(pStream))
+                    hdaR3TimerSet(pThis, pStream, hdaR3StreamTransferGetNext(pStream), true /* fForce */);
 
                 /* Also keep track of the currently active streams. */
@@ -3610,5 +3611,5 @@
  * @param   uPass               Loading stage to handle.
  */
-static int hdaLoadExecLegacy(PHDASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+static int hdaR3LoadExecLegacy(PHDASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
 {
     RT_NOREF(uPass);
@@ -3727,5 +3728,5 @@
             /* Output */
             PHDASTREAM pStream = &pThis->aStreams[4];
-            rc = hdaStreamInit(pStream, 4 /* Stream descriptor, hardcoded */);
+            rc = hdaR3StreamInit(pStream, 4 /* Stream descriptor, hardcoded */);
             if (RT_FAILURE(rc))
                 break;
@@ -3735,5 +3736,5 @@
             /* Microphone-In */
             pStream = &pThis->aStreams[2];
-            rc = hdaStreamInit(pStream, 2 /* Stream descriptor, hardcoded */);
+            rc = hdaR3StreamInit(pStream, 2 /* Stream descriptor, hardcoded */);
             if (RT_FAILURE(rc))
                 break;
@@ -3743,5 +3744,5 @@
             /* Line-In */
             pStream = &pThis->aStreams[0];
-            rc = hdaStreamInit(pStream, 0 /* Stream descriptor, hardcoded */);
+            rc = hdaR3StreamInit(pStream, 0 /* Stream descriptor, hardcoded */);
             if (RT_FAILURE(rc))
                 break;
@@ -3780,5 +3781,5 @@
                 }
 
-                rc = hdaStreamInit(pStream, uStreamID);
+                rc = hdaR3StreamInit(pStream, uStreamID);
                 if (RT_FAILURE(rc))
                 {
@@ -3868,5 +3869,5 @@
                               HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID)));
 #ifdef LOG_ENABLED
-                    hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
+                    hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
 #endif
                 }
@@ -3883,5 +3884,5 @@
  * @callback_method_impl{FNSSMDEVLOADEXEC}
  */
-static DECLCALLBACK(int) hdaLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+static DECLCALLBACK(int) hdaR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -3889,5 +3890,5 @@
     Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
 
-    LogRel2(("hdaLoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));
+    LogRel2(("hdaR3LoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));
 
     /*
@@ -3903,7 +3904,7 @@
     if (uVersion < HDA_SSM_VERSION) /* Handle older saved states? */
     {
-        rc = hdaLoadExecLegacy(pThis, pSSM, uVersion, uPass);
+        rc = hdaR3LoadExecLegacy(pThis, pSSM, uVersion, uPass);
         if (RT_SUCCESS(rc))
-            rc = hdaLoadExecPost(pThis);
+            rc = hdaR3LoadExecPost(pThis);
 
         return rc;
@@ -3976,5 +3977,5 @@
         }
 
-        rc = hdaStreamInit(pStream, uStreamID);
+        rc = hdaR3StreamInit(pStream, uStreamID);
         if (RT_FAILURE(rc))
         {
@@ -4005,6 +4006,6 @@
          * Don't annoy other team mates (forgot this for state v7).
          */
-        hdaStreamPeriodInit(&pStream->State.Period,
-                            pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
+        hdaR3StreamPeriodInit(&pStream->State.Period,
+                              pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg);
 
         if (   SSMR3HandleRevision(pSSM) >= 116273
@@ -4072,5 +4073,5 @@
                   HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID)));
 #ifdef LOG_ENABLED
-        hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
+        hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
 #endif
         /** @todo (Re-)initialize active periods? */
@@ -4078,5 +4079,5 @@
     } /* for cStreams */
 
-    rc = hdaLoadExecPost(pThis);
+    rc = hdaR3LoadExecPost(pThis);
     AssertRC(rc);
 
@@ -4085,13 +4086,13 @@
 }
 
-/* Debug and log type formatters. */
+/* IPRT format type handlers. */
 
 /**
  * @callback_method_impl{FNRTSTRFORMATTYPE}
  */
-static DECLCALLBACK(size_t) hdaDbgFmtBDLE(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
-                                          const char *pszType, void const *pvValue,
-                                          int cchWidth, int cchPrecision, unsigned fFlags,
-                                          void *pvUser)
+static DECLCALLBACK(size_t) hdaR3StrFmtBDLE(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
+                                            const char *pszType, void const *pvValue,
+                                            int cchWidth, int cchPrecision, unsigned fFlags,
+                                            void *pvUser)
 {
     RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
@@ -4106,8 +4107,8 @@
  * @callback_method_impl{FNRTSTRFORMATTYPE}
  */
-static DECLCALLBACK(size_t) hdaDbgFmtSDCTL(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
-                                           const char *pszType, void const *pvValue,
-                                           int cchWidth, int cchPrecision, unsigned fFlags,
-                                           void *pvUser)
+static DECLCALLBACK(size_t) hdaR3StrFmtSDCTL(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
+                                             const char *pszType, void const *pvValue,
+                                             int cchWidth, int cchPrecision, unsigned fFlags,
+                                             void *pvUser)
 {
     RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
@@ -4129,34 +4130,34 @@
  * @callback_method_impl{FNRTSTRFORMATTYPE}
  */
-static DECLCALLBACK(size_t) hdaDbgFmtSDFIFOS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
+static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
+                                               const char *pszType, void const *pvValue,
+                                               int cchWidth, int cchPrecision, unsigned fFlags,
+                                               void *pvUser)
+{
+    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
+    uint32_t uSDFIFOS = (uint32_t)(uintptr_t)pvValue;
+    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOS(raw:%#x, sdfifos:%RU8 B)", uSDFIFOS, uSDFIFOS ? uSDFIFOS + 1 : 0);
+}
+
+/**
+ * @callback_method_impl{FNRTSTRFORMATTYPE}
+ */
+static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOW(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
+                                               const char *pszType, void const *pvValue,
+                                               int cchWidth, int cchPrecision, unsigned fFlags,
+                                               void *pvUser)
+{
+    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
+    uint32_t uSDFIFOW = (uint32_t)(uintptr_t)pvValue;
+    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOW(raw: %#0x, sdfifow:%d B)", uSDFIFOW, hdaSDFIFOWToBytes(uSDFIFOW));
+}
+
+/**
+ * @callback_method_impl{FNRTSTRFORMATTYPE}
+ */
+static DECLCALLBACK(size_t) hdaR3StrFmtSDSTS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
                                              const char *pszType, void const *pvValue,
                                              int cchWidth, int cchPrecision, unsigned fFlags,
                                              void *pvUser)
-{
-    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
-    uint32_t uSDFIFOS = (uint32_t)(uintptr_t)pvValue;
-    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOS(raw:%#x, sdfifos:%RU8 B)", uSDFIFOS, uSDFIFOS ? uSDFIFOS + 1 : 0);
-}
-
-/**
- * @callback_method_impl{FNRTSTRFORMATTYPE}
- */
-static DECLCALLBACK(size_t) hdaDbgFmtSDFIFOW(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
-                                             const char *pszType, void const *pvValue,
-                                             int cchWidth, int cchPrecision, unsigned fFlags,
-                                             void *pvUser)
-{
-    RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
-    uint32_t uSDFIFOW = (uint32_t)(uintptr_t)pvValue;
-    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOW(raw: %#0x, sdfifow:%d B)", uSDFIFOW, hdaSDFIFOWToBytes(uSDFIFOW));
-}
-
-/**
- * @callback_method_impl{FNRTSTRFORMATTYPE}
- */
-static DECLCALLBACK(size_t) hdaDbgFmtSDSTS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
-                                           const char *pszType, void const *pvValue,
-                                           int cchWidth, int cchPrecision, unsigned fFlags,
-                                           void *pvUser)
 {
     RT_NOREF(pszType, cchWidth,  cchPrecision, fFlags, pvUser);
@@ -4171,5 +4172,7 @@
 }
 
-static int hdaDbgLookupRegByName(const char *pszArgs)
+/* Debug info dumpers */
+
+static int hdaR3DbgLookupRegByName(const char *pszArgs)
 {
     int iReg = 0;
@@ -4181,5 +4184,5 @@
 
 
-static void hdaDbgPrintRegister(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iHdaIndex)
+static void hdaR3DbgPrintRegister(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iHdaIndex)
 {
     Assert(   pThis
@@ -4192,18 +4195,18 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
-    int iHdaRegisterIndex = hdaDbgLookupRegByName(pszArgs);
+    int iHdaRegisterIndex = hdaR3DbgLookupRegByName(pszArgs);
     if (iHdaRegisterIndex != -1)
-        hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
+        hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
     else
     {
         for(iHdaRegisterIndex = 0; (unsigned int)iHdaRegisterIndex < HDA_NUM_REGS; ++iHdaRegisterIndex)
-            hdaDbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
-    }
-}
-
-static void hdaDbgPrintStream(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
+            hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex);
+    }
+}
+
+static void hdaR3DbgPrintStream(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
 {
     Assert(   pThis
@@ -4221,5 +4224,5 @@
 }
 
-static void hdaDbgPrintBDLE(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
+static void hdaR3DbgPrintBDLE(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx)
 {
     Assert(   pThis
@@ -4278,5 +4281,5 @@
 }
 
-static int hdaDbgLookupStrmIdx(PHDASTATE pThis, const char *pszArgs)
+static int hdaR3DbgLookupStrmIdx(PHDASTATE pThis, const char *pszArgs)
 {
     RT_NOREF(pThis, pszArgs);
@@ -4288,13 +4291,13 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE   pThis         = PDMINS_2_DATA(pDevIns, PHDASTATE);
-    int         iHdaStreamdex = hdaDbgLookupStrmIdx(pThis, pszArgs);
+    int         iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs);
     if (iHdaStreamdex != -1)
-        hdaDbgPrintStream(pThis, pHlp, iHdaStreamdex);
+        hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex);
     else
         for(iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
-            hdaDbgPrintStream(pThis, pHlp, iHdaStreamdex);
+            hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex);
 }
 
@@ -4302,13 +4305,13 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE   pThis         = PDMINS_2_DATA(pDevIns, PHDASTATE);
-    int         iHdaStreamdex = hdaDbgLookupStrmIdx(pThis, pszArgs);
+    int         iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs);
     if (iHdaStreamdex != -1)
-        hdaDbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
+        hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
     else
-        for(iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
-            hdaDbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
+        for (iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex)
+            hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex);
 }
 
@@ -4316,5 +4319,5 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4329,5 +4332,5 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4342,5 +4345,5 @@
  * @callback_method_impl{FNDBGFHANDLERDEV}
  */
-static DECLCALLBACK(void) hdaDbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+static DECLCALLBACK(void) hdaR3DbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4358,5 +4361,5 @@
  * @interface_method_impl{PDMIBASE,pfnQueryInterface}
  */
-static DECLCALLBACK(void *) hdaQueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
+static DECLCALLBACK(void *) hdaR3QueryInterface(struct PDMIBASE *pInterface, const char *pszIID)
 {
     PHDASTATE pThis = RT_FROM_MEMBER(pInterface, HDASTATE, IBase);
@@ -4383,5 +4386,5 @@
  * @param   ppDrv       Attached driver instance on success. Optional.
  */
-static int hdaAttachInternal(PHDASTATE pThis, unsigned uLUN, uint32_t fFlags, PHDADRIVER *ppDrv)
+static int hdaR3AttachInternal(PHDASTATE pThis, unsigned uLUN, uint32_t fFlags, PHDADRIVER *ppDrv)
 {
     RT_NOREF(fFlags);
@@ -4455,5 +4458,5 @@
  * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
  */
-static int hdaDetachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint32_t fFlags)
+static int hdaR3DetachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint32_t fFlags)
 {
     RT_NOREF(fFlags);
@@ -4492,5 +4495,5 @@
  * @interface_method_impl{PDMDEVREG,pfnAttach}
  */
-static DECLCALLBACK(int) hdaAttach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
+static DECLCALLBACK(int) hdaR3Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4501,28 +4504,28 @@
 
     PHDADRIVER pDrv;
-    int rc2 = hdaAttachInternal(pThis, uLUN, fFlags, &pDrv);
+    int rc2 = hdaR3AttachInternal(pThis, uLUN, fFlags, &pDrv);
     if (RT_SUCCESS(rc2))
     {
-        PHDASTREAM pStream = hdaGetStreamFromSink(pThis, &pThis->SinkFront);
+        PHDASTREAM pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkFront);
         if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
-            hdaMixerAddDrvStream(pThis, pThis->SinkFront.pMixSink,     &pStream->State.Cfg, pDrv);
+            hdaR3MixerAddDrvStream(pThis, pThis->SinkFront.pMixSink,     &pStream->State.Cfg, pDrv);
 
 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
-        pStream = hdaGetStreamFromSink(pThis, &pThis->SinkCenterLFE);
+        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkCenterLFE);
         if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
-            hdaMixerAddDrvStream(pThis, pThis->SinkCenterLFE.pMixSink, &pStream->State.Cfg, pDrv);
-
-        pStream = hdaGetStreamFromSink(pThis, &pThis->SinkRear);
+            hdaR3MixerAddDrvStream(pThis, pThis->SinkCenterLFE.pMixSink, &pStream->State.Cfg, pDrv);
+
+        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkRear);
         if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
-            hdaMixerAddDrvStream(pThis, pThis->SinkRear.pMixSink,      &pStream->State.Cfg, pDrv);
+            hdaR3MixerAddDrvStream(pThis, pThis->SinkRear.pMixSink,      &pStream->State.Cfg, pDrv);
 #endif
-        pStream = hdaGetStreamFromSink(pThis, &pThis->SinkLineIn);
+        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn);
         if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
-            hdaMixerAddDrvStream(pThis, pThis->SinkLineIn.pMixSink,    &pStream->State.Cfg, pDrv);
+            hdaR3MixerAddDrvStream(pThis, pThis->SinkLineIn.pMixSink,    &pStream->State.Cfg, pDrv);
 
 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
-        pStream = hdaGetStreamFromSink(pThis, &pThis->SinkMicIn);
+        pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn);
         if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg))
-            hdaMixerAddDrvStream(pThis, pThis->SinkMicIn.pMixSink,     &pStream->State.Cfg, pDrv);
+            hdaR3MixerAddDrvStream(pThis, pThis->SinkMicIn.pMixSink,     &pStream->State.Cfg, pDrv);
 #endif
     }
@@ -4536,5 +4539,5 @@
  * @interface_method_impl{PDMDEVREG,pfnDetach}
  */
-static DECLCALLBACK(void) hdaDetach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
+static DECLCALLBACK(void) hdaR3Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4549,5 +4552,5 @@
         if (pDrv->uLUN == uLUN)
         {
-            int rc2 = hdaDetachInternal(pThis, pDrv, fFlags);
+            int rc2 = hdaR3DetachInternal(pThis, pDrv, fFlags);
             if (RT_SUCCESS(rc2))
             {
@@ -4568,5 +4571,5 @@
  * @param   pDevIns             Device instance to power off.
  */
-static DECLCALLBACK(void) hdaPowerOff(PPDMDEVINS pDevIns)
+static DECLCALLBACK(void) hdaR3PowerOff(PPDMDEVINS pDevIns)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4580,5 +4583,5 @@
 
     /*
-     * Note: Destroy the mixer while powering off and *not* in hdaDestruct,
+     * Note: Destroy the mixer while powering off and *not* in hdaR3Destruct,
      *       giving the mixer the chance to release any references held to
      *       PDM audio streams it maintains.
@@ -4608,5 +4611,5 @@
  * @param   pszDriver   New driver name to attach.
  */
-static int hdaReattachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint8_t uLUN, const char *pszDriver)
+static int hdaR3ReattachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint8_t uLUN, const char *pszDriver)
 {
     AssertPtrReturn(pThis,     VERR_INVALID_POINTER);
@@ -4617,5 +4620,5 @@
     if (pDrv)
     {
-        rc = hdaDetachInternal(pThis, pDrv, 0 /* fFlags */);
+        rc = hdaR3DetachInternal(pThis, pDrv, 0 /* fFlags */);
         if (RT_SUCCESS(rc))
             rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */);
@@ -4653,5 +4656,5 @@
 
     if (RT_SUCCESS(rc))
-        rc = hdaAttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
+        rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
 
     LogFunc(("pThis=%p, uLUN=%u, pszDriver=%s, rc=%Rrc\n", pThis, uLUN, pszDriver, rc));
@@ -4666,5 +4669,5 @@
  * @interface_method_impl{PDMDEVREG,pfnReset}
  */
-static DECLCALLBACK(void) hdaReset(PPDMDEVINS pDevIns)
+static DECLCALLBACK(void) hdaR3Reset(PPDMDEVINS pDevIns)
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
@@ -4676,9 +4679,9 @@
      /*
      * 18.2.6,7 defines that values of this registers might be cleared on power on/reset
-     * hdaReset shouldn't affects these registers.
+     * hdaR3Reset shouldn't affects these registers.
      */
     HDA_REG(pThis, WAKEEN)  = 0x0;
 
-    hdaGCTLReset(pThis);
+    hdaR3GCTLReset(pThis);
 
     /* Indicate that HDA is not in reset. The firmware is supposed to (un)reset HDA,
@@ -4694,5 +4697,5 @@
  * @interface_method_impl{PDMDEVREG,pfnRelocate}
  */
-static DECLCALLBACK(void) hdaRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
+static DECLCALLBACK(void) hdaR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
 {
     NOREF(offDelta);
@@ -4705,5 +4708,5 @@
  * @interface_method_impl{PDMDEVREG,pfnDestruct}
  */
-static DECLCALLBACK(int) hdaDestruct(PPDMDEVINS pDevIns)
+static DECLCALLBACK(int) hdaR3Destruct(PPDMDEVINS pDevIns)
 {
     PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
@@ -4735,5 +4738,5 @@
 
     for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++)
-        hdaStreamDestroy(&pThis->aStreams[i]);
+        hdaR3StreamDestroy(&pThis->aStreams[i]);
 
     DEVHDA_UNLOCK(pThis);
@@ -4745,5 +4748,5 @@
  * @interface_method_impl{PDMDEVREG,pfnConstruct}
  */
-static DECLCALLBACK(int) hdaConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
+static DECLCALLBACK(int) hdaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
 {
     RT_NOREF(iInstance);
@@ -4839,5 +4842,5 @@
     pThis->pDevInsRC                = PDMDEVINS_2_RCPTR(pDevIns);
     /* IBase */
-    pThis->IBase.pfnQueryInterface  = hdaQueryInterface;
+    pThis->IBase.pfnQueryInterface  = hdaR3QueryInterface;
 
     /* PCI Device */
@@ -4925,5 +4928,5 @@
         return rc;
 
-    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaPciIoRegionMap);
+    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaR3PciIoRegionMap);
     if (RT_FAILURE(rc))
         return rc;
@@ -4943,5 +4946,5 @@
 #endif
 
-    rc = PDMDevHlpSSMRegister(pDevIns, HDA_SSM_VERSION, sizeof(*pThis), hdaSaveExec, hdaLoadExec);
+    rc = PDMDevHlpSSMRegister(pDevIns, HDA_SSM_VERSION, sizeof(*pThis), hdaR3SaveExec, hdaR3LoadExec);
     if (RT_FAILURE(rc))
         return rc;
@@ -4955,5 +4958,5 @@
     {
         LogFunc(("Trying to attach driver for LUN #%RU32 ...\n", uLUN));
-        rc = hdaAttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
+        rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */);
         if (RT_FAILURE(rc))
         {
@@ -4962,5 +4965,5 @@
             else if (rc == VERR_AUDIO_BACKEND_INIT_FAILED)
             {
-                hdaReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
+                hdaR3ReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio");
                 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
                     N_("Host audio backend initialization has failed. Selecting the NULL audio backend "
@@ -5042,8 +5045,8 @@
         {
             /* Set codec callbacks to this controller. */
-            pThis->pCodec->pfnCbMixerAddStream    = hdaMixerAddStream;
-            pThis->pCodec->pfnCbMixerRemoveStream = hdaMixerRemoveStream;
-            pThis->pCodec->pfnCbMixerControl      = hdaMixerControl;
-            pThis->pCodec->pfnCbMixerSetVolume    = hdaMixerSetVolume;
+            pThis->pCodec->pfnCbMixerAddStream    = hdaR3MixerAddStream;
+            pThis->pCodec->pfnCbMixerRemoveStream = hdaR3MixerRemoveStream;
+            pThis->pCodec->pfnCbMixerControl      = hdaR3MixerControl;
+            pThis->pCodec->pfnCbMixerSetVolume    = hdaR3MixerSetVolume;
 
             pThis->pCodec->pHDAState = pThis; /* Assign HDA controller state to codec. */
@@ -5079,5 +5082,5 @@
             RTStrPrintf2(szTimer, sizeof(szTimer), "HDA SD%RU8", i);
 
-            rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaTimer, &pThis->aStreams[i],
+            rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaR3Timer, &pThis->aStreams[i],
                                         TMTIMER_FLAGS_NO_CRIT_SECT, szTimer, &pThis->pTimer[i]);
             AssertRCReturn(rc, rc);
@@ -5088,5 +5091,5 @@
             AssertRCReturn(rc, rc);
 
-            rc = hdaStreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */);
+            rc = hdaR3StreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */);
             AssertRC(rc);
         }
@@ -5126,6 +5129,6 @@
                 LogRel(("HDA: Falling back to NULL backend (no sound audible)\n"));
 
-                hdaReset(pDevIns);
-                hdaReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
+                hdaR3Reset(pDevIns);
+                hdaR3ReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio");
 
                 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
@@ -5209,25 +5212,25 @@
     if (RT_SUCCESS(rc))
     {
-        hdaReset(pDevIns);
+        hdaR3Reset(pDevIns);
 
         /*
          * Debug and string formatter types.
          */
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hda",         "HDA info. (hda [register case-insensitive])",     hdaDbgInfo);
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hdabdle",     "HDA stream BDLE info. (hdabdle [stream number])", hdaDbgInfoBDLE);
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hdastream",   "HDA stream info. (hdastream [stream number])",    hdaDbgInfoStream);
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes",    "HDA codec nodes.",                                hdaDbgInfoCodecNodes);
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].",      hdaDbgInfoCodecSelector);
-        PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer",    "HDA mixer state.",                                hdaDbgInfoMixer);
-
-        rc = RTStrFormatTypeRegister("bdle",    hdaDbgFmtBDLE,    NULL);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hda",         "HDA info. (hda [register case-insensitive])",     hdaR3DbgInfo);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdabdle",     "HDA stream BDLE info. (hdabdle [stream number])", hdaR3DbgInfoBDLE);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdastream",   "HDA stream info. (hdastream [stream number])",    hdaR3DbgInfoStream);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes",    "HDA codec nodes.",                                hdaR3DbgInfoCodecNodes);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].",      hdaR3DbgInfoCodecSelector);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer",    "HDA mixer state.",                                hdaR3DbgInfoMixer);
+
+        rc = RTStrFormatTypeRegister("bdle",    hdaR3StrFmtBDLE,    NULL);
         AssertRC(rc);
-        rc = RTStrFormatTypeRegister("sdctl",   hdaDbgFmtSDCTL,   NULL);
+        rc = RTStrFormatTypeRegister("sdctl",   hdaR3StrFmtSDCTL,   NULL);
         AssertRC(rc);
-        rc = RTStrFormatTypeRegister("sdsts",   hdaDbgFmtSDSTS,   NULL);
+        rc = RTStrFormatTypeRegister("sdsts",   hdaR3StrFmtSDSTS,   NULL);
         AssertRC(rc);
-        rc = RTStrFormatTypeRegister("sdfifos", hdaDbgFmtSDFIFOS, NULL);
+        rc = RTStrFormatTypeRegister("sdfifos", hdaR3StrFmtSDFIFOS, NULL);
         AssertRC(rc);
-        rc = RTStrFormatTypeRegister("sdfifow", hdaDbgFmtSDFIFOW, NULL);
+        rc = RTStrFormatTypeRegister("sdfifow", hdaR3StrFmtSDFIFOW, NULL);
         AssertRC(rc);
 
@@ -5285,5 +5288,5 @@
          * Register statistics.
          */
-        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer,            STAMTYPE_PROFILE, "/Devices/HDA/Timer",             STAMUNIT_TICKS_PER_CALL, "Profiling hdaTimer.");
+        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer,            STAMTYPE_PROFILE, "/Devices/HDA/Timer",             STAMUNIT_TICKS_PER_CALL, "Profiling hdaR3Timer.");
         PDMDevHlpSTAMRegister(pDevIns, &pThis->StatIn,               STAMTYPE_PROFILE, "/Devices/HDA/Input",             STAMUNIT_TICKS_PER_CALL, "Profiling input.");
         PDMDevHlpSTAMRegister(pDevIns, &pThis->StatOut,              STAMTYPE_PROFILE, "/Devices/HDA/Output",            STAMUNIT_TICKS_PER_CALL, "Profiling output.");
@@ -5321,9 +5324,9 @@
     sizeof(HDASTATE),
     /* pfnConstruct */
-    hdaConstruct,
+    hdaR3Construct,
     /* pfnDestruct */
-    hdaDestruct,
+    hdaR3Destruct,
     /* pfnRelocate */
-    hdaRelocate,
+    hdaR3Relocate,
     /* pfnMemSetup */
     NULL,
@@ -5331,5 +5334,5 @@
     NULL,
     /* pfnReset */
-    hdaReset,
+    hdaR3Reset,
     /* pfnSuspend */
     NULL,
@@ -5337,7 +5340,7 @@
     NULL,
     /* pfnAttach */
-    hdaAttach,
+    hdaR3Attach,
     /* pfnDetach */
-    hdaDetach,
+    hdaR3Detach,
     /* pfnQueryInterface. */
     NULL,
@@ -5345,5 +5348,5 @@
     NULL,
     /* pfnPowerOff */
-    hdaPowerOff,
+    hdaR3PowerOff,
     /* pfnSoftReset */
     NULL,
Index: /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp	(revision 71736)
@@ -113,18 +113,18 @@
  * @param   fForce              Whether to force setting the wall clock value or not.
  */
-bool hdaWalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce)
-{
-    const bool     fFrontPassed       = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkFront)->State.Period,
+bool hdaR3WalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce)
+{
+    const bool     fFrontPassed       = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkFront)->State.Period,
                                                                            u64WalClk);
-    const uint64_t u64FrontAbsWalClk  = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkFront)->State.Period);
+    const uint64_t u64FrontAbsWalClk  = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkFront)->State.Period);
 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
 #  error "Implement me!"
 # endif
 
-    const bool     fLineInPassed      = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period, u64WalClk);
-    const uint64_t u64LineInAbsWalClk = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period);
+    const bool     fLineInPassed      = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period, u64WalClk);
+    const uint64_t u64LineInAbsWalClk = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period);
 # ifdef VBOX_WITH_HDA_MIC_IN
-    const bool     fMicInPassed       = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period,  u64WalClk);
-    const uint64_t u64MicInAbsWalClk  = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period);
+    const bool     fMicInPassed       = hdaR3StreamPeriodHasPassedAbsWalClk (&hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period,  u64WalClk);
+    const uint64_t u64MicInAbsWalClk  = hdaR3StreamPeriodGetAbsElapsedWalClk(&hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period);
 # endif
 
@@ -196,5 +196,5 @@
  *                              NULL if not found / handled.
  */
-PHDAMIXERSINK hdaGetDefaultSink(PHDASTATE pThis, uint8_t uSD)
+PHDAMIXERSINK hdaR3GetDefaultSink(PHDASTATE pThis, uint8_t uSD)
 {
     if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN)
@@ -229,5 +229,5 @@
 }
 
-#endif /* IN_RING */
+#endif /* IN_RING3 */
 
 /**
@@ -279,5 +279,5 @@
  * @return  Pointer to HDA stream, or NULL if none found.
  */
-PHDASTREAM hdaGetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink)
+PHDASTREAM hdaR3GetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink)
 {
     AssertPtrReturn(pThis, NULL);
@@ -298,5 +298,5 @@
  * @param   pcbRead             Returns read bytes from DMA. Optional.
  */
-int hdaDMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
+int hdaR3DMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
 {
     AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
@@ -383,5 +383,5 @@
  * @param   pcbWritten          Returns written bytes on success. Optional.
  */
-int hdaDMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
+int hdaR3DMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
 {
     AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
@@ -477,4 +477,6 @@
 }
 
+#ifdef IN_RING3
+
 /**
  * Converts an HDA stream's SDFMT register into a given PCM properties structure.
@@ -484,9 +486,9 @@
  * @param   pProps              PCM properties structure to hold converted result on success.
  */
-int hdaSDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps)
+int hdaR3SDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pProps, VERR_INVALID_POINTER);
 
-#define EXTRACT_VALUE(v, mask, shift) ((v & ((mask) << (shift))) >> (shift))
+# define EXTRACT_VALUE(v, mask, shift) ((v & ((mask) << (shift))) >> (shift))
 
     int rc = VINF_SUCCESS;
@@ -556,12 +558,10 @@
     }
 
-#undef EXTRACT_VALUE
+# undef EXTRACT_VALUE
     return rc;
 }
 
-#ifdef IN_RING3
-
 # ifdef LOG_ENABLED
-void hdaBDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE)
+void hdaR3BDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE)
 {
     LogFlowFunc(("BDLEs @ 0x%x (%RU16):\n", u64BDLBase, cBDLE));
@@ -607,5 +607,5 @@
  * @param   u16Entry                BDLE entry to fetch.
  */
-int hdaBDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry)
+int hdaR3BDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry)
 {
     AssertPtrReturn(pThis,   VERR_INVALID_POINTER);
@@ -642,5 +642,5 @@
  * @param   pBDLE               BDLE to retrieve status for.
  */
-bool hdaBDLEIsComplete(PHDABDLE pBDLE)
+bool hdaR3BDLEIsComplete(PHDABDLE pBDLE)
 {
     bool fIsComplete = false;
@@ -664,5 +664,5 @@
  * @param   pBDLE               BDLE to retrieve status for.
  */
-bool hdaBDLENeedsInterrupt(PHDABDLE pBDLE)
+bool hdaR3BDLENeedsInterrupt(PHDABDLE pBDLE)
 {
     return (pBDLE->Desc.fFlags & HDA_BDLE_FLAG_IOC);
@@ -687,5 +687,5 @@
  *          Forcing a new expiration time will override the above mechanism.
  */
-bool hdaTimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce)
+bool hdaR3TimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce)
 {
     AssertPtr(pThis);
@@ -696,6 +696,6 @@
     if (!fForce)
     {
-        if (hdaStreamTransferIsScheduled(pStream))
-            tsExpireMin = RT_MIN(tsExpireMin, hdaStreamTransferGetNext(pStream));
+        if (hdaR3StreamTransferIsScheduled(pStream))
+            tsExpireMin = RT_MIN(tsExpireMin, hdaR3StreamTransferGetNext(pStream));
     }
 
Index: /trunk/src/VBox/Devices/Audio/DevHDACommon.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDACommon.h	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/DevHDACommon.h	(revision 71736)
@@ -76,5 +76,5 @@
 #define HDA_NUM_GENERAL_REGS        34
 /** Number of total registers in the HDA's register map. */
-#define HDA_NUM_REGS                                       (HDA_NUM_GENERAL_REGS + (HDA_MAX_STREAMS * 10 /* Each stream descriptor has 10 registers */))
+#define HDA_NUM_REGS                (HDA_NUM_GENERAL_REGS + (HDA_MAX_STREAMS * 10 /* Each stream descriptor has 10 registers */))
 /** Total number of stream tags (channels). Index 0 is reserved / invalid. */
 #define HDA_MAX_TAGS                16
@@ -517,7 +517,4 @@
 
 
-/*********************************************************************************************************************************
-*   Prototypes                                                                                                                 *
-*********************************************************************************************************************************/
 
 /** The HDA controller. */
@@ -580,8 +577,12 @@
  * @{
  */
-PHDAMIXERSINK hdaGetDefaultSink(PHDASTATE pThis, uint8_t uSD);
+#ifdef IN_RING3
+PHDAMIXERSINK hdaR3GetDefaultSink(PHDASTATE pThis, uint8_t uSD);
+#endif
 PDMAUDIODIR   hdaGetDirFromSD(uint8_t uSD);
 PHDASTREAM    hdaGetStreamFromSD(PHDASTATE pThis, uint8_t uSD);
-PHDASTREAM    hdaGetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink);
+#ifdef IN_RING3
+PHDASTREAM    hdaR3GetStreamFromSink(PHDASTATE pThis, PHDAMIXERSINK pSink);
+#endif
 /** @} */
 
@@ -601,5 +602,5 @@
 uint64_t      hdaWalClkGetCurrent(PHDASTATE pThis);
 #ifdef IN_RING3
-bool          hdaWalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce);
+bool          hdaR3WalClkSet(PHDASTATE pThis, uint64_t u64WalClk, bool fForce);
 #endif
 /** @} */
@@ -608,6 +609,8 @@
  * @{
  */
-int           hdaDMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
-int           hdaDMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
+#ifdef IN_RING3
+int           hdaR3DMARead(PHDASTATE pThis, PHDASTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
+int           hdaR3DMAWrite(PHDASTATE pThis, PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
+#endif
 /** @} */
 
@@ -617,5 +620,5 @@
 uint32_t      hdaGetINTSTS(PHDASTATE pThis);
 #ifdef IN_RING3
-int           hdaSDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps);
+int           hdaR3SDFMTToPCMProps(uint32_t u32SDFMT, PPDMAUDIOPCMPROPS pProps);
 #endif /* IN_RING3 */
 /** @} */
@@ -626,9 +629,9 @@
 #ifdef IN_RING3
 # ifdef LOG_ENABLED
-void          hdaBDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE);
+void          hdaR3BDLEDumpAll(PHDASTATE pThis, uint64_t u64BDLBase, uint16_t cBDLE);
 # endif
-int           hdaBDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry);
-bool          hdaBDLEIsComplete(PHDABDLE pBDLE);
-bool          hdaBDLENeedsInterrupt(PHDABDLE pBDLE);
+int           hdaR3BDLEFetch(PHDASTATE pThis, PHDABDLE pBDLE, uint64_t u64BaseDMA, uint16_t u16Entry);
+bool          hdaR3BDLEIsComplete(PHDABDLE pBDLE);
+bool          hdaR3BDLENeedsInterrupt(PHDABDLE pBDLE);
 #endif /* IN_RING3 */
 /** @} */
@@ -638,5 +641,5 @@
  */
 #ifdef IN_RING3
-bool          hdaTimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce);
+bool          hdaR3TimerSet(PHDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce);
 #endif /* IN_RING3 */
 /** @} */
Index: /trunk/src/VBox/Devices/Audio/HDAStream.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStream.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStream.cpp	(revision 71736)
@@ -45,5 +45,5 @@
  * @param   u8SD                Stream descriptor number to assign.
  */
-int hdaStreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD)
+int hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD)
 {
     RT_NOREF(pThis);
@@ -68,5 +68,5 @@
     AssertRCReturn(rc, rc);
 
-    rc = hdaStreamPeriodCreate(&pStream->State.Period);
+    rc = hdaR3StreamPeriodCreate(&pStream->State.Period);
     AssertRCReturn(rc, rc);
 
@@ -119,5 +119,5 @@
  * @param   pStream             HDA stream to destroy.
  */
-void hdaStreamDestroy(PHDASTREAM pStream)
+void hdaR3StreamDestroy(PHDASTREAM pStream)
 {
     AssertPtrReturnVoid(pStream);
@@ -125,10 +125,10 @@
     LogFlowFunc(("[SD%RU8]: Destroying ...\n", pStream->u8SD));
 
-    hdaStreamMapDestroy(&pStream->State.Mapping);
+    hdaR3StreamMapDestroy(&pStream->State.Mapping);
 
     int rc2;
 
 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-    rc2 = hdaStreamAsyncIODestroy(pStream);
+    rc2 = hdaR3StreamAsyncIODestroy(pStream);
     AssertRC(rc2);
 #endif
@@ -146,5 +146,5 @@
     }
 
-    hdaStreamPeriodDestroy(&pStream->State.Period);
+    hdaR3StreamPeriodDestroy(&pStream->State.Period);
 
 #ifdef DEBUG
@@ -175,5 +175,5 @@
  * @param   uSD                 SD (stream descriptor) number to assign the HDA stream to.
  */
-int hdaStreamInit(PHDASTREAM pStream, uint8_t uSD)
+int hdaR3StreamInit(PHDASTREAM pStream, uint8_t uSD)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
@@ -191,5 +191,5 @@
     PPDMAUDIOSTREAMCFG pCfg = &pStream->State.Cfg;
 
-    int rc = hdaSDFMTToPCMProps(HDA_STREAM_REG(pThis, FMT, uSD), &pCfg->Props);
+    int rc = hdaR3SDFMTToPCMProps(HDA_STREAM_REG(pThis, FMT, uSD), &pCfg->Props);
     if (RT_FAILURE(rc))
     {
@@ -246,5 +246,5 @@
      * number of channels in a single audio stream.
      */
-    rc = hdaStreamMapInit(&pStream->State.Mapping, &pCfg->Props);
+    rc = hdaR3StreamMapInit(&pStream->State.Mapping, &pCfg->Props);
     AssertRCReturn(rc, rc);
 
@@ -284,5 +284,5 @@
             RT_ZERO(BDLE);
 
-            int rc2 = hdaBDLEFetch(pThis, &BDLE, pStream->u64BDLBase, 0 /* Entry */);
+            int rc2 = hdaR3BDLEFetch(pThis, &BDLE, pStream->u64BDLBase, 0 /* Entry */);
             AssertRC(rc2);
 
@@ -299,5 +299,5 @@
             if (   !pThis->cPosAdjustFrames
             /* Position adjustmenet buffer *must* have the IOC bit set! */
-                && hdaBDLENeedsInterrupt(&BDLE))
+                && hdaR3BDLENeedsInterrupt(&BDLE))
             {
                 /** @todo Implement / use a (dynamic) table once this gets more complicated. */
@@ -387,8 +387,8 @@
 
         /* Make sure to also update the stream's DMA counter (based on its current LPIB value). */
-        hdaStreamSetPosition(pStream, HDA_STREAM_REG(pThis, LPIB, pStream->u8SD));
+        hdaR3StreamSetPosition(pStream, HDA_STREAM_REG(pThis, LPIB, pStream->u8SD));
 
 #ifdef LOG_ENABLED
-        hdaBDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
+        hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1);
 #endif
     }
@@ -407,5 +407,5 @@
  * @param   uSD                 Stream descriptor (SD) number to use for this stream.
  */
-void hdaStreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD)
+void hdaR3StreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD)
 {
     AssertPtrReturnVoid(pThis);
@@ -444,9 +444,9 @@
 
 #ifdef HDA_USE_DMA_ACCESS_HANDLER
-    hdaStreamUnregisterDMAHandlers(pThis, pStream);
+    hdaR3StreamUnregisterDMAHandlers(pThis, pStream);
 #endif
 
     /* Assign the default mixer sink to the stream. */
-    pStream->pMixSink             = hdaGetDefaultSink(pThis, uSD);
+    pStream->pMixSink             = hdaR3GetDefaultSink(pThis, uSD);
 
     pStream->State.tsTransferLast = 0;
@@ -460,12 +460,12 @@
 
     /* Reset stream map. */
-    hdaStreamMapReset(&pStream->State.Mapping);
+    hdaR3StreamMapReset(&pStream->State.Mapping);
 
     /* (Re-)initialize the stream with current values. */
-    int rc2 = hdaStreamInit(pStream, uSD);
+    int rc2 = hdaR3StreamInit(pStream, uSD);
     AssertRC(rc2);
 
     /* Reset the stream's period. */
-    hdaStreamPeriodReset(&pStream->State.Period);
+    hdaR3StreamPeriodReset(&pStream->State.Period);
 
 #ifdef DEBUG
@@ -496,5 +496,5 @@
  * @param   fEnable             Whether to enable or disble the stream.
  */
-int hdaStreamEnable(PHDASTREAM pStream, bool fEnable)
+int hdaR3StreamEnable(PHDASTREAM pStream, bool fEnable)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
@@ -545,5 +545,5 @@
 }
 
-uint32_t hdaStreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream)
+uint32_t hdaR3StreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream)
 {
     return HDA_STREAM_REG(pThis, LPIB, pStream->u8SD);
@@ -557,5 +557,5 @@
  * @param   u32LPIB             Absolute position (in bytes) to set current read / write position to.
  */
-void hdaStreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB)
+void hdaR3StreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB)
 {
     AssertPtrReturnVoid(pStream);
@@ -583,5 +583,5 @@
  * @param   pStream             HDA stream to retrieve size for.
  */
-uint32_t hdaStreamGetUsed(PHDASTREAM pStream)
+uint32_t hdaR3StreamGetUsed(PHDASTREAM pStream)
 {
     AssertPtrReturn(pStream, 0);
@@ -599,5 +599,5 @@
  * @param   pStream             HDA stream to retrieve size for.
  */
-uint32_t hdaStreamGetFree(PHDASTREAM pStream)
+uint32_t hdaR3StreamGetFree(PHDASTREAM pStream)
 {
     AssertPtrReturn(pStream, 0);
@@ -617,5 +617,5 @@
  * @param   pStream             HDA stream to retrieve schedule status for.
  */
-bool hdaStreamTransferIsScheduled(PHDASTREAM pStream)
+bool hdaR3StreamTransferIsScheduled(PHDASTREAM pStream)
 {
     if (pStream)
@@ -649,5 +649,5 @@
  * @param   pStream             HDA stream to retrieve timestamp for.
  */
-uint64_t hdaStreamTransferGetNext(PHDASTREAM pStream)
+uint64_t hdaR3StreamTransferGetNext(PHDASTREAM pStream)
 {
     return pStream->State.tsTransferNext;
@@ -664,5 +664,5 @@
  * @param   pcbWritten          Number of bytes written. Optional.
  */
-int hdaStreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
+int hdaR3StreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
@@ -731,5 +731,5 @@
  * @param   pcbRead             Number of bytes read. Optional.
  */
-int hdaStreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead)
+int hdaR3StreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
@@ -806,9 +806,9 @@
  * @param   cbToProcessMax      How much data (in bytes) to process as maximum.
  */
-int hdaStreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax)
+int hdaR3StreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
 
-    hdaStreamLock(pStream);
+    hdaR3StreamLock(pStream);
 
     PHDASTATE pThis = pStream->pHDAState;
@@ -816,5 +816,5 @@
 
     PHDASTREAMPERIOD pPeriod = &pStream->State.Period;
-    if (!hdaStreamPeriodLock(pPeriod))
+    if (!hdaR3StreamPeriodLock(pPeriod))
         return VERR_ACCESS_DENIED;
 
@@ -835,6 +835,6 @@
     if (!fProceed)
     {
-        hdaStreamPeriodUnlock(pPeriod);
-        hdaStreamUnlock(pStream);
+        hdaR3StreamPeriodUnlock(pPeriod);
+        hdaR3StreamUnlock(pStream);
         return VINF_SUCCESS;
     }
@@ -866,7 +866,7 @@
     /* Fetch first / next BDL entry. */
     PHDABDLE pBDLE = &pStream->State.BDLE;
-    if (hdaBDLEIsComplete(pBDLE))
-    {
-        rc = hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
+    if (hdaR3BDLEIsComplete(pBDLE))
+    {
+        rc = hdaR3BDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
         AssertRC(rc);
     }
@@ -956,5 +956,5 @@
             }
 
-            rc = hdaDMAWrite(pThis, pStream, abChunk, cbDMAWritten, &cbDMA /* pcbWritten */);
+            rc = hdaR3DMAWrite(pThis, pStream, abChunk, cbDMAWritten, &cbDMA /* pcbWritten */);
             if (RT_FAILURE(rc))
                 LogRel(("HDA: Writing to stream #%RU8 DMA failed with %Rrc\n", pStream->u8SD, rc));
@@ -966,5 +966,5 @@
             STAM_PROFILE_START(&pThis->StatOut, a);
 
-            rc = hdaDMARead(pThis, pStream, abChunk, cbChunk, &cbDMA /* pcbRead */);
+            rc = hdaR3DMARead(pThis, pStream, abChunk, cbChunk, &cbDMA /* pcbRead */);
             if (RT_SUCCESS(rc))
             {
@@ -999,5 +999,5 @@
                 else
                 {
-                    /**
+                    /*
                      * The following code extracts the required audio stream (channel) data
                      * of non-interleaved *and* interleaved audio streams.
@@ -1010,6 +1010,6 @@
                      * and just discard the other channel's data.
                      *
-                     * @todo Optimize this stuff -- copying only one frame a time is expensive.
                      */
+                    /** @todo Optimize this stuff -- copying only one frame a time is expensive. */
                     uint32_t cbDMARead = pStream->State.cbDMALeft ? pStream->State.cbFrameSize - pStream->State.cbDMALeft : 0;
                     uint32_t cbDMALeft = RT_MIN(cbDMA, (uint32_t)RTCircBufFree(pCircBuf));
@@ -1070,22 +1070,22 @@
             }
 
-            /**
+            /*
              * Update the stream's current position.
              * Do this as accurate and close to the actual data transfer as possible.
              * All guetsts rely on this, depending on the mechanism they use (LPIB register or DMA counters).
              */
-            uint32_t cbStreamPos = hdaStreamGetPosition(pThis, pStream);
+            uint32_t cbStreamPos = hdaR3StreamGetPosition(pThis, pStream);
             if (cbStreamPos == pStream->u32CBL)
                 cbStreamPos = 0;
 
-            hdaStreamSetPosition(pStream, cbStreamPos + cbDMA);
-        }
-
-        if (hdaBDLEIsComplete(pBDLE))
+            hdaR3StreamSetPosition(pStream, cbStreamPos + cbDMA);
+        }
+
+        if (hdaR3BDLEIsComplete(pBDLE))
         {
             Log3Func(("[SD%RU8] Complete: %R[bdle]\n", pStream->u8SD, pBDLE));
 
                 /* Does the current BDLE require an interrupt to be sent? */
-            if (   hdaBDLENeedsInterrupt(pBDLE)
+            if (   hdaR3BDLENeedsInterrupt(pBDLE)
                 /* Are we done doing the position adjustment?
                  * It can happen that a BDLE which is handled while doing the
@@ -1116,5 +1116,5 @@
 
             /* Fetch the next BDLE entry. */
-            hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
+            hdaR3BDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
         }
 
@@ -1137,5 +1137,6 @@
     if (pStream->State.cPosAdjustFramesLeft == 0)
     {
-        hdaStreamPeriodInc(pPeriod, RT_MIN(cbProcessed / pStream->State.cbFrameSize, hdaStreamPeriodGetRemainingFrames(pPeriod)));
+        hdaR3StreamPeriodInc(pPeriod, RT_MIN(cbProcessed / pStream->State.cbFrameSize,
+                                             hdaR3StreamPeriodGetRemainingFrames(pPeriod)));
 
         pStream->State.cbTransferProcessed += cbProcessed;
@@ -1152,5 +1153,5 @@
     if (fTransferComplete)
     {
-        /**
+        /*
          * Try updating the wall clock.
          *
@@ -1164,8 +1165,10 @@
          *         sound output. Running VLC on the guest will tell!
          */
-        const bool fWalClkSet = hdaWalClkSet(pThis,
-                                               hdaWalClkGetCurrent(pThis)
-                                             + hdaStreamPeriodFramesToWalClk(pPeriod, pStream->State.cbTransferProcessed / pStream->State.cbFrameSize),
-                                             false /* fForce */);
+        const bool fWalClkSet = hdaR3WalClkSet(pThis,
+                                                 hdaWalClkGetCurrent(pThis)
+                                               + hdaR3StreamPeriodFramesToWalClk(pPeriod,
+                                                                                   pStream->State.cbTransferProcessed
+                                                                                 / pStream->State.cbFrameSize),
+                                               false /* fForce */);
         RT_NOREF(fWalClkSet);
     }
@@ -1176,5 +1179,5 @@
         Log3Func(("[SD%RU8] Scheduling interrupt\n", pStream->u8SD));
 
-        /**
+        /*
          * Set the stream's BCIS bit.
          *
@@ -1211,5 +1214,5 @@
         tsTransferNext = tsNow + (cbTransferNext * pStream->State.cTicksPerByte);
 
-        /**
+        /*
          * If the current transfer is complete, reset our counter.
          *
@@ -1230,5 +1233,5 @@
 
         LogFunc(("Timer set SD%RU8\n", pStream->u8SD));
-        hdaTimerSet(pStream->pHDAState, pStream, tsTransferNext, false /* fForce */);
+        hdaR3TimerSet(pStream->pHDAState, pStream, tsTransferNext, false /* fForce */);
 
         TMTimerLock(pStream->pTimer, VINF_SUCCESS);
@@ -1246,6 +1249,6 @@
               pStream->u8SD, tsNow, tsTransferNext, tsTransferNext - tsNow));
 
-    hdaStreamPeriodUnlock(pPeriod);
-    hdaStreamUnlock(pStream);
+    hdaR3StreamPeriodUnlock(pPeriod);
+    hdaR3StreamUnlock(pStream);
 
     return VINF_SUCCESS;
@@ -1262,5 +1265,5 @@
  *                              context or an asynchronous I/O stream thread (if supported).
  */
-void hdaStreamUpdate(PHDASTREAM pStream, bool fInTimer)
+void hdaR3StreamUpdate(PHDASTREAM pStream, bool fInTimer)
 {
     if (!pStream)
@@ -1282,5 +1285,5 @@
     {
         /* Is the HDA stream ready to be written (guest output data) to? If so, by how much? */
-        const uint32_t cbFree = hdaStreamGetFree(pStream);
+        const uint32_t cbFree = hdaR3StreamGetFree(pStream);
 
         if (   fInTimer
@@ -1290,10 +1293,10 @@
 
             /* Do the DMA transfer. */
-            rc2 = hdaStreamTransfer(pStream, cbFree);
+            rc2 = hdaR3StreamTransfer(pStream, cbFree);
             AssertRC(rc2);
         }
 
         /* How much (guest output) data is available at the moment for the HDA stream? */
-        uint32_t cbUsed = hdaStreamGetUsed(pStream);
+        uint32_t cbUsed = hdaR3StreamGetUsed(pStream);
 
 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
@@ -1301,5 +1304,5 @@
             && cbUsed)
         {
-            rc2 = hdaStreamAsyncIONotify(pStream);
+            rc2 = hdaR3StreamAsyncIONotify(pStream);
             AssertRC(rc2);
         }
@@ -1317,5 +1320,5 @@
             {
                 /* Read (guest output) data and write it to the stream's sink. */
-                rc2 = hdaStreamRead(pStream, cbUsed, NULL /* pcbRead */);
+                rc2 = hdaR3StreamRead(pStream, cbUsed, NULL /* pcbRead */);
                 AssertRC(rc2);
             }
@@ -1343,5 +1346,5 @@
 
             /* How much (guest input) data is available for writing at the moment for the HDA stream? */
-            const uint32_t cbFree = hdaStreamGetFree(pStream);
+            const uint32_t cbFree = hdaR3StreamGetFree(pStream);
 
             Log3Func(("[SD%RU8] cbReadable=%RU32, cbFree=%RU32\n", pStream->u8SD, cbReadable, cbFree));
@@ -1370,5 +1373,5 @@
                     /* Write (guest input) data to the stream which was read from stream's sink before. */
                     uint32_t cbWritten;
-                    rc2 = hdaStreamWrite(pStream, abFIFO, cbRead, &cbWritten);
+                    rc2 = hdaR3StreamWrite(pStream, abFIFO, cbRead, &cbWritten);
                     AssertRCBreak(rc2);
 
@@ -1392,5 +1395,5 @@
                 if (cbReadable)
                 {
-                    rc2 = hdaStreamWrite(pStream, NULL /* Silence */, cbReadable, NULL /* pcbWritten */);
+                    rc2 = hdaR3StreamWrite(pStream, NULL /* Silence */, cbReadable, NULL /* pcbWritten */);
                     AssertRC(rc2);
                 }
@@ -1409,5 +1412,5 @@
             if (tsNow - s_lasti >= 10) /** @todo Fix this properly. */
             {
-                rc2 = hdaStreamAsyncIONotify(pStream);
+                rc2 = hdaR3StreamAsyncIONotify(pStream);
                 AssertRC(rc2);
 
@@ -1415,8 +1418,8 @@
             }
 
-            const uint32_t cbToTransfer = hdaStreamGetUsed(pStream);
+            const uint32_t cbToTransfer = hdaR3StreamGetUsed(pStream);
             if (cbToTransfer)
             {
-                rc2 = hdaStreamTransfer(pStream, cbToTransfer);
+                rc2 = hdaR3StreamTransfer(pStream, cbToTransfer);
                 AssertRC(rc2);
             }
@@ -1433,5 +1436,5 @@
  * @param   pStream             HDA stream to lock.
  */
-void hdaStreamLock(PHDASTREAM pStream)
+void hdaR3StreamLock(PHDASTREAM pStream)
 {
     AssertPtrReturnVoid(pStream);
@@ -1446,5 +1449,5 @@
  * @param   pStream             HDA stream to unlock.
  */
-void hdaStreamUnlock(PHDASTREAM pStream)
+void hdaR3StreamUnlock(PHDASTREAM pStream)
 {
     AssertPtrReturnVoid(pStream);
@@ -1461,5 +1464,5 @@
  * @param   u32LPIB             New LPIB (position) value to set.
  */
-uint32_t hdaStreamUpdateLPIB(PHDASTREAM pStream, uint32_t u32LPIB)
+uint32_t hdaR3StreamUpdateLPIB(PHDASTREAM pStream, uint32_t u32LPIB)
 {
     AssertPtrReturn(pStream, 0);
@@ -1497,5 +1500,5 @@
  * @param   pStream             HDA stream to register BDLE access handlers for.
  */
-bool hdaStreamRegisterDMAHandlers(PHDASTREAM pStream)
+bool hdaR3StreamRegisterDMAHandlers(PHDASTREAM pStream)
 {
     /* At least LVI and the BDL base must be set. */
@@ -1506,5 +1509,5 @@
     }
 
-    hdaStreamUnregisterDMAHandlers(pStream);
+    hdaR3StreamUnregisterDMAHandlers(pStream);
 
     LogFunc(("Registering ...\n"));
@@ -1527,5 +1530,5 @@
     {
         HDABDLE BDLE;
-        rc = hdaBDLEFetch(pThis, &BDLE, pStream->u64BDLBase, i /* Index */);
+        rc = hdaR3BDLEFetch(pThis, &BDLE, pStream->u64BDLBase, i /* Index */);
         if (RT_FAILURE(rc))
             break;
@@ -1634,5 +1637,5 @@
  * @param   pStream             HDA stream to unregister BDLE access handlers for.
  */
-void hdaStreamUnregisterDMAHandlers(PHDASTREAM pStream)
+void hdaR3StreamUnregisterDMAHandlers(PHDASTREAM pStream)
 {
     LogFunc(("\n"));
@@ -1670,5 +1673,5 @@
  * @param   pvUser              User argument. Must be of type PHDASTREAMTHREADCTX.
  */
-DECLCALLBACK(int) hdaStreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
+DECLCALLBACK(int) hdaR3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser)
 {
     PHDASTREAMTHREADCTX pCtx = (PHDASTREAMTHREADCTX)pvUser;
@@ -1704,5 +1707,5 @@
             }
 
-            hdaStreamUpdate(pStream, false /* fInTimer */);
+            hdaR3StreamUpdate(pStream, false /* fInTimer */);
 
             int rc3 = RTCritSectLeave(&pAIO->CritSect);
@@ -1726,5 +1729,5 @@
  * @param   pStream             HDA audio stream to create the async I/O thread for.
  */
-int hdaStreamAsyncIOCreate(PHDASTREAM pStream)
+int hdaR3StreamAsyncIOCreate(PHDASTREAM pStream)
 {
     PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1747,5 +1750,5 @@
                 RTStrPrintf2(szThreadName, sizeof(szThreadName), "hdaAIO%RU8", pStream->u8SD);
 
-                rc = RTThreadCreate(&pAIO->Thread, hdaStreamAsyncIOThread, &Ctx,
+                rc = RTThreadCreate(&pAIO->Thread, hdaR3StreamAsyncIOThread, &Ctx,
                                     0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, szThreadName);
                 if (RT_SUCCESS(rc))
@@ -1767,5 +1770,5 @@
  * @param   pStream             HDA audio stream to destroy the async I/O thread for.
  */
-int hdaStreamAsyncIODestroy(PHDASTREAM pStream)
+int hdaR3StreamAsyncIODestroy(PHDASTREAM pStream)
 {
     PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1776,5 +1779,5 @@
     ASMAtomicWriteBool(&pAIO->fShutdown, true);
 
-    int rc = hdaStreamAsyncIONotify(pStream);
+    int rc = hdaR3StreamAsyncIONotify(pStream);
     AssertRC(rc);
 
@@ -1806,5 +1809,5 @@
  * @param   pStream             HDA stream to notify async I/O thread for.
  */
-int hdaStreamAsyncIONotify(PHDASTREAM pStream)
+int hdaR3StreamAsyncIONotify(PHDASTREAM pStream)
 {
     return RTSemEventSignal(pStream->State.AIO.Event);
@@ -1816,5 +1819,5 @@
  * @param   pStream             HDA stream to lock async I/O thread for.
  */
-void hdaStreamAsyncIOLock(PHDASTREAM pStream)
+void hdaR3StreamAsyncIOLock(PHDASTREAM pStream)
 {
     PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1832,5 +1835,5 @@
  * @param   pStream             HDA stream to unlock async I/O thread for.
  */
-void hdaStreamAsyncIOUnlock(PHDASTREAM pStream)
+void hdaR3StreamAsyncIOUnlock(PHDASTREAM pStream)
 {
     PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
@@ -1851,5 +1854,5 @@
  * @remarks Does not do locking.
  */
-void hdaStreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable)
+void hdaR3StreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable)
 {
     PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO;
Index: /trunk/src/VBox/Devices/Audio/HDAStream.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStream.h	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStream.h	(revision 71736)
@@ -243,24 +243,24 @@
  * @{
  */
-int               hdaStreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD);
-void              hdaStreamDestroy(PHDASTREAM pStream);
-int               hdaStreamInit(PHDASTREAM pStream, uint8_t uSD);
-void              hdaStreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD);
-int               hdaStreamEnable(PHDASTREAM pStream, bool fEnable);
-uint32_t          hdaStreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream);
-void              hdaStreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB);
-uint32_t          hdaStreamGetFree(PHDASTREAM pStream);
-uint32_t          hdaStreamGetUsed(PHDASTREAM pStream);
-bool              hdaStreamTransferIsScheduled(PHDASTREAM pStream);
-uint64_t          hdaStreamTransferGetNext(PHDASTREAM pStream);
-int               hdaStreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax);
-void              hdaStreamLock(PHDASTREAM pStream);
-void              hdaStreamUnlock(PHDASTREAM pStream);
-int               hdaStreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead);
-int               hdaStreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
-void              hdaStreamUpdate(PHDASTREAM pStream, bool fAsync);
+int               hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD);
+void              hdaR3StreamDestroy(PHDASTREAM pStream);
+int               hdaR3StreamInit(PHDASTREAM pStream, uint8_t uSD);
+void              hdaR3StreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD);
+int               hdaR3StreamEnable(PHDASTREAM pStream, bool fEnable);
+uint32_t          hdaR3StreamGetPosition(PHDASTATE pThis, PHDASTREAM pStream);
+void              hdaR3StreamSetPosition(PHDASTREAM pStream, uint32_t u32LPIB);
+uint32_t          hdaR3StreamGetFree(PHDASTREAM pStream);
+uint32_t          hdaR3StreamGetUsed(PHDASTREAM pStream);
+bool              hdaR3StreamTransferIsScheduled(PHDASTREAM pStream);
+uint64_t          hdaR3StreamTransferGetNext(PHDASTREAM pStream);
+int               hdaR3StreamTransfer(PHDASTREAM pStream, uint32_t cbToProcessMax);
+void              hdaR3StreamLock(PHDASTREAM pStream);
+void              hdaR3StreamUnlock(PHDASTREAM pStream);
+int               hdaR3StreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead);
+int               hdaR3StreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten);
+void              hdaR3StreamUpdate(PHDASTREAM pStream, bool fAsync);
 # ifdef HDA_USE_DMA_ACCESS_HANDLER
-bool              hdaStreamRegisterDMAHandlers(PHDASTREAM pStream);
-void              hdaStreamUnregisterDMAHandlers(PHDASTREAM pStream);
+bool              hdaR3StreamRegisterDMAHandlers(PHDASTREAM pStream);
+void              hdaR3StreamUnregisterDMAHandlers(PHDASTREAM pStream);
 # endif /* HDA_USE_DMA_ACCESS_HANDLER */
 /** @} */
@@ -269,5 +269,5 @@
  * @{
  */
-DECLCALLBACK(void) hdaStreamTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
+DECLCALLBACK(void) hdaR3StreamTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
 /** @} */
 
@@ -277,11 +277,11 @@
  */
 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
-DECLCALLBACK(int) hdaStreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
-int               hdaStreamAsyncIOCreate(PHDASTREAM pStream);
-int               hdaStreamAsyncIODestroy(PHDASTREAM pStream);
-int               hdaStreamAsyncIONotify(PHDASTREAM pStream);
-void              hdaStreamAsyncIOLock(PHDASTREAM pStream);
-void              hdaStreamAsyncIOUnlock(PHDASTREAM pStream);
-void              hdaStreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable);
+DECLCALLBACK(int) hdaR3StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser);
+int               hdaR3StreamAsyncIOCreate(PHDASTREAM pStream);
+int               hdaR3StreamAsyncIODestroy(PHDASTREAM pStream);
+int               hdaR3StreamAsyncIONotify(PHDASTREAM pStream);
+void              hdaR3StreamAsyncIOLock(PHDASTREAM pStream);
+void              hdaR3StreamAsyncIOUnlock(PHDASTREAM pStream);
+void              hdaR3StreamAsyncIOEnable(PHDASTREAM pStream, bool fEnable);
 # endif /* VBOX_WITH_AUDIO_HDA_ASYNC_IO */
 /** @} */
Index: /trunk/src/VBox/Devices/Audio/HDAStreamChannel.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamChannel.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamChannel.cpp	(revision 71736)
@@ -35,5 +35,5 @@
  * @param   fFlags
  */
-int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags)
+int hdaR3StreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags)
 {
     int rc = RTCircBufCreate(&pChanData->pCircBuf, 256); /** @todo Make this configurable? */
@@ -51,5 +51,5 @@
  * @param   pChanData           Channel data to destroy.
  */
-void hdaStreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData)
+void hdaR3StreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData)
 {
     if (!pChanData)
@@ -73,5 +73,5 @@
  * @param   cbBuf               Size (in bytes) of audio data to extract.
  */
-int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
+int hdaR3StreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
 {
     AssertPtrReturn(pChan, VERR_INVALID_POINTER);
@@ -130,5 +130,5 @@
  * @remark  Currently not used / implemented.
  */
-int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv)
+int hdaR3StreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv)
 {
     AssertPtrReturn(pChan, VERR_INVALID_POINTER);
@@ -142,5 +142,5 @@
 /**
  * Acquires (reads) audio channel data.
- * Must be released when done with hdaStreamChannelReleaseData().
+ * Must be released when done with hdaR3StreamChannelReleaseData().
  *
  * @returns IPRT status code.
@@ -149,5 +149,5 @@
  * @param   pcbData             Size (in bytes) of acquired data.
  */
-int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void **ppvData, size_t *pcbData)
+int hdaR3StreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void **ppvData, size_t *pcbData)
 {
     AssertPtrReturn(pChanData, VERR_INVALID_POINTER);
@@ -162,10 +162,10 @@
 
 /**
- * Releases formerly acquired data by hdaStreamChannelAcquireData().
+ * Releases formerly acquired data by hdaR3StreamChannelAcquireData().
  *
  * @returns IPRT status code.
  * @param   pChanData           Channel data to release formerly acquired data for.
  */
-int hdaStreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData)
+int hdaR3StreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData)
 {
     AssertPtrReturn(pChanData, VERR_INVALID_POINTER);
Index: /trunk/src/VBox/Devices/Audio/HDAStreamChannel.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamChannel.h	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamChannel.h	(revision 71736)
@@ -19,10 +19,10 @@
 #define HDA_STREAMCHANNEL_H
 
-int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags);
-void hdaStreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData);
-int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf);
-int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv);
-int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *ppvData, size_t *pcbData);
-int hdaStreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData);
+int  hdaR3StreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags);
+void hdaR3StreamChannelDataDestroy(PPDMAUDIOSTREAMCHANNELDATA pChanData);
+int  hdaR3StreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf);
+int  hdaR3StreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv);
+int  hdaR3StreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *ppvData, size_t *pcbData);
+int  hdaR3StreamChannelReleaseData(PPDMAUDIOSTREAMCHANNELDATA pChanData);
 
 #endif /* !HDA_STREAMCHANNEL_H */
Index: /trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp	(revision 71736)
@@ -42,5 +42,5 @@
  * @param   pProps              Pointer to PCM properties to use for initialization.
  */
-int hdaStreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps)
+int hdaR3StreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps)
 {
     AssertPtrReturn(pMapping, VERR_INVALID_POINTER);
@@ -50,5 +50,5 @@
         return VERR_INVALID_PARAMETER;
 
-    hdaStreamMapReset(pMapping);
+    hdaR3StreamMapReset(pMapping);
 
     pMapping->paChannels = (PPDMAUDIOSTREAMCHANNEL)RTMemAlloc(sizeof(PDMAUDIOSTREAMCHANNEL) * pProps->cChannels);
@@ -70,5 +70,5 @@
         pChan->cbOff    = pChan->cbFirst;
 
-        int rc2 = hdaStreamChannelDataInit(&pChan->Data, PDMAUDIOSTREAMCHANNELDATA_FLAG_NONE);
+        int rc2 = hdaR3StreamChannelDataInit(&pChan->Data, PDMAUDIOSTREAMCHANNELDATA_FLAG_NONE);
         if (RT_SUCCESS(rc))
             rc = rc2;
@@ -106,7 +106,7 @@
  * @param   pMapping            Pointer to mapping to destroy.
  */
-void hdaStreamMapDestroy(PHDASTREAMMAPPING pMapping)
+void hdaR3StreamMapDestroy(PHDASTREAMMAPPING pMapping)
 {
-    hdaStreamMapReset(pMapping);
+    hdaR3StreamMapReset(pMapping);
 
     if (pMapping->pCircBuf)
@@ -123,5 +123,5 @@
  * @param   pMapping            Pointer to mapping to reset.
  */
-void hdaStreamMapReset(PHDASTREAMMAPPING pMapping)
+void hdaR3StreamMapReset(PHDASTREAMMAPPING pMapping)
 {
     AssertPtrReturnVoid(pMapping);
@@ -132,5 +132,5 @@
     {
         for (uint8_t i = 0; i < pMapping->cChannels; i++)
-            hdaStreamChannelDataDestroy(&pMapping->paChannels[i].Data);
+            hdaR3StreamChannelDataDestroy(&pMapping->paChannels[i].Data);
 
         AssertPtr(pMapping->paChannels);
Index: /trunk/src/VBox/Devices/Audio/HDAStreamMap.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamMap.h	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamMap.h	(revision 71736)
@@ -38,7 +38,7 @@
  */
 #ifdef IN_RING3
-int  hdaStreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps);
-void hdaStreamMapDestroy(PHDASTREAMMAPPING pMapping);
-void hdaStreamMapReset(PHDASTREAMMAPPING pMapping);
+int  hdaR3StreamMapInit(PHDASTREAMMAPPING pMapping, PPDMAUDIOPCMPROPS pProps);
+void hdaR3StreamMapDestroy(PHDASTREAMMAPPING pMapping);
+void hdaR3StreamMapReset(PHDASTREAMMAPPING pMapping);
 #endif /* IN_RING3 */
 /** @} */
Index: /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp	(revision 71736)
@@ -48,5 +48,5 @@
  * @param   pPeriod             Stream period to initialize.
  */
-int hdaStreamPeriodCreate(PHDASTREAMPERIOD pPeriod)
+int hdaR3StreamPeriodCreate(PHDASTREAMPERIOD pPeriod)
 {
     Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_VALID));
@@ -64,5 +64,5 @@
  * @param   pPeriod             Stream period to destroy.
  */
-void hdaStreamPeriodDestroy(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodDestroy(PHDASTREAMPERIOD pPeriod)
 {
     if (pPeriod->fStatus & HDASTREAMPERIOD_FLAG_VALID)
@@ -78,5 +78,5 @@
  *
  * @return  VBox status code.
- * @param   pPeriod             Stream period to (re-)initialize. Must be created with hdaStreamPeriodCreate() first.
+ * @param   pPeriod             Stream period to (re-)initialize. Must be created with hdaR3StreamPeriodCreate() first.
  * @param   u8SD                Stream descriptor (serial data #) number to assign this stream period to.
  * @param   u16LVI              The HDA stream's LVI value to use for the period calculation.
@@ -84,6 +84,6 @@
  * @param   pStreamCfg          Audio stream configuration to use for this period.
  */
-int hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod,
-                        uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
+int hdaR3StreamPeriodInit(PHDASTREAMPERIOD pPeriod,
+                          uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg)
 {
     if (   !u16LVI
@@ -111,5 +111,5 @@
     pPeriod->u64StartWalClk    = 0;
     pPeriod->u32Hz             = pStreamCfg->Props.uHz;
-    pPeriod->u64DurationWalClk = hdaStreamPeriodFramesToWalClk(pPeriod, framesToTransfer);
+    pPeriod->u64DurationWalClk = hdaR3StreamPeriodFramesToWalClk(pPeriod, framesToTransfer);
     pPeriod->u64ElapsedWalClk  = 0;
     pPeriod->i64DelayWalClk    = 0;
@@ -130,5 +130,5 @@
  * @param   pPeriod             Stream period to reset.
  */
-void hdaStreamPeriodReset(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodReset(PHDASTREAMPERIOD pPeriod)
 {
     Log3Func(("[SD%RU8]\n", pPeriod->u8SD));
@@ -155,5 +155,5 @@
  * @param   u64WalClk           Wall clock (WALCLK) value to set for the period's starting point.
  */
-int hdaStreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
+int hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
 {
     Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE)); /* No nested calls. */
@@ -177,5 +177,5 @@
  * @param   pPeriod             Stream period to end life span for.
  */
-void hdaStreamPeriodEnd(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodEnd(PHDASTREAMPERIOD pPeriod)
 {
     Log3Func(("[SD%RU8] Took %zuus\n", pPeriod->u8SD, (RTTimeNanoTS() - pPeriod->Dbg.tsStartNs) / 1000));
@@ -188,5 +188,5 @@
               ("%RU8 interrupts for stream #%RU8 still pending -- so ending a period might trigger audio hangs\n",
                pPeriod->cIntPending, pPeriod->u8SD));
-    Assert(hdaStreamPeriodIsComplete(pPeriod));
+    Assert(hdaR3StreamPeriodIsComplete(pPeriod));
 
     pPeriod->fStatus &= ~HDASTREAMPERIOD_FLAG_ACTIVE;
@@ -198,5 +198,5 @@
  * @param   pPeriod             Stream period to pause.
  */
-void hdaStreamPeriodPause(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodPause(PHDASTREAMPERIOD pPeriod)
 {
     AssertMsg((pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE), ("Period %p already in inactive state\n", pPeriod));
@@ -212,5 +212,5 @@
  * @param   pPeriod             Stream period to resume.
  */
-void hdaStreamPeriodResume(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodResume(PHDASTREAMPERIOD pPeriod)
 {
     AssertMsg(!(pPeriod->fStatus & HDASTREAMPERIOD_FLAG_ACTIVE), ("Period %p already in active state\n", pPeriod));
@@ -227,5 +227,5 @@
  * @param   pPeriod             Stream period to lock.
  */
-bool hdaStreamPeriodLock(PHDASTREAMPERIOD pPeriod)
+bool hdaR3StreamPeriodLock(PHDASTREAMPERIOD pPeriod)
 {
     return RT_SUCCESS(RTCritSectEnter(&pPeriod->CritSect));
@@ -237,5 +237,5 @@
  * @param   pPeriod             Stream period to unlock.
  */
-void hdaStreamPeriodUnlock(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodUnlock(PHDASTREAMPERIOD pPeriod)
 {
     int rc2 = RTCritSectLeave(&pPeriod->CritSect);
@@ -252,5 +252,5 @@
  * @remark  Calculation depends on the given stream period and assumes a 24 MHz wall clock counter (WALCLK).
  */
-uint64_t hdaStreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames)
+uint64_t hdaR3StreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames)
 {
     /* Prevent division by zero. */
@@ -268,5 +268,5 @@
  * @param   pPeriod             Stream period to use.
  */
-uint64_t hdaStreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod)
+uint64_t hdaR3StreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod)
 {
     return pPeriod->u64StartWalClk
@@ -282,5 +282,5 @@
  * @param   pPeriod             Stream period to use.
  */
-uint64_t hdaStreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod)
+uint64_t hdaR3StreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod)
 {
     return pPeriod->u64StartWalClk + pPeriod->u64DurationWalClk;
@@ -293,5 +293,5 @@
  * @param   pPeriod             Stream period to return value for.
  */
-uint32_t hdaStreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod)
+uint32_t hdaR3StreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod)
 {
     Assert(pPeriod->framesToTransfer >= pPeriod->framesTransferred);
@@ -305,5 +305,5 @@
  * @param   pPeriod             Stream period to get status for.
  */
-bool hdaStreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod)
+bool hdaR3StreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod)
 {
     return (pPeriod->u64ElapsedWalClk >= pPeriod->u64DurationWalClk);
@@ -318,5 +318,5 @@
  * @param   u64WalClk           Absolute wall clock (WALCLK) time to check for.
  */
-bool hdaStreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
+bool hdaR3StreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk)
 {
     /* Period not in use? */
@@ -324,5 +324,5 @@
         return true; /* ... implies that it has passed. */
 
-    if (hdaStreamPeriodHasElapsed(pPeriod))
+    if (hdaR3StreamPeriodHasElapsed(pPeriod))
         return true; /* Period already has elapsed. */
 
@@ -336,5 +336,5 @@
  * @param   pPeriod             Stream period to get status for.
  */
-bool hdaStreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod)
+bool hdaR3StreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod)
 {
     return pPeriod->cIntPending > 0;
@@ -349,5 +349,5 @@
  *          keeps track of the required (pending) interrupts for a stream period.
  */
-void hdaStreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod)
 {
     uint32_t cIntPending = pPeriod->cIntPending;
@@ -368,5 +368,5 @@
  * @param   pPeriod             Stream period to release pending interrupt for.
  */
-void hdaStreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod)
+void hdaR3StreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod)
 {
     Assert(pPeriod->cIntPending);
@@ -383,10 +383,10 @@
  * @param   framesInc           Audio frames to add.
  */
-void hdaStreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc)
+void hdaR3StreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc)
 {
     pPeriod->framesTransferred += framesInc;
     Assert(pPeriod->framesTransferred <= pPeriod->framesToTransfer);
 
-    pPeriod->u64ElapsedWalClk   = hdaStreamPeriodFramesToWalClk(pPeriod, pPeriod->framesTransferred);
+    pPeriod->u64ElapsedWalClk   = hdaR3StreamPeriodFramesToWalClk(pPeriod, pPeriod->framesTransferred);
     Assert(pPeriod->u64ElapsedWalClk <= pPeriod->u64DurationWalClk);
 
@@ -404,8 +404,8 @@
  *          and 2) processed all required audio frames.
  */
-bool hdaStreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod)
+bool hdaR3StreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod)
 {
     const bool fIsComplete = /* Has the period elapsed time-wise? */
-                                hdaStreamPeriodHasElapsed(pPeriod)
+                                hdaR3StreamPeriodHasElapsed(pPeriod)
                              /* All frames transferred? */
                              && pPeriod->framesTransferred >= pPeriod->framesToTransfer;
@@ -422,6 +422,6 @@
               fIsComplete ? "COMPLETE" : "NOT COMPLETE YET",
               pPeriod->u64ElapsedWalClk, pPeriod->u64DurationWalClk,
-              hdaStreamPeriodGetAbsElapsedWalClk(pPeriod), pPeriod->u64StartWalClk,
-              hdaStreamPeriodGetAbsEndWalClk(pPeriod), pPeriod->cIntPending));
+              hdaR3StreamPeriodGetAbsElapsedWalClk(pPeriod), pPeriod->u64StartWalClk,
+              hdaR3StreamPeriodGetAbsEndWalClk(pPeriod), pPeriod->cIntPending));
 
     return fIsComplete;
Index: /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h	(revision 71735)
+++ /trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h	(revision 71736)
@@ -84,25 +84,25 @@
 
 #ifdef IN_RING3
-int      hdaStreamPeriodCreate(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodDestroy(PHDASTREAMPERIOD pPeriod);
-int      hdaStreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
-void     hdaStreamPeriodReset(PHDASTREAMPERIOD pPeriod);
-int      hdaStreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
-void     hdaStreamPeriodEnd(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodPause(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodResume(PHDASTREAMPERIOD pPeriod);
-bool     hdaStreamPeriodLock(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodUnlock(PHDASTREAMPERIOD pPeriod);
-uint64_t hdaStreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames);
-uint64_t hdaStreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod);
-uint64_t hdaStreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod);
-uint32_t hdaStreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod);
-bool     hdaStreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod);
-bool     hdaStreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
-bool     hdaStreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod);
-void     hdaStreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc);
-bool     hdaStreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod);
+int      hdaR3StreamPeriodCreate(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodDestroy(PHDASTREAMPERIOD pPeriod);
+int      hdaR3StreamPeriodInit(PHDASTREAMPERIOD pPeriod, uint8_t u8SD, uint16_t u16LVI, uint32_t u32CBL, PPDMAUDIOSTREAMCFG pStreamCfg);
+void     hdaR3StreamPeriodReset(PHDASTREAMPERIOD pPeriod);
+int      hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
+void     hdaR3StreamPeriodEnd(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodPause(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodResume(PHDASTREAMPERIOD pPeriod);
+bool     hdaR3StreamPeriodLock(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodUnlock(PHDASTREAMPERIOD pPeriod);
+uint64_t hdaR3StreamPeriodFramesToWalClk(PHDASTREAMPERIOD pPeriod, uint32_t uFrames);
+uint64_t hdaR3StreamPeriodGetAbsEndWalClk(PHDASTREAMPERIOD pPeriod);
+uint64_t hdaR3StreamPeriodGetAbsElapsedWalClk(PHDASTREAMPERIOD pPeriod);
+uint32_t hdaR3StreamPeriodGetRemainingFrames(PHDASTREAMPERIOD pPeriod);
+bool     hdaR3StreamPeriodHasElapsed(PHDASTREAMPERIOD pPeriod);
+bool     hdaR3StreamPeriodHasPassedAbsWalClk(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk);
+bool     hdaR3StreamPeriodNeedsInterrupt(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodAcquireInterrupt(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodReleaseInterrupt(PHDASTREAMPERIOD pPeriod);
+void     hdaR3StreamPeriodInc(PHDASTREAMPERIOD pPeriod, uint32_t framesInc);
+bool     hdaR3StreamPeriodIsComplete(PHDASTREAMPERIOD pPeriod);
 #endif /* IN_RING3 */
 
