summaryrefslogtreecommitdiff
path: root/arch/sh/include/asm/unwinder.h
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2009-08-13 19:49:03 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-08-13 19:49:03 +0900
commitbf61ad1f870be88676a07bfef69acd59ce10172e (patch)
tree2fb8817fb76386b3d543d8d02f2cbe5877088e18 /arch/sh/include/asm/unwinder.h
parent4e14dfc722b8e9e07a355f97aa60a3d9f0739071 (diff)
sh: Allow multiple stack unwinders to be setup
Provide an interface for registering stack unwinders, where each unwinder is given a rating that describes its accuracy and complexity. The more accurate an unwinder is, the more complex it is. If a the current stack unwinder faults, then the stack unwinder with the next highest accuracy will be used in its place (provided one is available). For example, this allows unwinders, such as the DWARF unwinder, to liberally sprinkle BUG()s to catch badly formed DWARF debug info. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/unwinder.h')
-rw-r--r--arch/sh/include/asm/unwinder.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/sh/include/asm/unwinder.h b/arch/sh/include/asm/unwinder.h
new file mode 100644
index 000000000000..3dc551453e28
--- /dev/null
+++ b/arch/sh/include/asm/unwinder.h
@@ -0,0 +1,25 @@
+#ifndef _LINUX_UNWINDER_H
+#define _LINUX_UNWINDER_H
+
+#include <asm/stacktrace.h>
+
+struct unwinder {
+ const char *name;
+ struct list_head list;
+ int rating;
+ void (*dump)(struct task_struct *, struct pt_regs *,
+ unsigned long *, const struct stacktrace_ops *, void *);
+};
+
+extern int unwinder_init(void);
+extern int unwinder_register(struct unwinder *);
+
+extern void unwind_stack(struct task_struct *, struct pt_regs *,
+ unsigned long *, const struct stacktrace_ops *,
+ void *);
+
+extern void stack_reader_dump(struct task_struct *, struct pt_regs *,
+ unsigned long *, const struct stacktrace_ops *,
+ void *);
+
+#endif /* _LINUX_UNWINDER_H */