1
2
3
4
5
6
7
8#include <common.h>
9#include <linux/compiler.h>
10#include <efi_loader.h>
11
12DECLARE_GLOBAL_DATA_PTR;
13
14int interrupt_init(void)
15{
16 return 0;
17}
18
19void enable_interrupts(void)
20{
21 return;
22}
23
24int disable_interrupts(void)
25{
26 return 0;
27}
28
29void show_regs(struct pt_regs *regs)
30{
31 int i;
32
33 if (gd->flags & GD_FLG_RELOC) {
34 printf("ELR: %lx\n", regs->elr - gd->reloc_off);
35 printf("LR: %lx\n", regs->regs[30] - gd->reloc_off);
36 } else {
37 printf("ELR: %lx\n", regs->elr);
38 printf("LR: %lx\n", regs->regs[30]);
39 }
40 for (i = 0; i < 29; i += 2)
41 printf("x%-2d: %016lx x%-2d: %016lx\n",
42 i, regs->regs[i], i+1, regs->regs[i+1]);
43 printf("\n");
44}
45
46
47
48
49void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
50{
51 efi_restore_gd();
52 printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
53 show_regs(pt_regs);
54 panic("Resetting CPU ...\n");
55}
56
57
58
59
60void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
61{
62 efi_restore_gd();
63 printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
64 show_regs(pt_regs);
65 panic("Resetting CPU ...\n");
66}
67
68
69
70
71void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
72{
73 efi_restore_gd();
74 printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
75 show_regs(pt_regs);
76 panic("Resetting CPU ...\n");
77}
78
79
80
81
82void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
83{
84 efi_restore_gd();
85 printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
86 show_regs(pt_regs);
87 panic("Resetting CPU ...\n");
88}
89
90
91
92
93void do_sync(struct pt_regs *pt_regs, unsigned int esr)
94{
95 efi_restore_gd();
96 printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
97 show_regs(pt_regs);
98 panic("Resetting CPU ...\n");
99}
100
101
102
103
104void do_irq(struct pt_regs *pt_regs, unsigned int esr)
105{
106 efi_restore_gd();
107 printf("\"Irq\" handler, esr 0x%08x\n", esr);
108 show_regs(pt_regs);
109 panic("Resetting CPU ...\n");
110}
111
112
113
114
115void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
116{
117 efi_restore_gd();
118 printf("\"Fiq\" handler, esr 0x%08x\n", esr);
119 show_regs(pt_regs);
120 panic("Resetting CPU ...\n");
121}
122
123
124
125
126
127
128
129void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
130{
131 efi_restore_gd();
132 printf("\"Error\" handler, esr 0x%08x\n", esr);
133 show_regs(pt_regs);
134 panic("Resetting CPU ...\n");
135}
136