[PATCH] ARM: Fix kernel stack offset calculations
[linux-2.6.git] / include / asm-arm / processor.h
index 4a98459..7d4118e 100644 (file)
@@ -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.