exceptions.c 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <asm/string.h>
  14. #include <asm/regs.h>
  15. typedef void (*handler_t)(struct pt_regs *);
  16. void unhandled_exception(struct pt_regs *regs)
  17. {
  18. printf("Unhandled Exception: EXCCAUSE = %ld, EXCVADDR = %lx, pc = %lx\n",
  19. regs->exccause, regs->excvaddr, regs->pc);
  20. panic("*** PANIC\n");
  21. }
  22. handler_t exc_table[EXCCAUSE_LAST] = {
  23. [0 ... EXCCAUSE_LAST-1] = unhandled_exception,
  24. };
  25. int interrupt_init(void)
  26. {
  27. return 0;
  28. }
  29. void enable_interrupts(void)
  30. {
  31. }
  32. int disable_interrupts(void)
  33. {
  34. return 0;
  35. }