aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/cmpxchg-grb.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/include/asm/cmpxchg-grb.h')
-rw-r--r--arch/sh/include/asm/cmpxchg-grb.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/sh/include/asm/cmpxchg-grb.h b/arch/sh/include/asm/cmpxchg-grb.h
index 4676bf57693a..f848dec9e483 100644
--- a/arch/sh/include/asm/cmpxchg-grb.h
+++ b/arch/sh/include/asm/cmpxchg-grb.h
@@ -15,8 +15,9 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
15 " mov.l %2, @%1 \n\t" /* store new value */ 15 " mov.l %2, @%1 \n\t" /* store new value */
16 "1: mov r1, r15 \n\t" /* LOGOUT */ 16 "1: mov r1, r15 \n\t" /* LOGOUT */
17 : "=&r" (retval), 17 : "=&r" (retval),
18 "+r" (m) 18 "+r" (m),
19 : "r" (val) 19 "+r" (val) /* inhibit r15 overloading */
20 :
20 : "memory", "r0", "r1"); 21 : "memory", "r0", "r1");
21 22
22 return retval; 23 return retval;
@@ -36,8 +37,9 @@ static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
36 " mov.b %2, @%1 \n\t" /* store new value */ 37 " mov.b %2, @%1 \n\t" /* store new value */
37 "1: mov r1, r15 \n\t" /* LOGOUT */ 38 "1: mov r1, r15 \n\t" /* LOGOUT */
38 : "=&r" (retval), 39 : "=&r" (retval),
39 "+r" (m) 40 "+r" (m),
40 : "r" (val) 41 "+r" (val) /* inhibit r15 overloading */
42 :
41 : "memory" , "r0", "r1"); 43 : "memory" , "r0", "r1");
42 44
43 return retval; 45 return retval;
@@ -54,13 +56,14 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
54 " nop \n\t" 56 " nop \n\t"
55 " mov r15, r1 \n\t" /* r1 = saved sp */ 57 " mov r15, r1 \n\t" /* r1 = saved sp */
56 " mov #-8, r15 \n\t" /* LOGIN */ 58 " mov #-8, r15 \n\t" /* LOGIN */
57 " mov.l @%1, %0 \n\t" /* load old value */ 59 " mov.l @%3, %0 \n\t" /* load old value */
58 " cmp/eq %0, %2 \n\t" 60 " cmp/eq %0, %1 \n\t"
59 " bf 1f \n\t" /* if not equal */ 61 " bf 1f \n\t" /* if not equal */
60 " mov.l %3, @%1 \n\t" /* store new value */ 62 " mov.l %2, @%3 \n\t" /* store new value */
61 "1: mov r1, r15 \n\t" /* LOGOUT */ 63 "1: mov r1, r15 \n\t" /* LOGOUT */
62 : "=&r" (retval) 64 : "=&r" (retval),
63 : "r" (m), "r" (old), "r" (new) 65 "+r" (old), "+r" (new) /* old or new can be r15 */
66 : "r" (m)
64 : "memory" , "r0", "r1", "t"); 67 : "memory" , "r0", "r1", "t");
65 68
66 return retval; 69 return retval;