Source code of Windows XP (NT5)
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.

756 lines
20 KiB

  1. title "Interprocessor Interrupt"
  2. ;++
  3. ;
  4. ;Copyright (c) 1991 Microsoft Corporation
  5. ;
  6. ;Module Name:
  7. ;
  8. ; spipi.asm
  9. ;
  10. ;Abstract:
  11. ;
  12. ; SystemPro IPI code.
  13. ; Provides the HAL support for Interprocessor Interrupts for hte
  14. ; MP SystemPro implementation.
  15. ;
  16. ;Author:
  17. ;
  18. ; Ken Reneris (kenr) 13-Jan-1992
  19. ;
  20. ;Revision History:
  21. ;
  22. ;--
  23. .386p
  24. ; .xlist
  25. ;
  26. ; Include SystemPro detection code
  27. ;
  28. include i386\spdetect.asm
  29. ;
  30. ; Normal includes
  31. ;
  32. include hal386.inc
  33. include i386\kimacro.inc
  34. include i386\ix8259.inc
  35. include callconv.inc ; calling convention macros
  36. EXTRNP _KiCoprocessorError,0,IMPORT
  37. EXTRNP Kei386EoiHelper,0,IMPORT
  38. EXTRNP _KeRaiseIrql,2
  39. EXTRNP _HalBeginSystemInterrupt,3
  40. EXTRNP _HalEndSystemInterrupt,2
  41. EXTRNP _KiIpiServiceRoutine,2,IMPORT
  42. EXTRNP _HalEnableSystemInterrupt,3
  43. EXTRNP _HalpInitializePICs,1
  44. EXTRNP _HalDisplayString,1
  45. EXTRNP _HalEnableSystemInterrupt,3
  46. EXTRNP _HalDisableSystemInterrupt,2
  47. EXTRNP _HalpAcerInitializeCache,0
  48. extrn _HalpDefaultInterruptAffinity:DWORD
  49. extrn _HalpActiveProcessors:DWORD
  50. extrn _HalpCpuCount:DWORD
  51. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  52. public _HalpFindFirstSetRight
  53. _HalpFindFirstSetRight db 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
  54. _TEXT ends
  55. _DATA SEGMENT DWORD PUBLIC 'DATA'
  56. public _Sp8259PerProcessorMode
  57. _Sp8259PerProcessorMode db 0
  58. align 4
  59. public _HalpProcessorPCR
  60. _HalpProcessorPCR dd MAXIMUM_PROCESSORS dup (?) ; PCR pointer for each processor
  61. _DATA ends
  62. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  63. _HalpPINTAddrTable label word
  64. dw SMP_MPINT0
  65. dw SMP_MPINT1
  66. dw SMP_MPINT3
  67. dw SMP_MPINT4
  68. dw SMP_MPINT5
  69. dw SMP_MPINT6
  70. dw SMP_MPINT7
  71. dw SMP_MPINT8
  72. dw SMP_MPINT9
  73. dw SMP_MPINT10
  74. dw SMP_MPINT11
  75. dw SMP_MPINT12
  76. dw SMP_MPINT13
  77. dw SMP_MPINT14
  78. dw SMP_MPINT15
  79. HALPPINTADDRTABLESIZE equ ($-_HalpPINTAddrTable)/TYPE(_HalpPINTAddrTable)
  80. BadHalString db 'HAL: SystemPro HAL.DLL cannot be run on non SystemPro'
  81. db '/compatible', cr,lf
  82. db ' Replace the hal.dll with the correct hal', cr, lf
  83. db ' System is HALTING *********', 0
  84. _TEXT ends
  85. page ,132
  86. subttl "Post InterProcessor Interrupt"
  87. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  88. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  89. ;++
  90. ;
  91. ; VOID
  92. ; HalInitializeProcessor(
  93. ; ULONG Number
  94. ; );
  95. ;
  96. ;Routine Description:
  97. ;
  98. ; Initialize hal pcr values for current processor (if any)
  99. ; (called shortly after processor reaches kernel, before
  100. ; HalInitSystem if P0)
  101. ;
  102. ; IPI's and KeReadir/LowerIrq's must be available once this function
  103. ; returns. (IPI's are only used once two or more processors are
  104. ; available)
  105. ;
  106. ; . Enable IPI interrupt (makes sense for P1, P2, ...).
  107. ; . Save Processor Number in PCR.
  108. ; . if (P0)
  109. ; . determine what kind of system is it,
  110. ; . if (NotSysProCompatible) Halt;
  111. ; . program VECTOR_PORT to accept IPI at IRQ13.
  112. ; . InitializePICs.
  113. ; . if (P1)
  114. ; . Save ProcesserControlPort (PCR) to PCRegion, per processor.
  115. ; . Enable PINTs on CPU.
  116. ;
  117. ;Arguments:
  118. ;
  119. ; Number - Logical processor number of calling processor
  120. ;
  121. ;Return Value:
  122. ;
  123. ; None.
  124. ;
  125. ;--
  126. cPublicProc _HalInitializeProcessor ,2
  127. ;
  128. ; Initialize various PCR values
  129. ; PcIDR in PCR - enable slave IRQ
  130. ; PcStallScaleFactor - bogusly large value for now
  131. ; PcHal.PcrNumber - logical processor #
  132. ; PcHal.PcrPic - Set if processor has it's own pics.
  133. ; The SystemPro only defines one pic set on P0, but some clones
  134. ; put more pics on each other processor. This isn't vastly
  135. ; better, but it is better then processor. This isn't vastly 'em
  136. ; PcHal.PcrIpiType - Address to jmp to once ipi is verified.
  137. ; This is done to optimize how to deal with a varity of 'work-
  138. ; arounds' due to non-smp nature of SP clones
  139. ;
  140. cli
  141. mov fs:PcIDR, 0fffffffbh
  142. movzx eax, byte ptr [esp+4]
  143. mov fs:PcHal.PcrNumber, al ; Save processor # in PCR
  144. lock bts _HalpActiveProcessors, eax
  145. lock inc _HalpCpuCount
  146. mov dword ptr fs:PcStallScaleFactor, INITIAL_STALL_COUNT
  147. mov dword ptr fs:PcHal.PcrPerfSkew, 0
  148. mov fs:PcHal.PcrIpiSecondLevelDispatch, offset _HalpNo2ndDispatch
  149. ;
  150. ; Initialize IDT vector for IPI interrupts
  151. ; KiSetHandlerAddressToIDT(I386_80387_VECTOR, HalpIrq13Handler);
  152. ;
  153. mov ebx, fs:PcIDT
  154. lea ecx, _HalpIrq13Handler
  155. add ebx, (PRIMARY_VECTOR_BASE + 13) * 8
  156. mov word ptr [ebx+0], cx
  157. shr ecx, 16
  158. mov word ptr [ebx+6], cx
  159. ;
  160. ; Save away flat address of our PCR - (used in emulating clock ticks
  161. ; on systempro p1 which doesn't have it's own clock tick)
  162. ;
  163. mov ecx, fs:PcSelfPcr ; Flat address of this PCR
  164. mov _HalpProcessorPCR[eax*4], ecx ; Save it away
  165. or eax, eax
  166. jnz ipi_10 ; If !p0 then ipi_10
  167. mov fs:PcHal.PcrPic, 1 ; P0 has a pic
  168. mov fs:PcHal.PcrIpiType, offset P0Ipi
  169. ; Run on P0 only
  170. sub esp, 4
  171. stdCall _DetectSystemPro,<esp> ; Which type of SystemPro
  172. add esp,4
  173. or eax, eax
  174. jz NotSystemPro
  175. lock or _HalpDefaultInterruptAffinity, 1
  176. cmp _SpType, SMP_SYSPRO2 ; Belize SystemPro?
  177. je short ipi_belize
  178. ;
  179. ; Set all processors IPI to irq13
  180. ;
  181. mov al, PRIMARY_VECTOR_BASE + 13
  182. mov dx, 0FC68h ; Set SystemPro P1 Interrupt
  183. out dx, al ; Vector to irq13
  184. cmp _SpType, SMP_ACER ; Acer? Then set other acer
  185. jne short ipi_notacer ; processor ports as well
  186. mov dx, 0C028h
  187. out dx, al ; set P2 Interrupt Vector
  188. mov dx, 0C02Ch
  189. out dx, al ; set P3 Interrupt Vector
  190. stdCall _HalpAcerInitializeCache
  191. mov dx, 0C06h ; Check for ASMP or SMP mode
  192. in al, dx
  193. test al, 10h ; SMP mode bit set?
  194. jz short @f ; No, then ASMP mode
  195. cmp al, 0ffh ; Ambra doesn't implement
  196. je short @f ; this port...
  197. mov _Sp8259PerProcessorMode, SP_M8259 ; Set to use multiple pic
  198. @@: jmp short ipi_05 ; implementation
  199. ipi_belize:
  200. ;
  201. ; Machine is Belize SystemPro
  202. ; Set for multiple 8259s, statically distribute device interrupts, and
  203. ; use symmetric clock interrupt.
  204. ;
  205. mov _Sp8259PerProcessorMode, SP_M8259 + SP_SMPDEVINTS + SP_SMPCLOCK
  206. stdCall HalpInitializeBelizeIC
  207. ipi_notacer:
  208. ipi_05:
  209. ; enable IPI vector
  210. stdCall _HalEnableSystemInterrupt,<PRIMARY_VECTOR_BASE+13,IPI_LEVEL,0>
  211. ; Other P0 initialization would go here
  212. jmp short ipi_30
  213. ipi_10:
  214. mov fs:PcHal.PcrIpiType, offset IpiWithNoPic ; default it
  215. test _Sp8259PerProcessorMode, SP_M8259 ; 8259 on this processor?
  216. jz short ipi_20
  217. ;
  218. ; SP machine is set for SMP mode - which has 2 8259s per processor
  219. ;
  220. mov fs:PcHal.PcrPic, 1 ; Set to use pic on this proc
  221. cmp _SpType, SMP_ACER
  222. jne short ipi_notacer2
  223. ;
  224. ; Machine is in ACER "SMP" mode - well, this fine SMP mode happens
  225. ; to have an asymmetric clock interrupt, so we need to emulate non-
  226. ; P0 clock interrupts to it just like we do on the standard SystemPro
  227. ;
  228. mov fs:PcHal.PcrIpiType, offset IpiWithPicButNoClock
  229. stdCall _HalpInitializePICs, <1> ; Init this processors PICs
  230. ipi_notacer2:
  231. cmp _SpType, SMP_SYSPRO2
  232. jne short ipi_notbelize2
  233. ;
  234. ; Machine is Belize SystemPro
  235. ;
  236. stdCall HalpInitializeBelizeIC
  237. ipi_notbelize2:
  238. ;
  239. ; Enable IPI vector for non-P0 cpu
  240. ;
  241. stdCall _HalEnableSystemInterrupt,<PRIMARY_VECTOR_BASE+13, IPI_LEVEL,0>
  242. ipi_20:
  243. ; Specific non-P0 initialization would go here
  244. ipi_30:
  245. movzx eax, byte ptr [esp+4] ; cpu number
  246. mov dx, _SpProcessorControlPort[eax*2] ; Port value for this processor
  247. mov fs:PcHal.PcrControlPort, dx ; Save port value
  248. mov fs:PcHal.PcrIpiClockTick, 0 ; Set to not signaled
  249. cmp _SpType, SMP_SYSPRO2
  250. je short @f
  251. in al, dx ; remove disabled & signaled
  252. and al, not (INTDIS or PINT) ; bits
  253. out dx, al
  254. @@:
  255. stdRET _HalInitializeProcessor
  256. NotSystemPro:
  257. ; on a non system pro. Display message and HALT system.
  258. stdCall _HalDisplayString, <offset BadHalString>
  259. hlt
  260. stdENDP _HalInitializeProcessor
  261. ;++
  262. ;
  263. ; VOID
  264. ; HalpInitializeBelizeIC(
  265. ; VOID
  266. ; );
  267. ;
  268. ;Routine Description:
  269. ;
  270. ; Initialize interrupt control for the Belize SystemPro
  271. ;
  272. ;Return Value:
  273. ;
  274. ; None.
  275. ;
  276. ;--
  277. cPublicProc HalpInitializeBelizeIC, 0
  278. push ebx
  279. ;
  280. ; Belize IPIs go to Belize Irq13 handler
  281. ;
  282. mov ebx, fs:PcIDT
  283. lea ecx, _HalpBelizeIrq13Handler
  284. add ebx, (PRIMARY_VECTOR_BASE + 13) * 8
  285. mov word ptr [ebx+0], cx
  286. shr ecx, 16
  287. mov word ptr [ebx+6], cx
  288. ;
  289. ; Disable irq13 sources
  290. ;
  291. mov dx, SMP_MPINT13PORT
  292. mov al, (SMP_DSBL_NCPERR + SMP_DSBL_DMACHAIN + SMP_DSBL_MCERR)
  293. out dx, al
  294. ;
  295. ; Disable ipi ports
  296. ;
  297. mov ecx, HALPPINTADDRTABLESIZE
  298. xor ebx, ebx
  299. mov al, SMP_INTx_DISABLE
  300. @@:
  301. mov dx, _HalpPINTAddrTable[ ebx ]
  302. out dx, al
  303. add ebx, 2
  304. loopnz short @b
  305. stdCall _HalpInitializePICs, <1> ; Init this processors PICs
  306. ;
  307. ; Enable PINT
  308. ;
  309. mov dx, SMP_IPI_MPINTx_PORT
  310. mov al, SMP_INTx_ENABLE + SMP_INTx_CLR_PINT
  311. out dx, al
  312. pop ebx
  313. stdRet HalpInitializeBelizeIC
  314. stdENDP HalpInitializeBelizeIC
  315. ;++
  316. ;
  317. ; VOID
  318. ; HalRequestIpi(
  319. ; IN ULONG Mask
  320. ; );
  321. ;
  322. ;Routine Description:
  323. ;
  324. ; Requests an interprocessor interrupt
  325. ;
  326. ;Arguments:
  327. ;
  328. ; Mask - Supplies a mask of the processors to be interrupted
  329. ;
  330. ;Return Value:
  331. ;
  332. ; None.
  333. ;
  334. ;--
  335. cPublicProc _HalRequestIpi ,1
  336. cmp _SpType, SMP_SYSPRO2
  337. jne short ripi_10
  338. mov eax, dword ptr [esp+4] ; (eax) = Processor bitmask
  339. if DBG
  340. or eax, eax ; must ipi somebody
  341. jz short ipibad
  342. movzx ecx, byte ptr fs:PcHal.PcrNumber
  343. bt eax, ecx ; cannot ipi yourself
  344. jc short ipibad
  345. endif
  346. mov dx, SMP_IPI_MASKPORT
  347. or eax, (SMP_IPI_VECTOR shl 24)
  348. out dx, eax
  349. stdRET _HalRequestIpi
  350. ALIGN 4
  351. ripi_10:
  352. mov ecx, dword ptr [esp+4] ; (ecx) = Processor bitmask
  353. if DBG
  354. or ecx, ecx ; must ipi somebody
  355. jz short ipibad
  356. movzx eax, byte ptr fs:PcHal.PcrNumber
  357. bt ecx, eax ; cannot ipi yourself
  358. jc short ipibad
  359. endif
  360. @@:
  361. movzx eax, _HalpFindFirstSetRight[ecx] ; lookup first processor to ipi
  362. btr ecx, eax
  363. mov dx, _SpProcessorControlPort[eax*2]
  364. in al, dx ; (al) = original content of PCP
  365. or al, PINT ; generate Ipi on target
  366. out dx, al
  367. or ecx, ecx ; ipi any other processors?
  368. jnz @b ; yes, loop
  369. stdRET _HalRequestIpi
  370. if DBG
  371. ipibad: int 3
  372. stdRET _HalRequestIpi
  373. endif
  374. stdENDP _HalRequestIpi
  375. page ,132
  376. subttl "SystemPro Irq13 Interrupt Handler"
  377. ;++
  378. ;
  379. ; VOID
  380. ; HalpIrq13Handler (
  381. ; );
  382. ;
  383. ; Routine Description:
  384. ;
  385. ; This routine is entered as the result of an interrupt generated by inter
  386. ; processor communication or coprocessor error.
  387. ; Its function is to determine the sources of the interrupts and to
  388. ; call its handler.
  389. ;
  390. ; If the interrupt is determined to be generated by coprocessor error,
  391. ; this routine will lower irql to its original level, and finally invoke
  392. ; coprocessor error handler. By doing this, the coprocessor
  393. ; error will be handled at Irql 0 as it should be.
  394. ;
  395. ; N.B. This routine is specific to Compaq SystemPro. On SystemPro, the
  396. ; IRQ13 of P0 is also used by DMA buffer chaining interrupt. Currently,
  397. ; NO NT driver uses the DMA buffer chaining capability. For now, this
  398. ; routine simply ignores it.
  399. ;
  400. ; Arguments:
  401. ;
  402. ; None.
  403. ; Interrupt is dismissed
  404. ;
  405. ; Return Value:
  406. ;
  407. ; None.
  408. ;
  409. ;--
  410. ENTER_DR_ASSIST Hi13_a, Hi13_t
  411. cPublicProc _HalpIrq13Handler ,0
  412. ;
  413. ; Save machine state in trap frame
  414. ;
  415. ENTER_INTERRUPT Hi13_a, Hi13_t ; (ebp) -> Trap frame
  416. ;
  417. ; Save previous IRQL
  418. ;
  419. push 13 + PRIMARY_VECTOR_BASE ; Vector
  420. sub esp, 4 ; space for OldIrql
  421. ;
  422. ; Dismiss interrupt.
  423. ;
  424. mov dx, fs:PcHal.PcrControlPort
  425. in al, dx
  426. test al, PINT
  427. jz Hi100 ; if not a PINT, then go Hi100
  428. ;
  429. ; The interrupt has been identified to be Inter-Processor Interrupt
  430. ; We now dismiss the interprocessor interrupt and call its handler
  431. ;
  432. and al, not (PINT or INTDIS)
  433. out dx, al ; clear PINT
  434. jmp fs:[PcHal.PcrIpiType] ; Go handle ipi accordingly
  435. align 4
  436. IpiWithNoPic:
  437. ;
  438. ; This processor doesn't have a PIC
  439. ;
  440. cmp byte ptr fs:PcIrql, IPI_LEVEL ; is preview IRQL level
  441. jnc short Ksi20 ; >= IPI_LEVEL?
  442. ; WARNING: Some SystemPro's actually don't complete the OUT to the
  443. ; ProcessorControlRegister by the return of the OUT instruction. This
  444. ; code path can do a 'sti' before the pending interrupt bit is cleared
  445. ; on these machines. To get around this problem we do an IN from the
  446. ; ProcessorControlPort again which will cause the last OUT to complete
  447. ; before the IN can.
  448. in al, dx
  449. stdCall _KeRaiseIrql, <IPI_LEVEL,esp>
  450. ;
  451. ; It also doesn't have it's own clock interrupt, see if clock interrupt
  452. ; emulation is requested - if so raise a software interrupt to go emulate
  453. ; it when we reach a lower IRQL
  454. ;
  455. cmp fs:PcHal.PcrIpiClockTick, 0 ; Emulate ClockTick?
  456. jz short Ksi30 ; No, just go service ipi
  457. mov fs:PcHal.PcrIpiClockTick, 0 ; yes, reset trigger
  458. or dword ptr fs:PcIRR, SWClockTick ; Set SW ClockTick bit
  459. jmp short Ksi30 ; go process ipi
  460. Ksi20:
  461. ;
  462. ; This processor is >= IPI_LEVEL, this IPI should not be here.
  463. ;
  464. in al, dx
  465. or al, PINT ; re-post this IPI
  466. out dx, al
  467. ; clear IF bit in return EFLAGS
  468. add esp, 8
  469. and dword ptr [esp].TsEflags, NOT 200h
  470. SPURIOUS_INTERRUPT_EXIT
  471. align 4
  472. IpiWithPicButNoClock:
  473. cmp fs:PcHal.PcrIpiClockTick, 0 ; Emulate ClockTick?
  474. jz short SymmetricIpi
  475. mov fs:PcHal.PcrIpiClockTick, 0
  476. or dword ptr fs:PcIRR, SWClockTick ; Set SW ClockTick bit
  477. align 4
  478. P0Ipi:
  479. SymmetricIpi:
  480. stdCall _HalBeginSystemInterrupt,<IPI_LEVEL,13 + PRIMARY_VECTOR_BASE,esp>
  481. ; or eax, eax NOTNOW: To add lazy irql support, this
  482. ; jz short KsiSpuripus needs to be added - and IpiWithNoPic
  483. ; would need fixed as well
  484. Ksi30:
  485. ; Pass Null ExceptionFrame
  486. ; Pass TrapFrame to Ipi service rtn
  487. stdCall _KiIpiServiceRoutine, <ebp,0>
  488. Hi90: call fs:[PcHal.PcrIpiSecondLevelDispatch]
  489. ;
  490. ; Do interrupt exit processing
  491. ;
  492. INTERRUPT_EXIT ; will return to caller
  493. Hi100:
  494. mov esi, eax ; save control register
  495. mov edi, edx ; save control port
  496. cmp byte ptr fs:PcHal.PcrPic, 0 ; A pic on this processor?
  497. je short Hi120
  498. stdCall _HalBeginSystemInterrupt, <IPI_LEVEL,13 + PRIMARY_VECTOR_BASE,esp>
  499. jmp short Hi130
  500. Hi120:
  501. stdCall _KeRaiseIrql, <IPI_LEVEL,esp>
  502. Hi130:
  503. test esi, ERR387 ; Interrupt from 387?
  504. jz short Hi90 ; No, then unkown exit
  505. xor al,al
  506. out I386_80387_BUSY_PORT, al
  507. mov eax, esi
  508. and eax, NOT ERR387
  509. mov edx, edi
  510. out dx, al ; clear ERR387
  511. mov eax, PCR[PcPrcb]
  512. cmp byte ptr [eax].PbCpuType, 4 ; Is this a 386?
  513. jc short Hi40 ; Yes, then don't check CR0_NE
  514. mov eax, cr0 ; Is CR0_NE set? If so, then
  515. test eax, CR0_NE ; we shouldn't be getting NPX
  516. jnz short Hi50 ; interrupts.
  517. Hi40:
  518. stdCall _KiCoprocessorError ; call CoprocessorError handler
  519. Hi50:
  520. ;
  521. ; We did an out to the ProcessorControl port which might have cleared a
  522. ; pending interrupt (PINT) bit. Go process ipi handler just in case.
  523. ;
  524. jmp Ksi30
  525. stdENDP _HalpIrq13Handler
  526. ;++
  527. ;
  528. ; VOID
  529. ; HalpBelizeIrq13Handler (
  530. ; );
  531. ;
  532. ; Routine Description:
  533. ;
  534. ; Same as HalpIrql13Handler, expect specific to the Belize SyetemPro
  535. ;
  536. ; Arguments:
  537. ;
  538. ; None.
  539. ; Interrupt is dismissed
  540. ;
  541. ; Return Value:
  542. ;
  543. ; None.
  544. ;
  545. ;--
  546. ENTER_DR_ASSIST Hib13_a, Hib13_t
  547. cPublicProc _HalpBelizeIrq13Handler ,0
  548. ENTER_INTERRUPT Hib13_a, Hib13_t ; (ebp) -> Trap frame
  549. push 13 + PRIMARY_VECTOR_BASE ; Vector
  550. sub esp, 4 ; space for OldIrql
  551. stdCall _HalBeginSystemInterrupt,<IPI_LEVEL,13 + PRIMARY_VECTOR_BASE,esp>
  552. mov dx, SMP_IPI_MPINTx_PORT
  553. in al, dx ; read clears pending int
  554. stdCall _KiIpiServiceRoutine, <ebp,0>
  555. call fs:[PcHal.PcrIpiSecondLevelDispatch]
  556. ;
  557. ; Do interrupt exit processing
  558. ;
  559. INTERRUPT_EXIT ; will return to caller
  560. stdENDP _HalpBelizeIrq13Handler
  561. ;++
  562. ;
  563. ; VOID
  564. ; HalpNoSecondDispatch (
  565. ; VOID
  566. ; )
  567. ;
  568. ; Routine Description:
  569. ;
  570. ; Does nothing
  571. ;--
  572. cPublicProc _HalpNo2ndDispatch,0
  573. stdRET _HalpNo2ndDispatch
  574. stdENDP _HalpNo2ndDispatch
  575. ;++
  576. ;
  577. ; ULONG
  578. ; FASTCALL
  579. ; HalSystemVectorDispatchEntry (
  580. ; IN ULONG Vector,
  581. ; OUT PKINTERRUPT_ROUTINE **FlatDispatch,
  582. ; OUT PKINTERRUPT_ROUTINE *NoConnection
  583. ; )
  584. ;
  585. ; Routine Description:
  586. ;
  587. ; If TRUE, returns dispatch address for vector; otherwise, IDT dispatch is
  588. ; assumed
  589. ;
  590. ; Arguments:
  591. ;
  592. ; Vector - System Vector to get dispatch address of
  593. ; FlatDispatch - Returned dispatched address for system vector
  594. ; NoConnection - Returned "no connection" dispatch value for system vector
  595. ;
  596. ;--
  597. cPublicFastCall HalSystemVectorDispatchEntry,3
  598. xor eax, eax ; reutrn FALSE
  599. cmp ecx, PRIMARY_VECTOR_BASE + SECOND_IPI_DISPATCH
  600. jne short hsvexit
  601. inc eax ; return TRUE
  602. mov ecx, PCR[PcSelfPcr] ; return FlatDispatch
  603. add ecx, PcHal.PcrIpiSecondLevelDispatch
  604. mov [edx], ecx
  605. mov ecx, [esp+4] ; return NoConnection
  606. mov [ecx], offset _HalpNo2ndDispatch
  607. hsvexit:
  608. fstRET HalSystemVectorDispatchEntry
  609. fstENDP HalSystemVectorDispatchEntry
  610. _TEXT ENDS
  611. END