1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007 Michal Simek
5 * Michal SIMEK <monstr@monstr.eu>
12 void _hw_exception_handler (void)
17 /* loading address of exception EAR */
19 /* loading exception state register ESR */
21 printf("Hardware exception at 0x%x address\n", address);
24 if (CONFIG_IS_ENABLED(XILINX_MICROBLAZE0_DELAY_SLOT_EXCEP) &&
27 * For exceptions in delay slots, the return address is stored
28 * in the Branch Target Register (BTR), rather than R17.
32 puts("Exception in delay slot\n");
35 switch (state & 0x1f) { /* mask on exception cause */
37 puts("Unaligned data access exception\n");
39 printf("Unaligned %sword access\n", ((state & 0x800) ? "" : "half"));
40 printf("Unaligned %s access\n", ((state & 0x400) ? "store" : "load"));
41 printf("Register R%x\n", (state & 0x3E0) >> 5);
44 puts("Illegal op-code exception\n");
47 puts("Instruction bus error exception\n");
50 puts("Data bus error exception\n");
53 puts("Divide by zero exception\n");
56 puts("Priviledged or stack protection violation exception\n");
59 puts("Undefined cause\n");
63 printf("Return address from exception 0x%x\n", address);
67 #if CONFIG_IS_ENABLED(XILINX_MICROBLAZE0_USR_EXCEP)
68 void _exception_handler (void)
70 puts("User vector_exception\n");