exceptions.c 854 B

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