diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-05-05 08:11:00 -0400 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-05-05 08:11:00 -0400 |
commit | 4f7a18124c1a44858fb74a1c4234015009952959 (patch) | |
tree | 978f55875b776c83ebcfed24737784ac098d1a4e /include | |
parent | 897f5ab2cd733a77a2279268262919caa8154b9d (diff) |
[PATCH] ARM: Fix kernel stack offset calculations
Various places in the ARM kernel implicitly assumed that kernel
stacks are always 8K due to hard coded constants. Replace these
constants with definitions.
Correct the allowable range of kernel stack pointer values within
the allocation. Arrange for the entire kernel stack to be zeroed,
not just the upper 4K if CONFIG_DEBUG_STACK_USAGE is set.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-arm/processor.h | 7 | ||||
-rw-r--r-- | include/asm-arm/thread_info.h | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 4a9845997a75..7d4118e09054 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h | |||
@@ -23,8 +23,6 @@ | |||
23 | #include <asm/procinfo.h> | 23 | #include <asm/procinfo.h> |
24 | #include <asm/types.h> | 24 | #include <asm/types.h> |
25 | 25 | ||
26 | #define KERNEL_STACK_SIZE PAGE_SIZE | ||
27 | |||
28 | union debug_insn { | 26 | union debug_insn { |
29 | u32 arm; | 27 | u32 arm; |
30 | u16 thumb; | 28 | u16 thumb; |
@@ -87,8 +85,9 @@ unsigned long get_wchan(struct task_struct *p); | |||
87 | */ | 85 | */ |
88 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 86 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
89 | 87 | ||
90 | #define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019]) | 88 | #define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1) |
91 | #define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017]) | 89 | #define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc |
90 | #define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp | ||
92 | 91 | ||
93 | /* | 92 | /* |
94 | * Prefetching support - only ARMv5. | 93 | * Prefetching support - only ARMv5. |
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index a61618fb433c..66c585c50cf9 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
@@ -14,6 +14,10 @@ | |||
14 | 14 | ||
15 | #include <asm/fpstate.h> | 15 | #include <asm/fpstate.h> |
16 | 16 | ||
17 | #define THREAD_SIZE_ORDER 1 | ||
18 | #define THREAD_SIZE 8192 | ||
19 | #define THREAD_START_SP (THREAD_SIZE - 8) | ||
20 | |||
17 | #ifndef __ASSEMBLY__ | 21 | #ifndef __ASSEMBLY__ |
18 | 22 | ||
19 | struct task_struct; | 23 | struct task_struct; |
@@ -77,8 +81,6 @@ struct thread_info { | |||
77 | #define init_thread_info (init_thread_union.thread_info) | 81 | #define init_thread_info (init_thread_union.thread_info) |
78 | #define init_stack (init_thread_union.stack) | 82 | #define init_stack (init_thread_union.stack) |
79 | 83 | ||
80 | #define THREAD_SIZE 8192 | ||
81 | |||
82 | /* | 84 | /* |
83 | * how to get the thread information struct from C | 85 | * how to get the thread information struct from C |
84 | */ | 86 | */ |