VirtualBox

Changeset 90448 in vbox for trunk/src


Ignore:
Timestamp:
Jul 31, 2021 12:54:54 AM (4 years ago)
Author:
vboxsync
Message:

Dev*: Require ring-3 to check PDMDevHlpCritSectEnter return values too, just to not leave any ambiguity and form safe habits. bugref:6695

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

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

    r90447 r90448  
    47544754
    47554755    if (PDMDevHlpCritSectIsInitialized(pDevIns, &pThis->CritSect))
    4756         (void)PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED);
     4756    {
     4757        int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED);
     4758        AssertRC(rc);
     4759    }
    47574760
    47584761    PHDADRIVER pDrv;
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r90445 r90448  
    173173
    174174/** Acquires the cache lock. */
    175 # ifdef IN_RING3
    176 #  define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis)      PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSectCache, VERR_IGNORED)
    177 # else
    178 #  define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis) \
     175# define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis) \
    179176    do { \
    180177        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSectCache, VINF_SUCCESS); \
    181178        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), &(a_pThis)->CritSectCache, rcLock); \
    182179    } while (0)
    183 # endif
    184180
    185181/** Releases the cache lock.  */
     
    198194
    199195/** Acquires the PDM lock (can fail under extraordinary circumstance in in ring-0). */
    200 #ifdef IN_RING3
    201 # define IOMMU_LOCK(a_pDevIns, a_pThisCC)           (a_pThisCC)->CTX_SUFF(pIommuHlp)->pfnLock((a_pDevIns), VERR_IGNORED)
    202 #else
    203 # define IOMMU_LOCK(a_pDevIns, a_pThisCC) \
     196#define IOMMU_LOCK(a_pDevIns, a_pThisCC) \
    204197    do { \
    205198        int const rcLock = (a_pThisCC)->CTX_SUFF(pIommuHlp)->pfnLock((a_pDevIns), VINF_SUCCESS); \
    206199        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), NULL, rcLock); \
    207200    } while (0)
    208 #endif
    209201
    210202/** Checks if the current thread owns the PDM lock. */
  • trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp

    r90436 r90448  
    6767
    6868/** Acquires the DMAR lock (can fail under extraordinary circumstance in in ring-0). */
    69 #ifdef IN_RING3
    70 # define DMAR_LOCK(a_pDevIns, a_pThisCC)            (a_pThisCC)->CTX_SUFF(pIommuHlp)->pfnLock((a_pDevIns), VERR_IGNORED)
    71 #else
    72 # define DMAR_LOCK(a_pDevIns, a_pThisCC) \
     69#define DMAR_LOCK(a_pDevIns, a_pThisCC) \
    7370    do { \
    7471        int const rcLock = (a_pThisCC)->CTX_SUFF(pIommuHlp)->pfnLock((a_pDevIns), VINF_SUCCESS); \
    7572        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), NULL, rcLock); \
    7673    } while (0)
    77 #endif
    7874
    7975/** Release the DMAR lock. */
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