This source file includes following definitions.
- poor_mans_delay
- show_value
- panic_handler
1
2
3
4
5
6 #include <linux/kernel.h>
7 #include <linux/io.h>
8 #include <cpu/registers.h>
9
10
11 #define HDSP2534_ADDR (0x04002100)
12
13 static void poor_mans_delay(void)
14 {
15 int i;
16
17 for (i = 0; i < 2500000; i++)
18 cpu_relax();
19 }
20
21 static void show_value(unsigned long x)
22 {
23 int i;
24 unsigned nibble;
25 for (i = 0; i < 8; i++) {
26 nibble = ((x >> (i * 4)) & 0xf);
27
28 __raw_writeb(nibble + ((nibble > 9) ? 55 : 48),
29 HDSP2534_ADDR + 0xe0 + ((7 - i) << 2));
30 }
31 }
32
33 void
34 panic_handler(unsigned long panicPC, unsigned long panicSSR,
35 unsigned long panicEXPEVT)
36 {
37 while (1) {
38
39 show_value(panicPC);
40 poor_mans_delay();
41 show_value(panicSSR);
42 poor_mans_delay();
43 show_value(panicEXPEVT);
44 poor_mans_delay();
45 }
46 }