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.

102 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. interobj.c
  5. Abstract:
  6. This module implements functions to acquire and release the spin lock
  7. associated with an interrupt object.
  8. Author:
  9. David N. Cutler (davec) 10-Apr-2000
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. --*/
  14. #include "ki.h"
  15. KIRQL
  16. KeAcquireInterruptSpinLock (
  17. IN PKINTERRUPT Interrupt
  18. )
  19. /*++
  20. Routine Description:
  21. This function raises the IRQL to the interrupt synchronization level
  22. and acquires the actual spin lock associated with an interrupt object.
  23. Arguments:
  24. Interrupt - Supplies a pointer to a control object of type interrupt.
  25. Return Value:
  26. The previous IRQL is returned as the function value.
  27. --*/
  28. {
  29. KIRQL OldIrql;
  30. //
  31. // Raise IRQL to interrupt synchronization level and acquire the actual
  32. // spin lock associated with the interrupt object.
  33. //
  34. KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql);
  35. KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
  36. return OldIrql;
  37. }
  38. VOID
  39. KeReleaseInterruptSpinLock (
  40. IN PKINTERRUPT Interrupt,
  41. IN KIRQL OldIrql
  42. )
  43. /*++
  44. Routine Description:
  45. This function releases the actual spin lock associated with an interrupt
  46. object and lowers the IRQL to its previous value.
  47. Arguments:
  48. Interrupt - Supplies a pointer to a control object of type interrupt.
  49. OldIrql - Supplies the previous IRQL value.
  50. Return Value:
  51. None.
  52. --*/
  53. {
  54. //
  55. // Release the actual spin lock associated with the interrupt object
  56. // and lower IRQL to its previous value.
  57. //
  58. KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
  59. KeLowerIrql(OldIrql);
  60. return;
  61. }