1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
; SCCSID = @(#)crit.asm 1.1 85/04/10
TITLE CRIT - Critical Section Routines
NAME CRIT
;
; Critical Section Routines
;
; Critical section handlers
;
; Modification history:
;
; Created: ARR 30 March 1983
;
.xlist
;
; get the appropriate segment definitions
;
include dosseg.asm
CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME SS:NOTHING,CS:DOSGROUP
.xcref
INCLUDE DOSSYM.INC
.cref
.list
I_need User_In_AX,WORD
i_need CurrentPDB,WORD
if debug
I_need BugLev,WORD
I_need BugTyp,WORD
include bugtyp.asm
endif
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
CODE ENDS
END
|