aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-m68knommu/system.h')
-rw-r--r--include/asm-m68knommu/system.h43
1 files changed, 10 insertions, 33 deletions
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 15b4c7d45c94..039ab3f81732 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -186,42 +186,19 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
186} 186}
187#endif 187#endif
188 188
189#include <asm-generic/cmpxchg-local.h>
190
189/* 191/*
190 * Atomic compare and exchange. Compare OLD with MEM, if identical, 192 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
191 * store NEW in MEM. Return the initial value in MEM. Success is 193 * them available.
192 * indicated by comparing RETURN with OLD.
193 */ 194 */
194#define __HAVE_ARCH_CMPXCHG 1 195#define cmpxchg_local(ptr, o, n) \
195 196 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
196static __inline__ unsigned long 197 (unsigned long)(n), sizeof(*(ptr))))
197cmpxchg(volatile int *p, int old, int new) 198#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
198{
199 unsigned long flags;
200 int prev;
201
202 local_irq_save(flags);
203 if ((prev = *p) == old)
204 *p = new;
205 local_irq_restore(flags);
206 return(prev);
207}
208
209 199
210#ifdef CONFIG_M68332 200#ifndef CONFIG_SMP
211#define HARD_RESET_NOW() ({ \ 201#include <asm-generic/cmpxchg.h>
212 local_irq_disable(); \
213 asm(" \
214 movew #0x0000, 0xfffa6a; \
215 reset; \
216 /*movew #0x1557, 0xfffa44;*/ \
217 /*movew #0x0155, 0xfffa46;*/ \
218 moveal #0, %a0; \
219 movec %a0, %vbr; \
220 moveal 0, %sp; \
221 moveal 4, %a0; \
222 jmp (%a0); \
223 "); \
224})
225#endif 202#endif
226 203
227#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ 204#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \