X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-m68knommu%2Fsystem.h;h=64c64432bbb80248c44ddfc34a6cc98beff938e1;hb=95dfec6ae1cb8c03406aac612a5642cbddb676b3;hp=1bd1142685e18f5dd916c0dcf838fe1e3c2435df;hpb=ebc283118ee448dcb6e6cae74a8a43f17a1ccc3f;p=linux-2.6 diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 1bd1142685..64c64432bb 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h @@ -104,8 +104,7 @@ asmlinkage void resume(void); #define mb() asm volatile ("" : : :"memory") #define rmb() asm volatile ("" : : :"memory") #define wmb() asm volatile ("" : : :"memory") -#define set_rmb(var, value) do { xchg(&var, value); } while (0) -#define set_mb(var, value) set_rmb(var, value) +#define set_mb(var, value) ({ (var) = (value); wmb(); }) #ifdef CONFIG_SMP #define smp_mb() mb() @@ -187,42 +186,19 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz } #endif +#include + /* - * Atomic compare and exchange. Compare OLD with MEM, if identical, - * store NEW in MEM. Return the initial value in MEM. Success is - * indicated by comparing RETURN with OLD. + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make + * them available. */ -#define __HAVE_ARCH_CMPXCHG 1 - -static __inline__ unsigned long -cmpxchg(volatile int *p, int old, int new) -{ - unsigned long flags; - int prev; - - local_irq_save(flags); - if ((prev = *p) == old) - *p = new; - local_irq_restore(flags); - return(prev); -} - +#define cmpxchg_local(ptr, o, n) \ + ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ + (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) -#ifdef CONFIG_M68332 -#define HARD_RESET_NOW() ({ \ - local_irq_disable(); \ - asm(" \ - movew #0x0000, 0xfffa6a; \ - reset; \ - /*movew #0x1557, 0xfffa44;*/ \ - /*movew #0x0155, 0xfffa46;*/ \ - moveal #0, %a0; \ - movec %a0, %vbr; \ - moveal 0, %sp; \ - moveal 4, %a0; \ - jmp (%a0); \ - "); \ -}) +#ifndef CONFIG_SMP +#include #endif #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \