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.

107 lines
2.8 KiB

  1. ;**********************************************************************
  2. ;
  3. ; SYSLEVEL.H - System Synchronization Support Include File
  4. ;
  5. ;**********************************************************************
  6. ; Author: Michael Toutonghi
  7. ;
  8. ; Copyright: 1993 Microsoft
  9. ;
  10. ; Description:
  11. ;
  12. ; This file provides the interface to the heirarchical critical
  13. ; section support for system synchronization. For further information
  14. ; see the associated .C file (for 16 bit, CRITSECT.ASM). This file
  15. ; works with both 16 and 32 bit code.
  16. ;
  17. ; Revision History:
  18. ; 2/3/92: created (miketout)
  19. ;
  20. ;**********************************************************************
  21. ; If this is defined, we will do system heirarchical level checking
  22. ifdef DEBUG
  23. SYSLEVELCHECK EQU
  24. endif
  25. ; These are the currently supported critical section levels
  26. SL_LOAD EQU 0
  27. SL_WIN16 EQU 1
  28. SL_KRN32 EQU 2
  29. SL_PRIVATE EQU 3
  30. SL_TOTAL EQU 4
  31. ; This is another duplicate definition of the LCRST structure. It must be
  32. ; kept in sync with the definitions in core\inc\object16.*, and
  33. ; core\win32\inc\object.*.
  34. ; It exists so that modules other than krnl386 and kernel32 do not have to
  35. ; include all of the various private kernel header files.
  36. IFNDEF LCRST_DEFINED
  37. LCRST STRUC
  38. crst dd 5 dup(0)
  39. IFDEF SYSLEVELCHECK
  40. slLevel dd 0
  41. ENDIF
  42. LCRST ENDS
  43. LPLCRST typedef PTR LCRST
  44. ENDIF
  45. ; if we have system level checking enabled, the macro will actually
  46. ; do a call, otherwise, it does nothing
  47. IFDEF SYSLEVELCHECK
  48. _CheckSysLevel PROTO stdcall :LPLCRST
  49. CheckSysLevel MACRO plcCrst:VARARG
  50. FOR Arg:REQ, <plcCrst>
  51. INVOKE _CheckSysLevel, Arg ;; check sys level through function
  52. ENDM
  53. ENDM
  54. ELSE
  55. CheckSysLevel MACRO plcCrst
  56. ENDM
  57. ENDIF
  58. ; if we have system level checking enabled, the macro will actually
  59. ; do a call, otherwise, it does nothing
  60. IFDEF SYSLEVELCHECK
  61. _ConfirmSysLevel PROTO stdcall :LPLCRST
  62. ConfirmSysLevel MACRO plcCrst:VARARG
  63. FOR Arg:REQ, <plcCrst>
  64. INVOKE _ConfirmSysLevel, Arg ;; confirm sys level
  65. ENDM
  66. ENDM
  67. ELSE
  68. ConfirmSysLevel MACRO plcCrst
  69. ENDM
  70. ENDIF
  71. ; We can have a macro with the same name as the prototype since
  72. ; MASM will munge the function name to be different than the macro
  73. _InitSysLevel PROTO stdcall :LPLCRST, :DWORD
  74. InitSysLevel MACRO plcCrst, Level
  75. INVOKE _InitSysLevel, plcCrst, Level ;; init critical section
  76. ENDM
  77. _EnterSysLevel PROTO stdcall :LPLCRST
  78. EnterSysLevel MACRO plcCrst:VARARG
  79. FOR Arg:REQ, <plcCrst>
  80. INVOKE _EnterSysLevel, Arg ;; enter critical section
  81. ENDM
  82. ENDM
  83. _LeaveSysLevel PROTO stdcall :LPLCRST
  84. LeaveSysLevel MACRO plcCrst:VARARG
  85. FOR Arg:REQ, <plcCrst>
  86. INVOKE _LeaveSysLevel, Arg ;; leave critical section
  87. ENDM
  88. ENDM
  89. _EnterMustComplete PROTO KERNENTRY
  90. EnterMustComplete MACRO
  91. INVOKE _EnterMustComplete
  92. ENDM
  93. _LeaveMustComplete PROTO KERNENTRY
  94. LeaveMustComplete MACRO
  95. INVOKE _LeaveMustComplete
  96. ENDM