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.

121 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. mpswint.c
  5. Abstract:
  6. This module implements the software interrupt handlers
  7. for x86 machines
  8. Author:
  9. John Vert (jvert) 2-Jan-1992
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. Forrest Foltz (forrestf) 23-Oct-2000
  14. Ported from ixswint.asm to ixswint.c
  15. --*/
  16. #include "halcmn.h"
  17. //
  18. // Array used to look up the correct ICR command based on the requested
  19. // software interrupt
  20. //
  21. const
  22. ULONG
  23. HalpIcrCommandArray[3] = {
  24. 0,
  25. APC_VECTOR | DELIVER_FIXED | ICR_SELF, // APC_LEVEL
  26. DPC_VECTOR | DELIVER_FIXED | ICR_SELF // DISPATCH_LEVEL
  27. };
  28. C_ASSERT(APC_LEVEL == 1);
  29. C_ASSERT(DISPATCH_LEVEL == 2);
  30. VOID
  31. FASTCALL
  32. HalRequestSoftwareInterrupt (
  33. IN KIRQL RequestIrql
  34. )
  35. /*++
  36. Routine Description:
  37. This routine is used to request a software interrupt of
  38. the system.
  39. Arguments:
  40. RequestIrql - Supplies the request IRQL value
  41. Return Value:
  42. None.
  43. --*/
  44. {
  45. ULONG icrCommand;
  46. ULONG flags;
  47. ASSERT(RequestIrql == APC_LEVEL || RequestIrql == DISPATCH_LEVEL);
  48. icrCommand = HalpIcrCommandArray[RequestIrql];
  49. flags = HalpDisableInterrupts();
  50. HalpStallWhileApicBusy();
  51. LOCAL_APIC(LU_INT_CMD_LOW) = icrCommand;
  52. HalpStallWhileApicBusy();
  53. HalpRestoreInterrupts(flags);
  54. }
  55. VOID
  56. HalClearSoftwareInterrupt (
  57. IN KIRQL RequestIrql
  58. )
  59. /*++
  60. Routine Description:
  61. This routine is used to clear a possible pending software interrupt.
  62. Support for this function is optional, and allows the kernel to
  63. reduce the number of spurious software interrupts it receives/
  64. Arguments:
  65. RequestIrql - Supplies the request IRQL value
  66. Return Value:
  67. None.
  68. --*/
  69. {
  70. }