VirtualBox

Changeset 81764 in vbox for trunk/include


Ignore:
Timestamp:
Nov 11, 2019 3:58:21 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134554
Message:

SSM,PDMDevHlp: Exported volatile integer getter variants and added macros for dealing with enums w/o ugly pointer casting. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r81753 r81764  
    81358135}
    81368136
     8137/** Wrapper around SSMR3GetU32 for simplifying getting enum values saved as uint32_t. */
     8138# define PDMDEVHLP_SSM_GET_ENUM32_RET(a_pHlp, a_pSSM, a_enmDst, a_EnumType) \
     8139    do { \
     8140        uint32_t u32GetEnumTmp = 0; \
     8141        int rcGetEnum32Tmp = (a_pHlp)->pfnSSMGetU32((a_pSSM), &u32GetEnumTmp); \
     8142        AssertRCReturn(rcGetEnum32Tmp, rcGetEnum32Tmp); \
     8143        (a_enmDst) = (a_EnumType)u32GetEnumTmp; \
     8144        AssertCompile(sizeof(a_EnumType) == sizeof(u32GetEnumTmp)); \
     8145    } while (0)
     8146
     8147/** Wrapper around SSMR3GetU8 for simplifying getting enum values saved as uint8_t. */
     8148# define PDMDEVHLP_SSM_GET_ENUM8_RET(a_pHlp, a_pSSM, a_enmDst, a_EnumType) \
     8149    do { \
     8150        uint8_t bGetEnumTmp = 0; \
     8151        int rcGetEnum32Tmp = (a_pHlp)->pfnSSMGetU8((a_pSSM), &bGetEnumTmp); \
     8152        AssertRCReturn(rcGetEnum32Tmp, rcGetEnum32Tmp); \
     8153        (a_enmDst) = (a_EnumType)bGetEnumTmp; \
     8154    } while (0)
     8155
    81378156#endif /* IN_RING3 */
    81388157
Note: See TracChangeset for help on using the changeset viewer.

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