From: Stuart Menefy Date: Fri, 24 Nov 2006 03:53:02 +0000 (+0900) Subject: sh: KSTK_EIP/KSTK_ESP consistency. X-Git-Tag: v2.6.20-rc1~34^2~20^2~32^2~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f0b1c1410e9e637b819c5050fc8c1f1971e178;p=linux-2.6 sh: KSTK_EIP/KSTK_ESP consistency. Two of the fields in /proc/[number]/stat are documented in proc(5) as: kstkesp %lu The current value of esp (stack pointer), as found in the kernel stack page for the process. kstkeip %lu The current EIP (instruction pointer). The SH currently prints the the last SP and PC of the process inside the kernel, while most other archs use the last user space values. This patch modifes the SH to display the user space values. Signed-off-by: Stuart Menefy Signed-off-by: Paul Mundt --- diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index 4a90e7cd81..6f1dd7ca1b 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h @@ -259,8 +259,8 @@ void show_trace(struct task_struct *tsk, unsigned long *sp, struct pt_regs *regs); extern unsigned long get_wchan(struct task_struct *p); -#define KSTK_EIP(tsk) ((tsk)->thread.pc) -#define KSTK_ESP(tsk) ((tsk)->thread.sp) +#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) +#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[15]) #define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") #define cpu_relax() barrier()