aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/system.h
diff options
context:
space:
mode:
authorkaf24@penguin.local <kaf24@penguin.local>2004-09-01 19:17:37 +0000
committerkaf24@penguin.local <kaf24@penguin.local>2004-09-01 19:17:37 +0000
commit7c7a3a2ec9429577f0adea0c5e197634ecce02d6 (patch)
treebc82782fe7b5d7ed47c04c29202208dd618c48ba /xen/include/asm-x86/system.h
parent8a1d582d657e5d3b0fa4aa746aec33557bd65a65 (diff)
downloadxen-7c7a3a2ec9429577f0adea0c5e197634ecce02d6.tar.gz
xen-7c7a3a2ec9429577f0adea0c5e197634ecce02d6.tar.bz2
xen-7c7a3a2ec9429577f0adea0c5e197634ecce02d6.zip
bitkeeper revision 1.1159.53.28 (41362051V9OMFFkN7QeuoU0c6ND07A)
Build fixes for x86/64.
Diffstat (limited to 'xen/include/asm-x86/system.h')
-rw-r--r--xen/include/asm-x86/system.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 4835b6e236..e2c961e360 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -123,6 +123,7 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr, unsigned long o
* If no fault occurs then _o is updated to the value we saw at _p. If this
* is the same as the initial value of _o then _n is written to location _p.
*/
+#ifdef __i386__
#define __cmpxchg_user(_p,_o,_n,_isuff,_oppre,_regtype) \
__asm__ __volatile__ ( \
"1: " LOCK_PREFIX "cmpxchg"_isuff" %"_oppre"2,%3\n" \
@@ -138,7 +139,6 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr, unsigned long o
: "=a" (_o), "=r" (_rc) \
: _regtype (_n), "m" (*__xg((volatile void *)_p)), "0" (_o), "1" (0) \
: "memory");
-#ifdef __i386__
#define cmpxchg_user(_p,_o,_n) \
({ \
int _rc; \
@@ -156,6 +156,21 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr, unsigned long o
_rc; \
})
#else
+#define __cmpxchg_user(_p,_o,_n,_isuff,_oppre,_regtype) \
+ __asm__ __volatile__ ( \
+ "1: " LOCK_PREFIX "cmpxchg"_isuff" %"_oppre"2,%3\n" \
+ "2:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "3: movl $1,%1\n" \
+ " jmp 2b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"a\"\n" \
+ " .align 8\n" \
+ " .quad 1b,3b\n" \
+ ".previous" \
+ : "=a" (_o), "=r" (_rc) \
+ : _regtype (_n), "m" (*__xg((volatile void *)_p)), "0" (_o), "1" (0) \
+ : "memory");
#define cmpxchg_user(_p,_o,_n) \
({ \
int _rc; \