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.

118 lines
1.5 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. KeRaiseIrql(HIGH_LEVEL, &OldLevel);
  31. Enabled = HalpDisableInterrupts();
  32. ASSERT(Enabled);
  33. KiAcquireSpinLock(Lock);
  34. return((ULONG)OldLevel);
  35. }
  36. VOID
  37. HalpReleaseHighLevelLock (
  38. PKSPIN_LOCK Lock,
  39. ULONG OldLevel
  40. )
  41. /*++
  42. Routine Description:
  43. Releases a spinlock and turns interrupts back on
  44. Arguments:
  45. Lock - Lock to release
  46. OldLevel - Context returned by HalpAcquireHighLevelLock
  47. Return Value:
  48. None
  49. --*/
  50. /*++
  51. Routine Description:
  52. Arguments:
  53. Return Value:
  54. --*/
  55. {
  56. KiReleaseSpinLock(Lock);
  57. HalpEnableInterrupts();
  58. KeLowerIrql((KIRQL)OldLevel);
  59. }
  60. VOID
  61. HalpSerialize ( )
  62. /*++
  63. Routine Description:
  64. Arguements:
  65. Return Value:
  66. --*/
  67. {
  68. return;
  69. }