summaryrefslogtreecommitdiff
blob: 807e007a6aa8f855439d539ad74ee53a4fbf1550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Date Mon Apr 10 17:25:42 2006 +0100
# Node ID c89d62e7015a25a48225daa929616a5ed44205b4
# parent: 4088dd0856a9cbc7ef050d7272e81666b7dfbcc7
Fix push/pop usage in tools/ioemu for x86/64.

Signed-off-by: Keir Fraser <keir@xensource.com>



--- a/tools/ioemu/hw/vga.c	Mon Apr 10 17:16:25 2006 +0100
+++ b/tools/ioemu/hw/vga.c	Mon Apr 10 17:25:42 2006 +0100
@@ -1369,10 +1369,16 @@ static inline unsigned int cpuid_edx(uns
 {
     unsigned int eax, edx;
 
-    __asm__("pushl %%ebx; cpuid; popl %%ebx"
+#ifdef __x86_64__
+#define __bx "rbx"
+#else
+#define __bx "ebx"
+#endif
+    __asm__("push %%"__bx"; cpuid; pop %%"__bx
             : "=a" (eax), "=d" (edx)
             : "0" (op)
             : "cx");
+#undef __ebx
 
     return edx;
 }