summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/processor.h
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-05-05 13:11:00 +0100
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-05-05 13:11:00 +0100
commit4f7a18124c1a44858fb74a1c4234015009952959 (patch)
tree978f55875b776c83ebcfed24737784ac098d1a4e /include/asm-arm/processor.h
parent897f5ab2cd733a77a2279268262919caa8154b9d (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/asm-arm/processor.h')
-rw-r--r--include/asm-arm/processor.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 4a9845997a7..7d4118e0905 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -23,8 +23,6 @@
#include <asm/procinfo.h>
#include <asm/types.h>
-#define KERNEL_STACK_SIZE PAGE_SIZE
-
union debug_insn {
u32 arm;
u16 thumb;
@@ -87,8 +85,9 @@ unsigned long get_wchan(struct task_struct *p);
*/
extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
-#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
-#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017])
+#define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1)
+#define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc
+#define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp
/*
* Prefetching support - only ARMv5.