1 Index: arch/blackfin/kernel/traps.c
2 ===================================================================
3 RCS file: /usr/local/src/blackfin/rsync/uclinux533/uClinux-dist/linux-2.6.x/arch/blackfin/kernel/traps.c,v
4 retrieving revision 1.60
5 diff -u -p -r1.60 traps.c
6 --- arch/blackfin/kernel/traps.c 21 Aug 2006 10:31:28 -0000 1.60
7 +++ arch/blackfin/kernel/traps.c 29 Aug 2006 22:48:11 -0000
9 * >2 for various levels of hopefully increasingly useless information
12 -#define TRAPS_DEBUG 1 /* Must be defined here or in in Makefile */
14 +# define TRAPS_DEBUG 0
17 #if (TRAPS_DEBUG > 2 )
18 -#define DPRINTK3(args...) printk(args)
19 +# define DPRINTK3(args...) printk(KERN_DEBUG args)
21 -#define DPRINTK3(args...)
22 +# define DPRINTK3(args...)
26 -#define DPRINTK2(args...) printk(args)
27 +#if (TRAPS_DEBUG > 1)
28 +# define DPRINTK2(args...) printk(KERN_DEBUG args)
30 -#define DPRINTK2(args...)
31 +# define DPRINTK2(args...)
35 -#define DPRINTK(args...) printk(args)
36 +# define DPRINTK1(args...) printk(KERN_DEBUG args)
38 -#define DPRINTK(args...)
39 +# define DPRINTK1(args...)
42 /* assembler routines */
43 @@ -145,12 +147,12 @@ asmlinkage void trap_c(struct pt_regs *f
44 fp->orig_pc = fp->retx;
46 /* send the appropriate signal to the user program */
47 - switch (fp->seqstat & 0x3f) {
48 + switch (fp->seqstat & SEQSTAT_EXCAUSE) {
50 info.si_code = TRAP_STEP;
52 /* Check if this is a single step in kernel space */
53 - if(fp->ipend & 0xffc0)
54 + if (fp->ipend & 0xffc0)
58 @@ -158,14 +160,14 @@ asmlinkage void trap_c(struct pt_regs *f
59 info.si_code = TRAP_ILLTRAP;
61 /* Check if this is a breakpoint in kernel space */
62 - if(fp->ipend & 0xffc0)
63 + if (fp->ipend & 0xffc0)
67 case VEC_EXCPT03: /* Atomic test and set service */
68 info.si_code = SEGV_STACKFLOW;
71 + printk(KERN_EMERG EXC_0x03);
73 case VEC_EXCPT04: /* Atomic test and set service */
75 @@ -173,52 +175,53 @@ asmlinkage void trap_c(struct pt_regs *f
77 info.si_code = ILL_ILLOPC;
80 + printk(KERN_EMERG EXC_0x21);
83 info.si_code = TRAP_TRACEFLOW;
86 + printk(KERN_EMERG EXC_0x11);
89 info.si_code = ILL_ILLPARAOP;
92 + printk(KERN_EMERG EXC_0x22);
95 info.si_code = ILL_PRVOPC;
98 + printk(KERN_EMERG EXC_0x2E);
101 info.si_code = BUS_ADRALN;
104 - DPRINTK("DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
105 + printk(KERN_EMERG EXC_0x24);
106 + printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
109 info.si_code = BUS_ADRALN;
112 - DPRINTK("ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
113 + printk(KERN_EMERG EXC_0x2A);
114 + printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
117 info.si_code = ILL_ILLEXCPT;
120 + printk(KERN_EMERG EXC_0x25);
123 info.si_code = TRAP_WATCHPT;
126 /* Check if this is a watchpoint in kernel space */
127 - if(fp->ipend & 0xffc0)
128 + if (fp->ipend & 0xffc0)
132 case VEC_ISTRU_VL: /* ADSP-BF535 only (MH) */
133 info.si_code = BUS_OPFETCH;
135 + printk(KERN_EMERG "BF535: VEC_ISTRU_VL\n");
139 @@ -229,8 +232,6 @@ asmlinkage void trap_c(struct pt_regs *f
140 DPRINTK3("DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
147 DPRINTK3("ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
148 @@ -244,18 +245,19 @@ asmlinkage void trap_c(struct pt_regs *f
149 case VEC_CPLB_I_MHIT:
150 info.si_code = ILL_CPLB_MULHIT;
152 - DPRINTK3(EXC_0x2D);
153 - DPRINTK3("ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
154 + printk(KERN_EMERG EXC_0x2D);
155 + printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", (void*)bfin_read_ICPLB_FAULT_ADDR());
158 info.si_code = ILL_CPLB_MULHIT;
159 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
161 + printk(KERN_EMERG "\n\nNULL pointer access (probably)\n");
164 + printk(KERN_EMERG EXC_0x27);
166 - DPRINTK3(EXC_0x27);
167 - DPRINTK3("DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
168 + printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", (void*)bfin_read_DCPLB_FAULT_ADDR());
171 info.si_code = TRAP_ILLTRAP;
172 @@ -270,6 +272,8 @@ asmlinkage void trap_c(struct pt_regs *f
174 dump_bfin_regs(fp, (void *)fp->retx);
175 show_stack(current, &stack);
176 + if (current == NULL)
177 + panic("Kernel exception");
180 trace_buffer_restore(j);
181 Index: arch/blackfin/mach-common/irqpanic.c
182 ===================================================================
183 RCS file: /usr/local/src/blackfin/rsync/uclinux533/uClinux-dist/linux-2.6.x/arch/blackfin/mach-common/irqpanic.c,v
184 retrieving revision 1.17
185 diff -u -p -r1.17 irqpanic.c
186 --- arch/blackfin/mach-common/irqpanic.c 3 Aug 2006 17:37:12 -0000 1.17
187 +++ arch/blackfin/mach-common/irqpanic.c 29 Aug 2006 20:35:23 -0000
190 #include "../oprofile/op_blackfin.h"
193 - * irq_panic - calls panic with string setup
195 #ifdef CONFIG_DEBUG_ICACHE_CHECK
196 #define L1_ICACHE_START 0xffa10000
197 #define L1_ICACHE_END 0xffa13fff
198 void irq_panic(int reason, struct pt_regs *regs) __attribute__ ((section (".text.l1")));
202 + * irq_panic - calls panic with string setup
204 asmlinkage void irq_panic(int reason, struct pt_regs *regs)
207 @@ -135,31 +135,30 @@ asmlinkage void irq_panic(int reason, st
208 printk(" stack frame=0x%04x, ", (unsigned int)(unsigned long)regs);
209 printk(" bad PC=0x%04x\n", (unsigned int)regs->pc);
212 printk("\n----------- HARDWARE ERROR -----------\n\n");
214 /* There is only need to check for Hardware Errors, since other
215 * EXCEPTIONS are handled in TRAPS.c (MH)
217 - switch (((unsigned int)regs->seqstat) >> 14) {
218 - case (0x2): /* System MMR Error */
219 + switch (regs->seqstat & SEQSTAT_HWERRCAUSE) {
220 + case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR): /* System MMR Error */
221 info.si_code = BUS_ADRALN;
225 - case (0x3): /* External Memory Addressing Error */
226 + case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR): /* External Memory Addressing Error */
227 info.si_code = BUS_ADRERR;
230 + printk(KERN_EMERG HWC_x3);
232 - case (0x12): /* Performance Monitor Overflow */
234 + case (SEQSTAT_HWERRCAUSE_PERF_FLOW): /* Performance Monitor Overflow */
235 + printk(KERN_EMERG HWC_x12);
237 - case (0x18): /* RAISE 5 instruction */
239 + case (SEQSTAT_HWERRCAUSE_RAISE_5): /* RAISE 5 instruction */
240 + printk(KERN_EMERG HWC_x18);
242 default: /* Reserved */
243 - printk(HWC_default);
244 + printk(KERN_EMERG HWC_default);
248 @@ -176,11 +175,11 @@ asmlinkage void irq_panic(int reason, st
251 #ifdef CONFIG_HARDWARE_PM
254 - * call the handler of Performance overflow
256 -asmlinkage void pm_overflow(int irq, struct pt_regs *regs){
257 - pm_overflow_handler(irq , regs);
259 + * call the handler of Performance overflow
261 +asmlinkage void pm_overflow(int irq, struct pt_regs *regs)
263 + pm_overflow_handler(irq, regs);
266 Index: include/asm-blackfin/mach-common/def_LPBlackfin.h
267 ===================================================================
268 RCS file: /usr/local/src/blackfin/rsync/uclinux533/uClinux-dist/linux-2.6.x/include/asm-blackfin/mach-common/def_LPBlackfin.h,v
269 retrieving revision 1.11
270 diff -u -p -r1.11 def_LPBlackfin.h
271 --- include/asm-blackfin/mach-common/def_LPBlackfin.h 3 Aug 2006 14:36:27 -0000 1.11
272 +++ include/asm-blackfin/mach-common/def_LPBlackfin.h 29 Aug 2006 21:18:13 -0000
273 @@ -182,29 +182,35 @@
274 #define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */
275 #define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */
276 #define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */
277 -#define SEQSTAT_HWERRCAUSE5_P 0x00000013 /* Last hw error cause bit 5 */
278 -#define SEQSTAT_HWERRCAUSE6_P 0x00000014 /* Last hw error cause bit 6 */
279 -#define SEQSTAT_HWERRCAUSE7_P 0x00000015 /* Last hw error cause bit 7 */
281 /* Exception cause */
282 -#define SEQSTAT_EXCAUSE MK_BMSK_(SEQSTAT_EXCAUSE0_P ) | \
283 - MK_BMSK_(SEQSTAT_EXCAUSE1_P ) | \
284 - MK_BMSK_(SEQSTAT_EXCAUSE2_P ) | \
285 - MK_BMSK_(SEQSTAT_EXCAUSE3_P ) | \
286 - MK_BMSK_(SEQSTAT_EXCAUSE4_P ) | \
287 - MK_BMSK_(SEQSTAT_EXCAUSE5_P ) | \
289 +#define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \
290 + MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \
291 + MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \
292 + MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \
293 + MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \
294 + MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \
297 /* Indicates whether the last reset was a software reset (=1) */
298 -#define SEQSTAT_SFTRESET MK_BMSK_(SEQSTAT_SFTRESET_P )
299 +#define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))
301 /* Last hw error cause */
302 -#define SEQSTAT_HWERRCAUSE MK_BMSK_(SEQSTAT_HWERRCAUSE0_P ) | \
303 - MK_BMSK_(SEQSTAT_HWERRCAUSE1_P ) | \
304 - MK_BMSK_(SEQSTAT_HWERRCAUSE2_P ) | \
305 - MK_BMSK_(SEQSTAT_HWERRCAUSE3_P ) | \
306 - MK_BMSK_(SEQSTAT_HWERRCAUSE4_P ) | \
308 +#define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \
309 + MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \
310 + MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \
311 + MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \
312 + MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \
315 +/* Translate bits to something useful */
317 +/* Last hw error cause */
318 +#define SEQSTAT_HWERRCAUSE_SHIFT (14)
319 +#define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)
320 +#define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)
321 +#define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)
322 +#define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)
324 /**************************************************