blob: ec4327a4653d45c7e1e3fe6bb1e142d8fadce2e8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_ARM_SYSTEM_H
2#define __ASM_ARM_SYSTEM_H
3
4#ifdef __KERNEL__
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#define CPU_ARCH_UNKNOWN 0
7#define CPU_ARCH_ARMv3 1
8#define CPU_ARCH_ARMv4 2
9#define CPU_ARCH_ARMv4T 3
10#define CPU_ARCH_ARMv5 4
11#define CPU_ARCH_ARMv5T 5
12#define CPU_ARCH_ARMv5TE 6
13#define CPU_ARCH_ARMv5TEJ 7
14#define CPU_ARCH_ARMv6 8
Catalin Marinasbbe88882007-05-08 22:27:46 +010015#define CPU_ARCH_ARMv7 9
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17/*
18 * CR1 bits (CP#15 CR1)
19 */
20#define CR_M (1 << 0) /* MMU enable */
21#define CR_A (1 << 1) /* Alignment abort enable */
22#define CR_C (1 << 2) /* Dcache enable */
23#define CR_W (1 << 3) /* Write buffer enable */
24#define CR_P (1 << 4) /* 32-bit exception handler */
25#define CR_D (1 << 5) /* 32-bit data address range */
26#define CR_L (1 << 6) /* Implementation defined */
27#define CR_B (1 << 7) /* Big endian */
28#define CR_S (1 << 8) /* System MMU protection */
29#define CR_R (1 << 9) /* ROM MMU protection */
30#define CR_F (1 << 10) /* Implementation defined */
31#define CR_Z (1 << 11) /* Implementation defined */
32#define CR_I (1 << 12) /* Icache enable */
33#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
34#define CR_RR (1 << 14) /* Round Robin cache replacement */
35#define CR_L4 (1 << 15) /* LDR pc can set T bit */
36#define CR_DT (1 << 16)
37#define CR_IT (1 << 18)
38#define CR_ST (1 << 19)
39#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */
40#define CR_U (1 << 22) /* Unaligned access operation */
41#define CR_XP (1 << 23) /* Extended page tables */
42#define CR_VE (1 << 24) /* Vectored interrupts */
Russell Kingb1cce6b2008-11-04 10:52:28 +000043#define CR_EE (1 << 25) /* Exception (Big) Endian */
44#define CR_TRE (1 << 28) /* TEX remap enable */
45#define CR_AFE (1 << 29) /* Access flag enable */
46#define CR_TE (1 << 30) /* Thumb exception enable */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Linus Torvalds1da177e2005-04-16 15:20:36 -070048/*
49 * This is used to ensure the compiler did actually allocate the register we
50 * asked it for some inline assembly sequences. Apparently we can't trust
51 * the compiler from one version to another so a bit of paranoia won't hurt.
52 * This string is meant to be concatenated with the inline asm string and
53 * will cause compilation to stop on mismatch.
54 * (for details, see gcc PR 15089)
55 */
56#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
57
58#ifndef __ASSEMBLY__
59
60#include <linux/linkage.h>
Russell King255d1f82006-12-18 00:12:47 +000061#include <linux/irqflags.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Catalin Marinase7c56502010-03-24 16:49:54 +010063#include <asm/outercache.h>
64
Russell King7ab3f8d2007-03-02 15:01:36 +000065#define __exception __attribute__((section(".exception.text")))
Rabin Vincent61b5cb12010-10-07 20:51:58 +053066#ifdef CONFIG_FUNCTION_GRAPH_TRACER
67#define __exception_irq_entry __irq_entry
68#else
69#define __exception_irq_entry __exception
70#endif
Russell King7ab3f8d2007-03-02 15:01:36 +000071
Linus Torvalds1da177e2005-04-16 15:20:36 -070072struct thread_info;
73struct task_struct;
74
75/* information about the system we're running on */
76extern unsigned int system_rev;
77extern unsigned int system_serial_low;
78extern unsigned int system_serial_high;
79extern unsigned int mem_fclk_21285;
80
81struct pt_regs;
82
Russell Kinga9221de2010-01-20 17:02:54 +000083void die(const char *msg, struct pt_regs *regs, int err);
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Russell Kingcfb08102005-06-30 11:06:49 +010085struct siginfo;
Christoph Hellwig1eeb66a2007-05-08 00:27:03 -070086void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
Russell Kingcfb08102005-06-30 11:06:49 +010087 unsigned long err, unsigned long trap);
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
89void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
90 struct pt_regs *),
Kirill A. Shutemov6338a6a2010-07-22 13:18:19 +010091 int sig, int code, const char *name);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
Will Deacon3a4b5dc2010-09-03 10:39:59 +010093void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
94 struct pt_regs *),
95 int sig, int code, const char *name);
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097#define xchg(ptr,x) \
98 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
99
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100extern asmlinkage void __backtrace(void);
Russell King652a12e2005-04-17 15:50:36 +0100101extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
Russell King5470dc62005-11-16 18:36:49 +0000102
103struct mm_struct;
Russell King652a12e2005-04-17 15:50:36 +0100104extern void show_pte(struct mm_struct *mm, unsigned long addr);
105extern void __show_regs(struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107extern int cpu_architecture(void);
Russell King36c5ed22005-06-19 18:39:33 +0100108extern void cpu_init(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109
Russell Kingbe093be2009-03-19 16:20:24 +0000110void arm_machine_restart(char mode, const char *cmd);
111extern void (*arm_pm_restart)(char str, const char *cmd);
Richard Purdie74617fb2006-06-19 19:57:12 +0100112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113#define UDBG_UNDEFINED (1 << 0)
114#define UDBG_SYSCALL (1 << 1)
115#define UDBG_BADABORT (1 << 2)
116#define UDBG_SEGV (1 << 3)
117#define UDBG_BUS (1 << 4)
118
119extern unsigned int user_debug;
120
121#if __LINUX_ARM_ARCH__ >= 4
122#define vectors_high() (cr_alignment & CR_V)
123#else
124#define vectors_high() (0)
125#endif
126
Catalin Marinas56163fc2007-05-08 22:53:44 +0100127#if __LINUX_ARM_ARCH__ >= 7
128#define isb() __asm__ __volatile__ ("isb" : : : "memory")
129#define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
130#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
131#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
Catalin Marinasdcda7e42007-02-05 14:47:35 +0100132#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
133 : : "r" (0) : "memory")
134#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
135 : : "r" (0) : "memory")
136#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
137 : : "r" (0) : "memory")
Paulius Zaleckas28853ac2009-03-25 13:10:01 +0200138#elif defined(CONFIG_CPU_FA526)
139#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
140 : : "r" (0) : "memory")
141#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
142 : : "r" (0) : "memory")
143#define dmb() __asm__ __volatile__ ("" : : : "memory")
Russell King6d9b37a2005-07-26 19:44:26 +0100144#else
Catalin Marinasdcda7e42007-02-05 14:47:35 +0100145#define isb() __asm__ __volatile__ ("" : : : "memory")
146#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
147 : : "r" (0) : "memory")
148#define dmb() __asm__ __volatile__ ("" : : : "memory")
Russell King6d9b37a2005-07-26 19:44:26 +0100149#endif
Catalin Marinas9623b372007-02-28 12:30:38 +0100150
Catalin Marinase7c56502010-03-24 16:49:54 +0100151#ifdef CONFIG_ARCH_HAS_BARRIERS
152#include <mach/barriers.h>
Russell Kingac1d4262010-05-17 17:24:04 +0100153#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
Catalin Marinase7c56502010-03-24 16:49:54 +0100154#define mb() do { dsb(); outer_sync(); } while (0)
Russell King26a26d32009-11-20 21:06:43 +0000155#define rmb() dmb()
Catalin Marinase7c56502010-03-24 16:49:54 +0100156#define wmb() mb()
Russell King26a26d32009-11-20 21:06:43 +0000157#else
Lennert Buytenhek398e6922007-03-31 12:03:20 +0100158#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
159#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
160#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
Russell King26a26d32009-11-20 21:06:43 +0000161#endif
162
163#ifndef CONFIG_SMP
Lennert Buytenhek398e6922007-03-31 12:03:20 +0100164#define smp_mb() barrier()
165#define smp_rmb() barrier()
166#define smp_wmb() barrier()
Catalin Marinas9623b372007-02-28 12:30:38 +0100167#else
Catalin Marinase7c56502010-03-24 16:49:54 +0100168#define smp_mb() dmb()
169#define smp_rmb() dmb()
170#define smp_wmb() dmb()
Lennert Buytenhek398e6922007-03-31 12:03:20 +0100171#endif
Russell King26a26d32009-11-20 21:06:43 +0000172
Lennert Buytenhek398e6922007-03-31 12:03:20 +0100173#define read_barrier_depends() do { } while(0)
174#define smp_read_barrier_depends() do { } while(0)
Catalin Marinas9623b372007-02-28 12:30:38 +0100175
176#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
178
Catalin Marinas56660fa2007-02-05 14:48:02 +0100179extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
180extern unsigned long cr_alignment; /* defined in entry-armv.S */
181
182static inline unsigned int get_cr(void)
183{
184 unsigned int val;
185 asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
186 return val;
187}
188
189static inline void set_cr(unsigned int val)
190{
191 asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
192 : : "r" (val) : "cc");
193 isb();
194}
195
196#ifndef CONFIG_SMP
197extern void adjust_cr(unsigned long mask, unsigned long set);
198#endif
199
200#define CPACC_FULL(n) (3 << (n * 2))
201#define CPACC_SVC(n) (1 << (n * 2))
202#define CPACC_DISABLE(n) (0 << (n * 2))
203
204static inline unsigned int get_copro_access(void)
205{
206 unsigned int val;
207 asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
208 : "=r" (val) : : "cc");
209 return val;
210}
211
212static inline void set_copro_access(unsigned int val)
213{
214 asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
215 : : "r" (val) : "cc");
216 isb();
217}
218
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219/*
Nick Piggin4866cde2005-06-25 14:57:23 -0700220 * switch_mm() may do a full cache flush over the context switch,
221 * so enable interrupts over the context switch to avoid high
222 * latency.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 */
Nick Piggin4866cde2005-06-25 14:57:23 -0700224#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225
226/*
227 * switch_to(prev, next) should switch from task `prev' to `next'
228 * `prev' will never be the same as `next'. schedule() itself
229 * contains the memory barrier to tell GCC not to cache `current'.
230 */
231extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
232
233#define switch_to(prev,next,last) \
234do { \
Al Viroe7c1b322006-01-12 01:05:56 -0800235 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236} while (0)
237
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
239/*
240 * On the StrongARM, "swp" is terminally broken since it bypasses the
241 * cache totally. This means that the cache becomes inconsistent, and,
242 * since we use normal loads/stores as well, this is really bad.
243 * Typically, this causes oopsen in filp_close, but could have other,
244 * more disasterous effects. There are two work-arounds:
245 * 1. Disable interrupts and emulate the atomic swap
246 * 2. Clean the cache, perform atomic swap, flush the cache
247 *
248 * We choose (1) since its the "easiest" to achieve here and is not
249 * dependent on the processor type.
Russell King053a7b52005-06-28 19:22:25 +0100250 *
251 * NOTE that this solution won't work on an SMP system, so explcitly
252 * forbid it here.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253 */
254#define swp_is_buggy
255#endif
256
257static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
258{
259 extern void __bad_xchg(volatile void *, int);
260 unsigned long ret;
261#ifdef swp_is_buggy
262 unsigned long flags;
263#endif
Russell King95607822005-07-26 19:39:31 +0100264#if __LINUX_ARM_ARCH__ >= 6
265 unsigned int tmp;
266#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267
Russell Kingbac4e962009-05-25 20:58:00 +0100268 smp_mb();
269
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 switch (size) {
Russell King95607822005-07-26 19:39:31 +0100271#if __LINUX_ARM_ARCH__ >= 6
272 case 1:
273 asm volatile("@ __xchg1\n"
274 "1: ldrexb %0, [%3]\n"
275 " strexb %1, %2, [%3]\n"
276 " teq %1, #0\n"
277 " bne 1b"
278 : "=&r" (ret), "=&r" (tmp)
279 : "r" (x), "r" (ptr)
280 : "memory", "cc");
281 break;
282 case 4:
283 asm volatile("@ __xchg4\n"
284 "1: ldrex %0, [%3]\n"
285 " strex %1, %2, [%3]\n"
286 " teq %1, #0\n"
287 " bne 1b"
288 : "=&r" (ret), "=&r" (tmp)
289 : "r" (x), "r" (ptr)
290 : "memory", "cc");
291 break;
292#elif defined(swp_is_buggy)
293#ifdef CONFIG_SMP
294#error SMP is not supported on this platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295#endif
Russell King95607822005-07-26 19:39:31 +0100296 case 1:
Lennert Buytenheke7cc2c52006-09-21 03:35:20 +0100297 raw_local_irq_save(flags);
Russell King95607822005-07-26 19:39:31 +0100298 ret = *(volatile unsigned char *)ptr;
299 *(volatile unsigned char *)ptr = x;
Lennert Buytenheke7cc2c52006-09-21 03:35:20 +0100300 raw_local_irq_restore(flags);
Russell King95607822005-07-26 19:39:31 +0100301 break;
302
303 case 4:
Lennert Buytenheke7cc2c52006-09-21 03:35:20 +0100304 raw_local_irq_save(flags);
Russell King95607822005-07-26 19:39:31 +0100305 ret = *(volatile unsigned long *)ptr;
306 *(volatile unsigned long *)ptr = x;
Lennert Buytenheke7cc2c52006-09-21 03:35:20 +0100307 raw_local_irq_restore(flags);
Russell King95607822005-07-26 19:39:31 +0100308 break;
309#else
310 case 1:
311 asm volatile("@ __xchg1\n"
312 " swpb %0, %1, [%2]"
313 : "=&r" (ret)
314 : "r" (x), "r" (ptr)
315 : "memory", "cc");
316 break;
317 case 4:
318 asm volatile("@ __xchg4\n"
319 " swp %0, %1, [%2]"
320 : "=&r" (ret)
321 : "r" (x), "r" (ptr)
322 : "memory", "cc");
323 break;
324#endif
325 default:
326 __bad_xchg(ptr, size), ret = 0;
327 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 }
Russell Kingbac4e962009-05-25 20:58:00 +0100329 smp_mb();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330
331 return ret;
332}
333
Ben Dooksdabaeff2006-03-15 23:17:26 +0000334extern void disable_hlt(void);
335extern void enable_hlt(void);
336
Kevin Hilmanc7b0aff2010-10-01 22:13:47 +0100337void cpu_idle_wait(void);
338
Mathieu Desnoyers176393d2008-02-07 00:16:11 -0800339#include <asm-generic/cmpxchg-local.h>
340
Mathieu Desnoyersecd322c2009-05-28 16:07:39 -0400341#if __LINUX_ARM_ARCH__ < 6
342
343#ifdef CONFIG_SMP
344#error "SMP is not supported on this platform"
345#endif
346
Mathieu Desnoyers176393d2008-02-07 00:16:11 -0800347/*
348 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
349 * them available.
350 */
351#define cmpxchg_local(ptr, o, n) \
352 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
353 (unsigned long)(n), sizeof(*(ptr))))
354#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
355
356#ifndef CONFIG_SMP
357#include <asm-generic/cmpxchg.h>
358#endif
359
Mathieu Desnoyersecd322c2009-05-28 16:07:39 -0400360#else /* __LINUX_ARM_ARCH__ >= 6 */
361
362extern void __bad_cmpxchg(volatile void *ptr, int size);
363
364/*
365 * cmpxchg only support 32-bits operands on ARMv6.
366 */
367
368static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
369 unsigned long new, int size)
370{
371 unsigned long oldval, res;
372
373 switch (size) {
374#ifdef CONFIG_CPU_32v6K
375 case 1:
376 do {
377 asm volatile("@ __cmpxchg1\n"
378 " ldrexb %1, [%2]\n"
379 " mov %0, #0\n"
380 " teq %1, %3\n"
381 " strexbeq %0, %4, [%2]\n"
382 : "=&r" (res), "=&r" (oldval)
383 : "r" (ptr), "Ir" (old), "r" (new)
384 : "memory", "cc");
385 } while (res);
386 break;
387 case 2:
388 do {
389 asm volatile("@ __cmpxchg1\n"
390 " ldrexh %1, [%2]\n"
391 " mov %0, #0\n"
392 " teq %1, %3\n"
393 " strexheq %0, %4, [%2]\n"
394 : "=&r" (res), "=&r" (oldval)
395 : "r" (ptr), "Ir" (old), "r" (new)
396 : "memory", "cc");
397 } while (res);
398 break;
399#endif /* CONFIG_CPU_32v6K */
400 case 4:
401 do {
402 asm volatile("@ __cmpxchg4\n"
403 " ldrex %1, [%2]\n"
404 " mov %0, #0\n"
405 " teq %1, %3\n"
406 " strexeq %0, %4, [%2]\n"
407 : "=&r" (res), "=&r" (oldval)
408 : "r" (ptr), "Ir" (old), "r" (new)
409 : "memory", "cc");
410 } while (res);
411 break;
412 default:
413 __bad_cmpxchg(ptr, size);
414 oldval = 0;
415 }
416
417 return oldval;
418}
419
420static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
421 unsigned long new, int size)
422{
423 unsigned long ret;
424
425 smp_mb();
426 ret = __cmpxchg(ptr, old, new, size);
427 smp_mb();
428
429 return ret;
430}
431
432#define cmpxchg(ptr,o,n) \
433 ((__typeof__(*(ptr)))__cmpxchg_mb((ptr), \
434 (unsigned long)(o), \
435 (unsigned long)(n), \
436 sizeof(*(ptr))))
437
438static inline unsigned long __cmpxchg_local(volatile void *ptr,
439 unsigned long old,
440 unsigned long new, int size)
441{
442 unsigned long ret;
443
444 switch (size) {
445#ifndef CONFIG_CPU_32v6K
446 case 1:
447 case 2:
448 ret = __cmpxchg_local_generic(ptr, old, new, size);
449 break;
450#endif /* !CONFIG_CPU_32v6K */
451 default:
452 ret = __cmpxchg(ptr, old, new, size);
453 }
454
455 return ret;
456}
457
458#define cmpxchg_local(ptr,o,n) \
459 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
460 (unsigned long)(o), \
461 (unsigned long)(n), \
462 sizeof(*(ptr))))
463
464#ifdef CONFIG_CPU_32v6K
465
466/*
467 * Note : ARMv7-M (currently unsupported by Linux) does not support
468 * ldrexd/strexd. If ARMv7-M is ever supported by the Linux kernel, it should
469 * not be allowed to use __cmpxchg64.
470 */
471static inline unsigned long long __cmpxchg64(volatile void *ptr,
472 unsigned long long old,
473 unsigned long long new)
474{
475 register unsigned long long oldval asm("r0");
476 register unsigned long long __old asm("r2") = old;
477 register unsigned long long __new asm("r4") = new;
478 unsigned long res;
479
480 do {
481 asm volatile(
482 " @ __cmpxchg8\n"
483 " ldrexd %1, %H1, [%2]\n"
484 " mov %0, #0\n"
485 " teq %1, %3\n"
486 " teqeq %H1, %H3\n"
487 " strexdeq %0, %4, %H4, [%2]\n"
488 : "=&r" (res), "=&r" (oldval)
489 : "r" (ptr), "Ir" (__old), "r" (__new)
490 : "memory", "cc");
491 } while (res);
492
493 return oldval;
494}
495
496static inline unsigned long long __cmpxchg64_mb(volatile void *ptr,
497 unsigned long long old,
498 unsigned long long new)
499{
500 unsigned long long ret;
501
502 smp_mb();
503 ret = __cmpxchg64(ptr, old, new);
504 smp_mb();
505
506 return ret;
507}
508
509#define cmpxchg64(ptr,o,n) \
510 ((__typeof__(*(ptr)))__cmpxchg64_mb((ptr), \
511 (unsigned long long)(o), \
512 (unsigned long long)(n)))
513
514#define cmpxchg64_local(ptr,o,n) \
515 ((__typeof__(*(ptr)))__cmpxchg64((ptr), \
516 (unsigned long long)(o), \
517 (unsigned long long)(n)))
518
519#else /* !CONFIG_CPU_32v6K */
520
521#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
522
523#endif /* CONFIG_CPU_32v6K */
524
525#endif /* __LINUX_ARM_ARCH__ >= 6 */
526
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527#endif /* __ASSEMBLY__ */
528
529#define arch_align_stack(x) (x)
530
531#endif /* __KERNEL__ */
532
533#endif