vectors.c 1.7 KB

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