exceptions.c 897 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2008 - 2013 Tensilica Inc.
  4. * (C) Copyright 2014 - 2016 Cadence Design Systems Inc.
  5. */
  6. /*
  7. * Exception handling.
  8. * We currently don't handle any exception and force a reset.
  9. * (Note that alloca is a special case and handled in start.S)
  10. */
  11. #include <common.h>
  12. #include <command.h>
  13. #include <irq_func.h>
  14. #include <asm/ptrace.h>
  15. #include <asm/string.h>
  16. #include <asm/regs.h>
  17. typedef void (*handler_t)(struct pt_regs *);
  18. void unhandled_exception(struct pt_regs *regs)
  19. {
  20. printf("Unhandled Exception: EXCCAUSE = %ld, EXCVADDR = %lx, pc = %lx\n",
  21. regs->exccause, regs->excvaddr, regs->pc);
  22. panic("*** PANIC\n");
  23. }
  24. handler_t exc_table[EXCCAUSE_LAST] = {
  25. [0 ... EXCCAUSE_LAST-1] = unhandled_exception,
  26. };
  27. int interrupt_init(void)
  28. {
  29. return 0;
  30. }
  31. void enable_interrupts(void)
  32. {
  33. }
  34. int disable_interrupts(void)
  35. {
  36. return 0;
  37. }