Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 2 | #ifndef __ARCH_SPARC64_PERCPU__ |
| 3 | #define __ARCH_SPARC64_PERCPU__ |
| 4 | |
| 5 | #include <linux/compiler.h> |
| 6 | |
| 7 | register unsigned long __local_per_cpu_offset asm("g5"); |
| 8 | |
| 9 | #ifdef CONFIG_SMP |
| 10 | |
David S. Miller | 5a5488d | 2009-04-01 01:47:10 -0700 | [diff] [blame] | 11 | #include <asm/trap_block.h> |
| 12 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 13 | #define __per_cpu_offset(__cpu) \ |
David S. Miller | 5a5488d | 2009-04-01 01:47:10 -0700 | [diff] [blame] | 14 | (trap_block[(__cpu)].__per_cpu_base) |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 15 | #define per_cpu_offset(x) (__per_cpu_offset(x)) |
| 16 | |
| 17 | #define __my_cpu_offset __local_per_cpu_offset |
| 18 | |
| 19 | #else /* ! SMP */ |
| 20 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 21 | #endif /* SMP */ |
| 22 | |
| 23 | #include <asm-generic/percpu.h> |
| 24 | |
| 25 | #endif /* __ARCH_SPARC64_PERCPU__ */ |