Originally committed as revision 17543 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -42,19 +42,13 @@ int mm_support(void) · 41 unmodified lines | |||
| 42 | int rval = 0; | 42 | int rval = 0; |
| 43 | int eax, ebx, ecx, edx; | 43 | int eax, ebx, ecx, edx; |
| 44 | int max_std_level, max_ext_level, std_caps=0, ext_caps=0; | 44 | int max_std_level, max_ext_level, std_caps=0, ext_caps=0; |
| 45 | x86_reg a, c; | ||
| 46 | 45 | ||
| 47 | #if ARCH_X86_64 | 46 | #if ARCH_X86_32 |
| 48 | #define PUSHF "pushfq\n\t" | 47 | x86_reg a, c; |
| 49 | #define POPF "popfq\n\t" | ||
| 50 | #else | ||
| 51 | #define PUSHF "pushfl\n\t" | ||
| 52 | #define POPF "popfl\n\t" | ||
| 53 | #endif | ||
| 54 | __asm__ volatile ( | 48 | __asm__ volatile ( |
| 55 | /* See if CPUID instruction is supported ... */ | 49 | /* See if CPUID instruction is supported ... */ |
| 56 | /* ... Get copies of EFLAGS into eax and ecx */ | 50 | /* ... Get copies of EFLAGS into eax and ecx */ |
| 57 | PUSHF | 51 | "pushfl\n\t" |
| 58 | "pop %0\n\t" | 52 | "pop %0\n\t" |
| 59 | "mov %0, %1\n\t" | 53 | "mov %0, %1\n\t" |
| 60 | 54 | ||
| @@ -62,10 +56,10 @@ int mm_support(void) · 1 unmodified line | |||
| 62 | /* to the EFLAGS reg */ | 56 | /* to the EFLAGS reg */ |
| 63 | "xor $0x200000, %0\n\t" | 57 | "xor $0x200000, %0\n\t" |
| 64 | "push %0\n\t" | 58 | "push %0\n\t" |
| 65 | POPF | 59 | "popfl\n\t" |
| 66 | 60 | ||
| 67 | /* ... Get the (hopefully modified) EFLAGS */ | 61 | /* ... Get the (hopefully modified) EFLAGS */ |
| 68 | PUSHF | 62 | "pushfl\n\t" |
| 69 | "pop %0\n\t" | 63 | "pop %0\n\t" |
| 70 | : "=a" (a), "=c" (c) | 64 | : "=a" (a), "=c" (c) |
| 71 | : | 65 | : |
| @@ -74,6 +68,7 @@ int mm_support(void) · 2 unmodified lines | |||
| 74 | 68 | ||
| 75 | if (a == c) | 69 | if (a == c) |
| 76 | return 0; /* CPUID not supported */ | 70 | return 0; /* CPUID not supported */ |
| 71 | #endif | ||
| 77 | 72 | ||
| 78 | cpuid(0, max_std_level, ebx, ecx, edx); | 73 | cpuid(0, max_std_level, ebx, ecx, edx); |
| 79 | 74 | ||