From 5deb3317cb51ac52de922bb55f8492624018906d Mon Sep 17 00:00:00 2001 From: Roman Yeryomin Date: Thu, 13 Sep 2012 00:40:35 +0300 Subject: Add realtek target files Signed-off-by: Roman Yeryomin --- .../files/arch/rlx/include/asm/stacktrace.h | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 target/linux/realtek/files/arch/rlx/include/asm/stacktrace.h (limited to 'target/linux/realtek/files/arch/rlx/include/asm/stacktrace.h') diff --git a/target/linux/realtek/files/arch/rlx/include/asm/stacktrace.h b/target/linux/realtek/files/arch/rlx/include/asm/stacktrace.h new file mode 100644 index 000000000..49ecb2c0c --- /dev/null +++ b/target/linux/realtek/files/arch/rlx/include/asm/stacktrace.h @@ -0,0 +1,41 @@ +#ifndef _ASM_STACKTRACE_H +#define _ASM_STACKTRACE_H + +#include + +#ifdef CONFIG_KALLSYMS +extern int raw_show_trace; +extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, + unsigned long pc, unsigned long *ra); +#else +#define raw_show_trace 1 +static inline unsigned long unwind_stack(struct task_struct *task, + unsigned long *sp, unsigned long pc, unsigned long *ra) +{ + return 0; +} +#endif + +static __always_inline void prepare_frametrace(struct pt_regs *regs) +{ +#ifndef CONFIG_KALLSYMS + /* + * Remove any garbage that may be in regs (specially func + * addresses) to avoid show_raw_backtrace() to report them + */ + memset(regs, 0, sizeof(*regs)); +#endif + __asm__ __volatile__( + ".set push\n\t" + ".set noat\n\t" + "1: la $1, 1b\n\t" + "sw $1, %0\n\t" + "sw $29, %1\n\t" + "sw $31, %2\n\t" + ".set pop\n\t" + : "=m" (regs->cp0_epc), + "=m" (regs->regs[29]), "=m" (regs->regs[31]) + : : "memory"); +} + +#endif /* _ASM_STACKTRACE_H */ -- cgit v1.2.3