macints.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. ** macints.h -- Macintosh Linux interrupt handling structs and prototypes
  3. **
  4. ** Copyright 1997 by Michael Schmitz
  5. **
  6. ** This file is subject to the terms and conditions of the GNU General Public
  7. ** License. See the file COPYING in the main directory of this archive
  8. ** for more details.
  9. **
  10. */
  11. #ifndef _ASM_MACINTS_H_
  12. #define _ASM_MACINTS_H_
  13. #include <asm/irq.h>
  14. /* Setting this prints debugging info for unclaimed interrupts */
  15. #define DEBUG_SPURIOUS
  16. /* Setting this prints debugging info on each autovector interrupt */
  17. /* #define DEBUG_IRQS */
  18. /* Setting this prints debugging info on each Nubus interrupt */
  19. /* #define DEBUG_NUBUS_INT */
  20. /* Setting this prints debugging info on irqs as they enabled and disabled. */
  21. /* #define DEBUG_IRQUSE */
  22. /*
  23. * Base IRQ number for all Mac68K interrupt sources. Each source
  24. * has eight indexes (base -> base+7).
  25. */
  26. #define VIA1_SOURCE_BASE 8
  27. #define VIA2_SOURCE_BASE 16
  28. #define PSC3_SOURCE_BASE 24
  29. #define PSC4_SOURCE_BASE 32
  30. #define PSC5_SOURCE_BASE 40
  31. #define PSC6_SOURCE_BASE 48
  32. #define NUBUS_SOURCE_BASE 56
  33. #define BABOON_SOURCE_BASE 64
  34. /*
  35. * Maximum IRQ number is BABOON_SOURCE_BASE + 7,
  36. * giving us IRQs up through 71
  37. */
  38. #define NUM_MAC_SOURCES 72
  39. /*
  40. * clean way to separate IRQ into its source and index
  41. */
  42. #define IRQ_SRC(irq) (irq >> 3)
  43. #define IRQ_IDX(irq) (irq & 7)
  44. /* VIA1 interrupts */
  45. #define IRQ_VIA1_0 (8) /* one second int. */
  46. #define IRQ_VIA1_1 (9) /* VBlank int. */
  47. #define IRQ_MAC_VBL IRQ_VIA1_1
  48. #define IRQ_VIA1_2 (10) /* ADB SR shifts complete */
  49. #define IRQ_MAC_ADB IRQ_VIA1_2
  50. #define IRQ_MAC_ADB_SR IRQ_VIA1_2
  51. #define IRQ_VIA1_3 (11) /* ADB SR CB2 ?? */
  52. #define IRQ_MAC_ADB_SD IRQ_VIA1_3
  53. #define IRQ_VIA1_4 (12) /* ADB SR ext. clock pulse */
  54. #define IRQ_MAC_ADB_CL IRQ_VIA1_4
  55. #define IRQ_VIA1_5 (13)
  56. #define IRQ_MAC_TIMER_2 IRQ_VIA1_5
  57. #define IRQ_VIA1_6 (14)
  58. #define IRQ_MAC_TIMER_1 IRQ_VIA1_6
  59. #define IRQ_VIA1_7 (15)
  60. /* VIA2/RBV interrupts */
  61. #define IRQ_VIA2_0 (16)
  62. #define IRQ_MAC_SCSIDRQ IRQ_VIA2_0
  63. #define IRQ_VIA2_1 (17)
  64. #define IRQ_MAC_NUBUS IRQ_VIA2_1
  65. #define IRQ_VIA2_2 (18)
  66. #define IRQ_VIA2_3 (19)
  67. #define IRQ_MAC_SCSI IRQ_VIA2_3
  68. #define IRQ_VIA2_4 (20)
  69. #define IRQ_VIA2_5 (21)
  70. #define IRQ_VIA2_6 (22)
  71. #define IRQ_VIA2_7 (23)
  72. /* Level 3 (PSC, AV Macs only) interrupts */
  73. #define IRQ_PSC3_0 (24)
  74. #define IRQ_MAC_MACE IRQ_PSC3_0
  75. #define IRQ_PSC3_1 (25)
  76. #define IRQ_PSC3_2 (26)
  77. #define IRQ_PSC3_3 (27)
  78. /* Level 4 (PSC, AV Macs only) interrupts */
  79. #define IRQ_PSC4_0 (32)
  80. #define IRQ_PSC4_1 (33)
  81. #define IRQ_MAC_SCC_A IRQ_PSC4_1
  82. #define IRQ_PSC4_2 (34)
  83. #define IRQ_MAC_SCC_B IRQ_PSC4_2
  84. #define IRQ_PSC4_3 (35)
  85. #define IRQ_MAC_MACE_DMA IRQ_PSC4_3
  86. /* OSS Level 4 interrupts */
  87. #define IRQ_MAC_SCC (33)
  88. /* Level 5 (PSC, AV Macs only) interrupts */
  89. #define IRQ_PSC5_0 (40)
  90. #define IRQ_PSC5_1 (41)
  91. #define IRQ_PSC5_2 (42)
  92. #define IRQ_PSC5_3 (43)
  93. /* Level 6 (PSC, AV Macs only) interrupts */
  94. #define IRQ_PSC6_0 (48)
  95. #define IRQ_PSC6_1 (49)
  96. #define IRQ_PSC6_2 (50)
  97. #define IRQ_PSC6_3 (51)
  98. /* Nubus interrupts (cascaded to VIA2) */
  99. #define IRQ_NUBUS_9 (56)
  100. #define IRQ_NUBUS_A (57)
  101. #define IRQ_NUBUS_B (58)
  102. #define IRQ_NUBUS_C (59)
  103. #define IRQ_NUBUS_D (60)
  104. #define IRQ_NUBUS_E (61)
  105. #define IRQ_NUBUS_F (62)
  106. /* Baboon interrupts (cascaded to nubus slot $C) */
  107. #define IRQ_BABOON_0 (64)
  108. #define IRQ_BABOON_1 (65)
  109. #define IRQ_BABOON_2 (66)
  110. #define IRQ_BABOON_3 (67)
  111. #define SLOT2IRQ(x) (x + 47)
  112. #define IRQ2SLOT(x) (x - 47)
  113. #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
  114. #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
  115. #endif /* asm/macints.h */