Leaked source code of windows server 2003
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.

205 lines
4.5 KiB

  1. title "Interprocessor Interrupt"
  2. ;++
  3. ;
  4. ;Copyright (c) 1991 Microsoft Corporation
  5. ;
  6. ;Module Name:
  7. ;
  8. ; ixipi.asm
  9. ;
  10. ;Abstract:
  11. ;
  12. ; Provides the HAL support for Interprocessor Interrupts.
  13. ; This is the UP version.
  14. ;
  15. ;Author:
  16. ;
  17. ; John Vert (jvert) 16-Jul-1991
  18. ;
  19. ;Revision History:
  20. ;
  21. ;--
  22. .386p
  23. .xlist
  24. include hal386.inc
  25. include callconv.inc ; calling convention macros
  26. include i386\kimacro.inc
  27. include i386\ix8259.inc
  28. EXTRNP _KiCoprocessorError,0,IMPORT
  29. EXTRNP Kei386EoiHelper,0,IMPORT
  30. EXTRNP _HalBeginSystemInterrupt,3
  31. EXTRNP _HalEndSystemInterrupt,2
  32. EXTRNP _HalpRegisterKdSupportFunctions,1
  33. extrn _HalpDefaultInterruptAffinity:DWORD
  34. extrn _HalpActiveProcessors:DWORD
  35. IFDEF NEC_98
  36. EXTRNP _HalpDetectCommonArea,0
  37. endif ; NEC_98
  38. page ,132
  39. subttl "Post InterProcessor Interrupt"
  40. INIT SEGMENT DWORD PUBLIC 'CODE'
  41. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  42. ;++
  43. ;
  44. ; VOID
  45. ; HalInitializeProcessor(
  46. ; ULONG Number
  47. ; PVOID LoaderBlock
  48. ; );
  49. ;
  50. ;Routine Description:
  51. ;
  52. ; Initialize hal pcr values for current processor (if any)
  53. ; (called shortly after processor reaches kernel, before
  54. ; HalInitSystem if P0)
  55. ;
  56. ; IPI's and KeReadir/LowerIrq's must be available once this function
  57. ; returns. (IPI's are only used once two or more processors are
  58. ; available)
  59. ;
  60. ;Arguments:
  61. ;
  62. ; Number - Logical processor number of calling processor
  63. ;
  64. ;Return Value:
  65. ;
  66. ; None.
  67. ;
  68. ;--
  69. cPublicProc _HalInitializeProcessor ,2
  70. ;
  71. ; Initialize PcIDR in PCR to enable slave IRQ
  72. ;
  73. IFDEF NEC_98
  74. mov fs:PcIDR, 0ffffff7fh
  75. stdCall _HalpDetectCommonArea
  76. else ; NEC_98
  77. mov fs:PcIDR, 0fffffffbh
  78. endif ; NEC_98
  79. mov dword ptr fs:PcStallScaleFactor, INITIAL_STALL_COUNT
  80. mov eax, dword ptr [esp+4]
  81. lock bts _HalpDefaultInterruptAffinity, eax
  82. lock bts _HalpActiveProcessors, eax
  83. ;
  84. ; This next call has nothing to do with processor init.
  85. ; But this is the only function in the HAL that gets
  86. ; called before KdInit.
  87. ;
  88. stdCall _HalpRegisterKdSupportFunctions <[esp + 8]>
  89. stdRET _HalInitializeProcessor
  90. stdENDP _HalInitializeProcessor
  91. INIT ends
  92. _TEXT$03 SEGMENT DWORD PUBLIC 'CODE'
  93. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  94. ;++
  95. ;
  96. ; VOID
  97. ; HalRequestIpi(
  98. ; IN ULONG Mask
  99. ; );
  100. ;
  101. ;Routine Description:
  102. ;
  103. ; Requests an interprocessor interrupt
  104. ;
  105. ;Arguments:
  106. ;
  107. ; Mask - Supplies a mask of the processors to interrupt
  108. ;
  109. ;Return Value:
  110. ;
  111. ; None.
  112. ;
  113. ;--
  114. cPublicProc _HalRequestIpi ,1
  115. if DBG
  116. int 3
  117. endif
  118. stdRET _HalRequestIpi
  119. stdENDP _HalRequestIpi
  120. page ,132
  121. subttl "80387 Irq13 Interrupt Handler"
  122. ;++
  123. ;
  124. ; VOID
  125. ; HalpIrq13Handler (
  126. ; );
  127. ;
  128. ; Routine Description:
  129. ;
  130. ; When the 80387 detects an error, it raises its error line. This
  131. ; was supposed to be routed directly to the 386 to cause a trap 16
  132. ; (which would actually occur when the 386 encountered the next FP
  133. ; instruction).
  134. ;
  135. ; However, the ISA design routes the error line to IRQ13 on the
  136. ; slave 8259. So an interrupt will be generated whenever the 387
  137. ; discovers an error.
  138. ;
  139. ; This routine handles that interrupt and passes control to the kernel
  140. ; coprocessor error handler.
  141. ;
  142. ; Arguments:
  143. ;
  144. ; None.
  145. ; Interrupt is disabled.
  146. ;
  147. ; Return Value:
  148. ;
  149. ; None.
  150. ;
  151. ;--
  152. ENTER_DR_ASSIST Hi13_a, Hi13_t
  153. cPublicProc _HalpIrq13Handler ,0
  154. ;
  155. ; Save machine state in trap frame
  156. ;
  157. ENTER_INTERRUPT Hi13_a, Hi13_t ; (ebp) -> Trap frame
  158. ;
  159. ; Save previous IRQL
  160. ;
  161. push 13 + PRIMARY_VECTOR_BASE ; Vector
  162. sub esp, 4 ; make space for OldIrql
  163. stdCall _HalBeginSystemInterrupt, <I386_80387_IRQL,13 + PRIMARY_VECTOR_BASE,esp>
  164. stdCall _KiCoprocessorError ; call CoprocessorError handler
  165. ;
  166. ; Clear the busy latch so that the 386 doesn't mistakenly think
  167. ; that the 387 is still busy.
  168. ;
  169. xor al,al
  170. out I386_80387_BUSY_PORT, al
  171. INTERRUPT_EXIT ; will return to caller
  172. stdENDP _HalpIrq13Handler
  173. _TEXT$03 ENDS
  174. END