Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
4.5 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. jxsysint.c
  5. Abstract:
  6. This module implements the HAL enable/disable system interrupt, and
  7. request interprocessor interrupt routines for a MIPS R3000 or R4000
  8. Jazz system.
  9. Author:
  10. David N. Cutler (davec) 6-May-1991
  11. Environment:
  12. Kernel mode
  13. Revision History:
  14. --*/
  15. #include "halp.h"
  16. //
  17. // Define reference to the builtin device interrupt enables.
  18. //
  19. extern USHORT HalpBuiltinInterruptEnable;
  20. VOID
  21. HalDisableSystemInterrupt (
  22. IN ULONG Vector,
  23. IN KIRQL Irql
  24. )
  25. /*++
  26. Routine Description:
  27. This routine disables the specified system interrupt.
  28. Arguments:
  29. Vector - Supplies the vector of the system interrupt that is disabled.
  30. Irql - Supplies the IRQL of the interrupting source.
  31. Return Value:
  32. None.
  33. --*/
  34. {
  35. KIRQL OldIrql;
  36. //
  37. // Raise IRQL to the highest level.
  38. //
  39. KeRaiseIrql(HIGH_LEVEL, &OldIrql);
  40. //
  41. // If the vector number is within the range of the EISA interrupts, then
  42. // disable the EISA interrrupt.
  43. //
  44. if (Vector >= EISA_VECTORS &&
  45. Vector < EISA_VECTORS + MAXIMUM_EISA_VECTOR &&
  46. Irql == EISA_DEVICE_LEVEL) {
  47. HalpDisableEisaInterrupt(Vector);
  48. }
  49. //
  50. // Lower IRQL to the previous level.
  51. //
  52. KeLowerIrql(OldIrql);
  53. return;
  54. }
  55. BOOLEAN
  56. HalEnableSystemInterrupt (
  57. IN ULONG Vector,
  58. IN KIRQL Irql,
  59. IN KINTERRUPT_MODE InterruptMode
  60. )
  61. /*++
  62. Routine Description:
  63. This routine enables the specified system interrupt.
  64. Arguments:
  65. Vector - Supplies the vector of the system interrupt that is enabled.
  66. Irql - Supplies the IRQL of the interrupting source.
  67. InterruptMode - Supplies the mode of the interrupt; LevelSensitive or
  68. Latched.
  69. Return Value:
  70. TRUE if the system interrupt was enabled
  71. --*/
  72. {
  73. KIRQL OldIrql;
  74. //
  75. // Raise IRQL to the highest level.
  76. //
  77. KeRaiseIrql(HIGH_LEVEL, &OldIrql);
  78. //
  79. // If the vector number is within the range of the EISA interrupts, then
  80. // enable the EISA interrrupt and set the Level/Edge register.
  81. //
  82. if (Vector >= EISA_VECTORS &&
  83. Vector < EISA_VECTORS + MAXIMUM_EISA_VECTOR &&
  84. Irql == EISA_DEVICE_LEVEL) {
  85. HalpEnableEisaInterrupt( Vector, InterruptMode);
  86. }
  87. //
  88. // Lower IRQL to the previous level.
  89. //
  90. KeLowerIrql(OldIrql);
  91. return TRUE;
  92. }
  93. ULONG
  94. HalGetInterruptVector(
  95. IN INTERFACE_TYPE InterfaceType,
  96. IN ULONG BusNumber,
  97. IN ULONG BusInterruptLevel,
  98. IN ULONG BusInterruptVector,
  99. OUT PKIRQL Irql,
  100. OUT PKAFFINITY Affinity
  101. )
  102. /*++
  103. Routine Description:
  104. This functionr returns the system interrupt vector and IRQL level
  105. corresponding to the specified bus interrupt level and/or vector. The
  106. system interrupt vector and IRQL are suitable for use in a subsequent call
  107. to KeInitializeInterrupt.
  108. Arguments:
  109. InterfaceType - Supplies the type of bus which the vector is for.
  110. BusNumber - Supplies the bus number for the device.
  111. BusInterruptLevel - Supplies the bus specific interrupt level.
  112. BusInterruptVector - Supplies the bus specific interrupt vector.
  113. Irql - Returns the system request priority.
  114. Affinity - Returns the affinity for the requested vector
  115. Return Value:
  116. Returns the system interrupt vector corresponding to the specified device.
  117. --*/
  118. {
  119. *Affinity = 1;
  120. //
  121. // The BusLogic 445 VESA SCSI Host Adapter will not work unless an InterfaceType of
  122. // Eisa is also allowed here.
  123. //
  124. //
  125. // if (InterfaceType != Isa) {
  126. //
  127. if (InterfaceType != Isa && InterfaceType != Eisa) {
  128. //
  129. // Not on this system return nothing.
  130. //
  131. *Affinity = 0;
  132. *Irql = 0;
  133. return(0);
  134. }
  135. //
  136. // Jazz only has one I/O bus which is an EISA, so the bus number and the
  137. // bus interrupt vector are unused.
  138. //
  139. // The IRQL level is always equal to the EISA level.
  140. //
  141. *Irql = EISA_DEVICE_LEVEL;
  142. //
  143. // Bus interrupt level 2 is actually mapped to bus level 9 in the Eisa
  144. // hardware.
  145. //
  146. if (BusInterruptLevel == 2) {
  147. BusInterruptLevel = 9;
  148. }
  149. //
  150. // The vector is equal to the specified bus level plus the EISA_VECTOR.
  151. //
  152. return(BusInterruptLevel + EISA_VECTORS);
  153. }
  154. VOID
  155. HalRequestIpi (
  156. IN ULONG Mask
  157. )
  158. /*++
  159. Routine Description:
  160. This routine requests an interprocessor interrupt on a set of processors.
  161. Arguments:
  162. Mask - Supplies the set of processors that are sent an interprocessor
  163. interrupt.
  164. Return Value:
  165. None.
  166. --*/
  167. {
  168. return;
  169. }