Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] lockdep: add per_cpu_offset()

Add the per_cpu_offset() generic method. (used by the lock validator)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Ingo Molnar and committed by
Linus Torvalds
a875a69f 8d8fdf5c

+8
+2
include/asm-generic/percpu.h
··· 7 7 8 8 extern unsigned long __per_cpu_offset[NR_CPUS]; 9 9 10 + #define per_cpu_offset(x) (__per_cpu_offset[x]) 11 + 10 12 /* Separate out the type, so (int[3], foo) works. */ 11 13 #define DEFINE_PER_CPU(type, name) \ 12 14 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
+1
include/asm-ia64/percpu.h
··· 36 36 #ifdef CONFIG_SMP 37 37 38 38 extern unsigned long __per_cpu_offset[NR_CPUS]; 39 + #define per_cpu_offset(x) (__per_cpu_offset(x)) 39 40 40 41 /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ 41 42 DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
+1
include/asm-powerpc/percpu.h
··· 14 14 15 15 #define __per_cpu_offset(cpu) (paca[cpu].data_offset) 16 16 #define __my_cpu_offset() get_paca()->data_offset 17 + #define per_cpu_offset(x) (__per_cpu_offset(x)) 17 18 18 19 /* Separate out the type, so (int[3], foo) works. */ 19 20 #define DEFINE_PER_CPU(type, name) \
+1
include/asm-s390/percpu.h
··· 42 42 #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 43 43 #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 44 44 #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 45 + #define per_cpu_offset(x) (__per_cpu_offset[x]) 45 46 46 47 /* A macro to avoid #include hell... */ 47 48 #define percpu_modcopy(pcpudst, src, size) \
+1
include/asm-sparc64/percpu.h
··· 11 11 extern unsigned long __per_cpu_shift; 12 12 #define __per_cpu_offset(__cpu) \ 13 13 (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) 14 + #define per_cpu_offset(x) (__per_cpu_offset(x)) 14 15 15 16 /* Separate out the type, so (int[3], foo) works. */ 16 17 #define DEFINE_PER_CPU(type, name) \
+2
include/asm-x86_64/percpu.h
··· 14 14 #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) 15 15 #define __my_cpu_offset() read_pda(data_offset) 16 16 17 + #define per_cpu_offset(x) (__per_cpu_offset(x)) 18 + 17 19 /* Separate out the type, so (int[3], foo) works. */ 18 20 #define DEFINE_PER_CPU(type, name) \ 19 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name