diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:02:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:02:58 -0400 |
commit | 064e297c324fff9b62226aae5dc468ebb272433c (patch) | |
tree | 49d031d180a30d6e94e4cfdcc46ec966399d8856 /arch/blackfin/kernel/exception.c | |
parent | f13771187b9423b824f32518319f6da85d819003 (diff) | |
parent | db52ecc2953d932b2fc1c62e585231659edd1d98 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (30 commits)
Blackfin: SMP: fix continuation lines
Blackfin: acvilon: fix timeout usage for I2C
Blackfin: fix typo in BF537 IRQ comment
Blackfin: unify duplicate MEM_MT48LC32M8A2_75 kconfig options
Blackfin: set ARCH_KMALLOC_MINALIGN
Blackfin: use atomic kmalloc in L1 alloc so it too can be atomic
Blackfin: another year of changes (update copyright in boot log)
Blackfin: optimize strncpy a bit
Blackfin: isram: clean up ITEST_COMMAND macro and improve the selftests
Blackfin: move string functions to normal lib/ assembly
Blackfin: SIC: cut down on IAR MMR reads a bit
Blackfin: bf537-minotaur: fix build errors due to header changes
Blackfin: kgdb: pass up the CC register instead of a 0 stub
Blackfin: handle HW errors in the new "FAULT" printing code
Blackfin: show the whole accumulator in the pseudo DBG insn
Blackfin: support all possible registers in the pseudo instructions
Blackfin: add support for the DBG (debug output) pseudo insn
Blackfin: change the BUG opcode to an unused 16-bit opcode
Blackfin: allow NMI watchdog to be used w/RETN as a scratch reg
Blackfin: add support for the DBGA (debug assert) pseudo insn
...
Diffstat (limited to 'arch/blackfin/kernel/exception.c')
-rw-r--r-- | arch/blackfin/kernel/exception.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/exception.c b/arch/blackfin/kernel/exception.c new file mode 100644 index 000000000000..9208b5fd5186 --- /dev/null +++ b/arch/blackfin/kernel/exception.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* Basic functions for adding/removing custom exception handlers | ||
2 | * | ||
3 | * Copyright 2004-2009 Analog Devices Inc. | ||
4 | * | ||
5 | * Licensed under the GPL-2 or later | ||
6 | */ | ||
7 | |||
8 | #include <linux/module.h> | ||
9 | #include <asm/irq_handler.h> | ||
10 | |||
11 | int bfin_request_exception(unsigned int exception, void (*handler)(void)) | ||
12 | { | ||
13 | void (*curr_handler)(void); | ||
14 | |||
15 | if (exception > 0x3F) | ||
16 | return -EINVAL; | ||
17 | |||
18 | curr_handler = ex_table[exception]; | ||
19 | |||
20 | if (curr_handler != ex_replaceable) | ||
21 | return -EBUSY; | ||
22 | |||
23 | ex_table[exception] = handler; | ||
24 | |||
25 | return 0; | ||
26 | } | ||
27 | EXPORT_SYMBOL(bfin_request_exception); | ||
28 | |||
29 | int bfin_free_exception(unsigned int exception, void (*handler)(void)) | ||
30 | { | ||
31 | void (*curr_handler)(void); | ||
32 | |||
33 | if (exception > 0x3F) | ||
34 | return -EINVAL; | ||
35 | |||
36 | curr_handler = ex_table[exception]; | ||
37 | |||
38 | if (curr_handler != handler) | ||
39 | return -EBUSY; | ||
40 | |||
41 | ex_table[exception] = ex_replaceable; | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | EXPORT_SYMBOL(bfin_free_exception); | ||