aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2011-09-19 17:10:15 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-07 00:10:44 (GMT)
commita973719b702b607fb084f014a52e2bceefbf366a (patch)
treefe3134b38d6e324b8af460cd9e469c73d9feeb0b /src
parent3ac157d607077cb74702f4c876618d684ee0c559 (diff)
[media] Update for cpuaccel.c
from http://stapelspeicher.org/tvtime/patches/ (originally from libmpeg2) Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/cpu_accel.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cpu_accel.c b/src/cpu_accel.c
index c3667e7..2799613 100644
--- a/src/cpu_accel.c
+++ b/src/cpu_accel.c
@@ -35,7 +35,7 @@ static inline uint32_t arch_accel (void)
int AMD;
uint32_t caps;
-#if (!defined(__PIC__) && !defined(PIC)) || defined(__x86_64__)
+#if defined(__x86_64__) || (!defined(PIC) && !defined(__PIC__))
#define cpuid(op,eax,ebx,ecx,edx) \
__asm__ ("cpuid" \
: "=a" (eax), \
@@ -44,7 +44,7 @@ static inline uint32_t arch_accel (void)
"=d" (edx) \
: "a" (op) \
: "cc")
-#else /* PIC version : save ebx */
+#else /* PIC version : save ebx (not needed on x86_64) */
#define cpuid(op,eax,ebx,ecx,edx) \
__asm__ ("pushl %%ebx\n\t" \
"cpuid\n\t" \
@@ -58,17 +58,17 @@ static inline uint32_t arch_accel (void)
: "cc")
#endif
-#ifdef ARCH_386
- __asm__ ("pushfl\n\t"
- "pushfl\n\t"
- "popl %0\n\t"
+#ifndef __x86_64__ /* x86_64 supports the cpuid op */
+ __asm__ ("pushf\n\t"
+ "pushf\n\t"
+ "pop %0\n\t"
"movl %0,%1\n\t"
"xorl $0x200000,%0\n\t"
- "pushl %0\n\t"
- "popfl\n\t"
- "pushfl\n\t"
- "popl %0\n\t"
- "popfl"
+ "push %0\n\t"
+ "popf\n\t"
+ "pushf\n\t"
+ "pop %0\n\t"
+ "popf"
: "=r" (eax),
"=r" (ebx)
:

Privacy Policy