2 void accounttime(void);
3 Timer* addclock0link(void (*)(void), int);
4 Physseg* addphysseg(Physseg*);
5 void addbootfile(char*, uchar*, ulong);
6 void addwatchdog(Watchdog*);
7 Block* adjustblock(Block*, int);
8 void alarmkproc(void*);
12 Image* attachimage(int, Chan*, uintptr, ulong);
15 void cachedel(Image*, uintptr);
16 void cachepage(Page*, Image*);
17 void callwithureg(void(*)(Ureg*));
18 char* chanpath(Chan*);
22 int canrlock(RWlock*);
23 void chandevinit(void);
24 void chandevreset(void);
25 void chandevshutdown(void);
27 void checkalarms(void);
28 void checkb(Block*, char*);
33 void closeegrp(Egrp*);
34 void closefgrp(Fgrp*);
35 void closepgrp(Pgrp*);
36 void closergrp(Rgrp*);
38 void cmderror(Cmdbuf*, char*);
39 int cmount(Chan**, Chan*, int, char*);
42 void (*consdebug)(void);
43 void cpushutdown(void);
46 Block* concatblock(Block*);
47 Block* copyblock(Block*, int);
48 void copypage(Page*, Page*);
49 void countpagerefs(ulong*, int);
50 int cread(Chan*, uchar*, int, vlong);
52 void cunmount(Chan*, Chan*);
53 void cupdate(Chan*, uchar*, int, vlong);
54 void cwrite(Chan*, uchar*, int, vlong);
57 int decrypt(void*, void*, int);
59 Proc* dequeueproc(Schedq*, Proc*);
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 Chan* devcreate(Chan*, char*, int, ulong);
66 void devdir(Chan*, Qid, char*, vlong, char*, long, Dir*);
67 long devdirread(Chan*, char*, long, Dirtab*, int, Devgen*);
71 Chan* devopen(Chan*, int, Dirtab*, int, Devgen*);
72 void devpermcheck(char*, ulong, int);
74 void devremove(Chan*);
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);
82 void dumpaproc(Proc*);
88 char* edfadmit(Proc*);
90 void edfrecord(Proc*);
91 void edfrun(Proc*, int);
95 int encrypt(void*, void*, int);
96 void envcpy(Egrp*, Egrp*);
97 int eqchan(Chan*, Chan*, int);
98 int eqchantdqid(Chan*, int, int, Qid, int);
102 uintptr execregs(uintptr, ulong, ulong);
103 void exhausted(char*);
105 uvlong fastticks(uvlong*);
106 uvlong fastticks2ns(uvlong);
107 uvlong fastticks2us(uvlong);
108 int fault(uintptr, int);
109 void fdclose(int, int);
110 Chan* fdtochan(int, int, int, int);
111 int findmount(Chan**, Mhead**, int, int, Qid);
112 int fixfault(Segment*, uintptr, int);
114 void forceclosefgrp(void);
115 void forkchild(Proc*, Ureg*);
119 void freeblist(Block*);
120 int freebroken(void);
121 void freepte(Segment*, Pte*);
122 void getcolor(ulong, ulong*, ulong*, ulong*);
123 uintptr getmalloctag(void*);
124 uintptr getrealloctag(void*);
125 void gotolabel(Label*);
126 char* getconfenv(void);
127 long hostdomainwrite(char*, int);
128 long hostownerwrite(char*, int);
129 void (*hwrandbuf)(void*, ulong);
132 uintptr ibrk(uintptr, int);
134 void interrupted(void);
136 ulong imagereclaim(ulong);
139 int iprint(char*, ...);
143 Segment* isoverlap(uintptr, uintptr);
144 Physseg* findphysseg(char*);
145 void kickpager(void);
147 void kproc(char*, void(*)(void*), void*);
148 void kprocchild(Proc*, void (*)(void*), void*);
149 void (*kproftimer)(uintptr);
150 void ksetenv(char*, char*, int);
151 void kstrcpy(char*, char*, int);
152 void kstrdup(char**, char*);
156 char* logctl(Log*, int, char**, Logflag*);
157 void logn(Log*, int, void*, int);
158 long logread(Log*, void*, ulong, long);
159 void log(Log*, int, char*, ...);
160 Cmdtab* lookupcmd(Cmdbuf*, Cmdtab*, int);
161 Page* lookpage(Image*, uintptr);
162 #define MS2NS(n) (((vlong)(n))*1000000LL)
164 void* mallocz(ulong, int);
166 void* mallocalign(ulong, ulong, long, ulong);
167 void mallocsummary(void);
168 Block* mem2bl(uchar*, int);
169 ulong mcountseg(Segment*);
170 void mfreeseg(Segment*, uintptr, ulong);
171 void microdelay(int);
172 uvlong mk64fract(uvlong, uvlong);
173 void mkqid(Qid*, vlong, ulong, int);
174 void mmurelease(Proc*);
175 void mmuswitch(Proc*);
176 Chan* mntattach(Chan*, Chan*, char*, int);
177 Chan* mntauth(Chan*, char*);
178 int mntversion(Chan*, char*, int, int);
179 void mouseresize(void);
180 void mountfree(Mount*);
184 uvlong ms2fastticks(ulong);
185 void mul64fract(uvlong*, uvlong, uvlong);
187 Chan* namec(char*, int, int, ulong);
188 void nameerror(char*, char*);
189 int needpages(void*);
192 Mhead* newmhead(Chan*);
193 Mount* newmount(Chan*, int, char*);
194 Page* newpage(int, Segment **, uintptr);
195 Path* newpath(char*);
199 void nexterror(void);
201 uvlong ns2fastticks(uvlong);
202 int okaddr(uintptr, ulong, int);
204 Block* packblock(Block*);
205 Block* padblock(Block*, int);
206 void pagechaindone(void);
207 void pagechainhead(Page*);
209 ulong pagenumber(Page*);
210 ulong pagereclaim(Image*, ulong);
211 void pagersummary(void);
212 void panic(char*, ...);
213 Cmdbuf* parsecmd(char *a, int n);
214 void pathclose(Path*);
215 ulong perfticks(void);
216 void pexit(char*, int);
217 void pgrpcpy(Pgrp*, Pgrp*);
218 void pgrpnote(ulong, char*, long, int);
220 #define poperror() up->nerrlab--
221 void portcountpagerefs(ulong*, int);
222 int postnote(Proc*, int, char*, int);
223 int pprint(char*, ...);
226 void printinit(void);
227 ulong procalarm(ulong);
230 int procfdprint(Chan*, int, char*, int);
231 void procflushseg(Segment*);
232 void procflushpseg(Physseg*);
233 int procindex(ulong);
234 void procinit0(void);
235 ulong procpagecount(Proc*);
236 void procpriority(Proc*, int, int);
238 extern void (*proctrace)(Proc*, int, vlong);
239 void procwired(Proc*, int);
242 int pullblock(Block**, int);
243 Block* pullupblock(Block*, int);
244 Block* pullupqueue(Queue*, int);
245 void putimage(Image*);
246 void putmhead(Mhead*);
247 void putmmu(uintptr, uintptr, Page*);
249 void putseg(Segment*);
250 void putstrn(char*, int);
252 ulong pwait(Waitmsg*);
253 int qaddlist(Queue*, Block*);
254 Block* qbread(Queue*, int);
255 long qbwrite(Queue*, Block*);
256 Queue* qbypass(void (*)(void*, Block*), void*);
257 int qcanread(Queue*);
259 int qconsume(Queue*, void*, int);
260 Block* qcopy(Queue*, int, ulong);
261 int qdiscard(Queue*, int);
266 void qhangup(Queue*, char*);
267 int qisclosed(Queue*);
268 int qiwrite(Queue*, void*, int);
271 Queue* qopen(int, int, void (*)(void*), void*);
272 int qpass(Queue*, Block*);
273 int qpassnolim(Queue*, Block*);
274 int qproduce(Queue*, void*, int);
275 void qputback(Queue*, Block*);
276 long qread(Queue*, void*, int);
277 Block* qremove(Queue*);
278 void qreopen(Queue*);
279 void qsetlimit(Queue*, int);
280 void qunlock(QLock*);
282 int qwrite(Queue*, void*, int);
283 void qnoblock(Queue*, int);
284 void randominit(void);
285 ulong randomread(void*, ulong);
287 long readblist(Block*, uchar*, long, ulong);
288 int readnum(ulong, char*, ulong, ulong, int);
289 int readstr(ulong, char*, ulong, char*);
291 void* realloc(void *v, ulong size);
292 void rebootcmd(int, char**);
293 void reboot(void*, void*, ulong);
294 void relocateseg(Segment*, uintptr);
295 void renameuser(char*, char*);
297 void resrcwait(char*);
301 void runlock(RWlock*);
303 void savefpregs(FPsave*);
305 void scheddump(void);
306 void schedinit(void);
307 void (*screenputs)(char*, int);
308 void* secalloc(ulong);
311 uintptr segattach(int, char *, uintptr, uintptr);
312 void segclock(uintptr);
313 long segio(Segio*, Segment*, void*, long, vlong, int);
314 void segpage(Segment*, Page*);
315 int setcolor(ulong, ulong, ulong, ulong);
316 void setkernur(Ureg*, Proc*);
317 int setlabel(Label*);
318 void setmalloctag(void*, uintptr);
319 void setrealloctag(void*, uintptr);
320 void setregisters(Ureg*, char*, char*, int);
321 void setupwatchpts(Proc*, Watchpt*, int);
322 char* skipslash(char*);
323 void sleep(Rendez*, int(*)(void*), void*);
324 void* smalloc(ulong);
329 char* srvname(Chan*);
330 void srvrenameuser(char*, char*);
331 void shrrenameuser(char*, char*);
332 int swapcount(uintptr);
334 void syscallfmt(ulong syscallno, uintptr pc, va_list list);
335 void sysretfmt(ulong syscallno, va_list list, uintptr ret, uvlong start, uvlong stop);
336 void timeradd(Timer*);
337 void timerdel(Timer*);
338 void timersinit(void);
339 void timerintr(Ureg*, Tval);
342 #define TK2MS(x) ((x)*(1000/HZ))
343 uvlong tod2fastticks(vlong);
344 vlong todget(vlong*);
345 void todsetfreq(vlong);
347 void todset(vlong, vlong, int);
348 Block* trimblock(Block*, int, int);
349 void tsleep(Rendez*, int (*)(void*), void*, ulong);
350 void twakeup(Ureg*, Timer *);
351 int uartctl(Uart*, char*);
353 void uartkick(void*);
354 void uartmouse(char*, int (*)(Queue*, int), int);
355 void uartsetmouseputc(char*, int (*)(Queue*, int));
357 void uartputs(char*, int);
358 void uartrecv(Uart*, char);
359 int uartstageoutput(Uart*);
361 void uncachepage(Page*);
362 long unionread(Chan*, void*, long);
364 uvlong us2fastticks(uvlong);
366 uintptr userpc(void);
367 long userwrite(char*, int);
368 void validaddr(uintptr, ulong, int);
369 void validname(char*, int);
370 char* validnamedup(char*, int);
371 void validstat(uchar*, int);
372 void* vmemchr(void*, int, ulong);
373 Proc* wakeup(Rendez*);
374 int walk(Chan**, char**, int, int, int*);
376 void wunlock(RWlock*);
378 void* xallocz(ulong, int);
380 void xhole(uintptr, uintptr);
382 int xmerge(void*, void*);
383 void* xspanalloc(ulong, int, ulong);
386 Segment* data2txt(Segment*);
387 Segment* dupseg(Segment**, int, int);
388 Segment* newseg(int, uintptr, ulong);
389 Segment* seg(Proc*, uintptr, int);
390 Segment* txt2data(Segment*);
391 void hnputv(void*, uvlong);
392 void hnputl(void*, uint);
393 void hnputs(void*, ushort);
394 uvlong nhgetv(void*);
396 ushort nhgets(void*);
400 #pragma varargck argpos iprint 1
401 #pragma varargck argpos panic 1
402 #pragma varargck argpos pprint 1