vectors.c 1.7 KB

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