blob: 32ef6f05cc565a370a1819d6856f8ae6aa78f148 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sam Ravnborgf5e706a2008-07-17 21:55:51 -07002#ifndef __ARCH_SPARC64_PERCPU__
3#define __ARCH_SPARC64_PERCPU__
4
5#include <linux/compiler.h>
6
7register unsigned long __local_per_cpu_offset asm("g5");
8
9#ifdef CONFIG_SMP
10
David S. Miller5a5488d2009-04-01 01:47:10 -070011#include <asm/trap_block.h>
12
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070013#define __per_cpu_offset(__cpu) \
David S. Miller5a5488d2009-04-01 01:47:10 -070014 (trap_block[(__cpu)].__per_cpu_base)
Sam Ravnborgf5e706a2008-07-17 21:55:51 -070015#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 Ravnborgf5e706a2008-07-17 21:55:51 -070021#endif /* SMP */
22
23#include <asm-generic/percpu.h>
24
25#endif /* __ARCH_SPARC64_PERCPU__ */