2 * (C) Copyright 2007 Michal Simek
4 * Michal SIMEK <monstr@monstr.eu>
6 * SPDX-License-Identifier: GPL-2.0+
12 void _hw_exception_handler (void)
17 /* loading address of exception EAR */
19 /* loading excetpion state register ESR */
21 printf("Hardware exception at 0x%x address\n", address);
23 printf("Return address from exception 0x%x\n", address);
24 switch (state & 0x1f) { /* mask on exception cause */
26 puts("Unaligned data access exception\n");
29 puts("Illegal op-code exception\n");
32 puts("Instruction bus error exception\n");
35 puts("Data bus error exception\n");
38 puts("Divide by zero exception\n");
42 puts("Priviledged or stack protection violation exception\n");
45 puts("Exception in delay slot\n");
49 puts("Undefined cause\n");
52 printf("Unaligned %sword access\n", ((state & 0x800) ? "" : "half"));
53 printf("Unaligned %s access\n", ((state & 0x400) ? "store" : "load"));
54 printf("Register R%x\n", (state & 0x3E) >> 5);
58 #ifdef CONFIG_SYS_USR_EXCEP
59 void _exception_handler (void)
61 puts("User vector_exception\n");