aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/traps.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-04-21 02:35:23 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2022-05-01 19:51:22 -0700
commitfc55402b84385bdb907c24f891e3e5df464f027c (patch)
treeef690638d268883a1b63e2a5f3b8ea29264a129c /arch/xtensa/kernel/traps.c
parentxtensa: clean up function declarations in traps.c (diff)
downloadlinux-dev-fc55402b84385bdb907c24f891e3e5df464f027c.tar.xz
linux-dev-fc55402b84385bdb907c24f891e3e5df464f027c.zip
xtensa: clean up exception handler prototypes
Exception handlers are currently passed as void pointers because they may have one or two parameters. Only two handlers uses the second parameter and it is available in the struct pt_regs anyway. Make all handlers have only one parameter, introduce xtensa_exception_handler type for handlers and use it in trap_set_handler. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to '')
-rw-r--r--arch/xtensa/kernel/traps.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index b6bb5911ec7f..d6b1a0c3e319 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -170,7 +170,7 @@ __die_if_kernel(const char *str, struct pt_regs *regs, long err)
* Unhandled Exceptions. Kill user task or panic if in kernel space.
*/
-void do_unhandled(struct pt_regs *regs, unsigned long exccause)
+void do_unhandled(struct pt_regs *regs)
{
__die_if_kernel("Caught unhandled exception - should not happen",
regs, SIGKILL);
@@ -180,7 +180,7 @@ void do_unhandled(struct pt_regs *regs, unsigned long exccause)
"(pid = %d, pc = %#010lx) - should not happen\n"
"\tEXCCAUSE is %ld\n",
current->comm, task_pid_nr(current), regs->pc,
- exccause);
+ regs->exccause);
force_sig(SIGILL);
}
@@ -360,7 +360,8 @@ static void 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)
+xtensa_exception_handler *
+__init trap_set_handler(int cause, xtensa_exception_handler *handler)
{
void *previous = per_cpu(exc_table, 0).default_handler[cause];