summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-17 20:15:02 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-17 20:15:02 +0000
commitfb1abd6b3bbd89f9d7d37c0421ebdec8bee1d1f7 (patch)
treedfd3af3f3fcf7964238ea5aa57f1c3007932edfa /TOOLS
parent9614f96612b54953ac1337eb62ea89be879dc04b (diff)
downloadmpv-fb1abd6b3bbd89f9d7d37c0421ebdec8bee1d1f7.tar.bz2
mpv-fb1abd6b3bbd89f9d7d37c0421ebdec8bee1d1f7.tar.xz
x86_64 only saves ebx, not rbx. Fix some potential compilation problem on amd64.
Patch by Zuxy Meng git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18535 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/cpuinfo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/TOOLS/cpuinfo.c b/TOOLS/cpuinfo.c
index 56ebe2087e..cd1ed0741d 100644
--- a/TOOLS/cpuinfo.c
+++ b/TOOLS/cpuinfo.c
@@ -43,9 +43,17 @@ static cpuid_regs_t
cpuid(int func) {
cpuid_regs_t regs;
#define CPUID ".byte 0x0f, 0xa2; "
+#ifdef __x86_64__
+ asm("mov %%rbx, %%rsi\n\t"
+#else
asm("mov %%ebx, %%esi\n\t"
+#endif
CPUID"\n\t"
- "xchg %%esi, %%ebx"
+#ifdef __x86_64__
+ "xchg %%rsi, %%rbx\n\t"
+#else
+ "xchg %%esi, %%ebx\n\t"
+#endif
: "=a" (regs.eax), "=S" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
: "0" (func));
return regs;