diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-04-28 02:21:22 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-29 01:57:34 -0400 |
commit | 85218827cc4ca900867807f19345418164ffc108 (patch) | |
tree | 1813b7fadb7c077acd0ef62f57385b7424ca0121 /include/asm-powerpc | |
parent | dd18434ff0b7d9b9ad3d596985fc84b329d2f9a8 (diff) |
[POWERPC] Add IRQSTACKS support on ppc32
This makes it possible to use separate stacks for hard and soft IRQs
on 32-bit powerpc as well as on 64-bit. The code for 32-bit is just
the 32-bit analog of the 64-bit code.
* Added allocation and initialization of the irq stacks. We limit the
stacks to be in lowmem for ppc32.
* Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
to switch the stack pointers
* Reworked how we do stack overflow detection. We now keep around the
limit of the stack in the thread_struct and compare against the limit
to see if we've overflowed. We can now use this on ppc64 if desired.
[ paulus@samba.org: Fixed bug on 6xx where we need to reload r9 with the
thread_info pointer. ]
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/processor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index fd98ca998b4f..cf83f2d7e2a5 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -138,6 +138,8 @@ typedef struct { | |||
138 | 138 | ||
139 | struct thread_struct { | 139 | struct thread_struct { |
140 | unsigned long ksp; /* Kernel stack pointer */ | 140 | unsigned long ksp; /* Kernel stack pointer */ |
141 | unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */ | ||
142 | |||
141 | #ifdef CONFIG_PPC64 | 143 | #ifdef CONFIG_PPC64 |
142 | unsigned long ksp_vsid; | 144 | unsigned long ksp_vsid; |
143 | #endif | 145 | #endif |
@@ -182,11 +184,14 @@ struct thread_struct { | |||
182 | #define ARCH_MIN_TASKALIGN 16 | 184 | #define ARCH_MIN_TASKALIGN 16 |
183 | 185 | ||
184 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) | 186 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) |
187 | #define INIT_SP_LIMIT \ | ||
188 | (_ALIGN_UP(sizeof(init_thread_info), 16) + (unsigned long) &init_stack) | ||
185 | 189 | ||
186 | 190 | ||
187 | #ifdef CONFIG_PPC32 | 191 | #ifdef CONFIG_PPC32 |
188 | #define INIT_THREAD { \ | 192 | #define INIT_THREAD { \ |
189 | .ksp = INIT_SP, \ | 193 | .ksp = INIT_SP, \ |
194 | .ksp_limit = INIT_SP_LIMIT, \ | ||
190 | .fs = KERNEL_DS, \ | 195 | .fs = KERNEL_DS, \ |
191 | .pgdir = swapper_pg_dir, \ | 196 | .pgdir = swapper_pg_dir, \ |
192 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ | 197 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ |
@@ -194,6 +199,7 @@ struct thread_struct { | |||
194 | #else | 199 | #else |
195 | #define INIT_THREAD { \ | 200 | #define INIT_THREAD { \ |
196 | .ksp = INIT_SP, \ | 201 | .ksp = INIT_SP, \ |
202 | .ksp_limit = INIT_SP_LIMIT, \ | ||
197 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ | 203 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ |
198 | .fs = KERNEL_DS, \ | 204 | .fs = KERNEL_DS, \ |
199 | .fpr = {0}, \ | 205 | .fpr = {0}, \ |