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.

115 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. mpcsysint.c
  5. Abstract:
  6. This module implements the HAL routines to enable/disable system
  7. interrupts on an MPS system.
  8. Author:
  9. John Vert (jvert) 22-Jul-1991
  10. Revision History:
  11. Forrest Foltz (forrestf) 27-Oct-2000
  12. Ported from mcsysint.asm to mcsysint.c
  13. Revision History:
  14. --*/
  15. #include "halcmn.h"
  16. VOID
  17. HalEndSystemInterrupt (
  18. IN KIRQL NewIrql,
  19. IN ULONG Vector
  20. )
  21. /*++
  22. Routine Description:
  23. This routine is used to send an EOI to the local APIC.
  24. Arguments:
  25. NewIrql - the new irql to be set.
  26. Vector - Vector number of the interrupt
  27. Return Value:
  28. None.
  29. --*/
  30. {
  31. UNREFERENCED_PARAMETER(NewIrql);
  32. UNREFERENCED_PARAMETER(Vector);
  33. //
  34. // Send EOI to APIC local unit
  35. //
  36. LOCAL_APIC(LU_EOI) = 0;
  37. }
  38. BOOLEAN
  39. HalBeginSystemInterrupt (
  40. IN KIRQL Irql,
  41. IN ULONG Vector,
  42. OUT PKIRQL OldIrql
  43. )
  44. /*++
  45. Routine Description:
  46. This routine raises the IRQL to the level of the specified
  47. interrupt vector. It is called by the hardware interrupt
  48. handler before any other interrupt service routine code is
  49. executed. The CPU interrupt flag is set on exit.
  50. On APIC-based systems we do not need to check for spurious
  51. interrupts since they now have their own vector. We also
  52. no longer need to check whether or not the incoming priority
  53. is higher than the current priority that is guaranteed by
  54. the priority mechanism of the APIC.
  55. SO
  56. All BeginSystemInterrupt needs to do is set the APIC TPR
  57. appropriate for the IRQL, and return TRUE. Note that to
  58. use the APIC ISR priority we are not going issue EOI until
  59. EndSystemInterrupt is called.
  60. Arguments:
  61. Irql - Supplies the IRQL to raise to
  62. Vector - Supplies the vector of the interrupt to be
  63. handled
  64. OldIrql- Location to return OldIrql
  65. Return Value:
  66. TRUE - Interrupt successfully dismissed and Irql raised.
  67. This routine can not fail.
  68. --*/
  69. {
  70. KeRaiseIrql(Irql,OldIrql);
  71. HalpEnableInterrupts();
  72. return TRUE;
  73. }