X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-arm%2Fsystem.h;h=6335de9a2bb384b5f8b6f83fdd832402e123eb89;hb=6a8b23086c82d7cc4f424518532c8b10d95715c0;hp=94ea8c6dc1a4485014fd9bb8fbd7c29078e69696;hpb=532df780a2012ad75b3f078647f229c4dabd99d1;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 94ea8c6dc1a..6335de9a2bb 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h @@ -75,8 +75,21 @@ #ifndef __ASSEMBLY__ #include +#include #include +/* + * The CPU ID never changes at run time, so we might as well tell the + * compiler that it's constant. Use this function to read the CPU ID + * rather than directly reading processor_id or read_cpuid() directly. + */ +static inline unsigned int read_cpuid_id(void) __attribute_const__; + +static inline unsigned int read_cpuid_id(void) +{ + return read_cpuid(CPUID_ID); +} + #define __exception __attribute__((section(".exception.text"))) struct thread_info; @@ -350,6 +363,21 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size extern void disable_hlt(void); extern void enable_hlt(void); +#include + +/* + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make + * them available. + */ +#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)) + +#ifndef CONFIG_SMP +#include +#endif + #endif /* __ASSEMBLY__ */ #define arch_align_stack(x) (x)