1 Index: include/asm-blackfin/irq_handler.h
2 ===================================================================
3 --- include/asm-blackfin/irq_handler.h (revision 3496)
4 +++ include/asm-blackfin/irq_handler.h (working copy)
6 asmlinkage void evt_soft_int1(void);
7 asmlinkage void evt_system_call(void);
8 asmlinkage void init_exception_buff(void);
9 +asmlinkage void trap_c(struct pt_regs *fp);
10 +asmlinkage void ex_replaceable(void);
12 +extern void *ex_table[];
13 +extern void return_from_exception(void);
15 +extern int bfin_request_exception(unsigned int exception, void (*handler)(void));
16 +extern int bfin_free_exception(unsigned int exception, void (*handler)(void));
19 Index: arch/blackfin/kernel/traps.c
20 ===================================================================
21 --- arch/blackfin/kernel/traps.c (revision 3496)
22 +++ arch/blackfin/kernel/traps.c (working copy)
27 -asmlinkage void trap_c(struct pt_regs *fp);
29 int kstack_depth_to_print = 48;
31 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
35 #ifdef CONFIG_SYS_BFIN_SPINLOCK_L1
36 -asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text));
37 +__attribute__((l1_text))
40 asmlinkage int sys_bfin_spinlock(int *spinlock)
47 +int bfin_request_exception(unsigned int exception, void (*handler)(void))
49 + void (*curr_handler)(void);
51 + if (exception > 0x3F)
54 + curr_handler = ex_table[exception];
56 + if (curr_handler != ex_replaceable)
59 + ex_table[exception] = handler;
63 +EXPORT_SYMBOL(bfin_request_exception);
65 +int bfin_free_exception(unsigned int exception, void (*handler)(void))
67 + void (*curr_handler)(void);
69 + if (exception > 0x3F)
72 + curr_handler = ex_table[exception];
74 + if (curr_handler != handler)
77 + ex_table[exception] = ex_replaceable;
81 +EXPORT_SYMBOL(bfin_free_exception);
83 void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
86 Index: arch/blackfin/mach-common/entry.S
87 ===================================================================
88 --- arch/blackfin/mach-common/entry.S (revision 3496)
89 +++ arch/blackfin/mach-common/entry.S (working copy)
92 if !cc jump _ex_trap_c;
94 -_return_from_exception:
95 +ENTRY(_return_from_exception)
96 DEBUG_START_HWTRACE(p5, r7)
101 [--sp] = (R7:6, P5:4);
103 +ENTRY(_ex_replaceable)
107 /* Call C code (trap_c) to handle the exception, which most
108 * likely involves sending a signal to the current process.
110 r6.l = lo(SEQSTAT_EXCAUSE);
111 r6.h = hi(SEQSTAT_EXCAUSE);
120 @@ -810,28 +813,27 @@
127 /* entry for each EXCAUSE[5:0]
128 * This table must be in sync with the table in ./kernel/traps.c
129 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
131 - .long _ex_syscall; /* 0x00 - User Defined - Linux Syscall */
132 + .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
133 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
134 - .long _ex_trap_c /* 0x02 - User Defined */
135 + .long _ex_replaceable /* 0x02 - User Defined */
136 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
137 - .long _ex_trap_c /* 0x04 - User Defined */
138 - .long _ex_trap_c /* 0x05 - User Defined */
139 - .long _ex_trap_c /* 0x06 - User Defined */
140 - .long _ex_trap_c /* 0x07 - User Defined */
141 - .long _ex_trap_c /* 0x08 - User Defined */
142 - .long _ex_trap_c /* 0x09 - User Defined */
143 - .long _ex_trap_c /* 0x0A - User Defined */
144 - .long _ex_trap_c /* 0x0B - User Defined */
145 - .long _ex_trap_c /* 0x0C - User Defined */
146 - .long _ex_trap_c /* 0x0D - User Defined */
147 - .long _ex_trap_c /* 0x0E - User Defined */
148 - .long _ex_trap_c /* 0x0F - User Defined */
149 + .long _ex_replaceable /* 0x04 - User Defined */
150 + .long _ex_replaceable /* 0x05 - User Defined */
151 + .long _ex_replaceable /* 0x06 - User Defined */
152 + .long _ex_replaceable /* 0x07 - User Defined */
153 + .long _ex_replaceable /* 0x08 - User Defined */
154 + .long _ex_replaceable /* 0x09 - User Defined */
155 + .long _ex_replaceable /* 0x0A - User Defined */
156 + .long _ex_replaceable /* 0x0B - User Defined */
157 + .long _ex_replaceable /* 0x0C - User Defined */
158 + .long _ex_replaceable /* 0x0D - User Defined */
159 + .long _ex_replaceable /* 0x0E - User Defined */
160 + .long _ex_replaceable /* 0x0F - User Defined */
161 .long _ex_single_step /* 0x10 - HW Single step */
162 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
163 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
165 .long _ex_trap_c /* 0x3D - Reserved */
166 .long _ex_trap_c /* 0x3E - Reserved */
167 .long _ex_trap_c /* 0x3F - Reserved */
171 ENTRY(_sys_call_table)
172 .long _sys_ni_syscall /* 0 - old "setup()" system call*/