Index: /trunk/src/VBox/Devices/Audio/DevHDA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 82381)
+++ /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 82382)
@@ -266,6 +266,6 @@
  * @{
  */
-static int hdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+static FNHDAREGREAD  hdaRegReadUnimpl;
+static FNHDAREGWRITE hdaRegWriteUnimpl;
 /** @} */
 
@@ -273,19 +273,19 @@
  * @{
  */
-static int hdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+static FNHDAREGWRITE hdaRegWriteGCTL;
+static FNHDAREGREAD  hdaRegReadLPIB;
+static FNHDAREGREAD  hdaRegReadWALCLK;
+static FNHDAREGWRITE hdaRegWriteCORBWP;
+static FNHDAREGWRITE hdaRegWriteCORBRP;
+static FNHDAREGWRITE hdaRegWriteCORBCTL;
+static FNHDAREGWRITE hdaRegWriteCORBSIZE;
+static FNHDAREGWRITE hdaRegWriteCORBSTS;
+static FNHDAREGWRITE hdaRegWriteRINTCNT;
+static FNHDAREGWRITE hdaRegWriteRIRBWP;
+static FNHDAREGWRITE hdaRegWriteRIRBSTS;
+static FNHDAREGWRITE hdaRegWriteSTATESTS;
+static FNHDAREGWRITE hdaRegWriteIRS;
+static FNHDAREGREAD  hdaRegReadIRS;
+static FNHDAREGWRITE hdaRegWriteBase;
 /** @} */
 
@@ -293,13 +293,13 @@
  * @{
  */
-static int hdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+static FNHDAREGWRITE hdaRegWriteSDCBL;
+static FNHDAREGWRITE hdaRegWriteSDCTL;
+static FNHDAREGWRITE hdaRegWriteSDSTS;
+static FNHDAREGWRITE hdaRegWriteSDLVI;
+static FNHDAREGWRITE hdaRegWriteSDFIFOW;
+static FNHDAREGWRITE hdaRegWriteSDFIFOS;
+static FNHDAREGWRITE hdaRegWriteSDFMT;
+static FNHDAREGWRITE hdaRegWriteSDBDPL;
+static FNHDAREGWRITE hdaRegWriteSDBDPU;
 /** @} */
 
@@ -307,14 +307,14 @@
  * @{
  */
-static int hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
+static FNHDAREGREAD  hdaRegReadU32;
+static FNHDAREGWRITE hdaRegWriteU32;
+static FNHDAREGREAD  hdaRegReadU24;
 #ifdef IN_RING3
-static int hdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+static FNHDAREGWRITE hdaRegWriteU24;
 #endif
-static int hdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
-static int hdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
-static int hdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+static FNHDAREGREAD  hdaRegReadU16;
+static FNHDAREGWRITE hdaRegWriteU16;
+static FNHDAREGREAD  hdaRegReadU8;
+static FNHDAREGWRITE hdaRegWriteU8;
 /** @} */
 
@@ -326,5 +326,5 @@
 static int                        hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg);
 # ifdef HDA_USE_DMA_ACCESS_HANDLER
-static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
+static DECLCALLBACK(VBOXSTRICTRC) hdaR3DmaAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
                                                         void *pvBuf, size_t cbBuf,
                                                         PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser);
@@ -386,5 +386,5 @@
     HDA_REG_MAP_STRM(HDA_REG_DESC_SD0_BASE + (index * 32 /* 0x20 */), name)
 
-/* See 302349 p 6.2. */
+/** See 302349 p 6.2. */
 const HDAREGDESC g_aHdaRegMap[HDA_NUM_REGS] =
 {
@@ -899,5 +899,5 @@
 /* Register access handlers. */
 
-static int hdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     RT_NOREF(pDevIns, pThis, iReg);
@@ -906,5 +906,5 @@
 }
 
-static int hdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF(pDevIns, pThis, iReg, u32Value);
@@ -913,5 +913,5 @@
 
 /* U8 */
-static int hdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffffff00) == 0);
@@ -919,5 +919,5 @@
 }
 
-static int hdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     Assert((u32Value & 0xffffff00) == 0);
@@ -926,5 +926,5 @@
 
 /* U16 */
-static int hdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffff0000) == 0);
@@ -932,5 +932,5 @@
 }
 
-static int hdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     Assert((u32Value & 0xffff0000) == 0);
@@ -939,5 +939,5 @@
 
 /* U24 */
-static int hdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xff000000) == 0);
@@ -946,5 +946,5 @@
 
 #ifdef IN_RING3
-static int hdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     Assert((u32Value & 0xff000000) == 0);
@@ -954,5 +954,5 @@
 
 /* U32 */
-static int hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx;
@@ -966,5 +966,5 @@
 }
 
-static int hdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx;
@@ -978,5 +978,5 @@
 }
 
-static int hdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF_PV(iReg);
@@ -1023,5 +1023,5 @@
 }
 
-static int hdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -1036,5 +1036,5 @@
 }
 
-static int hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);
@@ -1094,5 +1094,5 @@
 #endif /* IN_RING3 */
 
-static int hdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
 #ifdef IN_RING3
@@ -1113,5 +1113,5 @@
 }
 
-static int hdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF(iReg);
@@ -1143,16 +1143,14 @@
 }
 
-static int hdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
 #ifdef IN_RING3
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
 
-    int rc = hdaRegWriteU8(pDevIns, pThis, iReg, u32Value);
+    VBOXSTRICTRC rc = hdaRegWriteU8(pDevIns, pThis, iReg, u32Value);
     AssertRC(rc);
 
     if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Start DMA engine. */
-    {
         rc = hdaR3CORBCmdProcess(pThis);
-    }
     else
         LogFunc(("CORB DMA not running, skipping\n"));
@@ -1166,5 +1164,5 @@
 }
 
-static int hdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
 #ifdef IN_RING3
@@ -1226,5 +1224,5 @@
 }
 
-static int hdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF_PV(iReg);
@@ -1238,11 +1236,11 @@
 }
 
-static int hdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
 #ifdef IN_RING3
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
 
-    int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
-    AssertRCSuccess(rc);
+    VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
+    AssertRCSuccess(VBOXSTRICTRC_VAL(rc));
 
     rc = hdaR3CORBCmdProcess(pThis);
@@ -1256,10 +1254,10 @@
 }
 
-static int hdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
 
-    int rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
-    AssertRCSuccess(rc);
+    VBOXSTRICTRC rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
+    AssertRCSuccess(VBOXSTRICTRC_VAL(rc));
 
     DEVHDA_UNLOCK(pDevIns, pThis);
@@ -1267,5 +1265,5 @@
 }
 
-static int hdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
 #ifdef IN_RING3
@@ -1454,6 +1452,6 @@
     }
 
-    int rc2 = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value);
-    AssertRC(rc2);
+    VBOXSTRICTRC rc2 = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value);
+    AssertRC(VBOXSTRICTRC_VAL(rc2));
 
     DEVHDA_UNLOCK_BOTH(pDevIns, pThis, pStream);
@@ -1465,5 +1463,5 @@
 }
 
-static int hdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
 #ifdef IN_RING3
@@ -1580,5 +1578,5 @@
 }
 
-static int hdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -1604,6 +1602,6 @@
                             ("LVI for stream #%RU8 must not be bigger than %RU8\n", uSD, UINT8_MAX - 1));
 
-    int rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
-    AssertRC(rc2);
+    VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
+    AssertRC(VBOXSTRICTRC_VAL(rc2));
 
     DEVHDA_UNLOCK(pDevIns, pThis);
@@ -1611,5 +1609,5 @@
 }
 
-static int hdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -1657,6 +1655,6 @@
         LogFunc(("[SD%RU8] Updating FIFOW to %RU32 bytes\n", uSD, pStream->u16FIFOW));
 
-        int rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOW);
-        AssertRC(rc2);
+        VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOW);
+        AssertRC(VBOXSTRICTRC_VAL(rc2));
     }
 
@@ -1668,5 +1666,5 @@
  * @note This method could be called for changing value on Output Streams only (ICH6 datasheet 18.2.39).
  */
-static int hdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -1701,6 +1699,6 @@
     }
 
-    int rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOS);
-    AssertRC(rc2);
+    VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOS);
+    AssertRC(VBOXSTRICTRC_VAL(rc2));
 
     DEVHDA_UNLOCK(pDevIns, pThis);
@@ -1988,5 +1986,5 @@
 #endif /* IN_RING3 */
 
-static int hdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -1999,9 +1997,9 @@
      * When ignoring those (invalid) formats, this leads to MacOS thinking that the device is malfunctioning
      * and therefore disabling the device completely. */
-    int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
-    AssertRC(rc);
+    VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
+    AssertRC(VBOXSTRICTRC_VAL(rc));
 
     DEVHDA_UNLOCK(pDevIns, pThis);
-    return VINF_SUCCESS; /* Always return success to the MMIO handler. */
+    return VINF_SUCCESS; /* Always return success to the MMIO handler. */ /** @todo r=bird: This is non-sense in this context, though due to the double locking not really a problem */
 }
 
@@ -2029,6 +2027,6 @@
 # endif
 
-    int rc2 = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
-    AssertRC(rc2);
+    VBOXSTRICTRC rc2 = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
+    AssertRC(VBOXSTRICTRC_VAL(rc2));
 
     DEVHDA_UNLOCK(pDevIns, pThis);
@@ -2040,15 +2038,15 @@
 }
 
-static int hdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     return hdaRegWriteSDBDPX(pDevIns, pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPL, iReg));
 }
 
-static int hdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     return hdaRegWriteSDBDPX(pDevIns, pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPU, iReg));
 }
 
-static int hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
+static VBOXSTRICTRC hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);
@@ -2061,5 +2059,5 @@
     }
 
-    int rc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value);
+    VBOXSTRICTRC rc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value);
     DEVHDA_UNLOCK(pDevIns, pThis);
 
@@ -2067,5 +2065,5 @@
 }
 
-static int hdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF_PV(iReg);
@@ -2123,5 +2121,5 @@
 }
 
-static int hdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF(iReg);
@@ -2156,5 +2154,5 @@
 }
 
-static int hdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -2168,6 +2166,6 @@
     }
 
-    int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
-    AssertRC(rc);
+    VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
+    AssertRC(VBOXSTRICTRC_VAL(rc));
 
     LogFunc(("Response interrupt count is now %RU8\n", HDA_REG(pThis, RINTCNT) & 0xFF));
@@ -2177,11 +2175,11 @@
 }
 
-static int hdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx;
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
 
-    int rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
-    AssertRCSuccess(rc);
+    VBOXSTRICTRC rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);
+    AssertRCSuccess(VBOXSTRICTRC_VAL(rc));
 
     switch (iReg)
@@ -2228,5 +2226,5 @@
 }
 
-static int hdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
+static VBOXSTRICTRC hdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)
 {
     RT_NOREF_PV(iReg);
@@ -2236,5 +2234,5 @@
     HDA_REG(pThis, RIRBSTS) &= ~(v & u32Value);
 
-    int rc = HDA_PROCESS_INTERRUPT(pDevIns, pThis);
+    VBOXSTRICTRC rc = HDA_PROCESS_INTERRUPT(pDevIns, pThis);
 
     DEVHDA_UNLOCK(pDevIns, pThis);
@@ -2885,5 +2883,5 @@
  * @param   pvUser          User argument.
  */
-static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
+static DECLCALLBACK(VBOXSTRICTRC) hdaR3DmaAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,
                                                         void *pvBuf, size_t cbBuf,
                                                         PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser)
@@ -3121,8 +3119,8 @@
  *       spec.
  */
-static DECLCALLBACK(VBOXSTRICTRC) hdaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)
-{
-    PHDASTATE   pThis  = PDMDEVINS_2_DATA(pDevIns, PHDASTATE);
-    int         rc;
+static DECLCALLBACK(VBOXSTRICTRC) hdaMmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)
+{
+    PHDASTATE       pThis  = PDMDEVINS_2_DATA(pDevIns, PHDASTATE);
+    VBOXSTRICTRC    rc;
     RT_NOREF_PV(pvUser);
     Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC);
@@ -3160,5 +3158,5 @@
              */
             rc = g_aHdaRegMap[idxRegDsc].pfnRead(pDevIns, pThis, idxRegDsc, (uint32_t *)pv);
-            Log3Func(("\tRead %s => %x (%Rrc)\n", g_aHdaRegMap[idxRegDsc].abbrev, *(uint32_t *)pv, rc));
+            Log3Func(("\tRead %s => %x (%Rrc)\n", g_aHdaRegMap[idxRegDsc].abbrev, *(uint32_t *)pv, VBOXSTRICTRC_VAL(rc)));
         }
         else
@@ -3177,5 +3175,5 @@
 
                 rc = g_aHdaRegMap[idxRegDsc].pfnRead(pDevIns, pThis, idxRegDsc, &u32Tmp);
-                Log3Func(("\tRead %s[%db] => %x (%Rrc)*\n", g_aHdaRegMap[idxRegDsc].abbrev, cbReg, u32Tmp, rc));
+                Log3Func(("\tRead %s[%db] => %x (%Rrc)*\n", g_aHdaRegMap[idxRegDsc].abbrev, cbReg, u32Tmp, VBOXSTRICTRC_VAL(rc)));
                 if (rc != VINF_SUCCESS)
                     break;
@@ -3210,9 +3208,9 @@
 #ifdef LOG_ENABLED
     if (cbLog == 4)
-        Log3Func(("\tReturning @%#05x -> %#010x %Rrc\n", offRegLog, *(uint32_t *)pv, rc));
+        Log3Func(("\tReturning @%#05x -> %#010x %Rrc\n", offRegLog, *(uint32_t *)pv, VBOXSTRICTRC_VAL(rc)));
     else if (cbLog == 2)
-        Log3Func(("\tReturning @%#05x -> %#06x %Rrc\n", offRegLog, *(uint16_t *)pv, rc));
+        Log3Func(("\tReturning @%#05x -> %#06x %Rrc\n", offRegLog, *(uint16_t *)pv, VBOXSTRICTRC_VAL(rc)));
     else if (cbLog == 1)
-        Log3Func(("\tReturning @%#05x -> %#04x %Rrc\n", offRegLog, *(uint8_t *)pv, rc));
+        Log3Func(("\tReturning @%#05x -> %#04x %Rrc\n", offRegLog, *(uint8_t *)pv, VBOXSTRICTRC_VAL(rc)));
 #endif
     return rc;
@@ -3220,5 +3218,5 @@
 
 
-DECLINLINE(int) hdaWriteReg(PPDMDEVINS pDevIns, PHDASTATE pThis, int idxRegDsc, uint32_t u32Value, char const *pszLog)
+DECLINLINE(VBOXSTRICTRC) hdaWriteReg(PPDMDEVINS pDevIns, PHDASTATE pThis, int idxRegDsc, uint32_t u32Value, char const *pszLog)
 {
     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE);
@@ -3278,7 +3276,7 @@
     uint32_t const u32OldValue = pThis->au32Regs[idxRegMem];
 #endif
-    int rc = g_aHdaRegMap[idxRegDsc].pfnWrite(pDevIns, pThis, idxRegDsc, u32Value);
+    VBOXSTRICTRC rc = g_aHdaRegMap[idxRegDsc].pfnWrite(pDevIns, pThis, idxRegDsc, u32Value);
     Log3Func(("Written value %#x to %s[%d byte]; %x => %x%s, rc=%d\n", u32Value, g_aHdaRegMap[idxRegDsc].abbrev,
-              g_aHdaRegMap[idxRegDsc].size, u32OldValue, pThis->au32Regs[idxRegMem], pszLog, rc));
+              g_aHdaRegMap[idxRegDsc].size, u32OldValue, pThis->au32Regs[idxRegMem], pszLog, VBOXSTRICTRC_VAL(rc)));
     RT_NOREF(pszLog);
     return rc;
@@ -3290,8 +3288,7 @@
  *      Looks up and calls the appropriate handler.}
  */
-static DECLCALLBACK(VBOXSTRICTRC) hdaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)
+static DECLCALLBACK(VBOXSTRICTRC) hdaMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)
 {
     PHDASTATE pThis  = PDMDEVINS_2_DATA(pDevIns, PHDASTATE);
-    int       rc;
     RT_NOREF_PV(pvUser);
     Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC);
@@ -3331,4 +3328,5 @@
      * Try for a direct hit first.
      */
+    VBOXSTRICTRC rc;
     if (idxRegDsc >= 0 && g_aHdaRegMap[idxRegDsc].size == cb)
     {
@@ -4830,5 +4828,5 @@
     AssertRCReturn(rc, rc);
 
-    rc = PDMDevHlpPCIIORegionCreateMmio(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaMMIOWrite, hdaMMIORead, NULL /*pvUser*/,
+    rc = PDMDevHlpPCIIORegionCreateMmio(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaMmioWrite, hdaMmioRead, NULL /*pvUser*/,
                                         IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_PASSTHRU, "HDA", &pThis->hMmio);
     AssertRCReturn(rc, rc);
@@ -5191,5 +5189,5 @@
     AssertRCReturn(rc, rc);
 
-    rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmio, hdaMMIOWrite, hdaMMIORead, NULL /*pvUser*/);
+    rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmio, hdaMmioWrite, hdaMmioRead, NULL /*pvUser*/);
     AssertRCReturn(rc, rc);
 
Index: /trunk/src/VBox/Devices/Audio/DevHDACommon.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDACommon.h	(revision 82381)
+++ /trunk/src/VBox/Devices/Audio/DevHDACommon.h	(revision 82382)
@@ -25,30 +25,35 @@
 #include <VBox/log.h> /* LOG_ENABLED */
 
+    /** Read callback. */
+typedef VBOXSTRICTRC FNHDAREGREAD(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
+    /** Write callback. */
+typedef VBOXSTRICTRC FNHDAREGWRITE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+
 /** See 302349 p 6.2. */
 typedef struct HDAREGDESC
 {
     /** Register offset in the register space. */
-    uint32_t    offset;
+    uint32_t        offset;
     /** Size in bytes. Registers of size > 4 are in fact tables. */
-    uint32_t    size;
+    uint32_t        size;
     /** Readable bits. */
-    uint32_t    readable;
+    uint32_t        readable;
     /** Writable bits. */
-    uint32_t    writable;
+    uint32_t        writable;
     /** Register descriptor (RD) flags of type HDA_RD_FLAG_.
      *  These are used to specify the handling (read/write)
      *  policy of the register. */
-    uint32_t    fFlags;
+    uint32_t        fFlags;
     /** Read callback. */
-    int       (*pfnRead)(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);
+    FNHDAREGREAD   *pfnRead;
     /** Write callback. */
-    int       (*pfnWrite)(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);
+    FNHDAREGWRITE  *pfnWrite;
     /** Index into the register storage array. */
-    uint32_t    mem_idx;
+    uint32_t        mem_idx;
     /** Abbreviated name. */
-    const char *abbrev;
+    const char     *abbrev;
     /** Descripton. */
-    const char *desc;
-} HDAREGDESC, *PHDAREGDESC;
+    const char     *desc;
+} HDAREGDESC;
 
 /**
@@ -62,5 +67,5 @@
     /** The register index. */
     int         idxAlias;
-} HDAREGALIAS, *PHDAREGALIAS;
+} HDAREGALIAS;
 
 /**
