diff options
author | Mike Frysinger <michael.frysinger@analog.com> | 2007-08-05 05:14:04 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-08-05 05:14:04 -0400 |
commit | 1ffe6646babf8471714e649849ec2c9662bf410c (patch) | |
tree | cc10996b2dd08ac783a4621fffb650e23b66bb2e /arch/blackfin/kernel | |
parent | dbcc78bebe9daed8998d9f7c4e30bd3b73a4a169 (diff) |
Blackfin arch: add an exception request/free api
add an exception request/free api similar to the interrupt request/fre
api so people can utilize the free software based exceptions for their
own purposes
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/traps.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 0d2052abe41b..1a8a5f171bc8 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -51,8 +51,6 @@ void __init trap_init(void) | |||
51 | CSYNC(); | 51 | CSYNC(); |
52 | } | 52 | } |
53 | 53 | ||
54 | asmlinkage void trap_c(struct pt_regs *fp); | ||
55 | |||
56 | int kstack_depth_to_print = 48; | 54 | int kstack_depth_to_print = 48; |
57 | 55 | ||
58 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON | 56 | #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON |
@@ -693,6 +691,42 @@ asmlinkage int sys_bfin_spinlock(int *spinlock) | |||
693 | return ret; | 691 | return ret; |
694 | } | 692 | } |
695 | 693 | ||
694 | int bfin_request_exception(unsigned int exception, void (*handler)(void)) | ||
695 | { | ||
696 | void (*curr_handler)(void); | ||
697 | |||
698 | if (exception > 0x3F) | ||
699 | return -EINVAL; | ||
700 | |||
701 | curr_handler = ex_table[exception]; | ||
702 | |||
703 | if (curr_handler != ex_replaceable) | ||
704 | return -EBUSY; | ||
705 | |||
706 | ex_table[exception] = handler; | ||
707 | |||
708 | return 0; | ||
709 | } | ||
710 | EXPORT_SYMBOL(bfin_request_exception); | ||
711 | |||
712 | int bfin_free_exception(unsigned int exception, void (*handler)(void)) | ||
713 | { | ||
714 | void (*curr_handler)(void); | ||
715 | |||
716 | if (exception > 0x3F) | ||
717 | return -EINVAL; | ||
718 | |||
719 | curr_handler = ex_table[exception]; | ||
720 | |||
721 | if (curr_handler != handler) | ||
722 | return -EBUSY; | ||
723 | |||
724 | ex_table[exception] = ex_replaceable; | ||
725 | |||
726 | return 0; | ||
727 | } | ||
728 | EXPORT_SYMBOL(bfin_free_exception); | ||
729 | |||
696 | void panic_cplb_error(int cplb_panic, struct pt_regs *fp) | 730 | void panic_cplb_error(int cplb_panic, struct pt_regs *fp) |
697 | { | 731 | { |
698 | switch (cplb_panic) { | 732 | switch (cplb_panic) { |