Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ARCH_SPARC64_PERCPU__ |
| 2 | #define __ARCH_SPARC64_PERCPU__ |
| 3 | |
| 4 | #include <linux/compiler.h> |
| 5 | |
David S. Miller | 195f7fd | 2007-08-18 00:07:40 -0700 | [diff] [blame] | 6 | register unsigned long __local_per_cpu_offset asm("g5"); |
| 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #ifdef CONFIG_SMP |
| 9 | |
David S. Miller | 5cbc307 | 2007-05-25 15:49:59 -0700 | [diff] [blame] | 10 | extern void real_setup_per_cpu_areas(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | extern unsigned long __per_cpu_base; |
| 13 | extern unsigned long __per_cpu_shift; |
| 14 | #define __per_cpu_offset(__cpu) \ |
| 15 | (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) |
Ingo Molnar | a875a69 | 2006-07-03 00:24:26 -0700 | [diff] [blame] | 16 | #define per_cpu_offset(x) (__per_cpu_offset(x)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
travis@sgi.com | 3afc620 | 2008-01-30 23:27:58 +0100 | [diff] [blame] | 18 | #define __my_cpu_offset __local_per_cpu_offset |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #else /* ! SMP */ |
| 21 | |
David S. Miller | 5cbc307 | 2007-05-25 15:49:59 -0700 | [diff] [blame] | 22 | #define real_setup_per_cpu_areas() do { } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #endif /* SMP */ |
| 25 | |
travis@sgi.com | 3afc620 | 2008-01-30 23:27:58 +0100 | [diff] [blame] | 26 | #include <asm-generic/percpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | #endif /* __ARCH_SPARC64_PERCPU__ */ |