diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-04-30 04:49:55 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-06-02 15:54:42 -0400 |
commit | bcf0b0880710409420a4e3b15dbf4b9a63542c0b (patch) | |
tree | ca1c813648ea075b772112237fde3ccfe3ddb776 /arch/powerpc/kernel/head_booke.h | |
parent | c054065bc10a7ee2bcf78b5bc95f4b4d9bdc923a (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/head_booke.h')
-rw-r--r-- | arch/powerpc/kernel/head_booke.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h index 721faef87095..9eacf4ca442a 100644 --- a/arch/powerpc/kernel/head_booke.h +++ b/arch/powerpc/kernel/head_booke.h | |||
@@ -43,9 +43,7 @@ | |||
43 | SAVE_2GPRS(7, r11) | 43 | SAVE_2GPRS(7, r11) |
44 | 44 | ||
45 | /* To handle the additional exception priority levels on 40x and Book-E | 45 | /* To handle the additional exception priority levels on 40x and Book-E |
46 | * processors we allocate a 4k stack per additional priority level. The various | 46 | * processors we allocate a stack per additional priority level. |
47 | * head_xxx.S files allocate space (exception_stack_top) for each priority's | ||
48 | * stack times the number of CPUs | ||
49 | * | 47 | * |
50 | * On 40x critical is the only additional level | 48 | * On 40x critical is the only additional level |
51 | * On 44x/e500 we have critical and machine check | 49 | * On 44x/e500 we have critical and machine check |
@@ -61,36 +59,31 @@ | |||
61 | * going to critical or their own debug level we aren't currently | 59 | * going to critical or their own debug level we aren't currently |
62 | * providing configurations that micro-optimize space usage. | 60 | * providing configurations that micro-optimize space usage. |
63 | */ | 61 | */ |
64 | #ifdef CONFIG_44x | ||
65 | #define NUM_EXCEPTION_LVLS 2 | ||
66 | #else | ||
67 | #define NUM_EXCEPTION_LVLS 3 | ||
68 | #endif | ||
69 | #define BOOKE_EXCEPTION_STACK_SIZE (4096 * NUM_EXCEPTION_LVLS) | ||
70 | 62 | ||
71 | /* CRIT_SPRG only used in critical exception handling */ | 63 | /* CRIT_SPRG only used in critical exception handling */ |
72 | #define CRIT_SPRG SPRN_SPRG2 | 64 | #define CRIT_SPRG SPRN_SPRG2 |
73 | /* MCHECK_SPRG only used in machine check exception handling */ | 65 | /* MCHECK_SPRG only used in machine check exception handling */ |
74 | #define MCHECK_SPRG SPRN_SPRG6W | 66 | #define MCHECK_SPRG SPRN_SPRG6W |
75 | 67 | ||
76 | #define MCHECK_STACK_TOP (exception_stack_top - 4096) | 68 | #define MCHECK_STACK_BASE mcheckirq_ctx |
77 | #define CRIT_STACK_TOP (exception_stack_top) | 69 | #define CRIT_STACK_BASE critirq_ctx |
78 | 70 | ||
79 | /* only on e200 for now */ | 71 | /* only on e200 for now */ |
80 | #define DEBUG_STACK_TOP (exception_stack_top - 8192) | 72 | #define DEBUG_STACK_BASE dbgirq_ctx |
81 | #define DEBUG_SPRG SPRN_SPRG6W | 73 | #define DEBUG_SPRG SPRN_SPRG6W |
82 | 74 | ||
83 | #ifdef CONFIG_SMP | 75 | #ifdef CONFIG_SMP |
84 | #define BOOKE_LOAD_EXC_LEVEL_STACK(level) \ | 76 | #define BOOKE_LOAD_EXC_LEVEL_STACK(level) \ |
85 | mfspr r8,SPRN_PIR; \ | 77 | mfspr r8,SPRN_PIR; \ |
86 | mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \ | 78 | slwi r8,r8,2; \ |
87 | neg r8,r8; \ | 79 | addis r8,r8,level##_STACK_BASE@ha; \ |
88 | addis r8,r8,level##_STACK_TOP@ha; \ | 80 | lwz r8,level##_STACK_BASE@l(r8); \ |
89 | addi r8,r8,level##_STACK_TOP@l | 81 | addi r8,r8,THREAD_SIZE; |
90 | #else | 82 | #else |
91 | #define BOOKE_LOAD_EXC_LEVEL_STACK(level) \ | 83 | #define BOOKE_LOAD_EXC_LEVEL_STACK(level) \ |
92 | lis r8,level##_STACK_TOP@h; \ | 84 | lis r8,level##_STACK_BASE@ha; \ |
93 | ori r8,r8,level##_STACK_TOP@l | 85 | lwz r8,level##_STACK_BASE@l(r8); \ |
86 | addi r8,r8,THREAD_SIZE; | ||
94 | #endif | 87 | #endif |
95 | 88 | ||
96 | /* | 89 | /* |