summaryrefslogtreecommitdiffstats
path: root/include/asm-i386/pda.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-05-02 19:27:10 +0200
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 19:27:10 +0200
commitae1ee11be77f51cedb6c569887dddc70c163ab6d (patch)
treee579a6a6d10c6835cab9af47a2795bf40f669da6 /include/asm-i386/pda.h
parent8f9aeca7a081d81c4c9862be1e04f15b5ab5461f (diff)
downloadtalos-op-linux-ae1ee11be77f51cedb6c569887dddc70c163ab6d.tar.gz
talos-op-linux-ae1ee11be77f51cedb6c569887dddc70c163ab6d.zip
[PATCH] i386: Use per-cpu variables for GDT, PDA
Allocating PDA and GDT at boot is a pain. Using simple per-cpu variables adds happiness (although we need the GDT page-aligned for Xen, which we do in a followup patch). [akpm@linux-foundation.org: build fix] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/asm-i386/pda.h')
-rw-r--r--include/asm-i386/pda.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/asm-i386/pda.h b/include/asm-i386/pda.h
index b12d59a318b7..aef7f732f77e 100644
--- a/include/asm-i386/pda.h
+++ b/include/asm-i386/pda.h
@@ -8,6 +8,7 @@
#include <linux/stddef.h>
#include <linux/types.h>
+#include <asm/percpu.h>
struct i386_pda
{
@@ -18,10 +19,8 @@ struct i386_pda
struct pt_regs *irq_regs;
};
-extern struct i386_pda *_cpu_pda[];
-
-#define cpu_pda(i) (_cpu_pda[i])
-
+DECLARE_PER_CPU(struct i386_pda, _cpu_pda);
+#define cpu_pda(i) (&per_cpu(_cpu_pda, (i)))
#define pda_offset(field) offsetof(struct i386_pda, field)
extern void __bad_pda_field(void);
OpenPOWER on IntegriCloud