1 // SPDX-License-Identifier: GPL-2.0+
4 * David Feng <fenghua@phytium.com.cn>
8 #include <linux/compiler.h>
9 #include <efi_loader.h>
11 DECLARE_GLOBAL_DATA_PTR;
13 int interrupt_init(void)
18 void enable_interrupts(void)
23 int disable_interrupts(void)
28 void show_regs(struct pt_regs *regs)
32 if (gd->flags & GD_FLG_RELOC)
33 printf("elr: %016lx lr : %016lx (reloc)\n",
34 regs->elr - gd->reloc_off,
35 regs->regs[30] - gd->reloc_off);
36 printf("elr: %016lx lr : %016lx\n", regs->elr, regs->regs[30]);
38 for (i = 0; i < 29; i += 2)
39 printf("x%-2d: %016lx x%-2d: %016lx\n",
40 i, regs->regs[i], i+1, regs->regs[i+1]);
45 * do_bad_sync handles the impossible case in the Synchronous Abort vector.
47 void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
50 printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
52 panic("Resetting CPU ...\n");
56 * do_bad_irq handles the impossible case in the Irq vector.
58 void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
61 printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
63 panic("Resetting CPU ...\n");
67 * do_bad_fiq handles the impossible case in the Fiq vector.
69 void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
72 printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
74 panic("Resetting CPU ...\n");
78 * do_bad_error handles the impossible case in the Error vector.
80 void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
83 printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
85 panic("Resetting CPU ...\n");
89 * do_sync handles the Synchronous Abort exception.
91 void do_sync(struct pt_regs *pt_regs, unsigned int esr)
94 printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
96 panic("Resetting CPU ...\n");
100 * do_irq handles the Irq exception.
102 void do_irq(struct pt_regs *pt_regs, unsigned int esr)
105 printf("\"Irq\" handler, esr 0x%08x\n", esr);
107 panic("Resetting CPU ...\n");
111 * do_fiq handles the Fiq exception.
113 void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
116 printf("\"Fiq\" handler, esr 0x%08x\n", esr);
118 panic("Resetting CPU ...\n");
122 * do_error handles the Error exception.
123 * Errors are more likely to be processor specific,
124 * it is defined with weak attribute and can be redefined
125 * in processor specific code.
127 void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
130 printf("\"Error\" handler, esr 0x%08x\n", esr);
132 panic("Resetting CPU ...\n");