|
|
@ -44,10 +44,17 @@ int mm_support(void) |
|
|
|
int max_std_level, max_ext_level, std_caps=0, ext_caps=0; |
|
|
|
int max_std_level, max_ext_level, std_caps=0, ext_caps=0; |
|
|
|
x86_reg a, c; |
|
|
|
x86_reg a, c; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ARCH_X86_64 |
|
|
|
|
|
|
|
#define PUSHF "pushfq\n\t" |
|
|
|
|
|
|
|
#define POPF "popfq\n\t" |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define PUSHF "pushfl\n\t" |
|
|
|
|
|
|
|
#define POPF "popfl\n\t" |
|
|
|
|
|
|
|
#endif |
|
|
|
__asm__ volatile ( |
|
|
|
__asm__ volatile ( |
|
|
|
/* See if CPUID instruction is supported ... */ |
|
|
|
/* See if CPUID instruction is supported ... */ |
|
|
|
/* ... Get copies of EFLAGS into eax and ecx */ |
|
|
|
/* ... Get copies of EFLAGS into eax and ecx */ |
|
|
|
"pushf\n\t" |
|
|
|
PUSHF |
|
|
|
"pop %0\n\t" |
|
|
|
"pop %0\n\t" |
|
|
|
"mov %0, %1\n\t" |
|
|
|
"mov %0, %1\n\t" |
|
|
|
|
|
|
|
|
|
|
@ -55,10 +62,10 @@ int mm_support(void) |
|
|
|
/* to the EFLAGS reg */ |
|
|
|
/* to the EFLAGS reg */ |
|
|
|
"xor $0x200000, %0\n\t" |
|
|
|
"xor $0x200000, %0\n\t" |
|
|
|
"push %0\n\t" |
|
|
|
"push %0\n\t" |
|
|
|
"popf\n\t" |
|
|
|
POPF |
|
|
|
|
|
|
|
|
|
|
|
/* ... Get the (hopefully modified) EFLAGS */ |
|
|
|
/* ... Get the (hopefully modified) EFLAGS */ |
|
|
|
"pushf\n\t" |
|
|
|
PUSHF |
|
|
|
"pop %0\n\t" |
|
|
|
"pop %0\n\t" |
|
|
|
: "=a" (a), "=c" (c) |
|
|
|
: "=a" (a), "=c" (c) |
|
|
|
: |
|
|
|
: |
|
|
|