aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_32.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-04-30 04:49:55 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-06-02 15:54:42 -0400
commitbcf0b0880710409420a4e3b15dbf4b9a63542c0b (patch)
treeca1c813648ea075b772112237fde3ccfe3ddb776 /arch/powerpc/kernel/setup_32.c
parentc054065bc10a7ee2bcf78b5bc95f4b4d9bdc923a (diff)
[POWERPC] Move to runtime allocated exception stacks
For the additonal exception levels (critical, debug, machine check) on 40x/book-e we were using "static" allocations of the stack in the associated head.S. Move to a runtime allocation to make the code a bit easier to read as we mimic how we handle IRQ stacks. Its also a bit easier to setup the stack with a "dummy" thread_info in C code. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_32.c')
-rw-r--r--arch/powerpc/kernel/setup_32.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 5112a4aa801d..bef0be3fd98b 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -248,6 +248,28 @@ static void __init irqstack_early_init(void)
248#define irqstack_early_init() 248#define irqstack_early_init()
249#endif 249#endif
250 250
251#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
252static void __init exc_lvl_early_init(void)
253{
254 unsigned int i;
255
256 /* interrupt stacks must be in lowmem, we get that for free on ppc32
257 * as the lmb is limited to lowmem by LMB_REAL_LIMIT */
258 for_each_possible_cpu(i) {
259 critirq_ctx[i] = (struct thread_info *)
260 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
261#ifdef CONFIG_BOOKE
262 dbgirq_ctx[i] = (struct thread_info *)
263 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
264 mcheckirq_ctx[i] = (struct thread_info *)
265 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
266#endif
267 }
268}
269#else
270#define exc_lvl_early_init()
271#endif
272
251/* Warning, IO base is not yet inited */ 273/* Warning, IO base is not yet inited */
252void __init setup_arch(char **cmdline_p) 274void __init setup_arch(char **cmdline_p)
253{ 275{
@@ -305,6 +327,8 @@ void __init setup_arch(char **cmdline_p)
305 init_mm.end_data = (unsigned long) _edata; 327 init_mm.end_data = (unsigned long) _edata;
306 init_mm.brk = klimit; 328 init_mm.brk = klimit;
307 329
330 exc_lvl_early_init();
331
308 irqstack_early_init(); 332 irqstack_early_init();
309 333
310 /* set up the bootmem stuff with available memory */ 334 /* set up the bootmem stuff with available memory */