1 // SPDX-License-Identifier: GPL-2.0-only
2 #ifndef __SELFTESTS_X86_HELPERS_H
3 #define __SELFTESTS_X86_HELPERS_H
5 #include <asm/processor-flags.h>
7 static inline unsigned long get_eflags(void)
10 return __builtin_ia32_readeflags_u64();
12 return __builtin_ia32_readeflags_u32();
16 static inline void set_eflags(unsigned long eflags
)
19 __builtin_ia32_writeeflags_u64(eflags
);
21 __builtin_ia32_writeeflags_u32(eflags
);
25 #endif /* __SELFTESTS_X86_HELPERS_H */