summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pda.h
diff options
context:
space:
mode:
authorTejun Heo2009-01-13 12:41:35 +0100
committerIngo Molnar2009-01-16 14:20:03 +0100
commitb12d8db8fbfaed1e8222a15333a3645599636854 (patch)
tree4ae6ce55232885d0707eb464c5b43a54bdfe3ce4 /arch/x86/include/asm/pda.h
parentx86: merge 64 and 32 SMP percpu handling (diff)
downloadkernel-qcow2-linux-b12d8db8fbfaed1e8222a15333a3645599636854.tar.gz
kernel-qcow2-linux-b12d8db8fbfaed1e8222a15333a3645599636854.tar.xz
kernel-qcow2-linux-b12d8db8fbfaed1e8222a15333a3645599636854.zip
x86: make pda a percpu variable
[ Based on original patch from Christoph Lameter and Mike Travis. ] As pda is now allocated in percpu area, it can easily be made a proper percpu variable. Make it so by defining per cpu symbol from linker script and declaring it in C code for SMP and simply defining it for UP. This change cleans up code and brings SMP and UP closer a bit. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/pda.h')
-rw-r--r--arch/x86/include/asm/pda.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/include/asm/pda.h b/arch/x86/include/asm/pda.h
index e91558e37850..66ae1043393d 100644
--- a/arch/x86/include/asm/pda.h
+++ b/arch/x86/include/asm/pda.h
@@ -7,6 +7,7 @@
#include <linux/cache.h>
#include <linux/threads.h>
#include <asm/page.h>
+#include <asm/percpu.h>
/* Per processor datastructure. %gs points to it while the kernel runs */
struct x8664_pda {
@@ -39,10 +40,10 @@ struct x8664_pda {
unsigned irq_spurious_count;
} ____cacheline_aligned_in_smp;
-extern struct x8664_pda *_cpu_pda[NR_CPUS];
+DECLARE_PER_CPU(struct x8664_pda, __pda);
extern void pda_init(int);
-#define cpu_pda(i) (_cpu_pda[i])
+#define cpu_pda(cpu) (&per_cpu(__pda, cpu))
/*
* There is no fast way to get the base address of the PDA, all the accesses