x86/cpu: implement get/set_eflags using intrinsics
Signed-off-by: Diego Biurrun <diego@biurrun.de> Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
committed by
Martin Storsjö
parent
c0ee695bd7
commit
358d854df8
@@ -62,6 +62,8 @@
|
||||
} while (0)
|
||||
#endif /* HAVE_XGETBV */
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
#define get_eflags(x) \
|
||||
__asm__ volatile ("pushfl \n" \
|
||||
"pop %0 \n" \
|
||||
@@ -72,6 +74,18 @@
|
||||
"popfl \n" \
|
||||
:: "r"(x))
|
||||
|
||||
#elif HAVE_RWEFLAGS
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#define get_eflags(x) \
|
||||
x = __readeflags()
|
||||
|
||||
#define set_eflags(x) \
|
||||
__writeeflags(x)
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
/* Function to test if multimedia instructions are supported... */
|
||||
int ff_get_cpu_flags_x86(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user