void _assert(char*);
void accounttime(void);
Timer* addclock0link(void (*)(void), int);
-int addphysseg(Physseg*);
+Physseg* addphysseg(Physseg*);
void addbootfile(char*, uchar*, ulong);
void addwatchdog(Watchdog*);
Block* adjustblock(Block*, int);
Block* allocb(int);
int anyhigher(void);
int anyready(void);
-Image* attachimage(int, Chan*, ulong, ulong);
-Page* auxpage(void);
-Block* bl2mem(uchar*, Block*, int);
+Image* attachimage(int, Chan*, uintptr, ulong);
int blocklen(Block*);
void bootlinks(void);
-void cachedel(Image*, ulong);
+void cachedel(Image*, uintptr);
void cachepage(Page*, Image*);
void callwithureg(void(*)(Ureg*));
char* chanpath(Chan*);
void confinit(void);
int consactive(void);
void (*consdebug)(void);
-void copen(Chan*);
+void cpushutdown(void);
+int copen(Chan*);
+void cclunk(Chan*);
Block* concatblock(Block*);
Block* copyblock(Block*, int);
void copypage(Page*, Page*);
void countpagerefs(ulong*, int);
int cread(Chan*, uchar*, int, vlong);
+void ctrunc(Chan*);
void cunmount(Chan*, Chan*);
void cupdate(Chan*, uchar*, int, vlong);
void cwrite(Chan*, uchar*, int, vlong);
-ulong dbgpc(Proc*);
+uintptr dbgpc(Proc*);
long decref(Ref*);
int decrypt(void*, void*, int);
void delay(int);
void dumpregs(Ureg*);
void dumpstack(void);
Fgrp* dupfgrp(Fgrp*);
-void duppage(Page*);
void dupswap(Page*);
void edfinit(Proc*);
char* edfadmit(Proc*);
int eqqid(Qid, Qid);
void error(char*);
void eqlock(QLock*);
-long execregs(ulong, ulong, ulong);
+uintptr execregs(uintptr, ulong, ulong);
void exhausted(char*);
void exit(int);
uvlong fastticks(uvlong*);
uvlong fastticks2ns(uvlong);
uvlong fastticks2us(uvlong);
-int fault(ulong, int);
+int fault(uintptr, uintptr, int);
void fdclose(int, int);
Chan* fdtochan(int, int, int, int);
int findmount(Chan**, Mhead**, int, int, Qid);
-int fixfault(Segment*, ulong, int, int);
void flushmmu(void);
void forceclosefgrp(void);
void forkchild(Proc*, Ureg*);
void freeb(Block*);
void freeblist(Block*);
int freebroken(void);
+void freepages(Page*, Page*, ulong);
void freepte(Segment*, Pte*);
void getcolor(ulong, ulong*, ulong*, ulong*);
-ulong getmalloctag(void*);
-ulong getrealloctag(void*);
+uintptr getmalloctag(void*);
+uintptr getrealloctag(void*);
void gotolabel(Label*);
char* getconfenv(void);
-int haswaitq(void*);
long hostdomainwrite(char*, int);
long hostownerwrite(char*, int);
+void (*hwrandbuf)(void*, ulong);
void hzsched(void);
Block* iallocb(int);
-void iallocsummary(void);
-long ibrk(ulong, int);
+uintptr ibrk(uintptr, int);
void ilock(Lock*);
+void interrupted(void);
void iunlock(Lock*);
+ulong imagecached(void);
+ulong imagereclaim(ulong);
long incref(Ref*);
+void init0(void);
void initseg(void);
int iprint(char*, ...);
void isdir(Chan*);
int iseve(void);
int islo(void);
-Segment* isoverlap(Proc*, ulong, int);
-int ispages(void*);
-int isphysseg(char*);
-void ixsummary(void);
+Segment* isoverlap(uintptr, uintptr);
+Physseg* findphysseg(char*);
void kickpager(void);
void killbig(char*);
void kproc(char*, void(*)(void*), void*);
void kprocchild(Proc*, void (*)(void*), void*);
-void (*kproftimer)(ulong);
+void (*kproftimer)(uintptr);
void ksetenv(char*, char*, int);
void kstrcpy(char*, char*, int);
void kstrdup(char**, char*);
long logread(Log*, void*, ulong, long);
void log(Log*, int, char*, ...);
Cmdtab* lookupcmd(Cmdbuf*, Cmdtab*, int);
-Page* lookpage(Image*, ulong);
+Page* lookpage(Image*, uintptr);
#define MS2NS(n) (((vlong)(n))*1000000LL)
void machinit(void);
void* mallocz(ulong, int);
void* mallocalign(ulong, ulong, long, ulong);
void mallocsummary(void);
Block* mem2bl(uchar*, int);
-int mcountseg(Segment*);
-void mfreeseg(Segment*, ulong, int);
+ulong mcountseg(Segment*);
+void mfreeseg(Segment*, uintptr, ulong);
void microdelay(int);
uvlong mk64fract(uvlong, uvlong);
void mkqid(Qid*, vlong, ulong, int);
void mmurelease(Proc*);
void mmuswitch(Proc*);
+Chan* mntattach(Chan*, Chan*, char*, int);
Chan* mntauth(Chan*, char*);
-long mntversion(Chan*, char*, int, int);
+int mntversion(Chan*, char*, int, int);
void mouseresize(void);
void mountfree(Mount*);
ulong ms2tk(ulong);
void muxclose(Mnt*);
Chan* namec(char*, int, int, ulong);
void nameerror(char*, char*);
+int needpages(void*);
Chan* newchan(void);
int newfd(Chan*);
Mhead* newmhead(Chan*);
-Mount* newmount(Mhead*, Chan*, int, char*);
-Page* newpage(int, Segment **, ulong);
+Mount* newmount(Chan*, int, char*);
+Page* newpage(int, Segment **, uintptr);
Path* newpath(char*);
Pgrp* newpgrp(void);
Rgrp* newrgrp(void);
Proc* newproc(void);
void nexterror(void);
int notify(Ureg*);
-int nrand(int);
uvlong ns2fastticks(uvlong);
-int okaddr(ulong, ulong, int);
+int okaddr(uintptr, ulong, int);
int openmode(ulong);
Block* packblock(Block*);
Block* padblock(Block*, int);
+void pagechaindone(void);
void pagechainhead(Page*);
void pageinit(void);
-ulong pagenumber(Page*);
-void pagersummary(void);
+ulong pagereclaim(Image*, ulong);
void panic(char*, ...);
Cmdbuf* parsecmd(char *a, int n);
void pathclose(Path*);
ulong perfticks(void);
void pexit(char*, int);
void pgrpcpy(Pgrp*, Pgrp*);
-void pgrpnote(ulong, char*, long, int);
+void pgrpnote(ulong, char*, int);
int pidalloc(Proc*);
-void pio(Segment *, ulong, ulong, Page **);
#define poperror() up->nerrlab--
void portcountpagerefs(ulong*, int);
int postnote(Proc*, int, char*, int);
void prflush(void);
void printinit(void);
ulong procalarm(ulong);
-void procctl(Proc*);
+void procctl(void);
void procdump(void);
-int procfdprint(Chan*, int, int, char*, int);
+int procfdprint(Chan*, int, char*, int);
+void procflushseg(Segment*);
+void procflushpseg(Physseg*);
+void procflushothers(void);
int procindex(ulong);
void procinit0(void);
-void procflushseg(Segment*);
+ulong procpagecount(Proc*);
void procpriority(Proc*, int, int);
Proc* proctab(int);
extern void (*proctrace)(Proc*, int, vlong);
Block* pullupqueue(Queue*, int);
void putimage(Image*);
void putmhead(Mhead*);
-void putmmu(ulong, ulong, Page*);
+void putmmu(uintptr, uintptr, Page*);
void putpage(Page*);
void putseg(Segment*);
void putstrn(char*, int);
void putswap(Page*);
ulong pwait(Waitmsg*);
-void qaddlist(Queue*, Block*);
+int qaddlist(Queue*, Block*);
Block* qbread(Queue*, int);
long qbwrite(Queue*, Block*);
Queue* qbypass(void (*)(void*, Block*), void*);
int qwindow(Queue*);
int qwrite(Queue*, void*, int);
void qnoblock(Queue*, int);
-int rand(void);
void randominit(void);
ulong randomread(void*, ulong);
+void ramdiskinit(void);
void rdb(void);
+long readblist(Block*, uchar*, long, ulong);
int readnum(ulong, char*, ulong, ulong, int);
int readstr(ulong, char*, ulong, char*);
void ready(Proc*);
void* realloc(void *v, ulong size);
void rebootcmd(int, char**);
void reboot(void*, void*, ulong);
-void relocateseg(Segment*, ulong);
+void relocateseg(Segment*, uintptr);
void renameuser(char*, char*);
void resched(char*);
void resrcwait(char*);
void scheddump(void);
void schedinit(void);
void (*screenputs)(char*, int);
+void* secalloc(ulong);
+void secfree(void*);
long seconds(void);
-ulong segattach(Proc*, ulong, char *, ulong, ulong);
-void segclock(ulong);
+uintptr segattach(int, char *, uintptr, uintptr);
+void segclock(uintptr);
+long segio(Segio*, Segment*, void*, long, vlong, int);
void segpage(Segment*, Page*);
int setcolor(ulong, ulong, ulong, ulong);
void setkernur(Ureg*, Proc*);
int setlabel(Label*);
-void setmalloctag(void*, ulong);
-void setrealloctag(void*, ulong);
+void setmalloctag(void*, uintptr);
+void setrealloctag(void*, uintptr);
void setregisters(Ureg*, char*, char*, int);
-void setswapchan(Chan*);
+void setupwatchpts(Proc*, Watchpt*, int);
char* skipslash(char*);
void sleep(Rendez*, int(*)(void*), void*);
void* smalloc(ulong);
char* srvname(Chan*);
void srvrenameuser(char*, char*);
void shrrenameuser(char*, char*);
-int swapcount(ulong);
+int swapcount(uintptr);
int swapfull(void);
-void swapinit(void);
-void syscallfmt(ulong syscallno, ulong pc, va_list list);
-void sysretfmt(ulong syscallno, va_list list, long ret, uvlong start, uvlong stop);
+void syscallfmt(ulong syscallno, uintptr pc, va_list list);
+void sysretfmt(ulong syscallno, va_list list, uintptr ret, uvlong start, uvlong stop);
void timeradd(Timer*);
void timerdel(Timer*);
void timersinit(void);
void todset(vlong, vlong, int);
Block* trimblock(Block*, int, int);
void tsleep(Rendez*, int (*)(void*), void*, ulong);
+void twakeup(Ureg*, Timer *);
int uartctl(Uart*, char*);
int uartgetc(void);
void uartkick(void*);
-void uartmouse(Uart*, int (*)(Queue*, int), int);
-void uartsetmouseputc(Uart*, int (*)(Queue*, int));
+void uartmouse(char*, int (*)(Queue*, int), int);
+void uartsetmouseputc(char*, int (*)(Queue*, int));
void uartputc(int);
void uartputs(char*, int);
void uartrecv(Uart*, char);
void unlock(Lock*);
uvlong us2fastticks(uvlong);
void userinit(void);
-ulong userpc(void);
+uintptr userpc(void);
long userwrite(char*, int);
-void validaddr(ulong, ulong, int);
+void validaddr(uintptr, ulong, int);
void validname(char*, int);
char* validnamedup(char*, int);
void validstat(uchar*, int);
-void* vmemchr(void*, int, int);
+void* vmemchr(void*, int, ulong);
Proc* wakeup(Rendez*);
int walk(Chan**, char**, int, int, int*);
void wlock(RWlock*);
void* xalloc(ulong);
void* xallocz(ulong, int);
void xfree(void*);
-void xhole(ulong, ulong);
+void xhole(uintptr, uintptr);
void xinit(void);
int xmerge(void*, void*);
void* xspanalloc(ulong, int, ulong);
void yield(void);
Segment* data2txt(Segment*);
Segment* dupseg(Segment**, int, int);
-Segment* newseg(int, ulong, ulong);
-Segment* seg(Proc*, ulong, int);
+Segment* newseg(int, uintptr, ulong);
+Segment* seg(Proc*, uintptr, int);
+Segment* txt2data(Segment*);
void hnputv(void*, uvlong);
void hnputl(void*, uint);
void hnputs(void*, ushort);
uint nhgetl(void*);
ushort nhgets(void*);
ulong µs(void);
-void _xinc(long*);
-long _xdec(long*);
long lcycles(void);
#pragma varargck argpos iprint 1