summaryrefslogtreecommitdiff
path: root/dxr3cpu.c
diff options
context:
space:
mode:
authorscop <scop>2005-03-18 22:28:31 +0000
committerscop <scop>2005-03-18 22:28:31 +0000
commit96cca4c3599e9f2cd2628f1ad124b81edf11e9af (patch)
treec740901e3e84b6341a8cea8434abc4acf8d3f4f8 /dxr3cpu.c
parent82a7ea3745f40ff55f54ea6964b8e326b27d7593 (diff)
downloadvdr-plugin-dxr3-96cca4c3599e9f2cd2628f1ad124b81edf11e9af.tar.gz
vdr-plugin-dxr3-96cca4c3599e9f2cd2628f1ad124b81edf11e9af.tar.bz2
PIC build fix, from ffmpeg.
Diffstat (limited to 'dxr3cpu.c')
-rw-r--r--dxr3cpu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dxr3cpu.c b/dxr3cpu.c
index 4cd0a7a..3881480 100644
--- a/dxr3cpu.c
+++ b/dxr3cpu.c
@@ -125,6 +125,13 @@ bool cDxr3CPU::CheckCPUIDPresence()
//! cpuid function
bool cDxr3CPU::Cpuid(unsigned long function, unsigned long& out_eax, unsigned long& out_ebx, unsigned long& out_ecx, unsigned long& out_edx)
{
- asm("cpuid": "=a" (out_eax), "=b" (out_ebx), "=c" (out_ecx), "=d" (out_edx) : "a" (function));
+ // This works with PIC/non-PIC, from ffmpeg (libavcodec/i386/cputest.c)
+ __asm __volatile \
+ ("movl %%ebx, %%esi\n\t" \
+ "cpuid\n\t" \
+ "xchgl %%ebx, %%esi" \
+ : "=a" (out_eax), "=S" (out_ebx), \
+ "=c" (out_ecx), "=d" (out_edx) \
+ : "0" (function));
return true;
}