X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-avr32%2Fsystem.h;h=c600cc15cbcb640d2d7941f0991fb823dd8fd2f4;hb=fa2dd441df28b9fdfc68f84ae66f1b507cfff0e4;hp=a8236bacc8789133c573885d3065ba97005eebc3;hpb=f697b677620d04d8c77841745727de85f7e948b1;p=linux-2.6 diff --git a/include/asm-avr32/system.h b/include/asm-avr32/system.h index a8236bacc8..c600cc15cb 100644 --- a/include/asm-avr32/system.h +++ b/include/asm-avr32/system.h @@ -35,8 +35,8 @@ #include #define finish_arch_switch(prev) \ do { \ - __mtdr(DBGREG_PID, prev->pid); \ - __mtdr(DBGREG_PID, current->pid); \ + ocd_write(PID, prev->pid); \ + ocd_write(PID, current->pid); \ } while(0) #endif @@ -73,11 +73,16 @@ extern struct task_struct *__switch_to(struct task_struct *, extern void __xchg_called_with_bad_pointer(void); -#ifdef __CHECKER__ -extern unsigned long __builtin_xchg(void *ptr, unsigned long x); -#endif +static inline unsigned long xchg_u32(u32 val, volatile u32 *m) +{ + u32 ret; -#define xchg_u32(val, m) __builtin_xchg((void *)m, val) + asm volatile("xchg %[ret], %[m], %[val]" + : [ret] "=&r"(ret), "=m"(*m) + : "m"(*m), [m] "r"(m), [val] "r"(val) + : "memory"); + return ret; +} static inline unsigned long __xchg(unsigned long x, volatile void *ptr,