VirtualBox

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


Ignore:
Timestamp:
Dec 4, 2019 5:38:21 PM (5 years ago)
Author:
vboxsync
Message:

DevHDA: Ditto for hdaMmioRead, only here there are fewer method and no-one involving the virtual-sync lock. bugref:9218

File:
1 edited

Legend:

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

    r82388 r82391  
    956956static VBOXSTRICTRC hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
    957957{
    958     uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx;
    959 
    960     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);
    961 
     958    RT_NOREF(pDevIns);
     959
     960    uint32_t const iRegMem = g_aHdaRegMap[iReg].mem_idx;
    962961    *pu32Value = pThis->au32Regs[iRegMem] & g_aHdaRegMap[iReg].readable;
    963 
    964     DEVHDA_UNLOCK(pDevIns, pThis);
    965962    return VINF_SUCCESS;
    966963}
     
    10271024static VBOXSTRICTRC hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
    10281025{
    1029     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);
     1026    RT_NOREF(pDevIns);
    10301027
    10311028    const uint8_t  uSD     = HDA_SD_NUM_FROM_REG(pThis, LPIB, iReg);
    1032     uint32_t       u32LPIB = HDA_STREAM_REG(pThis, LPIB, uSD);
    1033 #ifdef LOG_ENABLED
    1034     const uint32_t u32CBL  = HDA_STREAM_REG(pThis, CBL,  uSD);
    1035     LogFlowFunc(("[SD%RU8] LPIB=%RU32, CBL=%RU32\n", uSD, u32LPIB, u32CBL));
    1036 #endif
    1037 
     1029    const uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, uSD);
    10381030    *pu32Value = u32LPIB;
    1039 
    1040     DEVHDA_UNLOCK(pDevIns, pThis);
     1031    LogFlowFunc(("[SD%RU8] LPIB=%RU32, CBL=%RU32\n", uSD, u32LPIB, HDA_STREAM_REG(pThis, CBL, uSD)));
     1032
    10411033    return VINF_SUCCESS;
    10421034}
     
    10871079#ifdef IN_RING3 /** @todo r=bird: No reason (except logging) for this to be ring-3 only! */
    10881080    RT_NOREF(pDevIns, iReg);
    1089     DEVHDA_LOCK(pDevIns, pThis);
    10901081
    10911082    const uint64_t u64WalClkCur = ASMAtomicReadU64(&pThis->u64WalClk);
     
    10931084
    10941085    Log3Func(("%RU32 (max @ %RU64)\n", *pu32Value, hdaR3WalClkGetMax(pThis)));
    1095     DEVHDA_UNLOCK(pDevIns, pThis);
    10961086    return VINF_SUCCESS;
    10971087#else
     
    19681958static VBOXSTRICTRC hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
    19691959{
    1970     DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);
    1971 
    19721960    /* regarding 3.4.3 we should mark IRS as busy in case CORB is active */
    19731961    if (   HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP)
    19741962        || (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA))
    1975     {
    19761963        HDA_REG(pThis, IRS) = HDA_IRS_ICB;  /* busy */
    1977     }
    1978 
    1979     VBOXSTRICTRC rc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value);
    1980     DEVHDA_UNLOCK(pDevIns, pThis);
    1981 
    1982     return rc;
     1964
     1965    return hdaRegReadU32(pDevIns, pThis, iReg, pu32Value);
    19831966}
    19841967
     
    30313014
    30323015    if (!(HDA_REG(pThis, GCTL) & HDA_GCTL_CRST) && idxRegDsc != HDA_REG_GCTL)
    3033         LogFunc(("Access to registers except GCTL is blocked while reset\n"));
    3034 
    3035     if (idxRegDsc == -1)
    3036         LogRel(("HDA: Invalid read access @0x%x (bytes=%u)\n", (uint32_t)off, cb));
    3037 
    3038     if (idxRegDsc != -1)
    3039     {
    3040         /* Leave lock before calling read function. */
    3041         DEVHDA_UNLOCK(pDevIns, pThis);
    3042 
     3016        LogFunc(("Access to registers except GCTL is blocked while resetting\n"));
     3017
     3018    if (idxRegDsc >= 0)
     3019    {
    30433020        /* ASSUMES gapless DWORD at end of map. */
    30443021        if (g_aHdaRegMap[idxRegDsc].size == 4)
     
    30873064    else
    30883065    {
    3089         DEVHDA_UNLOCK(pDevIns, pThis);
    3090 
     3066        LogRel(("HDA: Invalid read access @0x%x (bytes=%u)\n", (uint32_t)off, cb));
     3067        Log3Func(("\tHole at %x is accessed for read\n", offRegLog));
    30913068        rc = VINF_IOM_MMIO_UNUSED_FF;
    3092         Log3Func(("\tHole at %x is accessed for read\n", offRegLog));
    3093     }
     3069    }
     3070
     3071    DEVHDA_UNLOCK(pDevIns, pThis);
    30943072
    30953073    /*
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