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.

88 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. intplt.c
  5. Abstract:
  6. This module implements platform specific code to support the processing
  7. of interrupts.
  8. Author:
  9. David N. Cutler (davec) 30-Aug-2000
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. --*/
  14. #include "ki.h"
  15. BOOLEAN
  16. KeSynchronizeExecution (
  17. IN PKINTERRUPT Interrupt,
  18. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  19. IN PVOID SynchronizeContext
  20. )
  21. /*++
  22. Routine Description:
  23. This function synchronizes the execution of the specified routine with
  24. the execution of the service routine associated with the specified
  25. interrupt object.
  26. Arguments:
  27. Interrupt - Supplies a pointer to an interrupt object.
  28. SynchronizeRoutine - Supplies a pointer to the function whose
  29. execution is to be synchronized with the execution of the service
  30. routine associated with the specified interrupt object.
  31. SynchronizeContext - Supplies a context pointer which is to be
  32. passed to the synchronization function as a parameter.
  33. Return Value:
  34. The value returned by the synchronization routine is returned as the
  35. function value.
  36. --*/
  37. {
  38. KIRQL OldIrql;
  39. BOOLEAN Status;
  40. //
  41. // Raise IRQL to the interrupt synchronization level and acquire the
  42. // actual interrupt spinlock.
  43. //
  44. OldIrql = KfRaiseIrql(Interrupt->SynchronizeIrql);
  45. KiAcquireSpinLock(Interrupt->ActualLock);
  46. //
  47. // Call the specfied synchronization routine.
  48. //
  49. Status = (SynchronizeRoutine)(SynchronizeContext);
  50. //
  51. // Release the spin lock, lower IRQL to its previous value, and return
  52. // the sysnchronization routine status.
  53. //
  54. KiReleaseSpinLock(Interrupt->ActualLock);
  55. KeLowerIrql(OldIrql);
  56. return Status;
  57. }