exceptions.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* MN10300 Microcontroller core exceptions
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_EXCEPTIONS_H
  12. #define _ASM_EXCEPTIONS_H
  13. #include <linux/linkage.h>
  14. /*
  15. * define the breakpoint instruction opcode to use
  16. * - note that the JTAG unit steals 0xFF, so you can't use JTAG and GDBSTUB at
  17. * the same time.
  18. */
  19. #define GDBSTUB_BKPT 0xFF
  20. #ifndef __ASSEMBLY__
  21. /*
  22. * enumeration of exception codes (as extracted from TBR MSW)
  23. */
  24. enum exception_code {
  25. EXCEP_RESET = 0x000000, /* reset */
  26. /* MMU exceptions */
  27. EXCEP_ITLBMISS = 0x000100, /* instruction TLB miss */
  28. EXCEP_DTLBMISS = 0x000108, /* data TLB miss */
  29. EXCEP_IAERROR = 0x000110, /* instruction address */
  30. EXCEP_DAERROR = 0x000118, /* data address */
  31. /* system exceptions */
  32. EXCEP_TRAP = 0x000128, /* program interrupt (PI instruction) */
  33. EXCEP_ISTEP = 0x000130, /* single step */
  34. EXCEP_IBREAK = 0x000150, /* instruction breakpoint */
  35. EXCEP_OBREAK = 0x000158, /* operand breakpoint */
  36. EXCEP_PRIVINS = 0x000160, /* privileged instruction execution */
  37. EXCEP_UNIMPINS = 0x000168, /* unimplemented instruction execution */
  38. EXCEP_UNIMPEXINS = 0x000170, /* unimplemented extended instruction execution */
  39. EXCEP_MEMERR = 0x000178, /* illegal memory access */
  40. EXCEP_MISALIGN = 0x000180, /* misalignment */
  41. EXCEP_BUSERROR = 0x000188, /* bus error */
  42. EXCEP_ILLINSACC = 0x000190, /* illegal instruction access */
  43. EXCEP_ILLDATACC = 0x000198, /* illegal data access */
  44. EXCEP_IOINSACC = 0x0001a0, /* I/O space instruction access */
  45. EXCEP_PRIVINSACC = 0x0001a8, /* privileged space instruction access */
  46. EXCEP_PRIVDATACC = 0x0001b0, /* privileged space data access */
  47. EXCEP_DATINSACC = 0x0001b8, /* data space instruction access */
  48. EXCEP_DOUBLE_FAULT = 0x000200, /* double fault */
  49. /* FPU exceptions */
  50. EXCEP_FPU_DISABLED = 0x0001c0, /* FPU disabled */
  51. EXCEP_FPU_UNIMPINS = 0x0001c8, /* FPU unimplemented operation */
  52. EXCEP_FPU_OPERATION = 0x0001d0, /* FPU operation */
  53. /* interrupts */
  54. EXCEP_WDT = 0x000240, /* watchdog timer overflow */
  55. EXCEP_NMI = 0x000248, /* non-maskable interrupt */
  56. EXCEP_IRQ_LEVEL0 = 0x000280, /* level 0 maskable interrupt */
  57. EXCEP_IRQ_LEVEL1 = 0x000288, /* level 1 maskable interrupt */
  58. EXCEP_IRQ_LEVEL2 = 0x000290, /* level 2 maskable interrupt */
  59. EXCEP_IRQ_LEVEL3 = 0x000298, /* level 3 maskable interrupt */
  60. EXCEP_IRQ_LEVEL4 = 0x0002a0, /* level 4 maskable interrupt */
  61. EXCEP_IRQ_LEVEL5 = 0x0002a8, /* level 5 maskable interrupt */
  62. EXCEP_IRQ_LEVEL6 = 0x0002b0, /* level 6 maskable interrupt */
  63. /* system calls */
  64. EXCEP_SYSCALL0 = 0x000300, /* system call 0 */
  65. EXCEP_SYSCALL1 = 0x000308, /* system call 1 */
  66. EXCEP_SYSCALL2 = 0x000310, /* system call 2 */
  67. EXCEP_SYSCALL3 = 0x000318, /* system call 3 */
  68. EXCEP_SYSCALL4 = 0x000320, /* system call 4 */
  69. EXCEP_SYSCALL5 = 0x000328, /* system call 5 */
  70. EXCEP_SYSCALL6 = 0x000330, /* system call 6 */
  71. EXCEP_SYSCALL7 = 0x000338, /* system call 7 */
  72. EXCEP_SYSCALL8 = 0x000340, /* system call 8 */
  73. EXCEP_SYSCALL9 = 0x000348, /* system call 9 */
  74. EXCEP_SYSCALL10 = 0x000350, /* system call 10 */
  75. EXCEP_SYSCALL11 = 0x000358, /* system call 11 */
  76. EXCEP_SYSCALL12 = 0x000360, /* system call 12 */
  77. EXCEP_SYSCALL13 = 0x000368, /* system call 13 */
  78. EXCEP_SYSCALL14 = 0x000370, /* system call 14 */
  79. EXCEP_SYSCALL15 = 0x000378, /* system call 15 */
  80. };
  81. extern void __set_intr_stub(enum exception_code code, void *handler);
  82. extern void set_intr_stub(enum exception_code code, void *handler);
  83. struct pt_regs;
  84. extern asmlinkage void __common_exception(void);
  85. extern asmlinkage void itlb_miss(void);
  86. extern asmlinkage void dtlb_miss(void);
  87. extern asmlinkage void itlb_aerror(void);
  88. extern asmlinkage void dtlb_aerror(void);
  89. extern asmlinkage void raw_bus_error(void);
  90. extern asmlinkage void double_fault(void);
  91. extern asmlinkage int system_call(struct pt_regs *);
  92. extern asmlinkage void nmi(struct pt_regs *, enum exception_code);
  93. extern asmlinkage void uninitialised_exception(struct pt_regs *,
  94. enum exception_code);
  95. extern asmlinkage void irq_handler(void);
  96. extern asmlinkage void profile_handler(void);
  97. extern asmlinkage void nmi_handler(void);
  98. extern asmlinkage void misalignment(struct pt_regs *, enum exception_code);
  99. extern void die(const char *, struct pt_regs *, enum exception_code)
  100. __noreturn;
  101. extern int die_if_no_fixup(const char *, struct pt_regs *, enum exception_code);
  102. #define NUM2EXCEP_IRQ_LEVEL(num) (EXCEP_IRQ_LEVEL0 + (num) * 8)
  103. #endif /* __ASSEMBLY__ */
  104. #endif /* _ASM_EXCEPTIONS_H */