]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/port/portfns.h
devproc: fix proccrlmemio bugs
[plan9front.git] / sys / src / 9 / port / portfns.h
1 void            _assert(char*);
2 void            accounttime(void);
3 Timer*          addclock0link(void (*)(void), int);
4 int             addphysseg(Physseg*);
5 void            addbootfile(char*, uchar*, ulong);
6 void            addwatchdog(Watchdog*);
7 Block*          adjustblock(Block*, int);
8 void            alarmkproc(void*);
9 Block*          allocb(int);
10 int             anyhigher(void);
11 int             anyready(void);
12 Image*          attachimage(int, Chan*, uintptr, ulong);
13 Page*           auxpage(void);
14 Block*          bl2mem(uchar*, Block*, int);
15 int             blocklen(Block*);
16 void            bootlinks(void);
17 void            cachedel(Image*, uintptr);
18 void            cachepage(Page*, Image*);
19 void            callwithureg(void(*)(Ureg*));
20 char*           chanpath(Chan*);
21 int             canlock(Lock*);
22 int             canpage(Proc*);
23 int             canqlock(QLock*);
24 int             canrlock(RWlock*);
25 void            chandevinit(void);
26 void            chandevreset(void);
27 void            chandevshutdown(void);
28 void            chanfree(Chan*);
29 void            checkalarms(void);
30 void            checkb(Block*, char*);
31 void            cinit(void);
32 Chan*           cclone(Chan*);
33 void            cclose(Chan*);
34 void            ccloseq(Chan*);
35 void            closeegrp(Egrp*);
36 void            closefgrp(Fgrp*);
37 void            closepgrp(Pgrp*);
38 void            closergrp(Rgrp*);
39 long            clrfpintr(void);
40 void            cmderror(Cmdbuf*, char*);
41 int             cmount(Chan**, Chan*, int, char*);
42 void            confinit(void);
43 int             consactive(void);
44 void            (*consdebug)(void);
45 void            copen(Chan*);
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);
51 void            cunmount(Chan*, Chan*);
52 void            cupdate(Chan*, uchar*, int, vlong);
53 void            cwrite(Chan*, uchar*, int, vlong);
54 uintptr         dbgpc(Proc*);
55 long            decref(Ref*);
56 int             decrypt(void*, void*, int);
57 void            delay(int);
58 Proc*           dequeueproc(Schedq*, Proc*);
59 Chan*           devattach(int, char*);
60 Block*          devbread(Chan*, long, ulong);
61 long            devbwrite(Chan*, Block*, ulong);
62 Chan*           devclone(Chan*);
63 int             devconfig(int, char *, DevConf *);
64 Chan*           devcreate(Chan*, char*, int, ulong);
65 void            devdir(Chan*, Qid, char*, vlong, char*, long, Dir*);
66 long            devdirread(Chan*, char*, long, Dirtab*, int, Devgen*);
67 Devgen          devgen;
68 void            devinit(void);
69 int             devno(int, int);
70 Chan*           devopen(Chan*, int, Dirtab*, int, Devgen*);
71 void            devpermcheck(char*, ulong, int);
72 void            devpower(int);
73 void            devremove(Chan*);
74 void            devreset(void);
75 void            devshutdown(void);
76 int             devstat(Chan*, uchar*, int, Dirtab*, int, Devgen*);
77 Walkqid*        devwalk(Chan*, Chan*, char**, int, Dirtab*, int, Devgen*);
78 int             devwstat(Chan*, uchar*, int);
79 void            drawactive(int);
80 void            drawcmap(void);
81 void            dumpaproc(Proc*);
82 void            dumpregs(Ureg*);
83 void            dumpstack(void);
84 Fgrp*           dupfgrp(Fgrp*);
85 void            dupswap(Page*);
86 void            edfinit(Proc*);
87 char*           edfadmit(Proc*);
88 int             edfready(Proc*);
89 void            edfrecord(Proc*);
90 void            edfrun(Proc*, int);
91 void            edfstop(Proc*);
92 void            edfyield(void);
93 int             emptystr(char*);
94 int             encrypt(void*, void*, int);
95 void            envcpy(Egrp*, Egrp*);
96 int             eqchan(Chan*, Chan*, int);
97 int             eqchantdqid(Chan*, int, int, Qid, int);
98 int             eqqid(Qid, Qid);
99 void            error(char*);
100 void            eqlock(QLock*);
101 uintptr         execregs(uintptr, ulong, ulong);
102 void            exhausted(char*);
103 void            exit(int);
104 uvlong          fastticks(uvlong*);
105 uvlong          fastticks2ns(uvlong);
106 uvlong          fastticks2us(uvlong);
107 int             fault(uintptr, int);
108 void            fdclose(int, int);
109 Chan*           fdtochan(int, int, int, int);
110 int             findmount(Chan**, Mhead**, int, int, Qid);
111 int             fixfault(Segment*, uintptr, int, int);
112 void            flushmmu(void);
113 void            forceclosefgrp(void);
114 void            forkchild(Proc*, Ureg*);
115 void            forkret(void);
116 void            free(void*);
117 void            freeb(Block*);
118 void            freeblist(Block*);
119 int             freebroken(void);
120 void            freepte(Segment*, Pte*);
121 void            getcolor(ulong, ulong*, ulong*, ulong*);
122 uintptr         getmalloctag(void*);
123 uintptr         getrealloctag(void*);
124 void            gotolabel(Label*);
125 char*           getconfenv(void);
126 long            hostdomainwrite(char*, int);
127 long            hostownerwrite(char*, int);
128 void            hzsched(void);
129 Block*          iallocb(int);
130 void            iallocsummary(void);
131 long            ibrk(uintptr, int);
132 void            ilock(Lock*);
133 void            interrupted(void);
134 void            iunlock(Lock*);
135 long            incref(Ref*);
136 void            initseg(void);
137 int             iprint(char*, ...);
138 void            isdir(Chan*);
139 int             iseve(void);
140 int             islo(void);
141 Segment*        isoverlap(Proc*, uintptr, uintptr);
142 int             ispages(void*);
143 int             isphysseg(char*);
144 void            ixsummary(void);
145 void            kickpager(void);
146 void            killbig(char*);
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*);
153 int             lock(Lock*);
154 void            logopen(Log*);
155 void            logclose(Log*);
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)
163 void            machinit(void);
164 void*           mallocz(ulong, int);
165 void*           malloc(ulong);
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, int);
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*           mntauth(Chan*, char*);
177 long            mntversion(Chan*, char*, int, int);
178 void            mouseresize(void);
179 void            mountfree(Mount*);
180 ulong           ms2tk(ulong);
181 ulong           msize(void*);
182 ulong           ms2tk(ulong);
183 uvlong          ms2fastticks(ulong);
184 void            mul64fract(uvlong*, uvlong, uvlong);
185 void            muxclose(Mnt*);
186 Chan*           namec(char*, int, int, ulong);
187 void            nameerror(char*, char*);
188 Chan*           newchan(void);
189 int             newfd(Chan*);
190 Mhead*          newmhead(Chan*);
191 Mount*          newmount(Mhead*, Chan*, int, char*);
192 Page*           newpage(int, Segment **, uintptr);
193 Path*           newpath(char*);
194 Pgrp*           newpgrp(void);
195 Rgrp*           newrgrp(void);
196 Proc*           newproc(void);
197 void            nexterror(void);
198 int             notify(Ureg*);
199 int             nrand(int);
200 uvlong          ns2fastticks(uvlong);
201 int             okaddr(uintptr, ulong, int);
202 int             openmode(ulong);
203 Block*          packblock(Block*);
204 Block*          padblock(Block*, int);
205 void            pagechainhead(Page*);
206 void            pageinit(void);
207 ulong   pagenumber(Page*);
208 void            pagersummary(void);
209 void            panic(char*, ...);
210 Cmdbuf*         parsecmd(char *a, int n);
211 void            pathclose(Path*);
212 ulong           perfticks(void);
213 void            pexit(char*, int);
214 void            pgrpcpy(Pgrp*, Pgrp*);
215 void            pgrpnote(ulong, char*, long, int);
216 int             pidalloc(Proc*);
217 #define         poperror()              up->nerrlab--
218 void            portcountpagerefs(ulong*, int);
219 int             postnote(Proc*, int, char*, int);
220 int             pprint(char*, ...);
221 int             preempted(void);
222 void            prflush(void);
223 void            printinit(void);
224 ulong           procalarm(ulong);
225 void            procctl(Proc*);
226 void            procdump(void);
227 int             procfdprint(Chan*, int, int, char*, int);
228 int             procindex(ulong);
229 void            procinit0(void);
230 void            procflushseg(Segment*);
231 void            procpriority(Proc*, int, int);
232 Proc*           proctab(int);
233 extern void     (*proctrace)(Proc*, int, vlong); 
234 void            procwired(Proc*, int);
235 Pte*            ptealloc(void);
236 Pte*            ptecpy(Pte*);
237 int             pullblock(Block**, int);
238 Block*          pullupblock(Block*, int);
239 Block*          pullupqueue(Queue*, int);
240 void            putimage(Image*);
241 void            putmhead(Mhead*);
242 void            putmmu(uintptr, uintptr, Page*);
243 void            putpage(Page*);
244 void            putseg(Segment*);
245 void            putstrn(char*, int);
246 void            putswap(Page*);
247 ulong           pwait(Waitmsg*);
248 void            qaddlist(Queue*, Block*);
249 Block*          qbread(Queue*, int);
250 long            qbwrite(Queue*, Block*);
251 Queue*          qbypass(void (*)(void*, Block*), void*);
252 int             qcanread(Queue*);
253 void            qclose(Queue*);
254 int             qconsume(Queue*, void*, int);
255 Block*          qcopy(Queue*, int, ulong);
256 int             qdiscard(Queue*, int);
257 void            qflush(Queue*);
258 void            qfree(Queue*);
259 int             qfull(Queue*);
260 Block*          qget(Queue*);
261 void            qhangup(Queue*, char*);
262 int             qisclosed(Queue*);
263 int             qiwrite(Queue*, void*, int);
264 int             qlen(Queue*);
265 void            qlock(QLock*);
266 Queue*          qopen(int, int, void (*)(void*), void*);
267 int             qpass(Queue*, Block*);
268 int             qpassnolim(Queue*, Block*);
269 int             qproduce(Queue*, void*, int);
270 void            qputback(Queue*, Block*);
271 long            qread(Queue*, void*, int);
272 Block*          qremove(Queue*);
273 void            qreopen(Queue*);
274 void            qsetlimit(Queue*, int);
275 void            qunlock(QLock*);
276 int             qwindow(Queue*);
277 int             qwrite(Queue*, void*, int);
278 void            qnoblock(Queue*, int);
279 int             rand(void);
280 void            randominit(void);
281 ulong           randomread(void*, ulong);
282 void            rdb(void);
283 int             readnum(ulong, char*, ulong, ulong, int);
284 int             readstr(ulong, char*, ulong, char*);
285 void            ready(Proc*);
286 void*           realloc(void *v, ulong size);
287 void            rebootcmd(int, char**);
288 void            reboot(void*, void*, ulong);
289 void            relocateseg(Segment*, uintptr);
290 void            renameuser(char*, char*);
291 void            resched(char*);
292 void            resrcwait(char*);
293 int             return0(void*);
294 void            rlock(RWlock*);
295 long            rtctime(void);
296 void            runlock(RWlock*);
297 Proc*           runproc(void);
298 void            savefpregs(FPsave*);
299 void            sched(void);
300 void            scheddump(void);
301 void            schedinit(void);
302 void            (*screenputs)(char*, int);
303 long            seconds(void);
304 uintptr         segattach(Proc*, ulong, char *, uintptr, uintptr);
305 void            segclock(uintptr);
306 void            segpage(Segment*, Page*);
307 int             setcolor(ulong, ulong, ulong, ulong);
308 void            setkernur(Ureg*, Proc*);
309 int             setlabel(Label*);
310 void            setmalloctag(void*, uintptr);
311 void            setrealloctag(void*, uintptr);
312 void            setregisters(Ureg*, char*, char*, int);
313 void            setswapchan(Chan*);
314 char*           skipslash(char*);
315 void            sleep(Rendez*, int(*)(void*), void*);
316 void*           smalloc(ulong);
317 int             splhi(void);
318 int             spllo(void);
319 void            splx(int);
320 void            splxpc(int);
321 char*           srvname(Chan*);
322 void            srvrenameuser(char*, char*);
323 void            shrrenameuser(char*, char*);
324 int             swapcount(uintptr);
325 int             swapfull(void);
326 void            swapinit(void);
327 void            syscallfmt(ulong syscallno, uintptr pc, va_list list);
328 void            sysretfmt(ulong syscallno, va_list list, uintptr ret, uvlong start, uvlong stop);
329 void            timeradd(Timer*);
330 void            timerdel(Timer*);
331 void            timersinit(void);
332 void            timerintr(Ureg*, Tval);
333 void            timerset(Tval);
334 ulong           tk2ms(ulong);
335 #define         TK2MS(x) ((x)*(1000/HZ))
336 uvlong          tod2fastticks(vlong);
337 vlong           todget(vlong*);
338 void            todsetfreq(vlong);
339 void            todinit(void);
340 void            todset(vlong, vlong, int);
341 Block*          trimblock(Block*, int, int);
342 void            tsleep(Rendez*, int (*)(void*), void*, ulong);
343 int             uartctl(Uart*, char*);
344 int             uartgetc(void);
345 void            uartkick(void*);
346 void            uartmouse(char*, int (*)(Queue*, int), int);
347 void            uartsetmouseputc(char*, int (*)(Queue*, int));
348 void            uartputc(int);
349 void            uartputs(char*, int);
350 void            uartrecv(Uart*, char);
351 int             uartstageoutput(Uart*);
352 void            unbreak(Proc*);
353 void            uncachepage(Page*);
354 long            unionread(Chan*, void*, long);
355 void            unlock(Lock*);
356 uvlong          us2fastticks(uvlong);
357 void            userinit(void);
358 uintptr         userpc(void);
359 long            userwrite(char*, int);
360 void            validaddr(uintptr, ulong, int);
361 void            validname(char*, int);
362 char*           validnamedup(char*, int);
363 void            validstat(uchar*, int);
364 void*           vmemchr(void*, int, int);
365 Proc*           wakeup(Rendez*);
366 int             walk(Chan**, char**, int, int, int*);
367 void            wlock(RWlock*);
368 void            wunlock(RWlock*);
369 void*           xalloc(ulong);
370 void*           xallocz(ulong, int);
371 void            xfree(void*);
372 void            xhole(uintptr, uintptr);
373 void            xinit(void);
374 int             xmerge(void*, void*);
375 void*           xspanalloc(ulong, int, ulong);
376 void            xsummary(void);
377 void            yield(void);
378 Segment*        data2txt(Segment*);
379 Segment*        dupseg(Segment**, int, int);
380 Segment*        newseg(int, uintptr, ulong);
381 Segment*        seg(Proc*, uintptr, int);
382 Segment*        txt2data(Segment*);
383 void            hnputv(void*, uvlong);
384 void            hnputl(void*, uint);
385 void            hnputs(void*, ushort);
386 uvlong          nhgetv(void*);
387 uint            nhgetl(void*);
388 ushort          nhgets(void*);
389 ulong           µs(void);
390 long            lcycles(void);
391
392 #pragma varargck argpos iprint  1
393 #pragma varargck argpos panic   1
394 #pragma varargck argpos pprint  1