diff options
author | Brian Gerst <brgerst@gmail.com> | 2009-01-18 10:38:58 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-01-18 10:38:58 -0500 |
commit | 26f80bd6a9ab17bc8a60b6092e7c0d05c5927ce5 (patch) | |
tree | 7456ba479397c986337b2bb9574a74710fddbdee /arch/x86/kernel/setup_percpu.c | |
parent | 9eb912d1aa6b8106e06a73ea6702ec3dab0d6a1a (diff) |
x86-64: Convert irqstacks to per-cpu
Move the irqstackptr variable from the PDA to per-cpu. Make the
stacks themselves per-cpu, removing some specific allocation code.
Add a seperate flag (is_boot_cpu) to simplify the per-cpu boot
adjustments.
tj: * sprinkle some underbars around.
* irq_stack_ptr is not used till traps_init(), no reason to
initialize it early. On SMP, just leaving it NULL till proper
initialization in setup_per_cpu_areas() works. Dropped
is_boot_cpu and early irq_stack_ptr initialization.
* do DECLARE/DEFINE_PER_CPU(char[IRQ_STACK_SIZE], irq_stack)
instead of (char, irq_stack[IRQ_STACK_SIZE]).
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index b5c35af2011d..8b53ef83c611 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -192,7 +192,10 @@ void __init setup_per_cpu_areas(void) | |||
192 | 192 | ||
193 | memcpy(ptr, __per_cpu_load, __per_cpu_end - __per_cpu_start); | 193 | memcpy(ptr, __per_cpu_load, __per_cpu_end - __per_cpu_start); |
194 | per_cpu_offset(cpu) = ptr - __per_cpu_start; | 194 | per_cpu_offset(cpu) = ptr - __per_cpu_start; |
195 | per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu); | ||
195 | #ifdef CONFIG_X86_64 | 196 | #ifdef CONFIG_X86_64 |
197 | per_cpu(irq_stack_ptr, cpu) = | ||
198 | (char *)per_cpu(irq_stack, cpu) + IRQ_STACK_SIZE - 64; | ||
196 | /* | 199 | /* |
197 | * CPU0 modified pda in the init data area, reload pda | 200 | * CPU0 modified pda in the init data area, reload pda |
198 | * offset for CPU0 and clear the area for others. | 201 | * offset for CPU0 and clear the area for others. |
@@ -202,7 +205,6 @@ void __init setup_per_cpu_areas(void) | |||
202 | else | 205 | else |
203 | memset(cpu_pda(cpu), 0, sizeof(*cpu_pda(cpu))); | 206 | memset(cpu_pda(cpu), 0, sizeof(*cpu_pda(cpu))); |
204 | #endif | 207 | #endif |
205 | per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu); | ||
206 | 208 | ||
207 | DBG("PERCPU: cpu %4d %p\n", cpu, ptr); | 209 | DBG("PERCPU: cpu %4d %p\n", cpu, ptr); |
208 | } | 210 | } |