summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-11-19 05:30:15 +0100
committerChris Zankel <chris@zankel.net>2012-12-19 06:10:22 +0100
commit28570e8dac5c86ab10ce2a7e9c02d3aaece63760 (patch)
tree29a915825b1851c1377d88bdb008a0eb7993d78f /arch/xtensa/kernel
parentxtensa: initialize atomctl SR (diff)
downloadlinux-28570e8dac5c86ab10ce2a7e9c02d3aaece63760.tar.xz
linux-28570e8dac5c86ab10ce2a7e9c02d3aaece63760.zip
xtensa: add trap_set_handler function
trap_set_handler sets new C-handler in the exception table and returns previous handler. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/traps.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 5caf2b64d43a..691a792b01d3 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -293,6 +293,17 @@ do_debug(struct pt_regs *regs)
}
+/* Set exception C handler - for temporary use when probing exceptions */
+
+void * __init trap_set_handler(int cause, void *handler)
+{
+ unsigned long *entry = &exc_table[EXC_TABLE_DEFAULT / 4 + cause];
+ void *previous = (void *)*entry;
+ *entry = (unsigned long)handler;
+ return previous;
+}
+
+
/*
* Initialize dispatch tables.
*