diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-05-02 13:27:10 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:10 -0400 |
commit | ae1ee11be77f51cedb6c569887dddc70c163ab6d (patch) | |
tree | e579a6a6d10c6835cab9af47a2795bf40f669da6 /include/asm-i386 | |
parent | 8f9aeca7a081d81c4c9862be1e04f15b5ab5461f (diff) |
[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')
-rw-r--r-- | include/asm-i386/desc.h | 1 | ||||
-rw-r--r-- | include/asm-i386/pda.h | 7 | ||||
-rw-r--r-- | include/asm-i386/processor.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index 050831f34f71..53c5916687b6 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h | |||
@@ -22,6 +22,7 @@ struct Xgt_desc_struct { | |||
22 | 22 | ||
23 | extern struct Xgt_desc_struct idt_descr; | 23 | extern struct Xgt_desc_struct idt_descr; |
24 | DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr); | 24 | DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr); |
25 | DECLARE_PER_CPU(struct desc_struct, cpu_gdt[GDT_ENTRIES]); | ||
25 | extern struct Xgt_desc_struct early_gdt_descr; | 26 | extern struct Xgt_desc_struct early_gdt_descr; |
26 | 27 | ||
27 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | 28 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) |
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 @@ | |||
8 | 8 | ||
9 | #include <linux/stddef.h> | 9 | #include <linux/stddef.h> |
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <asm/percpu.h> | ||
11 | 12 | ||
12 | struct i386_pda | 13 | struct i386_pda |
13 | { | 14 | { |
@@ -18,10 +19,8 @@ struct i386_pda | |||
18 | struct pt_regs *irq_regs; | 19 | struct pt_regs *irq_regs; |
19 | }; | 20 | }; |
20 | 21 | ||
21 | extern struct i386_pda *_cpu_pda[]; | 22 | DECLARE_PER_CPU(struct i386_pda, _cpu_pda); |
22 | 23 | #define cpu_pda(i) (&per_cpu(_cpu_pda, (i))) | |
23 | #define cpu_pda(i) (_cpu_pda[i]) | ||
24 | |||
25 | #define pda_offset(field) offsetof(struct i386_pda, field) | 24 | #define pda_offset(field) offsetof(struct i386_pda, field) |
26 | 25 | ||
27 | extern void __bad_pda_field(void); | 26 | extern void __bad_pda_field(void); |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 01ae0ffcf236..cd940befef53 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -743,7 +743,7 @@ extern unsigned long boot_option_idle_override; | |||
743 | extern void enable_sep_cpu(void); | 743 | extern void enable_sep_cpu(void); |
744 | extern int sysenter_setup(void); | 744 | extern int sysenter_setup(void); |
745 | 745 | ||
746 | extern int init_gdt(int cpu, struct task_struct *idle); | 746 | extern void init_gdt(int cpu, struct task_struct *idle); |
747 | extern void cpu_set_gdt(int); | 747 | extern void cpu_set_gdt(int); |
748 | extern void secondary_cpu_init(void); | 748 | extern void secondary_cpu_init(void); |
749 | 749 | ||