diff options
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}, \ |