vectors.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // SPDX-License-Identifier: GPL-2.0
  2. /***************************************************************************/
  3. /*
  4. * vectors.c -- high level trap setup for ColdFire
  5. *
  6. * Copyright (C) 1999-2007, Greg Ungerer <[email protected]>
  7. */
  8. /***************************************************************************/
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/irq.h>
  12. #include <asm/traps.h>
  13. #include <asm/machdep.h>
  14. #include <asm/coldfire.h>
  15. #include <asm/mcfsim.h>
  16. #include <asm/mcfwdebug.h>
  17. /***************************************************************************/
  18. #ifdef TRAP_DBG_INTERRUPT
  19. asmlinkage void dbginterrupt_c(struct frame *fp)
  20. {
  21. extern void dump(struct pt_regs *fp);
  22. printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
  23. dump((struct pt_regs *) fp);
  24. asm("halt");
  25. }
  26. #endif
  27. /***************************************************************************/
  28. /* Assembler routines */
  29. asmlinkage void buserr(void);
  30. asmlinkage void trap(void);
  31. asmlinkage void system_call(void);
  32. asmlinkage void inthandler(void);
  33. void __init trap_init(void)
  34. {
  35. int i;
  36. /*
  37. * There is a common trap handler and common interrupt
  38. * handler that handle almost every vector. We treat
  39. * the system call and bus error special, they get their
  40. * own first level handlers.
  41. */
  42. for (i = 3; (i <= 23); i++)
  43. _ramvec[i] = trap;
  44. for (i = 33; (i <= 63); i++)
  45. _ramvec[i] = trap;
  46. for (i = 24; (i <= 31); i++)
  47. _ramvec[i] = inthandler;
  48. for (i = 64; (i < 255); i++)
  49. _ramvec[i] = inthandler;
  50. _ramvec[255] = 0;
  51. _ramvec[2] = buserr;
  52. _ramvec[32] = system_call;
  53. #ifdef TRAP_DBG_INTERRUPT
  54. _ramvec[12] = dbginterrupt;
  55. #endif
  56. }
  57. /***************************************************************************/