diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-04-21 10:46:29 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-04-21 10:46:29 +0000 |
commit | 45647612d07d2898e610650a6ef43d7053b0759d (patch) | |
tree | a18aaf49a54101b0aa0486ef15961d1036321155 /xen/include/asm-x86/system.h | |
parent | 086ac6b5c2e9de23b3f71182d80e3f656897b93a (diff) | |
download | xen-45647612d07d2898e610650a6ef43d7053b0759d.tar.gz xen-45647612d07d2898e610650a6ef43d7053b0759d.tar.bz2 xen-45647612d07d2898e610650a6ef43d7053b0759d.zip |
bitkeeper revision 1.1352 (42678485GbfE9tHK21SYM_tM6xSlBQ)
Add 8-byte version of cmpxchg_user() for i386.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/system.h')
-rw-r--r-- | xen/include/asm-x86/system.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h index 18854edc3f..49355af7d6 100644 --- a/xen/include/asm-x86/system.h +++ b/xen/include/asm-x86/system.h @@ -152,6 +152,23 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr, unsigned long o case 4: \ __cmpxchg_user(_p,_o,_n,"l","","r"); \ break; \ + case 8: \ + __asm__ __volatile__ ( \ + "1: " LOCK_PREFIX "cmpxchg8b %4\n" \ + "2:\n" \ + ".section .fixup,\"ax\"\n" \ + "3: movl $1,%1\n" \ + " jmp 2b\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n" \ + " .align 4\n" \ + " .long 1b,3b\n" \ + ".previous" \ + : "=A" (_o), "=r" (_rc) \ + : "c" ((u32)((u64)(_n)>>32)), "b" ((u32)(_n)), \ + "m" (*__xg((volatile void *)(_p))), "0" (_o), "1" (0) \ + : "memory"); \ + break; \ } \ _rc; \ }) |