Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Add cmpxchg_local to cris

Use the new generic cmpxchg_local (disables interrupt). Also use the generic
cmpxchg as fallback if SMP is not set.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mathieu Desnoyers and committed by
Linus Torvalds
7732ba3a 10b88270

+15
+15
include/asm-cris/system.h
··· 66 66 return x; 67 67 } 68 68 69 + #include <asm-generic/cmpxchg-local.h> 70 + 71 + /* 72 + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make 73 + * them available. 74 + */ 75 + #define cmpxchg_local(ptr, o, n) \ 76 + ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ 77 + (unsigned long)(n), sizeof(*(ptr)))) 78 + #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 79 + 80 + #ifndef CONFIG_SMP 81 + #include <asm-generic/cmpxchg.h> 82 + #endif 83 + 69 84 #define arch_align_stack(x) (x) 70 85 71 86 void default_idle(void);