forked from urbit/vere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.h
201 lines (163 loc) · 4.73 KB
/
manage.h
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/// @file
#ifndef U3_MANAGE_H
#define U3_MANAGE_H
#include "v1/manage.h"
#include "v2/manage.h"
#include "c3.h"
#include "types.h"
#include "version.h"
/** System management.
**/
/* u3m_boot(): start the u3 system. return next event, starting from 1.
*/
c3_d
u3m_boot(c3_c* dir_c, size_t len_i);
/* u3m_pier(): make a pier.
*/
c3_c*
u3m_pier(c3_c* dir_c);
/* u3m_boot_lite(): start without checkpointing.
*/
c3_d
u3m_boot_lite(size_t len_i);
/* u3m_stop(): graceful shutdown cleanup. */
void
u3m_stop(void);
/* u3m_bail(): bail out. Does not return.
**
** Bail motes:
**
** %exit :: semantic failure
** %evil :: bad crypto
** %intr :: interrupt
** %fail :: execution failure
** %foul :: assert failure
** %need :: network block
** %meme :: out of memory
** %time :: timed out
** %oops :: assertion failure
*/
c3_i
u3m_bail(c3_m how_m) __attribute__((noreturn));
/* u3m_fault(): handle a memory event with libsigsegv protocol.
*/
c3_i
u3m_fault(void* adr_v, c3_i ser_i);
/* u3m_foul(): dirty all pages and disable tracking.
*/
void
u3m_foul(void);
/* u3m_backup(): copy snapshot to .urb/bhk (if it doesn't exist yet).
*/
c3_o
u3m_backup(c3_o);
/* u3m_save(): update the checkpoint.
*/
void
u3m_save(void);
/* u3m_toss(): discard ephemeral memory.
*/
void
u3m_toss(void);
/* u3m_ward(): tend the guardpage.
*/
void
u3m_ward(void);
/* u3m_init(): start the environment.
*/
void
u3m_init(size_t len_i);
/* u3m_pave(): instantiate or activate image.
*/
void
u3m_pave(c3_o nuu_o);
/* u3m_signal(): treat a nock-level exception as a signal interrupt.
*/
void
u3m_signal(u3_noun sig_l);
/* u3m_file(): load file, as atom, or bail.
*/
u3_noun
u3m_file(c3_c* pas_c);
/* u3m_error(): bail out with %exit, ct_pushing error.
*/
c3_i
u3m_error(c3_c* str_c);
/* u3m_hate(): new, integrated leap mechanism (enter).
*/
void
u3m_hate(c3_w pad_w);
/* u3m_love(): return product from leap.
*/
u3_noun
u3m_love(u3_noun pro);
/* u3m_soft(): system soft wrapper. unifies unix and nock errors.
**
** Produces [%$ result] or [%error (list tank)].
*/
u3_noun
u3m_soft(c3_w mil_w, u3_funk fun_f, u3_noun arg);
/* u3m_soft_slam: top-level call.
*/
u3_noun
u3m_soft_slam(u3_noun gat, u3_noun sam);
/* u3m_soft_nock: top-level nock.
*/
u3_noun
u3m_soft_nock(u3_noun bus, u3_noun fol);
/* u3m_soft_sure(): top-level call assumed correct.
*/
u3_noun
u3m_soft_sure(u3_funk fun_f, u3_noun arg);
/* u3m_soft_run(): descend into virtualization context.
*/
u3_noun
u3m_soft_run(u3_noun gul,
u3_funq fun_f,
u3_noun aga,
u3_noun agb);
/* u3m_soft_esc(): namespace lookup to (unit ,*).
*/
u3_noun
u3m_soft_esc(u3_noun ref, u3_noun sam);
/* u3m_mark(): mark all nouns in the road.
*/
c3_w
u3m_mark(FILE* fil_u);
/* u3m_grab(): garbage-collect the world, plus extra roots.
*/
void
u3m_grab(u3_noun som, ...); // terminate with u3_none
/* u3m_water(): produce high and low watermarks. Asserts u3R == u3H.
*/
void
u3m_water(u3_post* low_p, u3_post* hig_p);
/* u3m_pretty(): dumb prettyprint to string. RETAIN.
*/
c3_c*
u3m_pretty(u3_noun som);
/* u3m_pretty_path(): prettyprint a path to string. RETAIN.
*/
c3_c*
u3m_pretty_path(u3_noun som);
/* u3m_p(): dumb print with caption. RETAIN.
*/
void
u3m_p(const c3_c* cap_c, u3_noun som);
/* u3m_tape(): dump a tape to stdout.
*/
void
u3m_tape(u3_noun tep);
/* u3m_wall(): dump a wall to stdout.
*/
void
u3m_wall(u3_noun wol);
/* u3m_reclaim: clear persistent caches to reclaim memory.
*/
void
u3m_reclaim(void);
/* u3m_pack: compact (defragment) memory, returns u3a_open delta.
*/
c3_w
u3m_pack(void);
#endif /* ifndef U3_MANAGE_H */