Commit 719fa35e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Xvmc: fix xvmc compilation on x86_64. Patch by eMPee584

parent 5ae10793
...@@ -33,7 +33,7 @@ static inline uint32_t arch_accel( void ) ...@@ -33,7 +33,7 @@ static inline uint32_t arch_accel( void )
int AMD; int AMD;
uint32_t caps; uint32_t caps;
#if !defined(PIC) && !defined(__PIC__) #if defined(__x86_64__) || (!defined(PIC) && !defined(__PIC__))
#define cpuid(op,eax,ebx,ecx,edx) \ #define cpuid(op,eax,ebx,ecx,edx) \
__asm__ ("cpuid" \ __asm__ ("cpuid" \
: "=a" (eax), \ : "=a" (eax), \
...@@ -42,7 +42,7 @@ static inline uint32_t arch_accel( void ) ...@@ -42,7 +42,7 @@ static inline uint32_t arch_accel( void )
"=d" (edx) \ "=d" (edx) \
: "a" (op) \ : "a" (op) \
: "cc") : "cc")
#else /* PIC version : save ebx */ #else /* PIC version : save ebx (not needed on x86_64) */
#define cpuid(op,eax,ebx,ecx,edx) \ #define cpuid(op,eax,ebx,ecx,edx) \
__asm__ ("push %%ebx\n\t" \ __asm__ ("push %%ebx\n\t" \
"cpuid\n\t" \ "cpuid\n\t" \
...@@ -56,6 +56,7 @@ static inline uint32_t arch_accel( void ) ...@@ -56,6 +56,7 @@ static inline uint32_t arch_accel( void )
: "cc") : "cc")
#endif #endif
#ifndef __x86_64__ /* x86_64 supports the cpuid op */
__asm__ ("pushf\n\t" __asm__ ("pushf\n\t"
"pushf\n\t" "pushf\n\t"
"pop %0\n\t" "pop %0\n\t"
...@@ -73,6 +74,7 @@ static inline uint32_t arch_accel( void ) ...@@ -73,6 +74,7 @@ static inline uint32_t arch_accel( void )
if (eax == ebx) /* no cpuid */ if (eax == ebx) /* no cpuid */
return 0; return 0;
#endif
cpuid (0x00000000, eax, ebx, ecx, edx); cpuid (0x00000000, eax, ebx, ecx, edx);
if (!eax) /* vendor string only */ if (!eax) /* vendor string only */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment