aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/system.h
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-11 21:36:10 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-11 21:36:10 +0000
commit976f815cf309158ba134cb945d0ad0817d86891c (patch)
treebeaad726cad5c0a186e97fcb5443d94620593364 /xen/include/asm-x86/system.h
parent9a36e18cd692a4d30b5a339c2a284a67f63a1a3d (diff)
downloadxen-976f815cf309158ba134cb945d0ad0817d86891c.tar.gz
xen-976f815cf309158ba134cb945d0ad0817d86891c.tar.bz2
xen-976f815cf309158ba134cb945d0ad0817d86891c.zip
bitkeeper revision 1.955.1.4 (40ca25caD-WBu24eVfed1yswCl7JeQ)
Many files: More x86_64 stuff. pda.h: Rename: xen/include/asm-x86/x86_64/pda.h -> xen/include/asm-x86/pda.h .del-config.h~ab742eeb14ad808f: Delete: xen/include/asm-x86/x86_64/config.h arch-x86_32.h: Rename: xen/include/hypervisor-ifs/arch_x86_32.h -> xen/include/hypervisor-ifs/arch-x86_32.h arch-x86_64.h: Rename: xen/include/hypervisor-ifs/arch_x86_64.h -> xen/include/hypervisor-ifs/arch-x86_64.h arch_x86_32.h: Rename: xen/include/hypervisor-ifs/arch-x86/hypervisor-if.h -> xen/include/hypervisor-ifs/arch_x86_32.h arch_x86_64.h: Rename: xen/include/hypervisor-ifs/arch-x86_64/hypervisor-if.h -> xen/include/hypervisor-ifs/arch_x86_64.h
Diffstat (limited to 'xen/include/asm-x86/system.h')
-rw-r--r--xen/include/asm-x86/system.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 4b787e6830..b15499cce8 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -47,14 +47,14 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
:"m" (*__xg(ptr)), "0" (x)
:"memory");
break;
-#ifdef x86_32
+#if defined(__i386__)
case 4:
__asm__ __volatile__("xchgl %0,%1"
:"=r" (x)
:"m" (*__xg(ptr)), "0" (x)
:"memory");
break;
-#else
+#elif defined(__x86_64__)
case 4:
__asm__ __volatile__("xchgl %k0,%1"
:"=r" (x)
@@ -95,14 +95,14 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
-#ifdef x86_32
+#if defined(__i386__)
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
-#else
+#elif defined(__x86_64__)
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
: "=a"(prev)
@@ -192,12 +192,12 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
/* interrupt control.. */
-#ifdef x86_64
-#define __save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0)
-#define __restore_flags(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc")
-#else
+#if defined(__i386__)
#define __save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */)
#define __restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc")
+#elif defined(__x86_64__)
+#define __save_flags(x) do { __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0)
+#define __restore_flags(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc")
#endif
#define __cli() __asm__ __volatile__("cli": : :"memory")
#define __sti() __asm__ __volatile__("sti": : :"memory")
@@ -205,12 +205,12 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory")
/* For spinlocks etc */
-#ifdef x86_64
-#define local_irq_save(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0)
-#define local_irq_restore(x) __asm__ __volatile__("# local_irq_restore \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory")
-#else
+#if defined(__i386__)
#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
#define local_irq_restore(x) __restore_flags(x)
+#elif defined(__x86_64__)
+#define local_irq_save(x) do { __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0)
+#define local_irq_restore(x) __asm__ __volatile__("# local_irq_restore \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory")
#endif
#define local_irq_disable() __cli()
#define local_irq_enable() __sti()