;       SCCSID = @(#)demcrit.asm	6.2 92/02/06

        TITLE CRIT - Critical Section Routines

;
; Critical Section Routines
;
;   Critical section handlers
;
;   Modification history:
;
;       Created: ARR 30 March 1983
;
;   Revisions:
;
;Local  DCR/
;Tag    PTM(R)  Who     When
;               danno   14-Dec-1988
;                   Modified for MVDM
;

;

.xlist
;
; get the appropriate segment definitions
;
include v86seg.inc
.xcref
include basemaca.inc
include osmaca.inc
include oldmaca.inc
include demmac.inc
include dossymc.inc
include vector.inc
include demmult.inc
include struc30.inc
.cref
.list

V86CODE    SEGMENT
        ASSUME  CS:V86GROUP,SS:NOTHING

        ReferV86  User_In_AX,WORD
        ReferV86  CurrentPDB,WORD

Break   <Critical section handlers>

;
;   Each handler must leave everything untouched; including flags!
;
;   Sleaze for time savings:  first instruction is a return.  This is patched
;   by the sharer to be a PUSH AX to complete the correct routines.
;
Procedure   EcritDisk,NEAR
        public  EcritMem
        public  EcritSFT
ECritMEM    LABEL   NEAR
ECritSFT    LABEL   NEAR
        RET
;       PUSH    AX
;        fmt     TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect>
        MOV     AX,8000h+critDisk
        INT     int_ibm
        POP     AX
        return
EndProc EcritDisk

Procedure   LcritDisk,NEAR
        public  LcritMem
        public  LcritSFT
LCritMEM    LABEL   NEAR
LCritSFT    LABEL   NEAR
        RET
;       PUSH    AX
;        fmt     TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect>
        MOV     AX,8100h+critDisk
        INT     int_ibm
        POP     AX
        return
EndProc LcritDisk

Procedure   EcritDevice,NEAR
        RET
;       PUSH    AX
;        fmt     TypSect,LevReq,<"PDB $x entering $x">,<CurrentPDB,sect>
        MOV     AX,8000h+critDevice
        INT     int_ibm
        POP     AX
        return
EndProc EcritDevice

Procedure   LcritDevice,NEAR
        RET
;       PUSH    AX
        MOV     AX,8100h+critDevice
        INT     int_ibm
        POP     AX
        return
EndProc LcritDevice

V86CODE    ENDS
    END
