3 * David Feng <fenghua@phytium.com.cn>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/compiler.h>
12 int interrupt_init(void)
17 void enable_interrupts(void)
22 int disable_interrupts(void)
27 void show_regs(struct pt_regs *regs)
31 printf("ELR: %lx\n", regs->elr);
32 printf("LR: %lx\n", regs->regs[30]);
33 for (i = 0; i < 29; i += 2)
34 printf("x%-2d: %016lx x%-2d: %016lx\n",
35 i, regs->regs[i], i+1, regs->regs[i+1]);
40 * do_bad_sync handles the impossible case in the Synchronous Abort vector.
42 void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
44 printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
46 panic("Resetting CPU ...\n");
50 * do_bad_irq handles the impossible case in the Irq vector.
52 void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
54 printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
56 panic("Resetting CPU ...\n");
60 * do_bad_fiq handles the impossible case in the Fiq vector.
62 void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
64 printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
66 panic("Resetting CPU ...\n");
70 * do_bad_error handles the impossible case in the Error vector.
72 void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
74 printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
76 panic("Resetting CPU ...\n");
80 * do_sync handles the Synchronous Abort exception.
82 void do_sync(struct pt_regs *pt_regs, unsigned int esr)
84 printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
86 panic("Resetting CPU ...\n");
90 * do_irq handles the Irq exception.
92 void do_irq(struct pt_regs *pt_regs, unsigned int esr)
94 printf("\"Irq\" handler, esr 0x%08x\n", esr);
96 panic("Resetting CPU ...\n");
100 * do_fiq handles the Fiq exception.
102 void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
104 printf("\"Fiq\" handler, esr 0x%08x\n", esr);
106 panic("Resetting CPU ...\n");
110 * do_error handles the Error exception.
111 * Errors are more likely to be processor specific,
112 * it is defined with weak attribute and can be redefined
113 * in processor specific code.
115 void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
117 printf("\"Error\" handler, esr 0x%08x\n", esr);
119 panic("Resetting CPU ...\n");