diff options
Diffstat (limited to 'target/s390x/cpu_features.h')
-rw-r--r-- | target/s390x/cpu_features.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index 14bc311dbe..e306aa7ab2 100644 --- a/target/s390x/cpu_features.h +++ b/target/s390x/cpu_features.h @@ -92,6 +92,13 @@ typedef struct { const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group); #define BE_BIT_NR(BIT) (BIT ^ (BITS_PER_LONG - 1)) -#define BE_BIT(BIT) (1ULL < BE_BIT_NR(BIT)) +static inline void set_be_bit(unsigned int bit_nr, uint8_t *array) +{ + array[bit_nr / 8] |= 0x80 >> (bit_nr % 8); +} +static inline bool test_be_bit(unsigned int bit_nr, const uint8_t *array) +{ + return array[bit_nr / 8] & (0x80 >> (bit_nr % 8)); +} #endif /* TARGET_S390X_CPU_FEATURES_H */ |