VirtualBox

Changeset 80692 in vbox


Ignore:
Timestamp:
Sep 10, 2019 10:17:36 AM (5 years ago)
Author:
vboxsync
Message:

DevHDA: Eliminated the pDevInsR0 and pDevInsRC members from the HDASTATE structure. bugref:9218

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

Legend:

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

    r80691 r80692  
    603603    LogFunc(("fInterrupt=%RTbool\n", fInterrupt));
    604604
    605 # ifndef LOG_ENABLED
    606     hdaProcessInterrupt(pThis);
    607 # else
    608     hdaProcessInterrupt(pThis, __FUNCTION__);
    609 # endif
     605    HDA_PROCESS_INTERRUPT(pThis->pDevInsR3, pThis);
    610606}
    611607#endif /* IN_RING3 */
     
    890886                HDA_REG(pThis, RIRBSTS) |= HDA_RIRBSTS_RINTFL;
    891887
    892 # ifndef LOG_ENABLED
    893                 rc = hdaProcessInterrupt(pThis);
    894 # else
    895                 rc = hdaProcessInterrupt(pThis, __FUNCTION__);
    896 # endif
     888                rc = HDA_PROCESS_INTERRUPT(pThis->pDevInsR3, pThis);
    897889            }
    898890        }
     
    15371529    }
    15381530
    1539 # ifndef LOG_ENABLED
    1540     hdaProcessInterrupt(pThis);
    1541 # else
    1542     hdaProcessInterrupt(pThis, __FUNCTION__);
    1543 # endif
     1531    HDA_PROCESS_INTERRUPT(pDevIns, pThis);
    15441532
    15451533    const uint64_t tsNow = TMTimerGet(pThis->pTimer[uSD]);
     
    22622250    HDA_REG(pThis, RIRBSTS) &= ~(v & u32Value);
    22632251
    2264 #ifndef LOG_ENABLED
    2265     int rc = hdaProcessInterrupt(pThis);
    2266 #else
    2267     int rc = hdaProcessInterrupt(pThis, __FUNCTION__);
    2268 #endif
     2252    int rc = HDA_PROCESS_INTERRUPT(pDevIns, pThis);
    22692253
    22702254    DEVHDA_UNLOCK(pDevIns, pThis);
     
    47634747
    47644748/**
    4765  * @interface_method_impl{PDMDEVREG,pfnRelocate}
    4766  */
    4767 static DECLCALLBACK(void) hdaR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    4768 {
    4769     NOREF(offDelta);
    4770     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
    4771     pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    4772 }
    4773 
    4774 
    4775 /**
    47764749 * @interface_method_impl{PDMDEVREG,pfnDestruct}
    47774750 */
     
    49064879     */
    49074880    pThis->pDevInsR3                = pDevIns;
    4908     pThis->pDevInsR0                = PDMDEVINS_2_R0PTR(pDevIns);
    4909     pThis->pDevInsRC                = PDMDEVINS_2_RCPTR(pDevIns);
    49104881    /* IBase */
    49114882    pThis->IBase.pfnQueryInterface  = hdaR3QueryInterface;
     
    53615332    /* .pfnConstruct = */           hdaR3Construct,
    53625333    /* .pfnDestruct = */            hdaR3Destruct,
    5363     /* .pfnRelocate = */            hdaR3Relocate,
     5334    /* .pfnRelocate = */            NULL,
    53645335    /* .pfnMemSetup = */            NULL,
    53655336    /* .pfnPowerOn = */             NULL,
  • trunk/src/VBox/Devices/Audio/DevHDA.h

    r80684 r80692  
    105105    /** The PCI device structure. */
    106106    PDMPCIDEV               PciDev;
     107    /** Critical section protecting the HDA state. */
     108    PDMCRITSECT             CritSect;
    107109    /** R3 Pointer to the device instance. */
    108110    PPDMDEVINSR3            pDevInsR3;
    109     /** R0 Pointer to the device instance. */
    110     PPDMDEVINSR0            pDevInsR0;
    111     /** R0 Pointer to the device instance. */
    112     PPDMDEVINSRC            pDevInsRC;
    113     /** Padding for alignment. */
    114     uint32_t                u32Padding;
    115     /** Critical section protecting the HDA state. */
    116     PDMCRITSECT             CritSect;
    117111    /** The base interface for LUN\#0. */
    118112    PDMIBASE                IBase;
     
    151145    /** The stream timers for pumping data thru the attached LUN drivers. */
    152146    PTMTIMERR3              pTimer[HDA_MAX_STREAMS];
    153 #ifdef VBOX_WITH_STATISTICS
    154     STAMPROFILE             StatTimer;
    155     STAMPROFILE             StatIn;
    156     STAMPROFILE             StatOut;
    157     STAMCOUNTER             StatBytesRead;
    158     STAMCOUNTER             StatBytesWritten;
    159 #endif
    160147    /** Pointer to HDA codec to use. */
    161148    R3PTRTYPE(PHDACODEC)    pCodec;
     
    211198    uint8_t                 au8Padding3[3];
    212199    HDASTATEDBGINFO         Dbg;
     200#ifdef VBOX_WITH_STATISTICS
     201    STAMPROFILE             StatTimer;
     202    STAMPROFILE             StatIn;
     203    STAMPROFILE             StatOut;
     204    STAMCOUNTER             StatBytesRead;
     205    STAMCOUNTER             StatBytesWritten;
     206#endif
    213207    /** This is for checking that the build was correctly configured in all contexts.
    214208     *  This is set to HDASTATE_ALIGNMENT_CHECK_MAGIC. */
  • trunk/src/VBox/Devices/Audio/DevHDACommon.cpp

    r76553 r80692  
    3434
    3535
    36 #ifndef LOG_ENABLED
    3736/**
    3837 * Processes (de/asserts) the interrupt according to the HDA's current state.
    3938 *
    4039 * @returns IPRT status code.
    41  * @param   pThis               HDA state.
    42  */
    43 int hdaProcessInterrupt(PHDASTATE pThis)
    44 #else
    45 /**
    46  * Processes (de/asserts) the interrupt according to the HDA's current state.
    47  * Debug version.
    48  *
    49  * @returns IPRT status code.
     40 * @param   pDevIns             The device instance.
    5041 * @param   pThis               HDA state.
    5142 * @param   pszSource           Caller information.
    5243 */
    53 int hdaProcessInterrupt(PHDASTATE pThis, const char *pszSource)
     44#if defined(LOG_ENABLED) || defined(DOXYGEN_RUNNING)
     45int hdaProcessInterrupt(PPDMDEVINS pDevIns, PHDASTATE pThis, const char *pszSource)
     46#else
     47int hdaProcessInterrupt(PPDMDEVINS pDevIns, PHDASTATE pThis)
    5448#endif
    5549{
     
    6761        Log3Func(("Asserted (%s)\n", pszSource));
    6862
    69         PDMDevHlpPCISetIrq(pThis->CTX_SUFF(pDevIns), 0, 1 /* Assert */);
     63        PDMDevHlpPCISetIrq(pDevIns, 0, 1 /* Assert */);
    7064        pThis->u8IRQL = 1;
    7165
     
    7973        Log3Func(("Deasserted (%s)\n", pszSource));
    8074
    81         PDMDevHlpPCISetIrq(pThis->CTX_SUFF(pDevIns), 0, 0 /* Deassert */);
     75        PDMDevHlpPCISetIrq(pDevIns, 0, 0 /* Deassert */);
    8276        pThis->u8IRQL = 0;
    8377    }
  • trunk/src/VBox/Devices/Audio/DevHDACommon.h

    r80691 r80692  
    601601 */
    602602#ifdef LOG_ENABLED
    603 int           hdaProcessInterrupt(PHDASTATE pThis, const char *pszSource);
     603int           hdaProcessInterrupt(PPDMDEVINS pDevIns, PHDASTATE pThis, const char *pszSource);
     604# define HDA_PROCESS_INTERRUPT(a_pDevIns, a_pThis)  hdaProcessInterrupt((a_pDevIns), (a_pThis), __FUNCTION__)
    604605#else
    605 int           hdaProcessInterrupt(PHDASTATE pThis);
     606int           hdaProcessInterrupt(PPDMDEVINS pDevIns, PHDASTATE pThis);
     607# define HDA_PROCESS_INTERRUPT(a_pDevIns, a_pThis)  hdaProcessInterrupt((a_pDevIns), (a_pThis))
    606608#endif
    607609/** @} */
  • trunk/src/VBox/Devices/Audio/HDAStream.cpp

    r78506 r80692  
    13341334        /* Trigger an interrupt first and let hdaRegWriteSDSTS() deal with
    13351335         * ending / beginning a period. */
    1336 #ifndef LOG_ENABLED
    1337         hdaProcessInterrupt(pThis);
    1338 #else
    1339         hdaProcessInterrupt(pThis, __FUNCTION__);
    1340 #endif
     1336        HDA_PROCESS_INTERRUPT(pThis->pDevInsR3, pThis);
    13411337    }
    13421338    else /* Transfer still in-flight -- schedule the next timing slot. */
Note: See TracChangeset for help on using the changeset viewer.

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