summaryrefslogtreecommitdiff
path: root/arch/sh/include/asm/stacktrace.h
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2009-08-07 16:11:19 +0100
committerPaul Mundt <lethal@linux-sh.org>2009-08-13 11:50:08 +0900
commit4e14dfc722b8e9e07a355f97aa60a3d9f0739071 (patch)
tree0d5b9f6ecb99a050e2ddb839aead6a1d235c26cb /arch/sh/include/asm/stacktrace.h
parent922b0dc59bb43f7ff3bb8b9558ffeb3ad6af528e (diff)
sh: Use the generalized stacktrace ops
Copy the stacktrace ops code from x86 and provide a central function for use by functions that need to dump a callstack. 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/stacktrace.h')
-rw-r--r--arch/sh/include/asm/stacktrace.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/sh/include/asm/stacktrace.h b/arch/sh/include/asm/stacktrace.h
new file mode 100644
index 000000000000..797018213718
--- /dev/null
+++ b/arch/sh/include/asm/stacktrace.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009 Matt Fleming
+ *
+ * Based on:
+ * The x86 implementation - arch/x86/include/asm/stacktrace.h
+ */
+#ifndef _ASM_SH_STACKTRACE_H
+#define _ASM_SH_STACKTRACE_H
+
+/* Generic stack tracer with callbacks */
+
+struct stacktrace_ops {
+ void (*warning)(void *data, char *msg);
+ /* msg must contain %s for the symbol */
+ void (*warning_symbol)(void *data, char *msg, unsigned long symbol);
+ void (*address)(void *data, unsigned long address, int reliable);
+ /* On negative return stop dumping */
+ int (*stack)(void *data, char *name);
+};
+
+void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
+ unsigned long *stack,
+ const struct stacktrace_ops *ops, void *data);
+
+#endif /* _ASM_SH_STACKTRACE_H */