Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / testing / selftests / x86 / helpers.h
blob4ef42c4559a9eb991a96171aaf0d91c487d9943d
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)
9 #ifdef __x86_64__
10 return __builtin_ia32_readeflags_u64();
11 #else
12 return __builtin_ia32_readeflags_u32();
13 #endif
16 static inline void set_eflags(unsigned long eflags)
18 #ifdef __x86_64__
19 __builtin_ia32_writeeflags_u64(eflags);
20 #else
21 __builtin_ia32_writeeflags_u32(eflags);
22 #endif
25 #endif /* __SELFTESTS_X86_HELPERS_H */