ia64/xen-unstable

changeset 4613:a7a5ecbdd584

bitkeeper revision 1.1352 (42678485GbfE9tHK21SYM_tM6xSlBQ)

Add 8-byte version of cmpxchg_user() for i386.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 21 10:46:29 2005 +0000 (2005-04-21)
parents 319e2634476d
children 1de9eed58522
files xen/include/asm-x86/system.h
line diff
     1.1 --- a/xen/include/asm-x86/system.h	Thu Apr 21 10:15:23 2005 +0000
     1.2 +++ b/xen/include/asm-x86/system.h	Thu Apr 21 10:46:29 2005 +0000
     1.3 @@ -152,6 +152,23 @@ static always_inline unsigned long __cmp
     1.4      case 4:                                                             \
     1.5          __cmpxchg_user(_p,_o,_n,"l","","r");                            \
     1.6          break;                                                          \
     1.7 +    case 8:                                                             \
     1.8 +        __asm__ __volatile__ (                                          \
     1.9 +            "1: " LOCK_PREFIX "cmpxchg8b %4\n"                          \
    1.10 +            "2:\n"                                                      \
    1.11 +            ".section .fixup,\"ax\"\n"                                  \
    1.12 +            "3:     movl $1,%1\n"                                       \
    1.13 +            "       jmp 2b\n"                                           \
    1.14 +            ".previous\n"                                               \
    1.15 +            ".section __ex_table,\"a\"\n"                               \
    1.16 +            "       .align 4\n"                                         \
    1.17 +            "       .long 1b,3b\n"                                      \
    1.18 +            ".previous"                                                 \
    1.19 +            : "=A" (_o), "=r" (_rc)                                     \
    1.20 +            : "c" ((u32)((u64)(_n)>>32)), "b" ((u32)(_n)),              \
    1.21 +              "m" (*__xg((volatile void *)(_p))), "0" (_o), "1" (0)     \
    1.22 +            : "memory");                                                \
    1.23 +        break;                                                          \
    1.24      }                                                                   \
    1.25      _rc;                                                                \
    1.26  })