-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforth_ops_core_thread.h
More file actions
46 lines (42 loc) · 1.04 KB
/
Copy pathforth_ops_core_thread.h
File metadata and controls
46 lines (42 loc) · 1.04 KB
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
BUILTIN(NEW_THREAD,
{
int ds_size = (int)POP();
int rs_size = (int)POP();
void** entry = (void**)POP();
PUSH(create_thread(ds_size, rs_size, entry));
})
BUILTIN(KILL_THREAD,
{
kill_thread();
ip = current_thread->ip;
ds = current_thread->ds;
rs = current_thread->rs;
ts = current_thread->ts;
fs = current_thread->fs;
t0 = current_thread->t0;
s0 = current_thread->s0;
r0 = current_thread->r0;
f0 = current_thread->f0;
})
BUILTIN(PAUSE,
{
current_thread->ip = ip;
current_thread->ds = ds;
current_thread->rs = rs;
current_thread->ts = ts;
current_thread->fs = fs;
current_thread->t0 = t0;
current_thread->s0 = s0;
current_thread->r0 = r0;
current_thread->f0 = f0;
current_thread = current_thread->next;
ip = current_thread->ip;
ds = current_thread->ds;
rs = current_thread->rs;
ts = current_thread->ts;
fs = current_thread->fs;
t0 = current_thread->t0;
s0 = current_thread->s0;
r0 = current_thread->r0;
f0 = current_thread->f0;
})