diff options
author | scop <scop> | 2005-04-30 11:27:47 +0000 |
---|---|---|
committer | scop <scop> | 2005-04-30 11:27:47 +0000 |
commit | db209a75d00e0c3a49bbc1c3c1007ef0baa2203a (patch) | |
tree | 498ee87d4614e4fbff3dd6ab35593373a6dc581f /dxr3cpu.c | |
parent | 4eff77d82fbde2dd23dc9c5985df849ce450f8f0 (diff) | |
download | vdr-plugin-dxr3-db209a75d00e0c3a49bbc1c3c1007ef0baa2203a.tar.gz vdr-plugin-dxr3-db209a75d00e0c3a49bbc1c3c1007ef0baa2203a.tar.bz2 |
Fix cpuid on AMD64 (Jon Burgess, newer ffmpeg).
Diffstat (limited to 'dxr3cpu.c')
-rw-r--r-- | dxr3cpu.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -128,10 +128,19 @@ bool cDxr3CPU::Cpuid(unsigned long function, unsigned long& out_eax, unsigned long& out_edx) { // This works with PIC/non-PIC, from ffmpeg (libavcodec/i386/cputest.c) + +#ifdef __x86_64__ +# define REG_b "rbx" +# define REG_S "rsi" +#else +# define REG_b "ebx" +# define REG_S "esi" +#endif + __asm __volatile \ - ("movl %%ebx, %%esi\n\t" \ + ("mov %%"REG_b", %%"REG_S"\n\t" \ "cpuid\n\t" \ - "xchgl %%ebx, %%esi" \ + "xchg %%"REG_b", %%"REG_S \ : "=a" (out_eax), "=S" (out_ebx), \ "=c" (out_ecx), "=d" (out_edx) \ : "0" (function)); |