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.

123 lines
2.8 KiB

  1. title "Interprocessor Interrupts"
  2. ;++
  3. ;
  4. ; Copyright (c) 2000 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; intipi.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; This module implements the code necessary to process interprocessor
  13. ; interrupt requests.
  14. ;
  15. ; Author:
  16. ;
  17. ; David N. Cutler (davec) 1-Sep-2000
  18. ;
  19. ; Environment:
  20. ;
  21. ; Kernel mode only.
  22. ;
  23. ;--
  24. include ksamd64.inc
  25. extern KiFreezeTargetExecution:proc
  26. extern KiIpiProcessRequests:proc
  27. subttl "Interprocess Interrupt Service Routine"
  28. ;++
  29. ;
  30. ; VOID
  31. ; KeIpiInterrupt (
  32. ; IN PKTRAP_FRAME TrapFrame
  33. ; )
  34. ;
  35. ; Routine Description:
  36. ;
  37. ; This routine is entered as the result of an interprocessor interrupt.
  38. ; It processes all interrupt immediate and packet requests.
  39. ;
  40. ; Arguments:
  41. ;
  42. ; TrapFrame (rcx) - Supplies a pointer to a trap frame.
  43. ;
  44. ; Return Value:
  45. ;
  46. ; None.
  47. ;
  48. ;--
  49. IiFrame struct
  50. P1Home dq ? ; trap frame parameter
  51. Iiframe ends
  52. NESTED_ENTRY KeIpiInterrupt, _TEXT$00
  53. alloc_stack (sizeof IiFrame) ; allocate stack frame
  54. END_PROLOGUE
  55. mov IiFrame.P1Home[rsp], rcx ; save trap frame address
  56. ;
  57. ; Process all interprocessor requests except for freeze execution requests.
  58. ;
  59. call KiIpiProcessRequests ; process interprocessor requests
  60. and eax, IPI_FREEZE ; check if freeze execution requested
  61. jz short KiII10 ; if z, freeze execution not requested
  62. ;
  63. ; Freeze target execution.
  64. ;
  65. ; N.B. A intermediary routine is used to freeze the target execution to
  66. ; enable the construction of an exception record.
  67. ;
  68. mov rcx, IiFrame.P1Home[rsp] ; set trap frame address
  69. call KiFreezeCurrentProcessor ; freeze current processor
  70. KiII10: add rsp, sizeof IiFrame ; deallocate stack frame
  71. ret ; return
  72. NESTED_END KeIpiInterrupt, _TEXT$00
  73. subttl "Freeze Current Processor"
  74. ;++
  75. ;
  76. ; VOID
  77. ; KiFreezeCurrentProcessor (
  78. ; IN PKTRAP_FRAME TrapFrame
  79. ; )
  80. ;
  81. ; Routine Description:
  82. ;
  83. ; This routine constructs and exception frame and freezes the execution
  84. ; of the current processor.
  85. ;
  86. ; Arguments:
  87. ;
  88. ; TrapFrame (rcx) - Supplies a pointer to a trap frame.
  89. ;
  90. ; Return Value:
  91. ;
  92. ; None.
  93. ;
  94. ;--
  95. NESTED_ENTRY KiFreezeCurrentProcessor, _TEXT$00
  96. GENERATE_EXCEPTION_FRAME ; generate exception frame
  97. mov rdx, rsp ; set address of exception frame
  98. call KiFreezeTargetExecution ; freeze current processor execution
  99. RESTORE_EXCEPTION_STATE ; restore exception state/deallocate
  100. ret ; return
  101. NESTED_END KiFreezeCurrentProcessor, _TEXT$00
  102. end