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.

115 lines
1.3 KiB

  1. /*++
  2. Module Name:
  3. i64lock.c copied from ixlock.asm
  4. Abstract:
  5. This module contains the lock routines.
  6. Author:
  7. Bernard Lint, M. Jayakumar
  8. Revision History:
  9. Bernard Lint 6-Jun-1995: IA64 version based on MIPS version.
  10. Todd Kjos 1-Jun-1998: Added versions of HighLevelLock services.
  11. --*/
  12. #include "halp.h"
  13. ULONG
  14. HalpAcquireHighLevelLock (
  15. PKSPIN_LOCK Lock
  16. )
  17. /*++
  18. Routine Description:
  19. Turns off interrupts and acquires a spinlock. Note: Interrupts MUST
  20. be enabled on entry.
  21. Arguments:
  22. Lock to acquire
  23. Return Value:
  24. Previous IRQL
  25. --*/
  26. {
  27. BOOLEAN Enabled;
  28. KIRQL OldLevel;
  29. ASSERT(sizeof(ULONG) >= sizeof(KIRQL));
  30. Enabled = HalpDisableInterrupts();
  31. ASSERT(Enabled);
  32. KeAcquireSpinLock(Lock,&OldLevel);
  33. return((ULONG)OldLevel);
  34. }
  35. VOID
  36. HalpReleaseHighLevelLock (
  37. PKSPIN_LOCK Lock,
  38. ULONG OldLevel
  39. )
  40. /*++
  41. Routine Description:
  42. Releases a spinlock and turns interrupts back on
  43. Arguments:
  44. Lock - Lock to release
  45. OldLevel - Context returned by HalpAcquireHighLevelLock
  46. Return Value:
  47. None
  48. --*/
  49. /*++
  50. Routine Description:
  51. Arguments:
  52. Return Value:
  53. --*/
  54. {
  55. KeReleaseSpinLock(Lock,(KIRQL)OldLevel);
  56. HalpEnableInterrupts();
  57. }
  58. VOID
  59. HalpSerialize ( )
  60. /*++
  61. Routine Description:
  62. Arguements:
  63. Return Value:
  64. --*/
  65. {
  66. return;
  67. }