-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.cpp
102 lines (71 loc) · 1.1 KB
/
event.cpp
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
93
94
95
96
97
98
99
100
101
102
/*
* event.cpp
*
* Created on: Aug 24, 2018
* Author: OS1
*/
#include "event.h"
#include "dos.h"
#include "System.h"
Event::Event(IVTNo ivtno) {
System::softLock();
EventConsArgs *args = new EventConsArgs(ivtno,this);
System::softUnlock();
#ifndef BCC_BLOCK_IGNORE
unsigned argsSeg = FP_SEG(args);
unsigned argsOff = FP_OFF(args);
asm {
push dx
push ax
push bx
mov dx, 000bh
mov ax, argsSeg
mov bx, argsOff
int 61h
pop bx
pop ax
pop dx
}
#endif
System::softLock();
delete args;
System::softUnlock();
}
Event::~Event(){
#ifndef BCC_BLOCK_IGNORE
asm {
push dx
mov dx, 000eh
int 61h
pop dx
}
#endif
}
void Event::wait() {
unsigned id = myKernelEvID;
#ifndef BCC_BLOCK_IGNORE
asm {
push dx
push cx
mov dx, 000ch
mov cx, id
int 61h
pop cx
pop dx
}
#endif
}
void Event::signal() {
unsigned id = myKernelEvID;
#ifndef BCC_BLOCK_IGNORE
asm {
push dx
push cx
mov dx, 000dh
mov cx, id
int 61h
pop cx
pop dx
}
#endif
}