Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 1 | #ifndef __ARCH_SPARC64_PERCPU__ |
| 2 | #define __ARCH_SPARC64_PERCPU__ |
| 3 | |
| 4 | #include <linux/compiler.h> |
| 5 | |
| 6 | register unsigned long __local_per_cpu_offset asm("g5"); |
| 7 | |
| 8 | #ifdef CONFIG_SMP |
| 9 | |
David S. Miller | 5a5488d | 2009-04-01 01:47:10 -0700 | [diff] [blame] | 10 | #include <asm/trap_block.h> |
| 11 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 12 | #define __per_cpu_offset(__cpu) \ |
David S. Miller | 5a5488d | 2009-04-01 01:47:10 -0700 | [diff] [blame] | 13 | (trap_block[(__cpu)].__per_cpu_base) |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 14 | #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 Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 20 | #endif /* SMP */ |
| 21 | |
| 22 | #include <asm-generic/percpu.h> |
| 23 | |
| 24 | #endif /* __ARCH_SPARC64_PERCPU__ */ |