2 |
- |
1 |
#define ROUND(s, sz) (((s)+((sz)-1))&~((sz)-1))
|
|
|
2 |
|
|
|
3 |
void accounttime(void);
|
|
|
4 |
void addclock0link(void (*)(void), int);
|
|
|
5 |
int addphysseg(Physseg*);
|
|
|
6 |
void addbootfile(char*, uchar*, ulong);
|
|
|
7 |
Block* adjustblock(Block*, int);
|
|
|
8 |
void alarmkproc(void*);
|
|
|
9 |
Block* allocb(int);
|
|
|
10 |
int anyhigher(void);
|
|
|
11 |
int anyready(void);
|
|
|
12 |
Page* auxpage(void);
|
|
|
13 |
Block* bl2mem(uchar*, Block*, int);
|
|
|
14 |
int blocklen(Block*);
|
|
|
15 |
void callwithureg(void(*)(Ureg*));
|
|
|
16 |
char* c2name(Chan*);
|
|
|
17 |
int cangetc(void*);
|
|
|
18 |
int canlock(Lock*);
|
|
|
19 |
int canpage(Proc*);
|
|
|
20 |
int canputc(void*);
|
|
|
21 |
int canqlock(QLock*);
|
|
|
22 |
int canrlock(RWlock*);
|
|
|
23 |
void chandevinit(void);
|
|
|
24 |
void chandevreset(void);
|
|
|
25 |
void chandevshutdown(void);
|
|
|
26 |
void chanfree(Chan*);
|
|
|
27 |
void chanrec(Mnt*);
|
|
|
28 |
void checkalarms(void);
|
|
|
29 |
void checkb(Block*, char*);
|
|
|
30 |
void cinit(void);
|
|
|
31 |
Chan* cclone(Chan*);
|
|
|
32 |
void cclose(Chan*);
|
|
|
33 |
char* clipread(void);
|
|
|
34 |
int clipwrite(char*);
|
|
|
35 |
void closeegrp(Egrp*);
|
|
|
36 |
void closefgrp(Fgrp*);
|
|
|
37 |
void closemount(Mount*);
|
|
|
38 |
void closepgrp(Pgrp*);
|
|
|
39 |
void closergrp(Rgrp*);
|
|
|
40 |
long clrfpintr(void);
|
|
|
41 |
void cmderror(Cmdbuf*, char*);
|
|
|
42 |
int cmount(Chan**, Chan*, int, char*);
|
|
|
43 |
void cnameclose(Cname*);
|
|
|
44 |
void confinit(void);
|
|
|
45 |
void confinit1(int);
|
|
|
46 |
int consactive(void);
|
|
|
47 |
extern void (*consdebug)(void);
|
|
|
48 |
void copen(Chan*);
|
|
|
49 |
Block* concatblock(Block*);
|
|
|
50 |
Block* copyblock(Block*, int);
|
|
|
51 |
void copypage(Page*, Page*);
|
|
|
52 |
int cread(Chan*, uchar*, int, vlong);
|
|
|
53 |
void cunmount(Chan*, Chan*);
|
|
|
54 |
void cupdate(Chan*, uchar*, int, vlong);
|
|
|
55 |
void cwrite(Chan*, uchar*, int, vlong);
|
|
|
56 |
ulong dbgpc(Proc*);
|
|
|
57 |
int decref(Ref*);
|
|
|
58 |
int decrypt(void*, void*, int);
|
|
|
59 |
void delay(int);
|
|
|
60 |
Chan* devattach(int, char*);
|
|
|
61 |
Block* devbread(Chan*, long, ulong);
|
|
|
62 |
long devbwrite(Chan*, Block*, ulong);
|
|
|
63 |
Chan* devclone(Chan*);
|
|
|
64 |
int devconfig(int, char *, DevConf *);
|
|
|
65 |
void devcreate(Chan*, char*, int, ulong);
|
|
|
66 |
void devdir(Chan*, Qid, char*, vlong, char*, long, Dir*);
|
|
|
67 |
long devdirread(Chan*, char*, long, Dirtab*, int, Devgen*);
|
|
|
68 |
Devgen devgen;
|
|
|
69 |
void devinit(void);
|
|
|
70 |
int devno(int, int);
|
|
|
71 |
Chan* devopen(Chan*, int, Dirtab*, int, Devgen*);
|
|
|
72 |
void devpermcheck(char*, ulong, int);
|
|
|
73 |
void devpower(int);
|
|
|
74 |
void devremove(Chan*);
|
|
|
75 |
void devreset(void);
|
|
|
76 |
void devshutdown(void);
|
|
|
77 |
int devstat(Chan*, uchar*, int, Dirtab*, int, Devgen*);
|
|
|
78 |
Walkqid* devwalk(Chan*, Chan*, char**, int, Dirtab*, int, Devgen*);
|
|
|
79 |
int devwstat(Chan*, uchar*, int);
|
|
|
80 |
void drawactive(int);
|
|
|
81 |
void drawcmap(void);
|
|
|
82 |
int drawcanqlock(void);
|
|
|
83 |
void drawqlock(void);
|
|
|
84 |
void drawqunlock(void);
|
|
|
85 |
void dumpaproc(Proc*);
|
|
|
86 |
void dumpqueues(void);
|
|
|
87 |
void dumpregs(Ureg*);
|
|
|
88 |
void dumpstack(void);
|
|
|
89 |
Fgrp* dupfgrp(Fgrp*);
|
|
|
90 |
void duppage(Page*);
|
|
|
91 |
void dupswap(Page*);
|
|
|
92 |
int emptystr(char*);
|
|
|
93 |
int encrypt(void*, void*, int);
|
|
|
94 |
void envcpy(Egrp*, Egrp*);
|
|
|
95 |
int eqchan(Chan*, Chan*, int);
|
|
|
96 |
int eqqid(Qid, Qid);
|
|
|
97 |
void error(char*);
|
|
|
98 |
long execregs(ulong, ulong, ulong);
|
|
|
99 |
void exhausted(char*);
|
|
|
100 |
void exit(int);
|
|
|
101 |
uvlong fastticks(uvlong*);
|
|
|
102 |
int fault(ulong, int);
|
|
|
103 |
void fdclose(int, int);
|
|
|
104 |
Chan* fdtochan(int, int, int, int);
|
|
|
105 |
int fixfault(Segment*, ulong, int, int);
|
|
|
106 |
void flushmmu(void);
|
|
|
107 |
void forkchild(Proc*, Ureg*);
|
|
|
108 |
void forkret(void);
|
|
|
109 |
void free(void*);
|
|
|
110 |
void freeb(Block*);
|
|
|
111 |
void freeblist(Block*);
|
|
|
112 |
int freebroken(void);
|
|
|
113 |
void freepte(Segment*, Pte*);
|
|
|
114 |
void freesegs(int);
|
|
|
115 |
void freesession(Session*);
|
|
|
116 |
ulong getmalloctag(void*);
|
|
|
117 |
ulong getrealloctag(void*);
|
|
|
118 |
void gotolabel(Label*);
|
|
|
119 |
char* getconfenv(void);
|
|
|
120 |
int haswaitq(void*);
|
|
|
121 |
long hostdomainwrite(char*, int);
|
|
|
122 |
long hostownerwrite(char*, int);
|
|
|
123 |
void hzsched(void);
|
|
|
124 |
void iallocinit(void);
|
|
|
125 |
Block* iallocb(int);
|
|
|
126 |
void iallocsummary(void);
|
|
|
127 |
long ibrk(ulong, int);
|
|
|
128 |
void ilock(Lock*);
|
|
|
129 |
void iunlock(Lock*);
|
|
|
130 |
int incref(Ref*);
|
|
|
131 |
void initseg(void);
|
|
|
132 |
int iprint(char*, ...);
|
|
|
133 |
void isdir(Chan*);
|
|
|
134 |
int iseve(void);
|
|
|
135 |
#define islo() (0)
|
|
|
136 |
Segment* isoverlap(Proc*, ulong, int);
|
|
|
137 |
int ispages(void*);
|
|
|
138 |
int isphysseg(char*);
|
|
|
139 |
void ixsummary(void);
|
|
|
140 |
void kbdclock(void);
|
|
|
141 |
int kbdcr2nl(Queue*, int);
|
|
|
142 |
int kbdputc(Queue*, int);
|
|
|
143 |
void kbdrepeat(int);
|
|
|
144 |
long keyread(char*, int, long);
|
|
|
145 |
void kickpager(void);
|
|
|
146 |
void killbig(void);
|
|
|
147 |
int kproc(char*, void(*)(void*), void*);
|
|
|
148 |
void kprocchild(Proc*, void (*)(void*), void*);
|
|
|
149 |
extern void (*kproftimer)(ulong);
|
|
|
150 |
void ksetenv(char*, char*, int);
|
|
|
151 |
void kstrcpy(char*, char*, int);
|
|
|
152 |
void kstrdup(char**, char*);
|
|
|
153 |
long latin1(Rune*, int);
|
|
|
154 |
void lock(Lock*);
|
|
|
155 |
void lockinit(void);
|
|
|
156 |
void logopen(Log*);
|
|
|
157 |
void logclose(Log*);
|
|
|
158 |
char* logctl(Log*, int, char**, Logflag*);
|
|
|
159 |
void logn(Log*, int, void*, int);
|
|
|
160 |
long logread(Log*, void*, ulong, long);
|
|
|
161 |
void log(Log*, int, char*, ...);
|
|
|
162 |
Cmdtab* lookupcmd(Cmdbuf*, Cmdtab*, int);
|
|
|
163 |
void machinit(void);
|
|
|
164 |
void* mallocz(ulong, int);
|
|
|
165 |
#define malloc kmalloc
|
|
|
166 |
void* malloc(ulong);
|
|
|
167 |
void mallocsummary(void);
|
|
|
168 |
Block* mem2bl(uchar*, int);
|
|
|
169 |
void mfreeseg(Segment*, ulong, int);
|
|
|
170 |
void microdelay(int);
|
|
|
171 |
void mkqid(Qid*, vlong, ulong, int);
|
|
|
172 |
void mmurelease(Proc*);
|
|
|
173 |
void mmuswitch(Proc*);
|
|
|
174 |
Chan* mntauth(Chan*, char*);
|
|
|
175 |
void mntdump(void);
|
|
|
176 |
long mntversion(Chan*, char*, int, int);
|
|
|
177 |
void mountfree(Mount*);
|
|
|
178 |
ulong ms2tk(ulong);
|
|
|
179 |
ulong msize(void*);
|
|
|
180 |
ulong ms2tk(ulong);
|
|
|
181 |
uvlong ms2fastticks(ulong);
|
|
|
182 |
void muxclose(Mnt*);
|
|
|
183 |
Chan* namec(char*, int, int, ulong);
|
|
|
184 |
Chan* newchan(void);
|
|
|
185 |
int newfd(Chan*);
|
|
|
186 |
Mhead* newmhead(Chan*);
|
|
|
187 |
Mount* newmount(Mhead*, Chan*, int, char*);
|
|
|
188 |
Page* newpage(int, Segment **, ulong);
|
|
|
189 |
Pgrp* newpgrp(void);
|
|
|
190 |
Rgrp* newrgrp(void);
|
|
|
191 |
Proc* newproc(void);
|
|
|
192 |
char* nextelem(char*, char*);
|
|
|
193 |
void nexterror(void);
|
|
|
194 |
Cname* newcname(char*);
|
|
|
195 |
int notify(Ureg*);
|
|
|
196 |
int nrand(int);
|
|
|
197 |
int okaddr(ulong, ulong, int);
|
|
|
198 |
int openmode(ulong);
|
|
|
199 |
void oserrstr(void);
|
|
|
200 |
void oserror(void);
|
|
|
201 |
Block* packblock(Block*);
|
|
|
202 |
Block* padblock(Block*, int);
|
|
|
203 |
void pagechainhead(Page*);
|
|
|
204 |
void pageinit(void);
|
|
|
205 |
void pagersummary(void);
|
|
|
206 |
void panic(char*, ...);
|
|
|
207 |
Cmdbuf* parsecmd(char *a, int n);
|
|
|
208 |
ulong perfticks(void);
|
|
|
209 |
void pexit(char*, int);
|
|
|
210 |
int preempted(void);
|
|
|
211 |
void printinit(void);
|
|
|
212 |
int procindex(ulong);
|
|
|
213 |
void pgrpcpy(Pgrp*, Pgrp*);
|
|
|
214 |
void pgrpnote(ulong, char*, long, int);
|
|
|
215 |
Pgrp* pgrptab(int);
|
|
|
216 |
void pio(Segment *, ulong, ulong, Page **);
|
|
|
217 |
#define poperror() up->nerrlab--
|
|
|
218 |
void portclock(Ureg*);
|
|
|
219 |
int postnote(Proc*, int, char*, int);
|
|
|
220 |
int pprint(char*, ...);
|
|
|
221 |
void prflush(void);
|
|
|
222 |
ulong procalarm(ulong);
|
|
|
223 |
int proccounter(char *name);
|
|
|
224 |
void procctl(Proc*);
|
|
|
225 |
void procdump(void);
|
|
|
226 |
int procfdprint(Chan*, int, int, char*, int);
|
|
|
227 |
void procinit0(void);
|
|
|
228 |
void procflushseg(Segment*);
|
|
|
229 |
void procpriority(Proc*, int, int);
|
|
|
230 |
Proc* proctab(int);
|
|
|
231 |
void procwired(Proc*, int);
|
|
|
232 |
Pte* ptealloc(void);
|
|
|
233 |
Pte* ptecpy(Pte*);
|
|
|
234 |
int pullblock(Block**, int);
|
|
|
235 |
Block* pullupblock(Block*, int);
|
|
|
236 |
Block* pullupqueue(Queue*, int);
|
|
|
237 |
void putmhead(Mhead*);
|
|
|
238 |
void putmmu(ulong, ulong, Page*);
|
|
|
239 |
void putpage(Page*);
|
|
|
240 |
void putseg(Segment*);
|
|
|
241 |
void putstr(char*);
|
|
|
242 |
void putstrn(char*, int);
|
|
|
243 |
void putswap(Page*);
|
|
|
244 |
ulong pwait(Waitmsg*);
|
|
|
245 |
Label* pwaserror(void);
|
|
|
246 |
void qaddlist(Queue*, Block*);
|
|
|
247 |
Block* qbread(Queue*, int);
|
|
|
248 |
long qbwrite(Queue*, Block*);
|
|
|
249 |
Queue* qbypass(void (*)(void*, Block*), void*);
|
|
|
250 |
int qcanread(Queue*);
|
|
|
251 |
void qclose(Queue*);
|
|
|
252 |
int qconsume(Queue*, void*, int);
|
|
|
253 |
Block* qcopy(Queue*, int, ulong);
|
|
|
254 |
int qdiscard(Queue*, int);
|
|
|
255 |
void qflush(Queue*);
|
|
|
256 |
void qfree(Queue*);
|
|
|
257 |
int qfull(Queue*);
|
|
|
258 |
Block* qget(Queue*);
|
|
|
259 |
void qhangup(Queue*, char*);
|
|
|
260 |
int qisclosed(Queue*);
|
|
|
261 |
void qinit(void);
|
|
|
262 |
int qiwrite(Queue*, void*, int);
|
|
|
263 |
int qlen(Queue*);
|
|
|
264 |
void qlock(QLock*);
|
|
|
265 |
Queue* qopen(int, int, void (*)(void*), void*);
|
|
|
266 |
int qpass(Queue*, Block*);
|
|
|
267 |
int qpassnolim(Queue*, Block*);
|
|
|
268 |
int qproduce(Queue*, void*, int);
|
|
|
269 |
void qputback(Queue*, Block*);
|
|
|
270 |
long qread(Queue*, void*, int);
|
|
|
271 |
Block* qremove(Queue*);
|
|
|
272 |
void qreopen(Queue*);
|
|
|
273 |
void qsetlimit(Queue*, int);
|
|
|
274 |
void qunlock(QLock*);
|
|
|
275 |
int qwindow(Queue*);
|
|
|
276 |
int qwrite(Queue*, void*, int);
|
|
|
277 |
void qnoblock(Queue*, int);
|
|
|
278 |
int rand(void);
|
|
|
279 |
void randominit(void);
|
|
|
280 |
ulong randomread(void*, ulong);
|
|
|
281 |
void rdb(void);
|
|
|
282 |
int readnum(ulong, char*, ulong, ulong, int);
|
|
|
283 |
int readstr(ulong, char*, ulong, char*);
|
|
|
284 |
void ready(Proc*);
|
|
|
285 |
void rebootcmd(int, char**);
|
|
|
286 |
void reboot(void*, void*, ulong);
|
|
|
287 |
void relocateseg(Segment*, ulong);
|
|
|
288 |
void renameuser(char*, char*);
|
|
|
289 |
void resched(char*);
|
|
|
290 |
void resrcwait(char*);
|
|
|
291 |
int return0(void*);
|
|
|
292 |
void rlock(RWlock*);
|
|
|
293 |
long rtctime(void);
|
|
|
294 |
void runlock(RWlock*);
|
|
|
295 |
Proc* runproc(void);
|
|
|
296 |
void savefpregs(FPsave*);
|
|
|
297 |
extern void (*saveintrts)(void);
|
|
|
298 |
void sched(void);
|
|
|
299 |
void scheddump(void);
|
|
|
300 |
void schedinit(void);
|
|
|
301 |
extern void (*screenputs)(char*, int);
|
|
|
302 |
long seconds(void);
|
|
|
303 |
ulong segattach(Proc*, ulong, char *, ulong, ulong);
|
|
|
304 |
void segclock(ulong);
|
|
|
305 |
void segpage(Segment*, Page*);
|
|
|
306 |
void setkernur(Ureg*, Proc*);
|
|
|
307 |
int setlabel(Label*);
|
|
|
308 |
void setmalloctag(void*, uintptr);
|
|
|
309 |
void setrealloctag(void*, ulong);
|
|
|
310 |
void setregisters(Ureg*, char*, char*, int);
|
|
|
311 |
void setswapchan(Chan*);
|
|
|
312 |
long showfilewrite(char*, int);
|
|
|
313 |
char* skipslash(char*);
|
|
|
314 |
void sleep(Rendez*, int(*)(void*), void*);
|
|
|
315 |
void* smalloc(ulong);
|
|
|
316 |
int splhi(void);
|
|
|
317 |
int spllo(void);
|
|
|
318 |
void splx(int);
|
|
|
319 |
void splxpc(int);
|
|
|
320 |
char* srvname(Chan*);
|
|
|
321 |
int swapcount(ulong);
|
|
|
322 |
int swapfull(void);
|
|
|
323 |
void swapinit(void);
|
|
|
324 |
void timeradd(Timer*);
|
|
|
325 |
void timerdel(Timer*);
|
|
|
326 |
void timersinit(void);
|
|
|
327 |
void timerintr(Ureg*, uvlong);
|
|
|
328 |
void timerset(uvlong);
|
|
|
329 |
ulong tk2ms(ulong);
|
|
|
330 |
#define TK2MS(x) ((x)*(1000/HZ))
|
|
|
331 |
vlong todget(vlong*);
|
|
|
332 |
void todfix(void);
|
|
|
333 |
void todsetfreq(vlong);
|
|
|
334 |
void todinit(void);
|
|
|
335 |
void todset(vlong, vlong, int);
|
|
|
336 |
Block* trimblock(Block*, int, int);
|
|
|
337 |
void tsleep(Rendez*, int (*)(void*), void*, int);
|
|
|
338 |
int uartctl(Uart*, char*);
|
|
|
339 |
int uartgetc(void);
|
|
|
340 |
void uartkick(void*);
|
|
|
341 |
void uartmouse(Uart*, int (*)(Queue*, int), int);
|
|
|
342 |
void uartputc(int);
|
|
|
343 |
void uartputs(char*, int);
|
|
|
344 |
void uartrecv(Uart*, char);
|
|
|
345 |
Uart* uartsetup(Uart*);
|
|
|
346 |
int uartstageoutput(Uart*);
|
|
|
347 |
void unbreak(Proc*);
|
|
|
348 |
void uncachepage(Page*);
|
|
|
349 |
long unionread(Chan*, void*, long);
|
|
|
350 |
void unlock(Lock*);
|
|
|
351 |
Proc** uploc(void);
|
|
|
352 |
void userinit(void);
|
|
|
353 |
ulong userpc(void);
|
|
|
354 |
long userwrite(char*, int);
|
|
|
355 |
#define validaddr(a, b, c)
|
|
|
356 |
void validname(char*, int);
|
|
|
357 |
void validstat(uchar*, int);
|
|
|
358 |
void vcacheinval(Page*, ulong);
|
|
|
359 |
void* vmemchr(void*, int, int);
|
|
|
360 |
Proc* wakeup(Rendez*);
|
|
|
361 |
int walk(Chan**, char**, int, int, int*);
|
|
|
362 |
#define waserror() (setjmp(pwaserror()->buf))
|
|
|
363 |
void wlock(RWlock*);
|
|
|
364 |
void wunlock(RWlock*);
|
|
|
365 |
void* xalloc(ulong);
|
|
|
366 |
void* xallocz(ulong, int);
|
|
|
367 |
void xfree(void*);
|
|
|
368 |
void xhole(ulong, ulong);
|
|
|
369 |
void xinit(void);
|
|
|
370 |
int xmerge(void*, void*);
|
|
|
371 |
void* xspanalloc(ulong, int, ulong);
|
|
|
372 |
void xsummary(void);
|
|
|
373 |
void yield(void);
|
|
|
374 |
Segment* data2txt(Segment*);
|
|
|
375 |
Segment* dupseg(Segment**, int, int);
|
|
|
376 |
Segment* newseg(int, ulong, ulong);
|
|
|
377 |
Segment* seg(Proc*, ulong, int);
|
|
|
378 |
ulong ticks(void);
|
|
|
379 |
void osproc(Proc*);
|
|
|
380 |
void osnewproc(Proc*);
|
|
|
381 |
void procsleep(void);
|
|
|
382 |
void procwakeup(Proc*);
|
|
|
383 |
void osinit(void);
|
|
|
384 |
void screeninit(void);
|
|
|
385 |
extern void terminit(void);
|
|
|
386 |
|