mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 13:43:55 +08:00
2a12c4632d
The current kernel/traps.c file has grown a bit unwieldy as more debugging functionality has been added over time, so split it up into more logical files. There should be no functional changes here, just minor whitespace tweaking. This should make future extensions easier to manage. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
46 lines
859 B
C
46 lines
859 B
C
/* Basic functions for adding/removing custom exception handlers
|
|
*
|
|
* Copyright 2004-2009 Analog Devices Inc.
|
|
*
|
|
* Licensed under the GPL-2 or later
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <asm/irq_handler.h>
|
|
|
|
int bfin_request_exception(unsigned int exception, void (*handler)(void))
|
|
{
|
|
void (*curr_handler)(void);
|
|
|
|
if (exception > 0x3F)
|
|
return -EINVAL;
|
|
|
|
curr_handler = ex_table[exception];
|
|
|
|
if (curr_handler != ex_replaceable)
|
|
return -EBUSY;
|
|
|
|
ex_table[exception] = handler;
|
|
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL(bfin_request_exception);
|
|
|
|
int bfin_free_exception(unsigned int exception, void (*handler)(void))
|
|
{
|
|
void (*curr_handler)(void);
|
|
|
|
if (exception > 0x3F)
|
|
return -EINVAL;
|
|
|
|
curr_handler = ex_table[exception];
|
|
|
|
if (curr_handler != handler)
|
|
return -EBUSY;
|
|
|
|
ex_table[exception] = ex_replaceable;
|
|
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL(bfin_free_exception);
|