Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / asm-sh / ptrace.h
index d0ca02c..792fc35 100644 (file)
@@ -90,6 +90,25 @@ struct pt_dspregs {
 #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
 #define instruction_pointer(regs) ((regs)->pc)
 extern void show_regs(struct pt_regs *);
+
+#ifdef CONFIG_SH_DSP
+#define task_pt_regs(task) \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
+                - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1)
+#else
+#define task_pt_regs(task) \
+       ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
+                - sizeof(unsigned long)) - 1)
+#endif
+
+static inline unsigned long profile_pc(struct pt_regs *regs)
+{
+       unsigned long pc = instruction_pointer(regs);
+
+       if (pc >= 0xa0000000UL && pc < 0xc0000000UL)
+               pc -= 0x20000000;
+       return pc;
+}
 #endif
 
 #endif /* __ASM_SH_PTRACE_H */