3 * David Feng <fenghua@phytium.com.cn>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/compiler.h>
10 #include <efi_loader.h>
12 DECLARE_GLOBAL_DATA_PTR;
14 int interrupt_init(void)
19 void enable_interrupts(void)
24 int disable_interrupts(void)
29 void show_regs(struct pt_regs *regs)
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);
37 printf("ELR: %lx\n", regs->elr);
38 printf("LR: %lx\n", regs->regs[30]);
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]);
47 * do_bad_sync handles the impossible case in the Synchronous Abort vector.
49 void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
52 printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
54 panic("Resetting CPU ...\n");
58 * do_bad_irq handles the impossible case in the Irq vector.
60 void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
63 printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
65 panic("Resetting CPU ...\n");
69 * do_bad_fiq handles the impossible case in the Fiq vector.
71 void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
74 printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
76 panic("Resetting CPU ...\n");
80 * do_bad_error handles the impossible case in the Error vector.
82 void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
85 printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
87 panic("Resetting CPU ...\n");
91 * do_sync handles the Synchronous Abort exception.
93 void do_sync(struct pt_regs *pt_regs, unsigned int esr)
96 printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
98 panic("Resetting CPU ...\n");
102 * do_irq handles the Irq exception.
104 void do_irq(struct pt_regs *pt_regs, unsigned int esr)
107 printf("\"Irq\" handler, esr 0x%08x\n", esr);
109 panic("Resetting CPU ...\n");
113 * do_fiq handles the Fiq exception.
115 void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
118 printf("\"Fiq\" handler, esr 0x%08x\n", esr);
120 panic("Resetting CPU ...\n");
124 * do_error handles the Error exception.
125 * Errors are more likely to be processor specific,
126 * it is defined with weak attribute and can be redefined
127 * in processor specific code.
129 void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
132 printf("\"Error\" handler, esr 0x%08x\n", esr);
134 panic("Resetting CPU ...\n");