blob: 007aafb4ae97e4914dbfeba584795680d41b6adf [file] [log] [blame]
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07001#ifndef __ARCH_SPARC64_PERCPU__
2#define __ARCH_SPARC64_PERCPU__
3
4#include <linux/compiler.h>
5
6register unsigned long __local_per_cpu_offset asm("g5");
7
8#ifdef CONFIG_SMP
9
David S. Miller5a5488d2009-04-01 01:47:10 -070010#include <asm/trap_block.h>
11
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070012#define __per_cpu_offset(__cpu) \
David S. Miller5a5488d2009-04-01 01:47:10 -070013 (trap_block[(__cpu)].__per_cpu_base)
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070014#define per_cpu_offset(x) (__per_cpu_offset(x))
15
16#define __my_cpu_offset __local_per_cpu_offset
17
18#else /* ! SMP */
19
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070020#endif /* SMP */
21
22#include <asm-generic/percpu.h>
23
24#endif /* __ARCH_SPARC64_PERCPU__ */