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>
This commit is contained in:

committed by
Chris Zankel

parent
c622b29d1f
commit
28570e8dac
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user