From: Ben Gras Date: Sun, 25 Mar 2012 18:25:53 +0000 (+0200) Subject: retire PUBLIC, PRIVATE and FORWARD X-Git-Tag: v3.2.1~645 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=7336a67dfec7ab328d10e4e507be2f8a4e0cc816;p=minix.git retire PUBLIC, PRIVATE and FORWARD --- diff --git a/commands/mdb/core.c b/commands/mdb/core.c index ce9d0cb7b..acccd565e 100644 --- a/commands/mdb/core.c +++ b/commands/mdb/core.c @@ -27,7 +27,7 @@ extern struct proc *prc; #define BSIZE 512 #define LOGBS 9 -PRIVATE struct file { +static struct file { int fid; char *name; long cblock; @@ -47,26 +47,26 @@ PRIVATE struct file { #define e3 smap[1] #define f3 smap[2] -PRIVATE long cnt[3]; /* Sizes of segments */ -PRIVATE int h_size; /* Size of core header */ -PRIVATE char def_name[] = "core"; /* Default core name */ +static long cnt[3]; /* Sizes of segments */ +static int h_size; /* Size of core header */ +static char def_name[] = "core"; /* Default core name */ #define SIZE_MP_SEG (sizeof(struct mem_map) * NR_LOCAL_SEGS) #define SIZE_KINFO sizeof(struct proc) #define SIZE_HEADER SIZE_MP_SEG -FORWARD int kernel_info(int fd ); -FORWARD void setmap(struct file *fp ); -FORWARD void read_info(struct file *fp ); -FORWARD void ill_addr(long d , int segment ); -FORWARD long map_addr(long d , int segment ); -FORWARD unsigned long c_status(void); -FORWARD long getn(long d, int s); +static int kernel_info(int fd ); +static void setmap(struct file *fp ); +static void read_info(struct file *fp ); +static void ill_addr(long d , int segment ); +static long map_addr(long d , int segment ); +static unsigned long c_status(void); +static long getn(long d, int s); /* * set and display mapping for core file */ -PRIVATE void setmap(fp) +static void setmap(fp) struct file *fp; { long h = (long) h_size; @@ -107,7 +107,7 @@ long h = (long) h_size; } /* Print mapping */ -PUBLIC void prtmap() +void prtmap() { Printf("%s I & D space\t", (is_separate) ? "Separate " : "Combined "); if (corepid > 0) { @@ -123,7 +123,7 @@ PUBLIC void prtmap() } /* Illegal address */ -PRIVATE void ill_addr(d, segment) +static void ill_addr(d, segment) long d; int segment; { @@ -134,7 +134,7 @@ int segment; /* Map virtual address -> core file addresses * depends on current segment if Separate I & D */ -PRIVATE long map_addr(d, segment) +static long map_addr(d, segment) long d; int segment; { @@ -175,7 +175,7 @@ int segment; /* Get value with address d and segment s */ -PRIVATE long getn(d, s) +static long getn(d, s) long d; int s; { @@ -209,7 +209,7 @@ int s; } /* Read kernel info from core file into lbuf[] */ -PRIVATE int kernel_info(fd) +static int kernel_info(fd) int fd; { int r; @@ -225,7 +225,7 @@ int fd; /* * Print status info from core - returns PC */ -PRIVATE unsigned long c_status() +static unsigned long c_status() { fprintf(stderr, "WARNING: don't know pid from core; using proc nr for pid.\n"); @@ -241,7 +241,7 @@ PRIVATE unsigned long c_status() } /* Read memory maps and kernel info from core file */ -PRIVATE void read_info(fp) +static void read_info(fp) struct file *fp; { struct mem_map seg[NR_LOCAL_SEGS]; @@ -292,7 +292,7 @@ struct file *fp; /* initialization for core files * returns PC address from core file */ -PUBLIC unsigned long core_init(filename) +unsigned long core_init(filename) char *filename; { core_file = &Core_File; @@ -321,7 +321,7 @@ char *filename; * always returns 0 * Similar to core files. */ -PUBLIC unsigned long file_init(filename) +unsigned long file_init(filename) char *filename; { core_file = &Core_File; @@ -349,7 +349,7 @@ char *filename; * Read from core file * Called by mdbtrace() */ -PUBLIC long read_core(req, addr, data) +long read_core(req, addr, data) int req; long addr, data; { diff --git a/commands/mdb/decode.c b/commands/mdb/decode.c index 1325fbeb6..4a7abecea 100644 --- a/commands/mdb/decode.c +++ b/commands/mdb/decode.c @@ -14,13 +14,13 @@ #include #include "proto.h" -FORWARD void get_message(message *m, unsigned bx); -FORWARD void get_data(char *s, unsigned bx, int cnt); +static void get_message(message *m, unsigned bx); +static void get_data(char *s, unsigned bx, int cnt); -PRIVATE message sent; -PRIVATE message recv; -PRIVATE unsigned saved_addr; -PRIVATE int last_call; +static message sent; +static message recv; +static unsigned saved_addr; +static int last_call; #define NOSYS 0 #define NOP 1 @@ -164,7 +164,7 @@ struct decode_system { REBOOT, M1_I1, NOP, "REBOOT" }; -PRIVATE void get_message(m,bx) +static void get_message(m,bx) message *m; unsigned bx; { @@ -181,7 +181,7 @@ unsigned bx; } -PRIVATE void get_data(s, bx, cnt) +static void get_data(s, bx, cnt) char *s; unsigned bx; int cnt; @@ -199,7 +199,7 @@ int cnt; } -PUBLIC void decode_result() +void decode_result() { /* Update message */ diff --git a/commands/mdb/gnu_sym.c b/commands/mdb/gnu_sym.c index 68961206f..bb4b521ee 100644 --- a/commands/mdb/gnu_sym.c +++ b/commands/mdb/gnu_sym.c @@ -48,18 +48,18 @@ struct symtab_s unsigned int nsym; }; -PRIVATE struct symtab_s symtab; +static struct symtab_s symtab; -FORWARD void gnu_sort(struct newnlist *array , struct newnlist *top ); -FORWARD int gnu_symeq(char *t , struct newnlist *sp ); -FORWARD int gnu_symprefix(char *t , struct newnlist *sp ); -FORWARD struct newnlist *gnu_sname(char *name, int is_text, int +static void gnu_sort(struct newnlist *array , struct newnlist *top ); +static int gnu_symeq(char *t , struct newnlist *sp ); +static int gnu_symprefix(char *t , struct newnlist *sp ); +static struct newnlist *gnu_sname(char *name, int is_text, int allflag); -FORWARD struct newnlist *gnu_sval(off_t value, int where); -FORWARD void gnu_sym(struct newnlist *sp, off_t off); +static struct newnlist *gnu_sval(off_t value, int where); +static void gnu_sym(struct newnlist *sp, off_t off); -PUBLIC void gnu_init( filename ) +void gnu_init( filename ) char *filename; { struct exec header; @@ -131,7 +131,7 @@ char *filename; } -PUBLIC long gnu_symbolvalue( name, is_text ) +long gnu_symbolvalue( name, is_text ) char *name; int is_text; { @@ -144,7 +144,7 @@ int is_text; } -PRIVATE struct newnlist *gnu_sname( name, is_text, allflag ) +static struct newnlist *gnu_sname( name, is_text, allflag ) char *name; int is_text; int allflag; @@ -204,7 +204,7 @@ int allflag; return NULL; } -PRIVATE struct newnlist *gnu_sval( value, where ) +static struct newnlist *gnu_sval( value, where ) off_t value; int where; { @@ -242,7 +242,7 @@ int where; } -PRIVATE void gnu_sym( sp, off ) +static void gnu_sym( sp, off ) struct newnlist *sp; off_t off; { @@ -260,7 +260,7 @@ off_t off; /* shell sort symbols on value */ -PRIVATE void gnu_sort( array, top ) +static void gnu_sort( array, top ) struct newnlist *array; struct newnlist *top; { @@ -294,7 +294,7 @@ struct newnlist *top; while ( (gap /= 3) != 0 ); } -PUBLIC void gnu_symbolic( value, separator ) +void gnu_symbolic( value, separator ) off_t value; int separator; { @@ -330,14 +330,14 @@ int separator; } -PRIVATE int gnu_symeq( t, sp ) +static int gnu_symeq( t, sp ) register char *t; struct newnlist *sp; { return strncmp( t, sp->n_un.n_name, strlen(t) ) == 0; } -PRIVATE int gnu_symprefix( t, sp ) +static int gnu_symprefix( t, sp ) register char *t; struct newnlist *sp; { @@ -356,7 +356,7 @@ struct newnlist *sp; /* list all symbols - test for selection criteria */ -PUBLIC void gnu_listsym( tchar ) +void gnu_listsym( tchar ) char tchar; { register struct symtab_s *tp; @@ -396,7 +396,7 @@ char tchar; } } -PUBLIC int gnu_text_symbol(value) +int gnu_text_symbol(value) off_t value; { struct newnlist *sp; @@ -410,7 +410,7 @@ off_t value; return FALSE; } -PUBLIC int gnu_finds_data(off,data_seg) +int gnu_finds_data(off,data_seg) off_t off; int data_seg; { @@ -425,7 +425,7 @@ int data_seg; return FALSE; } -PUBLIC int gnu_finds_pc(pc) +int gnu_finds_pc(pc) off_t pc; { struct newnlist *sp; diff --git a/commands/mdb/io.c b/commands/mdb/io.c index 2908794bf..7df8146c8 100644 --- a/commands/mdb/io.c +++ b/commands/mdb/io.c @@ -13,21 +13,21 @@ #define OUTBUFSIZE 512 #define PAGESIZE 24 -PRIVATE int forceupper = FALSE; -PRIVATE int someupper = FALSE; -PRIVATE int stringcount = 0; -PRIVATE char *string_ptr = NULL; /* stringptr ambiguous at 8th char */ -PRIVATE char *stringstart = NULL; - -PRIVATE char outbuf[OUTBUFSIZE]; -PRIVATE FILE *cmdfile = stdin; -PRIVATE FILE *outfile = stdout; -PRIVATE FILE *logfile; -PRIVATE int lineno; +static int forceupper = FALSE; +static int someupper = FALSE; +static int stringcount = 0; +static char *string_ptr = NULL; /* stringptr ambiguous at 8th char */ +static char *stringstart = NULL; + +static char outbuf[OUTBUFSIZE]; +static FILE *cmdfile = stdin; +static FILE *outfile = stdout; +static FILE *logfile; +static int lineno; int _doprnt(const char *format, va_list ap, FILE *stream ); -PUBLIC char *get_cmd(cbuf, csize) +char *get_cmd(cbuf, csize) char *cbuf; int csize; { @@ -50,7 +50,7 @@ char *r; return r; } -PUBLIC void openin(s) +void openin(s) char *s; { char *t; @@ -70,7 +70,7 @@ char *t; * from MINIX library * followed by outstr() */ -PUBLIC int Printf(const char *format, ...) +int Printf(const char *format, ...) { va_list ap; int retval; @@ -102,7 +102,7 @@ PUBLIC int Printf(const char *format, ...) /* * Set logging options */ -PUBLIC void logging( c, name ) +void logging( c, name ) int c; char *name; { @@ -142,7 +142,7 @@ char *t; } /* Output system error string */ -PUBLIC void do_error(m) +void do_error(m) char *m; { outstr(m); @@ -151,7 +151,7 @@ char *m; outstr("\n"); } -PUBLIC void closestring() +void closestring() { /* close string device */ @@ -159,7 +159,7 @@ PUBLIC void closestring() stringstart = string_ptr = NULL; } -PUBLIC int mytolower(ch) +int mytolower(ch) int ch; { /* convert char to lower case */ @@ -170,7 +170,7 @@ int ch; } -PUBLIC void openstring(string) +void openstring(string) char *string; { /* open string device */ @@ -179,7 +179,7 @@ char *string; stringstart = string_ptr = string; } -PUBLIC void outbyte(byte) +void outbyte(byte) int byte; { /* print char to currently open output devices */ @@ -215,15 +215,15 @@ int byte; } -PUBLIC void outcomma() +void outcomma() { /* print comma */ outbyte(','); } -PRIVATE char hexdigits[] = "0123456789ABCDEF"; -PUBLIC void outh4(num) +static char hexdigits[] = "0123456789ABCDEF"; +void outh4(num) unsigned num; { /* print 4 bits hex */ @@ -231,7 +231,7 @@ unsigned num; outbyte(hexdigits[num % 16]); } -PUBLIC void outh8(num) +void outh8(num) unsigned num; { /* print 8 bits hex */ @@ -240,7 +240,7 @@ unsigned num; outh4(num); } -PUBLIC void outh16(num) +void outh16(num) unsigned num; { /* print 16 bits hex */ @@ -249,7 +249,7 @@ unsigned num; outh8(num); } -PUBLIC void outh32(num) +void outh32(num) unsigned num; { /* print 32 bits hex */ @@ -258,14 +258,14 @@ unsigned num; outh16((u16_t) num); } -PUBLIC void outspace() +void outspace() { /* print space */ outbyte(' '); } -PUBLIC void outstr(s) +void outstr(s) register char *s; { /* print string */ @@ -274,14 +274,14 @@ register char *s; outbyte(*s++); } -PUBLIC void outtab() +void outtab() { /* print tab */ outbyte('\t'); } -PUBLIC void outustr(s) +void outustr(s) register char *s; { /* print string, perhaps converting case to upper */ @@ -293,14 +293,14 @@ register char *s; } -PUBLIC int stringpos() +int stringpos() { /* return current offset of string device */ return string_ptr - stringstart; } -PUBLIC int stringtab() +int stringtab() { /* return current "tab" spot of string device */ diff --git a/commands/mdb/ioctl.c b/commands/mdb/ioctl.c index 3da505ff7..0b8070c6b 100644 --- a/commands/mdb/ioctl.c +++ b/commands/mdb/ioctl.c @@ -15,7 +15,7 @@ #include #include "proto.h" -PRIVATE int get_request; +static int get_request; /* * decode ioctl call diff --git a/commands/mdb/kernel.c b/commands/mdb/kernel.c index ccc50d176..5e0b0ecf4 100644 --- a/commands/mdb/kernel.c +++ b/commands/mdb/kernel.c @@ -24,12 +24,12 @@ struct proc *prc; long lbuf[SIZ]; -PRIVATE char segment_name[] = "TDS"; +static char segment_name[] = "TDS"; /* * Display memory maps */ -PUBLIC void disp_maps() +void disp_maps() { int i; long int vir, phy, len; @@ -45,7 +45,7 @@ PUBLIC void disp_maps() } } -PUBLIC void update() +void update() { int i; @@ -68,7 +68,7 @@ PUBLIC void update() } -PUBLIC int disp_regs() +int disp_regs() { int i; @@ -118,13 +118,13 @@ PUBLIC int disp_regs() #ifdef MINIX_PC #ifdef __i386 -PRIVATE char regs[] = "fs gs ds es di si bp bx dx cx ax ip cs ps sp ss"; +static char regs[] = "fs gs ds es di si bp bx dx cx ax ip cs ps sp ss"; #else -PRIVATE char regs[] = "es ds di si bp bx dx cx ax ip cs ps sp ss"; +static char regs[] = "es ds di si bp bx dx cx ax ip cs ps sp ss"; #endif /* Get register for pid at offset k */ -PUBLIC long get_reg(pid, k) +long get_reg(pid, k) int pid; long k; { @@ -149,7 +149,7 @@ long k; /* Set register for pid at offset k */ -PUBLIC void set_reg(pid, k, value) +void set_reg(pid, k, value) int pid; long k; long value; @@ -164,7 +164,7 @@ long value; } -PUBLIC long reg_addr(s) +long reg_addr(s) char *s; { long val; @@ -198,7 +198,7 @@ char *s; } -PUBLIC int outsegreg(num) +int outsegreg(num) off_t num; { /* print segment register */ @@ -217,14 +217,14 @@ off_t num; #ifdef MINIX_ST /* Get register for pid at offset k */ -PUBLIC long get_reg(pid, k) +long get_reg(pid, k) int pid; long k; { return ptrace(T_GETUSER, pid, k, 0L); } -PUBLIC long reg_addr(s) +long reg_addr(s) char *s; { long val; diff --git a/commands/mdb/mdb.c b/commands/mdb/mdb.c index c9f6805b3..fca2bcda8 100644 --- a/commands/mdb/mdb.c +++ b/commands/mdb/mdb.c @@ -56,14 +56,14 @@ extern struct proc *prc; #define MAXLINE 128 #define MAXARG 20 -PRIVATE unsigned long lastexp = 0L; /* last expression and segment */ -PRIVATE int lastseg = NOSEG; -PRIVATE char *prog; /* prog name */ -PRIVATE char sbuf[MAXLINE]; -PRIVATE char cbuf[MAXLINE]; -PRIVATE char *cmd; /* current command */ -PRIVATE char *cmdstart; /* start of command */ -PRIVATE jmp_buf mainlp; +static unsigned long lastexp = 0L; /* last expression and segment */ +static int lastseg = NOSEG; +static char *prog; /* prog name */ +static char sbuf[MAXLINE]; +static char cbuf[MAXLINE]; +static char *cmd; /* current command */ +static char *cmdstart; /* start of command */ +static jmp_buf mainlp; struct b_pnt { @@ -75,30 +75,30 @@ struct b_pnt { int main(int argc, char *argv[]); -FORWARD void cleanup(void); -FORWARD void freepnt(struct b_pnt *pnt ); -FORWARD void findbpnt(int verbose ); -FORWARD int exebpnt(int restart ); -FORWARD void catch(int sig ); -FORWARD int run(char *name , char *argstr , int tflg ); -FORWARD int dowait(void); -FORWARD void backtrace(int all ); -FORWARD void modify(long addr , int cnt , int verbose , int size ); -FORWARD void display(long addr , int req ); -FORWARD void fill(long addr , int req ); -FORWARD void dorun(char *cmd ); -FORWARD void not_for_core(void); -FORWARD void command(void); - - -PRIVATE void cleanup() +static void cleanup(void); +static void freepnt(struct b_pnt *pnt ); +static void findbpnt(int verbose ); +static int exebpnt(int restart ); +static void catch(int sig ); +static int run(char *name , char *argstr , int tflg ); +static int dowait(void); +static void backtrace(int all ); +static void modify(long addr , int cnt , int verbose , int size ); +static void display(long addr , int req ); +static void fill(long addr , int req ); +static void dorun(char *cmd ); +static void not_for_core(void); +static void command(void); + + +static void cleanup() { curpid = 0; curpnt = NULL; while (b_head) freepnt(b_head); } -PRIVATE void findbpnt(verbose) +static void findbpnt(verbose) int verbose; { for (curpnt = b_head; curpnt; curpnt = curpnt->nxt) { @@ -121,7 +121,7 @@ int verbose; if (verbose) Printf("Unknown breakpoint hit.\n"); } -PRIVATE int exebpnt(restart) +static int exebpnt(restart) int restart; { ptrace(T_STEP, curpid, 0L, (long) restart); @@ -132,7 +132,7 @@ int restart; } -PRIVATE void freepnt(pnt) +static void freepnt(pnt) struct b_pnt *pnt; { if (pnt->prv) @@ -146,7 +146,7 @@ struct b_pnt *pnt; } -PUBLIC long breakpt(addr, cmd) +long breakpt(addr, cmd) long addr; char *cmd; { @@ -182,7 +182,7 @@ char *cmd; return new->oldval; } -PRIVATE void catch(sig) +static void catch(sig) int sig; { signal(sig, catch); @@ -192,7 +192,7 @@ int sig; } -PRIVATE int dowait() +static int dowait() { int stat; @@ -215,7 +215,7 @@ PRIVATE int dowait() -PUBLIC void tstart(req, verbose, val, cnt) +void tstart(req, verbose, val, cnt) int req, verbose, val, cnt; { if (curpid == 0) { @@ -255,7 +255,7 @@ int req, verbose, val, cnt; if ( verbose ) dasm((long) PC_MEMBER(prc), 1, 1); } -PRIVATE int run(name, argstr, tflg) +static int run(name, argstr, tflg) char *name, *argstr; int tflg; { @@ -301,7 +301,7 @@ int tflg; } -PRIVATE void dorun(cmd) +static void dorun(cmd) char *cmd; { if (curpid = run(prog, cmd, 1)) { @@ -316,7 +316,7 @@ char *cmd; /* * backtrace - inspect the stack */ -PRIVATE void backtrace(all) +static void backtrace(all) int all; { unsigned long pc, bp, off, val, obp; @@ -397,7 +397,7 @@ skiplp: while (all && (reg_t) bp); } -PRIVATE void modify(addr, cnt, verbose, size) +static void modify(addr, cnt, verbose, size) long addr; int cnt, verbose, size; { @@ -438,7 +438,7 @@ int cnt, verbose, size; return; } -PRIVATE void display(addr, req) +static void display(addr, req) long addr; int req; { @@ -533,7 +533,7 @@ exitlp: Printf("\n"); } -PRIVATE void fill(addr, req) +static void fill(addr, req) long addr; int req; { @@ -579,13 +579,13 @@ int req; while (--count > 0); } -PRIVATE void not_for_core() +static void not_for_core() { if (corepid > 0) mdb_error("Illegal command for 'core' file\n"); } -PRIVATE void command() +static void command() { char c, *p; int i; @@ -856,14 +856,14 @@ PRIVATE void command() if (*cmd == ';') cmd = skip(cmd + 1); } -PUBLIC void mdb_error(s) +void mdb_error(s) char *s; { Printf("%s",s); longjmp(mainlp, 0); } -PUBLIC int main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/commands/mdb/mdbdis86.c b/commands/mdb/mdbdis86.c index de2b012ad..dcb1c8998 100644 --- a/commands/mdb/mdbdis86.c +++ b/commands/mdb/mdbdis86.c @@ -15,18 +15,18 @@ struct address_s off_t base; }; -PRIVATE int bits32; -PRIVATE struct address_s uptr; - -FORWARD u8_t get8(void); -FORWARD u16_t get16(void); -FORWARD u32_t get32(void); -FORWARD u8_t peek_byte(off_t addr); -FORWARD u16_t peek_word(off_t addr); -FORWARD int puti(void); -FORWARD int outsegaddr(struct address_s *addr); -FORWARD int outssegaddr(struct address_s *addr); -FORWARD int show1instruction(void); +static int bits32; +static struct address_s uptr; + +static u8_t get8(void); +static u16_t get16(void); +static u32_t get32(void); +static u8_t peek_byte(off_t addr); +static u16_t peek_word(off_t addr); +static int puti(void); +static int outsegaddr(struct address_s *addr); +static int outssegaddr(struct address_s *addr); +static int show1instruction(void); /************************* UNASM ******************************/ @@ -62,73 +62,73 @@ typedef int reg_pt; typedef int su16_t; typedef int su8_pt; -FORWARD su8_pt get8s(void); -FORWARD void getmodregrm(void); -FORWARD void i_00_to_3f(opcode_pt opc ); -FORWARD void i_40_to_5f(opcode_pt opc ); -FORWARD void i_60_to_6f(opcode_pt opc ); -FORWARD void i_70_to_7f(opcode_pt opc ); -FORWARD void i_80(opcode_pt opc ); -FORWARD void i_88(opcode_pt opc ); -FORWARD void i_90(opcode_pt opc ); -FORWARD void i_98(opcode_pt opc ); -FORWARD void i_a0(opcode_pt opc ); -FORWARD void i_a8(opcode_pt opc ); -FORWARD void i_b0(opcode_pt opc ); -FORWARD void i_b8(opcode_pt opc ); -FORWARD void i_c0(opcode_pt opc ); -FORWARD void i_c8(opcode_pt opc ); -FORWARD void i_d0(opcode_pt opc ); -FORWARD void i_d8(opcode_pt opc ); -FORWARD void i_e0(opcode_pt opc ); -FORWARD void i_e8(opcode_pt opc ); -FORWARD void i_f0(opcode_pt opc ); -FORWARD void i_f8(opcode_pt opc ); -FORWARD void outad(opcode_pt opc ); -FORWARD void outad1(opcode_pt opc ); -FORWARD void outalorx(opcode_pt opc ); -FORWARD void outax(void); -FORWARD void outbptr(void); -FORWARD void outbwptr(opcode_pt opc ); -FORWARD void outea(opcode_pt wordflags ); -FORWARD void outf1(void); -FORWARD void out32offset(void); -FORWARD void outfishy(void); -FORWARD void outgetaddr(void); -FORWARD void outimmed(opcode_pt signwordflag ); -FORWARD void outpc(off_t pc ); -FORWARD void outsegpc(void); -FORWARD void oututstr(char *s ); -FORWARD void outword(void); -FORWARD void outwptr(void); -FORWARD void outwsize(void); -FORWARD void pagef(void); -FORWARD void shift(opcode_pt opc ); -FORWARD void checkmemory(void); -FORWARD void CL(void); -FORWARD void Eb(void); -FORWARD void Ev(void); -FORWARD void EvGv(void); -FORWARD void EvIb(void); -FORWARD void Ew(void); -FORWARD void EwRw(void); -FORWARD void Gv(void); -FORWARD void Gv1(void); -FORWARD void GvEv(void); -FORWARD void GvEw(void); -FORWARD void GvM(void); -FORWARD void GvMa(void); -FORWARD void GvMp(void); -FORWARD void Ib(void); -FORWARD void Iw(void); -FORWARD void Iv(void); -FORWARD void Jb(void); -FORWARD void Jv(void); -FORWARD void Ms(void); +static su8_pt get8s(void); +static void getmodregrm(void); +static void i_00_to_3f(opcode_pt opc ); +static void i_40_to_5f(opcode_pt opc ); +static void i_60_to_6f(opcode_pt opc ); +static void i_70_to_7f(opcode_pt opc ); +static void i_80(opcode_pt opc ); +static void i_88(opcode_pt opc ); +static void i_90(opcode_pt opc ); +static void i_98(opcode_pt opc ); +static void i_a0(opcode_pt opc ); +static void i_a8(opcode_pt opc ); +static void i_b0(opcode_pt opc ); +static void i_b8(opcode_pt opc ); +static void i_c0(opcode_pt opc ); +static void i_c8(opcode_pt opc ); +static void i_d0(opcode_pt opc ); +static void i_d8(opcode_pt opc ); +static void i_e0(opcode_pt opc ); +static void i_e8(opcode_pt opc ); +static void i_f0(opcode_pt opc ); +static void i_f8(opcode_pt opc ); +static void outad(opcode_pt opc ); +static void outad1(opcode_pt opc ); +static void outalorx(opcode_pt opc ); +static void outax(void); +static void outbptr(void); +static void outbwptr(opcode_pt opc ); +static void outea(opcode_pt wordflags ); +static void outf1(void); +static void out32offset(void); +static void outfishy(void); +static void outgetaddr(void); +static void outimmed(opcode_pt signwordflag ); +static void outpc(off_t pc ); +static void outsegpc(void); +static void oututstr(char *s ); +static void outword(void); +static void outwptr(void); +static void outwsize(void); +static void pagef(void); +static void shift(opcode_pt opc ); +static void checkmemory(void); +static void CL(void); +static void Eb(void); +static void Ev(void); +static void EvGv(void); +static void EvIb(void); +static void Ew(void); +static void EwRw(void); +static void Gv(void); +static void Gv1(void); +static void GvEv(void); +static void GvEw(void); +static void GvM(void); +static void GvMa(void); +static void GvMp(void); +static void Ib(void); +static void Iw(void); +static void Iv(void); +static void Jb(void); +static void Jv(void); +static void Ms(void); typedef void(*pfv_t) (opcode_pt opc ); -PRIVATE pfv_t optable[] = +static pfv_t optable[] = { i_00_to_3f, i_00_to_3f, @@ -164,33 +164,33 @@ PRIVATE pfv_t optable[] = i_f8, }; -PRIVATE char fishy[] = "???"; -PRIVATE char movtab[] = "mov\t"; +static char fishy[] = "???"; +static char movtab[] = "mov\t"; -PRIVATE char *genreg[] = +static char *genreg[] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", }; -PRIVATE char *segreg[] = +static char *segreg[] = { "es", "cs", "ss", "ds", "fs", "gs", "?s", "?s", }; -PRIVATE char *indreg[] = +static char *indreg[] = { "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx", }; -PRIVATE char *str_00_to_3f[] = +static char *str_00_to_3f[] = { /* index by (opcode >> 3) & 7 */ "add", "or", "adc", "sbb", "and", "sub", "xor", "cmp", }; -PRIVATE char *sstr_00_to_3f[] = +static char *sstr_00_to_3f[] = { /* index ((opc>>2) & 0x0E) + (opc & 7) - 6 */ "push\tes", "pop\tes", "push\tcs", "pop\tcs", @@ -198,7 +198,7 @@ PRIVATE char *sstr_00_to_3f[] = "es:", "daa", "cs:", "das", "ss:", "aaa", "ds:", "aas", }; -PRIVATE char *sstr_0f[] = +static char *sstr_0f[] = { "push\tfs", "pop\tfs", fishy, "bt\t", "shld\t", "shld\t", fishy, fishy, "push\tgs", "pop\tgs", fishy, "bts\t", "shrd\t", "shrd\t", fishy, "imul\t", @@ -206,69 +206,69 @@ PRIVATE char *sstr_0f[] = fishy, fishy, "", "btc\t", "bsf\t", "bsr\t", "movsx\t", "movsx\t", }; -PRIVATE char *ssstr_0f[] = +static char *ssstr_0f[] = { "sldt\t", "str\t", "lldt\t", "ltr\t", "verr\t", "verw\t", fishy, fishy, "sgdt\t", "sidt\t", "lgdt\t", "lidt\t", "smsw\t", fishy, "lmsw\t", fishy, fishy, fishy, fishy, fishy, "bt\t", "bts\t", "btr\t", "btc\t", }; -PRIVATE char *str_40_to_5f[] = +static char *str_40_to_5f[] = { /* index by (opcode >> 3) & 3 */ "inc\t", "dec\t", "push\t", "pop\t", }; -PRIVATE char *str_60_to_6f[] = +static char *str_60_to_6f[] = { "pusha", "popa", "bound\t", "arpl\t", "fs:", "gs:", "os:", "as:", "push\t", "imul\t", "push\t", "imul\t", "insb", "ins", "outsb", "outs", }; -PRIVATE char *str_flags[] = +static char *str_flags[] = { /* opcodes 0x70 to 0x7F, and 0x0F80 to 0x0F9F */ "o", "no", "b", "nb", "z", "nz", "be", "a", "s", "ns", "pe", "po", "l", "ge", "le", "g", }; -PRIVATE char *str_98[] = +static char *str_98[] = { "cbw", "cwd", "call\t", "wait", "pushf", "popf", "sahf", "lahf", "cwde", "cdq", "call\t", "wait", "pushfd", "popfd", "sahf", "lahf", }; -PRIVATE char *str_a0[] = +static char *str_a0[] = { movtab, movtab, movtab, movtab, "movsb", "movs", "cmpsb", "cmps", }; -PRIVATE char *str_a8[] = +static char *str_a8[] = { "test\t", "test\t", "stosb", "stos", "lodsb", "lods", "scasb", "scas", }; -PRIVATE char *str_c0[] = +static char *str_c0[] = { "", "", "ret\t", "ret", "les\t", "lds\t", movtab, movtab, }; -PRIVATE char *str_c8[] = +static char *str_c8[] = { "enter\t", "leave", "retf\t", "retf", "int\t3", "int\t", "into", "iret", }; -PRIVATE char *str_d0[] = +static char *str_d0[] = { "aam", "aad", "db\td6", "xlat", }; -PRIVATE char *sstr_d0[] = +static char *sstr_d0[] = { "rol", "ror", "rcl", "rcr", "shl", "shr", fishy, "sar", }; -PRIVATE char *str_d8[] = +static char *str_d8[] = { "fadd", "fmul", "fcom", "fcomp", "fsub", "fsubr", "fdiv", "fdivr", "fld", NULL, "fst", "fstp", "fldenv", "fldcw", "fstenv", "fstcw", @@ -280,7 +280,7 @@ PRIVATE char *str_d8[] = "fild", NULL, "fist", "fistp", "fbld", "fild", "fbstp", "fistp", }; -PRIVATE char *str1_d8[] = +static char *str1_d8[] = { "fadd", "fmul", "fcom", "fcomp", "fsub", "fsubr", "fdiv", "fdivr", "fld", "fxch", "\0\0", NULL, "\0\10", "\0\20", "\0\30", "\0\40", @@ -292,7 +292,7 @@ PRIVATE char *str1_d8[] = NULL, NULL, NULL, NULL, "\0\100", NULL, NULL, NULL, }; -PRIVATE unsigned char size_d8[] = +static unsigned char size_d8[] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 14-28, 2, 14-28, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 0, 10, 0, 10, @@ -300,7 +300,7 @@ PRIVATE unsigned char size_d8[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 10, 8, 10, 8, }; -PRIVATE char *sstr_d8[] = +static char *sstr_d8[] = { "fnop", NULL, NULL, NULL, /* D9D0 */ NULL, NULL, NULL, NULL, @@ -322,57 +322,57 @@ PRIVATE char *sstr_d8[] = "fstsw\tax", NULL, NULL, NULL, }; -PRIVATE char *str_e0[] = +static char *str_e0[] = { "loopnz\t", "loopz\t", "loop\t", "jcxz\t", "in\t", "in\t", "out\t", "out\t", }; -PRIVATE char *str_e8[] = +static char *str_e8[] = { "call\t", "jmp\t", "jmp\t", "jmp\t", "in\t", "in\t", "out\t", "out\t", }; -PRIVATE char *str_f0[] = +static char *str_f0[] = { "lock\t", "db\tf1", "repnz\t", "repz\t", "hlt", "cmc", /* other 2 from sstr_f0 */ }; -PRIVATE char *sstr_f0[] = +static char *sstr_f0[] = { "test\t", fishy, "not\t", "neg\t", "mul\t", "imul\t", "div\t", "idiv\t", }; -PRIVATE char *str_f8[] = +static char *str_f8[] = { "clc", "stc", "cli", "sti", "cld", "std", /* other 2 from sstr_f8 */ }; -PRIVATE char *sstr_f8[] = +static char *sstr_f8[] = { "inc\t", "dec\t", "call\t", "call\tfar ", "jmp\t", "jmp\tfar ", "push\t", "???\t", }; -PRIVATE int data_seg; /* data segment (munged name for asld) */ -PRIVATE unsigned hasize; /* half address size in bits */ -PRIVATE unsigned hdefsize; -PRIVATE unsigned hosize; /* half operand size in bits */ +static int data_seg; /* data segment (munged name for asld) */ +static unsigned hasize; /* half address size in bits */ +static unsigned hdefsize; +static unsigned hosize; /* half operand size in bits */ /* for easy index into reg tables */ -PRIVATE opcode_pt mod; -PRIVATE off_t offtable[2]; -PRIVATE off_t *offptr; -PRIVATE off_t *off1ptr; -PRIVATE opcode_pt reg; -PRIVATE opcode_pt rm; +static opcode_pt mod; +static off_t offtable[2]; +static off_t *offptr; +static off_t *off1ptr; +static opcode_pt reg; +static opcode_pt rm; -PRIVATE su8_pt get8s() +static su8_pt get8s() { su8_pt got; @@ -381,7 +381,7 @@ PRIVATE su8_pt get8s() return got; } -PRIVATE void getmodregrm() +static void getmodregrm() { opcode_pt modregrm; @@ -391,7 +391,7 @@ PRIVATE void getmodregrm() rm = (modregrm & RM_MASK) >> RM_SHIFT; } -PRIVATE void i_00_to_3f(opc) +static void i_00_to_3f(opc) opcode_pt opc; { opcode_pt sub; @@ -424,14 +424,14 @@ opcode_pt opc; } } -PRIVATE void i_40_to_5f(opc) +static void i_40_to_5f(opc) opcode_pt opc; { outustr(str_40_to_5f[(opc >> 3) & 3]); outustr(genreg[hosize + (opc & 7)]); } -PRIVATE void i_60_to_6f(opc) +static void i_60_to_6f(opc) opcode_pt opc; { /* most for 386, some for 286 */ @@ -485,7 +485,7 @@ opcode_pt opc; } } -PRIVATE void i_70_to_7f(opc) +static void i_70_to_7f(opc) opcode_pt opc; { outustr("j"); @@ -493,7 +493,7 @@ opcode_pt opc; Jb(); } -PRIVATE void i_80(opc) +static void i_80(opc) opcode_pt opc; { if (opc >= 4) @@ -519,7 +519,7 @@ opcode_pt opc; } } -PRIVATE void i_88(opc) +static void i_88(opc) opcode_pt opc; { if (opc < 4) @@ -559,7 +559,7 @@ opcode_pt opc; } } -PRIVATE void i_90(opc) +static void i_90(opc) opcode_pt opc; { if (opc == 0) @@ -573,7 +573,7 @@ opcode_pt opc; } } -PRIVATE void i_98(opc) +static void i_98(opc) opcode_pt opc; { outustr((str_98 - 8)[opc + hosize]); @@ -581,7 +581,7 @@ opcode_pt opc; outsegpc(); } -PRIVATE void i_a0(opc) +static void i_a0(opc) opcode_pt opc; { outustr(str_a0[opc]); @@ -599,7 +599,7 @@ opcode_pt opc; outwsize(); } -PRIVATE void i_a8(opc) +static void i_a8(opc) opcode_pt opc; { outustr(str_a8[opc]); @@ -613,7 +613,7 @@ opcode_pt opc; outwsize(); } -PRIVATE void i_b0(opc) +static void i_b0(opc) opcode_pt opc; { outustr(movtab); @@ -622,7 +622,7 @@ opcode_pt opc; Ib(); } -PRIVATE void i_b8(opc) +static void i_b8(opc) opcode_pt opc; { outustr(movtab); @@ -631,7 +631,7 @@ opcode_pt opc; Iv(); } -PRIVATE void i_c0(opc) +static void i_c0(opc) opcode_pt opc; { outustr(str_c0[opc]); @@ -654,7 +654,7 @@ opcode_pt opc; shift(opc); } -PRIVATE void i_c8(opc) +static void i_c8(opc) opcode_pt opc; { outustr(str_c8[opc]); @@ -672,7 +672,7 @@ opcode_pt opc; outwsize(); } -PRIVATE void i_d0(opc) +static void i_d0(opc) opcode_pt opc; { opcode_pt aabyte; @@ -691,7 +691,7 @@ opcode_pt opc; } } -PRIVATE void i_d8(opc) +static void i_d8(opc) opcode_pt opc; { opcode_pt esc; @@ -746,7 +746,7 @@ escape: outea(opc); } -PRIVATE void i_e0(opc) +static void i_e0(opc) opcode_pt opc; { outustr(str_e0[opc]); @@ -766,7 +766,7 @@ opcode_pt opc; } } -PRIVATE void i_e8(opc) +static void i_e8(opc) opcode_pt opc; { outustr(str_e8[opc]); @@ -793,7 +793,7 @@ opcode_pt opc; } } -PRIVATE void i_f0(opc) +static void i_f0(opc) opcode_pt opc; { if (opc < 6) @@ -812,7 +812,7 @@ opcode_pt opc; } } -PRIVATE void i_f8(opc) +static void i_f8(opc) opcode_pt opc; { if (opc < 6) @@ -829,14 +829,14 @@ opcode_pt opc; } } -PRIVATE void outad(opc) +static void outad(opc) opcode_pt opc; { getmodregrm(); outad1(opc); } -PRIVATE void outad1(opc) +static void outad1(opc) opcode_pt opc; { if (!(opc & TOREGBIT)) @@ -855,7 +855,7 @@ opcode_pt opc; } } -PRIVATE void outalorx(opc) +static void outalorx(opc) opcode_pt opc; { if (opc & WORDBIT) @@ -864,17 +864,17 @@ opcode_pt opc; outustr(genreg[0]); } -PRIVATE void outax() +static void outax() { outustr(genreg[hosize]); } -PRIVATE void outbptr() +static void outbptr() { outustr("byte ptr "); } -PRIVATE void outbwptr(opc) +static void outbwptr(opc) opcode_pt opc; { if (mod != REG_MOD) @@ -886,7 +886,7 @@ opcode_pt opc; } } -PRIVATE void outea(wordflags) +static void outea(wordflags) opcode_pt wordflags; { reg_pt base; @@ -943,7 +943,7 @@ opcode_pt wordflags; } } -PRIVATE void outf1() +static void outf1() { outustr("st("); outbyte((int) (rm + '0')); @@ -952,7 +952,7 @@ PRIVATE void outf1() #if (_WORD_SIZE == 4) -PRIVATE void out32offset() +static void out32offset() { off_t off; @@ -965,12 +965,12 @@ PRIVATE void out32offset() } #endif -PRIVATE void outfishy() +static void outfishy() { outustr("\t???"); } -PRIVATE void outgetaddr() +static void outgetaddr() { off_t off; @@ -987,7 +987,7 @@ PRIVATE void outgetaddr() outh16((u16_t) off); } -PRIVATE void outimmed(signwordflag) +static void outimmed(signwordflag) opcode_pt signwordflag; { su8_pt byte; @@ -1012,7 +1012,7 @@ opcode_pt signwordflag; Ib(); } -PRIVATE void outpc(pc) +static void outpc(pc) off_t pc; { if (hosize == 8) @@ -1026,7 +1026,7 @@ off_t pc; outh16((u16_t) pc); } -PRIVATE void outsegpc() +static void outsegpc() { off_t oldbase; off_t pc; @@ -1043,25 +1043,25 @@ PRIVATE void outsegpc() uptr.base = oldbase; } -PRIVATE void oututstr(s) +static void oututstr(s) char *s; { outustr(s); outtab(); } -PRIVATE void outword() +static void outword() { outustr("dword " + ((16 - hosize) >> 3)); } -PRIVATE void outwptr() +static void outwptr() { outword(); outustr("ptr "); } -PRIVATE void outwsize() +static void outwsize() { if (hosize == 16) outustr("d"); @@ -1069,7 +1069,7 @@ PRIVATE void outwsize() outustr("w"); } -PRIVATE void pagef() +static void pagef() { opcode_pt opc; int regbad; @@ -1214,7 +1214,7 @@ PRIVATE void pagef() outstr(fishy); } -PRIVATE int puti() +static int puti() { static int hadprefix; opcode_pt opcode; @@ -1270,7 +1270,7 @@ more: return TRUE; } -PRIVATE void shift(opc) +static void shift(opc) opcode_pt opc; { getmodregrm(); @@ -1286,28 +1286,28 @@ opcode_pt opc; outbyte('1'); } -PRIVATE void checkmemory() +static void checkmemory() { if (mod == REG_MOD) outfishy(); } -PRIVATE void CL() +static void CL() { outustr(genreg[1]); } -PRIVATE void Eb() +static void Eb() { outea(0); } -PRIVATE void Ev() +static void Ev() { outea(WORDBIT); } -PRIVATE void EvGv() +static void EvGv() { getmodregrm(); Ev(); @@ -1315,77 +1315,77 @@ PRIVATE void EvGv() Gv1(); } -PRIVATE void EvIb() +static void EvIb() { Ev(); outcomma(); Ib(); } -PRIVATE void Ew() +static void Ew() { hosize = 8; Ev(); } -PRIVATE void EwRw() +static void EwRw() { hosize = 8; EvGv(); } -PRIVATE void Gv() +static void Gv() { getmodregrm(); Gv1(); } -PRIVATE void Gv1() +static void Gv1() { outustr(genreg[hosize + reg]); } -PRIVATE void GvEv() +static void GvEv() { Gv(); outcomma(); Ev(); } -PRIVATE void GvEw() +static void GvEw() { Gv(); outcomma(); Ew(); } -PRIVATE void GvM() +static void GvM() { GvEv(); checkmemory(); } -PRIVATE void GvMa() +static void GvMa() { GvM(); } -PRIVATE void GvMp() +static void GvMp() { GvM(); } -PRIVATE void Ib() +static void Ib() { outh8(get8()); } -PRIVATE void Iw() +static void Iw() { outh16(get16()); } -PRIVATE void Iv() +static void Iv() { if (hosize == 16) outh32(get32()); @@ -1393,7 +1393,7 @@ PRIVATE void Iv() Iw(); } -PRIVATE void Jb() +static void Jb() { off_t pcjump; @@ -1401,7 +1401,7 @@ PRIVATE void Jb() outpc(pcjump + uptr.off); } -PRIVATE void Jv() +static void Jv() { off_t pcjump; @@ -1412,7 +1412,7 @@ PRIVATE void Jv() outpc(pcjump + uptr.off); } -PRIVATE void Ms() +static void Ms() { Ev(); checkmemory(); @@ -1420,7 +1420,7 @@ PRIVATE void Ms() /********************* DASM ******************************/ -PUBLIC long dasm( addr, count, symflg ) +long dasm( addr, count, symflg ) long addr; int count; int symflg; @@ -1437,7 +1437,7 @@ int symflg; } -PRIVATE int show1instruction() +static int show1instruction() { register int column; int idone; @@ -1481,7 +1481,7 @@ PRIVATE int show1instruction() } -PRIVATE u8_t get8() +static u8_t get8() { /* get 8 bits current instruction pointer and advance pointer */ @@ -1492,7 +1492,7 @@ PRIVATE u8_t get8() return temp; } -PRIVATE u16_t get16() +static u16_t get16() { /* get 16 bits from current instruction pointer and advance pointer */ @@ -1503,7 +1503,7 @@ PRIVATE u16_t get16() return temp; } -PRIVATE u32_t get32() +static u32_t get32() { /* get 32 bits from current instruction pointer and advance pointer */ @@ -1515,7 +1515,7 @@ PRIVATE u32_t get32() } -PRIVATE int outsegaddr(addr) +static int outsegaddr(addr) struct address_s *addr; { /* print segmented address */ @@ -1538,7 +1538,7 @@ struct address_s *addr; return bytes_printed + 4; } -PRIVATE int outssegaddr(addr) +static int outssegaddr(addr) struct address_s *addr; { /* print 32 bit segmented address and 2 spaces */ @@ -1551,13 +1551,13 @@ struct address_s *addr; return bytes_printed + 2; } -PRIVATE u8_t peek_byte(addr) +static u8_t peek_byte(addr) off_t addr; { return (u8_t) peek_dword(addr) & 0xFF; /* 8 bits only */ } -PRIVATE u16_t peek_word(addr) +static u16_t peek_word(addr) off_t addr; { return (u16_t) peek_dword(addr); diff --git a/commands/mdb/mdbexp.c b/commands/mdb/mdbexp.c index 10088c6f2..1d16cb7ea 100644 --- a/commands/mdb/mdbexp.c +++ b/commands/mdb/mdbexp.c @@ -16,15 +16,15 @@ #include #include "proto.h" -FORWARD long value(char *s , char **s_p , int *seg_p ); -FORWARD long lookup(char *s , char **s_p , int *seg_p ); +static long value(char *s , char **s_p , int *seg_p ); +static long lookup(char *s , char **s_p , int *seg_p ); #define idchar(c) (isalpha(c) || isdigit(c) || (c) == '_') /* * Get an expression for mdb */ -PUBLIC char *getexp(buf, exp_p, seg_p) +char *getexp(buf, exp_p, seg_p) char *buf; int *seg_p; long *exp_p; @@ -62,7 +62,7 @@ long *exp_p; * \n 0L * then calls lookup for symbols */ -PRIVATE long value(s, s_p, seg_p) +static long value(s, s_p, seg_p) char *s, **s_p; int *seg_p; { @@ -94,7 +94,7 @@ int *seg_p; * Handle special cases: _start T: D: S: * then call symbolvalue() */ -PRIVATE long lookup(s, s_p, seg_p) +static long lookup(s, s_p, seg_p) char *s, **s_p; int *seg_p; { @@ -148,7 +148,7 @@ int *seg_p; } /* Skip spaces */ -PUBLIC char *skip(s) +char *skip(s) register char *s; { while (isspace(*s)) ++s; diff --git a/commands/mdb/misc.c b/commands/mdb/misc.c index c671e0ec0..8bcaff4aa 100644 --- a/commands/mdb/misc.c +++ b/commands/mdb/misc.c @@ -12,10 +12,10 @@ #include #include "proto.h" -FORWARD void pr_ascii(long val , int size ); +static void pr_ascii(long val , int size ); /* Print ascii */ -PRIVATE void pr_ascii(val, size) +static void pr_ascii(val, size) long val; int size; { @@ -42,7 +42,7 @@ int size; } /* Dump stack */ -PUBLIC void dump_stack(cnt) +void dump_stack(cnt) long cnt; { vir_bytes v, vi; @@ -81,7 +81,7 @@ long cnt; /* Get file size */ -PUBLIC off_t file_size(fd) +off_t file_size(fd) int fd; { struct stat st; @@ -95,7 +95,7 @@ struct stat st; } /* Print help page */ -PUBLIC void help_page() +void help_page() { outstr("\nHelp for mdb. For more details, type 'command ?'\n"); outstr("!#\t- Shell escape / Set Variable or register\n"); @@ -133,7 +133,7 @@ PUBLIC void help_page() outstr(" mdb [-fc] file\n"); } -PUBLIC void version_info() +void version_info() { Printf("\nmdb version %s.%d for Minix", MDBVERSION, MDBBUILD ); Printf(" %s.%s", OS_RELEASE, OS_VERSION); @@ -151,7 +151,7 @@ PUBLIC void version_info() } /* Print help message on command */ -PUBLIC void help_on(h) +void help_on(h) int h; { diff --git a/commands/mdb/sym.c b/commands/mdb/sym.c index 7b3a1c49b..bf213123d 100644 --- a/commands/mdb/sym.c +++ b/commands/mdb/sym.c @@ -20,18 +20,18 @@ struct symtab_s unsigned nsym; }; -PRIVATE struct symtab_s symtab; -PRIVATE int type_of_exec; - -FORWARD int check_exec(struct exec *hdr); -FORWARD void sortsyms(struct nlist *array , struct nlist *top ); -FORWARD int symeq(char *t , struct nlist *sp ); -FORWARD int symprefix(char *t , struct nlist *sp ); -FORWARD struct nlist *findsname(char *name, int is_text, int allflag); -FORWARD void outsym(struct nlist *sp, off_t off); -FORWARD struct nlist *findsval(off_t value, int where); - -PUBLIC void syminit( filename ) +static struct symtab_s symtab; +static int type_of_exec; + +static int check_exec(struct exec *hdr); +static void sortsyms(struct nlist *array , struct nlist *top ); +static int symeq(char *t , struct nlist *sp ); +static int symprefix(char *t , struct nlist *sp ); +static struct nlist *findsname(char *name, int is_text, int allflag); +static void outsym(struct nlist *sp, off_t off); +static struct nlist *findsval(off_t value, int where); + +void syminit( filename ) char *filename; { int fd; @@ -100,7 +100,7 @@ char *filename; * return type of exec * or exit */ -PRIVATE int check_exec(hdr) +static int check_exec(hdr) struct exec *hdr; { long magic; @@ -159,7 +159,7 @@ long magic; } -PUBLIC long symbolvalue( name, is_text ) +long symbolvalue( name, is_text ) char *name; int is_text; { @@ -178,7 +178,7 @@ register struct nlist *sp; return 0L; } -PRIVATE struct nlist *findsname( name, is_text, allflag ) +static struct nlist *findsname( name, is_text, allflag ) char *name; int is_text; int allflag; @@ -240,7 +240,7 @@ int allflag; return NULL; } -PRIVATE struct nlist *findsval( value, where ) +static struct nlist *findsval( value, where ) off_t value; int where; { @@ -277,7 +277,7 @@ int where; } -PUBLIC void printhex(v) +void printhex(v) off_t v; { if ( v >= 65536L ) @@ -289,7 +289,7 @@ off_t v; } -PRIVATE void outsym( sp, off ) +static void outsym( sp, off ) struct nlist *sp; off_t off; { @@ -307,7 +307,7 @@ off_t off; /* shell sort symbols on value */ -PRIVATE void sortsyms( array, top ) +static void sortsyms( array, top ) struct nlist *array; struct nlist *top; { @@ -341,7 +341,7 @@ struct nlist *top; while ( (gap /= 3) != 0 ); } -PUBLIC void symbolic( value, separator ) +void symbolic( value, separator ) off_t value; int separator; { @@ -386,14 +386,14 @@ int separator; } -PRIVATE int symeq( t, sp ) +static int symeq( t, sp ) register char *t; struct nlist *sp; { return strncmp( t, sp->n_name, sizeof sp->n_name ) == 0; } -PRIVATE int symprefix( t, sp ) +static int symprefix( t, sp ) register char *t; struct nlist *sp; { @@ -412,7 +412,7 @@ struct nlist *sp; /* list all symbols - test for selection criteria */ -PUBLIC void listsym(cmd) +void listsym(cmd) char *cmd; { register struct symtab_s *tp; @@ -473,7 +473,7 @@ char *cmd; } -PUBLIC int text_symbol(value) +int text_symbol(value) off_t value; { struct nlist *sp; @@ -492,7 +492,7 @@ struct nlist *sp; return FALSE; } -PUBLIC int finds_data(off,data_seg) +int finds_data(off,data_seg) off_t off; int data_seg; { @@ -512,7 +512,7 @@ struct nlist *sp; return FALSE; } -PUBLIC int finds_pc(pc) +int finds_pc(pc) off_t pc; { struct nlist *sp; diff --git a/commands/mdb/syscalls.c b/commands/mdb/syscalls.c index c24c1590f..a4fedcac2 100644 --- a/commands/mdb/syscalls.c +++ b/commands/mdb/syscalls.c @@ -17,9 +17,9 @@ #define SYSCALL_OLD 0x20CD #endif -PRIVATE long intaddr; +static long intaddr; -PUBLIC void start_syscall(addr) +void start_syscall(addr) long addr; { long old; @@ -45,7 +45,7 @@ long old; } -PUBLIC void do_syscall(addr) +void do_syscall(addr) long addr; { unsigned reg_ax,reg_bx; diff --git a/commands/mdb/trace.c b/commands/mdb/trace.c index 66aae9299..4a64bbcb2 100644 --- a/commands/mdb/trace.c +++ b/commands/mdb/trace.c @@ -11,7 +11,7 @@ * Call ptrace and check for error if debugging running process * Otherwise read 'core' file */ -PUBLIC long mdbtrace(req, pid, addr, data) +long mdbtrace(req, pid, addr, data) int req, pid; long addr, data; { @@ -43,7 +43,7 @@ long addr, data; } /* Used by disassembler */ -PUBLIC u32_t peek_dword(addr) +u32_t peek_dword(addr) off_t addr; { return mdbtrace(T_GETINS, curpid, addr, 0L); diff --git a/commands/mkfs.mfs/mkfs.c b/commands/mkfs.mfs/mkfs.c index c4173ee14..ab495e2d3 100644 --- a/commands/mkfs.mfs/mkfs.c +++ b/commands/mkfs.mfs/mkfs.c @@ -100,8 +100,8 @@ void eat_dir(Ino_t parent); void eat_file(Ino_t inode, int f); void enter_dir(Ino_t parent, char *name, Ino_t child); void incr_size(Ino_t n, long count); -PRIVATE ino_t alloc_inode(int mode, int usrid, int grpid); -PRIVATE zone_t alloc_zone(void); +static ino_t alloc_inode(int mode, int usrid, int grpid); +static zone_t alloc_zone(void); void add_zone(Ino_t n, zone_t z, long bytes, long cur_time); void add_z_1(Ino_t n, zone_t z, long bytes, long cur_time); void add_z_2(Ino_t n, zone_t z, long bytes, long cur_time); @@ -880,7 +880,7 @@ long count; /*================================================================ * allocation assist group *===============================================================*/ -PRIVATE ino_t alloc_inode(mode, usrid, grpid) +static ino_t alloc_inode(mode, usrid, grpid) int mode, usrid, grpid; { ino_t num; @@ -924,7 +924,7 @@ int mode, usrid, grpid; } -PRIVATE zone_t alloc_zone() +static zone_t alloc_zone() { /* Allocate a new zone */ /* Works for zone > block */ diff --git a/commands/ps/ps.c b/commands/ps/ps.c index eccaf2552..4d978213c 100644 --- a/commands/ps/ps.c +++ b/commands/ps/ps.c @@ -135,7 +135,7 @@ int gettynames(void); * Tname assumes that the first three letters of the tty's name can be omitted * and returns the rest (except for the console, which yields "co"). */ -PRIVATE char *tname(dev_t dev_nr) +static char *tname(dev_t dev_nr) { unsigned int i; @@ -149,7 +149,7 @@ PRIVATE char *tname(dev_t dev_nr) } /* Find a task by its endpoint. */ -PRIVATE struct pstat *findtask(endpoint_t endpt) +static struct pstat *findtask(endpoint_t endpt) { struct pstat *ps; unsigned int slot; @@ -168,7 +168,7 @@ PRIVATE struct pstat *findtask(endpoint_t endpt) } /* Return canonical task name of the given endpoint. */ -PRIVATE char *taskname(endpoint_t endpt) +static char *taskname(endpoint_t endpt) { struct pstat *ps; @@ -180,7 +180,7 @@ PRIVATE char *taskname(endpoint_t endpt) /* Prrecv prints the RECV field for process with pstat buffer pointer ps. * This is either "ANY", "taskname", or "(blockreason) taskname". */ -PRIVATE char *prrecv(struct pstat *ps) +static char *prrecv(struct pstat *ps) { char *blkstr, *task; /* reason for blocking and task */ static char recvstr[20]; @@ -212,7 +212,7 @@ PRIVATE char *prrecv(struct pstat *ps) return recvstr; } -PRIVATE void getkinfo(void) +static void getkinfo(void) { FILE *fp; diff --git a/commands/service/parse.c b/commands/service/parse.c index 048246d3b..1fe637362 100644 --- a/commands/service/parse.c +++ b/commands/service/parse.c @@ -32,14 +32,14 @@ #include "config.h" #include "proto.h" -PRIVATE int class_recurs; /* Nesting level of class statements */ +static int class_recurs; /* Nesting level of class statements */ #define MAX_CLASS_RECURS 100 /* Max nesting level for classes */ #include "parse.h" -FORWARD void do_service(config_t *cpe, config_t *config, struct rs_config *); +static void do_service(config_t *cpe, config_t *config, struct rs_config *); -PRIVATE void do_class(config_t *cpe, config_t *config, struct rs_config *rs_config) +static void do_class(config_t *cpe, config_t *config, struct rs_config *rs_config) { config_t *cp, *cp1; @@ -110,7 +110,7 @@ PRIVATE void do_class(config_t *cpe, config_t *config, struct rs_config *rs_conf class_recurs--; } -PRIVATE void do_uid(config_t *cpe, struct rs_start *rs_start) +static void do_uid(config_t *cpe, struct rs_start *rs_start) { uid_t uid; struct passwd *pw; @@ -155,7 +155,7 @@ PRIVATE void do_uid(config_t *cpe, struct rs_start *rs_start) rs_start->rss_uid= uid; } -PRIVATE void do_sigmgr(config_t *cpe, struct rs_start *rs_start) +static void do_sigmgr(config_t *cpe, struct rs_start *rs_start) { endpoint_t sigmgr_ep; int r; @@ -192,7 +192,7 @@ PRIVATE void do_sigmgr(config_t *cpe, struct rs_start *rs_start) rs_start->rss_sigmgr= sigmgr_ep; } -PRIVATE void do_type(config_t *cpe, struct rs_config *rs_config) +static void do_type(config_t *cpe, struct rs_config *rs_config) { if (cpe->next != NULL) { @@ -223,7 +223,7 @@ PRIVATE void do_type(config_t *cpe, struct rs_config *rs_config) cpe->file, cpe->line); } -PRIVATE void do_descr(config_t *cpe, struct rs_config *rs_config) +static void do_descr(config_t *cpe, struct rs_config *rs_config) { if (cpe->next != NULL) { @@ -249,7 +249,7 @@ PRIVATE void do_descr(config_t *cpe, struct rs_config *rs_config) rs_config->descr = cpe->word; } -PRIVATE void do_scheduler(config_t *cpe, struct rs_start *rs_start) +static void do_scheduler(config_t *cpe, struct rs_start *rs_start) { endpoint_t scheduler_ep; int r; @@ -286,7 +286,7 @@ PRIVATE void do_scheduler(config_t *cpe, struct rs_start *rs_start) rs_start->rss_scheduler= scheduler_ep; } -PRIVATE void do_priority(config_t *cpe, struct rs_start *rs_start) +static void do_priority(config_t *cpe, struct rs_start *rs_start) { int priority_val; char *check; @@ -324,7 +324,7 @@ PRIVATE void do_priority(config_t *cpe, struct rs_start *rs_start) rs_start->rss_priority= priority_val; } -PRIVATE void do_quantum(config_t *cpe, struct rs_start *rs_start) +static void do_quantum(config_t *cpe, struct rs_start *rs_start) { int quantum_val; char *check; @@ -362,7 +362,7 @@ PRIVATE void do_quantum(config_t *cpe, struct rs_start *rs_start) rs_start->rss_quantum= quantum_val; } -PRIVATE void do_cpu(config_t *cpe, struct rs_start *rs_start) +static void do_cpu(config_t *cpe, struct rs_start *rs_start) { int cpu; char *check; @@ -400,7 +400,7 @@ PRIVATE void do_cpu(config_t *cpe, struct rs_start *rs_start) rs_start->rss_cpu= cpu; } -PRIVATE void do_irq(config_t *cpe, struct rs_start *rs_start) +static void do_irq(config_t *cpe, struct rs_start *rs_start) { int irq; int first; @@ -455,7 +455,7 @@ PRIVATE void do_irq(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_io(config_t *cpe, struct rs_start *rs_start) +static void do_io(config_t *cpe, struct rs_start *rs_start) { unsigned base, len; int first; @@ -517,7 +517,7 @@ PRIVATE void do_io(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_pci_device(config_t *cpe, struct rs_start *rs_start) +static void do_pci_device(config_t *cpe, struct rs_start *rs_start) { u16_t vid, did; char *check, *check2; @@ -554,7 +554,7 @@ PRIVATE void do_pci_device(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_pci_class(config_t *cpe, struct rs_start *rs_start) +static void do_pci_class(config_t *cpe, struct rs_start *rs_start) { u8_t baseclass, subclass, interface; u32_t class_id, mask; @@ -607,7 +607,7 @@ PRIVATE void do_pci_class(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_pci(config_t *cpe, struct rs_start *rs_start) +static void do_pci(config_t *cpe, struct rs_start *rs_start) { if (cpe == NULL) return; /* Empty PCI statement */ @@ -637,7 +637,7 @@ PRIVATE void do_pci(config_t *cpe, struct rs_start *rs_start) cpe->word, cpe->file, cpe->line); } -PRIVATE void do_ipc(config_t *cpe, struct rs_start *rs_start) +static void do_ipc(config_t *cpe, struct rs_start *rs_start) { char *list; const char *word; @@ -734,7 +734,7 @@ struct { NULL, 0 }, }; -PRIVATE void do_vm(config_t *cpe, struct rs_start *rs_start) +static void do_vm(config_t *cpe, struct rs_start *rs_start) { int i, first; @@ -821,7 +821,7 @@ struct { NULL, 0 } }; -PRIVATE void do_system(config_t *cpe, struct rs_start *rs_start) +static void do_system(config_t *cpe, struct rs_start *rs_start) { int i, first; @@ -882,7 +882,7 @@ PRIVATE void do_system(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_control(config_t *cpe, struct rs_start *rs_start) +static void do_control(config_t *cpe, struct rs_start *rs_start) { int nr_control = 0; @@ -912,7 +912,7 @@ PRIVATE void do_control(config_t *cpe, struct rs_start *rs_start) } } -PRIVATE void do_service(config_t *cpe, config_t *config, struct rs_config *rs_config) +static void do_service(config_t *cpe, config_t *config, struct rs_config *rs_config) { struct rs_start *rs_start = &rs_config->rs_start; config_t *cp; @@ -1031,7 +1031,7 @@ PRIVATE void do_service(config_t *cpe, config_t *config, struct rs_config *rs_co } } -PRIVATE const char *do_config(const char *label, char *filename, struct rs_config *rs_config) +static const char *do_config(const char *label, char *filename, struct rs_config *rs_config) { config_t *config, *cp, *cpe; struct passwd *pw; @@ -1109,7 +1109,7 @@ PRIVATE const char *do_config(const char *label, char *filename, struct rs_confi } /* returns failure */ -PUBLIC const char *parse_config(char *progname, int custom_config, char *req_config, +const char *parse_config(char *progname, int custom_config, char *req_config, struct rs_config *rs_config) { char *specificconfig, *specific_pkg_config; diff --git a/commands/service/service.c b/commands/service/service.c index 8f2b56d66..88d9bc767 100644 --- a/commands/service/service.c +++ b/commands/service/service.c @@ -40,7 +40,7 @@ #include "proto.h" /* This array defines all known requests. */ -PRIVATE char *known_requests[] = { +static char *known_requests[] = { "up", "down", "refresh", @@ -105,28 +105,28 @@ PRIVATE char *known_requests[] = { * parameters passed to this utility. Request parameters that are needed * are stored globally in the following variables: */ -PRIVATE int req_type; -PRIVATE int do_run= 0; /* 'run' command instead of 'up' */ -PRIVATE char *req_label = NULL; -PRIVATE char *req_path = NULL; -PRIVATE char *req_path_self = SELF_REQ_PATH; -PRIVATE char *req_args = ""; -PRIVATE int req_major = 0; -PRIVATE int devman_id = 0; -PRIVATE int req_dev_style = STYLE_NDEV; -PRIVATE long req_period = 0; -PRIVATE char *req_script = NULL; -PRIVATE char *req_config = PATH_CONFIG; -PRIVATE int custom_config_file = 0; -PRIVATE int req_lu_state = DEFAULT_LU_STATE; -PRIVATE int req_lu_maxtime = DEFAULT_LU_MAXTIME; +static int req_type; +static int do_run= 0; /* 'run' command instead of 'up' */ +static char *req_label = NULL; +static char *req_path = NULL; +static char *req_path_self = SELF_REQ_PATH; +static char *req_args = ""; +static int req_major = 0; +static int devman_id = 0; +static int req_dev_style = STYLE_NDEV; +static long req_period = 0; +static char *req_script = NULL; +static char *req_config = PATH_CONFIG; +static int custom_config_file = 0; +static int req_lu_state = DEFAULT_LU_STATE; +static int req_lu_maxtime = DEFAULT_LU_MAXTIME; /* Buffer to build "/command arg1 arg2 ..." string to pass to RS server. */ -PRIVATE char command[4096]; +static char command[4096]; /* An error occurred. Report the problem, print the usage, and exit. */ -PRIVATE void print_usage(char *app_name, char *problem) +static void print_usage(char *app_name, char *problem) { fprintf(stderr, "Warning, %s\n", problem); fprintf(stderr, "Usage:\n"); @@ -145,7 +145,7 @@ PRIVATE void print_usage(char *app_name, char *problem) /* A request to the RS server failed. Report and exit. */ -PRIVATE void failure(int request) +static void failure(int request) { fprintf(stderr, "Request 0x%x to RS failed: %s (error %d)\n", request, strerror(errno), errno); exit(errno); @@ -155,7 +155,7 @@ PRIVATE void failure(int request) /* Parse and verify correctness of arguments. Report problem and exit if an * error is found. Store needed parameters in global variables. */ -PRIVATE int parse_arguments(int argc, char **argv, u32_t *rss_flags) +static int parse_arguments(int argc, char **argv, u32_t *rss_flags) { struct stat stat_buf; char *hz, *buff; @@ -412,7 +412,7 @@ PRIVATE int parse_arguments(int argc, char **argv, u32_t *rss_flags) /* Main program. */ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { message m; int result = EXIT_SUCCESS; diff --git a/drivers/acpi/acpi.c b/drivers/acpi/acpi.c index 65fd1e03b..2e00e5b2d 100644 --- a/drivers/acpi/acpi.c +++ b/drivers/acpi/acpi.c @@ -5,11 +5,11 @@ #include "pci.h" -PUBLIC int acpi_enabled; -PUBLIC struct machine machine; +int acpi_enabled; +struct machine machine; /* don't know where ACPI tables are, we may need to access any memory */ -PRIVATE int init_mem_priv(void) +static int init_mem_priv(void) { struct mem_range mr; @@ -19,7 +19,7 @@ PRIVATE int init_mem_priv(void) return sys_privctl(SELF, SYS_PRIV_ADD_MEM, &mr); } -PRIVATE void set_machine_mode(void) +static void set_machine_mode(void) { ACPI_OBJECT arg1; ACPI_OBJECT_LIST args; @@ -40,7 +40,7 @@ PRIVATE void set_machine_mode(void) machine.apic_enabled ? "APIC" : "PIC"); } -PRIVATE ACPI_STATUS init_acpica(void) +static ACPI_STATUS init_acpica(void) { ACPI_STATUS status; @@ -71,7 +71,7 @@ PRIVATE ACPI_STATUS init_acpica(void) return AE_OK; } -PUBLIC void init_acpi(void) +void init_acpi(void) { ACPI_STATUS acpi_err; /* test conditions for acpi */ @@ -98,14 +98,14 @@ PUBLIC void init_acpi(void) } } -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { init_acpi(); return OK; } -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); diff --git a/drivers/acpi/osminixxf.c b/drivers/acpi/osminixxf.c index 398f3a665..3d35e964c 100644 --- a/drivers/acpi/osminixxf.c +++ b/drivers/acpi/osminixxf.c @@ -124,7 +124,7 @@ extern struct machine machine; -PRIVATE u32_t pci_inb(u16_t port) { +static u32_t pci_inb(u16_t port) { u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) @@ -132,7 +132,7 @@ PRIVATE u32_t pci_inb(u16_t port) { return value; } -PRIVATE u32_t pci_inw(u16_t port) { +static u32_t pci_inw(u16_t port) { u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) @@ -140,7 +140,7 @@ PRIVATE u32_t pci_inw(u16_t port) { return value; } -PRIVATE u32_t pci_inl(u16_t port) { +static u32_t pci_inl(u16_t port) { u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) @@ -148,19 +148,19 @@ PRIVATE u32_t pci_inl(u16_t port) { return value; } -PRIVATE void pci_outb(u16_t port, u8_t value) { +static void pci_outb(u16_t port, u8_t value) { int s; if ((s=sys_outb(port, value)) !=OK) printf("ACPI: warning, sys_outb failed: %d\n", s); } -PRIVATE void pci_outw(u16_t port, u16_t value) { +static void pci_outw(u16_t port, u16_t value) { int s; if ((s=sys_outw(port, value)) !=OK) printf("ACPI: warning, sys_outw failed: %d\n", s); } -PRIVATE void pci_outl(u16_t port, u32_t value) { +static void pci_outl(u16_t port, u32_t value) { int s; if ((s=sys_outl(port, value)) !=OK) printf("ACPI: warning, sys_outl failed: %d\n", s); @@ -965,7 +965,7 @@ AcpiOsSignal ( * *****************************************************************************/ -PUBLIC ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer ( +ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer ( void) { return machine.acpi_rsdp; diff --git a/drivers/acpi/pci.c b/drivers/acpi/pci.c index 1a7a62478..6db5259d7 100644 --- a/drivers/acpi/pci.c +++ b/drivers/acpi/pci.c @@ -20,14 +20,14 @@ struct pci_bridge { struct pci_bridge * children[PCI_MAX_DEVICES]; }; -PRIVATE struct pci_bridge pci_root_bridge; +static struct pci_bridge pci_root_bridge; struct irq_resource { struct pci_bridge * bridge; ACPI_PCI_ROUTING_TABLE * tbl; }; -PRIVATE struct pci_bridge * find_bridge(struct pci_bridge * root, +static struct pci_bridge * find_bridge(struct pci_bridge * root, int pbnr, int dev, int sbnr) @@ -68,7 +68,7 @@ PRIVATE struct pci_bridge * find_bridge(struct pci_bridge * root, return NULL; } -PUBLIC void do_map_bridge(message *m) +void do_map_bridge(message *m) { int err = OK; unsigned dev = ((struct acpi_map_bridge_req *)m)->device; @@ -92,7 +92,7 @@ map_error: } #if 0 -PRIVATE ACPI_STATUS device_get_int(ACPI_HANDLE handle, +static ACPI_STATUS device_get_int(ACPI_HANDLE handle, char * name, ACPI_INTEGER * val) { @@ -113,7 +113,7 @@ PRIVATE ACPI_STATUS device_get_int(ACPI_HANDLE handle, } #endif -PUBLIC void do_get_irq(message *m) +void do_get_irq(message *m) { struct pci_bridge * bridge; int irq; @@ -134,7 +134,7 @@ PUBLIC void do_get_irq(message *m) ((struct acpi_get_irq_resp *)m)->irq = irq; } -PRIVATE void add_irq(struct pci_bridge * bridge, +static void add_irq(struct pci_bridge * bridge, unsigned dev, unsigned pin, u8_t irq) @@ -144,7 +144,7 @@ PRIVATE void add_irq(struct pci_bridge * bridge, bridge->irqtable[dev * PCI_MAX_PINS + pin] = irq; } -PRIVATE ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context) +static ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context) { struct irq_resource * ires = (struct irq_resource *) context; @@ -165,7 +165,7 @@ PRIVATE ACPI_STATUS get_irq_resource(ACPI_RESOURCE *res, void *context) return AE_OK; } -PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge) +static ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge) { ACPI_STATUS status; ACPI_BUFFER abuff; @@ -230,7 +230,7 @@ PRIVATE ACPI_STATUS get_pci_irq_routing(struct pci_bridge * bridge) return AE_OK; } -PRIVATE void bridge_init_irqtable(struct pci_bridge * bridge) +static void bridge_init_irqtable(struct pci_bridge * bridge) { int i; @@ -238,7 +238,7 @@ PRIVATE void bridge_init_irqtable(struct pci_bridge * bridge) bridge->irqtable[i] = -1; } -PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle, +static ACPI_STATUS add_pci_dev(ACPI_HANDLE handle, UINT32 level, void *context, void **retval) @@ -283,7 +283,7 @@ PRIVATE ACPI_STATUS add_pci_dev(ACPI_HANDLE handle, return status; } -PRIVATE ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle, +static ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle, UINT32 level, void *context, void **retval) @@ -311,7 +311,7 @@ PRIVATE ACPI_STATUS add_pci_root_dev(ACPI_HANDLE handle, return status; } -PUBLIC void pci_scan_devices(void) +void pci_scan_devices(void) { ACPI_STATUS status; diff --git a/drivers/ahci/ahci.c b/drivers/ahci/ahci.c index 0cb99eda9..06d2e52cc 100644 --- a/drivers/ahci/ahci.c +++ b/drivers/ahci/ahci.c @@ -112,7 +112,7 @@ #include "ahci.h" /* Host Bus Adapter (HBA) state. */ -PRIVATE struct { +static struct { volatile u32_t *base; /* base address of memory-mapped registers */ size_t size; /* size of memory-mapped register area */ @@ -125,7 +125,7 @@ PRIVATE struct { } hba_state; /* Port state. */ -PRIVATE struct port_state { +static struct port_state { int state; /* port state */ unsigned int flags; /* port flags */ @@ -171,21 +171,21 @@ PRIVATE struct port_state { } cmd_info[NR_CMDS]; } port_state[NR_PORTS]; -PRIVATE int ahci_instance; /* driver instance number */ +static int ahci_instance; /* driver instance number */ -PRIVATE int ahci_verbose; /* verbosity level (0..4) */ +static int ahci_verbose; /* verbosity level (0..4) */ /* Timeout values. These can be overridden with environment variables. */ -PRIVATE long ahci_spinup_timeout = SPINUP_TIMEOUT; -PRIVATE long ahci_sig_timeout = SIG_TIMEOUT; -PRIVATE long ahci_sig_checks = NR_SIG_CHECKS; -PRIVATE long ahci_command_timeout = COMMAND_TIMEOUT; -PRIVATE long ahci_transfer_timeout = TRANSFER_TIMEOUT; -PRIVATE long ahci_flush_timeout = FLUSH_TIMEOUT; +static long ahci_spinup_timeout = SPINUP_TIMEOUT; +static long ahci_sig_timeout = SIG_TIMEOUT; +static long ahci_sig_checks = NR_SIG_CHECKS; +static long ahci_command_timeout = COMMAND_TIMEOUT; +static long ahci_transfer_timeout = TRANSFER_TIMEOUT; +static long ahci_flush_timeout = FLUSH_TIMEOUT; -PRIVATE int ahci_map[MAX_DRIVES]; /* device-to-port mapping */ +static int ahci_map[MAX_DRIVES]; /* device-to-port mapping */ -PRIVATE int ahci_exiting = FALSE; /* exit after last close? */ +static int ahci_exiting = FALSE; /* exit after last close? */ #define BUILD_ARG(port, tag) (((port) << 8) | (tag)) #define GET_PORT(arg) ((arg) >> 8) @@ -196,29 +196,29 @@ PRIVATE int ahci_exiting = FALSE; /* exit after last close? */ printf s; \ } while (0) -PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis, +static void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis, u8_t packet[ATAPI_PACKET_SIZE], prd_t *prdt, int nr_prds, int write); -PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout); -PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout); -PRIVATE void port_timeout(struct timer *tp); -PRIVATE void port_disconnect(struct port_state *ps); - -PRIVATE char *ahci_portname(struct port_state *ps); -PRIVATE int ahci_open(dev_t minor, int access); -PRIVATE int ahci_close(dev_t minor); -PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position, +static void port_issue(struct port_state *ps, int cmd, clock_t timeout); +static int port_exec(struct port_state *ps, int cmd, clock_t timeout); +static void port_timeout(struct timer *tp); +static void port_disconnect(struct port_state *ps); + +static char *ahci_portname(struct port_state *ps); +static int ahci_open(dev_t minor, int access); +static int ahci_close(dev_t minor); +static ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position, endpoint_t endpt, iovec_t *iovec, unsigned int count, int flags); -PRIVATE struct device *ahci_part(dev_t minor); -PRIVATE void ahci_alarm(clock_t stamp); -PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static struct device *ahci_part(dev_t minor); +static void ahci_alarm(clock_t stamp); +static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant); -PRIVATE void ahci_intr(unsigned int irqs); -PRIVATE int ahci_device(dev_t minor, device_id_t *id); -PRIVATE struct port_state *ahci_get_port(dev_t minor); +static void ahci_intr(unsigned int irqs); +static int ahci_device(dev_t minor, device_id_t *id); +static struct port_state *ahci_get_port(dev_t minor); /* AHCI driver table. */ -PRIVATE struct blockdriver ahci_dtab = { +static struct blockdriver ahci_dtab = { BLOCKDRIVER_TYPE_DISK, ahci_open, ahci_close, @@ -236,7 +236,7 @@ PRIVATE struct blockdriver ahci_dtab = { /*===========================================================================* * atapi_exec * *===========================================================================*/ -PRIVATE int atapi_exec(struct port_state *ps, int cmd, +static int atapi_exec(struct port_state *ps, int cmd, u8_t packet[ATAPI_PACKET_SIZE], size_t size, int write) { /* Execute an ATAPI command. Return OK or error. @@ -272,7 +272,7 @@ PRIVATE int atapi_exec(struct port_state *ps, int cmd, /*===========================================================================* * atapi_test_unit * *===========================================================================*/ -PRIVATE int atapi_test_unit(struct port_state *ps, int cmd) +static int atapi_test_unit(struct port_state *ps, int cmd) { /* Test whether the ATAPI device and medium are ready. */ @@ -287,7 +287,7 @@ PRIVATE int atapi_test_unit(struct port_state *ps, int cmd) /*===========================================================================* * atapi_request_sense * *===========================================================================*/ -PRIVATE int atapi_request_sense(struct port_state *ps, int cmd, int *sense) +static int atapi_request_sense(struct port_state *ps, int cmd, int *sense) { /* Request error (sense) information from an ATAPI device, and return * the sense key. The additional sense codes are not used at this time. @@ -316,7 +316,7 @@ PRIVATE int atapi_request_sense(struct port_state *ps, int cmd, int *sense) /*===========================================================================* * atapi_load_eject * *===========================================================================*/ -PRIVATE int atapi_load_eject(struct port_state *ps, int cmd, int load) +static int atapi_load_eject(struct port_state *ps, int cmd, int load) { /* Load or eject a medium in an ATAPI device. */ @@ -332,7 +332,7 @@ PRIVATE int atapi_load_eject(struct port_state *ps, int cmd, int load) /*===========================================================================* * atapi_read_capacity * *===========================================================================*/ -PRIVATE int atapi_read_capacity(struct port_state *ps, int cmd) +static int atapi_read_capacity(struct port_state *ps, int cmd) { /* Retrieve the LBA count and sector size of an ATAPI medium. */ @@ -372,7 +372,7 @@ PRIVATE int atapi_read_capacity(struct port_state *ps, int cmd) /*===========================================================================* * atapi_check_medium * *===========================================================================*/ -PRIVATE int atapi_check_medium(struct port_state *ps, int cmd) +static int atapi_check_medium(struct port_state *ps, int cmd) { /* Check whether a medium is present in a removable-media ATAPI device. * If a new medium is detected, get its total and sector size. Return @@ -407,7 +407,7 @@ PRIVATE int atapi_check_medium(struct port_state *ps, int cmd) /*===========================================================================* * atapi_id_check * *===========================================================================*/ -PRIVATE int atapi_id_check(struct port_state *ps, u16_t *buf) +static int atapi_id_check(struct port_state *ps, u16_t *buf) { /* Determine whether we support this ATAPI device based on the * identification data it returned, and store some of its properties. @@ -462,7 +462,7 @@ PRIVATE int atapi_id_check(struct port_state *ps, u16_t *buf) /*===========================================================================* * atapi_transfer * *===========================================================================*/ -PRIVATE int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba, +static int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba, unsigned int count, int write, prd_t *prdt, int nr_prds) { /* Perform data transfer from or to an ATAPI device. @@ -498,7 +498,7 @@ PRIVATE int atapi_transfer(struct port_state *ps, int cmd, u64_t start_lba, /*===========================================================================* * ata_id_check * *===========================================================================*/ -PRIVATE int ata_id_check(struct port_state *ps, u16_t *buf) +static int ata_id_check(struct port_state *ps, u16_t *buf) { /* Determine whether we support this ATA device based on the * identification data it returned, and store some of its properties. @@ -574,7 +574,7 @@ PRIVATE int ata_id_check(struct port_state *ps, u16_t *buf) /*===========================================================================* * ata_transfer * *===========================================================================*/ -PRIVATE int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba, +static int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba, unsigned int count, int write, int force, prd_t *prdt, int nr_prds) { /* Perform data transfer from or to an ATA device. @@ -624,7 +624,7 @@ PRIVATE int ata_transfer(struct port_state *ps, int cmd, u64_t start_lba, /*===========================================================================* * gen_identify * *===========================================================================*/ -PRIVATE int gen_identify(struct port_state *ps, int blocking) +static int gen_identify(struct port_state *ps, int blocking) { /* Identify an ATA or ATAPI device. If the blocking flag is set, block * until the command has completed; otherwise return immediately. @@ -657,7 +657,7 @@ PRIVATE int gen_identify(struct port_state *ps, int blocking) /*===========================================================================* * gen_flush_wcache * *===========================================================================*/ -PRIVATE int gen_flush_wcache(struct port_state *ps) +static int gen_flush_wcache(struct port_state *ps) { /* Flush the device's write cache. */ @@ -690,7 +690,7 @@ PRIVATE int gen_flush_wcache(struct port_state *ps) /*===========================================================================* * gen_get_wcache * *===========================================================================*/ -PRIVATE int gen_get_wcache(struct port_state *ps, int *val) +static int gen_get_wcache(struct port_state *ps, int *val) { /* Retrieve the status of the device's write cache. */ @@ -713,7 +713,7 @@ PRIVATE int gen_get_wcache(struct port_state *ps, int *val) /*===========================================================================* * gen_set_wcache * *===========================================================================*/ -PRIVATE int gen_set_wcache(struct port_state *ps, int enable) +static int gen_set_wcache(struct port_state *ps, int enable) { /* Enable or disable the device's write cache. */ @@ -744,7 +744,7 @@ PRIVATE int gen_set_wcache(struct port_state *ps, int enable) /*===========================================================================* * ct_set_fis * *===========================================================================*/ -PRIVATE vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag) +static vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag) { /* Fill in the Frame Information Structure part of a command table, * and return the resulting FIS size (in bytes). We only support the @@ -782,7 +782,7 @@ PRIVATE vir_bytes ct_set_fis(u8_t *ct, cmd_fis_t *fis, unsigned int tag) /*===========================================================================* * ct_set_packet * *===========================================================================*/ -PRIVATE void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE]) +static void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE]) { /* Fill in the packet part of a command table. */ @@ -793,7 +793,7 @@ PRIVATE void ct_set_packet(u8_t *ct, u8_t packet[ATAPI_PACKET_SIZE]) /*===========================================================================* * ct_set_prdt * *===========================================================================*/ -PRIVATE void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds) +static void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds) { /* Fill in the PRDT part of a command table. */ @@ -813,7 +813,7 @@ PRIVATE void ct_set_prdt(u8_t *ct, prd_t *prdt, int nr_prds) /*===========================================================================* * port_set_cmd * *===========================================================================*/ -PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis, +static void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis, u8_t packet[ATAPI_PACKET_SIZE], prd_t *prdt, int nr_prds, int write) { /* Prepare the given command for execution, by constructing a command @@ -868,7 +868,7 @@ PRIVATE void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis, /*===========================================================================* * port_finish_cmd * *===========================================================================*/ -PRIVATE void port_finish_cmd(struct port_state *ps, int cmd, int result) +static void port_finish_cmd(struct port_state *ps, int cmd, int result) { /* Finish a command that has either succeeded or failed. */ @@ -895,7 +895,7 @@ PRIVATE void port_finish_cmd(struct port_state *ps, int cmd, int result) /*===========================================================================* * port_fail_cmds * *===========================================================================*/ -PRIVATE void port_fail_cmds(struct port_state *ps) +static void port_fail_cmds(struct port_state *ps) { /* Fail all ongoing commands for a device. */ @@ -909,7 +909,7 @@ PRIVATE void port_fail_cmds(struct port_state *ps) /*===========================================================================* * port_check_cmds * *===========================================================================*/ -PRIVATE void port_check_cmds(struct port_state *ps) +static void port_check_cmds(struct port_state *ps) { /* Check what commands have completed, and finish them. */ @@ -933,7 +933,7 @@ PRIVATE void port_check_cmds(struct port_state *ps) /*===========================================================================* * port_find_cmd * *===========================================================================*/ -PRIVATE int port_find_cmd(struct port_state *ps) +static int port_find_cmd(struct port_state *ps) { /* Find a free command tag to queue the current request. */ @@ -954,7 +954,7 @@ PRIVATE int port_find_cmd(struct port_state *ps) /*===========================================================================* * port_get_padbuf * *===========================================================================*/ -PRIVATE int port_get_padbuf(struct port_state *ps, size_t size) +static int port_get_padbuf(struct port_state *ps, size_t size) { /* Make available a temporary buffer for use by this port. Enlarge the * previous buffer if applicable and necessary, potentially changing @@ -987,7 +987,7 @@ PRIVATE int port_get_padbuf(struct port_state *ps, size_t size) /*===========================================================================* * sum_iovec * *===========================================================================*/ -PRIVATE int sum_iovec(struct port_state *ps, endpoint_t endpt, +static int sum_iovec(struct port_state *ps, endpoint_t endpt, iovec_s_t *iovec, int nr_req, vir_bytes *total) { /* Retrieve the total size of the given I/O vector. Check for alignment @@ -1024,7 +1024,7 @@ PRIVATE int sum_iovec(struct port_state *ps, endpoint_t endpt, /*===========================================================================* * setup_prdt * *===========================================================================*/ -PRIVATE int setup_prdt(struct port_state *ps, endpoint_t endpt, +static int setup_prdt(struct port_state *ps, endpoint_t endpt, iovec_s_t *iovec, int nr_req, vir_bytes size, vir_bytes lead, int write, prd_t *prdt) { @@ -1107,7 +1107,7 @@ PRIVATE int setup_prdt(struct port_state *ps, endpoint_t endpt, /*===========================================================================* * port_transfer * *===========================================================================*/ -PRIVATE ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof, +static ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof, endpoint_t endpt, iovec_s_t *iovec, int nr_req, int write, int flags) { /* Perform an I/O transfer on a port. @@ -1189,7 +1189,7 @@ PRIVATE ssize_t port_transfer(struct port_state *ps, u64_t pos, u64_t eof, /*===========================================================================* * port_start * *===========================================================================*/ -PRIVATE void port_start(struct port_state *ps) +static void port_start(struct port_state *ps) { /* Start the given port, allowing for the execution of commands and the * transfer of data on that port. @@ -1214,7 +1214,7 @@ PRIVATE void port_start(struct port_state *ps) /*===========================================================================* * port_restart * *===========================================================================*/ -PRIVATE void port_restart(struct port_state *ps) +static void port_restart(struct port_state *ps) { /* Restart a port after a fatal error has occurred. */ @@ -1267,7 +1267,7 @@ PRIVATE void port_restart(struct port_state *ps) /*===========================================================================* * port_stop * *===========================================================================*/ -PRIVATE void port_stop(struct port_state *ps) +static void port_stop(struct port_state *ps) { /* Stop the given port, if not already stopped. */ @@ -1309,7 +1309,7 @@ PRIVATE void port_stop(struct port_state *ps) /*===========================================================================* * port_sig_check * *===========================================================================*/ -PRIVATE void port_sig_check(struct port_state *ps) +static void port_sig_check(struct port_state *ps) { /* Check whether the device's signature has become available yet, and * if so, start identifying the device. @@ -1393,7 +1393,7 @@ PRIVATE void port_sig_check(struct port_state *ps) /*===========================================================================* * print_string * *===========================================================================*/ -PRIVATE void print_string(u16_t *buf, int start, int end) +static void print_string(u16_t *buf, int start, int end) { /* Print a string that is stored as little-endian words and padded with * trailing spaces. @@ -1414,7 +1414,7 @@ PRIVATE void print_string(u16_t *buf, int start, int end) /*===========================================================================* * port_id_check * *===========================================================================*/ -PRIVATE void port_id_check(struct port_state *ps, int success) +static void port_id_check(struct port_state *ps, int success) { /* The device identification command has either completed or timed out. * Decide whether this device is usable or not, and store some of its @@ -1483,7 +1483,7 @@ PRIVATE void port_id_check(struct port_state *ps, int success) /*===========================================================================* * port_connect * *===========================================================================*/ -PRIVATE void port_connect(struct port_state *ps) +static void port_connect(struct port_state *ps) { /* A device has been found to be attached to this port. Start the port, * and do timed polling for its signature to become available. @@ -1508,7 +1508,7 @@ PRIVATE void port_connect(struct port_state *ps) /*===========================================================================* * port_disconnect * *===========================================================================*/ -PRIVATE void port_disconnect(struct port_state *ps) +static void port_disconnect(struct port_state *ps) { /* The device has detached from this port. Stop the port if necessary. */ @@ -1538,7 +1538,7 @@ PRIVATE void port_disconnect(struct port_state *ps) /*===========================================================================* * port_intr * *===========================================================================*/ -PRIVATE void port_intr(struct port_state *ps) +static void port_intr(struct port_state *ps) { /* Process an interrupt on this port. */ @@ -1619,7 +1619,7 @@ PRIVATE void port_intr(struct port_state *ps) /*===========================================================================* * port_timeout * *===========================================================================*/ -PRIVATE void port_timeout(struct timer *tp) +static void port_timeout(struct timer *tp) { /* A timeout has occurred on this port. Figure out what the timeout is * for, and take appropriate action. @@ -1705,7 +1705,7 @@ PRIVATE void port_timeout(struct timer *tp) /*===========================================================================* * port_wait * *===========================================================================*/ -PRIVATE void port_wait(struct port_state *ps) +static void port_wait(struct port_state *ps) { /* Suspend the current thread until the given port is no longer busy, * due to either command completion or timeout. @@ -1722,7 +1722,7 @@ PRIVATE void port_wait(struct port_state *ps) /*===========================================================================* * port_issue * *===========================================================================*/ -PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout) +static void port_issue(struct port_state *ps, int cmd, clock_t timeout) { /* Issue a command to the port, and set a timer to trigger a timeout * if the command takes too long to complete. @@ -1751,7 +1751,7 @@ PRIVATE void port_issue(struct port_state *ps, int cmd, clock_t timeout) /*===========================================================================* * port_exec * *===========================================================================*/ -PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout) +static int port_exec(struct port_state *ps, int cmd, clock_t timeout) { /* Execute a command on a port, wait for the command to complete or for * a timeout, and return whether the command succeeded or not. @@ -1789,7 +1789,7 @@ PRIVATE int port_exec(struct port_state *ps, int cmd, clock_t timeout) /*===========================================================================* * port_alloc * *===========================================================================*/ -PRIVATE void port_alloc(struct port_state *ps) +static void port_alloc(struct port_state *ps) { /* Allocate memory for the given port. We try to cram everything into * one 4K-page in order to limit memory usage as much as possible. @@ -1854,7 +1854,7 @@ PRIVATE void port_alloc(struct port_state *ps) /*===========================================================================* * port_free * *===========================================================================*/ -PRIVATE void port_free(struct port_state *ps) +static void port_free(struct port_state *ps) { /* Free previously allocated memory for the given port. */ @@ -1874,7 +1874,7 @@ PRIVATE void port_free(struct port_state *ps) /*===========================================================================* * port_init * *===========================================================================*/ -PRIVATE void port_init(struct port_state *ps) +static void port_init(struct port_state *ps) { /* Initialize the given port. */ @@ -1918,7 +1918,7 @@ PRIVATE void port_init(struct port_state *ps) /*===========================================================================* * ahci_probe * *===========================================================================*/ -PRIVATE int ahci_probe(int skip) +static int ahci_probe(int skip) { /* Find a matching PCI device. */ @@ -1945,7 +1945,7 @@ PRIVATE int ahci_probe(int skip) /*===========================================================================* * ahci_reset * *===========================================================================*/ -PRIVATE void ahci_reset(void) +static void ahci_reset(void) { /* Reset the HBA. Do not enable AHCI mode afterwards. */ @@ -1967,7 +1967,7 @@ PRIVATE void ahci_reset(void) /*===========================================================================* * ahci_init * *===========================================================================*/ -PRIVATE void ahci_init(int devind) +static void ahci_init(int devind) { /* Initialize the device. */ @@ -2048,7 +2048,7 @@ PRIVATE void ahci_init(int devind) /*===========================================================================* * ahci_stop * *===========================================================================*/ -PRIVATE void ahci_stop(void) +static void ahci_stop(void) { /* Disable AHCI, and clean up resources to the extent possible. */ @@ -2078,7 +2078,7 @@ PRIVATE void ahci_stop(void) /*===========================================================================* * ahci_alarm * *===========================================================================*/ -PRIVATE void ahci_alarm(clock_t stamp) +static void ahci_alarm(clock_t stamp) { /* Process an alarm. */ @@ -2090,7 +2090,7 @@ PRIVATE void ahci_alarm(clock_t stamp) /*===========================================================================* * ahci_intr * *===========================================================================*/ -PRIVATE void ahci_intr(unsigned int UNUSED(irqs)) +static void ahci_intr(unsigned int UNUSED(irqs)) { /* Process an interrupt. */ @@ -2127,7 +2127,7 @@ PRIVATE void ahci_intr(unsigned int UNUSED(irqs)) /*===========================================================================* * ahci_get_var * *===========================================================================*/ -PRIVATE void ahci_get_var(char *name, long *v, int timeout) +static void ahci_get_var(char *name, long *v, int timeout) { /* Retrieve an environment variable, and optionall adjust it to the * scale that we are using internally. @@ -2144,7 +2144,7 @@ PRIVATE void ahci_get_var(char *name, long *v, int timeout) /*===========================================================================* * ahci_get_params * *===========================================================================*/ -PRIVATE void ahci_get_params(void) +static void ahci_get_params(void) { /* Retrieve and parse parameters passed to this driver, except the * device-to-port mapping, which has to be parsed later. @@ -2173,7 +2173,7 @@ PRIVATE void ahci_get_params(void) /*===========================================================================* * ahci_set_mapping * *===========================================================================*/ -PRIVATE void ahci_set_mapping(void) +static void ahci_set_mapping(void) { /* Construct a mapping from device nodes to port numbers. */ @@ -2226,7 +2226,7 @@ PRIVATE void ahci_set_mapping(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the driver. */ @@ -2256,7 +2256,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* In case of a termination signal, shut down this driver. */ @@ -2282,7 +2282,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Set callbacks and initialize the System Event Framework (SEF). */ @@ -2301,7 +2301,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * ahci_portname * *===========================================================================*/ -PRIVATE char *ahci_portname(struct port_state *ps) +static char *ahci_portname(struct port_state *ps) { /* Return a printable name for the given port. Whenever we can, print a * "Dx" device number rather than a "Pxx" port number, because the user @@ -2328,7 +2328,7 @@ PRIVATE char *ahci_portname(struct port_state *ps) /*===========================================================================* * ahci_map_minor * *===========================================================================*/ -PRIVATE struct port_state *ahci_map_minor(dev_t minor, struct device **dvp) +static struct port_state *ahci_map_minor(dev_t minor, struct device **dvp) { /* Map a minor device number to a port and a pointer to the partition's * device structure. Return NULL if this minor device number does not @@ -2364,7 +2364,7 @@ PRIVATE struct port_state *ahci_map_minor(dev_t minor, struct device **dvp) /*===========================================================================* * ahci_part * *===========================================================================*/ -PRIVATE struct device *ahci_part(dev_t minor) +static struct device *ahci_part(dev_t minor) { /* Return a pointer to the partition information structure of the given * minor device. @@ -2380,7 +2380,7 @@ PRIVATE struct device *ahci_part(dev_t minor) /*===========================================================================* * ahci_open * *===========================================================================*/ -PRIVATE int ahci_open(dev_t minor, int access) +static int ahci_open(dev_t minor, int access) { /* Open a device. */ @@ -2450,7 +2450,7 @@ PRIVATE int ahci_open(dev_t minor, int access) /*===========================================================================* * ahci_close * *===========================================================================*/ -PRIVATE int ahci_close(dev_t minor) +static int ahci_close(dev_t minor) { /* Close a device. */ @@ -2506,7 +2506,7 @@ PRIVATE int ahci_close(dev_t minor) /*===========================================================================* * ahci_transfer * *===========================================================================*/ -PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position, +static ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position, endpoint_t endpt, iovec_t *iovec, unsigned int count, int flags) { /* Perform data transfer on the selected device. @@ -2541,7 +2541,7 @@ PRIVATE ssize_t ahci_transfer(dev_t minor, int do_write, u64_t position, /*===========================================================================* * ahci_ioctl * *===========================================================================*/ -PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { /* Process I/O control requests. @@ -2598,7 +2598,7 @@ PRIVATE int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, /*===========================================================================* * ahci_device * *===========================================================================*/ -PRIVATE int ahci_device(dev_t minor, device_id_t *id) +static int ahci_device(dev_t minor, device_id_t *id) { /* Map a minor device number to a device ID. */ @@ -2616,7 +2616,7 @@ PRIVATE int ahci_device(dev_t minor, device_id_t *id) /*===========================================================================* * ahci_get_port * *===========================================================================*/ -PRIVATE struct port_state *ahci_get_port(dev_t minor) +static struct port_state *ahci_get_port(dev_t minor) { /* Get the port structure associated with the given minor device. * Called only from worker threads, so the minor device is already @@ -2634,7 +2634,7 @@ PRIVATE struct port_state *ahci_get_port(dev_t minor) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* Driver task. */ diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index 7165dadb6..4115d1e80 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -59,9 +59,9 @@ static void del_range(phys_bytes busaddr, phys_bytes size); static void report_exceptions(void); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); int main(void) { @@ -92,7 +92,7 @@ int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -113,7 +113,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the amddev driver. */ int r, n_maps, n_domains, revision; @@ -157,7 +157,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { int r; endpoint_t proc_e; diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index c36814035..ff9917ffb 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -44,29 +44,29 @@ struct command { }; /* Timeouts and max retries. */ -PRIVATE int timeout_usecs = DEF_TIMEOUT_USECS; -PRIVATE int max_errors = MAX_ERRORS; -PRIVATE long w_standard_timeouts = 0; -PRIVATE long w_pci_debug = 0; -PRIVATE long w_instance = 0; -PRIVATE long disable_dma = 0; -PRIVATE long atapi_debug = 0; -PRIVATE long w_identify_wakeup_ticks; -PRIVATE long wakeup_ticks; -PRIVATE long w_atapi_dma; +static int timeout_usecs = DEF_TIMEOUT_USECS; +static int max_errors = MAX_ERRORS; +static long w_standard_timeouts = 0; +static long w_pci_debug = 0; +static long w_instance = 0; +static long disable_dma = 0; +static long atapi_debug = 0; +static long w_identify_wakeup_ticks; +static long wakeup_ticks; +static long w_atapi_dma; -PRIVATE int w_testing = 0; -PRIVATE int w_silent = 0; +static int w_testing = 0; +static int w_silent = 0; -PRIVATE int w_next_drive = 0; +static int w_next_drive = 0; -PRIVATE u32_t system_hz; +static u32_t system_hz; /* The struct wini is indexed by controller first, then drive (0-3). * Controller 0 is always the 'compatability' ide controller, at * the fixed locations, whether present or not. */ -PRIVATE struct wini { /* main drive struct, one entry per drive */ +static struct wini { /* main drive struct, one entry per drive */ unsigned state; /* drive state: deaf, initialized, dead */ unsigned short w_status; /* device status register */ unsigned base_cmd; /* command base register */ @@ -92,19 +92,19 @@ PRIVATE struct wini { /* main drive struct, one entry per drive */ struct device subpart[SUB_PER_DRIVE]; /* subpartitions */ } wini[MAX_DRIVES], *w_wn; -PRIVATE int w_device = -1; +static int w_device = -1; -PUBLIC int w_command; /* current command in execution */ -PRIVATE int w_drive; /* selected drive */ -PRIVATE struct device *w_dv; /* device's base and size */ +int w_command; /* current command in execution */ +static int w_drive; /* selected drive */ +static struct device *w_dv; /* device's base and size */ -PRIVATE u8_t *tmp_buf; +static u8_t *tmp_buf; #define ATA_DMA_SECTORS 64 #define ATA_DMA_BUF_SIZE (ATA_DMA_SECTORS*SECTOR_SIZE) -PRIVATE char *dma_buf; -PRIVATE phys_bytes dma_buf_phys; +static char *dma_buf; +static phys_bytes dma_buf_phys; #define N_PRDTE 1024 /* Should be enough for large requests */ @@ -117,13 +117,13 @@ struct prdte }; #define PRDT_BYTES (sizeof(struct prdte) * N_PRDTE) -PRIVATE struct prdte *prdt; -PRIVATE phys_bytes prdt_phys; +static struct prdte *prdt; +static phys_bytes prdt_phys; #define PRDTE_FL_EOT 0x80 /* End of table */ /* IDE devices we trust are IDE devices. */ -PRIVATE struct quirk +static struct quirk { int pci_class, pci_subclass, pci_interface; u16_t vendor; @@ -136,58 +136,58 @@ PRIVATE struct quirk { 0, 0, 0, 0, 0 } /* end of list */ }; -FORWARD void init_params(void); -FORWARD void init_drive(struct wini *w, int base_cmd, int base_ctl, int +static void init_params(void); +static void init_drive(struct wini *w, int base_cmd, int base_ctl, int base_dma, int irq, int ack, int hook, int drive); -FORWARD void init_params_pci(int); -FORWARD int w_do_open(dev_t minor, int access); -FORWARD struct device *w_prepare(dev_t dev); -FORWARD struct device *w_part(dev_t minor); -FORWARD int w_identify(void); -FORWARD char *w_name(void); -FORWARD int w_specify(void); -FORWARD int w_io_test(void); -FORWARD ssize_t w_transfer(dev_t minor, int do_write, u64_t position, +static void init_params_pci(int); +static int w_do_open(dev_t minor, int access); +static struct device *w_prepare(dev_t dev); +static struct device *w_part(dev_t minor); +static int w_identify(void); +static char *w_name(void); +static int w_specify(void); +static int w_io_test(void); +static ssize_t w_transfer(dev_t minor, int do_write, u64_t position, endpoint_t proc_nr, iovec_t *iov, unsigned int nr_req, int flags); -FORWARD int com_out(struct command *cmd); -FORWARD int com_out_ext(struct command *cmd); -FORWARD int setup_dma(unsigned *sizep, endpoint_t proc_nr, iovec_t *iov, +static int com_out(struct command *cmd); +static int com_out_ext(struct command *cmd); +static int setup_dma(unsigned *sizep, endpoint_t proc_nr, iovec_t *iov, size_t addr_offset, int do_write); -FORWARD void w_need_reset(void); -FORWARD void ack_irqs(unsigned int); -FORWARD int w_do_close(dev_t minor); -FORWARD int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static void w_need_reset(void); +static void ack_irqs(unsigned int); +static int w_do_close(dev_t minor); +static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant); -FORWARD void w_hw_int(unsigned int irqs); -FORWARD int com_simple(struct command *cmd); -FORWARD void w_timeout(void); -FORWARD int w_reset(void); -FORWARD void w_intr_wait(void); -FORWARD int at_intr_wait(void); -FORWARD int w_waitfor(int mask, int value); -FORWARD int w_waitfor_dma(int mask, int value); -FORWARD void w_geometry(dev_t minor, struct partition *entry); +static void w_hw_int(unsigned int irqs); +static int com_simple(struct command *cmd); +static void w_timeout(void); +static int w_reset(void); +static void w_intr_wait(void); +static int at_intr_wait(void); +static int w_waitfor(int mask, int value); +static int w_waitfor_dma(int mask, int value); +static void w_geometry(dev_t minor, struct partition *entry); #if ENABLE_ATAPI -FORWARD int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma); -FORWARD int atapi_intr_wait(int dma, size_t max); -FORWARD int atapi_open(void); -FORWARD void atapi_close(void); -FORWARD int atapi_transfer(int do_write, u64_t position, endpoint_t +static int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma); +static int atapi_intr_wait(int dma, size_t max); +static int atapi_open(void); +static void atapi_close(void); +static int atapi_transfer(int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int nr_req); #endif #define sys_voutb(out, n) at_voutb((out), (n)) -FORWARD int at_voutb(pvb_pair_t *, int n); +static int at_voutb(pvb_pair_t *, int n); #define sys_vinb(in, n) at_vinb((in), (n)) -FORWARD int at_vinb(pvb_pair_t *, int n); +static int at_vinb(pvb_pair_t *, int n); #undef sys_outb #undef sys_inb #undef sys_outl -FORWARD int at_out(int line, u32_t port, u32_t value, char *typename, +static int at_out(int line, u32_t port, u32_t value, char *typename, int type); -FORWARD int at_in(int line, u32_t port, u32_t *value, char *typename, +static int at_in(int line, u32_t port, u32_t *value, char *typename, int type); #define sys_outb(p, v) at_out(__LINE__, (p), (v), "outb", _DIO_BYTE) @@ -195,7 +195,7 @@ FORWARD int at_in(int line, u32_t port, u32_t *value, char *typename, #define sys_outl(p, v) at_out(__LINE__, (p), (v), "outl", _DIO_LONG) /* Entry points to this driver. */ -PRIVATE struct blockdriver w_dtab = { +static struct blockdriver w_dtab = { BLOCKDRIVER_TYPE_DISK,/* handle partition requests */ w_do_open, /* open or mount request, initialize device */ w_do_close, /* release device */ @@ -211,8 +211,8 @@ PRIVATE struct blockdriver w_dtab = { }; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); @@ -220,7 +220,7 @@ EXTERN void sef_cb_lu_state_dump(int state); /*===========================================================================* * at_winchester_task * *===========================================================================*/ -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* SEF local startup. */ env_setargs(argc, argv); @@ -235,7 +235,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -253,7 +253,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the at_wini driver. */ system_hz = sys_hz(); @@ -276,7 +276,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * init_params * *===========================================================================*/ -PRIVATE void init_params(void) +static void init_params(void) { /* This routine is called at startup to initialize the drive parameters. */ @@ -376,7 +376,7 @@ PRIVATE void init_params(void) /*===========================================================================* * init_drive * *===========================================================================*/ -PRIVATE void init_drive(struct wini *w, int base_cmd, int base_ctl, +static void init_drive(struct wini *w, int base_cmd, int base_ctl, int base_dma, int irq, int ack, int hook, int drive) { w->state = 0; @@ -396,7 +396,7 @@ PRIVATE void init_drive(struct wini *w, int base_cmd, int base_ctl, w->dma = 0; } -PRIVATE int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface, u16_t vid, u16_t did) { +static int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface, u16_t vid, u16_t did) { while(table->vendor) { if(table->vendor == vid && table->device == did && table->pci_class == bcr && @@ -414,7 +414,7 @@ PRIVATE int quirkmatch(struct quirk *table, u8_t bcr, u8_t scr, u8_t interface, /*===========================================================================* * init_params_pci * *===========================================================================*/ -PRIVATE void init_params_pci(int skip) +static void init_params_pci(int skip) { int i, r, devind, drive, pci_compat = 0; int irq, irq_hook; @@ -570,7 +570,7 @@ PRIVATE void init_params_pci(int skip) /*===========================================================================* * w_do_open * *===========================================================================*/ -PRIVATE int w_do_open(dev_t minor, int access) +static int w_do_open(dev_t minor, int access) { /* Device open: Initialize the controller and read the partition table. */ @@ -639,7 +639,7 @@ PRIVATE int w_do_open(dev_t minor, int access) /*===========================================================================* * w_prepare * *===========================================================================*/ -PRIVATE struct device *w_prepare(dev_t device) +static struct device *w_prepare(dev_t device) { /* Prepare for I/O on a device. */ w_device = (int) device; @@ -663,7 +663,7 @@ PRIVATE struct device *w_prepare(dev_t device) /*===========================================================================* * w_part * *===========================================================================*/ -PRIVATE struct device *w_part(dev_t device) +static struct device *w_part(dev_t device) { /* Return a pointer to the partition information of the given minor device. */ @@ -681,7 +681,7 @@ PRIVATE struct device *w_part(dev_t device) /*===========================================================================* * check_dma * *===========================================================================*/ -PRIVATE void +static void check_dma(struct wini *wn) { u32_t dma_status, dma_base; @@ -764,7 +764,7 @@ check_dma(struct wini *wn) /*===========================================================================* * w_identify * *===========================================================================*/ -PRIVATE int w_identify(void) +static int w_identify(void) { /* Find out if a device exists, if it is an old AT disk, or a newer ATA * drive, a removable media device, etc. @@ -916,7 +916,7 @@ PRIVATE int w_identify(void) /*===========================================================================* * w_name * *===========================================================================*/ -PRIVATE char *w_name(void) +static char *w_name(void) { /* Return a name for the current device. */ static char name[] = "AT0-D0"; @@ -929,7 +929,7 @@ PRIVATE char *w_name(void) /*===========================================================================* * w_io_test * *===========================================================================*/ -PRIVATE int w_io_test(void) +static int w_io_test(void) { int save_dev; int save_timeout, save_errors, save_wakeup; @@ -987,7 +987,7 @@ PRIVATE int w_io_test(void) /*===========================================================================* * w_specify * *===========================================================================*/ -PRIVATE int w_specify(void) +static int w_specify(void) { /* Routine to initialize the drive after boot or when a reset is needed. */ @@ -1026,7 +1026,7 @@ PRIVATE int w_specify(void) /*===========================================================================* * do_transfer * *===========================================================================*/ -PRIVATE int do_transfer(const struct wini *wn, unsigned int precomp, +static int do_transfer(const struct wini *wn, unsigned int precomp, unsigned int count, unsigned int sector, unsigned int do_write, int do_dma) { @@ -1098,7 +1098,7 @@ PRIVATE int do_transfer(const struct wini *wn, unsigned int precomp, return com_out(&cmd); } -PRIVATE void stop_dma(const struct wini *wn) +static void stop_dma(const struct wini *wn) { int r; @@ -1107,7 +1107,7 @@ PRIVATE void stop_dma(const struct wini *wn) if (r != 0) panic("stop_dma: sys_outb failed: %d", r); } -PRIVATE void start_dma(const struct wini *wn, int do_write) +static void start_dma(const struct wini *wn, int do_write) { u32_t v; int r; @@ -1123,7 +1123,7 @@ PRIVATE void start_dma(const struct wini *wn, int do_write) if (r != 0) panic("start_dma: sys_outb failed: %d", r); } -PRIVATE int error_dma(const struct wini *wn) +static int error_dma(const struct wini *wn) { int r; u32_t v; @@ -1158,7 +1158,7 @@ PRIVATE int error_dma(const struct wini *wn) /*===========================================================================* * w_transfer * *===========================================================================*/ -PRIVATE ssize_t w_transfer( +static ssize_t w_transfer( dev_t minor, /* minor device to perform the transfer on */ int do_write, /* read or write? */ u64_t position, /* offset on device to read or write */ @@ -1382,7 +1382,7 @@ PRIVATE ssize_t w_transfer( /*===========================================================================* * com_out * *===========================================================================*/ -PRIVATE int com_out(cmd) +static int com_out(cmd) struct command *cmd; /* Command block */ { /* Output the command block to the winchester controller and return status */ @@ -1433,7 +1433,7 @@ struct command *cmd; /* Command block */ /*===========================================================================* * com_out_ext * *===========================================================================*/ -PRIVATE int com_out_ext(cmd) +static int com_out_ext(cmd) struct command *cmd; /* Command block */ { /* Output the command block to the winchester controller and return status */ @@ -1487,7 +1487,7 @@ struct command *cmd; /* Command block */ /*===========================================================================* * setup_dma * *===========================================================================*/ -PRIVATE int setup_dma( +static int setup_dma( unsigned *sizep, endpoint_t proc_nr, iovec_t *iov, @@ -1611,7 +1611,7 @@ PRIVATE int setup_dma( /*===========================================================================* * w_need_reset * *===========================================================================*/ -PRIVATE void w_need_reset(void) +static void w_need_reset(void) { /* The controller needs to be reset. */ struct wini *wn; @@ -1627,7 +1627,7 @@ PRIVATE void w_need_reset(void) /*===========================================================================* * w_do_close * *===========================================================================*/ -PRIVATE int w_do_close(dev_t minor) +static int w_do_close(dev_t minor) { /* Device close: Release a device. */ if (w_prepare(minor) == NULL) @@ -1642,7 +1642,7 @@ PRIVATE int w_do_close(dev_t minor) /*===========================================================================* * com_simple * *===========================================================================*/ -PRIVATE int com_simple(cmd) +static int com_simple(cmd) struct command *cmd; /* Command block */ { /* A simple controller command, only one interrupt and no data-out phase. */ @@ -1658,7 +1658,7 @@ struct command *cmd; /* Command block */ /*===========================================================================* * w_timeout * *===========================================================================*/ -PRIVATE void w_timeout(void) +static void w_timeout(void) { struct wini *wn = w_wn; @@ -1691,7 +1691,7 @@ PRIVATE void w_timeout(void) /*===========================================================================* * w_reset * *===========================================================================*/ -PRIVATE int w_reset(void) +static int w_reset(void) { /* Issue a reset to the controller. This is done after any catastrophe, * like the controller refusing to respond. @@ -1737,7 +1737,7 @@ PRIVATE int w_reset(void) /*===========================================================================* * w_intr_wait * *===========================================================================*/ -PRIVATE void w_intr_wait(void) +static void w_intr_wait(void) { /* Wait for a task completion interrupt. */ @@ -1794,7 +1794,7 @@ PRIVATE void w_intr_wait(void) /*===========================================================================* * at_intr_wait * *===========================================================================*/ -PRIVATE int at_intr_wait(void) +static int at_intr_wait(void) { /* Wait for an interrupt, study the status bits and return error/success. */ int r, s; @@ -1819,7 +1819,7 @@ PRIVATE int at_intr_wait(void) /*===========================================================================* * w_waitfor * *===========================================================================*/ -PRIVATE int w_waitfor(mask, value) +static int w_waitfor(mask, value) int mask; /* status mask */ int value; /* required status */ { @@ -1845,7 +1845,7 @@ int value; /* required status */ /*===========================================================================* * w_waitfor_dma * *===========================================================================*/ -PRIVATE int w_waitfor_dma(mask, value) +static int w_waitfor_dma(mask, value) int mask; /* status mask */ int value; /* required status */ { @@ -1869,7 +1869,7 @@ int value; /* required status */ /*===========================================================================* * w_geometry * *===========================================================================*/ -PRIVATE void w_geometry(dev_t minor, struct partition *entry) +static void w_geometry(dev_t minor, struct partition *entry) { struct wini *wn; @@ -1892,7 +1892,7 @@ PRIVATE void w_geometry(dev_t minor, struct partition *entry) /*===========================================================================* * atapi_open * *===========================================================================*/ -PRIVATE int atapi_open(void) +static int atapi_open(void) { /* Should load and lock the device and obtain its size. For now just set the * size of the device to something big. What is really needed is a generic @@ -1905,12 +1905,12 @@ PRIVATE int atapi_open(void) /*===========================================================================* * atapi_close * *===========================================================================*/ -PRIVATE void atapi_close(void) +static void atapi_close(void) { /* Should unlock the device. For now do nothing. (XXX) */ } -PRIVATE void sense_request(void) +static void sense_request(void) { int r, i; static u8_t sense[100], packet[ATAPI_PACKETSIZE]; @@ -1943,7 +1943,7 @@ PRIVATE void sense_request(void) /*===========================================================================* * atapi_transfer * *===========================================================================*/ -PRIVATE int atapi_transfer( +static int atapi_transfer( int do_write, /* read or write? */ u64_t position, /* offset on device to read or write */ endpoint_t proc_nr, /* process doing the request */ @@ -2141,7 +2141,7 @@ PRIVATE int atapi_transfer( /*===========================================================================* * atapi_sendpacket * *===========================================================================*/ -PRIVATE int atapi_sendpacket(packet, cnt, do_dma) +static int atapi_sendpacket(packet, cnt, do_dma) u8_t *packet; unsigned cnt; int do_dma; @@ -2204,7 +2204,7 @@ int do_dma; /*===========================================================================* * w_ioctl * *===========================================================================*/ -PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { int r, timeout, prev, count; @@ -2285,7 +2285,7 @@ PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, /*===========================================================================* * w_hw_int * *===========================================================================*/ -PRIVATE void w_hw_int(unsigned int irqs) +static void w_hw_int(unsigned int irqs) { /* Leftover interrupt(s) received; ack it/them. */ ack_irqs(irqs); @@ -2295,7 +2295,7 @@ PRIVATE void w_hw_int(unsigned int irqs) /*===========================================================================* * ack_irqs * *===========================================================================*/ -PRIVATE void ack_irqs(unsigned int irqs) +static void ack_irqs(unsigned int irqs) { unsigned int drive; u32_t w_status; @@ -2323,7 +2323,7 @@ PRIVATE void ack_irqs(unsigned int irqs) #define STSTR(a) if (status & STATUS_ ## a) { strcat(str, #a); strcat(str, " "); } #define ERRSTR(a) if (e & ERROR_ ## a) { strcat(str, #a); strcat(str, " "); } -PRIVATE char *strstatus(int status) +static char *strstatus(int status) { static char str[200]; str[0] = '\0'; @@ -2338,7 +2338,7 @@ PRIVATE char *strstatus(int status) return str; } -PRIVATE char *strerr(int e) +static char *strerr(int e) { static char str[200]; str[0] = '\0'; @@ -2358,7 +2358,7 @@ PRIVATE char *strerr(int e) /*===========================================================================* * atapi_intr_wait * *===========================================================================*/ -PRIVATE int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max)) +static int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max)) { /* Wait for an interrupt and study the results. Returns a number of bytes * that need to be transferred, or an error code. @@ -2431,7 +2431,7 @@ PRIVATE int atapi_intr_wait(int UNUSED(do_dma), size_t UNUSED(max)) #undef sys_voutb #undef sys_vinb -PRIVATE int at_voutb(pvb_pair_t *pvb, int n) +static int at_voutb(pvb_pair_t *pvb, int n) { int s, i; if ((s=sys_voutb(pvb,n)) == OK) @@ -2442,7 +2442,7 @@ PRIVATE int at_voutb(pvb_pair_t *pvb, int n) panic("sys_voutb failed"); } -PRIVATE int at_vinb(pvb_pair_t *pvb, int n) +static int at_vinb(pvb_pair_t *pvb, int n) { int s, i; if ((s=sys_vinb(pvb,n)) == OK) @@ -2453,7 +2453,7 @@ PRIVATE int at_vinb(pvb_pair_t *pvb, int n) panic("sys_vinb failed"); } -PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type) +static int at_out(int line, u32_t port, u32_t value, char *typename, int type) { int s; s = sys_out(port, value, type); @@ -2465,7 +2465,7 @@ PRIVATE int at_out(int line, u32_t port, u32_t value, char *typename, int type) } -PRIVATE int at_in(int line, u32_t port, u32_t *value, char *typename, int type) +static int at_in(int line, u32_t port, u32_t *value, char *typename, int type) { int s; s = sys_in(port, value, type); diff --git a/drivers/at_wini/liveupdate.c b/drivers/at_wini/liveupdate.c index a048c22b4..25a57b742 100644 --- a/drivers/at_wini/liveupdate.c +++ b/drivers/at_wini/liveupdate.c @@ -19,7 +19,7 @@ EXTERN int w_command; /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -49,7 +49,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || AT_STATE_IS_CUSTOM(state); } @@ -57,7 +57,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { sef_lu_dprint("at_wini: live update state = %d\n", state); sef_lu_dprint("at_wini: w_command = 0x%02X\n", w_command); diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 756bde4ec..c06da5c9b 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -32,7 +32,7 @@ typedef struct { u8_t data[ATL2_RXD_SIZE - sizeof(u32_t) * 2]; } rxd_t; -PRIVATE struct { +static struct { int devind; /* PCI device index */ int irq; /* IRQ number */ int hook_id; /* IRQ hook ID */ @@ -82,14 +82,14 @@ PRIVATE struct { #define ATL2_ALIGN_32(n) (((n) + 3) & ~3) -PRIVATE iovec_s_t iovec[NR_IOREQS]; +static iovec_s_t iovec[NR_IOREQS]; -PRIVATE int instance; +static int instance; /*===========================================================================* * atl2_read_vpd * *===========================================================================*/ -PRIVATE int atl2_read_vpd(int index, u32_t *res) +static int atl2_read_vpd(int index, u32_t *res) { /* Read a value from the VPD register area. */ @@ -123,7 +123,7 @@ PRIVATE int atl2_read_vpd(int index, u32_t *res) /*===========================================================================* * atl2_get_vpd_hwaddr * *===========================================================================*/ -PRIVATE int atl2_get_vpd_hwaddr(void) +static int atl2_get_vpd_hwaddr(void) { /* Read the MAC address from the EEPROM, using the Vital Product Data * register interface. @@ -176,7 +176,7 @@ PRIVATE int atl2_get_vpd_hwaddr(void) /*===========================================================================* * atl2_get_hwaddr * *===========================================================================*/ -PRIVATE void atl2_get_hwaddr(void) +static void atl2_get_hwaddr(void) { /* Get the MAC address of the card. First try the EEPROM; if that * fails, just use whatever the card was already set to. @@ -196,7 +196,7 @@ PRIVATE void atl2_get_hwaddr(void) /*===========================================================================* * atl2_read_mdio * *===========================================================================*/ -PRIVATE int atl2_read_mdio(int addr, u16_t *res) +static int atl2_read_mdio(int addr, u16_t *res) { /* Read a MII PHY register using MDIO. */ @@ -227,7 +227,7 @@ PRIVATE int atl2_read_mdio(int addr, u16_t *res) /*===========================================================================* * atl2_alloc_dma * *===========================================================================*/ -PRIVATE int atl2_alloc_dma(void) +static int atl2_alloc_dma(void) { /* Allocate DMA ring buffers. */ @@ -263,7 +263,7 @@ PRIVATE int atl2_alloc_dma(void) /*===========================================================================* * atl2_stop * *===========================================================================*/ -PRIVATE int atl2_stop(void) +static int atl2_stop(void) { /* Stop the device. */ @@ -299,7 +299,7 @@ PRIVATE int atl2_stop(void) /*===========================================================================* * atl2_reset * *===========================================================================*/ -PRIVATE int atl2_reset(void) +static int atl2_reset(void) { /* Reset the device to a known good state. */ @@ -334,7 +334,7 @@ PRIVATE int atl2_reset(void) /*===========================================================================* * atl2_set_mode * *===========================================================================*/ -PRIVATE void atl2_set_mode(void) +static void atl2_set_mode(void) { /* Reconfigure the device's promiscuity, multicast, and broadcast mode * settings. @@ -357,7 +357,7 @@ PRIVATE void atl2_set_mode(void) /*===========================================================================* * atl2_setup * *===========================================================================*/ -PRIVATE int atl2_setup(void) +static int atl2_setup(void) { /* Set up the device for normal operation. */ @@ -457,7 +457,7 @@ PRIVATE int atl2_setup(void) /*===========================================================================* * atl2_probe * *===========================================================================*/ -PRIVATE int atl2_probe(int skip) +static int atl2_probe(int skip) { /* Find a matching PCI device. */ @@ -490,7 +490,7 @@ PRIVATE int atl2_probe(int skip) /*===========================================================================* * atl2_init * *===========================================================================*/ -PRIVATE void atl2_init(int devind) +static void atl2_init(int devind) { /* Initialize the device. */ @@ -537,7 +537,7 @@ PRIVATE void atl2_init(int devind) /*===========================================================================* * atl2_tx_stat * *===========================================================================*/ -PRIVATE void atl2_tx_stat(u32_t stat) +static void atl2_tx_stat(u32_t stat) { /* Update statistics for packet transmission. */ @@ -564,7 +564,7 @@ PRIVATE void atl2_tx_stat(u32_t stat) /*===========================================================================* * atl2_rx_stat * *===========================================================================*/ -PRIVATE void atl2_rx_stat(u32_t stat) +static void atl2_rx_stat(u32_t stat) { /* Update statistics for packet receipt. */ @@ -587,7 +587,7 @@ PRIVATE void atl2_rx_stat(u32_t stat) /*===========================================================================* * atl2_tx_advance * *===========================================================================*/ -PRIVATE int atl2_tx_advance(void) +static int atl2_tx_advance(void) { /* Advance the TxD/TxS tails by as many sent packets as found. */ @@ -642,7 +642,7 @@ PRIVATE int atl2_tx_advance(void) /*===========================================================================* * atl2_rx_advance * *===========================================================================*/ -PRIVATE void atl2_rx_advance(int next) +static void atl2_rx_advance(int next) { /* Advance the RxD tail by as many failed receipts as possible, and * see if there is an actual packet left to receive. If 'next' is set, @@ -710,7 +710,7 @@ PRIVATE void atl2_rx_advance(int next) /*===========================================================================* * atl2_reply * *===========================================================================*/ -PRIVATE void atl2_reply(void) +static void atl2_reply(void) { /* Send a task reply to Inet. */ @@ -740,7 +740,7 @@ PRIVATE void atl2_reply(void) /*===========================================================================* * atl2_readv * *===========================================================================*/ -PRIVATE void atl2_readv(const message *m, int from_int) +static void atl2_readv(const message *m, int from_int) { /* Read packet data. */ @@ -835,7 +835,7 @@ suspend: /*===========================================================================* * atl2_writev * *===========================================================================*/ -PRIVATE void atl2_writev(const message *m, int from_int) +static void atl2_writev(const message *m, int from_int) { /* Write packet data. */ @@ -959,7 +959,7 @@ suspend: /*===========================================================================* * atl2_intr * *===========================================================================*/ -PRIVATE void atl2_intr(const message *UNUSED(m)) +static void atl2_intr(const message *UNUSED(m)) { /* Interrupt received. */ @@ -1014,7 +1014,7 @@ PRIVATE void atl2_intr(const message *UNUSED(m)) /*===========================================================================* * atl2_conf * *===========================================================================*/ -PRIVATE void atl2_conf(message *m) +static void atl2_conf(message *m) { /* Configure the mode of the card. */ @@ -1044,7 +1044,7 @@ PRIVATE void atl2_conf(message *m) /*===========================================================================* * atl2_getstat * *===========================================================================*/ -PRIVATE void atl2_getstat(message *m) +static void atl2_getstat(message *m) { /* Copy out statistics. */ @@ -1062,7 +1062,7 @@ PRIVATE void atl2_getstat(message *m) /*===========================================================================* * atl2_dump_link * *===========================================================================*/ -PRIVATE void atl2_dump_link(void) +static void atl2_dump_link(void) { /* Dump link status. */ @@ -1099,7 +1099,7 @@ PRIVATE void atl2_dump_link(void) /*===========================================================================* * atl2_dump * *===========================================================================*/ -PRIVATE void atl2_dump(void) +static void atl2_dump(void) { /* Dump statistics. */ @@ -1143,7 +1143,7 @@ PRIVATE void atl2_dump(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the atl2 driver. */ @@ -1184,7 +1184,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* In case of a termination signal, shut down this driver. * Stop the device, and deallocate resources as proof of concept. @@ -1214,7 +1214,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); diff --git a/drivers/audio/es1370/ak4531.c b/drivers/audio/es1370/ak4531.c index 605d750b7..cfbf194da 100644 --- a/drivers/audio/es1370/ak4531.c +++ b/drivers/audio/es1370/ak4531.c @@ -26,15 +26,15 @@ #define MUTE 0x80 -FORWARD int ak4531_write(u8_t address, u8_t data); -FORWARD int ak4531_finished(void); -FORWARD int set_volume(struct volume_level *level, int cmd_left, int +static int ak4531_write(u8_t address, u8_t data); +static int ak4531_finished(void); +static int set_volume(struct volume_level *level, int cmd_left, int cmd_right, int max_level); -PRIVATE u16_t base_address; -PRIVATE u16_t status_register; -PRIVATE u16_t status_bit; -PRIVATE u16_t poll_address; +static u16_t base_address; +static u16_t status_register; +static u16_t status_bit; +static u16_t poll_address; u8_t mixer_values[0x20] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 0x00 - 0x07 */ @@ -53,7 +53,7 @@ u8_t mixer_values[0x20] = { -PRIVATE int ak4531_finished(void) { +static int ak4531_finished(void) { int i; u16_t cstat; for (i = 0; i < 0x40000; i++) { @@ -66,7 +66,7 @@ PRIVATE int ak4531_finished(void) { } -PRIVATE int ak4531_write (u8_t address, u8_t data) { +static int ak4531_write (u8_t address, u8_t data) { u16_t to_be_written; @@ -80,7 +80,7 @@ PRIVATE int ak4531_write (u8_t address, u8_t data) { } -PUBLIC int ak4531_init(u16_t base, u16_t status_reg, u16_t bit, +int ak4531_init(u16_t base, u16_t status_reg, u16_t bit, u16_t poll) { int i; @@ -107,7 +107,7 @@ PUBLIC int ak4531_init(u16_t base, u16_t status_reg, u16_t bit, } -PUBLIC int ak4531_get_set_volume(struct volume_level *level, int flag) { +int ak4531_get_set_volume(struct volume_level *level, int flag) { int cmd_left, cmd_right, max_level; max_level = 0x1f; @@ -160,7 +160,7 @@ PUBLIC int ak4531_get_set_volume(struct volume_level *level, int flag) { } -PRIVATE int set_volume(struct volume_level *level, int cmd_left, int cmd_right, +static int set_volume(struct volume_level *level, int cmd_left, int cmd_right, int max_level) { if(level->right < 0) level->right = 0; diff --git a/drivers/audio/es1370/es1370.c b/drivers/audio/es1370/es1370.c index 298cca7d0..9e2785987 100644 --- a/drivers/audio/es1370/es1370.c +++ b/drivers/audio/es1370/es1370.c @@ -28,32 +28,32 @@ /* prototypes of private functions */ -FORWARD int detect_hw(void); -FORWARD int disable_int(int sub_dev); -FORWARD int set_stereo(u32_t stereo, int sub_dev); -FORWARD int set_bits(u32_t nr_of_bits, int sub_dev); -FORWARD int set_sample_rate(u32_t rate, int sub_dev); -FORWARD int set_sign(u32_t val, int sub_dev); -FORWARD int get_max_frag_size(u32_t * val, int *len, int sub_dev); -FORWARD int set_frag_size(u32_t fragment_size, int sub_dev); -FORWARD int set_int_cnt(int sub_dev); -FORWARD int free_buf(u32_t *val, int *len, int sub_dev); -FORWARD int get_samples_in_buf(u32_t *val, int *len, int sub_dev); -FORWARD int get_set_volume(struct volume_level *level, int *len, int +static int detect_hw(void); +static int disable_int(int sub_dev); +static int set_stereo(u32_t stereo, int sub_dev); +static int set_bits(u32_t nr_of_bits, int sub_dev); +static int set_sample_rate(u32_t rate, int sub_dev); +static int set_sign(u32_t val, int sub_dev); +static int get_max_frag_size(u32_t * val, int *len, int sub_dev); +static int set_frag_size(u32_t fragment_size, int sub_dev); +static int set_int_cnt(int sub_dev); +static int free_buf(u32_t *val, int *len, int sub_dev); +static int get_samples_in_buf(u32_t *val, int *len, int sub_dev); +static int get_set_volume(struct volume_level *level, int *len, int sub_dev, int flag); -FORWARD int reset(int sub_dev); +static int reset(int sub_dev); DEV_STRUCT dev; aud_sub_dev_conf_t aud_conf[4]; -PUBLIC sub_dev_t sub_dev[4]; -PUBLIC special_file_t special_file[4]; -PUBLIC drv_t drv; +sub_dev_t sub_dev[4]; +special_file_t special_file[4]; +drv_t drv; -PUBLIC int drv_init(void) { +int drv_init(void) { drv.DriverName = DRIVER_NAME; drv.NrOfSubDevices = 4; drv.NrOfSpecialFiles = 4; @@ -106,7 +106,7 @@ PUBLIC int drv_init(void) { } -PUBLIC int drv_init_hw (void) { +int drv_init_hw (void) { u16_t i, j; u16_t chip_sel_ctrl_reg; @@ -167,7 +167,7 @@ PUBLIC int drv_init_hw (void) { } -PRIVATE int detect_hw(void) { +static int detect_hw(void) { u32_t device; int devind; u16_t v_id, d_id; @@ -210,7 +210,7 @@ PRIVATE int detect_hw(void) { } -PRIVATE int reset(int chan) { +static int reset(int chan) { drv_stop(chan); sub_dev[chan].OutOfData = 1; @@ -455,7 +455,7 @@ int drv_resume(int sub_dev) { } -PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) { +static int set_bits(u32_t nr_of_bits, int sub_dev) { /* set format bits for specified channel. */ u16_t size_16_bit, ser_interface; @@ -479,7 +479,7 @@ PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) { } -PRIVATE int set_stereo(u32_t stereo, int sub_dev) { +static int set_stereo(u32_t stereo, int sub_dev) { /* set format bits for specified channel. */ u16_t stereo_bit, ser_interface; @@ -501,12 +501,12 @@ PRIVATE int set_stereo(u32_t stereo, int sub_dev) { } -PRIVATE int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) { +static int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) { return OK; } -PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) { +static int set_frag_size(u32_t fragment_size, int sub_dev_nr) { if (fragment_size > (sub_dev[sub_dev_nr].DmaSize / sub_dev[sub_dev_nr].NrOfDmaFragments) || fragment_size < sub_dev[sub_dev_nr].MinFragmentSize) { @@ -518,7 +518,7 @@ PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) { } -PRIVATE int set_sample_rate(u32_t rate, int sub_dev) { +static int set_sample_rate(u32_t rate, int sub_dev) { /* currently only 44.1kHz */ u32_t controlRegister; @@ -536,7 +536,7 @@ PRIVATE int set_sample_rate(u32_t rate, int sub_dev) { } -PRIVATE int set_int_cnt(int chan) { +static int set_int_cnt(int chan) { /* Write interrupt count for specified channel. After bytes, an interrupt will be generated */ @@ -573,7 +573,7 @@ PRIVATE int set_int_cnt(int chan) { } -PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { +static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { *len = sizeof(*val); *val = (sub_dev[sub_dev_nr].DmaSize / sub_dev[sub_dev_nr].NrOfDmaFragments); @@ -581,7 +581,7 @@ PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { } -PRIVATE int disable_int(int chan) { +static int disable_int(int chan) { u16_t ser_interface, int_en_bit; switch(chan) { @@ -597,7 +597,7 @@ PRIVATE int disable_int(int chan) { } -PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { +static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { u16_t samp_ct_reg; u16_t curr_samp_ct_reg; u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */ @@ -629,7 +629,7 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { /* returns 1 if there are free buffers */ -PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) { +static int free_buf (u32_t *val, int *len, int sub_dev_nr) { *len = sizeof(*val); if (sub_dev[sub_dev_nr].BufLength == sub_dev[sub_dev_nr].NrOfExtraBuffers) { @@ -642,7 +642,7 @@ PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) { } -PRIVATE int get_set_volume(struct volume_level *level, int *len, int sub_dev, +static int get_set_volume(struct volume_level *level, int *len, int sub_dev, int flag) { *len = sizeof(struct volume_level); if (sub_dev == MIXER) { diff --git a/drivers/audio/es1370/pci_helper.c b/drivers/audio/es1370/pci_helper.c index 47b039806..6e6317344 100644 --- a/drivers/audio/es1370/pci_helper.c +++ b/drivers/audio/es1370/pci_helper.c @@ -14,7 +14,7 @@ /*===========================================================================* * helper functions for I/O * *===========================================================================*/ -PUBLIC u32_t pci_inb(u16_t port) { +u32_t pci_inb(u16_t port) { u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) @@ -23,7 +23,7 @@ PUBLIC u32_t pci_inb(u16_t port) { } -PUBLIC u32_t pci_inw(u16_t port) { +u32_t pci_inw(u16_t port) { u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) @@ -32,7 +32,7 @@ PUBLIC u32_t pci_inw(u16_t port) { } -PUBLIC u32_t pci_inl(u16_t port) { +u32_t pci_inl(u16_t port) { u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) @@ -41,21 +41,21 @@ PUBLIC u32_t pci_inl(u16_t port) { } -PUBLIC void pci_outb(u16_t port, u8_t value) { +void pci_outb(u16_t port, u8_t value) { int s; if ((s=sys_outb(port, value)) !=OK) printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s); } -PUBLIC void pci_outw(u16_t port, u16_t value) { +void pci_outw(u16_t port, u16_t value) { int s; if ((s=sys_outw(port, value)) !=OK) printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s); } -PUBLIC void pci_outl(u16_t port, u32_t value) { +void pci_outl(u16_t port, u32_t value) { int s; if ((s=sys_outl(port, value)) !=OK) printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s); diff --git a/drivers/audio/es1371/AC97.c b/drivers/audio/es1371/AC97.c index af003c3c4..6bb9bbce7 100644 --- a/drivers/audio/es1371/AC97.c +++ b/drivers/audio/es1371/AC97.c @@ -6,15 +6,15 @@ /* AC97 Mixer and Mode control function prototypes */ -FORWARD int AC97_write(const DEV_STRUCT * pCC, u16_t wAddr, u16_t +static int AC97_write(const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData); -FORWARD int AC97_write_unsynced(const DEV_STRUCT * pCC, u16_t wAddr, +static int AC97_write_unsynced(const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData); -FORWARD int AC97_read_unsynced(const DEV_STRUCT * pCC, u16_t wAddr, +static int AC97_read_unsynced(const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data); -FORWARD void set_nice_volume(void); -FORWARD int AC97_get_volume(struct volume_level *level); -FORWARD int AC97_set_volume(const struct volume_level *level); +static void set_nice_volume(void); +static int AC97_get_volume(struct volume_level *level); +static int AC97_set_volume(const struct volume_level *level); @@ -56,7 +56,7 @@ static DEV_STRUCT *dev; #if 0 -PRIVATE void set_src_sync_state (int state) +static void set_src_sync_state (int state) { if (state < 0) SrcSyncState = SRC_UNSYNCED; @@ -68,7 +68,7 @@ PRIVATE void set_src_sync_state (int state) #endif -PRIVATE int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) +static int AC97_write (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) { u32_t dtemp, i; u16_t wBaseAddr = pCC->base; @@ -133,7 +133,7 @@ u16_t wBaseAddr = pCC->base; #if 0 -PRIVATE int AC97_read (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) +static int AC97_read (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) { u32_t dtemp, i; u16_t base = pCC->base; @@ -207,7 +207,7 @@ u16_t base = pCC->base; #endif -PRIVATE int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, +static int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) { /* wait for WIP to go away */ @@ -220,7 +220,7 @@ PRIVATE int AC97_write_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, } -PRIVATE int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, +static int AC97_read_unsynced (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) { u32_t dtemp; @@ -309,7 +309,7 @@ int AC97_init( DEV_STRUCT * pCC ) { } -PRIVATE void set_nice_volume(void) { +static void set_nice_volume(void) { /* goofy code to set the DAC1 channel to an audibe volume to be able to test it without using the mixer */ @@ -340,7 +340,7 @@ PRIVATE void set_nice_volume(void) { } -PRIVATE int get_volume(u8_t *left, u8_t *right, int cmd) { +static int get_volume(u8_t *left, u8_t *right, int cmd) { u16_t value; AC97_read_unsynced(dev, (u16_t)cmd, &value); @@ -352,7 +352,7 @@ PRIVATE int get_volume(u8_t *left, u8_t *right, int cmd) { } -PRIVATE int set_volume(int left, int right, int cmd) { +static int set_volume(int left, int right, int cmd) { u16_t waarde; waarde = (u16_t)((left<<8)|right); @@ -393,7 +393,7 @@ int AC97_get_set_volume(struct volume_level *level, int flag) { } -PRIVATE int AC97_get_volume(struct volume_level *level) { +static int AC97_get_volume(struct volume_level *level) { int cmd; u8_t left; u8_t right; @@ -453,7 +453,7 @@ PRIVATE int AC97_get_volume(struct volume_level *level) { } -PRIVATE int AC97_set_volume(const struct volume_level *level) { +static int AC97_set_volume(const struct volume_level *level) { int cmd; int left; int right; diff --git a/drivers/audio/es1371/es1371.c b/drivers/audio/es1371/es1371.c index 12eb1959b..8830aa18a 100644 --- a/drivers/audio/es1371/es1371.c +++ b/drivers/audio/es1371/es1371.c @@ -34,32 +34,32 @@ /* prototypes of private functions */ -FORWARD int detect_hw(void); -FORWARD int disable_int(int sub_dev); -FORWARD int set_stereo(u32_t stereo, int sub_dev); -FORWARD int set_bits(u32_t nr_of_bits, int sub_dev); -FORWARD int set_sample_rate(u32_t rate, int sub_dev); -FORWARD int set_sign(u32_t val, int sub_dev); -FORWARD int get_max_frag_size(u32_t * val, int *len, int sub_dev); -FORWARD int set_frag_size(u32_t fragment_size, int sub_dev); -FORWARD int set_int_cnt(int sub_dev); -FORWARD int free_buf(u32_t *val, int *len, int sub_dev); -FORWARD int get_samples_in_buf(u32_t *val, int *len, int sub_dev); -FORWARD int get_set_volume(struct volume_level *level, int *len, int +static int detect_hw(void); +static int disable_int(int sub_dev); +static int set_stereo(u32_t stereo, int sub_dev); +static int set_bits(u32_t nr_of_bits, int sub_dev); +static int set_sample_rate(u32_t rate, int sub_dev); +static int set_sign(u32_t val, int sub_dev); +static int get_max_frag_size(u32_t * val, int *len, int sub_dev); +static int set_frag_size(u32_t fragment_size, int sub_dev); +static int set_int_cnt(int sub_dev); +static int free_buf(u32_t *val, int *len, int sub_dev); +static int get_samples_in_buf(u32_t *val, int *len, int sub_dev); +static int get_set_volume(struct volume_level *level, int *len, int sub_dev, int flag); -FORWARD int reset(int sub_dev); +static int reset(int sub_dev); DEV_STRUCT dev; aud_sub_dev_conf_t aud_conf[4]; -PUBLIC sub_dev_t sub_dev[4]; -PUBLIC special_file_t special_file[4]; -PUBLIC drv_t drv; +sub_dev_t sub_dev[4]; +special_file_t special_file[4]; +drv_t drv; -PUBLIC int drv_init(void) { +int drv_init(void) { drv.DriverName = DRIVER_NAME; drv.NrOfSubDevices = 4; drv.NrOfSpecialFiles = 4; @@ -112,7 +112,7 @@ PUBLIC int drv_init(void) { } -PUBLIC int drv_init_hw (void) { +int drv_init_hw (void) { u16_t i, j; /* First, detect the hardware */ @@ -169,7 +169,7 @@ PUBLIC int drv_init_hw (void) { } -PRIVATE int detect_hw(void) { +static int detect_hw(void) { u32_t device; int devind; u16_t v_id, d_id; @@ -212,7 +212,7 @@ PRIVATE int detect_hw(void) { } -PRIVATE int reset(int chan) { +static int reset(int chan) { drv_stop(chan); sub_dev[chan].OutOfData = 1; @@ -456,7 +456,7 @@ int drv_resume(int sub_dev) { } -PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) { +static int set_bits(u32_t nr_of_bits, int sub_dev) { /* set format bits for specified channel. */ u16_t size_16_bit, ser_interface; @@ -480,7 +480,7 @@ PRIVATE int set_bits(u32_t nr_of_bits, int sub_dev) { } -PRIVATE int set_stereo(u32_t stereo, int sub_dev) { +static int set_stereo(u32_t stereo, int sub_dev) { /* set format bits for specified channel. */ u16_t stereo_bit, ser_interface; @@ -502,12 +502,12 @@ PRIVATE int set_stereo(u32_t stereo, int sub_dev) { } -PRIVATE int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) { +static int set_sign(u32_t UNUSED(val), int UNUSED(sub_dev)) { return OK; } -PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) { +static int set_frag_size(u32_t fragment_size, int sub_dev_nr) { if (fragment_size > (sub_dev[sub_dev_nr].DmaSize / sub_dev[sub_dev_nr].NrOfDmaFragments) || fragment_size < sub_dev[sub_dev_nr].MinFragmentSize) { @@ -519,7 +519,7 @@ PRIVATE int set_frag_size(u32_t fragment_size, int sub_dev_nr) { } -PRIVATE int set_sample_rate(u32_t rate, int sub_dev) { +static int set_sample_rate(u32_t rate, int sub_dev) { u32_t src_base_reg; if (rate > MAX_RATE || rate < MIN_RATE) { @@ -538,7 +538,7 @@ PRIVATE int set_sample_rate(u32_t rate, int sub_dev) { } -PRIVATE int set_int_cnt(int chan) { +static int set_int_cnt(int chan) { /* Write interrupt count for specified channel. After bytes, an interrupt will be generated */ @@ -575,7 +575,7 @@ PRIVATE int set_int_cnt(int chan) { } -PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { +static int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { *len = sizeof(*val); *val = (sub_dev[sub_dev_nr].DmaSize / sub_dev[sub_dev_nr].NrOfDmaFragments); @@ -583,7 +583,7 @@ PRIVATE int get_max_frag_size(u32_t * val, int * len, int sub_dev_nr) { } -PRIVATE int disable_int(int chan) { +static int disable_int(int chan) { u16_t ser_interface, int_en_bit; switch(chan) { @@ -599,7 +599,7 @@ PRIVATE int disable_int(int chan) { } -PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { +static int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { u16_t samp_ct_reg; u16_t curr_samp_ct_reg; u16_t curr_samp_ct; /* counts back from SAMP_CT till 0 */ @@ -631,7 +631,7 @@ PRIVATE int get_samples_in_buf (u32_t *samples_in_buf, int *len, int chan) { /* returns 1 if there are free buffers */ -PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) { +static int free_buf (u32_t *val, int *len, int sub_dev_nr) { *len = sizeof(*val); if (sub_dev[sub_dev_nr].BufLength == sub_dev[sub_dev_nr].NrOfExtraBuffers) { @@ -644,7 +644,7 @@ PRIVATE int free_buf (u32_t *val, int *len, int sub_dev_nr) { } -PRIVATE int get_set_volume(struct volume_level *level, int *len, int sub_dev, +static int get_set_volume(struct volume_level *level, int *len, int sub_dev, int flag) { *len = sizeof(struct volume_level); if (sub_dev == MIXER) { diff --git a/drivers/audio/es1371/pci_helper.c b/drivers/audio/es1371/pci_helper.c index 44cce77c6..c2c473fdb 100644 --- a/drivers/audio/es1371/pci_helper.c +++ b/drivers/audio/es1371/pci_helper.c @@ -14,7 +14,7 @@ /*===========================================================================* * helper functions for I/O * *===========================================================================*/ -PUBLIC u32_t pci_inb(u16_t port) { +u32_t pci_inb(u16_t port) { u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) @@ -23,7 +23,7 @@ PUBLIC u32_t pci_inb(u16_t port) { } -PUBLIC u32_t pci_inw(u16_t port) { +u32_t pci_inw(u16_t port) { u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) @@ -32,7 +32,7 @@ PUBLIC u32_t pci_inw(u16_t port) { } -PUBLIC u32_t pci_inl(u16_t port) { +u32_t pci_inl(u16_t port) { u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) @@ -41,21 +41,21 @@ PUBLIC u32_t pci_inl(u16_t port) { } -PUBLIC void pci_outb(u16_t port, u8_t value) { +void pci_outb(u16_t port, u8_t value) { int s; if ((s=sys_outb(port, value)) !=OK) printf("%s: warning, sys_outb failed: %d\n", DRIVER_NAME, s); } -PUBLIC void pci_outw(u16_t port, u16_t value) { +void pci_outw(u16_t port, u16_t value) { int s; if ((s=sys_outw(port, value)) !=OK) printf("%s: warning, sys_outw failed: %d\n", DRIVER_NAME, s); } -PUBLIC void pci_outl(u16_t port, u32_t value) { +void pci_outl(u16_t port, u32_t value) { int s; if ((s=sys_outl(port, value)) !=OK) printf("%s: warning, sys_outl failed: %d\n", DRIVER_NAME, s); diff --git a/drivers/audio/es1371/sample_rate_converter.c b/drivers/audio/es1371/sample_rate_converter.c index e61661b5a..9229928a7 100644 --- a/drivers/audio/es1371/sample_rate_converter.c +++ b/drivers/audio/es1371/sample_rate_converter.c @@ -34,9 +34,9 @@ -FORWARD int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t +static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data); -FORWARD int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val); +static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val); int src_init ( DEV_STRUCT * DSP ) { @@ -103,7 +103,7 @@ int src_init ( DEV_STRUCT * DSP ) { } -PRIVATE int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) { +static int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) { u32_t dtemp; /* wait for ready */ @@ -129,7 +129,7 @@ PRIVATE int src_reg_read(const DEV_STRUCT * DSP, u16_t reg, u16_t *data) { } -PRIVATE int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) { +static int src_reg_write(const DEV_STRUCT * DSP, u16_t reg, u16_t val) { u32_t dtemp; /* wait for ready */ diff --git a/drivers/audio/sb16/mixer.c b/drivers/audio/sb16/mixer.c index b83946185..4dbf5368d 100644 --- a/drivers/audio/sb16/mixer.c +++ b/drivers/audio/sb16/mixer.c @@ -3,10 +3,10 @@ -FORWARD int get_set_volume(struct volume_level *level, int flag); -FORWARD int get_set_input(struct inout_ctrl *input, int flag, int +static int get_set_volume(struct volume_level *level, int flag); +static int get_set_input(struct inout_ctrl *input, int flag, int channel); -FORWARD int get_set_output(struct inout_ctrl *output, int flag); +static int get_set_output(struct inout_ctrl *output, int flag); @@ -14,7 +14,7 @@ FORWARD int get_set_output(struct inout_ctrl *output, int flag); /*=========================================================================* * mixer_ioctl *=========================================================================*/ -PUBLIC int mixer_ioctl(int request, void *val, int *UNUSED(len)) { +int mixer_ioctl(int request, void *val, int *UNUSED(len)) { int status; switch(request) { @@ -36,7 +36,7 @@ PUBLIC int mixer_ioctl(int request, void *val, int *UNUSED(len)) { /*=========================================================================* * mixer_init *=========================================================================*/ -PUBLIC int mixer_init() { +int mixer_init() { /* Try to detect the mixer by writing to MIXER_DAC_LEVEL if the * value written can be read back the mixer is there */ @@ -60,7 +60,7 @@ PUBLIC int mixer_init() { /*=========================================================================* * get_set_volume * *=========================================================================*/ -PRIVATE int get_set_volume(struct volume_level *level, int flag) { +static int get_set_volume(struct volume_level *level, int flag) { int cmd_left, cmd_right, shift, max_level; shift = 3; @@ -133,7 +133,7 @@ PRIVATE int get_set_volume(struct volume_level *level, int flag) { /*=========================================================================* * get_set_input * *=========================================================================*/ -PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) { +static int get_set_input(struct inout_ctrl *input, int flag, int channel) { int input_cmd, input_mask, mask, del_mask, shift; input_cmd = (channel == 0 ? MIXER_IN_LEFT : MIXER_IN_RIGHT); @@ -187,7 +187,7 @@ PRIVATE int get_set_input(struct inout_ctrl *input, int flag, int channel) { /*=========================================================================* * get_set_output * *=========================================================================*/ -PRIVATE int get_set_output(struct inout_ctrl *output, int flag) { +static int get_set_output(struct inout_ctrl *output, int flag) { int output_mask, mask, del_mask, shift; mask = mixer_get(MIXER_OUTPUT_CTRL); @@ -233,7 +233,7 @@ PRIVATE int get_set_output(struct inout_ctrl *output, int flag) { -PUBLIC int mixer_set(int reg, int data) { +int mixer_set(int reg, int data) { int i; sb16_outb(MIXER_REG, reg); @@ -245,7 +245,7 @@ PUBLIC int mixer_set(int reg, int data) { -PUBLIC int mixer_get(int reg) { +int mixer_get(int reg) { int i; sb16_outb(MIXER_REG, reg); diff --git a/drivers/audio/sb16/sb16.c b/drivers/audio/sb16/sb16.c index 32c5e09d0..84574ccbf 100644 --- a/drivers/audio/sb16/sb16.c +++ b/drivers/audio/sb16/sb16.c @@ -11,34 +11,34 @@ #include "mixer.h" -FORWARD void dsp_dma_setup(phys_bytes address, int count, int sub_dev); +static void dsp_dma_setup(phys_bytes address, int count, int sub_dev); -FORWARD int dsp_ioctl(int request, void *val, int *len); -FORWARD int dsp_set_size(unsigned int size); -FORWARD int dsp_set_speed(unsigned int speed); -FORWARD int dsp_set_stereo(unsigned int stereo); -FORWARD int dsp_set_bits(unsigned int bits); -FORWARD int dsp_set_sign(unsigned int sign); -FORWARD int dsp_get_max_frag_size(u32_t *val, int *len); +static int dsp_ioctl(int request, void *val, int *len); +static int dsp_set_size(unsigned int size); +static int dsp_set_speed(unsigned int speed); +static int dsp_set_stereo(unsigned int stereo); +static int dsp_set_bits(unsigned int bits); +static int dsp_set_sign(unsigned int sign); +static int dsp_get_max_frag_size(u32_t *val, int *len); -PRIVATE unsigned int DspStereo = DEFAULT_STEREO; -PRIVATE unsigned int DspSpeed = DEFAULT_SPEED; -PRIVATE unsigned int DspBits = DEFAULT_BITS; -PRIVATE unsigned int DspSign = DEFAULT_SIGN; -PRIVATE unsigned int DspFragmentSize; +static unsigned int DspStereo = DEFAULT_STEREO; +static unsigned int DspSpeed = DEFAULT_SPEED; +static unsigned int DspBits = DEFAULT_BITS; +static unsigned int DspSign = DEFAULT_SIGN; +static unsigned int DspFragmentSize; -PRIVATE phys_bytes DmaPhys; -PRIVATE int running = FALSE; +static phys_bytes DmaPhys; +static int running = FALSE; -PUBLIC sub_dev_t sub_dev[2]; -PUBLIC special_file_t special_file[3]; -PUBLIC drv_t drv; +sub_dev_t sub_dev[2]; +special_file_t special_file[3]; +drv_t drv; -PUBLIC int drv_init(void) { +int drv_init(void) { drv.DriverName = "SB16"; drv.NrOfSubDevices = 2; drv.NrOfSpecialFiles = 3; @@ -72,7 +72,7 @@ PUBLIC int drv_init(void) { } -PUBLIC int drv_init_hw(void) { +int drv_init_hw(void) { int i; int DspVersion[2]; Dprint(("drv_init_hw():\n")); @@ -114,7 +114,7 @@ PUBLIC int drv_init_hw(void) { -PUBLIC int drv_reset(void) { +int drv_reset(void) { int i; Dprint(("drv_reset():\n")); @@ -131,7 +131,7 @@ PUBLIC int drv_reset(void) { -PUBLIC int drv_start(int channel, int DmaMode) { +int drv_start(int channel, int DmaMode) { Dprint(("drv_start():\n")); drv_reset(); @@ -178,7 +178,7 @@ PUBLIC int drv_start(int channel, int DmaMode) { -PUBLIC int drv_stop(int sub_dev) { +int drv_stop(int sub_dev) { if(running) { Dprint(("drv_stop():\n")); dsp_command((DspBits == 8 ? DSP_CMD_DMA8HALT : DSP_CMD_DMA16HALT)); @@ -190,7 +190,7 @@ PUBLIC int drv_stop(int sub_dev) { -PUBLIC int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) { +int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) { Dprint(("drv_set_dma():\n")); DmaPhys = dma; return OK; @@ -198,7 +198,7 @@ PUBLIC int drv_set_dma(u32_t dma, u32_t UNUSED(length), int UNUSED(chan)) { -PUBLIC int drv_reenable_int(int UNUSED(chan)) { +int drv_reenable_int(int UNUSED(chan)) { Dprint(("drv_reenable_int()\n")); sb16_inb((DspBits == 8 ? DSP_DATA_AVL : DSP_DATA16_AVL)); return OK; @@ -206,33 +206,33 @@ PUBLIC int drv_reenable_int(int UNUSED(chan)) { -PUBLIC int drv_int_sum(void) { +int drv_int_sum(void) { return mixer_get(MIXER_IRQ_STATUS) & 0x0F; } -PUBLIC int drv_int(int sub_dev) { +int drv_int(int sub_dev) { return sub_dev == AUDIO && mixer_get(MIXER_IRQ_STATUS) & 0x03; } -PUBLIC int drv_pause(int chan) { +int drv_pause(int chan) { drv_stop(chan); return OK; } -PUBLIC int drv_resume(int UNUSED(chan)) { +int drv_resume(int UNUSED(chan)) { dsp_command((DspBits == 8 ? DSP_CMD_DMA8CONT : DSP_CMD_DMA16CONT)); return OK; } -PUBLIC int drv_io_ctl(int request, void *val, int *len, int sub_dev) { +int drv_io_ctl(int request, void *val, int *len, int sub_dev) { Dprint(("dsp_ioctl: got ioctl %d, argument: %d sub_dev: %d\n", request, val, sub_dev)); if(sub_dev == AUDIO) { @@ -246,7 +246,7 @@ PUBLIC int drv_io_ctl(int request, void *val, int *len, int sub_dev) { -PUBLIC int drv_get_irq(char *irq) { +int drv_get_irq(char *irq) { Dprint(("drv_get_irq():\n")); *irq = SB_IRQ; return OK; @@ -254,7 +254,7 @@ PUBLIC int drv_get_irq(char *irq) { -PUBLIC int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) { +int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) { Dprint(("drv_get_frag_size():\n")); *frag_size = DspFragmentSize; return OK; @@ -262,7 +262,7 @@ PUBLIC int drv_get_frag_size(u32_t *frag_size, int UNUSED(sub_dev)) { -PRIVATE int dsp_ioctl(int request, void *val, int *len) { +static int dsp_ioctl(int request, void *val, int *len) { int status; switch(request) { @@ -281,7 +281,7 @@ PRIVATE int dsp_ioctl(int request, void *val, int *len) { -PRIVATE void dsp_dma_setup(phys_bytes address, int count, int DmaMode) { +static void dsp_dma_setup(phys_bytes address, int count, int DmaMode) { pvb_pair_t pvb[9]; Dprint(("Setting up %d bit DMA\n", DspBits)); @@ -326,7 +326,7 @@ PRIVATE void dsp_dma_setup(phys_bytes address, int count, int DmaMode) { -PRIVATE int dsp_set_size(unsigned int size) { +static int dsp_set_size(unsigned int size) { Dprint(("dsp_set_size(): set fragment size to %u\n", size)); /* Sanity checks */ @@ -341,7 +341,7 @@ PRIVATE int dsp_set_size(unsigned int size) { -PRIVATE int dsp_set_speed(unsigned int speed) { +static int dsp_set_speed(unsigned int speed) { Dprint(("sb16: setting speed to %u, stereo = %d\n", speed, DspStereo)); if(speed < DSP_MIN_SPEED || speed > DSP_MAX_SPEED) { @@ -369,7 +369,7 @@ PRIVATE int dsp_set_speed(unsigned int speed) { -PRIVATE int dsp_set_stereo(unsigned int stereo) { +static int dsp_set_stereo(unsigned int stereo) { if(stereo) { DspStereo = 1; } else { @@ -381,7 +381,7 @@ PRIVATE int dsp_set_stereo(unsigned int stereo) { -PRIVATE int dsp_set_bits(unsigned int bits) { +static int dsp_set_bits(unsigned int bits) { /* Sanity checks */ if(bits != 8 && bits != 16) { return EINVAL; @@ -394,7 +394,7 @@ PRIVATE int dsp_set_bits(unsigned int bits) { -PRIVATE int dsp_set_sign(unsigned int sign) { +static int dsp_set_sign(unsigned int sign) { Dprint(("sb16: set sign to %u\n", sign)); DspSign = (sign > 0 ? 1 : 0); @@ -404,7 +404,7 @@ PRIVATE int dsp_set_sign(unsigned int sign) { -PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) { +static int dsp_get_max_frag_size(u32_t *val, int *len) { *len = sizeof(*val); *val = sub_dev[AUDIO].DmaSize / sub_dev[AUDIO].NrOfDmaFragments; return OK; @@ -412,7 +412,7 @@ PRIVATE int dsp_get_max_frag_size(u32_t *val, int *len) { -PUBLIC int dsp_command(int value) { +int dsp_command(int value) { int i; for (i = 0; i < SB_TIMEOUT; i++) { @@ -428,7 +428,7 @@ PUBLIC int dsp_command(int value) { -PUBLIC int sb16_inb(int port) { +int sb16_inb(int port) { int s; u32_t value; @@ -440,7 +440,7 @@ PUBLIC int sb16_inb(int port) { -PUBLIC void sb16_outb(int port, int value) { +void sb16_outb(int port, int value) { int s; if ((s=sys_outb(port, value)) != OK) diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index 02f322ab5..98bb69429 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -36,7 +36,7 @@ #define NR_SUBDEVS (MAX_DRIVES * SUB_PER_DRIVE) /* Variables. */ -PRIVATE struct wini { /* main drive struct, one entry per drive */ +static struct wini { /* main drive struct, one entry per drive */ unsigned cylinders; /* number of cylinders */ unsigned heads; /* number of heads */ unsigned sectors; /* number of sectors per track */ @@ -48,27 +48,27 @@ PRIVATE struct wini { /* main drive struct, one entry per drive */ struct device subpart[SUB_PER_DRIVE]; /* subpartitions */ } wini[MAX_DRIVES], *w_wn; -PRIVATE int w_drive; /* selected drive */ -PRIVATE struct device *w_dv; /* device's base and size */ -PRIVATE char *bios_buf_v; -PRIVATE phys_bytes bios_buf_phys; -PRIVATE int remap_first = 0; /* Remap drives for CD HD emulation */ +static int w_drive; /* selected drive */ +static struct device *w_dv; /* device's base and size */ +static char *bios_buf_v; +static phys_bytes bios_buf_phys; +static int remap_first = 0; /* Remap drives for CD HD emulation */ #define BIOSBUF 16384 int main(void); -FORWARD struct device *w_prepare(dev_t device); -FORWARD struct device *w_part(dev_t minor); -FORWARD ssize_t w_transfer(dev_t minor, int do_write, u64_t position, +static struct device *w_prepare(dev_t device); +static struct device *w_part(dev_t minor); +static ssize_t w_transfer(dev_t minor, int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags); -FORWARD int w_do_open(dev_t minor, int access); -FORWARD int w_do_close(dev_t minor); -FORWARD void w_init(void); -FORWARD void w_geometry(dev_t minor, struct partition *entry); -FORWARD int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int w_do_open(dev_t minor, int access); +static int w_do_close(dev_t minor); +static void w_init(void); +static void w_geometry(dev_t minor, struct partition *entry); +static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant); /* Entry points to this driver. */ -PRIVATE struct blockdriver w_dtab = { +static struct blockdriver w_dtab = { BLOCKDRIVER_TYPE_DISK, /* handle partition requests */ w_do_open, /* open or mount request, initialize device */ w_do_close, /* release device */ @@ -84,13 +84,13 @@ PRIVATE struct blockdriver w_dtab = { }; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); /*===========================================================================* * bios_winchester_task * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* SEF local startup. */ sef_local_startup(); @@ -104,7 +104,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -121,7 +121,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the bios_wini driver. */ long v; @@ -139,7 +139,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * w_prepare * *===========================================================================*/ -PRIVATE struct device *w_prepare(dev_t device) +static struct device *w_prepare(dev_t device) { /* Prepare for I/O on a device. */ @@ -163,7 +163,7 @@ PRIVATE struct device *w_prepare(dev_t device) /*===========================================================================* * w_part * *===========================================================================*/ -PRIVATE struct device *w_part(dev_t minor) +static struct device *w_part(dev_t minor) { /* Return a pointer to the partition information of the given minor device. */ @@ -173,7 +173,7 @@ PRIVATE struct device *w_part(dev_t minor) /*===========================================================================* * w_transfer * *===========================================================================*/ -PRIVATE ssize_t w_transfer( +static ssize_t w_transfer( dev_t minor, /* minor device number */ int do_write, /* read or write? */ u64_t pos64, /* offset on device to read or write */ @@ -356,7 +356,7 @@ PRIVATE ssize_t w_transfer( /*============================================================================* * w_do_open * *============================================================================*/ -PRIVATE int w_do_open(dev_t minor, int UNUSED(access)) +static int w_do_open(dev_t minor, int UNUSED(access)) { /* Device open: Initialize the controller and read the partition table. */ @@ -376,7 +376,7 @@ PRIVATE int w_do_open(dev_t minor, int UNUSED(access)) /*============================================================================* * w_do_close * *============================================================================*/ -PRIVATE int w_do_close(dev_t minor) +static int w_do_close(dev_t minor) { /* Device close: Release a device. */ @@ -388,7 +388,7 @@ PRIVATE int w_do_close(dev_t minor) /*===========================================================================* * w_init * *===========================================================================*/ -PRIVATE void w_init(void) +static void w_init(void) { /* This routine is called at startup to initialize the drive parameters. */ @@ -498,7 +498,7 @@ PRIVATE void w_init(void) /*============================================================================* * w_geometry * *============================================================================*/ -PRIVATE void w_geometry(dev_t minor, struct partition *entry) +static void w_geometry(dev_t minor, struct partition *entry) { if (w_prepare(minor) == NULL) return; @@ -510,7 +510,7 @@ PRIVATE void w_geometry(dev_t minor, struct partition *entry) /*============================================================================* * w_ioctl * *============================================================================*/ -PRIVATE int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { int count; diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index 048d27598..665752fd3 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -26,28 +26,28 @@ #include "dec21140A.h" -PRIVATE u32_t io_inl(u16_t); -PRIVATE void io_outl(u16_t, u32_t); -PRIVATE void do_conf(const message *); -PRIVATE void do_get_stat_s(message *); -PRIVATE void do_interrupt(const dpeth_t *); -PRIVATE void do_reply(dpeth_t *); -PRIVATE void do_vread_s(const message *, int); -PRIVATE void do_watchdog(void *); - -PRIVATE void de_update_conf(dpeth_t *); -PRIVATE int de_probe(dpeth_t *, int skip); -PRIVATE void de_conf_addr(dpeth_t *); -PRIVATE void de_first_init(dpeth_t *); -PRIVATE void de_reset(const dpeth_t *); -PRIVATE void de_hw_conf(const dpeth_t *); -PRIVATE void de_start(const dpeth_t *); -PRIVATE void de_setup_frame(const dpeth_t *); -PRIVATE u16_t de_read_rom(const dpeth_t *, u8_t, u8_t); -PRIVATE int de_calc_iov_size(iovec_dat_s_t *); -PRIVATE void de_next_iov(iovec_dat_s_t *); -PRIVATE void do_vwrite_s(const message *, int); -PRIVATE void de_get_userdata_s(int, cp_grant_id_t, vir_bytes, int, void +static u32_t io_inl(u16_t); +static void io_outl(u16_t, u32_t); +static void do_conf(const message *); +static void do_get_stat_s(message *); +static void do_interrupt(const dpeth_t *); +static void do_reply(dpeth_t *); +static void do_vread_s(const message *, int); +static void do_watchdog(void *); + +static void de_update_conf(dpeth_t *); +static int de_probe(dpeth_t *, int skip); +static void de_conf_addr(dpeth_t *); +static void de_first_init(dpeth_t *); +static void de_reset(const dpeth_t *); +static void de_hw_conf(const dpeth_t *); +static void de_start(const dpeth_t *); +static void de_setup_frame(const dpeth_t *); +static u16_t de_read_rom(const dpeth_t *, u8_t, u8_t); +static int de_calc_iov_size(iovec_dat_s_t *); +static void de_next_iov(iovec_dat_s_t *); +static void do_vwrite_s(const message *, int); +static void de_get_userdata_s(int, cp_grant_id_t, vir_bytes, int, void *); /* Error messages */ @@ -60,12 +60,12 @@ static char str_StatErrMsg[] = "Unable to send stats"; static char str_AlignErrMsg[] = "Bad align of buffer/descriptor"; static char str_DevName[] = "dec21140A:eth#?"; -PRIVATE dpeth_t de_state; -PRIVATE int de_instance; +static dpeth_t de_state; +static int de_instance; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); /*===========================================================================* * main * @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -147,7 +147,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the DEC 21140A driver. */ int fkeys, sfkeys; @@ -169,7 +169,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) return OK; } -PRIVATE void do_get_stat_s(message * mp) +static void do_get_stat_s(message * mp) { int rc; dpeth_t *dep; @@ -188,7 +188,7 @@ PRIVATE void do_get_stat_s(message * mp) return; } -PRIVATE void do_conf(const message * mp) +static void do_conf(const message * mp) { int r; dpeth_t *dep; @@ -257,7 +257,7 @@ PRIVATE void do_conf(const message * mp) return; } -PRIVATE void do_reply(dpeth_t * dep) +static void do_reply(dpeth_t * dep) { message reply; int r, flags = DL_NOFLAGS; @@ -279,13 +279,13 @@ PRIVATE void do_reply(dpeth_t * dep) return; } -PRIVATE void do_watchdog(void *UNUSED(message)) +static void do_watchdog(void *UNUSED(message)) { /* nothing here yet */ return; } -PRIVATE int de_probe(dpeth_t *dep, int skip) +static int de_probe(dpeth_t *dep, int skip) { int i, r, devind; u16_t vid, did, temp16; @@ -345,7 +345,7 @@ PRIVATE int de_probe(dpeth_t *dep, int skip) return TRUE; } -PRIVATE u16_t de_read_rom(const dpeth_t *dep, u8_t addr, u8_t nbAddrBits){ +static u16_t de_read_rom(const dpeth_t *dep, u8_t addr, u8_t nbAddrBits){ u16_t retVal = 0; int i; u32_t csr = 0; @@ -421,7 +421,7 @@ static void de_update_conf(dpeth_t * dep) return; } -PRIVATE void do_vread_s(const message * mp, int from_int) +static void do_vread_s(const message * mp, int from_int) { u8_t *buffer; u32_t size; @@ -552,7 +552,7 @@ PRIVATE void do_vread_s(const message * mp, int from_int) return; } -PRIVATE void de_conf_addr(dpeth_t * dep) +static void de_conf_addr(dpeth_t * dep) { static char ea_fmt[] = "x:x:x:x:x:x"; char ea_key[16]; @@ -574,7 +574,7 @@ PRIVATE void de_conf_addr(dpeth_t * dep) return; } -PRIVATE void de_first_init(dpeth_t *dep) +static void de_first_init(dpeth_t *dep) { int i,j,r; vir_bytes descr_vir = (vir_bytes)dep->sendrecv_descr_buf; @@ -666,7 +666,7 @@ PRIVATE void de_first_init(dpeth_t *dep) sys_irqenable(&dep->de_hook); } -PRIVATE void do_interrupt(const dpeth_t *dep){ +static void do_interrupt(const dpeth_t *dep){ u32_t val; val = io_inl(CSR_ADDR(dep, CSR5)); @@ -687,11 +687,11 @@ PRIVATE void do_interrupt(const dpeth_t *dep){ return; } -PRIVATE void de_reset(const dpeth_t *dep){ +static void de_reset(const dpeth_t *dep){ io_outl(CSR_ADDR(dep, CSR0), CSR0_SWR); } -PRIVATE void de_hw_conf(const dpeth_t *dep){ +static void de_hw_conf(const dpeth_t *dep){ u32_t val; /* CSR0 - global host bus prop */ @@ -716,13 +716,13 @@ PRIVATE void de_hw_conf(const dpeth_t *dep){ io_outl(CSR_ADDR(dep, CSR6), val); } -PRIVATE void de_start(const dpeth_t *dep){ +static void de_start(const dpeth_t *dep){ u32_t val; val = io_inl(CSR_ADDR(dep, CSR6)) | CSR6_ST | CSR6_SR; io_outl(CSR_ADDR(dep, CSR6), val); } -PRIVATE void de_setup_frame(const dpeth_t *dep){ +static void de_setup_frame(const dpeth_t *dep){ int i; u32_t val; @@ -756,7 +756,7 @@ PRIVATE void de_setup_frame(const dpeth_t *dep){ return; } -PRIVATE int de_calc_iov_size(iovec_dat_s_t * iovp){ +static int de_calc_iov_size(iovec_dat_s_t * iovp){ int size, ix; size = ix = 0; @@ -770,7 +770,7 @@ PRIVATE int de_calc_iov_size(iovec_dat_s_t * iovp){ return size; } -PRIVATE void de_get_userdata_s(int user_proc, cp_grant_id_t grant, +static void de_get_userdata_s(int user_proc, cp_grant_id_t grant, vir_bytes offset, int count, void *loc_addr){ int rc; vir_bytes len; @@ -782,7 +782,7 @@ PRIVATE void de_get_userdata_s(int user_proc, cp_grant_id_t grant, return; } -PRIVATE void de_next_iov(iovec_dat_s_t * iovp){ +static void de_next_iov(iovec_dat_s_t * iovp){ iovp->iod_iovec_s -= IOVEC_NR; iovp->iod_iovec_offset += IOVEC_NR * sizeof(iovec_t); @@ -791,7 +791,7 @@ PRIVATE void de_next_iov(iovec_dat_s_t * iovp){ return; } -PRIVATE void do_vwrite_s(const message * mp, int from_int){ +static void do_vwrite_s(const message * mp, int from_int){ static u8_t setupDone = 0; int size, r, bytes, ix, totalsize; dpeth_t *dep; @@ -881,19 +881,19 @@ PRIVATE void do_vwrite_s(const message * mp, int from_int){ do_reply(dep); } -PRIVATE void warning(const char *type, int err){ +static void warning(const char *type, int err){ printf("Warning: %s sys_%s failed (%d)\n", str_DevName, type, err); return; } -PRIVATE u32_t io_inl(u16_t port){ +static u32_t io_inl(u16_t port){ u32_t value; int rc; if ((rc = sys_inl(port, &value)) != OK) warning("inl", rc); return value; } -PRIVATE void io_outl(u16_t port, u32_t value){ +static void io_outl(u16_t port, u32_t value){ int rc; if ((rc = sys_outl(port, value)) != OK) warning("outl", rc); return; diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 1ac821672..80c971bce 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -44,7 +44,7 @@ typedef struct dp_conf } dp_conf_t; #define DP_CONF_NR 4 -PRIVATE dp_conf_t dp_conf[DP_CONF_NR]= /* Card addresses */ +static dp_conf_t dp_conf[DP_CONF_NR]= /* Card addresses */ { /* I/O port, IRQ, Buffer address. */ { 0x280, 3, 0xD0000, }, @@ -124,11 +124,11 @@ static void do_vir_insw(port_t port, int proc, vir_bytes buf, size_t size); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); -PRIVATE void handle_hw_intr(void) +static void handle_hw_intr(void) { int r, irq; dpeth_t *dep; @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -223,7 +223,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the dp8390 driver. */ dpeth_t *dep; @@ -253,7 +253,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; diff --git a/drivers/dp8390/ne2000.c b/drivers/dp8390/ne2000.c index 55e1effa8..f6d47d4c8 100644 --- a/drivers/dp8390/ne2000.c +++ b/drivers/dp8390/ne2000.c @@ -29,10 +29,10 @@ extern u32_t system_hz; typedef int(*testf_t) (dpeth_t *dep, int pos, u8_t *pat); -PRIVATE u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 }; -PRIVATE u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF }; -PRIVATE u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 }; -PRIVATE u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 }; +static u8_t pat0[]= { 0x00, 0x00, 0x00, 0x00 }; +static u8_t pat1[]= { 0xFF, 0xFF, 0xFF, 0xFF }; +static u8_t pat2[]= { 0xA5, 0x5A, 0x69, 0x96 }; +static u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 }; static int test_8(dpeth_t *dep, int pos, u8_t *pat); static int test_16(dpeth_t *dep, int pos, u8_t *pat); diff --git a/drivers/dp8390/rtl8029.c b/drivers/dp8390/rtl8029.c index ca3be8c80..f69453da9 100644 --- a/drivers/dp8390/rtl8029.c +++ b/drivers/dp8390/rtl8029.c @@ -30,7 +30,7 @@ static void set_ee_word(dpeth_t *dep, int a, u16_t w); static void ee_wds(dpeth_t *dep); #endif -PUBLIC int rtl_probe(dep, skip) +int rtl_probe(dep, skip) struct dpeth *dep; int skip; { diff --git a/drivers/dpeth/3c501.c b/drivers/dpeth/3c501.c index 51929e889..429ea5844 100644 --- a/drivers/dpeth/3c501.c +++ b/drivers/dpeth/3c501.c @@ -384,7 +384,7 @@ static void el1_init(dpeth_t * dep) ** Name: int el1_probe(dpeth_t *dep) ** Function: Checks for presence of the board. */ -PUBLIC int el1_probe(dpeth_t * dep) +int el1_probe(dpeth_t * dep) { int ix; diff --git a/drivers/dpeth/3c509.c b/drivers/dpeth/3c509.c index 48ec36a7a..c7739b2ba 100644 --- a/drivers/dpeth/3c509.c +++ b/drivers/dpeth/3c509.c @@ -555,7 +555,7 @@ static void el3_write_id(port_t port) ** Name: int el3_probe(dpeth_t *dep) ** Function: Checks for presence of the board. */ -PUBLIC int el3_probe(dpeth_t * dep) +int el3_probe(dpeth_t * dep) { port_t id_port; diff --git a/drivers/dpeth/devio.c b/drivers/dpeth/devio.c index 5aeb1e45f..ba8a545c2 100644 --- a/drivers/dpeth/devio.c +++ b/drivers/dpeth/devio.c @@ -25,7 +25,7 @@ static void warning(const char *type, int err) ** Name: unsigned int inb(unsigned short int port); ** Function: Reads a byte from specified i/o port. */ -PUBLIC unsigned int inb(unsigned short port) +unsigned int inb(unsigned short port) { u32_t value; int rc; @@ -38,7 +38,7 @@ PUBLIC unsigned int inb(unsigned short port) ** Name: unsigned int inw(unsigned short int port); ** Function: Reads a word from specified i/o port. */ -PUBLIC unsigned int inw(unsigned short port) +unsigned int inw(unsigned short port) { u32_t value; int rc; @@ -51,7 +51,7 @@ PUBLIC unsigned int inw(unsigned short port) ** Name: unsigned int insb(unsigned short int port, int proc_nr, void *buffer, int count); ** Function: Reads a sequence of bytes from specified i/o port to user space buffer. */ -PUBLIC void insb(unsigned short int port, endpoint_t proc_nr, +void insb(unsigned short int port, endpoint_t proc_nr, void *buffer, int count) { int rc; @@ -66,7 +66,7 @@ PUBLIC void insb(unsigned short int port, endpoint_t proc_nr, ** Name: void outb(unsigned short int port, unsigned long value); ** Function: Writes a byte to specified i/o port. */ -PUBLIC void outb(unsigned short port, unsigned long value) +void outb(unsigned short port, unsigned long value) { int rc; @@ -78,7 +78,7 @@ PUBLIC void outb(unsigned short port, unsigned long value) ** Name: void outw(unsigned short int port, unsigned long value); ** Function: Writes a word to specified i/o port. */ -PUBLIC void outw(unsigned short port, unsigned long value) +void outw(unsigned short port, unsigned long value) { int rc; @@ -90,7 +90,7 @@ PUBLIC void outw(unsigned short port, unsigned long value) ** Name: void outsb(unsigned short int port, int proc_nr, void *buffer, int count); ** Function: Writes a sequence of bytes from user space to specified i/o port. */ -PUBLIC void outsb(unsigned short port, endpoint_t proc_nr, void *buffer, int count) +void outsb(unsigned short port, endpoint_t proc_nr, void *buffer, int count) { int rc; diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index 9e918160e..1e17d7233 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -312,7 +312,7 @@ static void do_init(const message * mp) ** Name: void dp_next_iovec(iovec_dat_t *iovp) ** Function: Retrieves data from next iovec element. */ -PUBLIC void dp_next_iovec(iovec_dat_s_t * iovp) +void dp_next_iovec(iovec_dat_s_t * iovp) { iovp->iod_iovec_s -= IOVEC_NR; @@ -470,7 +470,7 @@ static void do_watchdog(const void *UNUSED(message)) return; } -PRIVATE void handle_hw_intr(void) +static void handle_hw_intr(void) { dpeth_t *dep; @@ -488,15 +488,15 @@ PRIVATE void handle_hw_intr(void) } /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /* ** Name: int dpeth_task(void) ** Function: Main entry for dp task */ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { message m; int ipc_status; @@ -560,7 +560,7 @@ PUBLIC int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -581,7 +581,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the dpeth driver. */ int fkeys, sfkeys; @@ -605,7 +605,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; diff --git a/drivers/dpeth/ne.c b/drivers/dpeth/ne.c index afa05b519..ea6cbe6b1 100644 --- a/drivers/dpeth/ne.c +++ b/drivers/dpeth/ne.c @@ -101,7 +101,7 @@ static void ne_init(dpeth_t * dep) ** Note that the NE1000 is an 8bit card and has a memory ** region distict from the 16bit NE2000. */ -PUBLIC int ne_probe(dpeth_t * dep) +int ne_probe(dpeth_t * dep) { int ix, wd, loc1, loc2; char EPROM[32]; diff --git a/drivers/dpeth/netbuff.c b/drivers/dpeth/netbuff.c index c12ec4e17..92d67f1be 100644 --- a/drivers/dpeth/netbuff.c +++ b/drivers/dpeth/netbuff.c @@ -21,7 +21,7 @@ static char tx_rx_buff[8192]; ** Name: void *alloc_buff(dpeth_t *dep, int size) ** Function: Allocates a buffer from the common pool. */ -PUBLIC void *alloc_buff(dpeth_t *dep, int size) +void *alloc_buff(dpeth_t *dep, int size) { m_hdr_t *ptr, *wrk = allocptr; int units = ((size + sizeof(m_hdr_t) - 1) / sizeof(m_hdr_t)) + 1; @@ -52,7 +52,7 @@ PUBLIC void *alloc_buff(dpeth_t *dep, int size) ** Name: void free_buff(dpeth_t *dep, void *blk) ** Function: Returns a buffer to the common pool. */ -PUBLIC void free_buff(dpeth_t *dep, void *blk) +void free_buff(dpeth_t *dep, void *blk) { m_hdr_t *wrk, *ptr = (m_hdr_t *) blk - 1; @@ -80,7 +80,7 @@ PUBLIC void free_buff(dpeth_t *dep, void *blk) ** Name: void init_buff(dpeth_t *dep, buff_t **tx_buff) ** Function: Initalizes driver data structures. */ -PUBLIC void init_buff(dpeth_t *dep, buff_t **tx_buff) +void init_buff(dpeth_t *dep, buff_t **tx_buff) { /* Initializes buffer pool */ @@ -105,7 +105,7 @@ PUBLIC void init_buff(dpeth_t *dep, buff_t **tx_buff) ** Name: void mem2user(dpeth_t *dep, buff_t *rxbuff); ** Function: Copies a packet from local buffer to user area. */ -PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff) +void mem2user(dpeth_t *dep, buff_t *rxbuff) { int bytes, ix = 0; iovec_dat_s_t *iovp = &dep->de_read_iovec; @@ -137,7 +137,7 @@ PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff) ** Name: void user2mem(dpeth_t *dep, buff_t *txbuff) ** Function: Copies a packet from user area to local buffer. */ -PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff) +void user2mem(dpeth_t *dep, buff_t *txbuff) { int bytes, ix = 0; iovec_dat_s_t *iovp = &dep->de_write_iovec; diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 0608c9cef..2220840bb 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -21,37 +21,37 @@ #include "e1000_reg.h" #include "e1000_pci.h" -PRIVATE int e1000_instance; -PRIVATE e1000_t e1000_state; - -PRIVATE void e1000_init(message *mp); -PRIVATE void e1000_init_pci(void); -PRIVATE int e1000_probe(e1000_t *e, int skip); -PRIVATE int e1000_init_hw(e1000_t *e); -PRIVATE void e1000_init_addr(e1000_t *e); -PRIVATE void e1000_init_buf(e1000_t *e); -PRIVATE void e1000_reset_hw(e1000_t *e); -PRIVATE void e1000_writev_s(message *mp, int from_int); -PRIVATE void e1000_readv_s(message *mp, int from_int); -PRIVATE void e1000_getstat_s(message *mp); -PRIVATE void e1000_interrupt(message *mp); -PRIVATE int e1000_link_changed(e1000_t *e); -PRIVATE void e1000_stop(e1000_t *e); -PRIVATE uint32_t e1000_reg_read(e1000_t *e, uint32_t reg); -PRIVATE void e1000_reg_write(e1000_t *e, uint32_t reg, uint32_t value); -PRIVATE void e1000_reg_set(e1000_t *e, uint32_t reg, uint32_t value); -PRIVATE void e1000_reg_unset(e1000_t *e, uint32_t reg, uint32_t value); -PRIVATE u16_t eeprom_eerd(void *e, int reg); -PRIVATE u16_t eeprom_ich(void *e, int reg); -PRIVATE int eeprom_ich_init(e1000_t *e); -PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout); -PRIVATE void reply(e1000_t *e); -PRIVATE void mess_reply(message *req, message *reply); +static int e1000_instance; +static e1000_t e1000_state; + +static void e1000_init(message *mp); +static void e1000_init_pci(void); +static int e1000_probe(e1000_t *e, int skip); +static int e1000_init_hw(e1000_t *e); +static void e1000_init_addr(e1000_t *e); +static void e1000_init_buf(e1000_t *e); +static void e1000_reset_hw(e1000_t *e); +static void e1000_writev_s(message *mp, int from_int); +static void e1000_readv_s(message *mp, int from_int); +static void e1000_getstat_s(message *mp); +static void e1000_interrupt(message *mp); +static int e1000_link_changed(e1000_t *e); +static void e1000_stop(e1000_t *e); +static uint32_t e1000_reg_read(e1000_t *e, uint32_t reg); +static void e1000_reg_write(e1000_t *e, uint32_t reg, uint32_t value); +static void e1000_reg_set(e1000_t *e, uint32_t reg, uint32_t value); +static void e1000_reg_unset(e1000_t *e, uint32_t reg, uint32_t value); +static u16_t eeprom_eerd(void *e, int reg); +static u16_t eeprom_ich(void *e, int reg); +static int eeprom_ich_init(e1000_t *e); +static int eeprom_ich_cycle(const e1000_t *e, u32_t timeout); +static void reply(e1000_t *e); +static void mess_reply(message *req, message *reply); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -125,7 +125,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the e1000 driver. */ long v; @@ -153,7 +153,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { e1000_t *e; e = &e1000_state; @@ -169,7 +169,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * e1000_init * *===========================================================================*/ -PRIVATE void e1000_init(message *mp) +static void e1000_init(message *mp) { static int first_time = 1; message reply_mess; @@ -203,7 +203,7 @@ PRIVATE void e1000_init(message *mp) /*===========================================================================* * e1000_int_pci * *===========================================================================*/ -PRIVATE void e1000_init_pci() +static void e1000_init_pci() { e1000_t *e; @@ -220,7 +220,7 @@ PRIVATE void e1000_init_pci() /*===========================================================================* * e1000_probe * *===========================================================================*/ -PRIVATE int e1000_probe(e1000_t *e, int skip) +static int e1000_probe(e1000_t *e, int skip) { int r, devind, ioflag; u16_t vid, did, cr; @@ -359,7 +359,7 @@ PRIVATE int e1000_probe(e1000_t *e, int skip) /*===========================================================================* * e1000_init_hw * *===========================================================================*/ -PRIVATE int e1000_init_hw(e) +static int e1000_init_hw(e) e1000_t *e; { int r, i; @@ -424,7 +424,7 @@ e1000_t *e; /*===========================================================================* * e1000_init_addr * *===========================================================================*/ -PRIVATE void e1000_init_addr(e) +static void e1000_init_addr(e) e1000_t *e; { static char eakey[]= E1000_ENVVAR "#_EA"; @@ -474,7 +474,7 @@ e1000_t *e; /*===========================================================================* * e1000_init_buf * *===========================================================================*/ -PRIVATE void e1000_init_buf(e) +static void e1000_init_buf(e) e1000_t *e; { phys_bytes rx_desc_p, rx_buff_p; @@ -570,7 +570,7 @@ e1000_t *e; /*===========================================================================* * e1000_reset_hw * *===========================================================================*/ -PRIVATE void e1000_reset_hw(e) +static void e1000_reset_hw(e) e1000_t *e; { /* Assert a Device Reset signal. */ @@ -583,7 +583,7 @@ e1000_t *e; /*===========================================================================* * e1000_writev_s * *===========================================================================*/ -PRIVATE void e1000_writev_s(mp, from_int) +static void e1000_writev_s(mp, from_int) message *mp; int from_int; { @@ -676,7 +676,7 @@ int from_int; /*===========================================================================* * e1000_readv_s * *===========================================================================*/ -PRIVATE void e1000_readv_s(mp, from_int) +static void e1000_readv_s(mp, from_int) message *mp; int from_int; { @@ -765,7 +765,7 @@ int from_int; /*===========================================================================* * e1000_getstat_s * *===========================================================================*/ -PRIVATE void e1000_getstat_s(mp) +static void e1000_getstat_s(mp) message *mp; { int r; @@ -800,7 +800,7 @@ message *mp; /*===========================================================================* * e1000_interrupt * *===========================================================================*/ -PRIVATE void e1000_interrupt(mp) +static void e1000_interrupt(mp) message *mp; { e1000_t *e; @@ -837,7 +837,7 @@ message *mp; /*===========================================================================* * e1000_link_changed * *===========================================================================*/ -PRIVATE int e1000_link_changed(e) +static int e1000_link_changed(e) e1000_t *e; { E1000_DEBUG(4, ("%s: link_changed()\n", e->name)); @@ -847,7 +847,7 @@ e1000_t *e; /*===========================================================================* * e1000_stop * *===========================================================================*/ -PRIVATE void e1000_stop(e) +static void e1000_stop(e) e1000_t *e; { E1000_DEBUG(3, ("%s: stop()\n", e->name)); @@ -860,7 +860,7 @@ e1000_t *e; /*===========================================================================* * e1000_reg_read * *===========================================================================*/ -PRIVATE uint32_t e1000_reg_read(e, reg) +static uint32_t e1000_reg_read(e, reg) e1000_t *e; uint32_t reg; { @@ -879,7 +879,7 @@ uint32_t reg; /*===========================================================================* * e1000_reg_write * *===========================================================================*/ -PRIVATE void e1000_reg_write(e, reg, value) +static void e1000_reg_write(e, reg, value) e1000_t *e; uint32_t reg; uint32_t value; @@ -894,7 +894,7 @@ uint32_t value; /*===========================================================================* * e1000_reg_set * *===========================================================================*/ -PRIVATE void e1000_reg_set(e, reg, value) +static void e1000_reg_set(e, reg, value) e1000_t *e; uint32_t reg; uint32_t value; @@ -911,7 +911,7 @@ uint32_t value; /*===========================================================================* * e1000_reg_unset * *===========================================================================*/ -PRIVATE void e1000_reg_unset(e, reg, value) +static void e1000_reg_unset(e, reg, value) e1000_t *e; uint32_t reg; uint32_t value; @@ -929,7 +929,7 @@ uint32_t value; /*===========================================================================* * eeprom_eerd * *===========================================================================*/ -PRIVATE u16_t eeprom_eerd(v, reg) +static u16_t eeprom_eerd(v, reg) void *v; int reg; { @@ -949,7 +949,7 @@ int reg; /*===========================================================================* * eeprom_ich_init * *===========================================================================*/ -PRIVATE int eeprom_ich_init(e) +static int eeprom_ich_init(e) e1000_t *e; { union ich8_hws_flash_status hsfsts; @@ -1029,7 +1029,7 @@ out: /*===========================================================================* * eeprom_ich_cycle * *===========================================================================*/ -PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout) +static int eeprom_ich_cycle(const e1000_t *e, u32_t timeout) { union ich8_hws_flash_ctrl hsflctl; union ich8_hws_flash_status hsfsts; @@ -1062,7 +1062,7 @@ PRIVATE int eeprom_ich_cycle(const e1000_t *e, u32_t timeout) /*===========================================================================* * eeprom_ich * *===========================================================================*/ -PRIVATE u16_t eeprom_ich(v, reg) +static u16_t eeprom_ich(v, reg) void *v; int reg; { @@ -1144,7 +1144,7 @@ out: /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply(e) +static void reply(e) e1000_t *e; { message msg; @@ -1192,7 +1192,7 @@ e1000_t *e; /*===========================================================================* * mess_reply * *===========================================================================*/ -PRIVATE void mess_reply(req, reply_mess) +static void mess_reply(req, reply_mess) message *req; message *reply_mess; { diff --git a/drivers/fbd/action.c b/drivers/fbd/action.c index 9ed6d921a..dd7d93c1c 100644 --- a/drivers/fbd/action.c +++ b/drivers/fbd/action.c @@ -7,7 +7,7 @@ /*===========================================================================* * get_rand * *===========================================================================*/ -PRIVATE u32_t get_rand(u32_t max) +static u32_t get_rand(u32_t max) { /* Las Vegas algorithm for getting a random number in the range from * 0 to max, inclusive. @@ -35,7 +35,7 @@ PRIVATE u32_t get_rand(u32_t max) /*===========================================================================* * get_range * *===========================================================================*/ -PRIVATE size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size, +static size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size, u64_t *skip) { /* Compute the range within the given request range that is affected @@ -82,7 +82,7 @@ PRIVATE size_t get_range(struct fbd_rule *rule, u64_t pos, size_t *size, /*===========================================================================* * limit_range * *===========================================================================*/ -PRIVATE void limit_range(iovec_t *iov, unsigned *count, size_t size) +static void limit_range(iovec_t *iov, unsigned *count, size_t size) { /* Limit the given vector to the given size. */ @@ -104,7 +104,7 @@ PRIVATE void limit_range(iovec_t *iov, unsigned *count, size_t size) /*===========================================================================* * action_io_corrupt * *===========================================================================*/ -PRIVATE void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size, +static void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size, u64_t pos, int UNUSED(flag)) { u64_t skip; @@ -151,7 +151,7 @@ PRIVATE void action_io_corrupt(struct fbd_rule *rule, char *buf, size_t size, /*===========================================================================* * action_pre_error * *===========================================================================*/ -PRIVATE void action_pre_error(struct fbd_rule *rule, iovec_t *iov, +static void action_pre_error(struct fbd_rule *rule, iovec_t *iov, unsigned *count, size_t *size, u64_t *pos) { /* Limit the request to the part that precedes the matched range. */ @@ -163,7 +163,7 @@ PRIVATE void action_pre_error(struct fbd_rule *rule, iovec_t *iov, /*===========================================================================* * action_post_error * *===========================================================================*/ -PRIVATE void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize), +static void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize), int *result) { /* Upon success of the first part, return the specified error code. */ @@ -174,7 +174,7 @@ PRIVATE void action_post_error(struct fbd_rule *rule, size_t UNUSED(osize), /*===========================================================================* * action_pre_misdir * *===========================================================================*/ -PRIVATE void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov), +static void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov), unsigned *UNUSED(count), size_t *UNUSED(size), u64_t *pos) { /* Randomize the request position to fall within the range (and have @@ -201,7 +201,7 @@ PRIVATE void action_pre_misdir(struct fbd_rule *rule, iovec_t *UNUSED(iov), /*===========================================================================* * action_pre_losttorn * *===========================================================================*/ -PRIVATE void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov, +static void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov, unsigned *count, size_t *size, u64_t *UNUSED(pos)) { if (*size > rule->params.losttorn.lead) @@ -213,7 +213,7 @@ PRIVATE void action_pre_losttorn(struct fbd_rule *rule, iovec_t *iov, /*===========================================================================* * action_post_losttorn * *===========================================================================*/ -PRIVATE void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize, +static void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize, int *result) { /* On success, pretend full completion. */ @@ -226,7 +226,7 @@ PRIVATE void action_post_losttorn(struct fbd_rule *UNUSED(rule), size_t osize, /*===========================================================================* * action_mask * *===========================================================================*/ -PUBLIC int action_mask(struct fbd_rule *rule) +int action_mask(struct fbd_rule *rule) { /* Return the hook mask for the given rule's action type. */ @@ -244,7 +244,7 @@ PUBLIC int action_mask(struct fbd_rule *rule) /*===========================================================================* * action_pre_hook * *===========================================================================*/ -PUBLIC void action_pre_hook(struct fbd_rule *rule, iovec_t *iov, +void action_pre_hook(struct fbd_rule *rule, iovec_t *iov, unsigned *count, size_t *size, u64_t *pos) { switch (rule->action) { @@ -268,7 +268,7 @@ PUBLIC void action_pre_hook(struct fbd_rule *rule, iovec_t *iov, /*===========================================================================* * action_io_hook * *===========================================================================*/ -PUBLIC void action_io_hook(struct fbd_rule *rule, char *buf, size_t size, +void action_io_hook(struct fbd_rule *rule, char *buf, size_t size, u64_t pos, int flag) { switch (rule->action) { @@ -284,7 +284,7 @@ PUBLIC void action_io_hook(struct fbd_rule *rule, char *buf, size_t size, /*===========================================================================* * action_post_hook * *===========================================================================*/ -PUBLIC void action_post_hook(struct fbd_rule *rule, size_t osize, int *result) +void action_post_hook(struct fbd_rule *rule, size_t osize, int *result) { switch (rule->action) { case FBD_ACTION_ERROR: diff --git a/drivers/fbd/fbd.c b/drivers/fbd/fbd.c index 075048ca7..3cb7cf765 100644 --- a/drivers/fbd/fbd.c +++ b/drivers/fbd/fbd.c @@ -15,22 +15,22 @@ #define BUF_SIZE (NR_IOREQS * CLICK_SIZE) /* 256k */ /* Function declarations. */ -PRIVATE int fbd_open(dev_t minor, int access); -PRIVATE int fbd_close(dev_t minor); -PRIVATE int fbd_transfer(dev_t minor, int do_write, u64_t position, +static int fbd_open(dev_t minor, int access); +static int fbd_close(dev_t minor); +static int fbd_transfer(dev_t minor, int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags); -PRIVATE int fbd_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int fbd_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant); /* Variables. */ -PRIVATE char *fbd_buf; /* scratch buffer */ +static char *fbd_buf; /* scratch buffer */ -PRIVATE char driver_label[32] = ""; /* driver DS label */ -PRIVATE dev_t driver_minor = -1; /* driver's partition minor to use */ -PRIVATE endpoint_t driver_endpt; /* driver endpoint */ +static char driver_label[32] = ""; /* driver DS label */ +static dev_t driver_minor = -1; /* driver's partition minor to use */ +static endpoint_t driver_endpt; /* driver endpoint */ /* Entry points to this driver. */ -PRIVATE struct blockdriver fbd_dtab = { +static struct blockdriver fbd_dtab = { BLOCKDRIVER_TYPE_OTHER, /* do not handle partition requests */ fbd_open, /* open or mount request, initialize device */ fbd_close, /* release device */ @@ -46,7 +46,7 @@ PRIVATE struct blockdriver fbd_dtab = { }; /* Options supported by this driver. */ -PRIVATE struct optset optset_table[] = { +static struct optset optset_table[] = { { "label", OPT_STRING, driver_label, sizeof(driver_label) }, { "minor", OPT_INT, &driver_minor, 10 }, { NULL, 0, NULL, 0 } @@ -55,7 +55,7 @@ PRIVATE struct optset optset_table[] = { /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { clock_t uptime; int r; @@ -97,7 +97,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Terminate immediately upon receiving a SIGTERM. */ if (signo != SIGTERM) return; @@ -115,7 +115,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -132,7 +132,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* SEF local startup. */ env_setargs(argc, argv); @@ -147,7 +147,7 @@ PUBLIC int main(int argc, char **argv) /*===========================================================================* * fbd_open * *===========================================================================*/ -PRIVATE int fbd_open(dev_t UNUSED(minor), int access) +static int fbd_open(dev_t UNUSED(minor), int access) { /* Open a device. */ message m; @@ -172,7 +172,7 @@ PRIVATE int fbd_open(dev_t UNUSED(minor), int access) /*===========================================================================* * fbd_close * *===========================================================================*/ -PRIVATE int fbd_close(dev_t UNUSED(minor)) +static int fbd_close(dev_t UNUSED(minor)) { /* Close a device. */ message m; @@ -196,7 +196,7 @@ PRIVATE int fbd_close(dev_t UNUSED(minor)) /*===========================================================================* * fbd_ioctl * *===========================================================================*/ -PRIVATE int fbd_ioctl(dev_t UNUSED(minor), unsigned int request, +static int fbd_ioctl(dev_t UNUSED(minor), unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { /* Handle an I/O control request. */ @@ -238,7 +238,7 @@ PRIVATE int fbd_ioctl(dev_t UNUSED(minor), unsigned int request, /*===========================================================================* * fbd_transfer_direct * *===========================================================================*/ -PRIVATE ssize_t fbd_transfer_direct(int do_write, u64_t position, +static ssize_t fbd_transfer_direct(int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int count, int flags) { /* Forward the entire transfer request, without any intervention. */ @@ -284,7 +284,7 @@ PRIVATE ssize_t fbd_transfer_direct(int do_write, u64_t position, /*===========================================================================* * fbd_transfer_copy * *===========================================================================*/ -PRIVATE ssize_t fbd_transfer_copy(int do_write, u64_t position, +static ssize_t fbd_transfer_copy(int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int count, size_t size, int flags) { @@ -406,7 +406,7 @@ PRIVATE ssize_t fbd_transfer_copy(int do_write, u64_t position, /*===========================================================================* * fbd_transfer * *===========================================================================*/ -PRIVATE int fbd_transfer(dev_t UNUSED(minor), int do_write, u64_t position, +static int fbd_transfer(dev_t UNUSED(minor), int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags) { /* Transfer data from or to the device. */ diff --git a/drivers/fbd/rule.c b/drivers/fbd/rule.c index 272bd63df..10a174dcc 100644 --- a/drivers/fbd/rule.c +++ b/drivers/fbd/rule.c @@ -5,14 +5,14 @@ #include "action.h" #include "rule.h" -PRIVATE struct fbd_rule rules[MAX_RULES]; -PRIVATE struct fbd_rule *matches[MAX_RULES]; -PRIVATE int nr_matches; +static struct fbd_rule rules[MAX_RULES]; +static struct fbd_rule *matches[MAX_RULES]; +static int nr_matches; /*===========================================================================* * rule_ctl * *===========================================================================*/ -PUBLIC int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) +int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) { /* Handle an I/O control request regarding rules. */ fbd_rulenum_t i; @@ -86,7 +86,7 @@ PUBLIC int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) /*===========================================================================* * rule_match * *===========================================================================*/ -PRIVATE int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag) +static int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag) { /* Check whether the given rule matches the given parameters. As side * effect, update counters in the rule as appropriate. @@ -113,7 +113,7 @@ PRIVATE int rule_match(struct fbd_rule *rule, u64_t pos, size_t size, int flag) /*===========================================================================* * rule_find * *===========================================================================*/ -PUBLIC int rule_find(u64_t pos, size_t size, int flag) +int rule_find(u64_t pos, size_t size, int flag) { /* Find all matching rules, and return a hook mask. */ struct fbd_rule *rule; @@ -150,7 +150,7 @@ PUBLIC int rule_find(u64_t pos, size_t size, int flag) /*===========================================================================* * rule_pre_hook * *===========================================================================*/ -PUBLIC void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size, +void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size, u64_t *pos) { int i; @@ -163,7 +163,7 @@ PUBLIC void rule_pre_hook(iovec_t *iov, unsigned *count, size_t *size, /*===========================================================================* * rule_io_hook * *===========================================================================*/ -PUBLIC void rule_io_hook(char *buf, size_t size, u64_t pos, int flag) +void rule_io_hook(char *buf, size_t size, u64_t pos, int flag) { int i; @@ -175,7 +175,7 @@ PUBLIC void rule_io_hook(char *buf, size_t size, u64_t pos, int flag) /*===========================================================================* * rule_post_hook * *===========================================================================*/ -PUBLIC void rule_post_hook(size_t osize, int *result) +void rule_post_hook(size_t osize, int *result) { int i; diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index 09293b3a1..b4106bbba 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -864,7 +864,7 @@ static int paired_grant(char *buf1, char *buf2, int request, /*===========================================================================* * single_revoke * *===========================================================================*/ -PRIVATE void single_revoke(cp_grant_id_t gid, +static void single_revoke(cp_grant_id_t gid, const iovec_s_t vector[NR_IOREQS], int count) { /* Revoke all grants associated with a request to a single driver. diff --git a/drivers/filter/main.c b/drivers/filter/main.c index c6dd7ca1d..81db0f507 100644 --- a/drivers/filter/main.c +++ b/drivers/filter/main.c @@ -35,7 +35,7 @@ char BACKUP_LABEL[LABEL_SIZE] = ""; /* backup disk driver label */ int MAIN_MINOR = -1; /* main partition minor nr */ int BACKUP_MINOR = -1; /* backup partition minor nr */ -PRIVATE struct optset optset_table[] = { +static struct optset optset_table[] = { { "label0", OPT_STRING, MAIN_LABEL, LABEL_SIZE }, { "label1", OPT_STRING, BACKUP_LABEL, LABEL_SIZE }, { "minor0", OPT_INT, &MAIN_MINOR, 10 }, @@ -73,9 +73,9 @@ static cp_grant_id_t grant_id; /* BDEV_GRANT */ static char *buf_array, *buffer; /* contiguous buffer */ /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * carry * @@ -425,7 +425,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -443,7 +443,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the filter driver. */ int r; @@ -476,7 +476,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index 5085069e6..e0f9bd64e 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -158,7 +158,7 @@ * * 3 720K 1.44M 9 80 300 RPM 250 kbps PS/2, et al. */ -PRIVATE struct density { +static struct density { u8_t secpt; /* sectors per track */ u8_t cyls; /* tracks per side */ u8_t steps; /* steps per cylinder (2 = double step) */ @@ -187,7 +187,7 @@ PRIVATE struct density { #define b(d) (1 << (d)) /* bit for density d. */ -PRIVATE struct test_order { +static struct test_order { u8_t t_density; /* floppy/drive type */ u8_t t_class; /* limit drive to this class of densities */ } test_order[NT-1] = { @@ -203,7 +203,7 @@ PRIVATE struct test_order { }; /* Variables. */ -PRIVATE struct floppy { /* main drive struct, one entry per drive */ +static struct floppy { /* main drive struct, one entry per drive */ unsigned fl_curcyl; /* current cylinder */ unsigned fl_hardcyl; /* hardware cylinder, as opposed to: */ unsigned fl_cylinder; /* cylinder number addressed */ @@ -217,54 +217,54 @@ PRIVATE struct floppy { /* main drive struct, one entry per drive */ struct device fl_part[NR_PARTITIONS]; /* partition's base & size */ } floppy[NR_DRIVES]; -PRIVATE int irq_hook_id; /* id of irq hook at the kernel */ -PUBLIC int motor_status; /* bitmap of current motor status */ -PRIVATE int need_reset; /* set to 1 when controller must be reset */ -PUBLIC unsigned f_drive; /* selected drive */ -PRIVATE unsigned f_device; /* selected minor device */ -PRIVATE struct floppy *f_fp; /* current drive */ -PRIVATE struct density *f_dp; /* current density parameters */ -PRIVATE struct density *prev_dp;/* previous density parameters */ -PRIVATE unsigned f_sectors; /* equal to f_dp->secpt (needed a lot) */ -PUBLIC u16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */ -PRIVATE struct device *f_dv; /* device's base and size */ -PRIVATE struct disk_parameter_s fmt_param; /* parameters for format */ -PRIVATE u8_t f_results[MAX_RESULTS];/* the controller can give lots of output */ +static int irq_hook_id; /* id of irq hook at the kernel */ +int motor_status; /* bitmap of current motor status */ +static int need_reset; /* set to 1 when controller must be reset */ +unsigned f_drive; /* selected drive */ +static unsigned f_device; /* selected minor device */ +static struct floppy *f_fp; /* current drive */ +static struct density *f_dp; /* current density parameters */ +static struct density *prev_dp;/* previous density parameters */ +static unsigned f_sectors; /* equal to f_dp->secpt (needed a lot) */ +u16_t f_busy; /* BSY_IDLE, BSY_IO, BSY_WAKEN */ +static struct device *f_dv; /* device's base and size */ +static struct disk_parameter_s fmt_param; /* parameters for format */ +static u8_t f_results[MAX_RESULTS];/* the controller can give lots of output */ /* The floppy uses various timers. These are managed by the floppy driver * itself, because only a single synchronous alarm is available per process. * Besides the 'f_tmr_timeout' timer below, the floppy structure for each * floppy disk drive contains a 'fl_tmr_stop' timer. */ -PRIVATE timer_t f_tmr_timeout; /* timer for various timeouts */ -PRIVATE u32_t system_hz; /* system clock frequency */ -FORWARD void f_expire_tmrs(clock_t stamp); -FORWARD void stop_motor(timer_t *tp); -FORWARD void f_timeout(timer_t *tp); - -FORWARD struct device *f_prepare(dev_t device); -FORWARD struct device *f_part(dev_t minor); -FORWARD void f_cleanup(void); -FORWARD ssize_t f_transfer(dev_t minor, int do_write, u64_t position, +static timer_t f_tmr_timeout; /* timer for various timeouts */ +static u32_t system_hz; /* system clock frequency */ +static void f_expire_tmrs(clock_t stamp); +static void stop_motor(timer_t *tp); +static void f_timeout(timer_t *tp); + +static struct device *f_prepare(dev_t device); +static struct device *f_part(dev_t minor); +static void f_cleanup(void); +static ssize_t f_transfer(dev_t minor, int do_write, u64_t position, endpoint_t proc_nr, iovec_t *iov, unsigned int nr_req, int flags); -FORWARD int dma_setup(int do_write); -FORWARD void start_motor(void); -FORWARD int seek(void); -FORWARD int fdc_transfer(int do_write); -FORWARD int fdc_results(void); -FORWARD int fdc_command(const u8_t *cmd, int len); -FORWARD void fdc_out(int val); -FORWARD int recalibrate(void); -FORWARD void f_reset(void); -FORWARD int f_intr_wait(void); -FORWARD int read_id(void); -FORWARD int f_do_open(dev_t minor, int access); -FORWARD int f_do_close(dev_t minor); -FORWARD int test_read(int density); -FORWARD void f_geometry(dev_t minor, struct partition *entry); +static int dma_setup(int do_write); +static void start_motor(void); +static int seek(void); +static int fdc_transfer(int do_write); +static int fdc_results(void); +static int fdc_command(const u8_t *cmd, int len); +static void fdc_out(int val); +static int recalibrate(void); +static void f_reset(void); +static int f_intr_wait(void); +static int read_id(void); +static int f_do_open(dev_t minor, int access); +static int f_do_close(dev_t minor); +static int test_read(int density); +static void f_geometry(dev_t minor, struct partition *entry); /* Entry points to this driver. */ -PRIVATE struct blockdriver f_dtab = { +static struct blockdriver f_dtab = { BLOCKDRIVER_TYPE_DISK, /* handle partition requests */ f_do_open, /* open or mount request, sense type of diskette */ f_do_close, /* nothing on a close */ @@ -283,18 +283,18 @@ static char *floppy_buf; static phys_bytes floppy_buf_phys; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); -PUBLIC int last_was_write; +int last_was_write; /*===========================================================================* * floppy_task * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* SEF local startup. */ sef_local_startup(); @@ -308,7 +308,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -329,7 +329,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the floppy driver. */ struct floppy *fp; @@ -369,7 +369,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { int s; @@ -385,7 +385,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * f_expire_tmrs * *===========================================================================*/ -PRIVATE void f_expire_tmrs(clock_t stamp) +static void f_expire_tmrs(clock_t stamp) { /* A synchronous alarm message was received. Call the watchdog function for * each expired timer, if any. @@ -397,7 +397,7 @@ PRIVATE void f_expire_tmrs(clock_t stamp) /*===========================================================================* * f_prepare * *===========================================================================*/ -PRIVATE struct device *f_prepare(dev_t device) +static struct device *f_prepare(dev_t device) { /* Prepare for I/O on a device. */ @@ -424,7 +424,7 @@ PRIVATE struct device *f_prepare(dev_t device) /*===========================================================================* * f_part * *===========================================================================*/ -PRIVATE struct device *f_part(dev_t minor) +static struct device *f_part(dev_t minor) { /* Return a pointer to the partition information of the given minor device. */ @@ -434,7 +434,7 @@ PRIVATE struct device *f_part(dev_t minor) /*===========================================================================* * f_cleanup * *===========================================================================*/ -PRIVATE void f_cleanup(void) +static void f_cleanup(void) { /* Start a timer to turn the motor off in a few seconds. */ set_timer(&f_fp->fl_tmr_stop, MOTOR_OFF, stop_motor, f_drive); @@ -446,7 +446,7 @@ PRIVATE void f_cleanup(void) /*===========================================================================* * f_transfer * *===========================================================================*/ -PRIVATE ssize_t f_transfer( +static ssize_t f_transfer( dev_t minor, /* minor device number */ int do_write, /* read or write? */ u64_t pos64, /* offset on device to read or write */ @@ -690,7 +690,7 @@ PRIVATE ssize_t f_transfer( /*===========================================================================* * dma_setup * *===========================================================================*/ -PRIVATE int dma_setup(int do_write) +static int dma_setup(int do_write) { /* The IBM PC can perform DMA operations by using the DMA chip. To use it, * the DMA (Direct Memory Access) chip is loaded with the 20-bit memory address @@ -734,7 +734,7 @@ PRIVATE int dma_setup(int do_write) /*===========================================================================* * start_motor * *===========================================================================*/ -PRIVATE void start_motor(void) +static void start_motor(void) { /* Control of the floppy disk motors is a big pain. If a motor is off, you * have to turn it on first, which takes 1/2 second. You can't leave it on @@ -788,7 +788,7 @@ PRIVATE void start_motor(void) /*===========================================================================* * stop_motor * *===========================================================================*/ -PRIVATE void stop_motor(timer_t *tp) +static void stop_motor(timer_t *tp) { /* This routine is called from an alarm timer after several seconds have * elapsed with no floppy disk activity. It turns the drive motor off. @@ -802,7 +802,7 @@ PRIVATE void stop_motor(timer_t *tp) /*===========================================================================* * seek * *===========================================================================*/ -PRIVATE int seek(void) +static int seek(void) { /* Issue a SEEK command on the indicated drive unless the arm is already * positioned on the correct cylinder. @@ -866,7 +866,7 @@ PRIVATE int seek(void) /*===========================================================================* * fdc_transfer * *===========================================================================*/ -PRIVATE int fdc_transfer(int do_write) +static int fdc_transfer(int do_write) { /* The drive is now on the proper cylinder. Read, write or format 1 block. */ @@ -938,7 +938,7 @@ PRIVATE int fdc_transfer(int do_write) /*===========================================================================* * fdc_results * *===========================================================================*/ -PRIVATE int fdc_results(void) +static int fdc_results(void) { /* Extract results from the controller after an operation, then allow floppy * interrupts again. @@ -987,7 +987,7 @@ PRIVATE int fdc_results(void) /*===========================================================================* * fdc_command * *===========================================================================*/ -PRIVATE int fdc_command( +static int fdc_command( const u8_t *cmd, /* command bytes */ int len /* command length */ ) @@ -1012,7 +1012,7 @@ PRIVATE int fdc_command( /*===========================================================================* * fdc_out * *===========================================================================*/ -PRIVATE void fdc_out( +static void fdc_out( int val /* write this byte to floppy disk controller */ ) { @@ -1045,7 +1045,7 @@ PRIVATE void fdc_out( /*===========================================================================* * recalibrate * *===========================================================================*/ -PRIVATE int recalibrate(void) +static int recalibrate(void) { /* The floppy disk controller has no way of determining its absolute arm * position (cylinder). Instead, it steps the arm a cylinder at a time and @@ -1087,7 +1087,7 @@ PRIVATE int recalibrate(void) /*===========================================================================* * f_reset * *===========================================================================*/ -PRIVATE void f_reset(void) +static void f_reset(void) { /* Issue a reset to the controller. This is done after any catastrophe, * like the controller refusing to respond. @@ -1160,7 +1160,7 @@ PRIVATE void f_reset(void) /*===========================================================================* * f_intr_wait * *===========================================================================*/ -PRIVATE int f_intr_wait(void) +static int f_intr_wait(void) { /* Wait for an interrupt, but not forever. The FDC may have all the time of * the world, but we humans do not. @@ -1199,7 +1199,7 @@ PRIVATE int f_intr_wait(void) /*===========================================================================* * f_timeout * *===========================================================================*/ -PRIVATE void f_timeout(timer_t *UNUSED(tp)) +static void f_timeout(timer_t *UNUSED(tp)) { /* This routine is called when a timer expires. Usually to tell that a * motor has spun up, but also to forge an interrupt when it takes too long @@ -1214,7 +1214,7 @@ PRIVATE void f_timeout(timer_t *UNUSED(tp)) /*===========================================================================* * read_id * *===========================================================================*/ -PRIVATE int read_id(void) +static int read_id(void) { /* Determine current cylinder and sector. */ @@ -1247,7 +1247,7 @@ PRIVATE int read_id(void) /*===========================================================================* * f_do_open * *===========================================================================*/ -PRIVATE int f_do_open(dev_t minor, int UNUSED(access)) +static int f_do_open(dev_t minor, int UNUSED(access)) { /* Handle an open on a floppy. Determine diskette type if need be. */ @@ -1306,7 +1306,7 @@ PRIVATE int f_do_open(dev_t minor, int UNUSED(access)) /*===========================================================================* * f_do_close * *===========================================================================*/ -PRIVATE int f_do_close(dev_t UNUSED(minor)) +static int f_do_close(dev_t UNUSED(minor)) { /* Handle a close on a floppy. Nothing to do here. */ @@ -1316,7 +1316,7 @@ PRIVATE int f_do_close(dev_t UNUSED(minor)) /*===========================================================================* * test_read * *===========================================================================*/ -PRIVATE int test_read(int density) +static int test_read(int density) { /* Try to read the highest numbered sector on cylinder 2. Not all floppy * types have as many sectors per track, and trying cylinder 2 finds the @@ -1346,7 +1346,7 @@ PRIVATE int test_read(int density) /*===========================================================================* * f_geometry * *===========================================================================*/ -PRIVATE void f_geometry(dev_t minor, struct partition *entry) +static void f_geometry(dev_t minor, struct partition *entry) { if (f_prepare(minor) == NULL) return; diff --git a/drivers/floppy/liveupdate.c b/drivers/floppy/liveupdate.c index 81e521848..d709725d8 100644 --- a/drivers/floppy/liveupdate.c +++ b/drivers/floppy/liveupdate.c @@ -22,7 +22,7 @@ EXTERN int last_was_write; /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -49,7 +49,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || FL_STATE_IS_CUSTOM(state); } @@ -57,7 +57,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { sef_lu_dprint("floppy: live update state = %d\n", state); sef_lu_dprint("floppy: f_busy = %d\n", f_busy); diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 02a1d39d6..90cff2645 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -45,7 +45,7 @@ typedef int irq_hook_t; /* ignore interrupt for the moment */ #define interrupt(x) do { } while(0) -PRIVATE union tmpbuf +static union tmpbuf { char pad[4096]; struct cbl_conf cc; @@ -136,13 +136,13 @@ fxp_t; #define FT_82559 0x4 #define FT_82801 0x8 -PRIVATE int fxp_instance; +static int fxp_instance; -PRIVATE fxp_t *fxp_state; +static fxp_t *fxp_state; -PRIVATE timer_t fxp_watchdog; +static timer_t fxp_watchdog; -PRIVATE u32_t system_hz; +static u32_t system_hz; #define fxp_inb(port, offset) (do_inb((port) + (offset))) #define fxp_inl(port, offset) (do_inl((port) + (offset))) @@ -184,7 +184,7 @@ static void do_outl(port_t port, u32_t v); static void tell_dev(vir_bytes start, size_t size, int pci_bus, int pci_dev, int pci_func); -PRIVATE void handle_hw_intr(void) +static void handle_hw_intr(void) { int r; fxp_t *fp; @@ -208,9 +208,9 @@ PRIVATE void handle_hw_intr(void) } /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * @@ -261,7 +261,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -282,7 +282,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the fxp driver. */ long v; @@ -314,7 +314,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { port_t port; fxp_t *fp; @@ -1986,7 +1986,7 @@ message *reply_mess; /*===========================================================================* * eeprom_read * *===========================================================================*/ -PRIVATE u16_t eeprom_read(fp, reg) +static u16_t eeprom_read(fp, reg) fxp_t *fp; int reg; { @@ -2046,7 +2046,7 @@ int reg; /*===========================================================================* * eeprom_addrsize * *===========================================================================*/ -PRIVATE void eeprom_addrsize(fp) +static void eeprom_addrsize(fp) fxp_t *fp; { port_t port; @@ -2104,7 +2104,7 @@ fxp_t *fp; /*===========================================================================* * mii_read * *===========================================================================*/ -PRIVATE u16_t mii_read(fp, reg) +static u16_t mii_read(fp, reg) fxp_t *fp; int reg; { @@ -2178,7 +2178,7 @@ static void do_outl(port_t port, u32_t value) panic("sys_outl failed: %d", r); } -PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func) +static void tell_dev(buf, size, pci_bus, pci_dev, pci_func) vir_bytes buf; size_t size; int pci_bus; diff --git a/drivers/fxp/mii.c b/drivers/fxp/mii.c index 46a2712d0..c8a8e8fce 100644 --- a/drivers/fxp/mii.c +++ b/drivers/fxp/mii.c @@ -16,7 +16,7 @@ Media Independent (Ethernet) Interface functions /*===========================================================================* * mii_print_stat_speed * *===========================================================================*/ -PUBLIC void mii_print_stat_speed(u16_t stat, u16_t extstat) +void mii_print_stat_speed(u16_t stat, u16_t extstat) { int fs, ft; @@ -117,7 +117,7 @@ PUBLIC void mii_print_stat_speed(u16_t stat, u16_t extstat) /*===========================================================================* * mii_print_techab * *===========================================================================*/ -PUBLIC void mii_print_techab(u16_t techab) +void mii_print_techab(u16_t techab) { int fs, ft; diff --git a/drivers/hello/hello.c b/drivers/hello/hello.c index 529fd923d..35700eacb 100644 --- a/drivers/hello/hello.c +++ b/drivers/hello/hello.c @@ -8,21 +8,21 @@ /* * Function prototypes for the hello driver. */ -FORWARD int hello_open(message *m); -FORWARD int hello_close(message *m); -FORWARD struct device * hello_prepare(dev_t device); -FORWARD int hello_transfer(endpoint_t endpt, int opcode, u64_t position, +static int hello_open(message *m); +static int hello_close(message *m); +static struct device * hello_prepare(dev_t device); +static int hello_transfer(endpoint_t endpt, int opcode, u64_t position, iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int flags); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init(int type, sef_init_info_t *info); -FORWARD int sef_cb_lu_state_save(int); -FORWARD int lu_state_restore(void); +static void sef_local_startup(void); +static int sef_cb_init(int type, sef_init_info_t *info); +static int sef_cb_lu_state_save(int); +static int lu_state_restore(void); /* Entry points to the hello driver. */ -PRIVATE struct chardriver hello_tab = +static struct chardriver hello_tab = { hello_open, hello_close, @@ -37,31 +37,31 @@ PRIVATE struct chardriver hello_tab = }; /** Represents the /dev/hello device. */ -PRIVATE struct device hello_device; +static struct device hello_device; /** State variable to count the number of times the device has been opened. */ -PRIVATE int open_counter; +static int open_counter; -PRIVATE int hello_open(message *UNUSED(m)) +static int hello_open(message *UNUSED(m)) { printf("hello_open(). Called %d time(s).\n", ++open_counter); return OK; } -PRIVATE int hello_close(message *UNUSED(m)) +static int hello_close(message *UNUSED(m)) { printf("hello_close()\n"); return OK; } -PRIVATE struct device * hello_prepare(dev_t UNUSED(dev)) +static struct device * hello_prepare(dev_t UNUSED(dev)) { hello_device.dv_base = make64(0, 0); hello_device.dv_size = make64(strlen(HELLO_MESSAGE), 0); return &hello_device; } -PRIVATE int hello_transfer(endpoint_t endpt, int opcode, u64_t position, +static int hello_transfer(endpoint_t endpt, int opcode, u64_t position, iovec_t *iov, unsigned nr_req, endpoint_t UNUSED(user_endpt), unsigned int UNUSED(flags)) { @@ -97,14 +97,14 @@ PRIVATE int hello_transfer(endpoint_t endpt, int opcode, u64_t position, return ret; } -PRIVATE int sef_cb_lu_state_save(int UNUSED(state)) { +static int sef_cb_lu_state_save(int UNUSED(state)) { /* Save the state. */ ds_publish_u32("open_counter", open_counter, DSF_OVERWRITE); return OK; } -PRIVATE int lu_state_restore() { +static int lu_state_restore() { /* Restore the state. */ u32_t value; @@ -115,7 +115,7 @@ PRIVATE int lu_state_restore() { return OK; } -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* * Register init callbacks. Use the same function for all event types @@ -138,7 +138,7 @@ PRIVATE void sef_local_startup() sef_startup(); } -PRIVATE int sef_cb_init(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the hello driver. */ int do_announce_driver = TRUE; @@ -171,7 +171,7 @@ PRIVATE int sef_cb_init(int type, sef_init_info_t *UNUSED(info)) return OK; } -PUBLIC int main(void) +int main(void) { /* * Perform initialization. diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index 72121740d..b0531bf91 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -245,9 +245,9 @@ static char isstored[TX_RING_SIZE]; /* Tx-slot in-use */ phys_bytes lance_buf_phys; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * @@ -322,7 +322,7 @@ int main( int argc, char **argv ) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -343,7 +343,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the lance driver. */ long v; @@ -371,7 +371,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ diff --git a/drivers/log/diag.c b/drivers/log/diag.c index 1e3885536..c9de05334 100644 --- a/drivers/log/diag.c +++ b/drivers/log/diag.c @@ -12,7 +12,7 @@ /*==========================================================================* * do_new_kmess * *==========================================================================*/ -PUBLIC void do_new_kmess(void) +void do_new_kmess(void) { /* Notification for a new kernel message. */ static struct kmessages kmess; /* entire kmess structure */ diff --git a/drivers/log/liveupdate.c b/drivers/log/liveupdate.c index 7ba768623..e1d114ab7 100644 --- a/drivers/log/liveupdate.c +++ b/drivers/log/liveupdate.c @@ -5,9 +5,9 @@ EXTERN struct logdevice logdevices[NR_DEVS]; /* State management helpers. */ -PRIVATE int is_read_pending; -PRIVATE int is_select_callback_pending; -PRIVATE void load_state_info(void) +static int is_read_pending; +static int is_select_callback_pending; +static void load_state_info(void) { int i, found_pending; struct logdevice *log; @@ -36,7 +36,7 @@ PRIVATE void load_state_info(void) /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -68,7 +68,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || LOG_STATE_IS_CUSTOM(state); } @@ -76,7 +76,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { /* Load state information. */ load_state_info(); diff --git a/drivers/log/log.c b/drivers/log/log.c index 9de05512e..3dbc887b5 100644 --- a/drivers/log/log.c +++ b/drivers/log/log.c @@ -18,23 +18,23 @@ #define LOGINC(n, i) do { (n) = (((n) + (i)) % LOG_SIZE); } while(0) -PUBLIC struct logdevice logdevices[NR_DEVS]; -PRIVATE struct device log_geom[NR_DEVS]; /* base and size of devices */ -PRIVATE int log_device = -1; /* current device */ +struct logdevice logdevices[NR_DEVS]; +static struct device log_geom[NR_DEVS]; /* base and size of devices */ +static int log_device = -1; /* current device */ -FORWARD struct device *log_prepare(dev_t device); -FORWARD int log_transfer(endpoint_t endpt, int opcode, u64_t position, +static struct device *log_prepare(dev_t device); +static int log_transfer(endpoint_t endpt, int opcode, u64_t position, iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int flags); -FORWARD int log_do_open(message *m_ptr); -FORWARD int log_cancel(message *m_ptr); -FORWARD int log_select(message *m_ptr); -FORWARD int log_other(message *m_ptr); -FORWARD int subread(struct logdevice *log, int count, endpoint_t endpt, +static int log_do_open(message *m_ptr); +static int log_cancel(message *m_ptr); +static int log_select(message *m_ptr); +static int log_other(message *m_ptr); +static int subread(struct logdevice *log, int count, endpoint_t endpt, cp_grant_id_t grant, size_t); /* Entry points to this driver. */ -PRIVATE struct chardriver log_dtab = { +static struct chardriver log_dtab = { log_do_open, /* open or mount */ do_nop, /* nothing on a close */ nop_ioctl, /* ioctl nop */ @@ -48,17 +48,17 @@ PRIVATE struct chardriver log_dtab = { }; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* SEF local startup. */ sef_local_startup(); @@ -72,7 +72,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -94,7 +94,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the log driver. */ int i; @@ -118,7 +118,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for a pending message from the kernel, ignore anything else. */ if (signo != SIGKMESS) return; @@ -129,7 +129,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * log_prepare * *===========================================================================*/ -PRIVATE struct device *log_prepare(dev_t device) +static struct device *log_prepare(dev_t device) { /* Prepare for I/O on a device: check if the minor device number is ok. */ @@ -142,7 +142,7 @@ PRIVATE struct device *log_prepare(dev_t device) /*===========================================================================* * subwrite * *===========================================================================*/ -PRIVATE int +static int subwrite(struct logdevice *log, int count, endpoint_t endpt, cp_grant_id_t grant, size_t offset, char *localbuf) { @@ -230,7 +230,7 @@ subwrite(struct logdevice *log, int count, endpoint_t endpt, /*===========================================================================* * log_append * *===========================================================================*/ -PUBLIC void +void log_append(char *buf, int count) { int w = 0, skip = 0; @@ -250,7 +250,7 @@ log_append(char *buf, int count) /*===========================================================================* * subread * *===========================================================================*/ -PRIVATE int +static int subread(struct logdevice *log, int count, endpoint_t endpt, cp_grant_id_t grant, size_t offset) { @@ -275,7 +275,7 @@ subread(struct logdevice *log, int count, endpoint_t endpt, /*===========================================================================* * log_transfer * *===========================================================================*/ -PRIVATE int log_transfer( +static int log_transfer( endpoint_t endpt, /* endpoint of grant owner */ int opcode, /* DEV_GATHER_S or DEV_SCATTER_S */ u64_t UNUSED(position), /* offset on device to read or write */ @@ -356,7 +356,7 @@ PRIVATE int log_transfer( /*============================================================================* * log_do_open * *============================================================================*/ -PRIVATE int log_do_open(message *m_ptr) +static int log_do_open(message *m_ptr) { if (log_prepare(m_ptr->DEVICE) == NULL) return(ENXIO); return(OK); @@ -365,7 +365,7 @@ PRIVATE int log_do_open(message *m_ptr) /*============================================================================* * log_cancel * *============================================================================*/ -PRIVATE int log_cancel(message *m_ptr) +static int log_cancel(message *m_ptr) { int d; d = m_ptr->TTY_LINE; @@ -379,7 +379,7 @@ PRIVATE int log_cancel(message *m_ptr) /*============================================================================* * log_other * *============================================================================*/ -PRIVATE int log_other(message *m_ptr) +static int log_other(message *m_ptr) { int r; @@ -406,7 +406,7 @@ PRIVATE int log_other(message *m_ptr) /*============================================================================* * log_select * *============================================================================*/ -PRIVATE int log_select(message *m_ptr) +static int log_select(message *m_ptr) { int d, ready_ops = 0, ops = 0; d = m_ptr->TTY_LINE; diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index b431616af..5daa46ab4 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -38,29 +38,29 @@ #define NR_DEVS (7+RAMDISKS) /* number of minor devices */ -PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */ -PRIVATE vir_bytes m_vaddrs[NR_DEVS]; -PRIVATE dev_t m_device; /* current minor character device */ +static struct device m_geom[NR_DEVS]; /* base and size of each device */ +static vir_bytes m_vaddrs[NR_DEVS]; +static dev_t m_device; /* current minor character device */ -PRIVATE int openct[NR_DEVS]; +static int openct[NR_DEVS]; -FORWARD struct device *m_prepare(dev_t device); -FORWARD int m_transfer(endpoint_t endpt, int opcode, u64_t position, +static struct device *m_prepare(dev_t device); +static int m_transfer(endpoint_t endpt, int opcode, u64_t position, iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int flags); -FORWARD int m_do_open(message *m_ptr); -FORWARD int m_do_close(message *m_ptr); +static int m_do_open(message *m_ptr); +static int m_do_close(message *m_ptr); -FORWARD struct device *m_block_part(dev_t minor); -FORWARD int m_block_transfer(dev_t minor, int do_write, u64_t position, +static struct device *m_block_part(dev_t minor); +static int m_block_transfer(dev_t minor, int do_write, u64_t position, endpoint_t endpt, iovec_t *iov, unsigned int nr_req, int flags); -FORWARD int m_block_open(dev_t minor, int access); -FORWARD int m_block_close(dev_t minor); -FORWARD int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t +static int m_block_open(dev_t minor, int access); +static int m_block_close(dev_t minor); +static int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant); /* Entry points to the CHARACTER part of this driver. */ -PRIVATE struct chardriver m_cdtab = { +static struct chardriver m_cdtab = { m_do_open, /* open or mount */ m_do_close, /* nothing on a close */ nop_ioctl, /* no I/O control */ @@ -74,7 +74,7 @@ PRIVATE struct chardriver m_cdtab = { }; /* Entry points to the BLOCK part of this driver. */ -PRIVATE struct blockdriver m_bdtab = { +static struct blockdriver m_bdtab = { BLOCKDRIVER_TYPE_DISK,/* handle partition requests */ m_block_open, /* open or mount */ m_block_close, /* nothing on a close */ @@ -91,19 +91,19 @@ PRIVATE struct blockdriver m_bdtab = { /* Buffer for the /dev/zero null byte feed. */ #define ZERO_BUF_SIZE 1024 -PRIVATE char dev_zero[ZERO_BUF_SIZE]; +static char dev_zero[ZERO_BUF_SIZE]; #define click_to_round_k(n) \ ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024)) /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { message msg; int r, ipc_status; @@ -129,7 +129,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -147,7 +147,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the memory driver. */ int i; @@ -193,7 +193,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * m_is_block * *===========================================================================*/ -PRIVATE int m_is_block(dev_t minor) +static int m_is_block(dev_t minor) { /* Return TRUE iff the given minor device number is for a block device. */ @@ -212,7 +212,7 @@ PRIVATE int m_is_block(dev_t minor) /*===========================================================================* * m_prepare * *===========================================================================*/ -PRIVATE struct device *m_prepare(dev_t device) +static struct device *m_prepare(dev_t device) { /* Prepare for I/O on a device: check if the minor device number is ok. */ if (device >= NR_DEVS || m_is_block(device)) return(NULL); @@ -224,7 +224,7 @@ PRIVATE struct device *m_prepare(dev_t device) /*===========================================================================* * m_transfer * *===========================================================================*/ -PRIVATE int m_transfer( +static int m_transfer( endpoint_t endpt, /* endpoint of grant owner */ int opcode, /* DEV_GATHER_S or DEV_SCATTER_S */ u64_t pos64, /* offset on device to read or write */ @@ -381,7 +381,7 @@ PRIVATE int m_transfer( /*===========================================================================* * m_do_open * *===========================================================================*/ -PRIVATE int m_do_open(message *m_ptr) +static int m_do_open(message *m_ptr) { /* Open a memory character device. */ int r; @@ -407,7 +407,7 @@ PRIVATE int m_do_open(message *m_ptr) /*===========================================================================* * m_do_close * *===========================================================================*/ -PRIVATE int m_do_close(message *m_ptr) +static int m_do_close(message *m_ptr) { /* Close a memory character device. */ if (m_prepare(m_ptr->DEVICE) == NULL) return(ENXIO); @@ -424,7 +424,7 @@ PRIVATE int m_do_close(message *m_ptr) /*===========================================================================* * m_block_part * *===========================================================================*/ -PRIVATE struct device *m_block_part(dev_t minor) +static struct device *m_block_part(dev_t minor) { /* Prepare for I/O on a device: check if the minor device number is ok. */ if (minor >= NR_DEVS || !m_is_block(minor)) return(NULL); @@ -435,7 +435,7 @@ PRIVATE struct device *m_block_part(dev_t minor) /*===========================================================================* * m_block_transfer * *===========================================================================*/ -PRIVATE int m_block_transfer( +static int m_block_transfer( dev_t minor, /* minor device number */ int do_write, /* read or write? */ u64_t pos64, /* offset on device to read or write */ @@ -502,7 +502,7 @@ PRIVATE int m_block_transfer( /*===========================================================================* * m_block_open * *===========================================================================*/ -PRIVATE int m_block_open(dev_t minor, int UNUSED(access)) +static int m_block_open(dev_t minor, int UNUSED(access)) { /* Open a memory block device. */ if (m_block_part(minor) == NULL) return(ENXIO); @@ -515,7 +515,7 @@ PRIVATE int m_block_open(dev_t minor, int UNUSED(access)) /*===========================================================================* * m_block_close * *===========================================================================*/ -PRIVATE int m_block_close(dev_t minor) +static int m_block_close(dev_t minor) { /* Close a memory block device. */ if (m_block_part(minor) == NULL) return(ENXIO); @@ -556,7 +556,7 @@ PRIVATE int m_block_close(dev_t minor) /*===========================================================================* * m_block_ioctl * *===========================================================================*/ -PRIVATE int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, +static int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { /* I/O controls for the block devices of the memory driver. Currently there is diff --git a/drivers/orinoco/hermes.c b/drivers/orinoco/hermes.c index c4f0c6691..e0feff77e 100644 --- a/drivers/orinoco/hermes.c +++ b/drivers/orinoco/hermes.c @@ -43,7 +43,7 @@ * * * Wait msecs milli seconds * *****************************************************************************/ -PRIVATE void milli_delay(unsigned int msecs) +static void milli_delay(unsigned int msecs) { micro_delay((long)msecs * 1000); } @@ -141,7 +141,7 @@ int hermes_cor_reset (hermes_t *hw) { * Check whether we have access to the card. Does the SWSUPPORT0 contain the * * value we put in it earlier? * *****************************************************************************/ -PRIVATE int hermes_present (hermes_t * hw) { +static int hermes_present (hermes_t * hw) { int i = hermes_read_reg (hw, HERMES_SWSUPPORT0) == HERMES_MAGIC; if (!i) printf("Hermes: Error, card not present?\n"); diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index da9006c1b..2df330bf0 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -69,8 +69,8 @@ #define IRQ_BAP 1 #define ETH_HLEN 14 -PRIVATE t_or or_state; -PRIVATE int or_instance; +static t_or or_state; +static int or_instance; struct ethhdr { u8_t h_dest[ETH_ALEN]; @@ -102,7 +102,7 @@ u8_t encaps_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; ********************************************************************/ /* The frequency of each channel in MHz */ -PRIVATE const long channel_frequency[] = { +static const long channel_frequency[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484 }; @@ -159,15 +159,15 @@ static void or_dump(message *m); /* The message used in the main loop is made global, so that rl_watchdog_f() * can change its message type to fake an interrupt message. */ -PRIVATE message m; -PRIVATE int int_event_check; /* set to TRUE if events arrived */ +static message m; +static int int_event_check; /* set to TRUE if events arrived */ -PRIVATE u32_t system_hz; +static u32_t system_hz; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /***************************************************************************** * main * @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) { /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -252,7 +252,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the orinoco driver. */ long v; @@ -278,7 +278,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { t_or *orp; diff --git a/drivers/pci/main.c b/drivers/pci/main.c index 90415c896..d93ecb965 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -4,33 +4,33 @@ main.c #include "pci.h" -PUBLIC struct pci_acl pci_acl[NR_DRIVERS]; - -FORWARD void do_init(message *mp); -FORWARD void do_first_dev(message *mp); -FORWARD void do_next_dev(message *mp); -FORWARD void do_find_dev(message *mp); -FORWARD void do_ids(message *mp); -FORWARD void do_dev_name_s(message *mp); -FORWARD void do_slot_name_s(message *mp); -FORWARD void do_set_acl(message *mp); -FORWARD void do_del_acl(message *mp); -FORWARD void do_reserve(message *mp); -FORWARD void do_attr_r8(message *mp); -FORWARD void do_attr_r16(message *mp); -FORWARD void do_attr_r32(message *mp); -FORWARD void do_attr_w8(message *mp); -FORWARD void do_attr_w16(message *mp); -FORWARD void do_attr_w32(message *mp); -FORWARD void do_get_bar(message *mp); -FORWARD void do_rescan_bus(message *mp); -FORWARD void reply(message *mp, int result); -FORWARD struct rs_pci *find_acl(int endpoint); +struct pci_acl pci_acl[NR_DRIVERS]; + +static void do_init(message *mp); +static void do_first_dev(message *mp); +static void do_next_dev(message *mp); +static void do_find_dev(message *mp); +static void do_ids(message *mp); +static void do_dev_name_s(message *mp); +static void do_slot_name_s(message *mp); +static void do_set_acl(message *mp); +static void do_del_acl(message *mp); +static void do_reserve(message *mp); +static void do_attr_r8(message *mp); +static void do_attr_r16(message *mp); +static void do_attr_r32(message *mp); +static void do_attr_w8(message *mp); +static void do_attr_w16(message *mp); +static void do_attr_w32(message *mp); +static void do_get_bar(message *mp); +static void do_rescan_bus(message *mp); +static void reply(message *mp, int result); +static struct rs_pci *find_acl(int endpoint); extern int debug; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); int main(void) { @@ -90,7 +90,7 @@ int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -105,7 +105,7 @@ PRIVATE void sef_local_startup() sef_startup(); } -PRIVATE void do_init(mp) +static void do_init(mp) message *mp; { int r; @@ -121,7 +121,7 @@ message *mp; mp->m_source, r); } -PRIVATE void do_first_dev(message *mp) +static void do_first_dev(message *mp) { int r, devind; u16_t vid, did; @@ -149,7 +149,7 @@ PRIVATE void do_first_dev(message *mp) } } -PRIVATE void do_next_dev(message *mp) +static void do_next_dev(message *mp) { int r, devind; u16_t vid, did; @@ -174,7 +174,7 @@ PRIVATE void do_next_dev(message *mp) } } -PRIVATE void do_find_dev(mp) +static void do_find_dev(mp) message *mp; { int r, devind; @@ -196,7 +196,7 @@ message *mp; } } -PRIVATE void do_ids(mp) +static void do_ids(mp) message *mp; { int r, devind; @@ -222,7 +222,7 @@ message *mp; } } -PRIVATE void do_dev_name_s(mp) +static void do_dev_name_s(mp) message *mp; { int r, name_len, len; @@ -259,7 +259,7 @@ message *mp; } } -PRIVATE void do_slot_name_s(mp) +static void do_slot_name_s(mp) message *mp; { int r, devind, name_len, len; @@ -295,7 +295,7 @@ message *mp; } } -PRIVATE void do_set_acl(mp) +static void do_set_acl(mp) message *mp; { int i, r, gid; @@ -338,7 +338,7 @@ message *mp; reply(mp, OK); } -PRIVATE void do_del_acl(message *mp) +static void do_del_acl(message *mp) { int i, proc_nr; @@ -378,7 +378,7 @@ PRIVATE void do_del_acl(message *mp) reply(mp, OK); } -PRIVATE void do_reserve(message *mp) +static void do_reserve(message *mp) { struct rs_pci *aclp; int r, devind; @@ -396,7 +396,7 @@ PRIVATE void do_reserve(message *mp) } } -PRIVATE void do_attr_r8(mp) +static void do_attr_r8(mp) message *mp; { int r, devind, port; @@ -422,7 +422,7 @@ message *mp; } } -PRIVATE void do_attr_r16(mp) +static void do_attr_r16(mp) message *mp; { int r, devind, port; @@ -442,7 +442,7 @@ message *mp; } } -PRIVATE void do_attr_r32(mp) +static void do_attr_r32(mp) message *mp; { int r, devind, port; @@ -468,7 +468,7 @@ message *mp; } } -PRIVATE void do_attr_w8(mp) +static void do_attr_w8(mp) message *mp; { int r, devind, port; @@ -488,7 +488,7 @@ message *mp; } } -PRIVATE void do_attr_w16(mp) +static void do_attr_w16(mp) message *mp; { int r, devind, port; @@ -508,7 +508,7 @@ message *mp; } } -PRIVATE void do_attr_w32(mp) +static void do_attr_w32(mp) message *mp; { int r, devind, port; @@ -528,7 +528,7 @@ message *mp; } } -PRIVATE void do_get_bar(mp) +static void do_get_bar(mp) message *mp; { int r, devind, port, ioflag; @@ -554,7 +554,7 @@ message *mp; } } -PRIVATE void do_rescan_bus(mp) +static void do_rescan_bus(mp) message *mp; { int r, busnr; @@ -572,7 +572,7 @@ message *mp; } -PRIVATE void reply(mp, result) +static void reply(mp, result) message *mp; int result; { @@ -586,7 +586,7 @@ int result; } -PRIVATE struct rs_pci *find_acl(endpoint) +static struct rs_pci *find_acl(endpoint) int endpoint; { int i; diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 58855fe25..86a311dad 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -39,7 +39,7 @@ Created: Jan 2000 by Philip Homburg int debug= 0; -PRIVATE struct pcibus +static struct pcibus { int pb_type; int pb_needinit; @@ -57,9 +57,9 @@ PRIVATE struct pcibus u16_t (*pb_rsts)(int busind); void (*pb_wsts)(int busind, u16_t value); } pcibus[NR_PCIBUS]; -PRIVATE int nr_pcibus= 0; +static int nr_pcibus= 0; -PRIVATE struct pcidev +static struct pcidev { u8_t pd_busnr; u8_t pd_dev; @@ -90,68 +90,68 @@ EXTERN struct pci_acl pci_acl[NR_DRIVERS]; #define PBF_IO 1 /* I/O else memory */ #define PBF_INCOMPLETE 2 /* not allocated */ -PRIVATE int nr_pcidev= 0; - -FORWARD void pci_intel_init(void); -FORWARD void probe_bus(int busind); -FORWARD int is_duplicate(u8_t busnr, u8_t dev, u8_t func); -FORWARD void record_irq(int devind); -FORWARD void record_bars_normal(int devind); -FORWARD void record_bars_bridge(int devind); -FORWARD void record_bars_cardbus(int devind); -FORWARD void record_bars(int devind, int last_reg); -FORWARD int record_bar(int devind, int bar_nr, int last); -FORWARD void complete_bridges(void); -FORWARD void complete_bars(void); -FORWARD void update_bridge4dev_io(int devind, u32_t io_base, u32_t +static int nr_pcidev= 0; + +static void pci_intel_init(void); +static void probe_bus(int busind); +static int is_duplicate(u8_t busnr, u8_t dev, u8_t func); +static void record_irq(int devind); +static void record_bars_normal(int devind); +static void record_bars_bridge(int devind); +static void record_bars_cardbus(int devind); +static void record_bars(int devind, int last_reg); +static int record_bar(int devind, int bar_nr, int last); +static void complete_bridges(void); +static void complete_bars(void); +static void update_bridge4dev_io(int devind, u32_t io_base, u32_t io_size); -FORWARD int get_freebus(void); -FORWARD int do_isabridge(int busind); -FORWARD void do_pcibridge(int busind); -FORWARD int get_busind(int busnr); -FORWARD int do_piix(int devind); -FORWARD int do_amd_isabr(int devind); -FORWARD int do_sis_isabr(int devind); -FORWARD int do_via_isabr(int devind); +static int get_freebus(void); +static int do_isabridge(int busind); +static void do_pcibridge(int busind); +static int get_busind(int busnr); +static int do_piix(int devind); +static int do_amd_isabr(int devind); +static int do_sis_isabr(int devind); +static int do_via_isabr(int devind); #if 0 -FORWARD void report_vga(int devind); +static void report_vga(int devind); #endif -FORWARD char *pci_vid_name(u16_t vid); -FORWARD char *pci_baseclass_name(u8_t baseclass); -FORWARD char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t +static char *pci_vid_name(u16_t vid); +static char *pci_baseclass_name(u8_t baseclass); +static char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass); -FORWARD void ntostr(unsigned n, char **str, char *end); - -FORWARD u8_t pci_attr_r8_u(int devind, int port); -FORWARD u32_t pci_attr_r32_u(int devind, int port); - -FORWARD u16_t pci_attr_rsts(int devind); -FORWARD void pci_attr_wsts(int devind, u16_t value); -FORWARD u16_t pcibr_std_rsts(int busind); -FORWARD void pcibr_std_wsts(int busind, u16_t value); -FORWARD u16_t pcibr_cb_rsts(int busind); -FORWARD void pcibr_cb_wsts(int busind, u16_t value); -FORWARD u16_t pcibr_via_rsts(int busind); -FORWARD void pcibr_via_wsts(int busind, u16_t value); -FORWARD u8_t pcii_rreg8(int busind, int devind, int port); -FORWARD u16_t pcii_rreg16(int busind, int devind, int port); -FORWARD u32_t pcii_rreg32(int busind, int devind, int port); -FORWARD void pcii_wreg8(int busind, int devind, int port, u8_t value); -FORWARD void pcii_wreg16(int busind, int devind, int port, u16_t value); -FORWARD void pcii_wreg32(int busind, int devind, int port, u32_t value); -FORWARD u16_t pcii_rsts(int busind); -FORWARD void pcii_wsts(int busind, u16_t value); -FORWARD void print_capabilities(int devind); -FORWARD int visible(struct rs_pci *aclp, int devind); -FORWARD void print_hyper_cap(int devind, u8_t capptr); - -PRIVATE struct machine machine; -PRIVATE endpoint_t acpi_ep; +static void ntostr(unsigned n, char **str, char *end); + +static u8_t pci_attr_r8_u(int devind, int port); +static u32_t pci_attr_r32_u(int devind, int port); + +static u16_t pci_attr_rsts(int devind); +static void pci_attr_wsts(int devind, u16_t value); +static u16_t pcibr_std_rsts(int busind); +static void pcibr_std_wsts(int busind, u16_t value); +static u16_t pcibr_cb_rsts(int busind); +static void pcibr_cb_wsts(int busind, u16_t value); +static u16_t pcibr_via_rsts(int busind); +static void pcibr_via_wsts(int busind, u16_t value); +static u8_t pcii_rreg8(int busind, int devind, int port); +static u16_t pcii_rreg16(int busind, int devind, int port); +static u32_t pcii_rreg32(int busind, int devind, int port); +static void pcii_wreg8(int busind, int devind, int port, u8_t value); +static void pcii_wreg16(int busind, int devind, int port, u16_t value); +static void pcii_wreg32(int busind, int devind, int port, u32_t value); +static u16_t pcii_rsts(int busind); +static void pcii_wsts(int busind, u16_t value); +static void print_capabilities(int devind); +static int visible(struct rs_pci *aclp, int devind); +static void print_hyper_cap(int devind, u8_t capptr); + +static struct machine machine; +static endpoint_t acpi_ep; /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info) +int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the pci driver. */ long v; @@ -195,7 +195,7 @@ PUBLIC int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * map_service * *===========================================================================*/ -PUBLIC int map_service(rpub) +int map_service(rpub) struct rprocpub *rpub; { /* Map a new service by registering a new acl entry if required. */ @@ -229,38 +229,38 @@ struct rprocpub *rpub; /*===========================================================================* * helper functions for I/O * *===========================================================================*/ -PUBLIC unsigned pci_inb(u16_t port) { +unsigned pci_inb(u16_t port) { u32_t value; int s; if ((s=sys_inb(port, &value)) !=OK) printf("PCI: warning, sys_inb failed: %d\n", s); return value; } -PUBLIC unsigned pci_inw(u16_t port) { +unsigned pci_inw(u16_t port) { u32_t value; int s; if ((s=sys_inw(port, &value)) !=OK) printf("PCI: warning, sys_inw failed: %d\n", s); return value; } -PUBLIC unsigned pci_inl(u16_t port) { +unsigned pci_inl(u16_t port) { u32_t value; int s; if ((s=sys_inl(port, &value)) !=OK) printf("PCI: warning, sys_inl failed: %d\n", s); return value; } -PUBLIC void pci_outb(u16_t port, u8_t value) { +void pci_outb(u16_t port, u8_t value) { int s; if ((s=sys_outb(port, value)) !=OK) printf("PCI: warning, sys_outb failed: %d\n", s); } -PUBLIC void pci_outw(u16_t port, u16_t value) { +void pci_outw(u16_t port, u16_t value) { int s; if ((s=sys_outw(port, value)) !=OK) printf("PCI: warning, sys_outw failed: %d\n", s); } -PUBLIC void pci_outl(u16_t port, u32_t value) { +void pci_outl(u16_t port, u32_t value) { int s; if ((s=sys_outl(port, value)) !=OK) printf("PCI: warning, sys_outl failed: %d\n", s); @@ -269,7 +269,7 @@ PUBLIC void pci_outl(u16_t port, u32_t value) { /*===========================================================================* * pci_find_dev * *===========================================================================*/ -PUBLIC int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) +int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) { int devind; @@ -295,7 +295,7 @@ PUBLIC int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) /*===========================================================================* * pci_first_dev_a * *===========================================================================*/ -PUBLIC int pci_first_dev_a( +int pci_first_dev_a( struct rs_pci *aclp, int *devindp, u16_t *vidp, @@ -325,7 +325,7 @@ PUBLIC int pci_first_dev_a( /*===========================================================================* * pci_next_dev * *===========================================================================*/ -PUBLIC int pci_next_dev_a( +int pci_next_dev_a( struct rs_pci *aclp, int *devindp, u16_t *vidp, @@ -355,7 +355,7 @@ PUBLIC int pci_next_dev_a( /*===========================================================================* * pci_reserve_a * *===========================================================================*/ -PUBLIC int pci_reserve_a(devind, proc, aclp) +int pci_reserve_a(devind, proc, aclp) int devind; endpoint_t proc; struct rs_pci *aclp; @@ -439,7 +439,7 @@ struct rs_pci *aclp; /*===========================================================================* * pci_release * *===========================================================================*/ -PUBLIC void pci_release(proc) +void pci_release(proc) endpoint_t proc; { int i; @@ -457,7 +457,7 @@ endpoint_t proc; /*===========================================================================* * pci_ids_s * *===========================================================================*/ -PUBLIC int pci_ids_s(int devind, u16_t *vidp, u16_t *didp) +int pci_ids_s(int devind, u16_t *vidp, u16_t *didp) { if (devind < 0 || devind >= nr_pcidev) return EINVAL; @@ -470,7 +470,7 @@ PUBLIC int pci_ids_s(int devind, u16_t *vidp, u16_t *didp) /*===========================================================================* * pci_rescan_bus * *===========================================================================*/ -PUBLIC void pci_rescan_bus(u8_t busnr) +void pci_rescan_bus(u8_t busnr) { int busind; @@ -487,7 +487,7 @@ PUBLIC void pci_rescan_bus(u8_t busnr) /*===========================================================================* * pci_slot_name_s * *===========================================================================*/ -PUBLIC int pci_slot_name_s(devind, cpp) +int pci_slot_name_s(devind, cpp) int devind; char **cpp; { @@ -516,7 +516,7 @@ char **cpp; /*===========================================================================* * pci_dev_name * *===========================================================================*/ -PUBLIC char *pci_dev_name(u16_t vid, u16_t did) +char *pci_dev_name(u16_t vid, u16_t did) { int i; @@ -534,7 +534,7 @@ PUBLIC char *pci_dev_name(u16_t vid, u16_t did) /*===========================================================================* * pci_get_bar_s * *===========================================================================*/ -PUBLIC int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size, +int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size, int *ioflag) { int i, reg; @@ -564,7 +564,7 @@ PUBLIC int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size, /*===========================================================================* * pci_attr_r8_s * *===========================================================================*/ -PUBLIC int pci_attr_r8_s(int devind, int port, u8_t *vp) +int pci_attr_r8_s(int devind, int port, u8_t *vp) { if (devind < 0 || devind >= nr_pcidev) return EINVAL; @@ -578,7 +578,7 @@ PUBLIC int pci_attr_r8_s(int devind, int port, u8_t *vp) /*===========================================================================* * pci_attr_r8_u * *===========================================================================*/ -PRIVATE u8_t pci_attr_r8_u(devind, port) +static u8_t pci_attr_r8_u(devind, port) int devind; int port; { @@ -592,7 +592,7 @@ int port; /*===========================================================================* * pci_attr_r16 * *===========================================================================*/ -PUBLIC u16_t pci_attr_r16(devind, port) +u16_t pci_attr_r16(devind, port) int devind; int port; { @@ -606,7 +606,7 @@ int port; /*===========================================================================* * pci_attr_r32_s * *===========================================================================*/ -PUBLIC int pci_attr_r32_s(int devind, int port, u32_t *vp) +int pci_attr_r32_s(int devind, int port, u32_t *vp) { if (devind < 0 || devind >= nr_pcidev) return EINVAL; @@ -620,7 +620,7 @@ PUBLIC int pci_attr_r32_s(int devind, int port, u32_t *vp) /*===========================================================================* * pci_attr_r32_u * *===========================================================================*/ -PRIVATE u32_t pci_attr_r32_u(devind, port) +static u32_t pci_attr_r32_u(devind, port) int devind; int port; { @@ -634,7 +634,7 @@ int port; /*===========================================================================* * pci_attr_w8 * *===========================================================================*/ -PUBLIC void pci_attr_w8(int devind, int port, u8_t value) +void pci_attr_w8(int devind, int port, u8_t value) { int busnr, busind; @@ -646,7 +646,7 @@ PUBLIC void pci_attr_w8(int devind, int port, u8_t value) /*===========================================================================* * pci_attr_w16 * *===========================================================================*/ -PUBLIC void pci_attr_w16(int devind, int port, u16_t value) +void pci_attr_w16(int devind, int port, u16_t value) { int busnr, busind; @@ -658,7 +658,7 @@ PUBLIC void pci_attr_w16(int devind, int port, u16_t value) /*===========================================================================* * pci_attr_w32 * *===========================================================================*/ -PUBLIC void pci_attr_w32(int devind, int port, u32_t value) +void pci_attr_w32(int devind, int port, u32_t value) { int busnr, busind; @@ -670,7 +670,7 @@ PUBLIC void pci_attr_w32(int devind, int port, u32_t value) /*===========================================================================* * pci_intel_init * *===========================================================================*/ -PRIVATE void pci_intel_init() +static void pci_intel_init() { /* Try to detect a know PCI controller. Read the Vendor ID and * the Device ID for function 0 of device 0. @@ -770,7 +770,7 @@ PRIVATE void pci_intel_init() /*===========================================================================* * probe_bus * *===========================================================================*/ -PRIVATE void probe_bus(int busind) +static void probe_bus(int busind) { u32_t dev, func, t3; u16_t vid, did, sts; @@ -927,7 +927,7 @@ PRIVATE void probe_bus(int busind) /*===========================================================================* * is_duplicate * *===========================================================================*/ -PRIVATE int is_duplicate(u8_t busnr, u8_t dev, u8_t func) +static int is_duplicate(u8_t busnr, u8_t dev, u8_t func) { int i; @@ -943,7 +943,7 @@ PRIVATE int is_duplicate(u8_t busnr, u8_t dev, u8_t func) return 0; } -PRIVATE int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin) +static int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin) { int err; message m; @@ -959,7 +959,7 @@ PRIVATE int acpi_get_irq(unsigned bus, unsigned dev, unsigned pin) return ((struct acpi_get_irq_resp *)&m)->irq; } -PRIVATE int derive_irq(struct pcidev * dev, int pin) +static int derive_irq(struct pcidev * dev, int pin) { struct pcidev * parent_bridge; int slot; @@ -979,7 +979,7 @@ PRIVATE int derive_irq(struct pcidev * dev, int pin) /*===========================================================================* * record_irq * *===========================================================================*/ -PRIVATE void record_irq(devind) +static void record_irq(devind) int devind; { int ilr, ipr, busnr, busind, cb_devind; @@ -1078,7 +1078,7 @@ int devind; /*===========================================================================* * record_bars_normal * *===========================================================================*/ -PRIVATE void record_bars_normal(devind) +static void record_bars_normal(devind) int devind; { int i, j, clear_01, clear_23, pb_nr; @@ -1142,7 +1142,7 @@ int devind; /*===========================================================================* * record_bars_bridge * *===========================================================================*/ -PRIVATE void record_bars_bridge(devind) +static void record_bars_bridge(devind) int devind; { u32_t base, limit, size; @@ -1194,7 +1194,7 @@ int devind; /*===========================================================================* * record_bars_cardbus * *===========================================================================*/ -PRIVATE void record_bars_cardbus(devind) +static void record_bars_cardbus(devind) int devind; { u32_t base, limit, size; @@ -1246,7 +1246,7 @@ int devind; /*===========================================================================* * record_bars * *===========================================================================*/ -PRIVATE void record_bars(int devind, int last_reg) +static void record_bars(int devind, int last_reg) { int i, reg, width; @@ -1259,7 +1259,7 @@ PRIVATE void record_bars(int devind, int last_reg) /*===========================================================================* * record_bar * *===========================================================================*/ -PRIVATE int record_bar(devind, bar_nr, last) +static int record_bar(devind, bar_nr, last) int devind; int bar_nr; int last; @@ -1405,7 +1405,7 @@ int last; /*===========================================================================* * complete_bridges * *===========================================================================*/ -PRIVATE void complete_bridges() +static void complete_bridges() { int i, freebus, devind, prim_busnr; @@ -1446,7 +1446,7 @@ PRIVATE void complete_bridges() /*===========================================================================* * complete_bars * *===========================================================================*/ -PRIVATE void complete_bars(void) +static void complete_bars(void) { int i, j, r, bar_nr, reg; u32_t memgap_low, memgap_high, iogap_low, iogap_high, io_high, @@ -1670,7 +1670,7 @@ bad_mem_string: /*===========================================================================* * update_bridge4dev_io * *===========================================================================*/ -PRIVATE void update_bridge4dev_io( +static void update_bridge4dev_io( int devind, u32_t io_base, u32_t io_size @@ -1710,7 +1710,7 @@ PRIVATE void update_bridge4dev_io( /*===========================================================================* * get_freebus * *===========================================================================*/ -PRIVATE int get_freebus() +static int get_freebus() { int i, freebus; @@ -1731,7 +1731,7 @@ PRIVATE int get_freebus() /*===========================================================================* * do_isabridge * *===========================================================================*/ -PRIVATE int do_isabridge(busind) +static int do_isabridge(busind) int busind; { int i, j, r, type, busnr, unknown_bridge, bridge_dev; @@ -1840,7 +1840,7 @@ int busind; * (pbnr) must be already known to acpi and it must map dev as the connection to * the secondary (sbnr) bus */ -PRIVATE void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr) +static void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr) { int err; message m; @@ -1861,7 +1861,7 @@ PRIVATE void acpi_map_bridge(unsigned pbnr, unsigned dev, unsigned sbnr) /*===========================================================================* * do_pcibridge * *===========================================================================*/ -PRIVATE void do_pcibridge(busind) +static void do_pcibridge(busind) int busind; { int i, devind, busnr; @@ -2015,7 +2015,7 @@ int busind; /*===========================================================================* * get_busind * *===========================================================================*/ -PRIVATE int get_busind(busnr) +static int get_busind(busnr) int busnr; { int i; @@ -2031,7 +2031,7 @@ int busnr; /*===========================================================================* * do_piix * *===========================================================================*/ -PRIVATE int do_piix(int devind) +static int do_piix(int devind) { int i, s, irqrc, irq; u32_t elcr1, elcr2, elcr; @@ -2075,7 +2075,7 @@ PRIVATE int do_piix(int devind) /*===========================================================================* * do_amd_isabr * *===========================================================================*/ -PRIVATE int do_amd_isabr(int devind) +static int do_amd_isabr(int devind) { int i, busnr, dev, func, xdevind, irq, edge; u8_t levmask; @@ -2127,7 +2127,7 @@ PRIVATE int do_amd_isabr(int devind) /*===========================================================================* * do_sis_isabr * *===========================================================================*/ -PRIVATE int do_sis_isabr(int devind) +static int do_sis_isabr(int devind) { int i, irq; @@ -2154,7 +2154,7 @@ PRIVATE int do_sis_isabr(int devind) /*===========================================================================* * do_via_isabr * *===========================================================================*/ -PRIVATE int do_via_isabr(int devind) +static int do_via_isabr(int devind) { int i, irq, edge; u8_t levmask; @@ -2212,7 +2212,7 @@ PRIVATE int do_via_isabr(int devind) /*===========================================================================* * report_vga * *===========================================================================*/ -PRIVATE void report_vga(devind) +static void report_vga(devind) int devind; { /* Report the amount of video memory. This is needed by the X11R6 @@ -2247,7 +2247,7 @@ int devind; /*===========================================================================* * pci_vid_name * *===========================================================================*/ -PRIVATE char *pci_vid_name(u16_t vid) +static char *pci_vid_name(u16_t vid) { int i; @@ -2262,7 +2262,7 @@ PRIVATE char *pci_vid_name(u16_t vid) /*===========================================================================* * pci_baseclass_name * *===========================================================================*/ -PRIVATE char *pci_baseclass_name(u8_t baseclass) +static char *pci_baseclass_name(u8_t baseclass) { int i; @@ -2277,7 +2277,7 @@ PRIVATE char *pci_baseclass_name(u8_t baseclass) /*===========================================================================* * pci_subclass_name * *===========================================================================*/ -PRIVATE char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass) +static char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass) { int i; @@ -2300,7 +2300,7 @@ PRIVATE char *pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass) /*===========================================================================* * ntostr * *===========================================================================*/ -PRIVATE void ntostr(n, str, end) +static void ntostr(n, str, end) unsigned n; char **str; char *end; @@ -2339,7 +2339,7 @@ char *end; /*===========================================================================* * pci_attr_rsts * *===========================================================================*/ -PRIVATE u16_t pci_attr_rsts(devind) +static u16_t pci_attr_rsts(devind) int devind; { int busnr, busind; @@ -2353,7 +2353,7 @@ int devind; /*===========================================================================* * pcibr_std_rsts * *===========================================================================*/ -PRIVATE u16_t pcibr_std_rsts(busind) +static u16_t pcibr_std_rsts(busind) int busind; { int devind; @@ -2365,7 +2365,7 @@ int busind; /*===========================================================================* * pcibr_std_wsts * *===========================================================================*/ -PRIVATE void pcibr_std_wsts(int busind, u16_t value) +static void pcibr_std_wsts(int busind, u16_t value) { int devind; devind= pcibus[busind].pb_devind; @@ -2380,7 +2380,7 @@ PRIVATE void pcibr_std_wsts(int busind, u16_t value) /*===========================================================================* * pcibr_cb_rsts * *===========================================================================*/ -PRIVATE u16_t pcibr_cb_rsts(busind) +static u16_t pcibr_cb_rsts(busind) int busind; { int devind; @@ -2392,7 +2392,7 @@ int busind; /*===========================================================================* * pcibr_cb_wsts * *===========================================================================*/ -PRIVATE void pcibr_cb_wsts(int busind, u16_t value) +static void pcibr_cb_wsts(int busind, u16_t value) { int devind; devind= pcibus[busind].pb_devind; @@ -2407,7 +2407,7 @@ PRIVATE void pcibr_cb_wsts(int busind, u16_t value) /*===========================================================================* * pcibr_via_rsts * *===========================================================================*/ -PRIVATE u16_t pcibr_via_rsts(int busind) +static u16_t pcibr_via_rsts(int busind) { return 0; } @@ -2415,7 +2415,7 @@ PRIVATE u16_t pcibr_via_rsts(int busind) /*===========================================================================* * pcibr_via_wsts * *===========================================================================*/ -PRIVATE void pcibr_via_wsts(int busind, u16_t value) +static void pcibr_via_wsts(int busind, u16_t value) { int devind; devind= pcibus[busind].pb_devind; @@ -2429,7 +2429,7 @@ PRIVATE void pcibr_via_wsts(int busind, u16_t value) /*===========================================================================* * pci_attr_wsts * *===========================================================================*/ -PRIVATE void pci_attr_wsts(int devind, u16_t value) +static void pci_attr_wsts(int devind, u16_t value) { int busnr, busind; @@ -2442,7 +2442,7 @@ PRIVATE void pci_attr_wsts(int devind, u16_t value) /*===========================================================================* * pcii_rreg8 * *===========================================================================*/ -PRIVATE u8_t pcii_rreg8(busind, devind, port) +static u8_t pcii_rreg8(busind, devind, port) int busind; int devind; int port; @@ -2467,7 +2467,7 @@ int port; /*===========================================================================* * pcii_rreg16 * *===========================================================================*/ -PRIVATE u16_t pcii_rreg16(int busind, int devind, int port) +static u16_t pcii_rreg16(int busind, int devind, int port) { u16_t v; int s; @@ -2489,7 +2489,7 @@ PRIVATE u16_t pcii_rreg16(int busind, int devind, int port) /*===========================================================================* * pcii_rreg32 * *===========================================================================*/ -PRIVATE u32_t pcii_rreg32(int busind, int devind, int port) +static u32_t pcii_rreg32(int busind, int devind, int port) { u32_t v; int s; @@ -2511,7 +2511,7 @@ PRIVATE u32_t pcii_rreg32(int busind, int devind, int port) /*===========================================================================* * pcii_wreg8 * *===========================================================================*/ -PRIVATE void pcii_wreg8( +static void pcii_wreg8( int busind, int devind, int port, @@ -2535,7 +2535,7 @@ PRIVATE void pcii_wreg8( /*===========================================================================* * pcii_wreg16 * *===========================================================================*/ -PRIVATE void pcii_wreg16( +static void pcii_wreg16( int busind, int devind, int port, @@ -2559,7 +2559,7 @@ PRIVATE void pcii_wreg16( /*===========================================================================* * pcii_wreg32 * *===========================================================================*/ -PRIVATE void pcii_wreg32( +static void pcii_wreg32( int busind, int devind, int port, @@ -2583,7 +2583,7 @@ PRIVATE void pcii_wreg32( /*===========================================================================* * pcii_rsts * *===========================================================================*/ -PRIVATE u16_t pcii_rsts(int busind) +static u16_t pcii_rsts(int busind) { u16_t v; int s; @@ -2597,7 +2597,7 @@ PRIVATE u16_t pcii_rsts(int busind) /*===========================================================================* * pcii_wsts * *===========================================================================*/ -PRIVATE void pcii_wsts(int busind, u16_t value) +static void pcii_wsts(int busind, u16_t value) { int s; PCII_WREG16_(pcibus[busind].pb_busnr, 0, 0, PCI_SR, value); @@ -2609,7 +2609,7 @@ PRIVATE void pcii_wsts(int busind, u16_t value) /*===========================================================================* * print_capabilities * *===========================================================================*/ -PRIVATE void print_capabilities(int devind) +static void print_capabilities(int devind) { u8_t status, capptr, type, next, subtype; char *str; @@ -2661,7 +2661,7 @@ PRIVATE void print_capabilities(int devind) /*===========================================================================* * visible * *===========================================================================*/ -PRIVATE int visible(aclp, devind) +static int visible(aclp, devind) struct rs_pci *aclp; int devind; { @@ -2703,7 +2703,7 @@ int devind; /*===========================================================================* * print_hyper_cap * *===========================================================================*/ -PRIVATE void print_hyper_cap(int devind, u8_t capptr) +static void print_hyper_cap(int devind, u8_t capptr) { u32_t v; u16_t cmd; diff --git a/drivers/printer/liveupdate.c b/drivers/printer/liveupdate.c index d0666d548..1f3655569 100644 --- a/drivers/printer/liveupdate.c +++ b/drivers/printer/liveupdate.c @@ -11,7 +11,7 @@ EXTERN int is_status_msg_expected; /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -40,7 +40,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || PR_STATE_IS_CUSTOM(state); } @@ -48,7 +48,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { sef_lu_dprint("printer: live update state = %d\n", state); sef_lu_dprint("printer: writing = %d\n", writing); diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 6a2caf09e..13067fbb1 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -86,44 +86,44 @@ * with the sys_outb() messages exchanged. */ -PRIVATE endpoint_t caller; /* process to tell when printing done (FS) */ -PRIVATE int revive_pending; /* set to true if revive is pending */ -PRIVATE int revive_status; /* revive status */ -PRIVATE int done_status; /* status of last output completion */ -PRIVATE int oleft; /* bytes of output left in obuf */ -PRIVATE unsigned char obuf[128]; /* output buffer */ -PRIVATE unsigned const char *optr; /* ptr to next char in obuf to print */ -PRIVATE int orig_count; /* original byte count */ -PRIVATE int port_base; /* I/O port for printer */ -PRIVATE endpoint_t proc_nr; /* user requesting the printing */ -PRIVATE cp_grant_id_t grant_nr; /* grant on which print happens */ -PRIVATE int user_left; /* bytes of output left in user buf */ -PRIVATE vir_bytes user_vir_d; /* offset in user buf */ -PUBLIC int writing; /* nonzero while write is in progress */ -PRIVATE int irq_hook_id; /* id of irq hook at kernel */ - -FORWARD void do_cancel(message *m_ptr); -FORWARD void output_done(void); -FORWARD void do_write(message *m_ptr); -FORWARD void do_status(message *m_ptr); -FORWARD void prepare_output(void); -FORWARD int do_probe(void); -FORWARD void do_initialize(void); -FORWARD void reply(int code,int replyee,int proc,int status); -FORWARD void do_printer_output(void); +static endpoint_t caller; /* process to tell when printing done (FS) */ +static int revive_pending; /* set to true if revive is pending */ +static int revive_status; /* revive status */ +static int done_status; /* status of last output completion */ +static int oleft; /* bytes of output left in obuf */ +static unsigned char obuf[128]; /* output buffer */ +static unsigned const char *optr; /* ptr to next char in obuf to print */ +static int orig_count; /* original byte count */ +static int port_base; /* I/O port for printer */ +static endpoint_t proc_nr; /* user requesting the printing */ +static cp_grant_id_t grant_nr; /* grant on which print happens */ +static int user_left; /* bytes of output left in user buf */ +static vir_bytes user_vir_d; /* offset in user buf */ +int writing; /* nonzero while write is in progress */ +static int irq_hook_id; /* id of irq hook at kernel */ + +static void do_cancel(message *m_ptr); +static void output_done(void); +static void do_write(message *m_ptr); +static void do_status(message *m_ptr); +static void prepare_output(void); +static int do_probe(void); +static void do_initialize(void); +static void reply(int code,int replyee,int proc,int status); +static void do_printer_output(void); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); -PUBLIC int is_status_msg_expected = FALSE; +int is_status_msg_expected = FALSE; /*===========================================================================* * printer_task * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* Main routine of the printer task. */ message pr_mess; /* buffer for all incoming messages */ @@ -169,7 +169,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -191,7 +191,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the printer driver. */ @@ -208,7 +208,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * do_write * *===========================================================================*/ -PRIVATE void do_write(m_ptr) +static void do_write(m_ptr) register message *m_ptr; /* pointer to the newly arrived message */ { /* The printer is used by sending DEV_WRITE messages to it. Process one. */ @@ -260,7 +260,7 @@ register message *m_ptr; /* pointer to the newly arrived message */ /*===========================================================================* * output_done * *===========================================================================*/ -PRIVATE void output_done() +static void output_done() { /* Previous chunk of printing is finished. Continue if OK and more. * Otherwise, reply to caller (FS). @@ -300,7 +300,7 @@ PRIVATE void output_done() /*===========================================================================* * do_status * *===========================================================================*/ -PRIVATE void do_status(m_ptr) +static void do_status(m_ptr) register message *m_ptr; /* pointer to the newly arrived message */ { if (revive_pending) { @@ -322,7 +322,7 @@ register message *m_ptr; /* pointer to the newly arrived message */ /*===========================================================================* * do_cancel * *===========================================================================*/ -PRIVATE void do_cancel(m_ptr) +static void do_cancel(m_ptr) register message *m_ptr; /* pointer to the newly arrived message */ { /* Cancel a print request that has already started. Usually this means that @@ -342,7 +342,7 @@ register message *m_ptr; /* pointer to the newly arrived message */ /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply(code, replyee, process, status) +static void reply(code, replyee, process, status) int code; /* TASK_REPLY or REVIVE */ int replyee; /* destination for message (normally FS) */ int process; /* which user requested the printing */ @@ -361,7 +361,7 @@ int status; /* number of chars printed or error code */ /*===========================================================================* * do_probe * *===========================================================================*/ -PRIVATE int do_probe(void) +static int do_probe(void) { /* See if there is a printer at all. */ @@ -378,7 +378,7 @@ PRIVATE int do_probe(void) /*===========================================================================* * do_initialize * *===========================================================================*/ -PRIVATE void do_initialize() +static void do_initialize() { /* Set global variables and initialize the printer. */ static int initialized = FALSE; @@ -404,7 +404,7 @@ PRIVATE void do_initialize() /*==========================================================================* * prepare_output * *==========================================================================*/ -PRIVATE void prepare_output() +static void prepare_output() { /* Start next chunk of printer output. Fetch the data from user space. */ int s; @@ -427,7 +427,7 @@ PRIVATE void prepare_output() /*===========================================================================* * do_printer_output * *===========================================================================*/ -PRIVATE void do_printer_output() +static void do_printer_output() { /* This function does the actual output to the printer. This is called on an * interrupt message sent from the generic interrupt handler that 'forwards' diff --git a/drivers/random/main.c b/drivers/random/main.c index 74c35d7dd..ff9c8649a 100644 --- a/drivers/random/main.c +++ b/drivers/random/main.c @@ -15,21 +15,21 @@ #define KRANDOM_PERIOD 1 /* ticks between krandom calls */ -PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */ -PRIVATE dev_t m_device; /* current device */ +static struct device m_geom[NR_DEVS]; /* base and size of each device */ +static dev_t m_device; /* current device */ extern int errno; /* error number for PM calls */ -FORWARD struct device *r_prepare(dev_t device); -FORWARD int r_transfer(endpoint_t endpt, int opcode, u64_t position, +static struct device *r_prepare(dev_t device); +static int r_transfer(endpoint_t endpt, int opcode, u64_t position, iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int flags); -FORWARD int r_do_open(message *m_ptr); -FORWARD void r_random(message *m_ptr); -FORWARD void r_updatebin(int source, struct k_randomness_bin *rb); +static int r_do_open(message *m_ptr); +static void r_random(message *m_ptr); +static void r_updatebin(int source, struct k_randomness_bin *rb); /* Entry points to this driver. */ -PRIVATE struct chardriver r_dtab = { +static struct chardriver r_dtab = { r_do_open, /* open or mount */ do_nop, /* nothing on a close */ nop_ioctl, /* no I/O controls supported */ @@ -44,16 +44,16 @@ PRIVATE struct chardriver r_dtab = { /* Buffer for the /dev/random number generator. */ #define RANDOM_BUF_SIZE 1024 -PRIVATE char random_buf[RANDOM_BUF_SIZE]; +static char random_buf[RANDOM_BUF_SIZE]; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* SEF local startup. */ sef_local_startup(); @@ -67,7 +67,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -85,7 +85,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the random driver. */ static struct k_randomness krandom; @@ -122,7 +122,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * r_prepare * *===========================================================================*/ -PRIVATE struct device *r_prepare(dev_t device) +static struct device *r_prepare(dev_t device) { /* Prepare for I/O on a device: check if the minor device number is ok. */ @@ -135,7 +135,7 @@ PRIVATE struct device *r_prepare(dev_t device) /*===========================================================================* * r_transfer * *===========================================================================*/ -PRIVATE int r_transfer( +static int r_transfer( endpoint_t endpt, /* endpoint of grant owner */ int opcode, /* DEV_GATHER or DEV_SCATTER */ u64_t position, /* offset on device to read or write */ @@ -212,7 +212,7 @@ PRIVATE int r_transfer( /*===========================================================================* * r_do_open * *===========================================================================*/ -PRIVATE int r_do_open(message *m_ptr) +static int r_do_open(message *m_ptr) { /* Check device number on open. */ @@ -239,7 +239,7 @@ PRIVATE int r_do_open(message *m_ptr) /*===========================================================================* * r_updatebin * *===========================================================================*/ -PRIVATE void r_updatebin(int source, struct k_randomness_bin *rb) +static void r_updatebin(int source, struct k_randomness_bin *rb) { int r_next, r_size, r_high; @@ -265,7 +265,7 @@ PRIVATE void r_updatebin(int source, struct k_randomness_bin *rb) /*===========================================================================* * r_random * *===========================================================================*/ -PRIVATE void r_random(message *UNUSED(m_ptr)) +static void r_random(message *UNUSED(m_ptr)) { /* Fetch random information from the kernel to update /dev/random. */ int s; diff --git a/drivers/random/random.c b/drivers/random/random.c index 350d9d33f..7973b12fa 100644 --- a/drivers/random/random.c +++ b/drivers/random/random.c @@ -25,20 +25,20 @@ that data into a seed for a psuedo random number generator. * re-seed. */ -PRIVATE unsigned long deriv[TOTAL_SOURCES][N_DERIV]; -PRIVATE int pool_ind[TOTAL_SOURCES]; -PRIVATE SHA256_CTX pool_ctx[NR_POOLS]; -PRIVATE unsigned samples= 0; -PRIVATE int got_seeded= 0; -PRIVATE u8_t random_key[2*AES_BLOCKSIZE]; -PRIVATE u32_t count_lo, count_hi; -PRIVATE u32_t reseed_count; - -FORWARD void add_sample(int source, unsigned long sample); -FORWARD void data_block(rd_keyinstance *keyp, void *data); -FORWARD void reseed(void); - -PUBLIC void random_init() +static unsigned long deriv[TOTAL_SOURCES][N_DERIV]; +static int pool_ind[TOTAL_SOURCES]; +static SHA256_CTX pool_ctx[NR_POOLS]; +static unsigned samples= 0; +static int got_seeded= 0; +static u8_t random_key[2*AES_BLOCKSIZE]; +static u32_t count_lo, count_hi; +static u32_t reseed_count; + +static void add_sample(int source, unsigned long sample); +static void data_block(rd_keyinstance *keyp, void *data); +static void reseed(void); + +void random_init() { int i, j; @@ -58,14 +58,14 @@ PUBLIC void random_init() reseed_count= 0; } -PUBLIC int random_isseeded() +int random_isseeded() { if (got_seeded) return 1; return 0; } -PUBLIC void random_update(source, buf, count) +void random_update(source, buf, count) int source; rand_t *buf; int count; @@ -82,7 +82,7 @@ int count; reseed(); } -PUBLIC void random_getbytes(buf, size) +void random_getbytes(buf, size) void *buf; size_t size; { @@ -116,7 +116,7 @@ size_t size; data_block(&key, random_key+AES_BLOCKSIZE); } -PUBLIC void random_putbytes(buf, size) +void random_putbytes(buf, size) void *buf; size_t size; { @@ -131,7 +131,7 @@ size_t size; reseed(); } -PRIVATE void add_sample(source, sample) +static void add_sample(source, sample) int source; unsigned long sample; { @@ -182,7 +182,7 @@ unsigned long sample; pool_ind[source]= pool_nr; } -PRIVATE void data_block(keyp, data) +static void data_block(keyp, data) rd_keyinstance *keyp; void *data; { @@ -207,7 +207,7 @@ void *data; count_hi++; } -PRIVATE void reseed() +static void reseed() { int i; SHA256_CTX ctx; diff --git a/drivers/readclock/readclock.c b/drivers/readclock/readclock.c index 49d203d0b..70728b395 100644 --- a/drivers/readclock/readclock.c +++ b/drivers/readclock/readclock.c @@ -83,7 +83,7 @@ int dec_to_bcd(int n); void usage(void); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); int main(int argc, char **argv) { @@ -201,7 +201,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/drivers/rtl8139/liveupdate.c b/drivers/rtl8139/liveupdate.c index fc43d5bcf..9baaab8c0 100644 --- a/drivers/rtl8139/liveupdate.c +++ b/drivers/rtl8139/liveupdate.c @@ -10,10 +10,10 @@ EXTERN re_t re_state; ((s) >= RL_STATE_READ_PROTOCOL_FREE && (s) <= RL_STATE_WRITE_PROTOCOL_FREE) /* State management helpers. */ -PRIVATE int is_reading; -PRIVATE int is_writing; +static int is_reading; +static int is_writing; -PRIVATE void load_state_info(void) +static void load_state_info(void) { re_t *rep; @@ -27,7 +27,7 @@ PRIVATE void load_state_info(void) /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -63,7 +63,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || RL_STATE_IS_CUSTOM(state); } @@ -71,7 +71,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { /* Load state information. */ load_state_info(); diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 1b9d98f83..100312b01 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -16,7 +16,7 @@ #include "rtl8139.h" -PUBLIC re_t re_state; +re_t re_state; static int re_instance; @@ -98,15 +98,15 @@ static void tell_dev(vir_bytes start, size_t size, int pci_bus, int /* The message used in the main loop is made global, so that rl_watchdog_f() * can change its message type to fake an interrupt message. */ -PRIVATE message m; -PRIVATE int int_event_check; /* set to TRUE if events arrived */ +static message m; +static int int_event_check; /* set to TRUE if events arrived */ -PRIVATE u32_t system_hz; +static u32_t system_hz; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -200,7 +200,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the rtl8139 driver. */ long v; @@ -233,7 +233,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { re_t *rep; @@ -2231,7 +2231,7 @@ dpeth_t *dep; } #endif -PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func) +static void tell_dev(buf, size, pci_bus, pci_dev, pci_func) vir_bytes buf; size_t size; int pci_bus; diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 54eab23cc..20abcfbe6 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -232,15 +232,15 @@ static void rl_watchdog_f(timer_t *tp); * The message used in the main loop is made global, so that rl_watchdog_f() * can change its message type to fake an interrupt message. */ -PRIVATE message m; -PRIVATE int int_event_check; /* set to TRUE if events arrived */ +static message m; +static int int_event_check; /* set to TRUE if events arrived */ u32_t system_hz; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * @@ -303,7 +303,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -324,7 +324,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) { /* Initialize the rtl8169 driver. */ long v; @@ -347,7 +347,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { re_t *rep; diff --git a/drivers/ti1225/ti1225.c b/drivers/ti1225/ti1225.c index a44c6f835..49fa9e997 100644 --- a/drivers/ti1225/ti1225.c +++ b/drivers/ti1225/ti1225.c @@ -16,7 +16,7 @@ Created: Dec 2005 by Philip Homburg /* The use of interrupts is not yet ready for prime time */ #define USE_INTS 0 -PRIVATE struct port +static struct port { int p_devind; u8_t p_cb_busnr; @@ -28,16 +28,16 @@ PRIVATE struct port volatile struct csr *csr_ptr; } port; -PRIVATE int instance; -PRIVATE int debug; +static int instance; +static int debug; -FORWARD int hw_probe(int skip); -FORWARD void hw_init(struct port *pp, int devind); -FORWARD void do_int(struct port *pp); +static int hw_probe(int skip); +static void hw_init(struct port *pp, int devind); +static void do_int(struct port *pp); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); /*===========================================================================* * main * @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -84,7 +84,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the ti1225 driver. */ int r, devind; @@ -114,7 +114,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * hw_probe * *===========================================================================*/ -PRIVATE int hw_probe(int skip) +static int hw_probe(int skip) { u16_t vid, did; int devind; @@ -139,7 +139,7 @@ PRIVATE int hw_probe(int skip) /*===========================================================================* * hw_init * *===========================================================================*/ -PRIVATE void hw_init(struct port *pp, int devind) +static void hw_init(struct port *pp, int devind) { u8_t v8; u16_t v16; @@ -247,7 +247,7 @@ PRIVATE void hw_init(struct port *pp, int devind) /*===========================================================================* * do_int * *===========================================================================*/ -PRIVATE void do_int(struct port *pp) +static void do_int(struct port *pp) { int devind, vcc_5v, vcc_3v, vcc_Xv, vcc_Yv, socket_5v, socket_3v, socket_Xv, socket_Yv; diff --git a/drivers/tty/console.c b/drivers/tty/console.c index 91555edfa..5726d0a4c 100644 --- a/drivers/tty/console.c +++ b/drivers/tty/console.c @@ -38,33 +38,33 @@ #define TIMER_FREQ 1193182L /* clock frequency for timer in PC and AT */ /* Global variables used by the console driver and assembly support. */ -PRIVATE phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */ -PRIVATE phys_bytes vid_base; -PRIVATE unsigned vid_mask; /* 0x1FFF for color or 0x07FF for mono */ -PRIVATE unsigned blank_color = BLANK_COLOR; /* display code for blank */ +static phys_bytes vid_size; /* 0x2000 for color or 0x0800 for mono */ +static phys_bytes vid_base; +static unsigned vid_mask; /* 0x1FFF for color or 0x07FF for mono */ +static unsigned blank_color = BLANK_COLOR; /* display code for blank */ /* Private variables used by the console driver. */ -PRIVATE int vid_port; /* I/O port for accessing 6845 */ -PRIVATE int wrap; /* hardware can wrap? */ -PRIVATE int softscroll; /* 1 = software scrolling, 0 = hardware */ -PRIVATE int beeping; /* speaker is beeping? */ -PRIVATE unsigned font_lines; /* font lines per character */ -PRIVATE unsigned scr_width; /* # characters on a line */ -PRIVATE unsigned scr_lines; /* # lines on the screen */ -PRIVATE unsigned scr_size; /* # characters on the screen */ +static int vid_port; /* I/O port for accessing 6845 */ +static int wrap; /* hardware can wrap? */ +static int softscroll; /* 1 = software scrolling, 0 = hardware */ +static int beeping; /* speaker is beeping? */ +static unsigned font_lines; /* font lines per character */ +static unsigned scr_width; /* # characters on a line */ +static unsigned scr_lines; /* # lines on the screen */ +static unsigned scr_size; /* # characters on the screen */ /* tells mem_vid_copy() to blank the screen */ #define BLANK_MEM ((vir_bytes) 0) -PRIVATE int disabled_vc = -1; /* Virtual console that was active when +static int disabled_vc = -1; /* Virtual console that was active when * disable_console was called. */ -PRIVATE int disabled_sm; /* Scroll mode to be restored when re-enabling +static int disabled_sm; /* Scroll mode to be restored when re-enabling * console */ -PRIVATE char *console_memory = NULL; -PRIVATE char *font_memory = NULL; +static char *console_memory = NULL; +static char *font_memory = NULL; /* Per console data. */ typedef struct console { @@ -99,17 +99,17 @@ typedef struct console { set_6845(VID_ORG, ccons->c_org); \ } -PRIVATE int nr_cons= 1; /* actual number of consoles */ -PRIVATE console_t cons_table[NR_CONS]; -PRIVATE console_t *curcons = NULL; /* currently visible */ +static int nr_cons= 1; /* actual number of consoles */ +static console_t cons_table[NR_CONS]; +static console_t *curcons = NULL; /* currently visible */ -PRIVATE int shutting_down = FALSE; /* don't allow console switches */ +static int shutting_down = FALSE; /* don't allow console switches */ /* Color if using a color controller. */ #define color (vid_port == C_6845) /* Map from ANSI colors to the attributes used by the PC */ -PRIVATE int ansi_colors[8] = {0, 4, 2, 6, 1, 5, 3, 7}; +static int ansi_colors[8] = {0, 4, 2, 6, 1, 5, 3, 7}; /* Structure used for font management */ struct sequence { @@ -118,33 +118,33 @@ struct sequence { unsigned char value; }; -FORWARD int cons_write(struct tty *tp, int try); -FORWARD void cons_echo(tty_t *tp, int c); -FORWARD void out_char(console_t *cons, int c); -FORWARD void cons_putk(int c); -FORWARD void beep(void); -FORWARD void do_escape(console_t *cons, int c); -FORWARD void flush(console_t *cons); -FORWARD void parse_escape(console_t *cons, int c); -FORWARD void scroll_screen(console_t *cons, int dir); -FORWARD void set_6845(int reg, unsigned val); -FORWARD void stop_beep(timer_t *tmrp); -FORWARD void cons_org0(void); -FORWARD void disable_console(void); -FORWARD void reenable_console(void); -FORWARD int ga_program(struct sequence *seq); -FORWARD int cons_ioctl(tty_t *tp, int); -FORWARD void mem_vid_copy(vir_bytes src, int dst, int count); -FORWARD void vid_vid_copy(int src, int dst, int count); +static int cons_write(struct tty *tp, int try); +static void cons_echo(tty_t *tp, int c); +static void out_char(console_t *cons, int c); +static void cons_putk(int c); +static void beep(void); +static void do_escape(console_t *cons, int c); +static void flush(console_t *cons); +static void parse_escape(console_t *cons, int c); +static void scroll_screen(console_t *cons, int dir); +static void set_6845(int reg, unsigned val); +static void stop_beep(timer_t *tmrp); +static void cons_org0(void); +static void disable_console(void); +static void reenable_console(void); +static int ga_program(struct sequence *seq); +static int cons_ioctl(tty_t *tp, int); +static void mem_vid_copy(vir_bytes src, int dst, int count); +static void vid_vid_copy(int src, int dst, int count); #if 0 -FORWARD void get_6845(int reg, unsigned *val); +static void get_6845(int reg, unsigned *val); #endif /*===========================================================================* * cons_write * *===========================================================================*/ -PRIVATE int cons_write(tp, try) +static int cons_write(tp, try) register struct tty *tp; /* tells which terminal is to be used */ int try; { @@ -222,7 +222,7 @@ int try; /*===========================================================================* * cons_echo * *===========================================================================*/ -PRIVATE void cons_echo(tp, c) +static void cons_echo(tp, c) register tty_t *tp; /* pointer to tty struct */ int c; /* character to be echoed */ { @@ -236,7 +236,7 @@ int c; /* character to be echoed */ /*===========================================================================* * out_char * *===========================================================================*/ -PRIVATE void out_char(cons, c) +static void out_char(cons, c) register console_t *cons; /* pointer to console struct */ int c; /* character to be output */ { @@ -331,7 +331,7 @@ int c; /* character to be output */ /*===========================================================================* * scroll_screen * *===========================================================================*/ -PRIVATE void scroll_screen(cons, dir) +static void scroll_screen(cons, dir) register console_t *cons; /* pointer to console struct */ int dir; /* SCROLL_UP or SCROLL_DOWN */ { @@ -383,7 +383,7 @@ int dir; /* SCROLL_UP or SCROLL_DOWN */ /*===========================================================================* * flush * *===========================================================================*/ -PRIVATE void flush(cons) +static void flush(cons) register console_t *cons; /* pointer to console struct */ { /* Send characters buffered in 'ramqueue' to screen memory, check the new @@ -415,7 +415,7 @@ register console_t *cons; /* pointer to console struct */ /*===========================================================================* * parse_escape * *===========================================================================*/ -PRIVATE void parse_escape(cons, c) +static void parse_escape(cons, c) register console_t *cons; /* pointer to console struct */ char c; /* next character in escape sequence */ { @@ -474,7 +474,7 @@ char c; /* next character in escape sequence */ /*===========================================================================* * do_escape * *===========================================================================*/ -PRIVATE void do_escape(cons, c) +static void do_escape(cons, c) register console_t *cons; /* pointer to console struct */ char c; /* next character in escape sequence */ { @@ -716,7 +716,7 @@ char c; /* next character in escape sequence */ /*===========================================================================* * set_6845 * *===========================================================================*/ -PRIVATE void set_6845(reg, val) +static void set_6845(reg, val) int reg; /* which register pair to set */ unsigned val; /* 16-bit value to set it to */ { @@ -736,7 +736,7 @@ unsigned val; /* 16-bit value to set it to */ /*===========================================================================* * get_6845 * *===========================================================================*/ -PRIVATE void get_6845(reg, val) +static void get_6845(reg, val) int reg; /* which register pair to set */ unsigned *val; /* 16-bit value to set it to */ { @@ -756,7 +756,7 @@ unsigned *val; /* 16-bit value to set it to */ /*===========================================================================* * beep * *===========================================================================*/ -PRIVATE void beep() +static void beep() { /* Making a beeping sound on the speaker (output for CRTL-G). * This routine works by turning on the bits 0 and 1 in port B of the 8255 @@ -786,7 +786,7 @@ PRIVATE void beep() /*===========================================================================* * do_video * *===========================================================================*/ -PUBLIC void do_video(message *m) +void do_video(message *m) { int r; @@ -861,7 +861,7 @@ PUBLIC void do_video(message *m) /*===========================================================================* * beep_x * *===========================================================================*/ -PUBLIC void beep_x(freq, dur) +void beep_x(freq, dur) unsigned freq; clock_t dur; { @@ -896,7 +896,7 @@ clock_t dur; /*===========================================================================* * stop_beep * *===========================================================================*/ -PRIVATE void stop_beep(timer_t *UNUSED(tmrp)) +static void stop_beep(timer_t *UNUSED(tmrp)) { /* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */ u32_t port_b_val; @@ -908,7 +908,7 @@ PRIVATE void stop_beep(timer_t *UNUSED(tmrp)) /*===========================================================================* * scr_init * *===========================================================================*/ -PUBLIC void scr_init(tp) +void scr_init(tp) tty_t *tp; { /* Initialize the screen driver. */ @@ -1010,7 +1010,7 @@ tty_t *tp; /*===========================================================================* * do_new_kmess * *===========================================================================*/ -PUBLIC void do_new_kmess() +void do_new_kmess() { /* Notification for a new kernel message. */ static struct kmessages kmess; /* kmessages structure */ @@ -1057,7 +1057,7 @@ PUBLIC void do_new_kmess() /*===========================================================================* * cons_putk * *===========================================================================*/ -PRIVATE void cons_putk(c) +static void cons_putk(c) int c; /* character to print */ { /* This procedure is used to print a character on the console. @@ -1076,7 +1076,7 @@ int c; /* character to print */ /*===========================================================================* * toggle_scroll * *===========================================================================*/ -PUBLIC void toggle_scroll() +void toggle_scroll() { /* Toggle between hardware and software scroll. */ @@ -1088,7 +1088,7 @@ PUBLIC void toggle_scroll() /*===========================================================================* * cons_stop * *===========================================================================*/ -PUBLIC void cons_stop() +void cons_stop() { /* Prepare for halt or reboot. */ cons_org0(); @@ -1101,7 +1101,7 @@ PUBLIC void cons_stop() /*===========================================================================* * cons_org0 * *===========================================================================*/ -PRIVATE void cons_org0() +static void cons_org0() { /* Scroll video memory back to put the origin at 0. */ int cons_line; @@ -1125,7 +1125,7 @@ PRIVATE void cons_org0() /*===========================================================================* * disable_console * *===========================================================================*/ -PRIVATE void disable_console() +static void disable_console() { if (disabled_vc != -1) return; @@ -1143,7 +1143,7 @@ PRIVATE void disable_console() /*===========================================================================* * reenable_console * *===========================================================================*/ -PRIVATE void reenable_console() +static void reenable_console() { if (disabled_vc == -1) return; @@ -1156,7 +1156,7 @@ PRIVATE void reenable_console() /*===========================================================================* * select_console * *===========================================================================*/ -PUBLIC void select_console(int cons_line) +void select_console(int cons_line) { /* Set the current console to console number 'cons_line'. */ @@ -1174,7 +1174,7 @@ PUBLIC void select_console(int cons_line) /*===========================================================================* * con_loadfont * *===========================================================================*/ -PUBLIC int con_loadfont(m) +int con_loadfont(m) message *m; { @@ -1217,7 +1217,7 @@ message *m; /*===========================================================================* * ga_program * *===========================================================================*/ -PRIVATE int ga_program(seq) +static int ga_program(seq) struct sequence *seq; { pvb_pair_t char_out[14]; @@ -1233,7 +1233,7 @@ struct sequence *seq; /*===========================================================================* * cons_ioctl * *===========================================================================*/ -PRIVATE int cons_ioctl(tty_t *tp, int UNUSED(try)) +static int cons_ioctl(tty_t *tp, int UNUSED(try)) { /* Set the screen dimensions. */ @@ -1254,7 +1254,7 @@ PRIVATE int cons_ioctl(tty_t *tp, int UNUSED(try)) /*===========================================================================* * mem_vid_copy * *===========================================================================*/ -PRIVATE void mem_vid_copy(vir_bytes src, int dst_index, int count) +static void mem_vid_copy(vir_bytes src, int dst_index, int count) { u16_t *src_mem = (u16_t *) src; while(count > 0) { @@ -1276,7 +1276,7 @@ PRIVATE void mem_vid_copy(vir_bytes src, int dst_index, int count) /*===========================================================================* * vid_vid_copy * *===========================================================================*/ -PRIVATE void vid_vid_copy(int src_index, int dst_index, int count) +static void vid_vid_copy(int src_index, int dst_index, int count) { int backwards = 0; if(src_index < dst_index) diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index f70a83f1d..65f585b0d 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -25,16 +25,16 @@ #include "kernel/type.h" #include "kernel/proc.h" -PRIVATE u16_t keymap[NR_SCAN_CODES * MAP_COLS] = { +static u16_t keymap[NR_SCAN_CODES * MAP_COLS] = { #include "keymaps/us-std.src" }; -PRIVATE u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = { +static u16_t keymap_escaped[NR_SCAN_CODES * MAP_COLS] = { #include "keymaps/us-std-esc.src" }; -PRIVATE int irq_hook_id = -1; -PRIVATE int aux_irq_hook_id = -1; +static int irq_hook_id = -1; +static int aux_irq_hook_id = -1; /* Standard and AT keyboard. (PS/2 MCA implies AT throughout.) */ #define KEYBD 0x60 /* I/O port for keyboard data */ @@ -76,31 +76,31 @@ PRIVATE int aux_irq_hook_id = -1; #define CONSOLE 0 /* line number for console */ #define KB_IN_BYTES 32 /* size of keyboard input buffer */ -PRIVATE char injbuf[KB_IN_BYTES]; -PRIVATE char *injhead = injbuf; -PRIVATE char *injtail = injbuf; -PRIVATE int injcount; - -PRIVATE char ibuf[KB_IN_BYTES]; /* input buffer */ -PRIVATE char *ihead = ibuf; /* next free spot in input buffer */ -PRIVATE char *itail = ibuf; /* scan code to return to TTY */ -PRIVATE int icount; /* # codes in buffer */ - -PRIVATE int esc; /* escape scan code detected? */ -PRIVATE int alt_l; /* left alt key state */ -PRIVATE int alt_r; /* right alt key state */ -PRIVATE int alt; /* either alt key */ -PRIVATE int ctrl_l; /* left control key state */ -PRIVATE int ctrl_r; /* right control key state */ -PRIVATE int ctrl; /* either control key */ -PRIVATE int shift_l; /* left shift key state */ -PRIVATE int shift_r; /* right shift key state */ -PRIVATE int shift; /* either shift key */ -PRIVATE int num_down; /* num lock key depressed */ -PRIVATE int caps_down; /* caps lock key depressed */ -PRIVATE int scroll_down; /* scroll lock key depressed */ -PRIVATE int alt_down; /* alt key depressed */ -PRIVATE int locks[NR_CONS]; /* per console lock keys state */ +static char injbuf[KB_IN_BYTES]; +static char *injhead = injbuf; +static char *injtail = injbuf; +static int injcount; + +static char ibuf[KB_IN_BYTES]; /* input buffer */ +static char *ihead = ibuf; /* next free spot in input buffer */ +static char *itail = ibuf; /* scan code to return to TTY */ +static int icount; /* # codes in buffer */ + +static int esc; /* escape scan code detected? */ +static int alt_l; /* left alt key state */ +static int alt_r; /* right alt key state */ +static int alt; /* either alt key */ +static int ctrl_l; /* left control key state */ +static int ctrl_r; /* right control key state */ +static int ctrl; /* either control key */ +static int shift_l; /* left shift key state */ +static int shift_r; /* right shift key state */ +static int shift; /* either shift key */ +static int num_down; /* num lock key depressed */ +static int caps_down; /* caps lock key depressed */ +static int scroll_down; /* scroll lock key depressed */ +static int alt_down; /* alt key depressed */ +static int locks[NR_CONS]; /* per console lock keys state */ /* Lock key active bits. Chosen to be equal to the keyboard LED bits. */ #define SCROLL_LOCK 0x01 @@ -108,19 +108,19 @@ PRIVATE int locks[NR_CONS]; /* per console lock keys state */ #define CAPS_LOCK 0x04 #define ALT_LOCK 0x08 -PRIVATE char numpad_map[12] = +static char numpad_map[12] = {'H', 'Y', 'A', 'B', 'D', 'C', 'V', 'U', 'G', 'S', 'T', '@'}; -PRIVATE char *fkey_map[12] = +static char *fkey_map[12] = {"11", "12", "13", "14", "15", "17", /* F1-F6 */ "18", "19", "20", "21", "23", "24"}; /* F7-F12 */ /* Variables and definition for observed function keys. */ typedef struct observer { int proc_nr; int events; } obs_t; -PRIVATE obs_t fkey_obs[12]; /* observers for F1-F12 */ -PRIVATE obs_t sfkey_obs[12]; /* observers for SHIFT F1-F12 */ +static obs_t fkey_obs[12]; /* observers for F1-F12 */ +static obs_t sfkey_obs[12]; /* observers for SHIFT F1-F12 */ -PRIVATE struct kbd +static struct kbd { int minor; int nr_open; @@ -139,7 +139,7 @@ PRIVATE struct kbd /* Data that is to be sent to the keyboard. Each byte is ACKed by the * keyboard. */ -PRIVATE struct kbd_outack +static struct kbd_outack { unsigned char buf[KBD_OUT_BUFSZ]; int offset; @@ -147,28 +147,28 @@ PRIVATE struct kbd_outack int expect_ack; } kbdout; -PRIVATE int kbd_watchdog_set= 0; -PRIVATE int kbd_alive= 1; -PRIVATE long sticky_alt_mode = 0; -PRIVATE long debug_fkeys = 1; -PRIVATE timer_t tmr_kbd_wd; - -FORWARD void handle_req(struct kbd *kbdp, message *m); -FORWARD int handle_status(struct kbd *kbdp, message *m); -FORWARD void kbc_cmd0(int cmd); -FORWARD void kbc_cmd1(int cmd, int data); -FORWARD int kbc_read(void); -FORWARD void kbd_send(void); -FORWARD int kb_ack(void); -FORWARD int kb_wait(void); -FORWARD int func_key(int scode); -FORWARD int scan_keyboard(unsigned char *bp, int *isauxp); -FORWARD unsigned make_break(int scode); -FORWARD void set_leds(void); -FORWARD void show_key_mappings(void); -FORWARD int kb_read(struct tty *tp, int try); -FORWARD unsigned map_key(int scode); -FORWARD void kbd_watchdog(timer_t *tmrp); +static int kbd_watchdog_set= 0; +static int kbd_alive= 1; +static long sticky_alt_mode = 0; +static long debug_fkeys = 1; +static timer_t tmr_kbd_wd; + +static void handle_req(struct kbd *kbdp, message *m); +static int handle_status(struct kbd *kbdp, message *m); +static void kbc_cmd0(int cmd); +static void kbc_cmd1(int cmd, int data); +static int kbc_read(void); +static void kbd_send(void); +static int kb_ack(void); +static int kb_wait(void); +static int func_key(int scode); +static int scan_keyboard(unsigned char *bp, int *isauxp); +static unsigned make_break(int scode); +static void set_leds(void); +static void show_key_mappings(void); +static int kb_read(struct tty *tp, int try); +static unsigned map_key(int scode); +static void kbd_watchdog(timer_t *tmrp); int micro_delay(u32_t usecs) { @@ -180,7 +180,7 @@ int micro_delay(u32_t usecs) /*===========================================================================* * do_kbd * *===========================================================================*/ -PUBLIC void do_kbd(message *m) +void do_kbd(message *m) { handle_req(&kbd, m); } @@ -189,7 +189,7 @@ PUBLIC void do_kbd(message *m) /*===========================================================================* * kbd_status * *===========================================================================*/ -PUBLIC int kbd_status(message *m) +int kbd_status(message *m) { int r; @@ -203,7 +203,7 @@ PUBLIC int kbd_status(message *m) /*===========================================================================* * do_kbdaux * *===========================================================================*/ -PUBLIC void do_kbdaux(message *m) +void do_kbdaux(message *m) { handle_req(&kbdaux, m); } @@ -212,7 +212,7 @@ PUBLIC void do_kbdaux(message *m) /*===========================================================================* * handle_req * *===========================================================================*/ -PRIVATE void handle_req(kbdp, m) +static void handle_req(kbdp, m) struct kbd *kbdp; message *m; { @@ -393,7 +393,7 @@ message *m; /*===========================================================================* * handle_status * *===========================================================================*/ -PRIVATE int handle_status(kbdp, m) +static int handle_status(kbdp, m) struct kbd *kbdp; message *m; { @@ -443,7 +443,7 @@ message *m; /*===========================================================================* * map_key * *===========================================================================*/ -PRIVATE unsigned map_key(scode) +static unsigned map_key(scode) int scode; { /* Map a scan code to an ASCII code. */ @@ -481,7 +481,7 @@ int scode; /*===========================================================================* * kbd_interrupt * *===========================================================================*/ -PUBLIC void kbd_interrupt(message *UNUSED(m_ptr)) +void kbd_interrupt(message *UNUSED(m_ptr)) { /* A keyboard interrupt has occurred. Process it. */ int o, isaux; @@ -534,7 +534,7 @@ PUBLIC void kbd_interrupt(message *UNUSED(m_ptr)) } -PUBLIC void do_kb_inject(message *msg) +void do_kb_inject(message *msg) { unsigned char scode; /* only handle keyboard events */ @@ -561,7 +561,7 @@ PUBLIC void do_kb_inject(message *msg) /*===========================================================================* * kb_read * *===========================================================================*/ -PRIVATE int kb_read(tp, try) +static int kb_read(tp, try) tty_t *tp; int try; { @@ -673,7 +673,7 @@ int try; /*===========================================================================* * kbd_send * *===========================================================================*/ -PRIVATE void kbd_send() +static void kbd_send() { u32_t sb; int r; @@ -725,7 +725,7 @@ PRIVATE void kbd_send() /*===========================================================================* * make_break * *===========================================================================*/ -PRIVATE unsigned make_break(scode) +static unsigned make_break(scode) int scode; /* scan code of key just struck or released */ { /* This routine can handle keyboards that interrupt only on key depression, @@ -833,7 +833,7 @@ int scode; /* scan code of key just struck or released */ /*===========================================================================* * set_leds * *===========================================================================*/ -PRIVATE void set_leds() +static void set_leds() { /* Set the LEDs on the caps, num, and scroll lock keys */ int s; @@ -854,7 +854,7 @@ PRIVATE void set_leds() /*===========================================================================* * kbc_cmd0 * *===========================================================================*/ -PRIVATE void kbc_cmd0(cmd) +static void kbc_cmd0(cmd) int cmd; { kb_wait(); @@ -865,7 +865,7 @@ int cmd; /*===========================================================================* * kbc_cmd1 * *===========================================================================*/ -PRIVATE void kbc_cmd1(cmd, data) +static void kbc_cmd1(cmd, data) int cmd; int data; { @@ -881,7 +881,7 @@ int data; /*===========================================================================* * kbc_read * *===========================================================================*/ -PRIVATE int kbc_read() +static int kbc_read() { int i; u32_t byte, st; @@ -929,7 +929,7 @@ PRIVATE int kbc_read() /*===========================================================================* * kb_wait * *===========================================================================*/ -PRIVATE int kb_wait() +static int kb_wait() { /* Wait until the controller is ready; return zero if this times out. */ @@ -960,7 +960,7 @@ PRIVATE int kb_wait() /*===========================================================================* * kb_ack * *===========================================================================*/ -PRIVATE int kb_ack() +static int kb_ack() { /* Wait until kbd acknowledges last command; return zero if this times out. */ @@ -982,7 +982,7 @@ PRIVATE int kb_ack() /*===========================================================================* * kb_init * *===========================================================================*/ -PUBLIC void kb_init(tp) +void kb_init(tp) tty_t *tp; { /* Initialize the keyboard driver. */ @@ -993,7 +993,7 @@ tty_t *tp; /*===========================================================================* * kb_init_once * *===========================================================================*/ -PUBLIC void kb_init_once(void) +void kb_init_once(void) { int i; u8_t ccb; @@ -1053,7 +1053,7 @@ PUBLIC void kb_init_once(void) /*===========================================================================* * kbd_loadmap * *===========================================================================*/ -PUBLIC int kbd_loadmap(m) +int kbd_loadmap(m) message *m; { /* Load a new keymap. */ @@ -1064,7 +1064,7 @@ message *m; /*===========================================================================* * do_fkey_ctl * *===========================================================================*/ -PUBLIC void do_fkey_ctl(m_ptr) +void do_fkey_ctl(m_ptr) message *m_ptr; /* pointer to the request message */ { /* This procedure allows processes to register a function key to receive @@ -1165,7 +1165,7 @@ message *m_ptr; /* pointer to the request message */ /*===========================================================================* * func_key * *===========================================================================*/ -PRIVATE int func_key(scode) +static int func_key(scode) int scode; /* scan code for a function key */ { /* This procedure traps function keys for debugging purposes. Observers of @@ -1210,7 +1210,7 @@ int scode; /* scan code for a function key */ /*===========================================================================* * show_key_mappings * *===========================================================================*/ -PRIVATE void show_key_mappings() +static void show_key_mappings() { int i,s; struct proc proc; @@ -1249,7 +1249,7 @@ PRIVATE void show_key_mappings() /*===========================================================================* * scan_keyboard * *===========================================================================*/ -PRIVATE int scan_keyboard(bp, isauxp) +static int scan_keyboard(bp, isauxp) unsigned char *bp; int *isauxp; { @@ -1294,7 +1294,7 @@ int *isauxp; /*===========================================================================* * kbd_watchdog * *===========================================================================*/ -PRIVATE void kbd_watchdog(timer_t *UNUSED(tmrp)) +static void kbd_watchdog(timer_t *UNUSED(tmrp)) { kbd_watchdog_set= 0; diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index a826a5fe0..b0123f4f2 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -65,22 +65,22 @@ typedef struct pty { #define TTY_CLOSED 0x02 /* tty side has closed down */ #define PTY_CLOSED 0x04 /* pty side has closed down */ -PRIVATE pty_t pty_table[NR_PTYS]; /* PTY bookkeeping */ - -FORWARD int pty_write(tty_t *tp, int try); -FORWARD void pty_echo(tty_t *tp, int c); -FORWARD void pty_start(pty_t *pp); -FORWARD void pty_finish(pty_t *pp); -FORWARD int pty_read(tty_t *tp, int try); -FORWARD int pty_close(tty_t *tp, int try); -FORWARD int pty_icancel(tty_t *tp, int try); -FORWARD int pty_ocancel(tty_t *tp, int try); -FORWARD int pty_select(tty_t *tp, message *m); +static pty_t pty_table[NR_PTYS]; /* PTY bookkeeping */ + +static int pty_write(tty_t *tp, int try); +static void pty_echo(tty_t *tp, int c); +static void pty_start(pty_t *pp); +static void pty_finish(pty_t *pp); +static int pty_read(tty_t *tp, int try); +static int pty_close(tty_t *tp, int try); +static int pty_icancel(tty_t *tp, int try); +static int pty_ocancel(tty_t *tp, int try); +static int pty_select(tty_t *tp, message *m); /*===========================================================================* * do_pty * *===========================================================================*/ -PUBLIC void do_pty(tty_t *tp, message *m_ptr) +void do_pty(tty_t *tp, message *m_ptr) { /* Perform an open/close/read/write call on a /dev/ptypX device. */ pty_t *pp = tp->tty_priv; @@ -194,7 +194,7 @@ PUBLIC void do_pty(tty_t *tp, message *m_ptr) /*===========================================================================* * pty_write * *===========================================================================*/ -PRIVATE int pty_write(tty_t *tp, int try) +static int pty_write(tty_t *tp, int try) { /* (*dev_write)() routine for PTYs. Transfer bytes from the writer on * /dev/ttypX to the output buffer. @@ -270,7 +270,7 @@ PRIVATE int pty_write(tty_t *tp, int try) /*===========================================================================* * pty_echo * *===========================================================================*/ -PRIVATE void pty_echo(tty_t *tp, int c) +static void pty_echo(tty_t *tp, int c) { /* Echo one character. (Like pty_write, but only one character, optionally.) */ @@ -293,7 +293,7 @@ PRIVATE void pty_echo(tty_t *tp, int c) /*===========================================================================* * pty_start * *===========================================================================*/ -PRIVATE void pty_start(pty_t *pp) +static void pty_start(pty_t *pp) { /* Transfer bytes written to the output buffer to the PTY reader. */ int count; @@ -324,7 +324,7 @@ PRIVATE void pty_start(pty_t *pp) /*===========================================================================* * pty_finish * *===========================================================================*/ -PRIVATE void pty_finish(pty_t *pp) +static void pty_finish(pty_t *pp) { /* Finish the read request of a PTY reader if there is at least one byte * transferred. @@ -343,7 +343,7 @@ PRIVATE void pty_finish(pty_t *pp) /*===========================================================================* * pty_read * *===========================================================================*/ -PRIVATE int pty_read(tty_t *tp, int try) +static int pty_read(tty_t *tp, int try) { /* Offer bytes from the PTY writer for input on the TTY. (Do it one byte at * a time, 99% of the writes will be for one byte, so no sense in being smart.) @@ -405,7 +405,7 @@ PRIVATE int pty_read(tty_t *tp, int try) /*===========================================================================* * pty_close * *===========================================================================*/ -PRIVATE int pty_close(tty_t *tp, int UNUSED(try)) +static int pty_close(tty_t *tp, int UNUSED(try)) { /* The tty side has closed, so shut down the pty side. */ pty_t *pp = tp->tty_priv; @@ -430,7 +430,7 @@ PRIVATE int pty_close(tty_t *tp, int UNUSED(try)) /*===========================================================================* * pty_icancel * *===========================================================================*/ -PRIVATE int pty_icancel(tty_t *tp, int UNUSED(try)) +static int pty_icancel(tty_t *tp, int UNUSED(try)) { /* Discard waiting input. */ pty_t *pp = tp->tty_priv; @@ -447,7 +447,7 @@ PRIVATE int pty_icancel(tty_t *tp, int UNUSED(try)) /*===========================================================================* * pty_ocancel * *===========================================================================*/ -PRIVATE int pty_ocancel(tty_t *tp, int UNUSED(try)) +static int pty_ocancel(tty_t *tp, int UNUSED(try)) { /* Drain the output buffer. */ pty_t *pp = tp->tty_priv; @@ -461,7 +461,7 @@ PRIVATE int pty_ocancel(tty_t *tp, int UNUSED(try)) /*===========================================================================* * pty_init * *===========================================================================*/ -PUBLIC void pty_init(tty_t *tp) +void pty_init(tty_t *tp) { pty_t *pp; int line; @@ -488,7 +488,7 @@ PUBLIC void pty_init(tty_t *tp) /*===========================================================================* * pty_status * *===========================================================================*/ -PUBLIC int pty_status(message *m_ptr) +int pty_status(message *m_ptr) { int i, event_found; pty_t *pp; @@ -541,7 +541,7 @@ PUBLIC int pty_status(message *m_ptr) /*===========================================================================* * select_try_pty * *===========================================================================*/ -PRIVATE int select_try_pty(tty_t *tp, int ops) +static int select_try_pty(tty_t *tp, int ops) { pty_t *pp = tp->tty_priv; int r = 0; @@ -566,7 +566,7 @@ PRIVATE int select_try_pty(tty_t *tp, int ops) /*===========================================================================* * select_retry_pty * *===========================================================================*/ -PUBLIC void select_retry_pty(tty_t *tp) +void select_retry_pty(tty_t *tp) { pty_t *pp = tp->tty_priv; int r; @@ -582,7 +582,7 @@ PUBLIC void select_retry_pty(tty_t *tp) /*===========================================================================* * pty_select * *===========================================================================*/ -PRIVATE int pty_select(tty_t *tp, message *m) +static int pty_select(tty_t *tp, message *m) { pty_t *pp = tp->tty_priv; int ops, ready_ops = 0, watch; diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index 0b11d8669..6ee1a65ea 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -166,11 +166,11 @@ typedef struct rs232 { char obuf[RS_OBUFSIZE]; /* output buffer */ } rs232_t; -PRIVATE rs232_t rs_lines[NR_RS_LINES]; +static rs232_t rs_lines[NR_RS_LINES]; #if (MACHINE == IBM_PC) /* 8250 base addresses. */ -PRIVATE port_t addr_8250[] = { +static port_t addr_8250[] = { 0x3F8, /* COM1 */ 0x2F8, /* COM2 */ 0x3E8, /* COM3 */ @@ -178,27 +178,27 @@ PRIVATE port_t addr_8250[] = { }; #endif -FORWARD void in_int(rs232_t *rs); -FORWARD void line_int(rs232_t *rs); -FORWARD void modem_int(rs232_t *rs); -FORWARD int rs_write(tty_t *tp, int try); -FORWARD void rs_echo(tty_t *tp, int c); -FORWARD int rs_ioctl(tty_t *tp, int try); -FORWARD void rs_config(rs232_t *rs); -FORWARD int rs_read(tty_t *tp, int try); -FORWARD int rs_icancel(tty_t *tp, int try); -FORWARD int rs_ocancel(tty_t *tp, int try); -FORWARD void rs_ostart(rs232_t *rs); -FORWARD int rs_break(tty_t *tp, int try); -FORWARD int rs_close(tty_t *tp, int try); -FORWARD void out_int(rs232_t *rs); -FORWARD void rs232_handler(rs232_t *rs); +static void in_int(rs232_t *rs); +static void line_int(rs232_t *rs); +static void modem_int(rs232_t *rs); +static int rs_write(tty_t *tp, int try); +static void rs_echo(tty_t *tp, int c); +static int rs_ioctl(tty_t *tp, int try); +static void rs_config(rs232_t *rs); +static int rs_read(tty_t *tp, int try); +static int rs_icancel(tty_t *tp, int try); +static int rs_ocancel(tty_t *tp, int try); +static void rs_ostart(rs232_t *rs); +static int rs_break(tty_t *tp, int try); +static int rs_close(tty_t *tp, int try); +static void out_int(rs232_t *rs); +static void rs232_handler(rs232_t *rs); /* XXX */ -PRIVATE void lock(void) {} -PRIVATE void unlock(void) {} +static void lock(void) {} +static void unlock(void) {} -PRIVATE int my_inb(port_t port) +static int my_inb(port_t port) { int r; u32_t v = 0; @@ -212,7 +212,7 @@ PRIVATE int my_inb(port_t port) /*===========================================================================* * rs_write * *===========================================================================*/ -PRIVATE int rs_write(register tty_t *tp, int try) +static int rs_write(register tty_t *tp, int try) { /* (*devwrite)() routine for RS232. */ @@ -297,7 +297,7 @@ PRIVATE int rs_write(register tty_t *tp, int try) /*===========================================================================* * rs_echo * *===========================================================================*/ -PRIVATE void rs_echo(tp, c) +static void rs_echo(tp, c) tty_t *tp; /* which TTY */ int c; /* character to echo */ { @@ -324,7 +324,7 @@ int c; /* character to echo */ /*===========================================================================* * rs_ioctl * *===========================================================================*/ -PRIVATE int rs_ioctl(tty_t *tp, int UNUSED(dummy)) +static int rs_ioctl(tty_t *tp, int UNUSED(dummy)) /* tp; which TTY */ { /* Reconfigure the line as soon as the output has drained. */ @@ -337,7 +337,7 @@ PRIVATE int rs_ioctl(tty_t *tp, int UNUSED(dummy)) /*===========================================================================* * rs_config * *===========================================================================*/ -PRIVATE void rs_config(rs232_t *rs) +static void rs_config(rs232_t *rs) /* rs which line */ { /* Set various line control parameters for RS232 I/O. @@ -423,7 +423,7 @@ PRIVATE void rs_config(rs232_t *rs) /*===========================================================================* * rs_init * *===========================================================================*/ -PUBLIC void rs_init(tty_t *tp) +void rs_init(tty_t *tp) /* tp which TTY */ { u32_t dummy; @@ -527,7 +527,7 @@ PUBLIC void rs_init(tty_t *tp) /*===========================================================================* * rs_interrupt * *===========================================================================*/ -PUBLIC void rs_interrupt(message *m) +void rs_interrupt(message *m) { unsigned long irq_set; int i; @@ -544,7 +544,7 @@ PUBLIC void rs_interrupt(message *m) /*===========================================================================* * rs_icancel * *===========================================================================*/ -PRIVATE int rs_icancel(tty_t *tp, int UNUSED(dummy)) +static int rs_icancel(tty_t *tp, int UNUSED(dummy)) { /* Cancel waiting input. */ rs232_t *rs = tp->tty_priv; @@ -561,7 +561,7 @@ PRIVATE int rs_icancel(tty_t *tp, int UNUSED(dummy)) /*===========================================================================* * rs_ocancel * *===========================================================================*/ -PRIVATE int rs_ocancel(tty_t *tp, int UNUSED(dummy)) +static int rs_ocancel(tty_t *tp, int UNUSED(dummy)) { /* Cancel pending output. */ rs232_t *rs = tp->tty_priv; @@ -578,7 +578,7 @@ PRIVATE int rs_ocancel(tty_t *tp, int UNUSED(dummy)) /*===========================================================================* * rs_read * *===========================================================================*/ -PRIVATE int rs_read(tty_t *tp, int try) +static int rs_read(tty_t *tp, int try) { /* Process characters from the circular input buffer. */ @@ -625,7 +625,7 @@ PRIVATE int rs_read(tty_t *tp, int try) /*===========================================================================* * rs_ostart * *===========================================================================*/ -PRIVATE void rs_ostart(rs232_t *rs) +static void rs_ostart(rs232_t *rs) { /* Tell RS232 there is something waiting in the output buffer. */ @@ -636,7 +636,7 @@ PRIVATE void rs_ostart(rs232_t *rs) /*===========================================================================* * rs_break * *===========================================================================*/ -PRIVATE int rs_break(tty_t *tp, int UNUSED(dummy)) +static int rs_break(tty_t *tp, int UNUSED(dummy)) { /* Generate a break condition by setting the BREAK bit for 0.4 sec. */ rs232_t *rs = tp->tty_priv; @@ -654,7 +654,7 @@ PRIVATE int rs_break(tty_t *tp, int UNUSED(dummy)) /*===========================================================================* * rs_close * *===========================================================================*/ -PRIVATE int rs_close(tty_t *tp, int UNUSED(dummy)) +static int rs_close(tty_t *tp, int UNUSED(dummy)) { /* The line is closed; optionally hang up. */ rs232_t *rs = tp->tty_priv; @@ -670,7 +670,7 @@ PRIVATE int rs_close(tty_t *tp, int UNUSED(dummy)) /*===========================================================================* * rs232_handler * *===========================================================================*/ -PRIVATE void rs232_handler(struct rs232 *rs) +static void rs232_handler(struct rs232 *rs) { /* Interrupt hander for RS232. */ @@ -703,7 +703,7 @@ PRIVATE void rs232_handler(struct rs232 *rs) /*===========================================================================* * in_int * *===========================================================================*/ -PRIVATE void in_int(register rs232_t *rs) +static void in_int(register rs232_t *rs) /* rs line with input interrupt */ { /* Read the data which just arrived. @@ -751,7 +751,7 @@ PRIVATE void in_int(register rs232_t *rs) /*===========================================================================* * line_int * *===========================================================================*/ -PRIVATE void line_int(register rs232_t *rs) +static void line_int(register rs232_t *rs) /* rs line with line status interrupt */ { /* Check for and record errors. */ @@ -768,7 +768,7 @@ PRIVATE void line_int(register rs232_t *rs) /*===========================================================================* * modem_int * *===========================================================================*/ -PRIVATE void modem_int(register rs232_t *rs) +static void modem_int(register rs232_t *rs) /* rs line with modem interrupt */ { /* Get possibly new device-ready status, and clear ODEVREADY if necessary. @@ -792,7 +792,7 @@ PRIVATE void modem_int(register rs232_t *rs) /*===========================================================================* * out_int * *===========================================================================*/ -PRIVATE void out_int(register rs232_t *rs) +static void out_int(register rs232_t *rs) /* rs; line with output interrupt */ { /* If there is output to do and everything is ready, do it (local device is diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 7ceb2dcf7..7ed0b97e3 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -101,28 +101,28 @@ unsigned long rs_irq_set = 0; struct kmessages kmess; -FORWARD void tty_timed_out(timer_t *tp); -FORWARD void settimer(tty_t *tty_ptr, int enable); -FORWARD void do_cancel(tty_t *tp, message *m_ptr); -FORWARD void do_ioctl(tty_t *tp, message *m_ptr); -FORWARD void do_open(tty_t *tp, message *m_ptr); -FORWARD void do_close(tty_t *tp, message *m_ptr); -FORWARD void do_read(tty_t *tp, message *m_ptr); -FORWARD void do_write(tty_t *tp, message *m_ptr); -FORWARD void do_select(tty_t *tp, message *m_ptr); -FORWARD void do_status(message *m_ptr); -FORWARD void in_transfer(tty_t *tp); -FORWARD int tty_echo(tty_t *tp, int ch); -FORWARD void rawecho(tty_t *tp, int ch); -FORWARD int back_over(tty_t *tp); -FORWARD void reprint(tty_t *tp); -FORWARD void dev_ioctl(tty_t *tp); -FORWARD void setattr(tty_t *tp); -FORWARD void tty_icancel(tty_t *tp); -FORWARD void tty_init(void); +static void tty_timed_out(timer_t *tp); +static void settimer(tty_t *tty_ptr, int enable); +static void do_cancel(tty_t *tp, message *m_ptr); +static void do_ioctl(tty_t *tp, message *m_ptr); +static void do_open(tty_t *tp, message *m_ptr); +static void do_close(tty_t *tp, message *m_ptr); +static void do_read(tty_t *tp, message *m_ptr); +static void do_write(tty_t *tp, message *m_ptr); +static void do_select(tty_t *tp, message *m_ptr); +static void do_status(message *m_ptr); +static void in_transfer(tty_t *tp); +static int tty_echo(tty_t *tp, int ch); +static void rawecho(tty_t *tp, int ch); +static int back_over(tty_t *tp); +static void reprint(tty_t *tp); +static void dev_ioctl(tty_t *tp); +static void setattr(tty_t *tp); +static void tty_icancel(tty_t *tp); +static void tty_init(void); /* Default attributes. */ -PRIVATE struct termios termios_defaults = { +static struct termios termios_defaults = { TINPUT_DEF, TOUTPUT_DEF, TCTRL_DEF, TLOCAL_DEF, TSPEED_DEF, TSPEED_DEF, { TEOF_DEF, TEOL_DEF, TERASE_DEF, TINTR_DEF, TKILL_DEF, TMIN_DEF, @@ -130,23 +130,23 @@ PRIVATE struct termios termios_defaults = { TREPRINT_DEF, TLNEXT_DEF, TDISCARD_DEF, }, }; -PRIVATE struct winsize winsize_defaults; /* = all zeroes */ +static struct winsize winsize_defaults; /* = all zeroes */ /* Global variables for the TTY task (declared extern in tty.h). */ -PUBLIC tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS]; -PUBLIC int ccurrent; /* currently active console */ -PUBLIC struct machine machine; /* kernel environment variables */ -PUBLIC u32_t system_hz; +tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS]; +int ccurrent; /* currently active console */ +struct machine machine; /* kernel environment variables */ +u32_t system_hz; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * tty_task * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* Main routine of the terminal task. */ @@ -291,7 +291,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -309,7 +309,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the tty driver. */ int r; @@ -331,7 +331,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Check for known signals, ignore anything else. */ switch(signo) { @@ -349,7 +349,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * do_status * *===========================================================================*/ -PRIVATE void do_status(m_ptr) +static void do_status(m_ptr) message *m_ptr; { register struct tty *tp; @@ -436,7 +436,7 @@ message *m_ptr; /*===========================================================================* * do_read * *===========================================================================*/ -PRIVATE void do_read(tp, m_ptr) +static void do_read(tp, m_ptr) register tty_t *tp; /* pointer to tty struct */ register message *m_ptr; /* pointer to message sent to the task */ { @@ -503,7 +503,7 @@ register message *m_ptr; /* pointer to message sent to the task */ /*===========================================================================* * do_write * *===========================================================================*/ -PRIVATE void do_write(tp, m_ptr) +static void do_write(tp, m_ptr) register tty_t *tp; register message *m_ptr; /* pointer to message sent to the task */ { @@ -544,7 +544,7 @@ register message *m_ptr; /* pointer to message sent to the task */ /*===========================================================================* * do_ioctl * *===========================================================================*/ -PRIVATE void do_ioctl(tp, m_ptr) +static void do_ioctl(tp, m_ptr) register tty_t *tp; message *m_ptr; /* pointer to message sent to task */ { @@ -704,7 +704,7 @@ message *m_ptr; /* pointer to message sent to task */ /*===========================================================================* * do_open * *===========================================================================*/ -PRIVATE void do_open(tp, m_ptr) +static void do_open(tp, m_ptr) register tty_t *tp; message *m_ptr; /* pointer to message sent to task */ { @@ -730,7 +730,7 @@ message *m_ptr; /* pointer to message sent to task */ /*===========================================================================* * do_close * *===========================================================================*/ -PRIVATE void do_close(tp, m_ptr) +static void do_close(tp, m_ptr) register tty_t *tp; message *m_ptr; /* pointer to message sent to task */ { @@ -751,7 +751,7 @@ message *m_ptr; /* pointer to message sent to task */ /*===========================================================================* * do_cancel * *===========================================================================*/ -PRIVATE void do_cancel(tp, m_ptr) +static void do_cancel(tp, m_ptr) register tty_t *tp; message *m_ptr; /* pointer to message sent to task */ { @@ -787,7 +787,7 @@ message *m_ptr; /* pointer to message sent to task */ tty_reply(TASK_REPLY, m_ptr->m_source, proc_nr, r); } -PUBLIC int select_try(struct tty *tp, int ops) +int select_try(struct tty *tp, int ops) { int ready_ops = 0; @@ -821,7 +821,7 @@ PUBLIC int select_try(struct tty *tp, int ops) return ready_ops; } -PUBLIC int select_retry(struct tty *tp) +int select_retry(struct tty *tp) { if (tp->tty_select_ops && select_try(tp, tp->tty_select_ops)) notify(tp->tty_select_proc); @@ -831,7 +831,7 @@ PUBLIC int select_retry(struct tty *tp) /*===========================================================================* * handle_events * *===========================================================================*/ -PUBLIC void handle_events(tp) +void handle_events(tp) tty_t *tp; /* TTY to check for events. */ { /* Handle any events pending on a TTY. These events are usually device @@ -888,7 +888,7 @@ tty_t *tp; /* TTY to check for events. */ /*===========================================================================* * in_transfer * *===========================================================================*/ -PRIVATE void in_transfer(tp) +static void in_transfer(tp) register tty_t *tp; /* pointer to terminal to read from */ { /* Transfer bytes from the input queue to a process reading from a terminal. */ @@ -960,7 +960,7 @@ register tty_t *tp; /* pointer to terminal to read from */ /*===========================================================================* * in_process * *===========================================================================*/ -PRIVATE void in_process_send_byte( +static void in_process_send_byte( tty_t *tp, /* terminal on which character has arrived */ int ch /* input character */ ) @@ -976,7 +976,7 @@ PRIVATE void in_process_send_byte( if (tp->tty_incount == buflen(tp->tty_inbuf)) in_transfer(tp); } -PUBLIC int in_process(tp, buf, count, scode) +int in_process(tp, buf, count, scode) register tty_t *tp; /* terminal on which character has arrived */ char *buf; /* buffer with input characters */ int count; /* number of input characters */ @@ -1137,7 +1137,7 @@ int scode; /* scan code */ /*===========================================================================* * echo * *===========================================================================*/ -PRIVATE int tty_echo(tp, ch) +static int tty_echo(tp, ch) register tty_t *tp; /* terminal on which to echo */ register int ch; /* pointer to character to echo */ { @@ -1198,7 +1198,7 @@ register int ch; /* pointer to character to echo */ /*===========================================================================* * rawecho * *===========================================================================*/ -PRIVATE void rawecho(tp, ch) +static void rawecho(tp, ch) register tty_t *tp; int ch; { @@ -1211,7 +1211,7 @@ int ch; /*===========================================================================* * back_over * *===========================================================================*/ -PRIVATE int back_over(tp) +static int back_over(tp) register tty_t *tp; { /* Backspace to previous character on screen and erase it. */ @@ -1240,7 +1240,7 @@ register tty_t *tp; /*===========================================================================* * reprint * *===========================================================================*/ -PRIVATE void reprint(tp) +static void reprint(tp) register tty_t *tp; /* pointer to tty struct */ { /* Restore what has been echoed to screen before if the user input has been @@ -1279,7 +1279,7 @@ register tty_t *tp; /* pointer to tty struct */ /*===========================================================================* * out_process * *===========================================================================*/ -PUBLIC void out_process(tp, bstart, bpos, bend, icount, ocount) +void out_process(tp, bstart, bpos, bend, icount, ocount) tty_t *tp; char *bstart, *bpos, *bend; /* start/pos/end of circular buffer */ int *icount; /* # input chars / input chars used */ @@ -1364,7 +1364,7 @@ out_done: /*===========================================================================* * dev_ioctl * *===========================================================================*/ -PRIVATE void dev_ioctl(tp) +static void dev_ioctl(tp) tty_t *tp; { /* The ioctl's TCSETSW, TCSETSF and TCDRAIN wait for output to finish to make @@ -1391,7 +1391,7 @@ tty_t *tp; /*===========================================================================* * setattr * *===========================================================================*/ -PRIVATE void setattr(tp) +static void setattr(tp) tty_t *tp; { /* Apply the new line attributes (raw/canonical, line speed, etc.) */ @@ -1447,7 +1447,7 @@ tty_t *tp; /*===========================================================================* * tty_reply * *===========================================================================*/ -PUBLIC void +void tty_reply_f( file, line, code, replyee, proc_nr, status) char *file; @@ -1481,7 +1481,7 @@ int status; /* reply code */ /*===========================================================================* * sigchar * *===========================================================================*/ -PUBLIC void sigchar(tp, sig, mayflush) +void sigchar(tp, sig, mayflush) register tty_t *tp; int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */ int mayflush; @@ -1511,7 +1511,7 @@ int mayflush; /*===========================================================================* * tty_icancel * *===========================================================================*/ -PRIVATE void tty_icancel(tp) +static void tty_icancel(tp) register tty_t *tp; { /* Discard all pending input, tty buffer or device. */ @@ -1524,7 +1524,7 @@ register tty_t *tp; /*===========================================================================* * tty_devnop * *===========================================================================*/ -PRIVATE int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try)) +static int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try)) { /* Some functions need not be implemented at the device level. */ return 0; @@ -1533,7 +1533,7 @@ PRIVATE int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try)) /*===========================================================================* * tty_init * *===========================================================================*/ -PRIVATE void tty_init() +static void tty_init() { /* Initialize tty structure and call device initialization routines. */ @@ -1576,7 +1576,7 @@ PRIVATE void tty_init() /*===========================================================================* * tty_timed_out * *===========================================================================*/ -PRIVATE void tty_timed_out(timer_t *tp) +static void tty_timed_out(timer_t *tp) { /* This timer has expired. Set the events flag, to force processing. */ tty_t *tty_ptr; @@ -1588,7 +1588,7 @@ PRIVATE void tty_timed_out(timer_t *tp) /*===========================================================================* * settimer * *===========================================================================*/ -PRIVATE void settimer(tty_ptr, enable) +static void settimer(tty_ptr, enable) tty_t *tty_ptr; /* line to set or unset a timer on */ int enable; /* set timer if true, otherwise unset */ { @@ -1608,7 +1608,7 @@ int enable; /* set timer if true, otherwise unset */ /*===========================================================================* * do_select * *===========================================================================*/ -PRIVATE void do_select(tp, m_ptr) +static void do_select(tp, m_ptr) register tty_t *tp; /* pointer to tty struct */ register message *m_ptr; /* pointer to message sent to the task */ { diff --git a/drivers/vbox/vbox.c b/drivers/vbox/vbox.c index ac7ab532a..dd5ffc928 100644 --- a/drivers/vbox/vbox.c +++ b/drivers/vbox/vbox.c @@ -10,14 +10,14 @@ #define DEFAULT_INTERVAL 1 /* check host time every second */ #define DEFAULT_DRIFT 2 /* update time if delta is >= 2 secs */ -PRIVATE void *vir_ptr; -PRIVATE phys_bytes phys_ptr; -PRIVATE port_t port; -PRIVATE u32_t ticks; -PRIVATE int interval; -PRIVATE int drift; - -PRIVATE struct optset optset_table[] = { +static void *vir_ptr; +static phys_bytes phys_ptr; +static port_t port; +static u32_t ticks; +static int interval; +static int drift; + +static struct optset optset_table[] = { { "interval", OPT_INT, &interval, 10 }, { "drift", OPT_INT, &drift, 10 }, { NULL, 0, NULL, 0 } @@ -26,7 +26,7 @@ PRIVATE struct optset optset_table[] = { /*===========================================================================* * vbox_request * *===========================================================================*/ -PRIVATE int vbox_request(int req_nr, size_t size) +static int vbox_request(int req_nr, size_t size) { /* Perform a VirtualBox backdoor request. */ struct VMMDevRequestHeader *hdr; @@ -47,7 +47,7 @@ PRIVATE int vbox_request(int req_nr, size_t size) /*===========================================================================* * vbox_init * *===========================================================================*/ -PRIVATE int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the device. */ int devind; @@ -100,7 +100,7 @@ PRIVATE int vbox_init(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * vbox_update_time * *===========================================================================*/ -PRIVATE void vbox_update_time(void) +static void vbox_update_time(void) { /* Update the current time if it has drifted too far. */ struct VMMDevReqHostTime *req; @@ -126,7 +126,7 @@ PRIVATE void vbox_update_time(void) /*===========================================================================* * vbox_signal * *===========================================================================*/ -PRIVATE void vbox_signal(int signo) +static void vbox_signal(int signo) { /* Process a signal. If it is a SIGTERM, terminate immediately. */ @@ -138,7 +138,7 @@ PRIVATE void vbox_signal(int signo) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Perform local SEF initialization. */ @@ -153,7 +153,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* The main message loop. */ message m; diff --git a/include/minix/const.h b/include/minix/const.h index 6adddfb98..5db05a4dc 100644 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -33,9 +33,6 @@ #endif #define EXTERN extern /* used in *.h files */ -#define PRIVATE static /* PRIVATE x limits the scope of x */ -#define PUBLIC /* PUBLIC is the opposite of PRIVATE */ -#define FORWARD static /* some compilers require this to be 'static'*/ #define TRUE 1 /* used for turning integers into Booleans */ #define FALSE 0 /* used for turning integers into Booleans */ diff --git a/kernel/arch/i386/acpi.c b/kernel/arch/i386/acpi.c index 36fa84e19..519410f1f 100644 --- a/kernel/arch/i386/acpi.c +++ b/kernel/arch/i386/acpi.c @@ -9,23 +9,23 @@ typedef int ((* acpi_read_t)(phys_bytes addr, void * buff, size_t size)); struct acpi_rsdp acpi_rsdp; -PRIVATE acpi_read_t read_func; +static acpi_read_t read_func; #define MAX_RSDT 35 /* ACPI defines 35 signatures */ -PRIVATE struct acpi_rsdt { +static struct acpi_rsdt { struct acpi_sdt_header hdr; u32_t data[MAX_RSDT]; } rsdt; -PRIVATE struct { +static struct { char signature [ACPI_SDT_SIGNATURE_LEN + 1]; size_t length; } sdt_trans[MAX_RSDT]; -PRIVATE int sdt_count; +static int sdt_count; -PRIVATE int acpi_check_csum(struct acpi_sdt_header * tb, size_t size) +static int acpi_check_csum(struct acpi_sdt_header * tb, size_t size) { u8_t total = 0; int i; @@ -34,12 +34,12 @@ PRIVATE int acpi_check_csum(struct acpi_sdt_header * tb, size_t size) return total == 0 ? 0 : -1; } -PRIVATE int acpi_check_signature(const char * orig, const char * match) +static int acpi_check_signature(const char * orig, const char * match) { return strncmp(orig, match, ACPI_SDT_SIGNATURE_LEN); } -PRIVATE int acpi_read_sdt_at(phys_bytes addr, +static int acpi_read_sdt_at(phys_bytes addr, struct acpi_sdt_header * tb, size_t size, const char * name) @@ -84,7 +84,7 @@ PRIVATE int acpi_read_sdt_at(phys_bytes addr, return tb->length; } -PUBLIC phys_bytes acpi_get_table_base(const char * name) +phys_bytes acpi_get_table_base(const char * name) { int i; @@ -97,7 +97,7 @@ PUBLIC phys_bytes acpi_get_table_base(const char * name) return (phys_bytes) NULL; } -PUBLIC size_t acpi_get_table_length(const char * name) +size_t acpi_get_table_length(const char * name) { int i; @@ -110,7 +110,7 @@ PUBLIC size_t acpi_get_table_length(const char * name) return 0; } -PRIVATE void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr, +static void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr, unsigned char type, unsigned idx) { @@ -135,7 +135,7 @@ PRIVATE void * acpi_madt_get_typed_item(struct acpi_madt_hdr * hdr, } #if 0 -PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr, +static void * acpi_madt_get_item(struct acpi_madt_hdr * hdr, unsigned idx) { u8_t * t, * end; @@ -154,7 +154,7 @@ PRIVATE void * acpi_madt_get_item(struct acpi_madt_hdr * hdr, } #endif -PRIVATE int acpi_rsdp_test(void * buff) +static int acpi_rsdp_test(void * buff) { struct acpi_rsdp * rsdp = (struct acpi_rsdp *) buff; @@ -166,7 +166,7 @@ PRIVATE int acpi_rsdp_test(void * buff) return 1; } -PRIVATE int get_acpi_rsdp(void) +static int get_acpi_rsdp(void) { u16_t ebda; /* @@ -192,13 +192,13 @@ PRIVATE int get_acpi_rsdp(void) return 0; } -PRIVATE int acpi_read_kernel(phys_bytes addr, void * buff, size_t size) +static int acpi_read_kernel(phys_bytes addr, void * buff, size_t size) { phys_copy(addr, vir2phys(buff), size); return 0; } -PUBLIC void acpi_init(void) +void acpi_init(void) { int s, i; read_func = acpi_read_kernel; @@ -229,7 +229,7 @@ PUBLIC void acpi_init(void) } } -PUBLIC struct acpi_madt_ioapic * acpi_get_ioapic_next(void) +struct acpi_madt_ioapic * acpi_get_ioapic_next(void) { static unsigned idx = 0; static struct acpi_madt_hdr * madt_hdr; @@ -251,7 +251,7 @@ PUBLIC struct acpi_madt_ioapic * acpi_get_ioapic_next(void) return ret; } -PUBLIC struct acpi_madt_lapic * acpi_get_lapic_next(void) +struct acpi_madt_lapic * acpi_get_lapic_next(void) { static unsigned idx = 0; static struct acpi_madt_hdr * madt_hdr; diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index 47715229b..cdb601e4a 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -107,8 +107,8 @@ #define SPLHI 0xF -PUBLIC struct io_apic io_apic[MAX_NR_IOAPICS]; -PUBLIC unsigned nioapics; +struct io_apic io_apic[MAX_NR_IOAPICS]; +unsigned nioapics; struct irq; typedef void (* eoi_method_t)(struct irq *); @@ -121,7 +121,7 @@ struct irq { unsigned state; }; -PRIVATE struct irq io_apic_irq[NR_IRQ_VECTORS]; +static struct irq io_apic_irq[NR_IRQ_VECTORS]; /* * to make APIC work if SMP is not configured, we need to set the maximal number @@ -146,20 +146,20 @@ PRIVATE struct irq io_apic_irq[NR_IRQ_VECTORS]; #define VERBOSE_APIC(x) x -PUBLIC int ioapic_enabled; -PUBLIC u32_t lapic_addr_vaddr; -PUBLIC vir_bytes lapic_addr; -PUBLIC vir_bytes lapic_eoi_addr; -PUBLIC int bsp_lapic_id; +int ioapic_enabled; +u32_t lapic_addr_vaddr; +vir_bytes lapic_addr; +vir_bytes lapic_eoi_addr; +int bsp_lapic_id; -PRIVATE volatile unsigned probe_ticks; -PRIVATE u64_t tsc0, tsc1; -PRIVATE u32_t lapic_tctr0, lapic_tctr1; +static volatile unsigned probe_ticks; +static u64_t tsc0, tsc1; +static u32_t lapic_tctr0, lapic_tctr1; -PRIVATE unsigned apic_imcrp; -PRIVATE const unsigned nlints = 0; +static unsigned apic_imcrp; +static const unsigned nlints = 0; -PUBLIC void arch_eoi(void) +void arch_eoi(void) { apic_eoi(); } @@ -169,20 +169,20 @@ PUBLIC void arch_eoi(void) * arch specific cpulocals. As this variable is write-once-read-only it is ok to * have at as an array until we resolve the cpulocals properly */ -PRIVATE u32_t lapic_bus_freq[CONFIG_MAX_CPUS]; +static u32_t lapic_bus_freq[CONFIG_MAX_CPUS]; /* the probe period will be roughly 100ms */ #define PROBE_TICKS (system_hz / 10) #define IOAPIC_IOREGSEL 0x0 #define IOAPIC_IOWIN 0x10 -PRIVATE u32_t ioapic_read(u32_t ioa_base, u32_t reg) +static u32_t ioapic_read(u32_t ioa_base, u32_t reg) { *((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = (reg & 0xff); return *(u32_t *)(ioa_base + IOAPIC_IOWIN); } -PRIVATE void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val) +static void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val) { *((u32_t *)(ioa_base + IOAPIC_IOREGSEL)) = reg; *((u32_t *)(ioa_base + IOAPIC_IOWIN)) = val; @@ -191,7 +191,7 @@ PRIVATE void ioapic_write(u32_t ioa_base, u8_t reg, u32_t val) void lapic_microsec_sleep(unsigned count); void apic_idt_init(const int reset); -PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin) +static void ioapic_enable_pin(vir_bytes ioapic_addr, int pin) { u32_t lo = ioapic_read(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2); @@ -199,7 +199,7 @@ PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin) ioapic_write(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2, lo); } -PRIVATE void ioapic_disable_pin(vir_bytes ioapic_addr, int pin) +static void ioapic_disable_pin(vir_bytes ioapic_addr, int pin) { u32_t lo = ioapic_read(ioapic_addr, IOAPIC_REDIR_TABLE + pin * 2); @@ -208,7 +208,7 @@ PRIVATE void ioapic_disable_pin(vir_bytes ioapic_addr, int pin) } #if 0 -PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr, +static void ioapic_redirt_entry_read(void * ioapic_addr, int entry, u32_t *hi, u32_t *lo) @@ -219,7 +219,7 @@ PRIVATE void ioapic_redirt_entry_read(void * ioapic_addr, } #endif -PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr, +static void ioapic_redirt_entry_write(void * ioapic_addr, int entry, u32_t hi, u32_t lo) @@ -243,7 +243,7 @@ PRIVATE void ioapic_redirt_entry_write(void * ioapic_addr, #define lapic_test_delivery_val(val, vector) ((val) & (1 << ((vector) & 0x1f))) -PRIVATE void ioapic_eoi_level(struct irq * irq) +static void ioapic_eoi_level(struct irq * irq) { reg_t tmr; @@ -285,12 +285,12 @@ PRIVATE void ioapic_eoi_level(struct irq * irq) } } -PRIVATE void ioapic_eoi_edge(__unused struct irq * irq) +static void ioapic_eoi_edge(__unused struct irq * irq) { apic_eoi(); } -PUBLIC void ioapic_eoi(int irq) +void ioapic_eoi(int irq) { if (ioapic_enabled) { io_apic_irq[irq].eoi(&io_apic_irq[irq]); @@ -299,12 +299,12 @@ PUBLIC void ioapic_eoi(int irq) irq_8259_eoi(irq); } -PUBLIC void ioapic_set_id(u32_t addr, unsigned int id) +void ioapic_set_id(u32_t addr, unsigned int id) { ioapic_write(addr, IOAPIC_ID, id << 24); } -PUBLIC int ioapic_enable_all(void) +int ioapic_enable_all(void) { i8259_disable(); @@ -318,7 +318,7 @@ PUBLIC int ioapic_enable_all(void) } /* disables a single IO APIC */ -PRIVATE void ioapic_disable(struct io_apic * ioapic) +static void ioapic_disable(struct io_apic * ioapic) { unsigned p; @@ -340,7 +340,7 @@ PRIVATE void ioapic_disable(struct io_apic * ioapic) } /* disables all IO APICs */ -PUBLIC void ioapic_disable_all(void) +void ioapic_disable_all(void) { unsigned ioa; if (!ioapic_enabled) @@ -365,7 +365,7 @@ PUBLIC void ioapic_disable_all(void) intr_init(INTS_ORIG, 0); /* no auto eoi */ } -PRIVATE void ioapic_disable_irq(unsigned irq) +static void ioapic_disable_irq(unsigned irq) { assert(io_apic_irq[irq].ioa); @@ -373,7 +373,7 @@ PRIVATE void ioapic_disable_irq(unsigned irq) io_apic_irq[irq].state |= IOAPIC_IRQ_STATE_MASKED; } -PRIVATE void ioapic_enable_irq(unsigned irq) +static void ioapic_enable_irq(unsigned irq) { assert(io_apic_irq[irq].ioa); @@ -381,7 +381,7 @@ PRIVATE void ioapic_enable_irq(unsigned irq) io_apic_irq[irq].state &= ~IOAPIC_IRQ_STATE_MASKED; } -PUBLIC void ioapic_unmask_irq(unsigned irq) +void ioapic_unmask_irq(unsigned irq) { if (ioapic_enabled) ioapic_enable_irq(irq); @@ -390,7 +390,7 @@ PUBLIC void ioapic_unmask_irq(unsigned irq) irq_8259_unmask(irq); } -PUBLIC void ioapic_mask_irq(unsigned irq) +void ioapic_mask_irq(unsigned irq) { if (ioapic_enabled) ioapic_disable_irq(irq); @@ -399,12 +399,12 @@ PUBLIC void ioapic_mask_irq(unsigned irq) irq_8259_mask(irq); } -PUBLIC unsigned int apicid(void) +unsigned int apicid(void) { return lapic_read(LAPIC_ID) >> 24; } -PRIVATE int calib_clk_handler(irq_hook_t * UNUSED(hook)) +static int calib_clk_handler(irq_hook_t * UNUSED(hook)) { u32_t tcrt; u64_t tsc; @@ -428,7 +428,7 @@ PRIVATE int calib_clk_handler(irq_hook_t * UNUSED(hook)) return 1; } -PRIVATE int spurious_irq_handler(irq_hook_t * UNUSED(hook)) +static int spurious_irq_handler(irq_hook_t * UNUSED(hook)) { /* * Do nothing, only unlock the kernel so we do not deadlock! @@ -437,7 +437,7 @@ PRIVATE int spurious_irq_handler(irq_hook_t * UNUSED(hook)) return 1; } -PRIVATE void apic_calibrate_clocks(unsigned cpu) +static void apic_calibrate_clocks(unsigned cpu) { u32_t lvtt, val, lapic_delta; u64_t tsc_delta; @@ -520,7 +520,7 @@ PRIVATE void apic_calibrate_clocks(unsigned cpu) BOOT_VERBOSE(cpu_print_freq(cpuid)); } -PUBLIC void lapic_set_timer_one_shot(const u32_t usec) +void lapic_set_timer_one_shot(const u32_t usec) { /* sleep in micro seconds */ u32_t lvtt; @@ -539,7 +539,7 @@ PUBLIC void lapic_set_timer_one_shot(const u32_t usec) lapic_write(LAPIC_LVTTR, lvtt); } -PUBLIC void lapic_set_timer_periodic(const unsigned freq) +void lapic_set_timer_periodic(const unsigned freq) { /* sleep in micro seconds */ u32_t lvtt; @@ -558,7 +558,7 @@ PUBLIC void lapic_set_timer_periodic(const unsigned freq) lapic_write(LAPIC_TIMER_ICR, lapic_ticks_per_clock_tick); } -PUBLIC void lapic_stop_timer(void) +void lapic_stop_timer(void) { u32_t lvtt; lvtt = lapic_read(LAPIC_LVTTR); @@ -568,27 +568,27 @@ PUBLIC void lapic_stop_timer(void) lapic_write(LAPIC_TIMER_CCR, 0); } -PUBLIC void lapic_restart_timer(void) +void lapic_restart_timer(void) { /* restart the timer only if the counter reached zero, i.e. expired */ if (lapic_read(LAPIC_TIMER_CCR) == 0) lapic_set_timer_one_shot(1000000/system_hz); } -PUBLIC void lapic_microsec_sleep(unsigned count) +void lapic_microsec_sleep(unsigned count) { lapic_set_timer_one_shot(count); while (lapic_read(LAPIC_TIMER_CCR)) arch_pause(); } -PRIVATE u32_t lapic_errstatus(void) +static u32_t lapic_errstatus(void) { lapic_write(LAPIC_ESR, 0); return lapic_read(LAPIC_ESR); } -PRIVATE int lapic_disable_in_msr(void) +static int lapic_disable_in_msr(void) { u32_t msr_hi, msr_lo; @@ -600,7 +600,7 @@ PRIVATE int lapic_disable_in_msr(void) return 1; } -PUBLIC void lapic_disable(void) +void lapic_disable(void) { /* Disable current APIC and close interrupts from PIC */ u32_t val; @@ -635,7 +635,7 @@ PUBLIC void lapic_disable(void) lapic_disable_in_msr(); } -PRIVATE int lapic_enable_in_msr(void) +static int lapic_enable_in_msr(void) { u32_t msr_hi, msr_lo; @@ -664,7 +664,7 @@ PRIVATE int lapic_enable_in_msr(void) return 1; } -PUBLIC int lapic_enable(unsigned cpu) +int lapic_enable(unsigned cpu) { u32_t val, nlvt; @@ -735,7 +735,7 @@ PUBLIC int lapic_enable(unsigned cpu) return 1; } -PUBLIC void apic_spurios_intr_handler(void) +void apic_spurios_intr_handler(void) { static unsigned x; @@ -744,7 +744,7 @@ PUBLIC void apic_spurios_intr_handler(void) printf("WARNING spurious interrupt(s) %d on cpu %d\n", x, cpuid); } -PUBLIC void apic_error_intr_handler(void) +void apic_error_intr_handler(void) { static unsigned x; @@ -754,7 +754,7 @@ PUBLIC void apic_error_intr_handler(void) lapic_errstatus(), x, cpuid); } -PRIVATE struct gate_table_s gate_table_ioapic[] = { +static struct gate_table_s gate_table_ioapic[] = { { apic_hwint0, LAPIC_VECTOR( 0), INTR_PRIVILEGE }, { apic_hwint1, LAPIC_VECTOR( 1), INTR_PRIVILEGE }, { apic_hwint2, LAPIC_VECTOR( 2), INTR_PRIVILEGE }, @@ -824,14 +824,14 @@ PRIVATE struct gate_table_s gate_table_ioapic[] = { { NULL, 0, 0} }; -PRIVATE struct gate_table_s gate_table_common[] = { +static struct gate_table_s gate_table_common[] = { { ipc_entry, IPC_VECTOR, USER_PRIVILEGE }, { kernel_call_entry, KERN_CALL_VECTOR, USER_PRIVILEGE }, { NULL, 0, 0} }; #ifdef CONFIG_SMP -PRIVATE struct gate_table_s gate_table_smp[] = { +static struct gate_table_s gate_table_smp[] = { { apic_ipi_sched_intr, APIC_SMP_SCHED_PROC_VECTOR, INTR_PRIVILEGE }, { apic_ipi_halt_intr, APIC_SMP_CPU_HALT_VECTOR, INTR_PRIVILEGE }, { NULL, 0, 0} @@ -839,7 +839,7 @@ PRIVATE struct gate_table_s gate_table_smp[] = { #endif #ifdef APIC_DEBUG -PRIVATE void lapic_set_dummy_handlers(void) +static void lapic_set_dummy_handlers(void) { char * handler; int vect = 32; /* skip the reserved vectors */ @@ -856,7 +856,7 @@ PRIVATE void lapic_set_dummy_handlers(void) #endif /* Build descriptors for interrupt gates in IDT. */ -PUBLIC void apic_idt_init(const int reset) +void apic_idt_init(const int reset) { u32_t val; @@ -905,7 +905,7 @@ PUBLIC void apic_idt_init(const int reset) } -PRIVATE int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max) +static int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max) { unsigned n = 0; struct acpi_madt_ioapic * acpi_ioa; @@ -932,7 +932,7 @@ PRIVATE int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max return n; } -PUBLIC int detect_ioapics(void) +int detect_ioapics(void) { int status; @@ -948,7 +948,7 @@ PUBLIC int detect_ioapics(void) #ifdef CONFIG_SMP -PUBLIC void apic_send_ipi(unsigned vector, unsigned cpu, int type) +void apic_send_ipi(unsigned vector, unsigned cpu, int type) { u32_t icr1, icr2; @@ -987,7 +987,7 @@ PUBLIC void apic_send_ipi(unsigned vector, unsigned cpu, int type) } -PUBLIC int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline) +int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline) { int timeout; u32_t errstatus = 0; @@ -1033,7 +1033,7 @@ PUBLIC int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline) return 0; } -PUBLIC int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline) +int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline) { u32_t ptr, errstatus = 0; int timeout; @@ -1108,7 +1108,7 @@ PUBLIC int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline) #endif #ifndef CONFIG_SMP -PUBLIC int apic_single_cpu_init(void) +int apic_single_cpu_init(void) { if (!cpu_feature_apic_on_chip()) return 0; @@ -1143,7 +1143,7 @@ PUBLIC int apic_single_cpu_init(void) } #endif -PRIVATE eoi_method_t set_eoi_method(unsigned irq) +static eoi_method_t set_eoi_method(unsigned irq) { /* * in APIC mode the lowest 16 IRQs are reserved for legacy (E)ISA edge @@ -1156,7 +1156,7 @@ PRIVATE eoi_method_t set_eoi_method(unsigned irq) return ioapic_eoi_level; } -PUBLIC void set_irq_redir_low(unsigned irq, u32_t * low) +void set_irq_redir_low(unsigned irq, u32_t * low) { u32_t val = 0; @@ -1182,7 +1182,7 @@ PUBLIC void set_irq_redir_low(unsigned irq, u32_t * low) *low = val; } -PUBLIC void ioapic_set_irq(unsigned irq) +void ioapic_set_irq(unsigned irq) { unsigned ioa; @@ -1216,7 +1216,7 @@ PUBLIC void ioapic_set_irq(unsigned irq) } } -PUBLIC void ioapic_unset_irq(unsigned irq) +void ioapic_unset_irq(unsigned irq) { assert(irq < NR_IRQ_VECTORS); @@ -1225,7 +1225,7 @@ PUBLIC void ioapic_unset_irq(unsigned irq) io_apic_irq[irq].eoi = NULL; } -PUBLIC void ioapic_reset_pic(void) +void ioapic_reset_pic(void) { apic_idt_init(TRUE); /* reset */ idt_reload(); @@ -1238,7 +1238,7 @@ PUBLIC void ioapic_reset_pic(void) intr_init(INTS_ORIG, 0); /* no auto eoi */ } -PRIVATE void irq_lapic_status(int irq) +static void irq_lapic_status(int irq) { u32_t lo; reg_t tmr, irr, isr; @@ -1280,7 +1280,7 @@ PRIVATE void irq_lapic_status(int irq) "masked" : "unmasked"); } -PUBLIC void dump_apic_irq_state(void) +void dump_apic_irq_state(void) { int irq; diff --git a/kernel/arch/i386/arch_clock.c b/kernel/arch/i386/arch_clock.c index 7ac9ae2f7..07a006e8d 100644 --- a/kernel/arch/i386/arch_clock.c +++ b/kernel/arch/i386/arch_clock.c @@ -34,18 +34,18 @@ #define TIMER_FREQ 1193182 /* clock frequency for timer in PC and AT */ #define TIMER_COUNT(freq) (TIMER_FREQ/(freq)) /* initial value for counter*/ -PRIVATE irq_hook_t pic_timer_hook; /* interrupt handler hook */ +static irq_hook_t pic_timer_hook; /* interrupt handler hook */ -PRIVATE unsigned probe_ticks; -PRIVATE u64_t tsc0, tsc1; +static unsigned probe_ticks; +static u64_t tsc0, tsc1; #define PROBE_TICKS (system_hz / 10) -PRIVATE unsigned tsc_per_ms[CONFIG_MAX_CPUS]; +static unsigned tsc_per_ms[CONFIG_MAX_CPUS]; /*===========================================================================* * init_8235A_timer * *===========================================================================*/ -PUBLIC int init_8253A_timer(const unsigned freq) +int init_8253A_timer(const unsigned freq) { /* Initialize channel 0 of the 8253A timer to, e.g., 60 Hz, * and register the CLOCK task's interrupt handler to be run @@ -61,7 +61,7 @@ PUBLIC int init_8253A_timer(const unsigned freq) /*===========================================================================* * stop_8235A_timer * *===========================================================================*/ -PUBLIC void stop_8253A_timer(void) +void stop_8253A_timer(void) { /* Reset the clock to the BIOS rate. (For rebooting.) */ outb(TIMER_MODE, 0x36); @@ -69,7 +69,7 @@ PUBLIC void stop_8253A_timer(void) outb(TIMER0, 0); } -PRIVATE int calib_cpu_handler(irq_hook_t * UNUSED(hook)) +static int calib_cpu_handler(irq_hook_t * UNUSED(hook)) { u64_t tsc; @@ -89,7 +89,7 @@ PRIVATE int calib_cpu_handler(irq_hook_t * UNUSED(hook)) return 1; } -PRIVATE void estimate_cpu_freq(void) +static void estimate_cpu_freq(void) { u64_t tsc_delta; u64_t cpu_freq; @@ -124,7 +124,7 @@ PRIVATE void estimate_cpu_freq(void) BOOT_VERBOSE(cpu_print_freq(cpuid)); } -PUBLIC int init_local_timer(unsigned freq) +int init_local_timer(unsigned freq) { #ifdef USE_APIC /* if we know the address, lapic is enabled and we should use it */ @@ -147,7 +147,7 @@ PUBLIC int init_local_timer(unsigned freq) return 0; } -PUBLIC void stop_local_timer(void) +void stop_local_timer(void) { #ifdef USE_APIC if (lapic_addr) { @@ -160,7 +160,7 @@ PUBLIC void stop_local_timer(void) } } -PUBLIC void restart_local_timer(void) +void restart_local_timer(void) { #ifdef USE_APIC if (lapic_addr) { @@ -169,7 +169,7 @@ PUBLIC void restart_local_timer(void) #endif } -PUBLIC int register_local_timer_handler(const irq_handler_t handler) +int register_local_timer_handler(const irq_handler_t handler) { #ifdef USE_APIC if (lapic_addr) { @@ -188,7 +188,7 @@ PUBLIC int register_local_timer_handler(const irq_handler_t handler) return 0; } -PUBLIC void cycles_accounting_init(void) +void cycles_accounting_init(void) { #ifdef CONFIG_SMP unsigned cpu = cpuid; @@ -200,7 +200,7 @@ PUBLIC void cycles_accounting_init(void) make_zero64(get_cpu_var(cpu, cpu_last_idle)); } -PUBLIC void context_stop(struct proc * p) +void context_stop(struct proc * p) { u64_t tsc, tsc_delta; u64_t * __tsc_ctr_switch = get_cpulocal_var_ptr(tsc_ctr_switch); @@ -297,7 +297,7 @@ PUBLIC void context_stop(struct proc * p) *__tsc_ctr_switch = tsc; } -PUBLIC void context_stop_idle(void) +void context_stop_idle(void) { int is_idle; #ifdef CONFIG_SMP @@ -317,17 +317,17 @@ PUBLIC void context_stop_idle(void) #endif } -PUBLIC u64_t ms_2_cpu_time(unsigned ms) +u64_t ms_2_cpu_time(unsigned ms) { return mul64u(tsc_per_ms[cpuid], ms); } -PUBLIC unsigned cpu_time_2_ms(u64_t cpu_time) +unsigned cpu_time_2_ms(u64_t cpu_time) { return div64u(cpu_time, tsc_per_ms[cpuid]); } -PUBLIC short cpu_load(void) +short cpu_load(void) { u64_t current_tsc, *current_idle; u64_t tsc_delta, idle_delta, busy; @@ -365,7 +365,7 @@ PUBLIC short cpu_load(void) return load; } -PUBLIC void busy_delay_ms(int ms) +void busy_delay_ms(int ms) { u64_t cycles = ms_2_cpu_time(ms), tsc0, tsc, tsc1; read_tsc_64(&tsc0); diff --git a/kernel/arch/i386/arch_do_vmctl.c b/kernel/arch/i386/arch_do_vmctl.c index 242bf01cd..7a90bf6a7 100644 --- a/kernel/arch/i386/arch_do_vmctl.c +++ b/kernel/arch/i386/arch_do_vmctl.c @@ -15,7 +15,7 @@ /*===========================================================================* * arch_do_vmctl * *===========================================================================*/ -PUBLIC int arch_do_vmctl(m_ptr, p) +int arch_do_vmctl(m_ptr, p) register message *m_ptr; /* pointer to request message */ struct proc *p; { diff --git a/kernel/arch/i386/arch_smp.c b/kernel/arch/i386/arch_smp.c index 738024b2f..3cb9aed71 100644 --- a/kernel/arch/i386/arch_smp.c +++ b/kernel/arch/i386/arch_smp.c @@ -42,18 +42,18 @@ static int volatile ap_cpu_ready; static int volatile cpu_down; /* there can be at most 255 local APIC ids, each fits in 8 bits */ -PRIVATE unsigned char apicid2cpuid[255]; -PUBLIC unsigned char cpuid2apicid[CONFIG_MAX_CPUS]; +static unsigned char apicid2cpuid[255]; +unsigned char cpuid2apicid[CONFIG_MAX_CPUS]; SPINLOCK_DEFINE(smp_cpu_lock) SPINLOCK_DEFINE(dispq_lock) -FORWARD void smp_reinit_vars(void); +static void smp_reinit_vars(void); /* * copies the 16-bit AP trampoline code to the first 1M of memory */ -PRIVATE phys_bytes copy_trampoline(void) +static phys_bytes copy_trampoline(void) { char * s, *end; phys_bytes tramp_base = 0; @@ -93,7 +93,7 @@ PRIVATE phys_bytes copy_trampoline(void) return tramp_base; } -PRIVATE void smp_start_aps(void) +static void smp_start_aps(void) { /* * Find an address and align it to a 4k boundary. @@ -167,12 +167,12 @@ PRIVATE void smp_start_aps(void) NOT_REACHABLE; } -PUBLIC void smp_halt_cpu (void) +void smp_halt_cpu (void) { NOT_IMPLEMENTED; } -PUBLIC void smp_shutdown_aps(void) +void smp_shutdown_aps(void) { unsigned cpu; @@ -209,7 +209,7 @@ exit_shutdown_aps: return; } -PRIVATE void ap_finish_booting(void) +static void ap_finish_booting(void) { unsigned cpu = cpuid; @@ -257,13 +257,13 @@ PRIVATE void ap_finish_booting(void) NOT_REACHABLE; } -PUBLIC void smp_ap_boot(void) +void smp_ap_boot(void) { switch_k_stack((char *)get_k_stack_top(__ap_id) - X86_STACK_TOP_RESERVED, ap_finish_booting); } -PRIVATE void smp_reinit_vars(void) +static void smp_reinit_vars(void) { lapic_addr = lapic_eoi_addr = 0; ioapic_enabled = 0; @@ -271,7 +271,7 @@ PRIVATE void smp_reinit_vars(void) ncpus = 1; } -PRIVATE void tss_init_all(void) +static void tss_init_all(void) { unsigned cpu; @@ -279,7 +279,7 @@ PRIVATE void tss_init_all(void) tss_init(cpu, get_k_stack_top(cpu)); } -PRIVATE int discover_cpus(void) +static int discover_cpus(void) { struct acpi_madt_lapic * cpu; @@ -293,7 +293,7 @@ PRIVATE int discover_cpus(void) return ncpus; } -PUBLIC void smp_init (void) +void smp_init (void) { /* read the MP configuration */ if (!discover_cpus()) { @@ -351,7 +351,7 @@ uniproc_fallback: printf("WARNING : SMP initialization failed\n"); } -PUBLIC void arch_smp_halt_cpu(void) +void arch_smp_halt_cpu(void) { /* say that we are down */ cpu_down = cpuid; @@ -361,7 +361,7 @@ PUBLIC void arch_smp_halt_cpu(void) for(;;); } -PUBLIC void arch_send_smp_schedule_ipi(unsigned cpu) +void arch_send_smp_schedule_ipi(unsigned cpu) { apic_send_ipi(APIC_SMP_SCHED_PROC_VECTOR, cpu, APIC_IPI_DEST); } diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index d17809dd0..453047ef5 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -34,7 +34,7 @@ #include "acpi.h" #endif -PRIVATE int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */ +static int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */ extern __dead void poweroff_jmp(); extern void poweroff16(); @@ -47,17 +47,17 @@ extern void poweroff16_end(); /* set OSXMMEXCPT[bit 10] if we provide #XM handler. */ #define CR4_OSXMMEXCPT (1L<<10) -PUBLIC void * k_stacks; +void * k_stacks; -FORWARD void ser_debug(int c); +static void ser_debug(int c); #ifdef CONFIG_SMP -FORWARD void ser_dump_proc_cpu(void); +static void ser_dump_proc_cpu(void); #endif #if !CONFIG_OXPCIE -FORWARD void ser_init(void); +static void ser_init(void); #endif -PUBLIC __dead void arch_monitor(void) +__dead void arch_monitor(void) { monitor(); } @@ -118,7 +118,7 @@ reset(void) } } -PRIVATE __dead void arch_bios_poweroff(void) +static __dead void arch_bios_poweroff(void) { u32_t cr0; @@ -134,9 +134,9 @@ PRIVATE __dead void arch_bios_poweroff(void) poweroff_jmp(); } -PUBLIC int cpu_has_tsc; +int cpu_has_tsc; -PUBLIC __dead void arch_shutdown(int how) +__dead void arch_shutdown(int how) { u16_t magic; vm_stop(); @@ -236,7 +236,7 @@ PUBLIC __dead void arch_shutdown(int how) NOT_REACHABLE; } -PUBLIC void fpu_init(void) +void fpu_init(void) { unsigned short cw, sw; @@ -273,7 +273,7 @@ PUBLIC void fpu_init(void) } } -PUBLIC void save_local_fpu(struct proc *pr, int retain) +void save_local_fpu(struct proc *pr, int retain) { /* Save process FPU context. If the 'retain' flag is set, keep the FPU * state as is. If the flag is not set, the state is undefined upon @@ -292,7 +292,7 @@ PUBLIC void save_local_fpu(struct proc *pr, int retain) } } -PUBLIC void save_fpu(struct proc *pr) +void save_fpu(struct proc *pr) { #ifdef CONFIG_SMP if (cpuid != pr->p_cpu) { @@ -322,7 +322,7 @@ PUBLIC void save_fpu(struct proc *pr) } } -PUBLIC int restore_fpu(struct proc *pr) +int restore_fpu(struct proc *pr) { int failed; @@ -342,7 +342,7 @@ PUBLIC int restore_fpu(struct proc *pr) return OK; } -PUBLIC void cpu_identify(void) +void cpu_identify(void) { u32_t eax, ebx, ecx, edx; unsigned cpu = cpuid; @@ -376,7 +376,7 @@ PUBLIC void cpu_identify(void) cpu_info[cpu].flags[1] = edx; } -PUBLIC void arch_init(void) +void arch_init(void) { #ifdef USE_APIC /* @@ -424,7 +424,7 @@ PUBLIC void arch_init(void) } #ifdef DEBUG_SERIAL -PUBLIC void ser_putc(char c) +void ser_putc(char c) { int i; int lsr, thr; @@ -447,7 +447,7 @@ PUBLIC void ser_putc(char c) /*===========================================================================* * do_ser_debug * *===========================================================================*/ -PUBLIC void do_ser_debug() +void do_ser_debug() { u8_t c, lsr; @@ -466,7 +466,7 @@ PUBLIC void do_ser_debug() ser_debug(c); } -PRIVATE void ser_dump_queue_cpu(unsigned cpu) +static void ser_dump_queue_cpu(unsigned cpu) { int q; struct proc ** rdy_head; @@ -485,7 +485,7 @@ PRIVATE void ser_dump_queue_cpu(unsigned cpu) } } -PRIVATE void ser_dump_queues(void) +static void ser_dump_queues(void) { #ifdef CONFIG_SMP unsigned cpu; @@ -500,7 +500,7 @@ PRIVATE void ser_dump_queues(void) #endif } -PRIVATE void ser_dump_segs(void) +static void ser_dump_segs(void) { struct proc *pp; for (pp= BEG_PROC_ADDR; pp < END_PROC_ADDR; pp++) @@ -517,7 +517,7 @@ PRIVATE void ser_dump_segs(void) } #ifdef CONFIG_SMP -PRIVATE void dump_bkl_usage(void) +static void dump_bkl_usage(void) { unsigned cpu; @@ -532,7 +532,7 @@ PRIVATE void dump_bkl_usage(void) } } -PRIVATE void reset_bkl_usage(void) +static void reset_bkl_usage(void) { memset(kernel_ticks, 0, sizeof(kernel_ticks)); memset(bkl_ticks, 0, sizeof(bkl_ticks)); @@ -541,7 +541,7 @@ PRIVATE void reset_bkl_usage(void) } #endif -PRIVATE void ser_debug(const int c) +static void ser_debug(const int c) { serial_debug_active = 1; @@ -596,7 +596,7 @@ PRIVATE void ser_debug(const int c) serial_debug_active = 0; } -PUBLIC void ser_dump_proc() +void ser_dump_proc() { struct proc *pp; @@ -609,7 +609,7 @@ PUBLIC void ser_dump_proc() } #ifdef CONFIG_SMP -PRIVATE void ser_dump_proc_cpu(void) +static void ser_dump_proc_cpu(void) { struct proc *pp; unsigned cpu; @@ -629,7 +629,7 @@ PRIVATE void ser_dump_proc_cpu(void) #if SPROFILE -PUBLIC int arch_init_profile_clock(const u32_t freq) +int arch_init_profile_clock(const u32_t freq) { int r; /* Set CMOS timer frequency. */ @@ -647,7 +647,7 @@ PUBLIC int arch_init_profile_clock(const u32_t freq) return CMOS_CLOCK_IRQ; } -PUBLIC void arch_stop_profile_clock(void) +void arch_stop_profile_clock(void) { int r; /* Disable CMOS timer interrupts. */ @@ -657,7 +657,7 @@ PUBLIC void arch_stop_profile_clock(void) outb(RTC_IO, r & ~RTC_B_PIE); } -PUBLIC void arch_ack_profile_clock(void) +void arch_ack_profile_clock(void) { /* Mandatory read of CMOS register to re-enable timer interrupts. */ outb(RTC_INDEX, RTC_REG_C); @@ -669,7 +669,7 @@ PUBLIC void arch_ack_profile_clock(void) /* Saved by mpx386.s into these variables. */ u32_t params_size, params_offset, mon_ds; -PUBLIC int arch_get_params(char *params, int maxsize) +int arch_get_params(char *params, int maxsize) { phys_copy(seg2phys(mon_ds) + params_offset, vir2phys(params), MIN(maxsize, params_size)); @@ -677,7 +677,7 @@ PUBLIC int arch_get_params(char *params, int maxsize) return OK; } -PUBLIC int arch_set_params(char *params, int size) +int arch_set_params(char *params, int size) { if(size > params_size) return E2BIG; @@ -685,7 +685,7 @@ PUBLIC int arch_set_params(char *params, int size) return OK; } -PUBLIC void arch_do_syscall(struct proc *proc) +void arch_do_syscall(struct proc *proc) { /* do_ipc assumes that it's running because of the current process */ assert(proc == get_cpulocal_var(proc_ptr)); @@ -694,7 +694,7 @@ PUBLIC void arch_do_syscall(struct proc *proc) do_ipc(proc->p_reg.cx, proc->p_reg.retreg, proc->p_reg.bx); } -PUBLIC struct proc * arch_finish_switch_to_user(void) +struct proc * arch_finish_switch_to_user(void) { char * stk; struct proc * p; @@ -710,7 +710,7 @@ PUBLIC struct proc * arch_finish_switch_to_user(void) return p; } -PUBLIC void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigcontext *sc) +void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigcontext *sc) { int fp_error; @@ -744,7 +744,7 @@ PUBLIC void fpu_sigcontext(struct proc *pr, struct sigframe *fr, struct sigconte } #if !CONFIG_OXPCIE -PRIVATE void ser_init(void) +static void ser_init(void) { unsigned char lcr; unsigned divisor; diff --git a/kernel/arch/i386/arch_watchdog.c b/kernel/arch/i386/arch_watchdog.c index ac30dc4f6..b6884e4d4 100644 --- a/kernel/arch/i386/arch_watchdog.c +++ b/kernel/arch/i386/arch_watchdog.c @@ -18,10 +18,10 @@ * Intel architecture performance counters watchdog */ -PRIVATE struct arch_watchdog intel_arch_watchdog; -PRIVATE struct arch_watchdog amd_watchdog; +static struct arch_watchdog intel_arch_watchdog; +static struct arch_watchdog amd_watchdog; -PRIVATE void intel_arch_watchdog_init(const unsigned cpu) +static void intel_arch_watchdog_init(const unsigned cpu) { u64_t cpuf; u32_t val; @@ -51,13 +51,13 @@ PRIVATE void intel_arch_watchdog_init(const unsigned cpu) lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI); } -PRIVATE void intel_arch_watchdog_reinit(const unsigned cpu) +static void intel_arch_watchdog_reinit(const unsigned cpu) { lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI); ia32_msr_write(INTEL_MSR_PERFMON_CRT0, 0, ex64lo(watchdog->resetval)); } -PUBLIC int arch_watchdog_init(void) +int arch_watchdog_init(void) { u32_t eax, ebx, ecx, edx; unsigned cpu = cpuid; @@ -105,11 +105,11 @@ PUBLIC int arch_watchdog_init(void) return 0; } -PUBLIC void arch_watchdog_stop(void) +void arch_watchdog_stop(void) { } -PUBLIC void arch_watchdog_lockup(const struct nmi_frame * frame) +void arch_watchdog_lockup(const struct nmi_frame * frame) { printf("KERNEL LOCK UP\n" "eax 0x%08x\n" @@ -144,7 +144,7 @@ PUBLIC void arch_watchdog_lockup(const struct nmi_frame * frame) panic("Kernel lockup"); } -PUBLIC int i386_watchdog_start(void) +int i386_watchdog_start(void) { if (arch_watchdog_init()) { printf("WARNING watchdog initialization " @@ -158,7 +158,7 @@ PUBLIC int i386_watchdog_start(void) return 0; } -PRIVATE int intel_arch_watchdog_profile_init(const unsigned freq) +static int intel_arch_watchdog_profile_init(const unsigned freq) { u64_t cpuf; @@ -181,7 +181,7 @@ PRIVATE int intel_arch_watchdog_profile_init(const unsigned freq) return OK; } -PRIVATE struct arch_watchdog intel_arch_watchdog = { +static struct arch_watchdog intel_arch_watchdog = { /*.init = */ intel_arch_watchdog_init, /*.reinit = */ intel_arch_watchdog_reinit, /*.profile_init = */ intel_arch_watchdog_profile_init @@ -191,7 +191,7 @@ PRIVATE struct arch_watchdog intel_arch_watchdog = { #define AMD_MSR_EVENT_CTR0 0xc0010004 #define AMD_MSR_EVENT_SEL0_ENABLE (1 << 22) -PRIVATE void amd_watchdog_init(const unsigned cpu) +static void amd_watchdog_init(const unsigned cpu) { u64_t cpuf; u32_t val; @@ -216,14 +216,14 @@ PRIVATE void amd_watchdog_init(const unsigned cpu) lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI); } -PRIVATE void amd_watchdog_reinit(const unsigned cpu) +static void amd_watchdog_reinit(const unsigned cpu) { lapic_write(LAPIC_LVTPCR, APIC_ICR_DM_NMI); ia32_msr_write(AMD_MSR_EVENT_CTR0, ex64hi(watchdog->resetval), ex64lo(watchdog->resetval)); } -PRIVATE int amd_watchdog_profile_init(const unsigned freq) +static int amd_watchdog_profile_init(const unsigned freq) { u64_t cpuf; @@ -237,7 +237,7 @@ PRIVATE int amd_watchdog_profile_init(const unsigned freq) return OK; } -PRIVATE struct arch_watchdog amd_watchdog = { +static struct arch_watchdog amd_watchdog = { /*.init = */ amd_watchdog_init, /*.reinit = */ amd_watchdog_reinit, /*.profile_init = */ amd_watchdog_profile_init diff --git a/kernel/arch/i386/breakpoints.c b/kernel/arch/i386/breakpoints.c index 8850a842d..0965d9e5b 100644 --- a/kernel/arch/i386/breakpoints.c +++ b/kernel/arch/i386/breakpoints.c @@ -3,7 +3,7 @@ #include "debugreg.h" -PUBLIC int breakpoint_set(phys_bytes linaddr, int bp, const int flags) +int breakpoint_set(phys_bytes linaddr, int bp, const int flags) { unsigned long dr7, dr7flags; diff --git a/kernel/arch/i386/do_int86.c b/kernel/arch/i386/do_int86.c index 84021cbed..3ed1c4b50 100644 --- a/kernel/arch/i386/do_int86.c +++ b/kernel/arch/i386/do_int86.c @@ -17,7 +17,7 @@ struct reg86u reg86; /*===========================================================================* * do_int86 * *===========================================================================*/ -PUBLIC int do_int86(struct proc * caller, message * m_ptr) +int do_int86(struct proc * caller, message * m_ptr) { data_copy(caller->p_endpoint, (vir_bytes) m_ptr->INT86_REG86, KERNEL, (vir_bytes) ®86, sizeof(reg86)); diff --git a/kernel/arch/i386/do_iopenable.c b/kernel/arch/i386/do_iopenable.c index ea4a17150..2c27c2de0 100644 --- a/kernel/arch/i386/do_iopenable.c +++ b/kernel/arch/i386/do_iopenable.c @@ -17,7 +17,7 @@ /*===========================================================================* * do_iopenable * *===========================================================================*/ -PUBLIC int do_iopenable(struct proc * caller, message * m_ptr) +int do_iopenable(struct proc * caller, message * m_ptr) { int proc_nr; diff --git a/kernel/arch/i386/do_readbios.c b/kernel/arch/i386/do_readbios.c index 552716be6..c2a8e21ca 100644 --- a/kernel/arch/i386/do_readbios.c +++ b/kernel/arch/i386/do_readbios.c @@ -13,7 +13,7 @@ /*===========================================================================* * do_readbios * *===========================================================================*/ -PUBLIC int do_readbios(struct proc * caller, message * m_ptr) +int do_readbios(struct proc * caller, message * m_ptr) { struct vir_addr src, dst; diff --git a/kernel/arch/i386/do_sdevio.c b/kernel/arch/i386/do_sdevio.c index f141a9c2b..2f3e0822d 100644 --- a/kernel/arch/i386/do_sdevio.c +++ b/kernel/arch/i386/do_sdevio.c @@ -21,7 +21,7 @@ /*===========================================================================* * do_sdevio * *===========================================================================*/ -PUBLIC int do_sdevio(struct proc * caller, message *m_ptr) +int do_sdevio(struct proc * caller, message *m_ptr) { vir_bytes newoffset; endpoint_t newep; diff --git a/kernel/arch/i386/exception.c b/kernel/arch/i386/exception.c index 99c169814..e8dd6ac6a 100644 --- a/kernel/arch/i386/exception.c +++ b/kernel/arch/i386/exception.c @@ -41,14 +41,14 @@ static struct ex_s ex_data[] = { { "SIMD exception", SIGFPE, 386 }, }; -PRIVATE void inkernel_disaster(struct proc *saved_proc, +static void inkernel_disaster(struct proc *saved_proc, struct exception_frame *frame, struct ex_s *ep, int is_nested); extern int catch_pagefaults; -PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc); +static void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc); -PRIVATE void pagefault( struct proc *pr, +static void pagefault( struct proc *pr, struct exception_frame * frame, int is_nested) { @@ -132,7 +132,7 @@ PRIVATE void pagefault( struct proc *pr, return; } -PRIVATE void inkernel_disaster(struct proc *saved_proc, +static void inkernel_disaster(struct proc *saved_proc, struct exception_frame * frame, struct ex_s *ep, int is_nested) { @@ -184,7 +184,7 @@ PRIVATE void inkernel_disaster(struct proc *saved_proc, /*===========================================================================* * exception * *===========================================================================*/ -PUBLIC void exception_handler(int is_nested, struct exception_frame * frame) +void exception_handler(int is_nested, struct exception_frame * frame) { /* An exception or unexpected interrupt has occurred. */ register struct ex_s *ep; @@ -278,7 +278,7 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame) /*===========================================================================* * proc_stacktrace_execute * *===========================================================================*/ -PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc) +static void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t pc) { reg_t v_hbp; int iskernel; @@ -322,21 +322,21 @@ PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t p /*===========================================================================* * proc_stacktrace * *===========================================================================*/ -PUBLIC void proc_stacktrace(struct proc *whichproc) +void proc_stacktrace(struct proc *whichproc) { #if USE_SYSDEBUG proc_stacktrace_execute(whichproc, whichproc->p_reg.fp, whichproc->p_reg.pc); #endif /* USE_SYSDEBUG */ } -PUBLIC void enable_fpu_exception(void) +void enable_fpu_exception(void) { u32_t cr0 = read_cr0(); if(!(cr0 & I386_CR0_TS)) write_cr0(cr0 | I386_CR0_TS); } -PUBLIC void disable_fpu_exception(void) +void disable_fpu_exception(void) { clts(); } diff --git a/kernel/arch/i386/i8259.c b/kernel/arch/i386/i8259.c index a4bf29e25..ca3eac642 100644 --- a/kernel/arch/i386/i8259.c +++ b/kernel/arch/i386/i8259.c @@ -27,7 +27,7 @@ /*===========================================================================* * intr_init * *===========================================================================*/ -PUBLIC int intr_init(const int mine, const int auto_eoi) +int intr_init(const int mine, const int auto_eoi) { /* Initialize the 8259s, finishing with all interrupts disabled. This is * only done in protected mode, in real mode we don't touch the 8259s, but @@ -72,27 +72,27 @@ PUBLIC int intr_init(const int mine, const int auto_eoi) return OK; } -PUBLIC void irq_8259_unmask(const int irq) +void irq_8259_unmask(const int irq) { const unsigned ctl_mask = irq < 8 ? INT_CTLMASK : INT2_CTLMASK; outb(ctl_mask, inb(ctl_mask) & ~(1 << (irq & 0x7))); } -PUBLIC void irq_8259_mask(const int irq) +void irq_8259_mask(const int irq) { const unsigned ctl_mask = irq < 8 ? INT_CTLMASK : INT2_CTLMASK; outb(ctl_mask, inb(ctl_mask) | (1 << (irq & 0x7))); } /* Disable 8259 - write 0xFF in OCW1 master and slave. */ -PUBLIC void i8259_disable(void) +void i8259_disable(void) { outb(INT2_CTLMASK, 0xFF); outb(INT_CTLMASK, 0xFF); inb(INT_CTLMASK); } -PUBLIC void irq_8259_eoi(int irq) +void irq_8259_eoi(int irq) { if (irq < 8) eoi_8259_master(); diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 1f7f8c106..875f8b67c 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -27,20 +27,20 @@ #endif #endif -PUBLIC int i386_paging_enabled = 0; +int i386_paging_enabled = 0; -PRIVATE int psok = 0; +static int psok = 0; #define MAX_FREEPDES 2 -PRIVATE int nfreepdes = 0, freepdes[MAX_FREEPDES]; +static int nfreepdes = 0, freepdes[MAX_FREEPDES]; #define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0) -FORWARD u32_t phys_get32(phys_bytes v); -FORWARD void vm_enable_paging(void); +static u32_t phys_get32(phys_bytes v); +static void vm_enable_paging(void); -PUBLIC void segmentation2paging(struct proc * current) +void segmentation2paging(struct proc * current) { /* switch to the current process page tables before turning paging on */ switch_address_space(current); @@ -67,7 +67,7 @@ PUBLIC void segmentation2paging(struct proc * current) * pde number to be used, and a pointer to it (linear address) is returned * for actual use by phys_copy or phys_memset. */ -PRIVATE phys_bytes createpde( +static phys_bytes createpde( const struct proc *pr, /* Requested process, NULL for physical. */ const phys_bytes linaddr,/* Address after segment translation. */ phys_bytes *bytes, /* Size of chunk, function may truncate it. */ @@ -132,7 +132,7 @@ PRIVATE phys_bytes createpde( /*===========================================================================* * lin_lin_copy * *===========================================================================*/ -PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr, +static int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr, struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes) { u32_t addr; @@ -214,7 +214,7 @@ PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr, } -PRIVATE u32_t phys_get32(phys_bytes addr) +static u32_t phys_get32(phys_bytes addr) { const u32_t v; int r; @@ -233,7 +233,7 @@ PRIVATE u32_t phys_get32(phys_bytes addr) } #if 0 -PRIVATE char *cr0_str(u32_t e) +static char *cr0_str(u32_t e) { static char str[80]; strcpy(str, ""); @@ -249,7 +249,7 @@ PRIVATE char *cr0_str(u32_t e) return str; } -PRIVATE char *cr4_str(u32_t e) +static char *cr4_str(u32_t e) { static char str[80]; strcpy(str, ""); @@ -266,12 +266,12 @@ PRIVATE char *cr4_str(u32_t e) } #endif -PUBLIC void vm_stop(void) +void vm_stop(void) { write_cr0(read_cr0() & ~I386_CR0_PG); } -PRIVATE void vm_enable_paging(void) +static void vm_enable_paging(void) { u32_t cr0, cr4; int pgeok; @@ -311,7 +311,7 @@ PRIVATE void vm_enable_paging(void) /*===========================================================================* * umap_local * *===========================================================================*/ -PUBLIC phys_bytes umap_local(rp, seg, vir_addr, bytes) +phys_bytes umap_local(rp, seg, vir_addr, bytes) register struct proc *rp; /* pointer to proc table entry for process */ int seg; /* T, D, or S segment */ vir_bytes vir_addr; /* virtual address in bytes within the seg */ @@ -350,7 +350,7 @@ vir_bytes bytes; /* # of bytes to be copied */ /*===========================================================================* * umap_virtual * *===========================================================================*/ -PUBLIC phys_bytes umap_virtual(rp, seg, vir_addr, bytes) +phys_bytes umap_virtual(rp, seg, vir_addr, bytes) register struct proc *rp; /* pointer to proc table entry for process */ int seg; /* T, D, or S segment */ vir_bytes vir_addr; /* virtual address in bytes within the seg */ @@ -399,7 +399,7 @@ vir_bytes bytes; /* # of bytes to be copied */ /*===========================================================================* * vm_lookup * *===========================================================================*/ -PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual, +int vm_lookup(const struct proc *proc, const vir_bytes virtual, phys_bytes *physical, u32_t *ptent) { u32_t *root, *pt; @@ -455,7 +455,7 @@ PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual, /*===========================================================================* * vm_lookup_range * *===========================================================================*/ -PUBLIC size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr, +size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr, phys_bytes *phys_addr, size_t bytes) { /* Look up the physical address corresponding to linear virtual address @@ -507,7 +507,7 @@ PUBLIC size_t vm_lookup_range(const struct proc *proc, vir_bytes vir_addr, /*===========================================================================* * vm_suspend * *===========================================================================*/ -PRIVATE void vm_suspend(struct proc *caller, const struct proc *target, +static void vm_suspend(struct proc *caller, const struct proc *target, const vir_bytes linaddr, const vir_bytes len, const int type) { /* This range is not OK for this process. Set parameters @@ -534,7 +534,7 @@ PRIVATE void vm_suspend(struct proc *caller, const struct proc *target, /*===========================================================================* * vm_check_range * *===========================================================================*/ -PUBLIC int vm_check_range(struct proc *caller, struct proc *target, +int vm_check_range(struct proc *caller, struct proc *target, vir_bytes vir_addr, size_t bytes) { /* Public interface to vm_suspend(), for use by kernel calls. On behalf @@ -562,7 +562,7 @@ PUBLIC int vm_check_range(struct proc *caller, struct proc *target, /*===========================================================================* * delivermsg * *===========================================================================*/ -PUBLIC void delivermsg(struct proc *rp) +void delivermsg(struct proc *rp) { int r = OK; @@ -589,7 +589,7 @@ PUBLIC void delivermsg(struct proc *rp) } #if 0 -PRIVATE char *flagstr(u32_t e, const int dir) +static char *flagstr(u32_t e, const int dir) { static char str[80]; strcpy(str, ""); @@ -606,7 +606,7 @@ PRIVATE char *flagstr(u32_t e, const int dir) return str; } -PRIVATE void vm_pt_print(u32_t *pagetable, const u32_t v) +static void vm_pt_print(u32_t *pagetable, const u32_t v) { int pte; int col = 0; @@ -630,7 +630,7 @@ PRIVATE void vm_pt_print(u32_t *pagetable, const u32_t v) return; } -PRIVATE void vm_print(u32_t *root) +static void vm_print(u32_t *root) { int pde; @@ -705,7 +705,7 @@ int vm_phys_memset(phys_bytes ph, const u8_t c, phys_bytes bytes) /*===========================================================================* * virtual_copy_f * *===========================================================================*/ -PUBLIC int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck) +int virtual_copy_f(caller, src_addr, dst_addr, bytes, vmcheck) struct proc * caller; struct vir_addr *src_addr; /* source virtual address */ struct vir_addr *dst_addr; /* destination virtual address */ @@ -848,7 +848,7 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */ /*===========================================================================* * data_copy * *===========================================================================*/ -PUBLIC int data_copy(const endpoint_t from_proc, const vir_bytes from_addr, +int data_copy(const endpoint_t from_proc, const vir_bytes from_addr, const endpoint_t to_proc, const vir_bytes to_addr, size_t bytes) { @@ -866,7 +866,7 @@ PUBLIC int data_copy(const endpoint_t from_proc, const vir_bytes from_addr, /*===========================================================================* * data_copy_vmcheck * *===========================================================================*/ -PUBLIC int data_copy_vmcheck(struct proc * caller, +int data_copy_vmcheck(struct proc * caller, const endpoint_t from_proc, const vir_bytes from_addr, const endpoint_t to_proc, const vir_bytes to_addr, size_t bytes) @@ -885,7 +885,7 @@ PUBLIC int data_copy_vmcheck(struct proc * caller, /*===========================================================================* * arch_pre_exec * *===========================================================================*/ -PUBLIC void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp) +void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp) { /* set program counter and stack pointer. */ pr->p_reg.pc = ip; @@ -895,7 +895,7 @@ PUBLIC void arch_pre_exec(struct proc *pr, const u32_t ip, const u32_t sp) /*===========================================================================* * arch_umap * *===========================================================================*/ -PUBLIC int arch_umap(const struct proc *pr, vir_bytes offset, vir_bytes count, +int arch_umap(const struct proc *pr, vir_bytes offset, vir_bytes count, int seg, phys_bytes *addr) { switch(seg) { @@ -919,12 +919,12 @@ void i386_freepde(const int pde) freepdes[nfreepdes++] = pde; } -PRIVATE int oxpcie_mapping_index = -1, +static int oxpcie_mapping_index = -1, lapic_mapping_index = -1, ioapic_first_index = -1, ioapic_last_index = -1; -PUBLIC int arch_phys_map(const int index, +int arch_phys_map(const int index, phys_bytes *addr, phys_bytes *len, int *flags) @@ -988,7 +988,7 @@ PUBLIC int arch_phys_map(const int index, return EINVAL; } -PUBLIC int arch_phys_map_reply(const int index, const vir_bytes addr) +int arch_phys_map_reply(const int index, const vir_bytes addr) { #ifdef USE_APIC /* if local APIC is enabled */ @@ -1013,7 +1013,7 @@ PUBLIC int arch_phys_map_reply(const int index, const vir_bytes addr) return EINVAL; } -PUBLIC int arch_enable_paging(struct proc * caller, const message * m_ptr) +int arch_enable_paging(struct proc * caller, const message * m_ptr) { struct vm_ep_data ep_data; int r; @@ -1099,13 +1099,13 @@ PUBLIC int arch_enable_paging(struct proc * caller, const message * m_ptr) return OK; } -PUBLIC void release_address_space(struct proc *pr) +void release_address_space(struct proc *pr) { pr->p_seg.p_cr3_v = NULL; } /* computes a checksum of a buffer of a given length. The byte sum must be zero */ -PUBLIC int platform_tbl_checksum_ok(void *ptr, unsigned int length) +int platform_tbl_checksum_ok(void *ptr, unsigned int length) { u8_t total = 0; unsigned int i; @@ -1114,7 +1114,7 @@ PUBLIC int platform_tbl_checksum_ok(void *ptr, unsigned int length) return !total; } -PUBLIC int platform_tbl_ptr(phys_bytes start, +int platform_tbl_ptr(phys_bytes start, phys_bytes end, unsigned increment, void * buff, diff --git a/kernel/arch/i386/oxpcie.c b/kernel/arch/i386/oxpcie.c index 67c8cd062..4b87f6c10 100644 --- a/kernel/arch/i386/oxpcie.c +++ b/kernel/arch/i386/oxpcie.c @@ -8,14 +8,14 @@ #include "oxpcie.h" #include "serial.h" -PRIVATE unsigned char *oxpcie_vaddr = NULL; +static unsigned char *oxpcie_vaddr = NULL; -PUBLIC void oxpcie_set_vaddr(unsigned char *vaddr) +void oxpcie_set_vaddr(unsigned char *vaddr) { oxpcie_vaddr = vaddr; } -PRIVATE void oxpcie_init(void) +static void oxpcie_init(void) { printf("oxpcie_init\n"); /* Enable access to EFR and DLM+DLL */ @@ -45,7 +45,7 @@ PRIVATE void oxpcie_init(void) OXPCIE_CPR2 = 0; } -PUBLIC void oxpcie_putc(char c) +void oxpcie_putc(char c) { static int inuse = 0; @@ -68,7 +68,7 @@ PUBLIC void oxpcie_putc(char c) } } -PUBLIC int oxpcie_in(void) +int oxpcie_in(void) { if(vm_running && oxpcie_vaddr) { int lsr; diff --git a/kernel/arch/i386/pre_init.c b/kernel/arch/i386/pre_init.c index d49a2f69e..70c7153ea 100644 --- a/kernel/arch/i386/pre_init.c +++ b/kernel/arch/i386/pre_init.c @@ -43,7 +43,7 @@ #define mb_clear_memrange(start, end) \ phys_memset((start), 0, (end)-(start)) -PRIVATE void mb_itoa(u32_t val, char * out) +static void mb_itoa(u32_t val, char * out) { char ret[ITOA_BUFFER_SIZE]; int i = ITOA_BUFFER_SIZE - 2; @@ -67,7 +67,7 @@ PRIVATE void mb_itoa(u32_t val, char * out) strcpy(out, ret + i + 1); } -PRIVATE void mb_itox(u32_t val, char *out) +static void mb_itox(u32_t val, char *out) { char ret[9]; int i = 7; @@ -92,7 +92,7 @@ PRIVATE void mb_itox(u32_t val, char *out) strcpy(out, ret + i + 1); } -PRIVATE void mb_put_char(char c, int line, int col) +static void mb_put_char(char c, int line, int col) { /* Write a char to vga display buffer. */ if (line -PUBLIC void mb_cls(void) +void mb_cls(void) { int i, j; /* Clear screen */ @@ -139,7 +139,7 @@ PUBLIC void mb_cls(void) outb(C_6845+DATA, 0); } -PRIVATE void mb_scroll_up(int lines) +static void mb_scroll_up(int lines) { int i, j; for (i = 0; i < MULTIBOOT_CONSOLE_LINES; i++ ) { @@ -153,7 +153,7 @@ PRIVATE void mb_scroll_up(int lines) print_line-= lines; } -PUBLIC void mb_print_char(char c) +void mb_print_char(char c) { while (print_line >= MULTIBOOT_CONSOLE_LINES) mb_scroll_up(1); @@ -177,7 +177,7 @@ PUBLIC void mb_print_char(char c) mb_scroll_up(1); } -PUBLIC void mb_print(char *str) +void mb_print(char *str) { while (*str) { mb_print_char(*str); @@ -191,7 +191,7 @@ PUBLIC void mb_print(char *str) #define KB_OUT_FULL 0x01 /* status bit set when keypress char pending */ #define KB_AUX_BYTE 0x20 /* Auxiliary Device Output Buffer Full */ -PUBLIC int mb_read_char(unsigned char *ch) +int mb_read_char(unsigned char *ch) { unsigned long b, sb; #ifdef DEBUG_SERIAL @@ -220,7 +220,7 @@ PUBLIC int mb_read_char(unsigned char *ch) return 0; } -PRIVATE void mb_print_hex(u32_t value) +static void mb_print_hex(u32_t value) { int i; char c; @@ -238,7 +238,7 @@ PRIVATE void mb_print_hex(u32_t value) mb_print(out); } -PRIVATE int mb_set_param(char *name, char *value) +static int mb_set_param(char *name, char *value) { char *p = multiboot_param_buf; char *q; @@ -281,7 +281,7 @@ PRIVATE int mb_set_param(char *name, char *value) return 0; } -PRIVATE void get_parameters(multiboot_info_t *mbi) +static void get_parameters(multiboot_info_t *mbi) { char mem_value[40], temp[ITOA_BUFFER_SIZE]; int i; @@ -354,7 +354,7 @@ PRIVATE void get_parameters(multiboot_info_t *mbi) } } -PRIVATE void mb_extract_image(multiboot_info_t mbi) +static void mb_extract_image(multiboot_info_t mbi) { multiboot_module_t *mb_module_info; multiboot_module_t *module; @@ -458,7 +458,7 @@ PRIVATE void mb_extract_image(multiboot_info_t mbi) return; } -PUBLIC phys_bytes pre_init(u32_t ebx) +phys_bytes pre_init(u32_t ebx) { multiboot_info_t mbi; diff --git a/kernel/arch/i386/protect.c b/kernel/arch/i386/protect.c index 4eb1805fe..c6056a9ce 100644 --- a/kernel/arch/i386/protect.c +++ b/kernel/arch/i386/protect.c @@ -25,7 +25,7 @@ struct gatedesc_s { u16_t offset_high; }; -PUBLIC struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */ +struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */ { {0}, {0,0,0,0}, /* GDT descriptor */ {0,0,0,0}, /* IDT descriptor */ @@ -35,16 +35,16 @@ PUBLIC struct segdesc_s gdt[GDT_SIZE]= /* used in klib.s and mpx.s */ {0xffff,0,0,0x9b,0xcf,0}, /* kernel CS */ {0xffff,0,0,0x9b,0xcf,0}, /* temp for BIOS (386: monitor CS at startup) */ }; -PRIVATE struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */ -PUBLIC struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */ +static struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */ +struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */ -FORWARD void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes +static void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes size); /*===========================================================================* * enable_iop * *===========================================================================*/ -PUBLIC void enable_iop(struct proc *pp) +void enable_iop(struct proc *pp) { /* Allow a user process to use I/O instructions. Change the I/O Permission * Level bits in the psw. These specify least-privileged Current Permission @@ -57,7 +57,7 @@ PUBLIC void enable_iop(struct proc *pp) /*===========================================================================* * seg2phys * *===========================================================================*/ -PUBLIC phys_bytes seg2phys(const u16_t seg) +phys_bytes seg2phys(const u16_t seg) { /* Return the base address of a segment, with seg being a * register, or a 286/386 segment selector. @@ -75,7 +75,7 @@ PUBLIC phys_bytes seg2phys(const u16_t seg) /*===========================================================================* * init_dataseg * *===========================================================================*/ -PUBLIC void init_dataseg(register struct segdesc_s *segdp, +void init_dataseg(register struct segdesc_s *segdp, phys_bytes base, vir_bytes size, const int privilege) { /* Build descriptor for a data segment. */ @@ -88,7 +88,7 @@ PUBLIC void init_dataseg(register struct segdesc_s *segdp, /*===========================================================================* * init_codeseg * *===========================================================================*/ -PRIVATE void init_codeseg(register struct segdesc_s *segdp, phys_bytes base, +static void init_codeseg(register struct segdesc_s *segdp, phys_bytes base, vir_bytes size, int privilege) { /* Build descriptor for a code segment. */ @@ -98,7 +98,7 @@ PRIVATE void init_codeseg(register struct segdesc_s *segdp, phys_bytes base, /* CONFORMING = 0, ACCESSED = 0 */ } -PUBLIC struct gate_table_s gate_table_pic[] = { +struct gate_table_s gate_table_pic[] = { { hwint00, VECTOR( 0), INTR_PRIVILEGE }, { hwint01, VECTOR( 1), INTR_PRIVILEGE }, { hwint02, VECTOR( 2), INTR_PRIVILEGE }, @@ -118,7 +118,7 @@ PUBLIC struct gate_table_s gate_table_pic[] = { { NULL, 0, 0} }; -PUBLIC void tss_init(unsigned cpu, void * kernel_stack) +void tss_init(unsigned cpu, void * kernel_stack) { struct tss_s * t = &tss[cpu]; @@ -146,7 +146,7 @@ PUBLIC void tss_init(unsigned cpu, void * kernel_stack) /*===========================================================================* * prot_init * *===========================================================================*/ -PUBLIC void prot_init(void) +void prot_init(void) { /* Set up tables for protected mode. * All GDT slots are allocated at compile time. @@ -192,7 +192,7 @@ PUBLIC void prot_init(void) tss_init(0, &k_boot_stktop); } -PUBLIC void idt_copy_vectors(struct gate_table_s * first) +void idt_copy_vectors(struct gate_table_s * first) { struct gate_table_s *gtp; for (gtp = first; gtp->gate; gtp++) { @@ -203,7 +203,7 @@ PUBLIC void idt_copy_vectors(struct gate_table_s * first) } /* Build descriptors for interrupt gates in IDT. */ -PUBLIC void idt_init(void) +void idt_init(void) { struct gate_table_s gate_table[] = { { divide_error, DIVIDE_VECTOR, INTR_PRIVILEGE }, @@ -238,7 +238,7 @@ PUBLIC void idt_init(void) /*===========================================================================* * sdesc * *===========================================================================*/ -PRIVATE void sdesc(segdp, base, size) +static void sdesc(segdp, base, size) register struct segdesc_s *segdp; phys_bytes base; vir_bytes size; @@ -263,7 +263,7 @@ vir_bytes size; /*===========================================================================* * int_gate * *===========================================================================*/ -PUBLIC void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type) +void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type) { /* Build descriptor for an interrupt gate. */ register struct gatedesc_s *idp; @@ -278,7 +278,7 @@ PUBLIC void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type) /*===========================================================================* * alloc_segments * *===========================================================================*/ -PUBLIC void alloc_segments(register struct proc *rp) +void alloc_segments(register struct proc *rp) { /* This is called at system initialization from main() and by do_newmap(). * The code has a separate function because of all hardware-dependencies. @@ -322,7 +322,7 @@ PUBLIC void alloc_segments(register struct proc *rp) /*===========================================================================* * check_segments * *===========================================================================*/ -PRIVATE void check_segments(char *File, int line) +static void check_segments(char *File, int line) { int checked = 0; int fail = 0; @@ -363,7 +363,7 @@ for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) { /*===========================================================================* * printseg * *===========================================================================*/ -PUBLIC void printseg(char *banner, const int iscs, struct proc *pr, +void printseg(char *banner, const int iscs, struct proc *pr, const u32_t selector) { #if USE_SYSDEBUG @@ -453,7 +453,7 @@ PUBLIC void printseg(char *banner, const int iscs, struct proc *pr, /*===========================================================================* * prot_set_kern_seg_limit * *===========================================================================*/ -PUBLIC int prot_set_kern_seg_limit(const vir_bytes limit) +int prot_set_kern_seg_limit(const vir_bytes limit) { struct proc *rp; int orig_click; diff --git a/kernel/clock.c b/kernel/clock.c index 48a0aadc3..5571da27e 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -42,7 +42,7 @@ /* Function prototype for PRIVATE functions. */ -FORWARD void load_update(void); +static void load_update(void); /* The CLOCK's timers queue. The functions in operate on this. * Each system process possesses a single synchronous alarm timer. If other @@ -51,18 +51,18 @@ FORWARD void load_update(void); * via (re)set_timer(). * When a timer expires its watchdog function is run by the CLOCK task. */ -PRIVATE timer_t *clock_timers; /* queue of CLOCK timers */ -PRIVATE clock_t next_timeout; /* realtime that next timer expires */ +static timer_t *clock_timers; /* queue of CLOCK timers */ +static clock_t next_timeout; /* realtime that next timer expires */ /* The time is incremented by the interrupt handler on each clock tick. */ -PRIVATE clock_t realtime = 0; /* real time clock */ +static clock_t realtime = 0; /* real time clock */ /* * The boot processos timer interrupt handler. In addition to non-boot cpus it * keeps real time and notifies the clock task if need be */ -PUBLIC int timer_int_handler(void) +int timer_int_handler(void) { /* Update user and system accounting times. Charge the current process * for user time. If the current process is not billable, that is, if a @@ -153,7 +153,7 @@ PUBLIC int timer_int_handler(void) /*===========================================================================* * get_uptime * *===========================================================================*/ -PUBLIC clock_t get_uptime(void) +clock_t get_uptime(void) { /* Get and return the current clock uptime in ticks. */ return(realtime); @@ -162,7 +162,7 @@ PUBLIC clock_t get_uptime(void) /*===========================================================================* * set_timer * *===========================================================================*/ -PUBLIC void set_timer(tp, exp_time, watchdog) +void set_timer(tp, exp_time, watchdog) struct timer *tp; /* pointer to timer structure */ clock_t exp_time; /* expiration realtime */ tmr_func_t watchdog; /* watchdog to be called */ @@ -177,7 +177,7 @@ tmr_func_t watchdog; /* watchdog to be called */ /*===========================================================================* * reset_timer * *===========================================================================*/ -PUBLIC void reset_timer(tp) +void reset_timer(tp) struct timer *tp; /* pointer to timer structure */ { /* The timer pointed to by 'tp' is no longer needed. Remove it from both the @@ -192,7 +192,7 @@ struct timer *tp; /* pointer to timer structure */ /*===========================================================================* * load_update * *===========================================================================*/ -PRIVATE void load_update(void) +static void load_update(void) { u16_t slot; int enqueued = 0, q; @@ -225,7 +225,7 @@ PRIVATE void load_update(void) kloadinfo.last_clock = realtime; } -PUBLIC int boot_cpu_init_timer(unsigned freq) +int boot_cpu_init_timer(unsigned freq) { if (init_local_timer(freq)) return -1; @@ -237,7 +237,7 @@ PUBLIC int boot_cpu_init_timer(unsigned freq) return 0; } -PUBLIC int app_cpu_init_timer(unsigned freq) +int app_cpu_init_timer(unsigned freq) { if (init_local_timer(freq)) return -1; diff --git a/kernel/debug.c b/kernel/debug.c index 566dc03cc..8c37e32a8 100644 --- a/kernel/debug.c +++ b/kernel/debug.c @@ -16,7 +16,7 @@ #define MAX_LOOP (NR_PROCS + NR_TASKS) -PUBLIC int runqueues_ok_cpu(unsigned cpu) +int runqueues_ok_cpu(unsigned cpu) { int q, l = 0; register struct proc *xp; @@ -115,7 +115,7 @@ PUBLIC int runqueues_ok_cpu(unsigned cpu) } #ifdef CONFIG_SMP -PRIVATE int runqueues_ok_all(void) +static int runqueues_ok_all(void) { unsigned c; @@ -126,14 +126,14 @@ PRIVATE int runqueues_ok_all(void) return 1; } -PUBLIC int runqueues_ok(void) +int runqueues_ok(void) { return runqueues_ok_all(); } #else -PUBLIC int runqueues_ok(void) +int runqueues_ok(void) { return runqueues_ok_cpu(0); } @@ -141,7 +141,7 @@ PUBLIC int runqueues_ok(void) #endif -PUBLIC char * +char * rtsflagstr(const u32_t flags) { static char str[100]; @@ -168,7 +168,7 @@ rtsflagstr(const u32_t flags) return str; } -PUBLIC char * +char * miscflagstr(const u32_t flags) { static char str[100]; @@ -182,7 +182,7 @@ miscflagstr(const u32_t flags) return str; } -PUBLIC char * +char * schedulerstr(struct proc *scheduler) { if (scheduler != NULL) @@ -193,7 +193,7 @@ schedulerstr(struct proc *scheduler) return "KERNEL"; } -PRIVATE void +static void print_proc_name(struct proc *pp) { char *name = pp->p_name; @@ -207,7 +207,7 @@ print_proc_name(struct proc *pp) } } -PRIVATE void +static void print_endpoint(endpoint_t ep) { int proc_nr; @@ -240,7 +240,7 @@ print_endpoint(endpoint_t ep) } } -PRIVATE void +static void print_sigmgr(struct proc *pp) { endpoint_t sig_mgr, bak_sig_mgr; @@ -254,7 +254,7 @@ print_sigmgr(struct proc *pp) } } -PUBLIC void print_proc(struct proc *pp) +void print_proc(struct proc *pp) { endpoint_t dep; @@ -278,7 +278,7 @@ PUBLIC void print_proc(struct proc *pp) printf("\n"); } -PRIVATE void print_proc_depends(struct proc *pp, const int level) +static void print_proc_depends(struct proc *pp, const int level) { struct proc *depproc = NULL; endpoint_t dep; @@ -310,13 +310,13 @@ PRIVATE void print_proc_depends(struct proc *pp, const int level) } } -PUBLIC void print_proc_recursive(struct proc *pp) +void print_proc_recursive(struct proc *pp) { print_proc_depends(pp, 0); } #if DEBUG_DUMPIPC -PRIVATE const char *mtypename(int mtype, int iscall) +static const char *mtypename(int mtype, int iscall) { /* use generated file to recognize message types */ if (iscall) { @@ -337,7 +337,7 @@ PRIVATE const char *mtypename(int mtype, int iscall) return NULL; } -PRIVATE void printproc(struct proc *rp) +static void printproc(struct proc *rp) { if (rp) printf(" %s(%d)", rp->p_name, rp - proc); @@ -345,7 +345,7 @@ PRIVATE void printproc(struct proc *rp) printf(" kernel"); } -PRIVATE void printparam(const char *name, const void *data, size_t size) +static void printparam(const char *name, const void *data, size_t size) { printf(" %s=", name); switch (size) { @@ -356,7 +356,7 @@ PRIVATE void printparam(const char *name, const void *data, size_t size) } } -PRIVATE void printmsg(message *msg, struct proc *src, struct proc *dst, +static void printmsg(message *msg, struct proc *src, struct proc *dst, char operation, int iscall, int printparams) { const char *name; @@ -385,15 +385,15 @@ PRIVATE void printmsg(message *msg, struct proc *src, struct proc *dst, #if DEBUG_IPCSTATS #define IPCPROCS (NR_PROCS+1) /* number of slots we need */ #define KERNELIPC NR_PROCS /* slot number to use for kernel calls */ -PRIVATE int messages[IPCPROCS][IPCPROCS]; +static int messages[IPCPROCS][IPCPROCS]; #define PRINTSLOTS 20 -PRIVATE struct { +static struct { int src, dst, messages; } winners[PRINTSLOTS]; -PRIVATE int total, goodslots; +static int total, goodslots; -PRIVATE void printstats(int ticks) +static void printstats(int ticks) { int i; for(i = 0; i < goodslots; i++) { @@ -407,7 +407,7 @@ PRIVATE void printstats(int ticks) printf("total %d/s\n", persec(total)); } -PRIVATE void sortstats(void) +static void sortstats(void) { /* Print top message senders/receivers. */ int src_slot, dst_slot; @@ -447,7 +447,7 @@ PRIVATE void sortstats(void) assert(s >= 0 && s < IPCPROCS); \ } -PRIVATE void statmsg(message *msg, struct proc *srcp, struct proc *dstp) +static void statmsg(message *msg, struct proc *srcp, struct proc *dstp) { int src, dst, now, secs, dt; static int lastprint; @@ -473,14 +473,14 @@ PRIVATE void statmsg(message *msg, struct proc *srcp, struct proc *dstp) #endif #if DEBUG_IPC_HOOK -PUBLIC void hook_ipc_msgkcall(message *msg, struct proc *proc) +void hook_ipc_msgkcall(message *msg, struct proc *proc) { #if DEBUG_DUMPIPC printmsg(msg, proc, NULL, 'k', 1, 1); #endif } -PUBLIC void hook_ipc_msgkresult(message *msg, struct proc *proc) +void hook_ipc_msgkresult(message *msg, struct proc *proc) { #if DEBUG_DUMPIPC printmsg(msg, NULL, proc, 'k', 0, 0); @@ -490,7 +490,7 @@ PUBLIC void hook_ipc_msgkresult(message *msg, struct proc *proc) #endif } -PUBLIC void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst) +void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst) { #if DEBUG_DUMPIPC printmsg(msg, src, dst, 'r', src->p_misc_flags & MF_REPLY_PEND, 0); @@ -500,14 +500,14 @@ PUBLIC void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst) #endif } -PUBLIC void hook_ipc_msgsend(message *msg, struct proc *src, struct proc *dst) +void hook_ipc_msgsend(message *msg, struct proc *src, struct proc *dst) { #if DEBUG_DUMPIPC printmsg(msg, src, dst, 's', src->p_misc_flags & MF_REPLY_PEND, 1); #endif } -PUBLIC void hook_ipc_clear(struct proc *p) +void hook_ipc_clear(struct proc *p) { #if DEBUG_IPCSTATS int slot, i; diff --git a/kernel/interrupt.c b/kernel/interrupt.c index 661a4e1c8..9293a4c09 100644 --- a/kernel/interrupt.c +++ b/kernel/interrupt.c @@ -22,13 +22,13 @@ /* number of lists of IRQ hooks, one list per supported line. */ -PRIVATE irq_hook_t* irq_handlers[NR_IRQ_VECTORS] = {0}; +static irq_hook_t* irq_handlers[NR_IRQ_VECTORS] = {0}; /*===========================================================================* * put_irq_handler * *===========================================================================*/ /* Register an interrupt handler. */ -PUBLIC void put_irq_handler( irq_hook_t* hook, int irq, +void put_irq_handler( irq_hook_t* hook, int irq, const irq_handler_t handler) { int id; @@ -74,7 +74,7 @@ PUBLIC void put_irq_handler( irq_hook_t* hook, int irq, * rm_irq_handler * *===========================================================================*/ /* Unregister an interrupt handler. */ -PUBLIC void rm_irq_handler( const irq_hook_t* hook ) { +void rm_irq_handler( const irq_hook_t* hook ) { const int irq = hook->irq; const int id = hook->id; irq_hook_t **line; @@ -115,7 +115,7 @@ PUBLIC void rm_irq_handler( const irq_hook_t* hook ) { * the end. Before returning, it unmasks the IRQ if and only if all active ID * bits are cleared, and restart a process. */ -PUBLIC void irq_handle(int irq) +void irq_handle(int irq) { irq_hook_t * hook; @@ -160,7 +160,7 @@ PUBLIC void irq_handle(int irq) } /* Enable/Disable a interrupt line. */ -PUBLIC void enable_irq(const irq_hook_t *hook) +void enable_irq(const irq_hook_t *hook) { if((irq_actids[hook->irq] &= ~hook->id) == 0) { hw_intr_unmask(hook->irq); @@ -168,7 +168,7 @@ PUBLIC void enable_irq(const irq_hook_t *hook) } /* Return true if the interrupt was enabled before call. */ -PUBLIC int disable_irq(const irq_hook_t *hook) +int disable_irq(const irq_hook_t *hook) { if(irq_actids[hook->irq] & hook->id) /* already disabled */ return 0; diff --git a/kernel/main.c b/kernel/main.c index 3b5b8bb29..004948aa3 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -34,9 +34,9 @@ char *** _penviron; /* Prototype declarations for PRIVATE functions. */ -FORWARD void announce(void); +static void announce(void); -PUBLIC void bsp_finish_booting(void) +void bsp_finish_booting(void) { int i; #if SPROFILE @@ -110,7 +110,7 @@ PUBLIC void bsp_finish_booting(void) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* Start the ball rolling. */ struct boot_image *ip; /* boot image pointer */ @@ -309,7 +309,7 @@ PUBLIC int main(void) /*===========================================================================* * announce * *===========================================================================*/ -PRIVATE void announce(void) +static void announce(void) { /* Display the MINIX startup banner. */ printf("\nMINIX %s.%s. " @@ -324,7 +324,7 @@ PRIVATE void announce(void) /*===========================================================================* * prepare_shutdown * *===========================================================================*/ -PUBLIC void prepare_shutdown(const int how) +void prepare_shutdown(const int how) { /* This function prepares to shutdown MINIX. */ static timer_t shutdown_timer; @@ -341,7 +341,7 @@ PUBLIC void prepare_shutdown(const int how) /*===========================================================================* * shutdown * *===========================================================================*/ -PUBLIC void minix_shutdown(timer_t *tp) +void minix_shutdown(timer_t *tp) { /* This function is called from prepare_shutdown or stop_sequence to bring * down MINIX. How to shutdown is in the argument: RBT_HALT (return to the diff --git a/kernel/proc.c b/kernel/proc.c index a898c5154..c06073e78 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -48,27 +48,27 @@ #include "arch_proto.h" /* Scheduling and message passing functions */ -FORWARD void idle(void); +static void idle(void); /** * Made public for use in clock.c (for user-space scheduling) -FORWARD int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message +static int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message *m_ptr, int flags); */ -FORWARD int mini_receive(struct proc *caller_ptr, endpoint_t src, +static int mini_receive(struct proc *caller_ptr, endpoint_t src, message *m_ptr, int flags); -FORWARD int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t +static int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size); -FORWARD int deadlock(int function, register struct proc *caller, +static int deadlock(int function, register struct proc *caller, endpoint_t src_dst_e); -FORWARD int try_async(struct proc *caller_ptr); -FORWARD int try_one(struct proc *src_ptr, struct proc *dst_ptr); -FORWARD struct proc * pick_proc(void); -FORWARD void enqueue_head(struct proc *rp); +static int try_async(struct proc *caller_ptr); +static int try_one(struct proc *src_ptr, struct proc *dst_ptr); +static struct proc * pick_proc(void); +static void enqueue_head(struct proc *rp); /* all idles share the same idle_priv structure */ -PRIVATE struct priv idle_priv; +static struct priv idle_priv; -PRIVATE void set_idle_name(char * name, int n) +static void set_idle_name(char * name, int n) { int i, c; int p_z = 0; @@ -118,7 +118,7 @@ PRIVATE void set_idle_name(char * name, int n) break; \ } -PUBLIC void proc_init(void) +void proc_init(void) { struct proc * rp; struct priv *sp; @@ -174,7 +174,7 @@ PUBLIC void proc_init(void) } } -PRIVATE void switch_address_space_idle(void) +static void switch_address_space_idle(void) { #ifdef CONFIG_SMP /* @@ -189,7 +189,7 @@ PRIVATE void switch_address_space_idle(void) /*===========================================================================* * idle * *===========================================================================*/ -PRIVATE void idle(void) +static void idle(void) { struct proc * p; @@ -247,7 +247,7 @@ PRIVATE void idle(void) /*===========================================================================* * switch_to_user * *===========================================================================*/ -PUBLIC void switch_to_user(void) +void switch_to_user(void) { /* This function is called an instant before proc_ptr is * to be scheduled again. @@ -423,7 +423,7 @@ check_misc_flags: /* * handler for all synchronous IPC calls */ -PRIVATE int do_sync_ipc(struct proc * caller_ptr, /* who made the call */ +static int do_sync_ipc(struct proc * caller_ptr, /* who made the call */ int call_nr, /* system call number and flags */ endpoint_t src_dst_e, /* src or dst of the call */ message *m_ptr) /* users pointer to a message */ @@ -543,7 +543,7 @@ PRIVATE int do_sync_ipc(struct proc * caller_ptr, /* who made the call */ return(result); } -PUBLIC int do_ipc(reg_t r1, reg_t r2, reg_t r3) +int do_ipc(reg_t r1, reg_t r2, reg_t r3) { struct proc *const caller_ptr = get_cpulocal_var(proc_ptr); /* get pointer to caller */ int call_nr = (int) r1; @@ -633,7 +633,7 @@ PUBLIC int do_ipc(reg_t r1, reg_t r2, reg_t r3) /*===========================================================================* * deadlock * *===========================================================================*/ -PRIVATE int deadlock(function, cp, src_dst_e) +static int deadlock(function, cp, src_dst_e) int function; /* trap number */ register struct proc *cp; /* pointer to caller */ endpoint_t src_dst_e; /* src or dst process */ @@ -702,7 +702,7 @@ endpoint_t src_dst_e; /* src or dst process */ /*===========================================================================* * has_pending * *===========================================================================*/ -PRIVATE int has_pending(sys_map_t *map, int src_p, int asynm) +static int has_pending(sys_map_t *map, int src_p, int asynm) { /* Check to see if there is a pending message from the desired source * available. @@ -772,7 +772,7 @@ quit_search: /*===========================================================================* * has_pending_notify * *===========================================================================*/ -PUBLIC int has_pending_notify(struct proc * caller, int src_p) +int has_pending_notify(struct proc * caller, int src_p) { sys_map_t * map = &priv(caller)->s_notify_pending; return has_pending(map, src_p, 0); @@ -781,7 +781,7 @@ PUBLIC int has_pending_notify(struct proc * caller, int src_p) /*===========================================================================* * has_pending_asend * *===========================================================================*/ -PUBLIC int has_pending_asend(struct proc * caller, int src_p) +int has_pending_asend(struct proc * caller, int src_p) { sys_map_t * map = &priv(caller)->s_asyn_pending; return has_pending(map, src_p, 1); @@ -790,7 +790,7 @@ PUBLIC int has_pending_asend(struct proc * caller, int src_p) /*===========================================================================* * unset_notify_pending * *===========================================================================*/ -PUBLIC void unset_notify_pending(struct proc * caller, int src_p) +void unset_notify_pending(struct proc * caller, int src_p) { sys_map_t * map = &priv(caller)->s_notify_pending; unset_sys_bit(*map, src_p); @@ -799,7 +799,7 @@ PUBLIC void unset_notify_pending(struct proc * caller, int src_p) /*===========================================================================* * mini_send * *===========================================================================*/ -PUBLIC int mini_send( +int mini_send( register struct proc *caller_ptr, /* who is trying to send a message? */ endpoint_t dst_e, /* to whom is message being sent? */ message *m_ptr, /* pointer to message buffer */ @@ -896,7 +896,7 @@ PUBLIC int mini_send( /*===========================================================================* * mini_receive * *===========================================================================*/ -PRIVATE int mini_receive(struct proc * caller_ptr, +static int mini_receive(struct proc * caller_ptr, endpoint_t src_e, /* which message source is wanted */ message * m_buff_usr, /* pointer to message buffer */ const int flags) @@ -1043,7 +1043,7 @@ receive_done: /*===========================================================================* * mini_notify * *===========================================================================*/ -PUBLIC int mini_notify( +int mini_notify( const struct proc *caller_ptr, /* sender of the notification */ endpoint_t dst_e /* which process to notify */ ) @@ -1139,7 +1139,7 @@ field, caller->p_name, entry, priv(caller)->s_asynsize, priv(caller)->s_asyntab) /*===========================================================================* * try_deliver_senda * *===========================================================================*/ -PUBLIC int try_deliver_senda(struct proc *caller_ptr, +int try_deliver_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size) { @@ -1268,7 +1268,7 @@ asyn_error: /*===========================================================================* * mini_senda * *===========================================================================*/ -PRIVATE int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size) +static int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size) { struct priv *privp; @@ -1285,7 +1285,7 @@ PRIVATE int mini_senda(struct proc *caller_ptr, asynmsg_t *table, size_t size) /*===========================================================================* * try_async * *===========================================================================*/ -PRIVATE int try_async(caller_ptr) +static int try_async(caller_ptr) struct proc *caller_ptr; { int r; @@ -1328,7 +1328,7 @@ struct proc *caller_ptr; /*===========================================================================* * try_one * *===========================================================================*/ -PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr) +static int try_one(struct proc *src_ptr, struct proc *dst_ptr) { /* Try to receive an asynchronous message from 'src_ptr' */ int r = EAGAIN, done, do_notify; @@ -1433,7 +1433,7 @@ asyn_error: /*===========================================================================* * cancel_async * *===========================================================================*/ -PUBLIC int cancel_async(struct proc *src_ptr, struct proc *dst_ptr) +int cancel_async(struct proc *src_ptr, struct proc *dst_ptr) { /* Cancel asynchronous messages from src to dst, because dst is not interested * in them (e.g., dst has been restarted) */ @@ -1518,7 +1518,7 @@ asyn_error: /*===========================================================================* * enqueue * *===========================================================================*/ -PUBLIC void enqueue( +void enqueue( register struct proc *rp /* this process is now runnable */ ) { @@ -1593,7 +1593,7 @@ PUBLIC void enqueue( * process on a run queue. We have to put this process back at the fron to be * fair */ -PRIVATE void enqueue_head(struct proc *rp) +static void enqueue_head(struct proc *rp) { const int q = rp->p_priority; /* scheduling queue to use */ @@ -1639,7 +1639,7 @@ PRIVATE void enqueue_head(struct proc *rp) /*===========================================================================* * dequeue * *===========================================================================*/ -PUBLIC void dequeue(struct proc *rp) +void dequeue(struct proc *rp) /* this process is no longer runnable */ { /* A process must be removed from the scheduling queues, for example, because @@ -1706,7 +1706,7 @@ PUBLIC void dequeue(struct proc *rp) /*===========================================================================* * pick_proc * *===========================================================================*/ -PRIVATE struct proc * pick_proc(void) +static struct proc * pick_proc(void) { /* Decide who to run now. A new process is selected an returned. * When a billable process is selected, record it in 'bill_ptr', so that the @@ -1739,7 +1739,7 @@ PRIVATE struct proc * pick_proc(void) /*===========================================================================* * endpoint_lookup * *===========================================================================*/ -PUBLIC struct proc *endpoint_lookup(endpoint_t e) +struct proc *endpoint_lookup(endpoint_t e) { int n; @@ -1752,11 +1752,11 @@ PUBLIC struct proc *endpoint_lookup(endpoint_t e) * isokendpt_f * *===========================================================================*/ #if DEBUG_ENABLE_IPC_WARNINGS -PUBLIC int isokendpt_f(file, line, e, p, fatalflag) +int isokendpt_f(file, line, e, p, fatalflag) const char *file; int line; #else -PUBLIC int isokendpt_f(e, p, fatalflag) +int isokendpt_f(e, p, fatalflag) #endif endpoint_t e; int *p; @@ -1799,7 +1799,7 @@ const int fatalflag; return ok; } -PRIVATE void notify_scheduler(struct proc *p) +static void notify_scheduler(struct proc *p) { message m_no_quantum; int err; @@ -1832,7 +1832,7 @@ PRIVATE void notify_scheduler(struct proc *p) } } -PUBLIC void proc_no_time(struct proc * p) +void proc_no_time(struct proc * p) { if (!proc_kernel_scheduler(p) && priv(p)->s_flags & PREEMPTIBLE) { /* this dequeues the process */ @@ -1851,7 +1851,7 @@ PUBLIC void proc_no_time(struct proc * p) } } -PUBLIC void reset_proc_accounting(struct proc *p) +void reset_proc_accounting(struct proc *p) { p->p_accounting.preempted = 0; p->p_accounting.ipc_sync = 0; @@ -1861,7 +1861,7 @@ PUBLIC void reset_proc_accounting(struct proc *p) make_zero64(p->p_accounting.enter_queue); } -PUBLIC void copr_not_available_handler(void) +void copr_not_available_handler(void) { struct proc * p; struct proc ** local_fpu_owner; @@ -1900,7 +1900,7 @@ PUBLIC void copr_not_available_handler(void) NOT_REACHABLE; } -PUBLIC void release_fpu(struct proc * p) { +void release_fpu(struct proc * p) { struct proc ** fpu_owner_ptr; fpu_owner_ptr = get_cpu_var_ptr(p->p_cpu, fpu_owner); diff --git a/kernel/profile.c b/kernel/profile.c index 7a822dfbf..a417aa8ac 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -31,15 +31,15 @@ char sprof_sample_buffer[SAMPLE_BUFFER_SIZE]; /* Function prototype for the profiling clock handler. */ -FORWARD int profile_clock_handler(irq_hook_t *hook); +static int profile_clock_handler(irq_hook_t *hook); /* A hook for the profiling clock interrupt handler. */ -PRIVATE irq_hook_t profile_clock_hook; +static irq_hook_t profile_clock_hook; /*===========================================================================* * init_profile_clock * *===========================================================================*/ -PUBLIC void init_profile_clock(u32_t freq) +void init_profile_clock(u32_t freq) { int irq; @@ -54,7 +54,7 @@ PUBLIC void init_profile_clock(u32_t freq) /*===========================================================================* * profile_clock_stop * *===========================================================================*/ -PUBLIC void stop_profile_clock() +void stop_profile_clock() { arch_stop_profile_clock(); @@ -63,7 +63,7 @@ PUBLIC void stop_profile_clock() rm_irq_handler(&profile_clock_hook); } -PRIVATE void sprof_save_sample(struct proc * p, void * pc) +static void sprof_save_sample(struct proc * p, void * pc) { struct sprof_sample *s; @@ -75,7 +75,7 @@ PRIVATE void sprof_save_sample(struct proc * p, void * pc) sprof_info.mem_used += sizeof(struct sprof_sample); } -PRIVATE void sprof_save_proc(struct proc * p) +static void sprof_save_proc(struct proc * p) { struct sprof_proc * s; @@ -87,7 +87,7 @@ PRIVATE void sprof_save_proc(struct proc * p) sprof_info.mem_used += sizeof(struct sprof_proc); } -PRIVATE void profile_sample(struct proc * p, void * pc) +static void profile_sample(struct proc * p, void * pc) { /* This executes on every tick of the CMOS timer. */ @@ -127,7 +127,7 @@ PRIVATE void profile_sample(struct proc * p, void * pc) /*===========================================================================* * profile_clock_handler * *===========================================================================*/ -PRIVATE int profile_clock_handler(irq_hook_t *hook) +static int profile_clock_handler(irq_hook_t *hook) { struct proc * p; p = get_cpulocal_var(proc_ptr); @@ -140,7 +140,7 @@ PRIVATE int profile_clock_handler(irq_hook_t *hook) return(1); /* reenable interrupts */ } -PUBLIC void nmi_sprofile_handler(struct nmi_frame * frame) +void nmi_sprofile_handler(struct nmi_frame * frame) { struct proc * p = get_cpulocal_var(proc_ptr); /* @@ -184,13 +184,13 @@ PUBLIC void nmi_sprofile_handler(struct nmi_frame * frame) struct cprof_tbl_s cprof_tbl[CPROF_TABLE_SIZE_KERNEL]; /* Function that returns table size. */ -PUBLIC int profile_get_tbl_size(void) +int profile_get_tbl_size(void) { return CPROF_TABLE_SIZE_KERNEL; } /* Function that returns on which execution of procentry to announce. */ -PUBLIC int profile_get_announce(void) +int profile_get_announce(void) { return CPROF_ACCOUNCE_KERNEL; } @@ -199,7 +199,7 @@ PUBLIC int profile_get_announce(void) * The kernel "announces" its control struct and table locations * to itself through this function. */ -PUBLIC void profile_register(ctl_ptr, tbl_ptr) +void profile_register(ctl_ptr, tbl_ptr) void *ctl_ptr; void *tbl_ptr; { diff --git a/kernel/smp.c b/kernel/smp.c index e11c8cbc7..48d8c9832 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -8,7 +8,7 @@ unsigned ncpus; unsigned ht_per_core; unsigned bsp_cpu_id; -PUBLIC struct cpu cpus[CONFIG_MAX_CPUS]; +struct cpu cpus[CONFIG_MAX_CPUS]; /* info passed to another cpu along with a sched ipi */ struct sched_ipi_data { @@ -16,7 +16,7 @@ struct sched_ipi_data { volatile u32_t data; }; -PRIVATE struct sched_ipi_data sched_ipi_data[CONFIG_MAX_CPUS]; +static struct sched_ipi_data sched_ipi_data[CONFIG_MAX_CPUS]; #define SCHED_IPI_STOP_PROC 1 #define SCHED_IPI_VM_INHIBIT 2 @@ -27,7 +27,7 @@ static volatile unsigned ap_cpus_booted; SPINLOCK_DEFINE(big_kernel_lock) SPINLOCK_DEFINE(boot_lock) -PUBLIC void wait_for_APs_to_finish_booting(void) +void wait_for_APs_to_finish_booting(void) { unsigned n = 0; int i; @@ -48,19 +48,19 @@ PUBLIC void wait_for_APs_to_finish_booting(void) BKL_LOCK(); } -PUBLIC void ap_boot_finished(unsigned cpu) +void ap_boot_finished(unsigned cpu) { ap_cpus_booted++; } -PUBLIC void smp_ipi_halt_handler(void) +void smp_ipi_halt_handler(void) { ipi_ack(); stop_local_timer(); arch_smp_halt_cpu(); } -PUBLIC void smp_schedule(unsigned cpu) +void smp_schedule(unsigned cpu) { arch_send_smp_schedule_ipi(cpu); } @@ -72,7 +72,7 @@ void smp_sched_handler(void); * the task is finished. Also wait before it finishes task sent by another cpu * to the same one. */ -PRIVATE void smp_schedule_sync(struct proc * p, unsigned task) +static void smp_schedule_sync(struct proc * p, unsigned task) { unsigned cpu = p->p_cpu; unsigned mycpu = cpuid; @@ -111,7 +111,7 @@ PRIVATE void smp_schedule_sync(struct proc * p, unsigned task) BKL_LOCK(); } -PUBLIC void smp_schedule_stop_proc(struct proc * p) +void smp_schedule_stop_proc(struct proc * p) { if (proc_is_runnable(p)) smp_schedule_sync(p, SCHED_IPI_STOP_PROC); @@ -120,7 +120,7 @@ PUBLIC void smp_schedule_stop_proc(struct proc * p) assert(RTS_ISSET(p, RTS_PROC_STOP)); } -PUBLIC void smp_schedule_vminhibit(struct proc * p) +void smp_schedule_vminhibit(struct proc * p) { if (proc_is_runnable(p)) smp_schedule_sync(p, SCHED_IPI_VM_INHIBIT); @@ -129,7 +129,7 @@ PUBLIC void smp_schedule_vminhibit(struct proc * p) assert(RTS_ISSET(p, RTS_VMINHIBIT)); } -PUBLIC void smp_schedule_stop_proc_save_ctx(struct proc * p) +void smp_schedule_stop_proc_save_ctx(struct proc * p) { /* * stop the processes and force the complete context of the process to @@ -139,7 +139,7 @@ PUBLIC void smp_schedule_stop_proc_save_ctx(struct proc * p) assert(RTS_ISSET(p, RTS_PROC_STOP)); } -PUBLIC void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu) +void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu) { /* * stop the processes and force the complete context of the process to @@ -153,7 +153,7 @@ PUBLIC void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu) RTS_UNSET(p, RTS_PROC_STOP); } -PUBLIC void smp_sched_handler(void) +void smp_sched_handler(void) { unsigned flgs; unsigned cpu = cpuid; @@ -191,7 +191,7 @@ PUBLIC void smp_sched_handler(void) * already called. It only serves the purpose of acknowledging the IPI and * preempting the current process if the CPU was not idle. */ -PUBLIC void smp_ipi_sched_handler(void) +void smp_ipi_sched_handler(void) { struct proc * curr; diff --git a/kernel/start.c b/kernel/start.c index 7579954fb..3a301d0d9 100644 --- a/kernel/start.c +++ b/kernel/start.c @@ -14,7 +14,7 @@ /*===========================================================================* * cstart * *===========================================================================*/ -PUBLIC void cstart( +void cstart( u16_t cs, /* kernel code segment */ u16_t ds, /* kernel data segment */ u16_t mds, /* monitor data segment */ @@ -124,7 +124,7 @@ PUBLIC void cstart( * get_value * *===========================================================================*/ -PUBLIC char *get_value( +char *get_value( const char *params, /* boot monitor parameters */ const char *name /* key to look up */ ) @@ -148,7 +148,7 @@ PUBLIC char *get_value( /*===========================================================================* * env_get * *===========================================================================*/ -PUBLIC char *env_get(const char *name) +char *env_get(const char *name) { return get_value(params_buffer, name); } diff --git a/kernel/system.c b/kernel/system.c index ab18914c8..4614ab57d 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -51,14 +51,14 @@ * because the dummy is declared extern. If an illegal call is given, the * array size will be negative and this won't compile. */ -PRIVATE int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr); +static int (*call_vec[NR_SYS_CALLS])(struct proc * caller, message *m_ptr); #define map(call_nr, handler) \ { int call_index = call_nr-KERNEL_CALL; \ assert(call_index >= 0 && call_index < NR_SYS_CALLS); \ call_vec[call_index] = (handler) ; } -PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result) +static void kernel_call_finish(struct proc * caller, message *msg, int result) { if(result == VMSUSPEND) { /* Special case: message has to be saved for handling @@ -95,7 +95,7 @@ PRIVATE void kernel_call_finish(struct proc * caller, message *msg, int result) } } -PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg) +static int kernel_call_dispatch(struct proc * caller, message *msg) { int result = OK; int call_nr; @@ -136,7 +136,7 @@ PRIVATE int kernel_call_dispatch(struct proc * caller, message *msg) * this function checks the basic syscall parameters and if accepted it * dispatches its handling to the right handler */ -PUBLIC void kernel_call(message *m_user, struct proc * caller) +void kernel_call(message *m_user, struct proc * caller) { int result = OK; message msg; @@ -168,7 +168,7 @@ PUBLIC void kernel_call(message *m_user, struct proc * caller) /*===========================================================================* * initialize * *===========================================================================*/ -PUBLIC void system_init(void) +void system_init(void) { register struct priv *sp; int i; @@ -272,7 +272,7 @@ PUBLIC void system_init(void) /*===========================================================================* * get_priv * *===========================================================================*/ -PUBLIC int get_priv(rc, priv_id) +int get_priv(rc, priv_id) register struct proc *rc; /* new (child) process pointer */ int priv_id; /* privilege id */ { @@ -304,7 +304,7 @@ int priv_id; /* privilege id */ /*===========================================================================* * set_sendto_bit * *===========================================================================*/ -PUBLIC void set_sendto_bit(const struct proc *rp, int id) +void set_sendto_bit(const struct proc *rp, int id) { /* Allow a process to send messages to the process(es) associated with the * system privilege structure with the given ID. @@ -332,7 +332,7 @@ PUBLIC void set_sendto_bit(const struct proc *rp, int id) /*===========================================================================* * unset_sendto_bit * *===========================================================================*/ -PUBLIC void unset_sendto_bit(const struct proc *rp, int id) +void unset_sendto_bit(const struct proc *rp, int id) { /* Prevent a process from sending to another process. Retain the send mask * symmetry by also unsetting the bit for the other direction. @@ -346,7 +346,7 @@ PUBLIC void unset_sendto_bit(const struct proc *rp, int id) /*===========================================================================* * fill_sendto_mask * *===========================================================================*/ -PUBLIC void fill_sendto_mask(const struct proc *rp, sys_map_t *map) +void fill_sendto_mask(const struct proc *rp, sys_map_t *map) { int i; @@ -361,7 +361,7 @@ PUBLIC void fill_sendto_mask(const struct proc *rp, sys_map_t *map) /*===========================================================================* * send_sig * *===========================================================================*/ -PUBLIC void send_sig(endpoint_t ep, int sig_nr) +void send_sig(endpoint_t ep, int sig_nr) { /* Notify a system process about a signal. This is straightforward. Simply * set the signal that is to be delivered in the pending signals map and @@ -381,7 +381,7 @@ PUBLIC void send_sig(endpoint_t ep, int sig_nr) /*===========================================================================* * cause_sig * *===========================================================================*/ -PUBLIC void cause_sig(proc_nr, sig_nr) +void cause_sig(proc_nr, sig_nr) proc_nr_t proc_nr; /* process to be signalled */ int sig_nr; /* signal to be sent */ { @@ -443,7 +443,7 @@ int sig_nr; /* signal to be sent */ /*===========================================================================* * sig_delay_done * *===========================================================================*/ -PUBLIC void sig_delay_done(struct proc *rp) +void sig_delay_done(struct proc *rp) { /* A process is now known not to send any direct messages. * Tell PM that the stop delay has ended, by sending a signal to the process. @@ -460,7 +460,7 @@ PUBLIC void sig_delay_done(struct proc *rp) /*===========================================================================* * umap_bios * *===========================================================================*/ -PUBLIC phys_bytes umap_bios(vir_addr, bytes) +phys_bytes umap_bios(vir_addr, bytes) vir_bytes vir_addr; /* virtual address in BIOS segment */ vir_bytes bytes; /* # of bytes to be copied */ { @@ -485,7 +485,7 @@ vir_bytes bytes; /* # of bytes to be copied */ /*===========================================================================* * clear_ipc * *===========================================================================*/ -PRIVATE void clear_ipc( +static void clear_ipc( register struct proc *rc /* slot of process to clean up */ ) { @@ -516,7 +516,7 @@ PRIVATE void clear_ipc( /*===========================================================================* * clear_endpoint * *===========================================================================*/ -PUBLIC void clear_endpoint(rc) +void clear_endpoint(rc) register struct proc *rc; /* slot of process to clean up */ { if(isemptyp(rc)) panic("clear_proc: empty process: %d", rc->p_endpoint); @@ -549,7 +549,7 @@ register struct proc *rc; /* slot of process to clean up */ /*===========================================================================* * clear_ipc_refs * *===========================================================================*/ -PUBLIC void clear_ipc_refs(rc, caller_ret) +void clear_ipc_refs(rc, caller_ret) register struct proc *rc; /* slot of process to clean up */ int caller_ret; /* code to return on callers */ { @@ -583,7 +583,7 @@ int caller_ret; /* code to return on callers */ /*===========================================================================* * kernel_call_resume * *===========================================================================*/ -PUBLIC void kernel_call_resume(struct proc *caller) +void kernel_call_resume(struct proc *caller) { int result; @@ -613,7 +613,7 @@ PUBLIC void kernel_call_resume(struct proc *caller) /*===========================================================================* * sched_proc * *===========================================================================*/ -PUBLIC int sched_proc(struct proc *p, +int sched_proc(struct proc *p, int priority, int quantum, int cpu) diff --git a/kernel/system/do_abort.c b/kernel/system/do_abort.c index c38d4c6c5..c0c507881 100644 --- a/kernel/system/do_abort.c +++ b/kernel/system/do_abort.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_abort * *===========================================================================*/ -PUBLIC int do_abort(struct proc * caller, message * m_ptr) +int do_abort(struct proc * caller, message * m_ptr) { /* Handle sys_abort. MINIX is unable to continue. This can originate e.g. * in the PM (normal abort) or TTY (after CTRL-ALT-DEL). diff --git a/kernel/system/do_clear.c b/kernel/system/do_clear.c index 8592c98ef..f2f8fd8c9 100644 --- a/kernel/system/do_clear.c +++ b/kernel/system/do_clear.c @@ -14,7 +14,7 @@ /*===========================================================================* * do_clear * *===========================================================================*/ -PUBLIC int do_clear(struct proc * caller, message * m_ptr) +int do_clear(struct proc * caller, message * m_ptr) { /* Handle sys_clear. Only the PM can request other process slots to be cleared * when a process has exited. diff --git a/kernel/system/do_copy.c b/kernel/system/do_copy.c index 20142b3e9..33b7e0c82 100644 --- a/kernel/system/do_copy.c +++ b/kernel/system/do_copy.c @@ -19,7 +19,7 @@ /*===========================================================================* * do_copy * *===========================================================================*/ -PUBLIC int do_copy(struct proc * caller, message * m_ptr) +int do_copy(struct proc * caller, message * m_ptr) { /* Handle sys_vircopy() and sys_physcopy(). Copy data using virtual or * physical addressing. Although a single handler function is used, there diff --git a/kernel/system/do_cprofile.c b/kernel/system/do_cprofile.c index 22cf82b0d..c661a871e 100644 --- a/kernel/system/do_cprofile.c +++ b/kernel/system/do_cprofile.c @@ -21,7 +21,7 @@ /*===========================================================================* * do_cprofile * *===========================================================================*/ -PUBLIC int do_cprofile(struct proc * caller, message * m_ptr) +int do_cprofile(struct proc * caller, message * m_ptr) { int proc_nr, i; phys_bytes len; diff --git a/kernel/system/do_devio.c b/kernel/system/do_devio.c index 8828813a9..722e6c100 100644 --- a/kernel/system/do_devio.c +++ b/kernel/system/do_devio.c @@ -17,7 +17,7 @@ /*===========================================================================* * do_devio * *===========================================================================*/ -PUBLIC int do_devio(struct proc * caller, message * m_ptr) +int do_devio(struct proc * caller, message * m_ptr) { struct priv *privp; port_t port; diff --git a/kernel/system/do_endksig.c b/kernel/system/do_endksig.c index 4ee185d3e..de1a3505f 100644 --- a/kernel/system/do_endksig.c +++ b/kernel/system/do_endksig.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_endksig * *===========================================================================*/ -PUBLIC int do_endksig(struct proc * caller, message * m_ptr) +int do_endksig(struct proc * caller, message * m_ptr) { /* Finish up after a kernel type signal, caused by a SYS_KILL message or a * call to cause_sig by a task. This is called by a signal manager after diff --git a/kernel/system/do_exec.c b/kernel/system/do_exec.c index 762e02c1a..0919d8dc9 100644 --- a/kernel/system/do_exec.c +++ b/kernel/system/do_exec.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_exec * *===========================================================================*/ -PUBLIC int do_exec(struct proc * caller, message * m_ptr) +int do_exec(struct proc * caller, message * m_ptr) { /* Handle sys_exec(). A process has done a successful EXEC. Patch it up. */ register struct proc *rp; diff --git a/kernel/system/do_exit.c b/kernel/system/do_exit.c index 76abb7f3a..718b3f940 100644 --- a/kernel/system/do_exit.c +++ b/kernel/system/do_exit.c @@ -11,7 +11,7 @@ /*===========================================================================* * do_exit * *===========================================================================*/ -PUBLIC int do_exit(struct proc * caller, message * m_ptr) +int do_exit(struct proc * caller, message * m_ptr) { /* Handle sys_exit. A system process has requested to exit. Generate a * self-termination signal. diff --git a/kernel/system/do_fork.c b/kernel/system/do_fork.c index 0b6236196..e6788f72f 100644 --- a/kernel/system/do_fork.c +++ b/kernel/system/do_fork.c @@ -22,7 +22,7 @@ /*===========================================================================* * do_fork * *===========================================================================*/ -PUBLIC int do_fork(struct proc * caller, message * m_ptr) +int do_fork(struct proc * caller, message * m_ptr) { /* Handle sys_fork(). PR_ENDPT has forked. The child is PR_SLOT. */ #if (_MINIX_CHIP == _CHIP_INTEL) diff --git a/kernel/system/do_getinfo.c b/kernel/system/do_getinfo.c index 8f5802bff..b13e6e2ef 100644 --- a/kernel/system/do_getinfo.c +++ b/kernel/system/do_getinfo.c @@ -22,7 +22,7 @@ /*===========================================================================* * update_idle_time * *===========================================================================*/ -PRIVATE void update_idle_time(void) +static void update_idle_time(void) { int i; struct proc * idl = proc_addr(IDLE); @@ -38,7 +38,7 @@ PRIVATE void update_idle_time(void) /*===========================================================================* * do_getinfo * *===========================================================================*/ -PUBLIC int do_getinfo(struct proc * caller, message * m_ptr) +int do_getinfo(struct proc * caller, message * m_ptr) { /* Request system information to be copied to caller's address space. This * call simply copies entire data structures to the caller. diff --git a/kernel/system/do_getksig.c b/kernel/system/do_getksig.c index 561707284..0235fcc3b 100644 --- a/kernel/system/do_getksig.c +++ b/kernel/system/do_getksig.c @@ -15,7 +15,7 @@ /*===========================================================================* * do_getksig * *===========================================================================*/ -PUBLIC int do_getksig(struct proc * caller, message * m_ptr) +int do_getksig(struct proc * caller, message * m_ptr) { /* The signal manager is ready to accept signals and repeatedly does a kernel * call to get one. Find a process with pending signals. If no signals are diff --git a/kernel/system/do_irqctl.c b/kernel/system/do_irqctl.c index 432dff874..026fbfd6d 100644 --- a/kernel/system/do_irqctl.c +++ b/kernel/system/do_irqctl.c @@ -16,12 +16,12 @@ #if USE_IRQCTL -FORWARD int generic_handler(irq_hook_t *hook); +static int generic_handler(irq_hook_t *hook); /*===========================================================================* * do_irqctl * *===========================================================================*/ -PUBLIC int do_irqctl(struct proc * caller, message * m_ptr) +int do_irqctl(struct proc * caller, message * m_ptr) { /* Dismember the request message. */ int irq_vec; @@ -141,7 +141,7 @@ PUBLIC int do_irqctl(struct proc * caller, message * m_ptr) /*===========================================================================* * generic_handler * *===========================================================================*/ -PRIVATE int generic_handler(hook) +static int generic_handler(hook) irq_hook_t *hook; { /* This function handles hardware interrupt in a simple and generic way. All diff --git a/kernel/system/do_kill.c b/kernel/system/do_kill.c index 5e72f9689..dc370dc67 100644 --- a/kernel/system/do_kill.c +++ b/kernel/system/do_kill.c @@ -14,7 +14,7 @@ /*===========================================================================* * do_kill * *===========================================================================*/ -PUBLIC int do_kill(struct proc * caller, message * m_ptr) +int do_kill(struct proc * caller, message * m_ptr) { /* Handle sys_kill(). Cause a signal to be sent to a process. Any request * is added to the map of pending signals and the signal manager diff --git a/kernel/system/do_mcontext.c b/kernel/system/do_mcontext.c index c105acf5e..b3b2e22ba 100644 --- a/kernel/system/do_mcontext.c +++ b/kernel/system/do_mcontext.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_getmcontext * *===========================================================================*/ -PUBLIC int do_getmcontext(struct proc * caller, message * m_ptr) +int do_getmcontext(struct proc * caller, message * m_ptr) { /* Retrieve machine context of a process */ @@ -64,7 +64,7 @@ PUBLIC int do_getmcontext(struct proc * caller, message * m_ptr) /*===========================================================================* * do_setmcontext * *===========================================================================*/ -PUBLIC int do_setmcontext(struct proc * caller, message * m_ptr) +int do_setmcontext(struct proc * caller, message * m_ptr) { /* Set machine context of a process */ diff --git a/kernel/system/do_memset.c b/kernel/system/do_memset.c index dd8a06a51..fdce9a2f6 100644 --- a/kernel/system/do_memset.c +++ b/kernel/system/do_memset.c @@ -14,7 +14,7 @@ /*===========================================================================* * do_memset * *===========================================================================*/ -PUBLIC int do_memset(struct proc * caller, message * m_ptr) +int do_memset(struct proc * caller, message * m_ptr) { /* Handle sys_memset(). This writes a pattern into the specified memory. */ unsigned char c = m_ptr->MEM_PATTERN; diff --git a/kernel/system/do_newmap.c b/kernel/system/do_newmap.c index 016a0f90f..307f4b086 100644 --- a/kernel/system/do_newmap.c +++ b/kernel/system/do_newmap.c @@ -13,7 +13,7 @@ /*===========================================================================* * do_newmap * *===========================================================================*/ -PUBLIC int do_newmap(struct proc * caller, message * m_ptr) +int do_newmap(struct proc * caller, message * m_ptr) { /* Handle sys_newmap(). Fetch the memory map. */ struct proc *rp; /* process whose map is to be loaded */ @@ -32,7 +32,7 @@ PUBLIC int do_newmap(struct proc * caller, message * m_ptr) /*===========================================================================* * newmap * *===========================================================================*/ -PUBLIC int newmap(struct proc *caller, struct proc *rp, struct mem_map *map_ptr) +int newmap(struct proc *caller, struct proc *rp, struct mem_map *map_ptr) { int r; /* Fetch the memory map. */ diff --git a/kernel/system/do_privctl.c b/kernel/system/do_privctl.c index 17d1b82a7..d99598632 100644 --- a/kernel/system/do_privctl.c +++ b/kernel/system/do_privctl.c @@ -17,12 +17,12 @@ #define PRIV_DEBUG 0 -FORWARD int update_priv(struct proc *rp, struct priv *priv); +static int update_priv(struct proc *rp, struct priv *priv); /*===========================================================================* * do_privctl * *===========================================================================*/ -PUBLIC int do_privctl(struct proc * caller, message * m_ptr) +int do_privctl(struct proc * caller, message * m_ptr) { /* Handle sys_privctl(). Update a process' privileges. If the process is not * yet a system process, make sure it gets its own privilege structure. @@ -317,7 +317,7 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr) /*===========================================================================* * update_priv * *===========================================================================*/ -PRIVATE int update_priv(struct proc *rp, struct priv *priv) +static int update_priv(struct proc *rp, struct priv *priv) { /* Update the privilege structure of a given process. */ diff --git a/kernel/system/do_profbuf.c b/kernel/system/do_profbuf.c index e62bac0b7..e82f500f6 100644 --- a/kernel/system/do_profbuf.c +++ b/kernel/system/do_profbuf.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_profbuf * *===========================================================================*/ -PUBLIC int do_profbuf(struct proc * caller, message * m_ptr) +int do_profbuf(struct proc * caller, message * m_ptr) { /* This kernel call is used by profiled system processes when Call * Profiling is enabled. It is called on the first execution of procentry. diff --git a/kernel/system/do_runctl.c b/kernel/system/do_runctl.c index 16759464c..540100089 100644 --- a/kernel/system/do_runctl.c +++ b/kernel/system/do_runctl.c @@ -15,7 +15,7 @@ /*===========================================================================* * do_runctl * *===========================================================================*/ -PUBLIC int do_runctl(struct proc * caller, message * m_ptr) +int do_runctl(struct proc * caller, message * m_ptr) { /* Control a process's RTS_PROC_STOP flag. Used for process management. * If the process is queued sending a message or stopped for system call diff --git a/kernel/system/do_safecopy.c b/kernel/system/do_safecopy.c index d54940bc4..59b1b5b4e 100644 --- a/kernel/system/do_safecopy.c +++ b/kernel/system/do_safecopy.c @@ -23,7 +23,7 @@ #define MEM_TOP 0xFFFFFFFFUL -FORWARD int safecopy(struct proc *, endpoint_t, endpoint_t, +static int safecopy(struct proc *, endpoint_t, endpoint_t, cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int); #define HASGRANTTABLE(gr) \ @@ -32,7 +32,7 @@ FORWARD int safecopy(struct proc *, endpoint_t, endpoint_t, /*===========================================================================* * verify_grant * *===========================================================================*/ -PUBLIC int verify_grant(granter, grantee, grant, bytes, access, +int verify_grant(granter, grantee, grant, bytes, access, offset_in, offset_result, e_granter) endpoint_t granter, grantee; /* copyee, copyer */ cp_grant_id_t grant; /* grant id */ @@ -226,7 +226,7 @@ endpoint_t *e_granter; /* new granter (magic grants) */ /*===========================================================================* * safecopy * *===========================================================================*/ -PRIVATE int safecopy(caller, granter, grantee, grantid, src_seg, dst_seg, bytes, +static int safecopy(caller, granter, grantee, grantid, src_seg, dst_seg, bytes, g_offset, addr, access) struct proc * caller; endpoint_t granter, grantee; @@ -344,7 +344,7 @@ int access; /* CPF_READ for a copy from granter to grantee, CPF_WRITE /*===========================================================================* * do_safecopy_to * *===========================================================================*/ -PUBLIC int do_safecopy_to(struct proc * caller, message * m_ptr) +int do_safecopy_to(struct proc * caller, message * m_ptr) { return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint, (cp_grant_id_t) m_ptr->SCP_GID, m_ptr->SCP_SEG, D, @@ -355,7 +355,7 @@ PUBLIC int do_safecopy_to(struct proc * caller, message * m_ptr) /*===========================================================================* * do_safecopy_from * *===========================================================================*/ -PUBLIC int do_safecopy_from(struct proc * caller, message * m_ptr) +int do_safecopy_from(struct proc * caller, message * m_ptr) { return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint, (cp_grant_id_t) m_ptr->SCP_GID, D, m_ptr->SCP_SEG, @@ -366,7 +366,7 @@ PUBLIC int do_safecopy_from(struct proc * caller, message * m_ptr) /*===========================================================================* * do_vsafecopy * *===========================================================================*/ -PUBLIC int do_vsafecopy(struct proc * caller, message * m_ptr) +int do_vsafecopy(struct proc * caller, message * m_ptr) { static struct vscp_vec vec[SCPVEC_NR]; static struct vir_addr src, dst; diff --git a/kernel/system/do_safemap.c b/kernel/system/do_safemap.c index 33649b76e..66ac8fc92 100644 --- a/kernel/system/do_safemap.c +++ b/kernel/system/do_safemap.c @@ -117,7 +117,7 @@ static void clear_info(struct map_info_s *p) /*===========================================================================* * map_invoke_vm * *===========================================================================*/ -PUBLIC int map_invoke_vm(struct proc * caller, +int map_invoke_vm(struct proc * caller, int req_type, /* VMPTYPE_... COWMAP, SMAP, SUNMAP */ endpoint_t end_d, int seg_d, vir_bytes off_d, endpoint_t end_s, int seg_s, vir_bytes off_s, @@ -172,7 +172,7 @@ PUBLIC int map_invoke_vm(struct proc * caller, /*===========================================================================* * do_safemap * *===========================================================================*/ -PUBLIC int do_safemap(struct proc * caller, message * m_ptr) +int do_safemap(struct proc * caller, message * m_ptr) { endpoint_t grantor = m_ptr->SMAP_EP; cp_grant_id_t gid = (cp_grant_id_t) m_ptr->SMAP_GID; @@ -222,7 +222,7 @@ PUBLIC int do_safemap(struct proc * caller, message * m_ptr) /*===========================================================================* * safeunmap * *===========================================================================*/ -PRIVATE int safeunmap(struct proc * caller, struct map_info_s *p) +static int safeunmap(struct proc * caller, struct map_info_s *p) { vir_bytes offset_result; endpoint_t new_grantor; @@ -250,7 +250,7 @@ PRIVATE int safeunmap(struct proc * caller, struct map_info_s *p) /*===========================================================================* * do_saferevmap * *===========================================================================*/ -PUBLIC int do_saferevmap(struct proc * caller, message * m_ptr) +int do_saferevmap(struct proc * caller, message * m_ptr) { struct map_info_s *p; int flag = m_ptr->SMAP_FLAG; @@ -267,7 +267,7 @@ PUBLIC int do_saferevmap(struct proc * caller, message * m_ptr) /*===========================================================================* * do_safeunmap * *===========================================================================*/ -PUBLIC int do_safeunmap(struct proc * caller, message * m_ptr) +int do_safeunmap(struct proc * caller, message * m_ptr) { vir_bytes address = (vir_bytes) m_ptr->SMAP_ADDRESS; int seg = (int)m_ptr->SMAP_SEG; diff --git a/kernel/system/do_schedctl.c b/kernel/system/do_schedctl.c index b2e4563a3..498d0d04f 100644 --- a/kernel/system/do_schedctl.c +++ b/kernel/system/do_schedctl.c @@ -4,7 +4,7 @@ /*===========================================================================* * do_schedctl * *===========================================================================*/ -PUBLIC int do_schedctl(struct proc * caller, message * m_ptr) +int do_schedctl(struct proc * caller, message * m_ptr) { struct proc *p; unsigned flags; diff --git a/kernel/system/do_schedule.c b/kernel/system/do_schedule.c index 436f8147d..f5cf335a4 100644 --- a/kernel/system/do_schedule.c +++ b/kernel/system/do_schedule.c @@ -5,7 +5,7 @@ /*===========================================================================* * do_schedule * *===========================================================================*/ -PUBLIC int do_schedule(struct proc * caller, message * m_ptr) +int do_schedule(struct proc * caller, message * m_ptr) { struct proc *p; int proc_nr; diff --git a/kernel/system/do_setalarm.c b/kernel/system/do_setalarm.c index 3264518e1..d384421ef 100644 --- a/kernel/system/do_setalarm.c +++ b/kernel/system/do_setalarm.c @@ -14,12 +14,12 @@ #if USE_SETALARM -FORWARD void cause_alarm(timer_t *tp); +static void cause_alarm(timer_t *tp); /*===========================================================================* * do_setalarm * *===========================================================================*/ -PUBLIC int do_setalarm(struct proc * caller, message * m_ptr) +int do_setalarm(struct proc * caller, message * m_ptr) { /* A process requests a synchronous alarm, or wants to cancel its alarm. */ long exp_time; /* expiration time for this alarm */ @@ -58,7 +58,7 @@ PUBLIC int do_setalarm(struct proc * caller, message * m_ptr) /*===========================================================================* * cause_alarm * *===========================================================================*/ -PRIVATE void cause_alarm(timer_t *tp) +static void cause_alarm(timer_t *tp) { /* Routine called if a timer goes off and the process requested a synchronous * alarm. The process number is stored in timer argument 'ta_int'. Notify that diff --git a/kernel/system/do_setgrant.c b/kernel/system/do_setgrant.c index e7f6e76c9..11992fa9e 100644 --- a/kernel/system/do_setgrant.c +++ b/kernel/system/do_setgrant.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_setgrant * *===========================================================================*/ -PUBLIC int do_setgrant(struct proc * caller, message * m_ptr) +int do_setgrant(struct proc * caller, message * m_ptr) { int r; diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index cd8b68282..19a908587 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_sigreturn * *===========================================================================*/ -PUBLIC int do_sigreturn(struct proc * caller, message * m_ptr) +int do_sigreturn(struct proc * caller, message * m_ptr) { /* POSIX style signals require sys_sigreturn to put things in order before * the signalled process can resume execution diff --git a/kernel/system/do_sigsend.c b/kernel/system/do_sigsend.c index 97a36e10e..e2bfba8a5 100644 --- a/kernel/system/do_sigsend.c +++ b/kernel/system/do_sigsend.c @@ -17,7 +17,7 @@ /*===========================================================================* * do_sigsend * *===========================================================================*/ -PUBLIC int do_sigsend(struct proc * caller, message * m_ptr) +int do_sigsend(struct proc * caller, message * m_ptr) { /* Handle sys_sigsend, POSIX-style signal handling. */ diff --git a/kernel/system/do_sprofile.c b/kernel/system/do_sprofile.c index f0c50b29f..9f6be5354 100644 --- a/kernel/system/do_sprofile.c +++ b/kernel/system/do_sprofile.c @@ -19,9 +19,9 @@ #if SPROFILE /* user address to write info struct */ -PRIVATE vir_bytes sprof_info_addr_vir; +static vir_bytes sprof_info_addr_vir; -PRIVATE void clean_seen_flag(void) +static void clean_seen_flag(void) { int i; @@ -32,7 +32,7 @@ PRIVATE void clean_seen_flag(void) /*===========================================================================* * do_sprofile * *===========================================================================*/ -PUBLIC int do_sprofile(struct proc * caller, message * m_ptr) +int do_sprofile(struct proc * caller, message * m_ptr) { int proc_nr; int err; diff --git a/kernel/system/do_statectl.c b/kernel/system/do_statectl.c index 54b257171..88818dd09 100644 --- a/kernel/system/do_statectl.c +++ b/kernel/system/do_statectl.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_statectl * *===========================================================================*/ -PUBLIC int do_statectl(struct proc * caller, message * m_ptr) +int do_statectl(struct proc * caller, message * m_ptr) { /* Handle sys_statectl(). A process has issued a state control request. */ diff --git a/kernel/system/do_stime.c b/kernel/system/do_stime.c index 2e73be8b5..3c1d1c822 100644 --- a/kernel/system/do_stime.c +++ b/kernel/system/do_stime.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_stime * *===========================================================================*/ -PUBLIC int do_stime(struct proc * caller, message * m_ptr) +int do_stime(struct proc * caller, message * m_ptr) { boottime= m_ptr->T_BOOTTIME; return(OK); diff --git a/kernel/system/do_sysctl.c b/kernel/system/do_sysctl.c index 5866f3671..d4f258d10 100644 --- a/kernel/system/do_sysctl.c +++ b/kernel/system/do_sysctl.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_sysctl * *===========================================================================*/ -PUBLIC int do_sysctl(struct proc * caller, message * m_ptr) +int do_sysctl(struct proc * caller, message * m_ptr) { vir_bytes len, buf; static char mybuf[DIAG_BUFSIZE]; diff --git a/kernel/system/do_times.c b/kernel/system/do_times.c index 572ac140a..16a646a1d 100644 --- a/kernel/system/do_times.c +++ b/kernel/system/do_times.c @@ -18,7 +18,7 @@ /*===========================================================================* * do_times * *===========================================================================*/ -PUBLIC int do_times(struct proc * caller, message * m_ptr) +int do_times(struct proc * caller, message * m_ptr) { /* Handle sys_times(). Retrieve the accounting information. */ register const struct proc *rp; diff --git a/kernel/system/do_trace.c b/kernel/system/do_trace.c index f27dc4e34..896615454 100644 --- a/kernel/system/do_trace.c +++ b/kernel/system/do_trace.c @@ -16,7 +16,7 @@ /*==========================================================================* * do_trace * *==========================================================================*/ -PUBLIC int do_trace(struct proc * caller, message * m_ptr) +int do_trace(struct proc * caller, message * m_ptr) { /* Handle the debugging commands supported by the ptrace system call * The commands are: diff --git a/kernel/system/do_umap.c b/kernel/system/do_umap.c index f36d8e717..89378158c 100755 --- a/kernel/system/do_umap.c +++ b/kernel/system/do_umap.c @@ -22,7 +22,7 @@ /*==========================================================================* * do_umap * *==========================================================================*/ -PUBLIC int do_umap(struct proc * caller, message * m_ptr) +int do_umap(struct proc * caller, message * m_ptr) { int seg_index = m_ptr->CP_SRC_SPACE & SEGMENT_INDEX; int endpt = (int) m_ptr->CP_SRC_ENDPT; diff --git a/kernel/system/do_umap_remote.c b/kernel/system/do_umap_remote.c index 99a32c834..efebb4652 100644 --- a/kernel/system/do_umap_remote.c +++ b/kernel/system/do_umap_remote.c @@ -23,7 +23,7 @@ /*==========================================================================* * do_umap_remote * *==========================================================================*/ -PUBLIC int do_umap_remote(struct proc * caller, message * m_ptr) +int do_umap_remote(struct proc * caller, message * m_ptr) { /* Map virtual address to physical, for non-kernel processes. */ int seg_type = m_ptr->CP_SRC_SPACE & SEGMENT_TYPE; diff --git a/kernel/system/do_update.c b/kernel/system/do_update.c index 912401ee8..deb67b9c8 100644 --- a/kernel/system/do_update.c +++ b/kernel/system/do_update.c @@ -19,18 +19,18 @@ (RTS_ISSET(p, RTS_NO_PRIV) || RTS_ISSET(p, RTS_SIG_PENDING) \ || (RTS_ISSET(p, RTS_RECEIVING) && !RTS_ISSET(p, RTS_SENDING))) -FORWARD void adjust_proc_slot(struct proc *rp, struct proc *from_rp); -FORWARD void adjust_priv_slot(struct priv *privp, struct priv +static void adjust_proc_slot(struct proc *rp, struct proc *from_rp); +static void adjust_priv_slot(struct priv *privp, struct priv *from_privp); -FORWARD void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp, +static void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp, struct proc *b_copy_rp); -FORWARD void swap_proc_slot_pointer(struct proc **rpp, struct proc +static void swap_proc_slot_pointer(struct proc **rpp, struct proc *src_rp, struct proc *dst_rp); /*===========================================================================* * do_update * *===========================================================================*/ -PUBLIC int do_update(struct proc * caller, message * m_ptr) +int do_update(struct proc * caller, message * m_ptr) { /* Handle sys_update(). Update a process into another by swapping their process * slots. @@ -143,7 +143,7 @@ PUBLIC int do_update(struct proc * caller, message * m_ptr) /*===========================================================================* * adjust_proc_slot * *===========================================================================*/ -PRIVATE void adjust_proc_slot(struct proc *rp, struct proc *from_rp) +static void adjust_proc_slot(struct proc *rp, struct proc *from_rp) { /* Preserve endpoints, slot numbers, priv structure, IPC, FPU pointer. */ rp->p_endpoint = from_rp->p_endpoint; @@ -165,7 +165,7 @@ PRIVATE void adjust_proc_slot(struct proc *rp, struct proc *from_rp) /*===========================================================================* * adjust_priv_slot * *===========================================================================*/ -PRIVATE void adjust_priv_slot(struct priv *privp, struct priv *from_privp) +static void adjust_priv_slot(struct priv *privp, struct priv *from_privp) { /* Preserve privilege ids and non-privilege stuff in the priv structure. */ privp->s_id = from_privp->s_id; @@ -178,7 +178,7 @@ PRIVATE void adjust_priv_slot(struct priv *privp, struct priv *from_privp) /*===========================================================================* * swap_fpu_state * *===========================================================================*/ -PRIVATE void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp, +static void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp, struct proc *b_copy_rp) { /* Copy the FPU state from process B's copied slot, using B's original FPU @@ -196,7 +196,7 @@ PRIVATE void swap_fpu_state(struct proc *a_rp, struct proc *b_orig_rp, /*===========================================================================* * swap_proc_slot_pointer * *===========================================================================*/ -PRIVATE void swap_proc_slot_pointer(struct proc **rpp, struct proc *src_rp, +static void swap_proc_slot_pointer(struct proc **rpp, struct proc *src_rp, struct proc *dst_rp) { if(*rpp == src_rp) { diff --git a/kernel/system/do_vdevio.c b/kernel/system/do_vdevio.c index 14bec5bf9..8292e1295 100644 --- a/kernel/system/do_vdevio.c +++ b/kernel/system/do_vdevio.c @@ -15,15 +15,15 @@ #if USE_VDEVIO /* Buffer for SYS_VDEVIO to copy (port,value)-pairs from/ to user. */ -PRIVATE char vdevio_buf[VDEVIO_BUF_SIZE]; -PRIVATE pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf; -PRIVATE pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf; -PRIVATE pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf; +static char vdevio_buf[VDEVIO_BUF_SIZE]; +static pvb_pair_t * const pvb = (pvb_pair_t *) vdevio_buf; +static pvw_pair_t * const pvw = (pvw_pair_t *) vdevio_buf; +static pvl_pair_t * const pvl = (pvl_pair_t *) vdevio_buf; /*===========================================================================* * do_vdevio * *===========================================================================*/ -PUBLIC int do_vdevio(struct proc * caller, message * m_ptr) +int do_vdevio(struct proc * caller, message * m_ptr) { /* Perform a series of device I/O on behalf of a non-kernel process. The * I/O addresses and I/O values are fetched from and returned to some buffer diff --git a/kernel/system/do_vmctl.c b/kernel/system/do_vmctl.c index e5a945f7f..20ef5672e 100644 --- a/kernel/system/do_vmctl.c +++ b/kernel/system/do_vmctl.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_vmctl * *===========================================================================*/ -PUBLIC int do_vmctl(struct proc * caller, message * m_ptr) +int do_vmctl(struct proc * caller, message * m_ptr) { int proc_nr; endpoint_t ep = m_ptr->SVMCTL_WHO; diff --git a/kernel/system/do_vtimer.c b/kernel/system/do_vtimer.c index a0c6de045..790054bc9 100644 --- a/kernel/system/do_vtimer.c +++ b/kernel/system/do_vtimer.c @@ -18,7 +18,7 @@ /*===========================================================================* * do_vtimer * *===========================================================================*/ -PUBLIC int do_vtimer(struct proc * caller, message * m_ptr) +int do_vtimer(struct proc * caller, message * m_ptr) { /* Set and/or retrieve the value of one of a process' virtual timers. */ struct proc *rp; /* pointer to process the timer belongs to */ @@ -80,7 +80,7 @@ PUBLIC int do_vtimer(struct proc * caller, message * m_ptr) /*===========================================================================* * vtimer_check * *===========================================================================*/ -PUBLIC void vtimer_check(rp) +void vtimer_check(rp) struct proc *rp; /* pointer to the process */ { /* This is called from the clock task, so we can be interrupted by the clock diff --git a/kernel/system/do_vumap.c b/kernel/system/do_vumap.c index 5cdeaa6c3..6ad430361 100644 --- a/kernel/system/do_vumap.c +++ b/kernel/system/do_vumap.c @@ -19,7 +19,7 @@ /*===========================================================================* * do_vumap * *===========================================================================*/ -PUBLIC int do_vumap(struct proc *caller, message *m_ptr) +int do_vumap(struct proc *caller, message *m_ptr) { /* Map a vector of grants or local virtual addresses to physical addresses. * Designed to be used by drivers to perform an efficient lookup of physical diff --git a/kernel/table.c b/kernel/table.c index 7909eabdb..4975a7dd6 100644 --- a/kernel/table.c +++ b/kernel/table.c @@ -51,7 +51,7 @@ * to prioritize ping messages periodically delivered to system processes. */ -PUBLIC struct boot_image image[] = { +struct boot_image image[] = { /* process nr, flags, stack size, name */ {ASYNCM, 0, 0, "asyncm"}, {IDLE, 0, 0, "idle" }, diff --git a/kernel/utility.c b/kernel/utility.c index db9e77a45..a513b57e2 100644 --- a/kernel/utility.c +++ b/kernel/utility.c @@ -20,7 +20,7 @@ /*===========================================================================* * panic * *===========================================================================*/ -PUBLIC void panic(const char *fmt, ...) +void panic(const char *fmt, ...) { va_list arg; /* The system has run aground of a fatal kernel error. Terminate execution. */ @@ -48,7 +48,7 @@ PUBLIC void panic(const char *fmt, ...) /*===========================================================================* * kputc * *===========================================================================*/ -PUBLIC void kputc(c) +void kputc(c) int c; /* character to append */ { /* Accumulate a single character for a kernel message. Send a notification @@ -86,7 +86,7 @@ int c; /* character to append */ return; } -PUBLIC void cpu_print_freq(unsigned cpu) +void cpu_print_freq(unsigned cpu) { u64_t freq; @@ -94,7 +94,7 @@ PUBLIC void cpu_print_freq(unsigned cpu) printf("CPU %d freq %lu MHz\n", cpu, div64u(freq, 1000000)); } -PUBLIC int is_fpu(void) +int is_fpu(void) { return get_cpulocal_var(fpu_presence); } diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 763435108..9fee73b96 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -12,7 +12,7 @@ unsigned watchdog_local_timer_ticks = 0U; struct arch_watchdog *watchdog; int watchdog_enabled; -PRIVATE void lockup_check(struct nmi_frame * frame) +static void lockup_check(struct nmi_frame * frame) { /* FIXME this should be CPU local */ static unsigned no_ticks; @@ -50,7 +50,7 @@ PRIVATE void lockup_check(struct nmi_frame * frame) arch_watchdog_lockup(frame); } -PUBLIC void nmi_watchdog_handler(struct nmi_frame * frame) +void nmi_watchdog_handler(struct nmi_frame * frame) { #if SPROFILE /* diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 0677e81e7..499832693 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -47,43 +47,43 @@ #include -FORWARD int msg_open(int minor_dev_nr); -FORWARD int msg_close(int minor_dev_nr); -FORWARD int msg_ioctl(const message *m_ptr); -FORWARD void msg_write(const message *m_ptr); -FORWARD void msg_read(message *m_ptr); -FORWARD void msg_hardware(void); -FORWARD void msg_status(message *m_ptr); -FORWARD int init_driver(void); -FORWARD int open_sub_dev(int sub_dev_nr, int operation); -FORWARD int close_sub_dev(int sub_dev_nr); -FORWARD void handle_int_write(int sub_dev_nr); -FORWARD void handle_int_read(int sub_dev_nr); -FORWARD void data_to_user(sub_dev_t *sub_dev_ptr); -FORWARD void data_from_user(sub_dev_t *sub_dev_ptr); -FORWARD int init_buffers(sub_dev_t *sub_dev_ptr); -FORWARD int get_started(sub_dev_t *sub_dev_ptr); -FORWARD void reply(int code, int replyee, int process,int status); -FORWARD int io_ctl_length(int io_request); -FORWARD special_file_t* get_special_file(int minor_dev_nr); -FORWARD void tell_dev(vir_bytes buf, size_t size, int pci_bus, int +static int msg_open(int minor_dev_nr); +static int msg_close(int minor_dev_nr); +static int msg_ioctl(const message *m_ptr); +static void msg_write(const message *m_ptr); +static void msg_read(message *m_ptr); +static void msg_hardware(void); +static void msg_status(message *m_ptr); +static int init_driver(void); +static int open_sub_dev(int sub_dev_nr, int operation); +static int close_sub_dev(int sub_dev_nr); +static void handle_int_write(int sub_dev_nr); +static void handle_int_read(int sub_dev_nr); +static void data_to_user(sub_dev_t *sub_dev_ptr); +static void data_from_user(sub_dev_t *sub_dev_ptr); +static int init_buffers(sub_dev_t *sub_dev_ptr); +static int get_started(sub_dev_t *sub_dev_ptr); +static void reply(int code, int replyee, int process,int status); +static int io_ctl_length(int io_request); +static special_file_t* get_special_file(int minor_dev_nr); +static void tell_dev(vir_bytes buf, size_t size, int pci_bus, int pci_dev, int pci_func); -PRIVATE char io_ctl_buf[_IOCPARM_MASK]; -PRIVATE int irq_hook_id = 0; /* id of irq hook at the kernel */ -PRIVATE int irq_hook_set = FALSE; -PRIVATE int device_available = 0;/*todo*/ +static char io_ctl_buf[_IOCPARM_MASK]; +static int irq_hook_id = 0; /* id of irq hook at the kernel */ +static int irq_hook_set = FALSE; +static int device_available = 0;/*todo*/ /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); EXTERN int sef_cb_lu_prepare(int state); EXTERN int sef_cb_lu_state_isvalid(int state); EXTERN void sef_cb_lu_state_dump(int state); -PUBLIC int is_status_msg_expected = FALSE; +int is_status_msg_expected = FALSE; -PUBLIC int main(void) +int main(void) { int r, caller; message mess, repl_mess; @@ -180,7 +180,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -202,13 +202,13 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the audio driver framework. */ return init_driver(); } -PRIVATE int init_driver(void) { +static int init_driver(void) { u32_t i; char irq; static int executed = 0; sub_dev_t* sub_dev_ptr; @@ -263,7 +263,7 @@ PRIVATE int init_driver(void) { /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { int i; char irq; @@ -289,7 +289,7 @@ PRIVATE void sef_cb_signal_handler(int signo) } } -PRIVATE int msg_open (int minor_dev_nr) { +static int msg_open (int minor_dev_nr) { int r, read_chan, write_chan, io_ctl; special_file_t* special_file_ptr; @@ -341,7 +341,7 @@ PRIVATE int msg_open (int minor_dev_nr) { } -PRIVATE int open_sub_dev(int sub_dev_nr, int dma_mode) { +static int open_sub_dev(int sub_dev_nr, int dma_mode) { sub_dev_t* sub_dev_ptr; sub_dev_ptr = &sub_dev[sub_dev_nr]; @@ -377,7 +377,7 @@ PRIVATE int open_sub_dev(int sub_dev_nr, int dma_mode) { } -PRIVATE int msg_close(int minor_dev_nr) { +static int msg_close(int minor_dev_nr) { int r, read_chan, write_chan, io_ctl; special_file_t* special_file_ptr; @@ -412,7 +412,7 @@ PRIVATE int msg_close(int minor_dev_nr) { } -PRIVATE int close_sub_dev(int sub_dev_nr) { +static int close_sub_dev(int sub_dev_nr) { sub_dev_t *sub_dev_ptr; sub_dev_ptr = &sub_dev[sub_dev_nr]; if (sub_dev_ptr->DmaMode == DEV_WRITE_S && !sub_dev_ptr->OutOfData) { @@ -436,7 +436,7 @@ PRIVATE int close_sub_dev(int sub_dev_nr) { } -PRIVATE int msg_ioctl(const message *m_ptr) +static int msg_ioctl(const message *m_ptr) { int status, len, chan; sub_dev_t *sub_dev_ptr; @@ -497,7 +497,7 @@ PRIVATE int msg_ioctl(const message *m_ptr) } -PRIVATE void msg_write(const message *m_ptr) +static void msg_write(const message *m_ptr) { int chan; sub_dev_t *sub_dev_ptr; special_file_t* special_file_ptr; @@ -545,7 +545,7 @@ PRIVATE void msg_write(const message *m_ptr) } -PRIVATE void msg_read(message *m_ptr) +static void msg_read(message *m_ptr) { int chan; sub_dev_t *sub_dev_ptr; special_file_t* special_file_ptr; @@ -595,7 +595,7 @@ PRIVATE void msg_read(message *m_ptr) } -PRIVATE void msg_hardware(void) { +static void msg_hardware(void) { u32_t i; @@ -621,7 +621,7 @@ PRIVATE void msg_hardware(void) { } -PRIVATE void msg_status(message *m_ptr) +static void msg_status(message *m_ptr) { int i; @@ -651,7 +651,7 @@ PRIVATE void msg_status(message *m_ptr) } /* handle interrupt for specified sub device; DmaMode == DEV_WRITE_S*/ -PRIVATE void handle_int_write(int sub_dev_nr) +static void handle_int_write(int sub_dev_nr) { sub_dev_t *sub_dev_ptr; @@ -704,7 +704,7 @@ PRIVATE void handle_int_write(int sub_dev_nr) /* handle interrupt for specified sub device; DmaMode == DEV_READ_S */ -PRIVATE void handle_int_read(int sub_dev_nr) +static void handle_int_read(int sub_dev_nr) { sub_dev_t *sub_dev_ptr; @@ -755,7 +755,7 @@ PRIVATE void handle_int_read(int sub_dev_nr) } -PRIVATE int get_started(sub_dev_t *sub_dev_ptr) { +static int get_started(sub_dev_t *sub_dev_ptr) { u32_t i; /* enable interrupt messages from MINIX */ @@ -775,7 +775,7 @@ PRIVATE int get_started(sub_dev_t *sub_dev_ptr) { } -PRIVATE void data_from_user(sub_dev_t *subdev) +static void data_from_user(sub_dev_t *subdev) { int r; message m; @@ -845,7 +845,7 @@ PRIVATE void data_from_user(sub_dev_t *subdev) } -PRIVATE void data_to_user(sub_dev_t *sub_dev_ptr) +static void data_to_user(sub_dev_t *sub_dev_ptr) { int r; message m; @@ -902,7 +902,7 @@ PRIVATE void data_to_user(sub_dev_t *sub_dev_ptr) sub_dev_ptr->RevivePending = 0; } -PRIVATE int init_buffers(sub_dev_t *sub_dev_ptr) +static int init_buffers(sub_dev_t *sub_dev_ptr) { #if (CHIP == INTEL) char *base; @@ -961,7 +961,7 @@ PRIVATE int init_buffers(sub_dev_t *sub_dev_ptr) } -PRIVATE void reply(int code, int replyee, int process, int status) { +static void reply(int code, int replyee, int process, int status) { message m; m.m_type = code; /* DEV_REVIVE */ @@ -971,13 +971,13 @@ PRIVATE void reply(int code, int replyee, int process, int status) { } -PRIVATE int io_ctl_length(int io_request) { +static int io_ctl_length(int io_request) { io_request >>= 16; return io_request & _IOCPARM_MASK; } -PRIVATE special_file_t* get_special_file(int minor_dev_nr) { +static special_file_t* get_special_file(int minor_dev_nr) { int i; for(i = 0; i < drv.NrOfSpecialFiles; i++) { @@ -992,7 +992,7 @@ PRIVATE special_file_t* get_special_file(int minor_dev_nr) { return NULL; } -PRIVATE void tell_dev(buf, size, pci_bus, pci_dev, pci_func) +static void tell_dev(buf, size, pci_bus, pci_dev, pci_func) vir_bytes buf; size_t size; int pci_bus; diff --git a/lib/libaudiodriver/liveupdate.c b/lib/libaudiodriver/liveupdate.c index 4372d5d79..96b8a35fe 100644 --- a/lib/libaudiodriver/liveupdate.c +++ b/lib/libaudiodriver/liveupdate.c @@ -9,9 +9,9 @@ EXTERN int is_status_msg_expected; */ /* State management helpers */ -PRIVATE int is_read_pending; -PRIVATE int is_write_pending; -PRIVATE void load_state_info(void) +static int is_read_pending; +static int is_write_pending; +static void load_state_info(void) { int i, dma_mode, found_pending; @@ -44,7 +44,7 @@ PRIVATE void load_state_info(void) /*===========================================================================* * sef_cb_lu_prepare * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare(int state) +int sef_cb_lu_prepare(int state) { int is_ready; @@ -81,7 +81,7 @@ PUBLIC int sef_cb_lu_prepare(int state) /*===========================================================================* * sef_cb_lu_state_isvalid * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid(int state) +int sef_cb_lu_state_isvalid(int state) { return SEF_LU_STATE_IS_STANDARD(state) || AUDIO_STATE_IS_CUSTOM(state); } @@ -89,7 +89,7 @@ PUBLIC int sef_cb_lu_state_isvalid(int state) /*===========================================================================* * sef_cb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump(int state) +void sef_cb_lu_state_dump(int state) { /* Load state information. */ load_state_info(); diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index b72223b27..df32ad900 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -48,13 +48,13 @@ #include "trace.h" /* Management data for opened devices. */ -PRIVATE int open_devs[MAX_NR_OPEN_DEVICES]; -PRIVATE int next_open_devs_slot = 0; +static int open_devs[MAX_NR_OPEN_DEVICES]; +static int next_open_devs_slot = 0; /*===========================================================================* * clear_open_devs * *===========================================================================*/ -PRIVATE void clear_open_devs(void) +static void clear_open_devs(void) { /* Reset the set of previously opened minor devices. */ next_open_devs_slot = 0; @@ -63,7 +63,7 @@ PRIVATE void clear_open_devs(void) /*===========================================================================* * is_open_dev * *===========================================================================*/ -PRIVATE int is_open_dev(int device) +static int is_open_dev(int device) { /* Check whether the given minor device has previously been opened. */ int i; @@ -78,7 +78,7 @@ PRIVATE int is_open_dev(int device) /*===========================================================================* * set_open_dev * *===========================================================================*/ -PRIVATE void set_open_dev(int device) +static void set_open_dev(int device) { /* Mark the given minor device as having been opened. */ @@ -92,7 +92,7 @@ PRIVATE void set_open_dev(int device) /*===========================================================================* * blockdriver_announce * *===========================================================================*/ -PUBLIC void blockdriver_announce(int type) +void blockdriver_announce(int type) { /* Announce we are up after a fresh start or a restart. */ int r; @@ -130,7 +130,7 @@ PUBLIC void blockdriver_announce(int type) /*===========================================================================* * blockdriver_reply * *===========================================================================*/ -PUBLIC void blockdriver_reply(message *m_ptr, int ipc_status, int reply) +void blockdriver_reply(message *m_ptr, int ipc_status, int reply) { /* Reply to a block request sent to the driver. */ endpoint_t caller_e; @@ -167,7 +167,7 @@ PUBLIC void blockdriver_reply(message *m_ptr, int ipc_status, int reply) /*===========================================================================* * do_open * *===========================================================================*/ -PRIVATE int do_open(struct blockdriver *bdp, message *mp) +static int do_open(struct blockdriver *bdp, message *mp) { /* Open a minor device. */ @@ -177,7 +177,7 @@ PRIVATE int do_open(struct blockdriver *bdp, message *mp) /*===========================================================================* * do_close * *===========================================================================*/ -PRIVATE int do_close(struct blockdriver *bdp, message *mp) +static int do_close(struct blockdriver *bdp, message *mp) { /* Close a minor device. */ @@ -187,7 +187,7 @@ PRIVATE int do_close(struct blockdriver *bdp, message *mp) /*===========================================================================* * do_rdwt * *===========================================================================*/ -PRIVATE int do_rdwt(struct blockdriver *bdp, message *mp) +static int do_rdwt(struct blockdriver *bdp, message *mp) { /* Carry out a single read or write request. */ iovec_t iovec1; @@ -216,7 +216,7 @@ PRIVATE int do_rdwt(struct blockdriver *bdp, message *mp) /*===========================================================================* * do_vrdwt * *===========================================================================*/ -PRIVATE int do_vrdwt(struct blockdriver *bdp, message *mp, thread_id_t id) +static int do_vrdwt(struct blockdriver *bdp, message *mp, thread_id_t id) { /* Carry out an device read or write to/from a vector of buffers. */ iovec_t iovec[NR_IOREQS]; @@ -257,7 +257,7 @@ PRIVATE int do_vrdwt(struct blockdriver *bdp, message *mp, thread_id_t id) /*===========================================================================* * do_dioctl * *===========================================================================*/ -PRIVATE int do_dioctl(struct blockdriver *bdp, dev_t minor, +static int do_dioctl(struct blockdriver *bdp, dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { /* Carry out a disk-specific I/O control request. */ @@ -307,7 +307,7 @@ PRIVATE int do_dioctl(struct blockdriver *bdp, dev_t minor, /*===========================================================================* * do_ioctl * *===========================================================================*/ -PRIVATE int do_ioctl(struct blockdriver *bdp, message *mp) +static int do_ioctl(struct blockdriver *bdp, message *mp) { /* Carry out an I/O control request. We forward block trace control requests * to the tracing module, and handle setting/getting partitions when the driver @@ -355,7 +355,7 @@ PRIVATE int do_ioctl(struct blockdriver *bdp, message *mp) /*===========================================================================* * blockdriver_handle_notify * *===========================================================================*/ -PUBLIC void blockdriver_handle_notify(struct blockdriver *bdp, message *m_ptr) +void blockdriver_handle_notify(struct blockdriver *bdp, message *m_ptr) { /* Take care of the notifications (interrupt and clock messages) by calling * the appropiate callback functions. Never send a reply. @@ -382,7 +382,7 @@ PUBLIC void blockdriver_handle_notify(struct blockdriver *bdp, message *m_ptr) /*===========================================================================* * blockdriver_handle_request * *===========================================================================*/ -PUBLIC int blockdriver_handle_request(struct blockdriver *bdp, message *m_ptr, +int blockdriver_handle_request(struct blockdriver *bdp, message *m_ptr, thread_id_t id) { /* Call the appropiate driver function, based on the type of request. Return diff --git a/lib/libblockdriver/driver_mt.c b/lib/libblockdriver/driver_mt.c index e1673a8eb..31be86fec 100644 --- a/lib/libblockdriver/driver_mt.c +++ b/lib/libblockdriver/driver_mt.c @@ -53,20 +53,20 @@ typedef struct { mthread_rwlock_t barrier; } device_t; -PRIVATE struct blockdriver *bdtab; -PRIVATE int running = FALSE; +static struct blockdriver *bdtab; +static int running = FALSE; -PRIVATE mthread_key_t worker_key; +static mthread_key_t worker_key; -PRIVATE device_t device[MAX_DEVICES]; +static device_t device[MAX_DEVICES]; -PRIVATE worker_t *exited[MAX_THREADS]; -PRIVATE int num_exited = 0; +static worker_t *exited[MAX_THREADS]; +static int num_exited = 0; /*===========================================================================* * enqueue * *===========================================================================*/ -PRIVATE void enqueue(device_t *dp, const message *m_src, int ipc_status) +static void enqueue(device_t *dp, const message *m_src, int ipc_status) { /* Enqueue a message into the device's queue, and signal the event. * Must be called from the master thread. @@ -81,7 +81,7 @@ PRIVATE void enqueue(device_t *dp, const message *m_src, int ipc_status) /*===========================================================================* * try_dequeue * *===========================================================================*/ -PRIVATE int try_dequeue(device_t *dp, message *m_dst, int *ipc_status) +static int try_dequeue(device_t *dp, message *m_dst, int *ipc_status) { /* See if a message can be dequeued from the current worker thread's device * queue. If so, dequeue the message and return TRUE. If not, return FALSE. @@ -94,7 +94,7 @@ PRIVATE int try_dequeue(device_t *dp, message *m_dst, int *ipc_status) /*===========================================================================* * dequeue * *===========================================================================*/ -PRIVATE int dequeue(device_t *dp, worker_t *wp, message *m_dst, +static int dequeue(device_t *dp, worker_t *wp, message *m_dst, int *ipc_status) { /* Dequeue a message from the current worker thread's device queue. Block the @@ -119,7 +119,7 @@ PRIVATE int dequeue(device_t *dp, worker_t *wp, message *m_dst, /*===========================================================================* * is_transfer_req * *===========================================================================*/ -PRIVATE int is_transfer_req(int type) +static int is_transfer_req(int type) { /* Return whether the given block device request is a transfer request. */ @@ -139,7 +139,7 @@ PRIVATE int is_transfer_req(int type) /*===========================================================================* * worker_thread * *===========================================================================*/ -PRIVATE void *worker_thread(void *param) +static void *worker_thread(void *param) { /* The worker thread loop. Set up the thread-specific reference to itself and * start looping. The loop consists of blocking dequeing and handling messages. @@ -207,7 +207,7 @@ PRIVATE void *worker_thread(void *param) /*===========================================================================* * master_create_worker * *===========================================================================*/ -PRIVATE void master_create_worker(worker_t *wp, worker_id_t worker_id, +static void master_create_worker(worker_t *wp, worker_id_t worker_id, device_id_t device_id) { /* Start a new worker thread. @@ -240,7 +240,7 @@ PRIVATE void master_create_worker(worker_t *wp, worker_id_t worker_id, /*===========================================================================* * master_destroy_worker * *===========================================================================*/ -PRIVATE void master_destroy_worker(worker_t *wp) +static void master_destroy_worker(worker_t *wp) { /* Clean up resources used by an exited worker thread. */ @@ -261,7 +261,7 @@ PRIVATE void master_destroy_worker(worker_t *wp) /*===========================================================================* * master_handle_exits * *===========================================================================*/ -PRIVATE void master_handle_exits(void) +static void master_handle_exits(void) { /* Destroy the remains of all exited threads. */ @@ -276,7 +276,7 @@ PRIVATE void master_handle_exits(void) /*===========================================================================* * master_handle_request * *===========================================================================*/ -PRIVATE void master_handle_request(message *m_ptr, int ipc_status) +static void master_handle_request(message *m_ptr, int ipc_status) { /* For real request messages, query the device ID, start a thread if none is * free and the maximum number of threads for that device has not yet been @@ -337,7 +337,7 @@ PRIVATE void master_handle_request(message *m_ptr, int ipc_status) /*===========================================================================* * master_init * *===========================================================================*/ -PRIVATE void master_init(struct blockdriver *bdp) +static void master_init(struct blockdriver *bdp) { /* Initialize the state of the master thread. */ @@ -371,7 +371,7 @@ PRIVATE void master_init(struct blockdriver *bdp) /*===========================================================================* * blockdriver_mt_get_tid * *===========================================================================*/ -PUBLIC thread_id_t blockdriver_mt_get_tid(void) +thread_id_t blockdriver_mt_get_tid(void) { /* Return back the ID of this thread. */ @@ -388,7 +388,7 @@ PUBLIC thread_id_t blockdriver_mt_get_tid(void) /*===========================================================================* * blockdriver_mt_receive * *===========================================================================*/ -PRIVATE void blockdriver_mt_receive(message *m_ptr, int *ipc_status) +static void blockdriver_mt_receive(message *m_ptr, int *ipc_status) { /* Receive a message. */ @@ -403,7 +403,7 @@ PRIVATE void blockdriver_mt_receive(message *m_ptr, int *ipc_status) /*===========================================================================* * blockdriver_mt_task * *===========================================================================*/ -PUBLIC void blockdriver_mt_task(struct blockdriver *driver_tab) +void blockdriver_mt_task(struct blockdriver *driver_tab) { /* The multithreaded driver task. */ @@ -444,7 +444,7 @@ PUBLIC void blockdriver_mt_task(struct blockdriver *driver_tab) /*===========================================================================* * blockdriver_mt_terminate * *===========================================================================*/ -PUBLIC void blockdriver_mt_terminate(void) +void blockdriver_mt_terminate(void) { /* Instruct libblockdriver to shut down. */ @@ -455,7 +455,7 @@ PUBLIC void blockdriver_mt_terminate(void) /*===========================================================================* * blockdriver_mt_sleep * *===========================================================================*/ -PUBLIC void blockdriver_mt_sleep(void) +void blockdriver_mt_sleep(void) { /* Let the current thread sleep until it gets woken up by the master thread. */ @@ -472,7 +472,7 @@ PUBLIC void blockdriver_mt_sleep(void) /*===========================================================================* * blockdriver_mt_wakeup * *===========================================================================*/ -PUBLIC void blockdriver_mt_wakeup(thread_id_t id) +void blockdriver_mt_wakeup(thread_id_t id) { /* Wake up a sleeping worker thread from the master thread. */ @@ -496,7 +496,7 @@ PUBLIC void blockdriver_mt_wakeup(thread_id_t id) /*===========================================================================* * blockdriver_mt_set_workers * *===========================================================================*/ -PUBLIC void blockdriver_mt_set_workers(device_id_t id, int workers) +void blockdriver_mt_set_workers(device_id_t id, int workers) { /* Set the number of worker threads for the given device. */ diff --git a/lib/libblockdriver/driver_st.c b/lib/libblockdriver/driver_st.c index f5c78ab1d..61e3e1c9a 100644 --- a/lib/libblockdriver/driver_st.c +++ b/lib/libblockdriver/driver_st.c @@ -18,12 +18,12 @@ #include "driver.h" #include "mq.h" -PRIVATE int running; +static int running; /*===========================================================================* * blockdriver_receive_mq * *===========================================================================*/ -PUBLIC int blockdriver_receive_mq(message *m_ptr, int *status_ptr) +int blockdriver_receive_mq(message *m_ptr, int *status_ptr) { /* receive() interface for drivers with message queueing. */ @@ -38,7 +38,7 @@ PUBLIC int blockdriver_receive_mq(message *m_ptr, int *status_ptr) /*===========================================================================* * blockdriver_terminate * *===========================================================================*/ -PUBLIC void blockdriver_terminate(void) +void blockdriver_terminate(void) { /* Break out of the main driver loop after finishing the current request. */ @@ -48,7 +48,7 @@ PUBLIC void blockdriver_terminate(void) /*===========================================================================* * blockdriver_task * *===========================================================================*/ -PUBLIC void blockdriver_task(struct blockdriver *bdp) +void blockdriver_task(struct blockdriver *bdp) { /* Main program of any block device driver task. */ int r, ipc_status; @@ -70,7 +70,7 @@ PUBLIC void blockdriver_task(struct blockdriver *bdp) /*===========================================================================* * blockdriver_process * *===========================================================================*/ -PUBLIC void blockdriver_process(struct blockdriver *bdp, message *m_ptr, +void blockdriver_process(struct blockdriver *bdp, message *m_ptr, int ipc_status) { /* Handle the given received message. */ @@ -91,7 +91,7 @@ PUBLIC void blockdriver_process(struct blockdriver *bdp, message *m_ptr, /*===========================================================================* * blockdriver_mq_queue * *===========================================================================*/ -PUBLIC int blockdriver_mq_queue(message *m, int status) +int blockdriver_mq_queue(message *m, int status) { /* Queue a message for later processing. */ diff --git a/lib/libblockdriver/drvlib.c b/lib/libblockdriver/drvlib.c index 3091d5156..55df9f00d 100644 --- a/lib/libblockdriver/drvlib.c +++ b/lib/libblockdriver/drvlib.c @@ -11,18 +11,18 @@ /* Extended partition? */ #define ext_part(s) ((s) == 0x05 || (s) == 0x0F) -FORWARD void parse_part_table(struct blockdriver *bdp, int device, int +static void parse_part_table(struct blockdriver *bdp, int device, int style, int atapi, u8_t *tmp_buf); -FORWARD void extpartition(struct blockdriver *bdp, int extdev, unsigned +static void extpartition(struct blockdriver *bdp, int extdev, unsigned long extbase, u8_t *tmp_buf); -FORWARD int get_part_table(struct blockdriver *bdp, int device, unsigned +static int get_part_table(struct blockdriver *bdp, int device, unsigned long offset, struct part_entry *table, u8_t *tmp_buf); -FORWARD void sort(struct part_entry *table); +static void sort(struct part_entry *table); /*============================================================================* * partition * *============================================================================*/ -PUBLIC void partition(bdp, device, style, atapi) +void partition(bdp, device, style, atapi) struct blockdriver *bdp; /* device dependent entry points */ int device; /* device to partition */ int style; /* partitioning style: floppy, primary, sub. */ @@ -51,7 +51,7 @@ int atapi; /* atapi device */ /*============================================================================* * parse_part_table * *============================================================================*/ -PRIVATE void parse_part_table(bdp, device, style, atapi, tmp_buf) +static void parse_part_table(bdp, device, style, atapi, tmp_buf) struct blockdriver *bdp; /* device dependent entry points */ int device; /* device to partition */ int style; /* partitioning style: floppy, primary, sub. */ @@ -128,7 +128,7 @@ u8_t *tmp_buf; /* temporary buffer */ /*============================================================================* * extpartition * *============================================================================*/ -PRIVATE void extpartition(bdp, extdev, extbase, tmp_buf) +static void extpartition(bdp, extdev, extbase, tmp_buf) struct blockdriver *bdp; /* device dependent entry points */ int extdev; /* extended partition to scan */ unsigned long extbase; /* sector offset of the base ext. partition */ @@ -177,7 +177,7 @@ u8_t *tmp_buf; /* temporary buffer */ /*============================================================================* * get_part_table * *============================================================================*/ -PRIVATE int get_part_table(bdp, device, offset, table, tmp_buf) +static int get_part_table(bdp, device, offset, table, tmp_buf) struct blockdriver *bdp; int device; unsigned long offset; /* sector offset to the table */ @@ -210,7 +210,7 @@ u8_t *tmp_buf; /* temporary buffer */ /*===========================================================================* * sort * *===========================================================================*/ -PRIVATE void sort(table) +static void sort(table) struct part_entry *table; { /* Sort a partition table. */ diff --git a/lib/libblockdriver/mq.c b/lib/libblockdriver/mq.c index 1ea82aa71..af2fcc5ec 100644 --- a/lib/libblockdriver/mq.c +++ b/lib/libblockdriver/mq.c @@ -21,14 +21,14 @@ struct mq_cell { STAILQ_ENTRY(mq_cell) next; }; -PRIVATE struct mq_cell pool[MQ_SIZE]; -PRIVATE STAILQ_HEAD(queue, mq_cell) queue[MAX_DEVICES]; -PRIVATE STAILQ_HEAD(free_list, mq_cell) free_list; +static struct mq_cell pool[MQ_SIZE]; +static STAILQ_HEAD(queue, mq_cell) queue[MAX_DEVICES]; +static STAILQ_HEAD(free_list, mq_cell) free_list; /*===========================================================================* * mq_init * *===========================================================================*/ -PUBLIC void mq_init(void) +void mq_init(void) { /* Initialize the message queues and message cells. */ @@ -46,7 +46,7 @@ PUBLIC void mq_init(void) /*===========================================================================* * mq_enqueue * *===========================================================================*/ -PUBLIC int mq_enqueue(device_id_t device_id, const message *mess, +int mq_enqueue(device_id_t device_id, const message *mess, int ipc_status) { /* Add a message, including its IPC status, to the message queue of a device. @@ -73,7 +73,7 @@ PUBLIC int mq_enqueue(device_id_t device_id, const message *mess, /*===========================================================================* * mq_dequeue * *===========================================================================*/ -PUBLIC int mq_dequeue(device_id_t device_id, message *mess, int *ipc_status) +int mq_dequeue(device_id_t device_id, message *mess, int *ipc_status) { /* Return and remove a message, including its IPC status, from the message * queue of a thread. Return TRUE iff a message was available. diff --git a/lib/libblockdriver/trace.c b/lib/libblockdriver/trace.c index a93971073..036609c65 100644 --- a/lib/libblockdriver/trace.c +++ b/lib/libblockdriver/trace.c @@ -13,24 +13,24 @@ #define NO_TRACEDEV ((dev_t) -1) #define NO_TIME ((u32_t) -1) -PRIVATE int trace_enabled = FALSE; -PRIVATE dev_t trace_dev = NO_TRACEDEV; -PRIVATE btrace_entry *trace_buf = NULL; -PRIVATE size_t trace_size = 0; -PRIVATE size_t trace_pos; -PRIVATE size_t trace_next; -PRIVATE u64_t trace_tsc; +static int trace_enabled = FALSE; +static dev_t trace_dev = NO_TRACEDEV; +static btrace_entry *trace_buf = NULL; +static size_t trace_size = 0; +static size_t trace_pos; +static size_t trace_next; +static u64_t trace_tsc; /* Pointers to in-progress trace entries for each thread (all worker threads, * plus one for the main thread). Each pointer is set to NULL whenever no * operation is currently being traced for that thread, for whatever reason. */ -PRIVATE btrace_entry *trace_ptr[MAX_THREADS + 1] = { NULL }; +static btrace_entry *trace_ptr[MAX_THREADS + 1] = { NULL }; /*===========================================================================* * trace_gettime * *===========================================================================*/ -PRIVATE u32_t trace_gettime(void) +static u32_t trace_gettime(void) { /* Return the current time, in microseconds since the start of the trace. */ @@ -48,7 +48,7 @@ PRIVATE u32_t trace_gettime(void) /*===========================================================================* * trace_ctl * *===========================================================================*/ -PUBLIC int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, +int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, cp_grant_id_t grant) { /* Process a block trace control request. @@ -164,7 +164,7 @@ PUBLIC int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, /*===========================================================================* * trace_start * *===========================================================================*/ -PUBLIC void trace_start(thread_id_t id, message *m_ptr) +void trace_start(thread_id_t id, message *m_ptr) { /* Start creating a trace entry. */ @@ -247,7 +247,7 @@ PUBLIC void trace_start(thread_id_t id, message *m_ptr) /*===========================================================================* * trace_setsize * *===========================================================================*/ -PUBLIC void trace_setsize(thread_id_t id, size_t size) +void trace_setsize(thread_id_t id, size_t size) { /* Set the current trace entry's actual (byte) size, for vector requests. */ @@ -265,7 +265,7 @@ PUBLIC void trace_setsize(thread_id_t id, size_t size) /*===========================================================================* * trace_finish * *===========================================================================*/ -PUBLIC void trace_finish(thread_id_t id, int result) +void trace_finish(thread_id_t id, int result) { /* Finish a trace entry. */ diff --git a/lib/libc/gen/minix/sysconf.c b/lib/libc/gen/minix/sysconf.c index 95aabeb7a..45a9e7b13 100644 --- a/lib/libc/gen/minix/sysconf.c +++ b/lib/libc/gen/minix/sysconf.c @@ -19,7 +19,7 @@ __weak_alias(sysconf, __sysconf) #endif -PRIVATE u32_t get_hz(void) +static u32_t get_hz(void) { FILE *fp; u32_t hz; @@ -38,7 +38,7 @@ PRIVATE u32_t get_hz(void) return DEFAULT_HZ; } -PUBLIC long int sysconf(name) +long int sysconf(name) int name; /* property being inspected */ { switch(name) { diff --git a/lib/libc/gen/minix/times.c b/lib/libc/gen/minix/times.c index d839a3bf8..b8aa084b8 100644 --- a/lib/libc/gen/minix/times.c +++ b/lib/libc/gen/minix/times.c @@ -8,7 +8,7 @@ __weak_alias(times, _times) #endif -PUBLIC clock_t times(buf) +clock_t times(buf) struct tms *buf; { message m; diff --git a/lib/libc/gen/minix/utime.c b/lib/libc/gen/minix/utime.c index 35b3f0e66..999174496 100644 --- a/lib/libc/gen/minix/utime.c +++ b/lib/libc/gen/minix/utime.c @@ -7,7 +7,7 @@ #include #include -PUBLIC int utime(const char *name, const struct utimbuf *timp) +int utime(const char *name, const struct utimbuf *timp) { message m; diff --git a/lib/libc/sys-minix/_mcontext.c b/lib/libc/sys-minix/_mcontext.c index 183b8a3ea..14502250c 100644 --- a/lib/libc/sys-minix/_mcontext.c +++ b/lib/libc/sys-minix/_mcontext.c @@ -8,7 +8,7 @@ #include #include -PUBLIC int setmcontext(const mcontext_t *mcp) +int setmcontext(const mcontext_t *mcp) { message m; @@ -18,7 +18,7 @@ PUBLIC int setmcontext(const mcontext_t *mcp) } -PUBLIC int getmcontext(mcontext_t *mcp) +int getmcontext(mcontext_t *mcp) { message m; diff --git a/lib/libc/sys-minix/_ucontext.c b/lib/libc/sys-minix/_ucontext.c index 16cb40023..58a287352 100644 --- a/lib/libc/sys-minix/_ucontext.c +++ b/lib/libc/sys-minix/_ucontext.c @@ -15,7 +15,7 @@ void ctx_start(void (*)(void), int, ...); /*===========================================================================* * setuctx * *===========================================================================*/ -PUBLIC int setuctx(const ucontext_t *ucp) +int setuctx(const ucontext_t *ucp) { int r; @@ -42,7 +42,7 @@ PUBLIC int setuctx(const ucontext_t *ucp) /*===========================================================================* * getuctx * *===========================================================================*/ -PUBLIC int getuctx(ucontext_t *ucp) +int getuctx(ucontext_t *ucp) { int r; @@ -69,7 +69,7 @@ PUBLIC int getuctx(ucontext_t *ucp) /*===========================================================================* * makecontext * *===========================================================================*/ -PUBLIC void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) +void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) { va_list ap; unsigned int *stack_top; @@ -157,7 +157,7 @@ PUBLIC void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) /*===========================================================================* * swapcontext * *===========================================================================*/ -PUBLIC int swapcontext(ucontext_t *oucp, const ucontext_t *ucp) +int swapcontext(ucontext_t *oucp, const ucontext_t *ucp) { int r; @@ -186,7 +186,7 @@ PUBLIC int swapcontext(ucontext_t *oucp, const ucontext_t *ucp) /*===========================================================================* * resumecontext * *===========================================================================*/ -PUBLIC void resumecontext(ucontext_t *ucp) +void resumecontext(ucontext_t *ucp) { if (ucp->uc_link == NULL) exit(0); diff --git a/lib/libc/sys-minix/access.c b/lib/libc/sys-minix/access.c index 218f1d1f5..9aff366a0 100644 --- a/lib/libc/sys-minix/access.c +++ b/lib/libc/sys-minix/access.c @@ -8,7 +8,7 @@ __weak_alias(access, _access) #endif -PUBLIC int access(name, mode) +int access(name, mode) _CONST char *name; int mode; { diff --git a/lib/libc/sys-minix/brk.c b/lib/libc/sys-minix/brk.c index a182dd2dc..b4f76cdee 100644 --- a/lib/libc/sys-minix/brk.c +++ b/lib/libc/sys-minix/brk.c @@ -19,7 +19,7 @@ extern char *_brksize; * as with system calls. In this way, if a user inadvertently defines a * procedure brk, MINIX may continue to work because the true call is _brk. */ -PUBLIC int brk(addr) +int brk(addr) void *addr; { message m; diff --git a/lib/libc/sys-minix/chdir.c b/lib/libc/sys-minix/chdir.c index 03bab11f9..03efaf756 100644 --- a/lib/libc/sys-minix/chdir.c +++ b/lib/libc/sys-minix/chdir.c @@ -9,7 +9,7 @@ __weak_alias(chdir, _chdir) __weak_alias(fchdir, _fchdir) #endif -PUBLIC int chdir(name) +int chdir(name) _CONST char *name; { message m; @@ -18,7 +18,7 @@ _CONST char *name; return(_syscall(VFS_PROC_NR, CHDIR, &m)); } -PUBLIC int fchdir(fd) +int fchdir(fd) int fd; { message m; diff --git a/lib/libc/sys-minix/chmod.c b/lib/libc/sys-minix/chmod.c index 50df7fe37..e19979dd9 100644 --- a/lib/libc/sys-minix/chmod.c +++ b/lib/libc/sys-minix/chmod.c @@ -8,7 +8,7 @@ __weak_alias(chmod, _chmod) #endif -PUBLIC int chmod(const char *name, mode_t mode) +int chmod(const char *name, mode_t mode) { message m; diff --git a/lib/libc/sys-minix/chown.c b/lib/libc/sys-minix/chown.c index 8a15d3211..cbaf2b27a 100644 --- a/lib/libc/sys-minix/chown.c +++ b/lib/libc/sys-minix/chown.c @@ -9,7 +9,7 @@ __weak_alias(chown, _chown) #endif -PUBLIC int chown(const char *name, uid_t owner, gid_t grp) +int chown(const char *name, uid_t owner, gid_t grp) { message m; diff --git a/lib/libc/sys-minix/chroot.c b/lib/libc/sys-minix/chroot.c index e557cf0c6..c133ba347 100644 --- a/lib/libc/sys-minix/chroot.c +++ b/lib/libc/sys-minix/chroot.c @@ -8,7 +8,7 @@ __weak_alias(chroot, _chroot) #endif -PUBLIC int chroot(name) +int chroot(name) _CONST char *name; { message m; diff --git a/lib/libc/sys-minix/close.c b/lib/libc/sys-minix/close.c index 3fa75c1a5..587e5f1b4 100644 --- a/lib/libc/sys-minix/close.c +++ b/lib/libc/sys-minix/close.c @@ -8,7 +8,7 @@ __weak_alias(close, _close) #endif -PUBLIC int close(fd) +int close(fd) int fd; { message m; diff --git a/lib/libc/sys-minix/dup.c b/lib/libc/sys-minix/dup.c index d7bd8d4b4..2019937b2 100644 --- a/lib/libc/sys-minix/dup.c +++ b/lib/libc/sys-minix/dup.c @@ -9,7 +9,7 @@ __weak_alias(dup, _dup) #endif -PUBLIC int dup(fd) +int dup(fd) int fd; { return(fcntl(fd, F_DUPFD, 0)); diff --git a/lib/libc/sys-minix/dup2.c b/lib/libc/sys-minix/dup2.c index 46d632922..28772ff4d 100644 --- a/lib/libc/sys-minix/dup2.c +++ b/lib/libc/sys-minix/dup2.c @@ -9,7 +9,7 @@ __weak_alias(dup2, _dup2) #endif -PUBLIC int dup2(fd, fd2) +int dup2(fd, fd2) int fd, fd2; { /* The behavior of dup2 is defined by POSIX in 6.2.1.2 as almost, but not diff --git a/lib/libc/sys-minix/fchmod.c b/lib/libc/sys-minix/fchmod.c index 69445b911..8a62a8bbf 100644 --- a/lib/libc/sys-minix/fchmod.c +++ b/lib/libc/sys-minix/fchmod.c @@ -8,7 +8,7 @@ __weak_alias(fchmod, _fchmod) #endif -PUBLIC int fchmod(int fd, mode_t mode) +int fchmod(int fd, mode_t mode) { message m; diff --git a/lib/libc/sys-minix/fchown.c b/lib/libc/sys-minix/fchown.c index 95f1e411c..6949df983 100644 --- a/lib/libc/sys-minix/fchown.c +++ b/lib/libc/sys-minix/fchown.c @@ -9,7 +9,7 @@ __weak_alias(fchown, _fchown) #endif -PUBLIC int fchown(int fd, uid_t owner, gid_t grp) +int fchown(int fd, uid_t owner, gid_t grp) { message m; diff --git a/lib/libc/sys-minix/fcntl.c b/lib/libc/sys-minix/fcntl.c index 073f088d8..31e1281f3 100644 --- a/lib/libc/sys-minix/fcntl.c +++ b/lib/libc/sys-minix/fcntl.c @@ -10,9 +10,9 @@ __weak_alias(fcntl, _fcntl) #endif #if _ANSI -PUBLIC int fcntl(int fd, int cmd, ...) +int fcntl(int fd, int cmd, ...) #else -PUBLIC int fcntl(fd, cmd) +int fcntl(fd, cmd) int fd; int cmd; #endif diff --git a/lib/libc/sys-minix/fork.c b/lib/libc/sys-minix/fork.c index c041b961d..55b6bdc58 100644 --- a/lib/libc/sys-minix/fork.c +++ b/lib/libc/sys-minix/fork.c @@ -8,7 +8,7 @@ __weak_alias(fork, _fork) #endif -PUBLIC pid_t fork() +pid_t fork() { message m; diff --git a/lib/libc/sys-minix/fpathconf.c b/lib/libc/sys-minix/fpathconf.c index a1bbb09b7..cc4b8a083 100644 --- a/lib/libc/sys-minix/fpathconf.c +++ b/lib/libc/sys-minix/fpathconf.c @@ -14,7 +14,7 @@ __weak_alias(fpathconf, _fpathconf) #endif -PUBLIC long fpathconf(fd, name) +long fpathconf(fd, name) int fd; /* file descriptor being interrogated */ int name; /* property being inspected */ { diff --git a/lib/libc/sys-minix/fsync.c b/lib/libc/sys-minix/fsync.c index 1001529a2..15ef3feba 100644 --- a/lib/libc/sys-minix/fsync.c +++ b/lib/libc/sys-minix/fsync.c @@ -8,7 +8,7 @@ __weak_alias(fsync, _fsync) #endif -PUBLIC int fsync(int fd) +int fsync(int fd) { message m; diff --git a/lib/libc/sys-minix/getdents.c b/lib/libc/sys-minix/getdents.c index 61c4da31c..649d86bc6 100644 --- a/lib/libc/sys-minix/getdents.c +++ b/lib/libc/sys-minix/getdents.c @@ -4,7 +4,7 @@ #include -PUBLIC ssize_t getdents(fd, buffer, nbytes) +ssize_t getdents(fd, buffer, nbytes) int fd; char *buffer; size_t nbytes; diff --git a/lib/libc/sys-minix/getegid.c b/lib/libc/sys-minix/getegid.c index aba33b2fb..e77649e1a 100644 --- a/lib/libc/sys-minix/getegid.c +++ b/lib/libc/sys-minix/getegid.c @@ -8,7 +8,7 @@ __weak_alias(getegid, _getegid) #endif -PUBLIC gid_t getegid() +gid_t getegid() { message m; diff --git a/lib/libc/sys-minix/geteuid.c b/lib/libc/sys-minix/geteuid.c index b350ab6a6..ecde17313 100644 --- a/lib/libc/sys-minix/geteuid.c +++ b/lib/libc/sys-minix/geteuid.c @@ -8,7 +8,7 @@ __weak_alias(geteuid, _geteuid) #endif -PUBLIC uid_t geteuid() +uid_t geteuid() { message m; diff --git a/lib/libc/sys-minix/getgid.c b/lib/libc/sys-minix/getgid.c index 288612a56..86228e7ba 100644 --- a/lib/libc/sys-minix/getgid.c +++ b/lib/libc/sys-minix/getgid.c @@ -8,7 +8,7 @@ __weak_alias(getgid, _getgid) #endif -PUBLIC gid_t getgid() +gid_t getgid() { message m; diff --git a/lib/libc/sys-minix/getgroups.c b/lib/libc/sys-minix/getgroups.c index 30ad4b1cf..87f83502a 100644 --- a/lib/libc/sys-minix/getgroups.c +++ b/lib/libc/sys-minix/getgroups.c @@ -13,7 +13,7 @@ __weak_alias(getgroups, _getgroups) #endif -PUBLIC int getgroups(int ngroups, gid_t *arr) +int getgroups(int ngroups, gid_t *arr) { message m; m.m1_i1 = ngroups; diff --git a/lib/libc/sys-minix/getpgrp.c b/lib/libc/sys-minix/getpgrp.c index 5b2140cb7..8df2865f6 100644 --- a/lib/libc/sys-minix/getpgrp.c +++ b/lib/libc/sys-minix/getpgrp.c @@ -8,7 +8,7 @@ __weak_alias(getpgrp, _getpgrp) #endif -PUBLIC pid_t getpgrp() +pid_t getpgrp() { message m; diff --git a/lib/libc/sys-minix/getpid.c b/lib/libc/sys-minix/getpid.c index 2d6d62838..a041af71e 100644 --- a/lib/libc/sys-minix/getpid.c +++ b/lib/libc/sys-minix/getpid.c @@ -8,7 +8,7 @@ __weak_alias(getpid, _getpid) #endif -PUBLIC pid_t getpid() +pid_t getpid() { message m; diff --git a/lib/libc/sys-minix/getppid.c b/lib/libc/sys-minix/getppid.c index ed8d7c505..61bd275f4 100644 --- a/lib/libc/sys-minix/getppid.c +++ b/lib/libc/sys-minix/getppid.c @@ -8,7 +8,7 @@ __weak_alias(getppid, _getppid) #endif -PUBLIC pid_t getppid() +pid_t getppid() { message m; diff --git a/lib/libc/sys-minix/getuid.c b/lib/libc/sys-minix/getuid.c index 65e2215e1..b8662b7e3 100644 --- a/lib/libc/sys-minix/getuid.c +++ b/lib/libc/sys-minix/getuid.c @@ -8,7 +8,7 @@ __weak_alias(getuid, _getuid) #endif -PUBLIC uid_t getuid() +uid_t getuid() { message m; diff --git a/lib/libc/sys-minix/ioctl.c b/lib/libc/sys-minix/ioctl.c index e51e0584b..0c1610a34 100644 --- a/lib/libc/sys-minix/ioctl.c +++ b/lib/libc/sys-minix/ioctl.c @@ -8,7 +8,7 @@ __weak_alias(ioctl, _ioctl) #endif -PUBLIC int ioctl(fd, request, data) +int ioctl(fd, request, data) int fd; int request; void *data; diff --git a/lib/libc/sys-minix/kill.c b/lib/libc/sys-minix/kill.c index 8a91513f6..fb4c86c53 100644 --- a/lib/libc/sys-minix/kill.c +++ b/lib/libc/sys-minix/kill.c @@ -8,7 +8,7 @@ __weak_alias(kill, _kill) #endif -PUBLIC int kill(proc, sig) +int kill(proc, sig) int proc; /* which process is to be sent the signal */ int sig; /* signal number */ { diff --git a/lib/libc/sys-minix/link.c b/lib/libc/sys-minix/link.c index 960d3eba4..f87c9062b 100644 --- a/lib/libc/sys-minix/link.c +++ b/lib/libc/sys-minix/link.c @@ -9,7 +9,7 @@ __weak_alias(link, _link) #endif -PUBLIC int link(const char *name, const char *name2) +int link(const char *name, const char *name2) { message m; diff --git a/lib/libc/sys-minix/lseek.c b/lib/libc/sys-minix/lseek.c index f994fa50b..fbcfb09aa 100644 --- a/lib/libc/sys-minix/lseek.c +++ b/lib/libc/sys-minix/lseek.c @@ -8,7 +8,7 @@ __weak_alias(lseek, _lseek) #endif -PUBLIC off_t lseek(fd, offset, whence) +off_t lseek(fd, offset, whence) int fd; off_t offset; int whence; diff --git a/lib/libc/sys-minix/lseek64.c b/lib/libc/sys-minix/lseek64.c index ea562825e..1310cba5f 100644 --- a/lib/libc/sys-minix/lseek64.c +++ b/lib/libc/sys-minix/lseek64.c @@ -5,7 +5,7 @@ #include #include -PUBLIC int lseek64(fd, offset, whence, newpos) +int lseek64(fd, offset, whence, newpos) int fd; u64_t offset; int whence; diff --git a/lib/libc/sys-minix/m_closefrom.c b/lib/libc/sys-minix/m_closefrom.c index 418d439c5..eae7995c8 100644 --- a/lib/libc/sys-minix/m_closefrom.c +++ b/lib/libc/sys-minix/m_closefrom.c @@ -4,7 +4,7 @@ #include #include -PUBLIC int closefrom(int fd) +int closefrom(int fd) { int f, ok = 0, e = 0; for(f = fd; f < __MINIX_OPEN_MAX; f++) { diff --git a/lib/libc/sys-minix/mkdir.c b/lib/libc/sys-minix/mkdir.c index 1b291b0c5..a014868da 100644 --- a/lib/libc/sys-minix/mkdir.c +++ b/lib/libc/sys-minix/mkdir.c @@ -9,7 +9,7 @@ __weak_alias(mkdir, _mkdir) #endif -PUBLIC int mkdir(const char *name, mode_t mode) +int mkdir(const char *name, mode_t mode) { message m; diff --git a/lib/libc/sys-minix/mkfifo.c b/lib/libc/sys-minix/mkfifo.c index 5e944a9b2..0c2484029 100644 --- a/lib/libc/sys-minix/mkfifo.c +++ b/lib/libc/sys-minix/mkfifo.c @@ -9,7 +9,7 @@ __weak_alias(mkfifo, _mkfifo) #endif -PUBLIC int mkfifo(const char *name, mode_t mode) +int mkfifo(const char *name, mode_t mode) { return mknod(name, mode | S_IFIFO, (dev_t) 0); } diff --git a/lib/libc/sys-minix/mknod.c b/lib/libc/sys-minix/mknod.c index a98070b24..70c7b8705 100644 --- a/lib/libc/sys-minix/mknod.c +++ b/lib/libc/sys-minix/mknod.c @@ -7,7 +7,7 @@ #include #include -PUBLIC int mknod(const char *name, mode_t mode, dev_t dev) +int mknod(const char *name, mode_t mode, dev_t dev) { message m; diff --git a/lib/libc/sys-minix/mmap.c b/lib/libc/sys-minix/mmap.c index d49d495fd..d15e3d1a7 100644 --- a/lib/libc/sys-minix/mmap.c +++ b/lib/libc/sys-minix/mmap.c @@ -21,7 +21,7 @@ __weak_alias(minix_munmap_text, _minix_munmap_text) #include #include -PUBLIC void *minix_mmap(void *addr, size_t len, int prot, int flags, +void *minix_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) { message m; @@ -43,7 +43,7 @@ PUBLIC void *minix_mmap(void *addr, size_t len, int prot, int flags, return (void *) m.VMM_RETADDR; } -PUBLIC int minix_munmap(void *addr, size_t len) +int minix_munmap(void *addr, size_t len) { message m; @@ -54,7 +54,7 @@ PUBLIC int minix_munmap(void *addr, size_t len) } -PUBLIC int minix_munmap_text(void *addr, size_t len) +int minix_munmap_text(void *addr, size_t len) { message m; @@ -64,7 +64,7 @@ PUBLIC int minix_munmap_text(void *addr, size_t len) return _syscall(VM_PROC_NR, VM_MUNMAP_TEXT, &m); } -PUBLIC void *vm_remap(endpoint_t d, +void *vm_remap(endpoint_t d, endpoint_t s, void *da, void *sa, @@ -85,7 +85,7 @@ PUBLIC void *vm_remap(endpoint_t d, return (void *) m.VMRE_RETA; } -PUBLIC void *vm_remap_ro(endpoint_t d, +void *vm_remap_ro(endpoint_t d, endpoint_t s, void *da, void *sa, @@ -106,7 +106,7 @@ PUBLIC void *vm_remap_ro(endpoint_t d, return (void *) m.VMRE_RETA; } -PUBLIC int vm_unmap(endpoint_t endpt, void *addr) +int vm_unmap(endpoint_t endpt, void *addr) { message m; @@ -116,7 +116,7 @@ PUBLIC int vm_unmap(endpoint_t endpt, void *addr) return _syscall(VM_PROC_NR, VM_SHM_UNMAP, &m); } -PUBLIC unsigned long vm_getphys(int endpt, void *addr) +unsigned long vm_getphys(int endpt, void *addr) { message m; int r; @@ -130,7 +130,7 @@ PUBLIC unsigned long vm_getphys(int endpt, void *addr) return m.VMPHYS_RETA; } -PUBLIC u8_t vm_getrefcount(endpoint_t endpt, void *addr) +u8_t vm_getrefcount(endpoint_t endpt, void *addr) { message m; int r; diff --git a/lib/libc/sys-minix/mount.c b/lib/libc/sys-minix/mount.c index 46a8bca85..1f913f8cf 100644 --- a/lib/libc/sys-minix/mount.c +++ b/lib/libc/sys-minix/mount.c @@ -23,7 +23,7 @@ __weak_alias(umount2, _umount2) static char fspath[] = "/sbin/:/usr/pkg/bin/"; /* Must include trailing '/' */ -PRIVATE int rs_down(char *label) +static int rs_down(char *label) { char cmd[200]; if(strlen(_PATH_SERVICE)+strlen(label)+50 >= sizeof(cmd)) @@ -32,7 +32,7 @@ PRIVATE int rs_down(char *label) return system(cmd); } -PUBLIC int mount(special, name, mountflags, type, args) +int mount(special, name, mountflags, type, args) char *name, *special, *type, *args; int mountflags; { @@ -163,13 +163,13 @@ int mountflags; return r; } -PUBLIC int umount(name) +int umount(name) _CONST char *name; { return umount2(name, 0); } -PUBLIC int umount2(name, flags) +int umount2(name, flags) _CONST char *name; int flags; { diff --git a/lib/libc/sys-minix/open.c b/lib/libc/sys-minix/open.c index b62b2adce..cd62a0300 100644 --- a/lib/libc/sys-minix/open.c +++ b/lib/libc/sys-minix/open.c @@ -11,9 +11,9 @@ __weak_alias(open, _open) #endif #if _ANSI -PUBLIC int open(const char *name, int flags, ...) +int open(const char *name, int flags, ...) #else -PUBLIC int open(const char *name, int flags) +int open(const char *name, int flags) #endif { va_list argp; diff --git a/lib/libc/sys-minix/pathconf.c b/lib/libc/sys-minix/pathconf.c index 70a7c1174..49fa723e2 100644 --- a/lib/libc/sys-minix/pathconf.c +++ b/lib/libc/sys-minix/pathconf.c @@ -12,7 +12,7 @@ __weak_alias(pathconf, _pathconf) #endif -PUBLIC long pathconf(path, name) +long pathconf(path, name) _CONST char *path; /* name of file being interrogated */ int name; /* property being inspected */ { diff --git a/lib/libc/sys-minix/sbrk.c b/lib/libc/sys-minix/sbrk.c index ca947f252..a940c4bcc 100644 --- a/lib/libc/sys-minix/sbrk.c +++ b/lib/libc/sys-minix/sbrk.c @@ -10,7 +10,7 @@ __weak_alias(sbrk, _sbrk) extern char *_brksize; -PUBLIC void *sbrk(incr) +void *sbrk(incr) intptr_t incr; { char *newsize, *oldsize; diff --git a/lib/libc/sys-minix/vfork.c b/lib/libc/sys-minix/vfork.c index 9433c8a34..c4e8e4de5 100644 --- a/lib/libc/sys-minix/vfork.c +++ b/lib/libc/sys-minix/vfork.c @@ -8,7 +8,7 @@ __weak_alias(vfork, _vfork) #endif -PUBLIC pid_t vfork() +pid_t vfork() { message m; diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index c8cf63f15..2669ec04a 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -40,16 +40,16 @@ #include #include -PRIVATE int running; +static int running; /* Management data for opened devices. */ -PRIVATE int open_devs[MAX_NR_OPEN_DEVICES]; -PRIVATE int next_open_devs_slot = 0; +static int open_devs[MAX_NR_OPEN_DEVICES]; +static int next_open_devs_slot = 0; /*===========================================================================* * clear_open_devs * *===========================================================================*/ -PRIVATE void clear_open_devs(void) +static void clear_open_devs(void) { /* Reset the set of previously opened minor devices. */ next_open_devs_slot = 0; @@ -58,7 +58,7 @@ PRIVATE void clear_open_devs(void) /*===========================================================================* * is_open_dev * *===========================================================================*/ -PRIVATE int is_open_dev(int device) +static int is_open_dev(int device) { /* Check whether the given minor device has previously been opened. */ int i; @@ -73,7 +73,7 @@ PRIVATE int is_open_dev(int device) /*===========================================================================* * set_open_dev * *===========================================================================*/ -PRIVATE void set_open_dev(int device) +static void set_open_dev(int device) { /* Mark the given minor device as having been opened. */ @@ -87,7 +87,7 @@ PRIVATE void set_open_dev(int device) /*===========================================================================* * chardriver_announce * *===========================================================================*/ -PUBLIC void chardriver_announce(void) +void chardriver_announce(void) { /* Announce we are up after a fresh start or restart. */ int r; @@ -119,7 +119,7 @@ PUBLIC void chardriver_announce(void) /*===========================================================================* * async_reply * *===========================================================================*/ -PRIVATE void async_reply(message *mess, int r) +static void async_reply(message *mess, int r) { /* Send a reply using the asynchronous character device protocol. */ message reply_mess; @@ -185,7 +185,7 @@ PRIVATE void async_reply(message *mess, int r) /*===========================================================================* * sync_reply * *===========================================================================*/ -PRIVATE void sync_reply(message *m_ptr, int ipc_status, int reply) +static void sync_reply(message *m_ptr, int ipc_status, int reply) { /* Reply to a message sent to the driver. */ endpoint_t caller_e, user_e; @@ -211,7 +211,7 @@ PRIVATE void sync_reply(message *m_ptr, int ipc_status, int reply) /*===========================================================================* * send_reply * *===========================================================================*/ -PRIVATE void send_reply(int type, message *m_ptr, int ipc_status, int reply) +static void send_reply(int type, message *m_ptr, int ipc_status, int reply) { /* Prepare and send a reply message. */ @@ -227,7 +227,7 @@ PRIVATE void send_reply(int type, message *m_ptr, int ipc_status, int reply) /*===========================================================================* * do_rdwt * *===========================================================================*/ -PRIVATE int do_rdwt(struct chardriver *cdp, message *mp) +static int do_rdwt(struct chardriver *cdp, message *mp) { /* Carry out a single read or write request. */ iovec_t iovec1; @@ -261,7 +261,7 @@ PRIVATE int do_rdwt(struct chardriver *cdp, message *mp) /*===========================================================================* * do_vrdwt * *===========================================================================*/ -PRIVATE int do_vrdwt(struct chardriver *cdp, message *mp) +static int do_vrdwt(struct chardriver *cdp, message *mp) { /* Carry out an device read or write to/from a vector of user addresses. * The "user addresses" are assumed to be safe, i.e. FS transferring to/from @@ -307,7 +307,7 @@ PRIVATE int do_vrdwt(struct chardriver *cdp, message *mp) /*===========================================================================* * handle_notify * *===========================================================================*/ -PRIVATE void handle_notify(struct chardriver *cdp, message *m_ptr) +static void handle_notify(struct chardriver *cdp, message *m_ptr) { /* Take care of the notifications (interrupt and clock messages) by calling the * appropiate callback functions. Never send a reply. @@ -329,7 +329,7 @@ PRIVATE void handle_notify(struct chardriver *cdp, message *m_ptr) /*===========================================================================* * handle_request * *===========================================================================*/ -PRIVATE int handle_request(struct chardriver *cdp, message *m_ptr) +static int handle_request(struct chardriver *cdp, message *m_ptr) { /* Call the appropiate driver function, based on the type of request. Return * the result code that is to be sent back to the caller, or EDONTREPLY if no @@ -378,7 +378,7 @@ PRIVATE int handle_request(struct chardriver *cdp, message *m_ptr) /*===========================================================================* * chardriver_process * *===========================================================================*/ -PUBLIC void chardriver_process(struct chardriver *cdp, int driver_type, +void chardriver_process(struct chardriver *cdp, int driver_type, message *m_ptr, int ipc_status) { /* Handle the given received message. */ @@ -399,7 +399,7 @@ PUBLIC void chardriver_process(struct chardriver *cdp, int driver_type, /*===========================================================================* * chardriver_task * *===========================================================================*/ -PUBLIC void chardriver_task(struct chardriver *cdp, int driver_type) +void chardriver_task(struct chardriver *cdp, int driver_type) { /* Main program of any device driver task. */ int r, ipc_status; @@ -421,7 +421,7 @@ PUBLIC void chardriver_task(struct chardriver *cdp, int driver_type) /*===========================================================================* * do_nop * *===========================================================================*/ -PUBLIC int do_nop(message *UNUSED(mp)) +int do_nop(message *UNUSED(mp)) { return(OK); } @@ -429,7 +429,7 @@ PUBLIC int do_nop(message *UNUSED(mp)) /*===========================================================================* * nop_ioctl * *===========================================================================*/ -PUBLIC int nop_ioctl(message *UNUSED(mp)) +int nop_ioctl(message *UNUSED(mp)) { return(ENOTTY); } @@ -437,7 +437,7 @@ PUBLIC int nop_ioctl(message *UNUSED(mp)) /*===========================================================================* * nop_alarm * *===========================================================================*/ -PUBLIC void nop_alarm(message *UNUSED(mp)) +void nop_alarm(message *UNUSED(mp)) { /* Ignore the leftover alarm. */ } @@ -445,7 +445,7 @@ PUBLIC void nop_alarm(message *UNUSED(mp)) /*===========================================================================* * nop_cleanup * *===========================================================================*/ -PUBLIC void nop_cleanup(void) +void nop_cleanup(void) { /* Nothing to clean up. */ } @@ -453,7 +453,7 @@ PUBLIC void nop_cleanup(void) /*===========================================================================* * nop_cancel * *===========================================================================*/ -PUBLIC int nop_cancel(message *UNUSED(m)) +int nop_cancel(message *UNUSED(m)) { /* Nothing to do for cancel. */ return(OK); @@ -462,7 +462,7 @@ PUBLIC int nop_cancel(message *UNUSED(m)) /*===========================================================================* * nop_select * *===========================================================================*/ -PUBLIC int nop_select(message *UNUSED(m)) +int nop_select(message *UNUSED(m)) { /* Nothing to do for select. */ return(OK); diff --git a/lib/libcompat_minix/mtab.c b/lib/libcompat_minix/mtab.c index e777b93c3..c40a597bd 100644 --- a/lib/libcompat_minix/mtab.c +++ b/lib/libcompat_minix/mtab.c @@ -56,7 +56,7 @@ int get_mtab_entry(char *special, char *mounted_on, char *version, char *rw_flag); int put_mtab_entry(char *special, char *mounted_on, char *version, char *rw_flag); -PRIVATE void err(char *prog_name, char *str ); +static void err(char *prog_name, char *str ); int load_mtab(prog_name) @@ -195,7 +195,7 @@ char *rw_flag; } -PRIVATE void +static void err(prog_name, str) char *prog_name, *str; { diff --git a/lib/libddekit/src/condvar.c b/lib/libddekit/src/condvar.c index e2d43fb01..ffea35717 100644 --- a/lib/libddekit/src/condvar.c +++ b/lib/libddekit/src/condvar.c @@ -20,7 +20,7 @@ struct ddekit_condvar { /*****************************************************************************/ /* ddekit_condvar_init */ /*****************************************************************************/ -PUBLIC ddekit_condvar_t * ddekit_condvar_init(void) { +ddekit_condvar_t * ddekit_condvar_init(void) { ddekit_condvar_t *cv; cv = (ddekit_condvar_t *) ddekit_simple_malloc(sizeof(ddekit_condvar_t)); DDEBUG_MSG_VERBOSE("cv: %p", cv); @@ -30,7 +30,7 @@ PUBLIC ddekit_condvar_t * ddekit_condvar_init(void) { /*****************************************************************************/ /* ddekit_condvar_deinit */ /*****************************************************************************/ -PUBLIC void ddekit_condvar_deinit(ddekit_condvar_t *cvp) { +void ddekit_condvar_deinit(ddekit_condvar_t *cvp) { DDEBUG_MSG_VERBOSE("cv: %p", cvp); ddekit_simple_free(cvp); } @@ -38,7 +38,7 @@ PUBLIC void ddekit_condvar_deinit(ddekit_condvar_t *cvp) { /*****************************************************************************/ /* ddekit_condvar_wait */ /*****************************************************************************/ -PUBLIC void ddekit_condvar_wait(ddekit_condvar_t *cv, ddekit_lock_t *mp) { +void ddekit_condvar_wait(ddekit_condvar_t *cv, ddekit_lock_t *mp) { DDEBUG_MSG_VERBOSE("wait cv: %p, thread id: %d, name: %s", cv, ddekit_thread_myself()->id, ddekit_thread_myself()->name); @@ -65,7 +65,7 @@ PUBLIC void ddekit_condvar_wait(ddekit_condvar_t *cv, ddekit_lock_t *mp) { /*****************************************************************************/ /* ddekit_condvar_wait_timed */ /*****************************************************************************/ -PUBLIC int ddekit_condvar_wait_timed +int ddekit_condvar_wait_timed (ddekit_condvar_t *cvp, ddekit_lock_t *mp, int timo) { /* @@ -79,7 +79,7 @@ PUBLIC int ddekit_condvar_wait_timed /*****************************************************************************/ /* ddekit_condvar_signal */ /*****************************************************************************/ -PUBLIC void ddekit_condvar_signal(ddekit_condvar_t *cv) +void ddekit_condvar_signal(ddekit_condvar_t *cv) { DDEBUG_MSG_VERBOSE("cv: %p", cv); diff --git a/lib/libddekit/src/dde.c b/lib/libddekit/src/dde.c index 4409270f6..500cb1e07 100644 --- a/lib/libddekit/src/dde.c +++ b/lib/libddekit/src/dde.c @@ -22,13 +22,13 @@ void ddekit_pgtab_init(void); static ddekit_thread_t *dispatch_th = 0; -FORWARD void dispatcher_thread(void * unused); -FORWARD void ddekit_dispatcher_thread_init(void); +static void dispatcher_thread(void * unused); +static void ddekit_dispatcher_thread_init(void); /****************************************************************************/ /* dispatcher_thread */ /****************************************************************************/ -PRIVATE void dispatcher_thread(void *unused) { +static void dispatcher_thread(void *unused) { /* * Gets all messages and dispatches them. @@ -92,7 +92,7 @@ PRIVATE void dispatcher_thread(void *unused) { /****************************************************************************/ /* ddekit_dispatcher_thread_init */ /****************************************************************************/ -PRIVATE void ddekit_dispatcher_thread_init() +static void ddekit_dispatcher_thread_init() { dispatch_th = ddekit_thread_create(dispatcher_thread, NULL, "dispatch"); @@ -103,7 +103,7 @@ PRIVATE void ddekit_dispatcher_thread_init() /****************************************************************************/ /* ddekit_init */ /****************************************************************************/ -PUBLIC void ddekit_init(void) +void ddekit_init(void) { sef_startup(); diff --git a/lib/libddekit/src/initcall.c b/lib/libddekit/src/initcall.c index 4963b0b47..07d2088cb 100644 --- a/lib/libddekit/src/initcall.c +++ b/lib/libddekit/src/initcall.c @@ -15,7 +15,7 @@ static struct __ddekit_initcall_s head = {0,0,0}; /****************************************************************************/ /* __ddekit_add_initcall */ /****************************************************************************/ -PUBLIC void __attribute__((used)) +void __attribute__((used)) __ddekit_add_initcall(struct __ddekit_initcall_s * ic) { /* This function is required for the DDEKIT_INITCALL makro */ @@ -42,7 +42,7 @@ __ddekit_add_initcall(struct __ddekit_initcall_s * ic) { /****************************************************************************/ /* ddekit_do_initcalls */ /****************************************************************************/ -PUBLIC void ddekit_do_initcalls() +void ddekit_do_initcalls() { struct __ddekit_initcall_s *i = 0; diff --git a/lib/libddekit/src/irq.c b/lib/libddekit/src/irq.c index d92ed7208..ed30d7163 100644 --- a/lib/libddekit/src/irq.c +++ b/lib/libddekit/src/irq.c @@ -32,16 +32,16 @@ static ddekit_lock_t lock; *****************************************************************************/ -FORWARD void ddekit_irq_lock(void); -FORWARD void ddekit_irq_unlock(void); -FORWARD struct ddekit_irq_s* find_by_irq(int irq); -FORWARD void ddekit_irq_remove(struct ddekit_irq_s *irq_s); -FORWARD void ddekit_irq_thread(void *data); +static void ddekit_irq_lock(void); +static void ddekit_irq_unlock(void); +static struct ddekit_irq_s* find_by_irq(int irq); +static void ddekit_irq_remove(struct ddekit_irq_s *irq_s); +static void ddekit_irq_thread(void *data); /****************************************************************************** * ddekit_irq_lock * *****************************************************************************/ -PRIVATE void ddekit_irq_lock(void) +static void ddekit_irq_lock(void) { ddekit_lock_lock(&lock); } @@ -49,7 +49,7 @@ PRIVATE void ddekit_irq_lock(void) /****************************************************************************** * ddekit_irq_unlock * *****************************************************************************/ -PRIVATE void ddekit_irq_unlock(void) +static void ddekit_irq_unlock(void) { ddekit_lock_unlock(&lock); } @@ -57,7 +57,7 @@ PRIVATE void ddekit_irq_unlock(void) /****************************************************************************** * find_by_irq * *****************************************************************************/ -PRIVATE struct ddekit_irq_s * find_by_irq(int irq) +static struct ddekit_irq_s * find_by_irq(int irq) { struct ddekit_irq_s * irq_s; ddekit_irq_lock(); @@ -80,7 +80,7 @@ PRIVATE struct ddekit_irq_s * find_by_irq(int irq) /****************************************************************************** * ddekit_irq_remove * *****************************************************************************/ -PRIVATE void ddekit_irq_remove(struct ddekit_irq_s *irq_s) +static void ddekit_irq_remove(struct ddekit_irq_s *irq_s) { struct ddekit_irq_s *i; @@ -114,7 +114,7 @@ PRIVATE void ddekit_irq_remove(struct ddekit_irq_s *irq_s) /****************************************************************************** * ddekit_irq_thread * *****************************************************************************/ -PRIVATE void ddekit_irq_thread(void *data) +static void ddekit_irq_thread(void *data) { /* For each IRQ line an own thread is started */ @@ -239,7 +239,7 @@ void ddekit_init_irqs() /****************************************************************************** * _ddekit_interrupt_trigger * *****************************************************************************/ -PUBLIC void _ddekit_interrupt_trigger(int irq) +void _ddekit_interrupt_trigger(int irq) { struct ddekit_irq_s *irq_s; diff --git a/lib/libddekit/src/lock.c b/lib/libddekit/src/lock.c index fecb64989..5fe83d435 100644 --- a/lib/libddekit/src/lock.c +++ b/lib/libddekit/src/lock.c @@ -21,7 +21,7 @@ struct ddekit_lock { /****************************************************************************** * ddekit_lock_init_locked * *****************************************************************************/ -PUBLIC void ddekit_lock_init_locked(ddekit_lock_t *mtx) +void ddekit_lock_init_locked(ddekit_lock_t *mtx) { (*mtx) = (struct ddekit_lock *) ddekit_simple_malloc(sizeof(struct ddekit_lock)); @@ -33,7 +33,7 @@ PUBLIC void ddekit_lock_init_locked(ddekit_lock_t *mtx) /****************************************************************************** * ddekit_lock_init_unlocked * *****************************************************************************/ -PUBLIC void ddekit_lock_init_unlocked(ddekit_lock_t *mtx) +void ddekit_lock_init_unlocked(ddekit_lock_t *mtx) { (*mtx) = (struct ddekit_lock *) ddekit_simple_malloc(sizeof(struct ddekit_lock)); @@ -44,7 +44,7 @@ PUBLIC void ddekit_lock_init_unlocked(ddekit_lock_t *mtx) /****************************************************************************** * ddekit_lock_deinit * *****************************************************************************/ -PUBLIC void ddekit_lock_deinit (ddekit_lock_t *mtx) +void ddekit_lock_deinit (ddekit_lock_t *mtx) { ddekit_simple_free(*mtx); } @@ -52,7 +52,7 @@ PUBLIC void ddekit_lock_deinit (ddekit_lock_t *mtx) /****************************************************************************** * ddekit_lock_lock * *****************************************************************************/ -PUBLIC void ddekit_lock_lock (ddekit_lock_t *mtx) +void ddekit_lock_lock (ddekit_lock_t *mtx) { if ((*mtx)->owner == NULL) { (*mtx)->owner = ddekit_thread_myself(); @@ -84,7 +84,7 @@ PUBLIC void ddekit_lock_lock (ddekit_lock_t *mtx) /****************************************************************************** * ddekit_lock_try_lock * *****************************************************************************/ -PUBLIC int ddekit_lock_try_lock(ddekit_lock_t *mtx) +int ddekit_lock_try_lock(ddekit_lock_t *mtx) { if ((*mtx)->owner == NULL) { (*mtx)->owner = ddekit_thread_myself(); @@ -97,7 +97,7 @@ PUBLIC int ddekit_lock_try_lock(ddekit_lock_t *mtx) /****************************************************************************** * ddekit_lock_unlock * *****************************************************************************/ -PUBLIC void ddekit_lock_unlock (ddekit_lock_t *mtx) { +void ddekit_lock_unlock (ddekit_lock_t *mtx) { ddekit_assert((*mtx)->owner != NULL); (*mtx)->owner = NULL; if((*mtx)->wait_queue) { @@ -112,7 +112,7 @@ PUBLIC void ddekit_lock_unlock (ddekit_lock_t *mtx) { /****************************************************************************** * ddekit_lock_owner * *****************************************************************************/ -PUBLIC int ddekit_lock_owner(ddekit_lock_t *mtx) { +int ddekit_lock_owner(ddekit_lock_t *mtx) { return ddekit_thread_get_id((*mtx)->owner); } diff --git a/lib/libddekit/src/mem.c b/lib/libddekit/src/mem.c index b649aca2c..769c3a133 100644 --- a/lib/libddekit/src/mem.c +++ b/lib/libddekit/src/mem.c @@ -38,22 +38,22 @@ struct ddekit_slab { struct ddekit_slab_slab empty; }; -FORWARD void ddekit_slab_lock(struct ddekit_slab * sc); -FORWARD void ddekit_slab_unlock(struct ddekit_slab * sc); -FORWARD struct ddekit_slab_slab * ddekit_slab_find_slab(struct +static void ddekit_slab_lock(struct ddekit_slab * sc); +static void ddekit_slab_unlock(struct ddekit_slab * sc); +static struct ddekit_slab_slab * ddekit_slab_find_slab(struct ddekit_slab * sc, void * obj); -FORWARD void ddekit_slab_slab_insert(struct ddekit_slab_slab *list, +static void ddekit_slab_slab_insert(struct ddekit_slab_slab *list, struct ddekit_slab_slab *s); -FORWARD void ddekit_slab_slab_remove(struct ddekit_slab_slab *s); -FORWARD void ddekit_slab_grow(struct ddekit_slab * sc); -FORWARD void *ddekit_slab_getobj(struct ddekit_slab_slab *s); -FORWARD void ddekit_slab_free_slab(struct ddekit_slab_slab * sl, int +static void ddekit_slab_slab_remove(struct ddekit_slab_slab *s); +static void ddekit_slab_grow(struct ddekit_slab * sc); +static void *ddekit_slab_getobj(struct ddekit_slab_slab *s); +static void ddekit_slab_free_slab(struct ddekit_slab_slab * sl, int cont); /****************************************************************************** * ddekit_simple_malloc * *****************************************************************************/ -PUBLIC void *ddekit_simple_malloc(unsigned size) +void *ddekit_simple_malloc(unsigned size) { /* Simple memory allocation... malloc and free should be ok... */ void * r = malloc(size); @@ -67,7 +67,7 @@ PUBLIC void *ddekit_simple_malloc(unsigned size) /****************************************************************************** * ddekit_simple_free * *****************************************************************************/ -PUBLIC void ddekit_simple_free(void *p) +void ddekit_simple_free(void *p) { DDEBUG_MSG_VERBOSE("%p", p); free(p); @@ -76,7 +76,7 @@ PUBLIC void ddekit_simple_free(void *p) /****************************************************************************** * ddekit_large_malloc * *****************************************************************************/ -PUBLIC void *ddekit_large_malloc(int size) +void *ddekit_large_malloc(int size) { ddekit_addr_t phys; /* allocate a piece of coniguous memory */ @@ -93,7 +93,7 @@ PUBLIC void *ddekit_large_malloc(int size) /****************************************************************************** * ddekit_large_free * *****************************************************************************/ -PUBLIC void ddekit_large_free(void *p) +void ddekit_large_free(void *p) { unsigned len; DDEBUG_MSG_VERBOSE("get size of region %x", p); @@ -109,7 +109,7 @@ PUBLIC void ddekit_large_free(void *p) /****************************************************************************** * ddekit_contig_malloc * *****************************************************************************/ -PUBLIC void *ddekit_contig_malloc(unsigned long size, unsigned long low, +void *ddekit_contig_malloc(unsigned long size, unsigned long low, unsigned long high, unsigned long aligment, unsigned long boundary) { @@ -120,21 +120,21 @@ PUBLIC void *ddekit_contig_malloc(unsigned long size, unsigned long low, /****************************************************************************** * ddekit_slab_lock * *****************************************************************************/ -PRIVATE DDEKIT_INLINE void ddekit_slab_lock(struct ddekit_slab * sc) { +static DDEKIT_INLINE void ddekit_slab_lock(struct ddekit_slab * sc) { ddekit_lock_lock(&sc->lock); } /****************************************************************************** * ddekit_slab_unlock * *****************************************************************************/ -PRIVATE DDEKIT_INLINE void ddekit_slab_unlock(struct ddekit_slab * sc) { +static DDEKIT_INLINE void ddekit_slab_unlock(struct ddekit_slab * sc) { ddekit_lock_unlock(&sc->lock); } /****************************************************************************** * ddekit_slab_find_slab * *****************************************************************************/ -PRIVATE struct ddekit_slab_slab * +static struct ddekit_slab_slab * ddekit_slab_find_slab(struct ddekit_slab * sc, void * obj) { @@ -174,7 +174,7 @@ static void ddekit_slab_slab_insert(struct ddekit_slab_slab *list, /****************************************************************************** * ddekit_slab_slab_remove * *****************************************************************************/ -PRIVATE void ddekit_slab_slab_remove(struct ddekit_slab_slab *s) +static void ddekit_slab_slab_remove(struct ddekit_slab_slab *s) { s->next->prev = s->prev; s->prev->next = s->next; @@ -185,7 +185,7 @@ PRIVATE void ddekit_slab_slab_remove(struct ddekit_slab_slab *s) /****************************************************************************** * ddekit_slab_grow * *****************************************************************************/ -PRIVATE void ddekit_slab_grow(struct ddekit_slab *sc) +static void ddekit_slab_grow(struct ddekit_slab *sc) { /* * NOTE: @@ -249,7 +249,7 @@ PRIVATE void ddekit_slab_grow(struct ddekit_slab *sc) /****************************************************************************** * ddekit_slab_getobj * *****************************************************************************/ -PRIVATE void *ddekit_slab_getobj(struct ddekit_slab_slab *s) +static void *ddekit_slab_getobj(struct ddekit_slab_slab *s) { struct ddekit_slab *sc; void *ret = 0; @@ -284,7 +284,7 @@ PRIVATE void *ddekit_slab_getobj(struct ddekit_slab_slab *s) /****************************************************************************** * ddekit_slab_alloc * *****************************************************************************/ -PUBLIC void *ddekit_slab_alloc(struct ddekit_slab * sc) +void *ddekit_slab_alloc(struct ddekit_slab * sc) { struct ddekit_slab_slab *s=0; @@ -318,7 +318,7 @@ PUBLIC void *ddekit_slab_alloc(struct ddekit_slab * sc) /****************************************************************************** * ddekit_slab_free * *****************************************************************************/ -PUBLIC void ddekit_slab_free(struct ddekit_slab *sc, void* obj) +void ddekit_slab_free(struct ddekit_slab *sc, void* obj) { void **p; @@ -354,7 +354,7 @@ PUBLIC void ddekit_slab_free(struct ddekit_slab *sc, void* obj) /****************************************************************************** * ddekit_slab_set_data * *****************************************************************************/ -PUBLIC void ddekit_slab_set_data(struct ddekit_slab * sc, void *data) +void ddekit_slab_set_data(struct ddekit_slab * sc, void *data) { ddekit_slab_lock(sc); sc->data = data; @@ -364,7 +364,7 @@ PUBLIC void ddekit_slab_set_data(struct ddekit_slab * sc, void *data) /****************************************************************************** * ddekit_slab_get_data * *****************************************************************************/ -PUBLIC void *ddekit_slab_get_data (struct ddekit_slab *sc) +void *ddekit_slab_get_data (struct ddekit_slab *sc) { void *ret; ddekit_slab_lock(sc); @@ -377,7 +377,7 @@ PUBLIC void *ddekit_slab_get_data (struct ddekit_slab *sc) /****************************************************************************** * ddekit_slab_init * *****************************************************************************/ -PUBLIC struct ddekit_slab * ddekit_slab_init(unsigned size, int contiguous) +struct ddekit_slab * ddekit_slab_init(unsigned size, int contiguous) { struct ddekit_slab * sc = 0; @@ -412,7 +412,7 @@ PUBLIC struct ddekit_slab * ddekit_slab_init(unsigned size, int contiguous) /****************************************************************************** * ddekit_slab_free_slab * *****************************************************************************/ -PRIVATE void ddekit_slab_free_slab(struct ddekit_slab_slab * sl, int cont) +static void ddekit_slab_free_slab(struct ddekit_slab_slab * sl, int cont) { struct ddekit_slab_slab *s,*t; @@ -442,7 +442,7 @@ PRIVATE void ddekit_slab_free_slab(struct ddekit_slab_slab * sl, int cont) /****************************************************************************** * ddekit_slab_destroy * *****************************************************************************/ -PUBLIC void ddekit_slab_destroy(struct ddekit_slab *sc) +void ddekit_slab_destroy(struct ddekit_slab *sc) { DDEBUG_MSG_VERBOSE("%p full", sc); ddekit_slab_free_slab(&sc->full,sc->contiguous); diff --git a/lib/libddekit/src/msg_queue.c b/lib/libddekit/src/msg_queue.c index 669bf660a..57e1dbcfd 100644 --- a/lib/libddekit/src/msg_queue.c +++ b/lib/libddekit/src/msg_queue.c @@ -25,14 +25,14 @@ struct ddekit_minix_msg_q { struct ddekit_minix_msg_q *next; }; -PRIVATE struct ddekit_minix_msg_q * _list = NULL; -FORWARD void _ddekit_minix_queue_msg(struct ddekit_minix_msg_q *mq, +static struct ddekit_minix_msg_q * _list = NULL; +static void _ddekit_minix_queue_msg(struct ddekit_minix_msg_q *mq, message *m); /***************************************************************************** * ddekit_minix_create_msg_q * ****************************************************************************/ -PUBLIC struct ddekit_minix_msg_q * +struct ddekit_minix_msg_q * ddekit_minix_create_msg_q(unsigned from, unsigned to) { struct ddekit_minix_msg_q *mq = (struct ddekit_minix_msg_q *) @@ -58,7 +58,7 @@ ddekit_minix_create_msg_q(unsigned from, unsigned to) /***************************************************************************** * ddekit_minix_deregister_msg_q * ****************************************************************************/ -PUBLIC void ddekit_minix_deregister_msg_q(struct ddekit_minix_msg_q *mq) +void ddekit_minix_deregister_msg_q(struct ddekit_minix_msg_q *mq) { struct ddekit_minix_msg_q *prev =_list, *it; @@ -81,7 +81,7 @@ PUBLIC void ddekit_minix_deregister_msg_q(struct ddekit_minix_msg_q *mq) /***************************************************************************** * _ddekit_minix_queue_msg * ****************************************************************************/ -PRIVATE void +static void _ddekit_minix_queue_msg(struct ddekit_minix_msg_q *mq, message *m) { int full; @@ -137,7 +137,7 @@ void ddekit_minix_queue_msg(message *m) /***************************************************************************** * ddekit_minix_rcv * ****************************************************************************/ -PUBLIC void ddekit_minix_rcv(struct ddekit_minix_msg_q *mq, message *m) +void ddekit_minix_rcv(struct ddekit_minix_msg_q *mq, message *m) { DDEBUG_MSG_VERBOSE("waiting for message"); diff --git a/lib/libddekit/src/panic.c b/lib/libddekit/src/panic.c index bf20415c2..ad63e3ab5 100644 --- a/lib/libddekit/src/panic.c +++ b/lib/libddekit/src/panic.c @@ -5,7 +5,7 @@ /****************************************************************************/ /* ddekit_panic */ /****************************************************************************/ -PUBLIC void ddekit_panic(char *fmt, ...) +void ddekit_panic(char *fmt, ...) { int r; @@ -24,7 +24,7 @@ PUBLIC void ddekit_panic(char *fmt, ...) /****************************************************************************/ /* ddekit_debug */ /****************************************************************************/ -PUBLIC void ddekit_debug(char *fmt, ...) +void ddekit_debug(char *fmt, ...) { int r; va_list va; diff --git a/lib/libddekit/src/pci.c b/lib/libddekit/src/pci.c index 57cb75ff1..62ac39bb2 100644 --- a/lib/libddekit/src/pci.c +++ b/lib/libddekit/src/pci.c @@ -34,13 +34,13 @@ struct ddekit_pci_dev { struct ddekit_pci_dev pci_devs[PCI_MAX_DEVS]; -FORWARD struct ddekit_pci_dev * ddekit_get_dev_helper(int bus, int slot, +static struct ddekit_pci_dev * ddekit_get_dev_helper(int bus, int slot, int func); /****************************************************************************/ /* ddekit_pci_init_only_one */ /****************************************************************************/ -PUBLIC void ddekit_pci_init_only_one(int skip) +void ddekit_pci_init_only_one(int skip) { /* * If skip is not PCI_TAKE_ALL this function will skip skip PCI DEVICES @@ -108,7 +108,7 @@ PUBLIC void ddekit_pci_init_only_one(int skip) /****************************************************************************/ /* ddekit_pci_get_device_id */ /****************************************************************************/ -PUBLIC void ddekit_pci_init(void) +void ddekit_pci_init(void) { ddekit_pci_init_only_one(DDEKIT_PCI_ANY_ID); } @@ -133,7 +133,7 @@ int ddekit_pci_get_device(int nr, int *bus, int *slot, int *func) /****************************************************************************/ /* ddekit_pci_get_device_id */ /****************************************************************************/ -PRIVATE struct ddekit_pci_dev * +static struct ddekit_pci_dev * ddekit_get_dev_helper(int bus, int slot, int func) { /* @@ -153,7 +153,7 @@ ddekit_get_dev_helper(int bus, int slot, int func) /****************************************************************************/ /* ddekit_pci_read */ /****************************************************************************/ -PUBLIC int ddekit_pci_read +int ddekit_pci_read (int bus, int slot, int func, int pos, int len, ddekit_uint32_t *val) { switch(len) { @@ -172,7 +172,7 @@ PUBLIC int ddekit_pci_read /****************************************************************************/ /* ddekit_pci_write */ /****************************************************************************/ -PUBLIC int ddekit_pci_write +int ddekit_pci_write (int bus, int slot, int func, int pos, int len, ddekit_uint32_t val) { switch(len) { @@ -191,7 +191,7 @@ PUBLIC int ddekit_pci_write /****************************************************************************/ /* ddekit_pci_readb */ /****************************************************************************/ -PUBLIC int ddekit_pci_readb (int bus, int slot, int func, int pos, ddekit_uint8_t *val) { +int ddekit_pci_readb (int bus, int slot, int func, int pos, ddekit_uint8_t *val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (func!=0) { *val=0; @@ -209,7 +209,7 @@ PUBLIC int ddekit_pci_readb (int bus, int slot, int func, int pos, ddekit_uint8_ /****************************************************************************/ /* ddekit_pci_readw */ /****************************************************************************/ -PUBLIC int ddekit_pci_readw +int ddekit_pci_readw (int bus, int slot, int func, int pos, ddekit_uint16_t *val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (func!=0) { @@ -228,7 +228,7 @@ PUBLIC int ddekit_pci_readw /****************************************************************************/ /* ddekit_pci_readl */ /****************************************************************************/ -PUBLIC int ddekit_pci_readl +int ddekit_pci_readl (int bus, int slot, int func, int pos, ddekit_uint32_t *val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (func!=0) { @@ -247,7 +247,7 @@ PUBLIC int ddekit_pci_readl /****************************************************************************/ /* ddekit_pci_writeb */ /****************************************************************************/ -PUBLIC int ddekit_pci_writeb +int ddekit_pci_writeb (int bus, int slot, int func, int pos, ddekit_uint8_t val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (dev) { @@ -262,7 +262,7 @@ PUBLIC int ddekit_pci_writeb /****************************************************************************/ /* ddekit_pci_writel */ /****************************************************************************/ -PUBLIC int ddekit_pci_writew +int ddekit_pci_writew (int bus, int slot, int func, int pos, ddekit_uint16_t val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (dev) { @@ -277,7 +277,7 @@ PUBLIC int ddekit_pci_writew /****************************************************************************/ /* ddekit_pci_writel */ /****************************************************************************/ -PUBLIC int ddekit_pci_writel +int ddekit_pci_writel (int bus, int slot, int func, int pos, ddekit_uint32_t val) { struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func); if (dev) { @@ -291,7 +291,7 @@ PUBLIC int ddekit_pci_writel /****************************************************************************/ /* ddekit_pci_find_device */ /****************************************************************************/ -PUBLIC struct ddekit_pci_dev *ddekit_pci_find_device +struct ddekit_pci_dev *ddekit_pci_find_device (int *bus, int *slot, int *func, struct ddekit_pci_dev *start) { int i,search=0; @@ -323,7 +323,7 @@ PUBLIC struct ddekit_pci_dev *ddekit_pci_find_device /****************************************************************************/ /* ddekit_pci_get_vendor */ /****************************************************************************/ -PUBLIC unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev) +unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev) { return dev->vid; } @@ -331,7 +331,7 @@ PUBLIC unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_device_id */ /****************************************************************************/ -PUBLIC unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev) +unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev) { return dev->did; } @@ -344,7 +344,7 @@ PUBLIC unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_enable_device */ /****************************************************************************/ -PUBLIC int ddekit_pci_enable_device(struct ddekit_pci_dev *dev) +int ddekit_pci_enable_device(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -353,7 +353,7 @@ PUBLIC int ddekit_pci_enable_device(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_disable_device */ /****************************************************************************/ -PUBLIC int ddekit_pci_disable_device(struct ddekit_pci_dev *dev) +int ddekit_pci_disable_device(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -362,7 +362,7 @@ PUBLIC int ddekit_pci_disable_device(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_set_master */ /****************************************************************************/ -PUBLIC void ddekit_pci_set_master(struct ddekit_pci_dev *dev) +void ddekit_pci_set_master(struct ddekit_pci_dev *dev) { WARN_UNIMPL; } @@ -371,7 +371,7 @@ PUBLIC void ddekit_pci_set_master(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_sub_vendor */ /****************************************************************************/ -PUBLIC unsigned short ddekit_pci_get_sub_vendor(struct ddekit_pci_dev *dev) +unsigned short ddekit_pci_get_sub_vendor(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -380,7 +380,7 @@ PUBLIC unsigned short ddekit_pci_get_sub_vendor(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_sub_device */ /****************************************************************************/ -PUBLIC unsigned short ddekit_pci_get_sub_device(struct ddekit_pci_dev *dev) +unsigned short ddekit_pci_get_sub_device(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -389,7 +389,7 @@ PUBLIC unsigned short ddekit_pci_get_sub_device(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_dev_class */ /****************************************************************************/ -PUBLIC unsigned ddekit_pci_get_dev_class(struct ddekit_pci_dev *dev) +unsigned ddekit_pci_get_dev_class(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -398,7 +398,7 @@ PUBLIC unsigned ddekit_pci_get_dev_class(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_irq */ /****************************************************************************/ -PUBLIC unsigned long +unsigned long ddekit_pci_get_irq(struct ddekit_pci_dev *dev) { WARN_UNIMPL; @@ -408,7 +408,7 @@ ddekit_pci_get_irq(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_name */ /****************************************************************************/ -PUBLIC char *ddekit_pci_get_name(struct ddekit_pci_dev *dev) +char *ddekit_pci_get_name(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -417,7 +417,7 @@ PUBLIC char *ddekit_pci_get_name(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_slot_name */ /****************************************************************************/ -PUBLIC char *ddekit_pci_get_slot_name(struct ddekit_pci_dev *dev) +char *ddekit_pci_get_slot_name(struct ddekit_pci_dev *dev) { WARN_UNIMPL; return 0; @@ -426,7 +426,7 @@ PUBLIC char *ddekit_pci_get_slot_name(struct ddekit_pci_dev *dev) /****************************************************************************/ /* ddekit_pci_get_resource */ /****************************************************************************/ -PUBLIC ddekit_pci_res_t * +ddekit_pci_res_t * ddekit_pci_get_resource(struct ddekit_pci_dev *dev, unsigned int idx) { WARN_UNIMPL; @@ -436,7 +436,7 @@ ddekit_pci_get_resource(struct ddekit_pci_dev *dev, unsigned int idx) /****************************************************************************/ /* ddekit_pci_irq_enable */ /****************************************************************************/ -PUBLIC int ddekit_pci_irq_enable +int ddekit_pci_irq_enable (int bus, int slot, int func, int pin, int *irq) { /* call not needed */ diff --git a/lib/libddekit/src/pgtab.c b/lib/libddekit/src/pgtab.c index 81479fe5b..3206bde35 100644 --- a/lib/libddekit/src/pgtab.c +++ b/lib/libddekit/src/pgtab.c @@ -23,14 +23,14 @@ #include "debug.h" -FORWARD void lock_pgtab(void); -FORWARD void unlock_pgtab(void); -FORWARD struct dde_pgtab_region * allocate_region(void); -FORWARD void free_region(struct dde_pgtab_region *r); -FORWARD void add_region(struct dde_pgtab_region *r); -FORWARD void rm_region(struct dde_pgtab_region *r); -FORWARD struct dde_pgtab_region * find_region_virt(ddekit_addr_t va); -FORWARD struct dde_pgtab_region * find_region_phys(ddekit_addr_t pa); +static void lock_pgtab(void); +static void unlock_pgtab(void); +static struct dde_pgtab_region * allocate_region(void); +static void free_region(struct dde_pgtab_region *r); +static void add_region(struct dde_pgtab_region *r); +static void rm_region(struct dde_pgtab_region *r); +static struct dde_pgtab_region * find_region_virt(ddekit_addr_t va); +static struct dde_pgtab_region * find_region_phys(ddekit_addr_t pa); struct dde_pgtab_region { ddekit_addr_t vm_start; @@ -41,8 +41,8 @@ struct dde_pgtab_region { struct dde_pgtab_region *prev; }; -PRIVATE struct dde_pgtab_region head = {0,0,0,0,&head,&head}; -PRIVATE ddekit_lock_t lock; +static struct dde_pgtab_region head = {0,0,0,0,&head,&head}; +static ddekit_lock_t lock; /* * INTERNAL HELPERS @@ -51,7 +51,7 @@ PRIVATE ddekit_lock_t lock; /****************************************************************************/ /* lock_pgtab */ /****************************************************************************/ -PRIVATE void lock_pgtab() +static void lock_pgtab() { ddekit_lock_lock(&lock); } @@ -60,7 +60,7 @@ PRIVATE void lock_pgtab() /****************************************************************************/ /* unlock_pgtab */ /****************************************************************************/ -PRIVATE void unlock_pgtab() +static void unlock_pgtab() { ddekit_lock_unlock(&lock); } @@ -68,7 +68,7 @@ PRIVATE void unlock_pgtab() /****************************************************************************/ /* dde_pgtab_region */ /****************************************************************************/ -PRIVATE struct dde_pgtab_region * allocate_region() +static struct dde_pgtab_region * allocate_region() { struct dde_pgtab_region * res; @@ -84,7 +84,7 @@ PRIVATE struct dde_pgtab_region * allocate_region() /****************************************************************************/ /* free_region */ /****************************************************************************/ -PRIVATE void free_region(struct dde_pgtab_region *r) +static void free_region(struct dde_pgtab_region *r) { ddekit_simple_free(r); } @@ -92,7 +92,7 @@ PRIVATE void free_region(struct dde_pgtab_region *r) /****************************************************************************/ /* add_region */ /****************************************************************************/ -PRIVATE void add_region (struct dde_pgtab_region *r) +static void add_region (struct dde_pgtab_region *r) { r->next = head.next; head.next = r; @@ -108,7 +108,7 @@ PRIVATE void add_region (struct dde_pgtab_region *r) /****************************************************************************/ /* rm_region */ /****************************************************************************/ -PRIVATE void rm_region(struct dde_pgtab_region *r) +static void rm_region(struct dde_pgtab_region *r) { if (r->next) { r->next->prev = r->prev; @@ -124,7 +124,7 @@ PRIVATE void rm_region(struct dde_pgtab_region *r) /****************************************************************************/ /* find_region_virt */ /****************************************************************************/ -PRIVATE struct dde_pgtab_region * find_region_virt(ddekit_addr_t va) +static struct dde_pgtab_region * find_region_virt(ddekit_addr_t va) { struct dde_pgtab_region * r; @@ -146,7 +146,7 @@ PRIVATE struct dde_pgtab_region * find_region_virt(ddekit_addr_t va) /****************************************************************************/ /* find_region_phys */ /****************************************************************************/ -PRIVATE struct dde_pgtab_region * find_region_phys(ddekit_addr_t pa) +static struct dde_pgtab_region * find_region_phys(ddekit_addr_t pa) { struct dde_pgtab_region * r; @@ -166,7 +166,7 @@ PRIVATE struct dde_pgtab_region * find_region_phys(ddekit_addr_t pa) /****************************************************************************/ /* ddekit_pgtab_do_fo_each_region */ /****************************************************************************/ -PUBLIC void ddekit_pgtab_do_fo_each_region(void (*func) (unsigned, unsigned)) { +void ddekit_pgtab_do_fo_each_region(void (*func) (unsigned, unsigned)) { struct dde_pgtab_region * r; for( r = head.next; r != &head ; r = r->next ) { @@ -182,7 +182,7 @@ PUBLIC void ddekit_pgtab_do_fo_each_region(void (*func) (unsigned, unsigned)) { /****************************************************************************/ /* ddekit_pgtab_set_region */ /****************************************************************************/ -PUBLIC void ddekit_pgtab_set_region(void *virt, ddekit_addr_t phys, int pages, int type) +void ddekit_pgtab_set_region(void *virt, ddekit_addr_t phys, int pages, int type) { ddekit_pgtab_set_region_with_size(virt, phys, (4096)*pages, type); } @@ -190,7 +190,7 @@ PUBLIC void ddekit_pgtab_set_region(void *virt, ddekit_addr_t phys, int pages, i /****************************************************************************/ /* ddekit_pgtab_set_region_with_size */ /****************************************************************************/ -PUBLIC void ddekit_pgtab_set_region_with_size(void *virt, ddekit_addr_t phys, int size, int type) +void ddekit_pgtab_set_region_with_size(void *virt, ddekit_addr_t phys, int size, int type) { struct dde_pgtab_region * r; @@ -212,7 +212,7 @@ PUBLIC void ddekit_pgtab_set_region_with_size(void *virt, ddekit_addr_t phys, in /****************************************************************************/ /* ddekit_pgtab_clear_region */ /****************************************************************************/ -PUBLIC void ddekit_pgtab_clear_region(void *virt, int type) { +void ddekit_pgtab_clear_region(void *virt, int type) { struct dde_pgtab_region *r; @@ -234,7 +234,7 @@ PUBLIC void ddekit_pgtab_clear_region(void *virt, int type) { /****************************************************************************/ /* ddekit_pgtab_get_physaddr */ /****************************************************************************/ -PUBLIC ddekit_addr_t ddekit_pgtab_get_physaddr(const void *virt) +ddekit_addr_t ddekit_pgtab_get_physaddr(const void *virt) { struct dde_pgtab_region *r; ddekit_addr_t ret = 0; @@ -253,7 +253,7 @@ PUBLIC ddekit_addr_t ddekit_pgtab_get_physaddr(const void *virt) /****************************************************************************/ /* ddekit_pgtab_get_virtaddr */ /****************************************************************************/ -PUBLIC ddekit_addr_t ddekit_pgtab_get_virtaddr(const ddekit_addr_t physical) +ddekit_addr_t ddekit_pgtab_get_virtaddr(const ddekit_addr_t physical) { struct dde_pgtab_region *r; lock_pgtab(); @@ -270,7 +270,7 @@ PUBLIC ddekit_addr_t ddekit_pgtab_get_virtaddr(const ddekit_addr_t physical) /****************************************************************************/ /* ddekit_pgtab_get_size */ /****************************************************************************/ -PUBLIC int ddekit_pgtab_get_type(const void *virt) +int ddekit_pgtab_get_type(const void *virt) { /* * needed for dde fbsd @@ -287,7 +287,7 @@ PUBLIC int ddekit_pgtab_get_type(const void *virt) /****************************************************************************/ /* ddekit_pgtab_get_size */ /****************************************************************************/ -PUBLIC int ddekit_pgtab_get_size(const void *virt) +int ddekit_pgtab_get_size(const void *virt) { /* * needed for fbsd @@ -306,7 +306,7 @@ PUBLIC int ddekit_pgtab_get_size(const void *virt) /****************************************************************************/ /* ddekit_pgtab_init */ /****************************************************************************/ -PUBLIC void ddekit_pgtab_init() { +void ddekit_pgtab_init() { /* called by ddekit_init() */ ddekit_lock_init(&lock); } diff --git a/lib/libddekit/src/printf.c b/lib/libddekit/src/printf.c index deef59e22..f42bdb95b 100644 --- a/lib/libddekit/src/printf.c +++ b/lib/libddekit/src/printf.c @@ -4,7 +4,7 @@ /****************************************************************************/ /* ddekit_print */ /****************************************************************************/ -PUBLIC int ddekit_print(const char* c) +int ddekit_print(const char* c) { return ddekit_printf(c); } @@ -12,7 +12,7 @@ PUBLIC int ddekit_print(const char* c) /****************************************************************************/ /* ddekit_printf */ /****************************************************************************/ -PUBLIC int ddekit_printf(const char* fmt, ...) +int ddekit_printf(const char* fmt, ...) { int r; va_list va; @@ -27,7 +27,7 @@ PUBLIC int ddekit_printf(const char* fmt, ...) /****************************************************************************/ /* ddekit_vprintf */ /****************************************************************************/ -PUBLIC int ddekit_vprintf(const char *fmt, va_list va) +int ddekit_vprintf(const char *fmt, va_list va) { return vprintf(fmt, va); } diff --git a/lib/libddekit/src/resource.c b/lib/libddekit/src/resource.c index 8af8ccadb..29965c3bc 100644 --- a/lib/libddekit/src/resource.c +++ b/lib/libddekit/src/resource.c @@ -16,7 +16,7 @@ /****************************************************************************/ /* ddekit_release_dma */ /****************************************************************************/ -PUBLIC int ddekit_request_dma(int nr) { +int ddekit_request_dma(int nr) { WARN_UNIMPL; /* do we stil use isa dma ? imho no.*/ return -1; @@ -25,7 +25,7 @@ PUBLIC int ddekit_request_dma(int nr) { /****************************************************************************/ /* ddekit_request_dma */ /****************************************************************************/ -PUBLIC int ddekit_release_dma(int nr) { +int ddekit_release_dma(int nr) { WARN_UNIMPL; /* do we stil use isa dma ? imho no.*/ return -1; @@ -37,17 +37,17 @@ PUBLIC int ddekit_release_dma(int nr) { /****************************************************************************/ /* ddekit_release/request_io */ /****************************************************************************/ -PUBLIC int ddekit_request_io (ddekit_addr_t start, ddekit_addr_t count) { +int ddekit_request_io (ddekit_addr_t start, ddekit_addr_t count) { return 0; } -PUBLIC int ddekit_release_io (ddekit_addr_t start, ddekit_addr_t count) { +int ddekit_release_io (ddekit_addr_t start, ddekit_addr_t count) { return 0; } /****************************************************************************/ /* ddekit_request_mem */ /****************************************************************************/ -PUBLIC int ddekit_request_mem +int ddekit_request_mem (ddekit_addr_t start, ddekit_addr_t size, ddekit_addr_t *vaddr) { *vaddr = (ddekit_addr_t) vm_map_phys(SELF, (void *)start, size); @@ -64,7 +64,7 @@ PUBLIC int ddekit_request_mem /****************************************************************************/ /* ddekit_release_mem */ /****************************************************************************/ -PUBLIC int ddekit_release_mem(ddekit_addr_t start, ddekit_addr_t size) +int ddekit_release_mem(ddekit_addr_t start, ddekit_addr_t size) { return vm_unmap_phys(SELF,(void *) start, size ); } @@ -72,7 +72,7 @@ PUBLIC int ddekit_release_mem(ddekit_addr_t start, ddekit_addr_t size) /****************************************************************************/ /* ddekit_inb */ /****************************************************************************/ -PUBLIC unsigned char ddekit_inb(ddekit_addr_t port) { +unsigned char ddekit_inb(ddekit_addr_t port) { u32_t ret; if (sys_inb(port, &ret)) { ddekit_panic("sys_inb failed."); @@ -84,7 +84,7 @@ PUBLIC unsigned char ddekit_inb(ddekit_addr_t port) { /****************************************************************************/ /* ddekit_inw */ /****************************************************************************/ -PUBLIC unsigned short ddekit_inw(ddekit_addr_t port) { +unsigned short ddekit_inw(ddekit_addr_t port) { u32_t ret; if (sys_inw(port, &ret)) { ddekit_panic("sys_inw failed."); @@ -96,7 +96,7 @@ PUBLIC unsigned short ddekit_inw(ddekit_addr_t port) { /****************************************************************************/ /* ddekit_inl */ /****************************************************************************/ -PUBLIC unsigned long ddekit_inl(ddekit_addr_t port){ +unsigned long ddekit_inl(ddekit_addr_t port){ u32_t ret; if (sys_inl(port, &ret)) { ddekit_panic("sys_outl failed."); @@ -108,7 +108,7 @@ PUBLIC unsigned long ddekit_inl(ddekit_addr_t port){ /****************************************************************************/ /* ddekit_outb */ /****************************************************************************/ -PUBLIC void ddekit_outb(ddekit_addr_t port, unsigned char val) { +void ddekit_outb(ddekit_addr_t port, unsigned char val) { if (sys_outb(port,val)) { ddekit_panic("sys_outb failed."); } @@ -118,7 +118,7 @@ PUBLIC void ddekit_outb(ddekit_addr_t port, unsigned char val) { /****************************************************************************/ /* ddekit_outw */ /****************************************************************************/ -PUBLIC void ddekit_outw(ddekit_addr_t port, unsigned short val) { +void ddekit_outw(ddekit_addr_t port, unsigned short val) { if (sys_outw(port,val)) { ddekit_panic("sys_outw failed."); } @@ -128,7 +128,7 @@ PUBLIC void ddekit_outw(ddekit_addr_t port, unsigned short val) { /****************************************************************************/ /* ddekit_outl */ /****************************************************************************/ -PUBLIC void ddekit_outl(ddekit_addr_t port, unsigned long val) { +void ddekit_outl(ddekit_addr_t port, unsigned long val) { if (sys_outl(port,val)) { ddekit_panic("sys_outl failed."); } diff --git a/lib/libddekit/src/semaphore.c b/lib/libddekit/src/semaphore.c index 61d7866fa..e51cd14d9 100644 --- a/lib/libddekit/src/semaphore.c +++ b/lib/libddekit/src/semaphore.c @@ -26,7 +26,7 @@ struct ddekit_sem { /***************************************************************************** * ddekit_sem_init * *************************+**************************************************/ -PUBLIC ddekit_sem_t *ddekit_sem_init(int value) +ddekit_sem_t *ddekit_sem_init(int value) { ddekit_sem_t *sem; @@ -42,7 +42,7 @@ PUBLIC ddekit_sem_t *ddekit_sem_init(int value) /***************************************************************************** * ddekit_sem_deinit * ****************************************************************************/ -PUBLIC void ddekit_sem_deinit(ddekit_sem_t *sem) +void ddekit_sem_deinit(ddekit_sem_t *sem) { SEM_DEBUG(p); ddekit_simple_free(sem); @@ -51,7 +51,7 @@ PUBLIC void ddekit_sem_deinit(ddekit_sem_t *sem) /***************************************************************************** * ddekit_sem_down * ****************************************************************************/ -PUBLIC void ddekit_sem_down(ddekit_sem_t *sem) +void ddekit_sem_down(ddekit_sem_t *sem) { SEM_DEBUG(p); if(sem->count == 0) { @@ -73,7 +73,7 @@ PUBLIC void ddekit_sem_down(ddekit_sem_t *sem) /***************************************************************************** * ddekit_sem_down_try * ****************************************************************************/ -PUBLIC int ddekit_sem_down_try(ddekit_sem_t *sem) +int ddekit_sem_down_try(ddekit_sem_t *sem) { if(sem->count == 0) { return -1; @@ -85,7 +85,7 @@ PUBLIC int ddekit_sem_down_try(ddekit_sem_t *sem) /***************************************************************************** * ddekit_sem_up * ****************************************************************************/ -PUBLIC void ddekit_sem_up(ddekit_sem_t *sem) +void ddekit_sem_up(ddekit_sem_t *sem) { SEM_DEBUG(p); if (sem->wait_queue == NULL) { @@ -103,7 +103,7 @@ PUBLIC void ddekit_sem_up(ddekit_sem_t *sem) /**************************************************************************** * ddekit_sem_down_timed * ***************************************************************************/ -PUBLIC int ddekit_sem_down_timed(ddekit_sem_t *sem, int timo ) +int ddekit_sem_down_timed(ddekit_sem_t *sem, int timo ) { ddekit_panic("not implemented!"); return 0; diff --git a/lib/libddekit/src/thread.c b/lib/libddekit/src/thread.c index c23cbeec1..c8b2ba141 100644 --- a/lib/libddekit/src/thread.c +++ b/lib/libddekit/src/thread.c @@ -17,22 +17,22 @@ /* Incremented to generate unique thread IDs */ -PRIVATE unsigned id; +static unsigned id; -PRIVATE ddekit_thread_t *ready_queue[DDEKIT_THREAD_PRIOS]; +static ddekit_thread_t *ready_queue[DDEKIT_THREAD_PRIOS]; -PRIVATE ddekit_thread_t *sleep_queue; +static ddekit_thread_t *sleep_queue; /* Handle to the running thread, set in _dde_kit_thread_schedule() */ -PRIVATE ddekit_thread_t *current = NULL; +static ddekit_thread_t *current = NULL; -FORWARD void _ddekit_thread_start(ddekit_thread_t *th); -FORWARD void _ddekit_thread_sleep(unsigned long until); +static void _ddekit_thread_start(ddekit_thread_t *th); +static void _ddekit_thread_sleep(unsigned long until); /***************************************************************************** * _ddekit_thread_start * ****************************************************************************/ -PRIVATE void _ddekit_thread_start(ddekit_thread_t *th) +static void _ddekit_thread_start(ddekit_thread_t *th) { /* entry point of newly created threads */ th->fun(th->arg); @@ -42,7 +42,7 @@ PRIVATE void _ddekit_thread_start(ddekit_thread_t *th) /***************************************************************************** * _ddekit_thread_sleep * ****************************************************************************/ -PRIVATE void _ddekit_thread_sleep(unsigned long until) +static void _ddekit_thread_sleep(unsigned long until) { current->next = sleep_queue; sleep_queue = current; @@ -58,7 +58,7 @@ PRIVATE void _ddekit_thread_sleep(unsigned long until) /***************************************************************************** * ddekit_yield * ****************************************************************************/ -PUBLIC void ddekit_yield() +void ddekit_yield() { ddekit_thread_schedule(); } @@ -66,7 +66,7 @@ PUBLIC void ddekit_yield() /***************************************************************************** * ddekit_thread_schedule * ****************************************************************************/ -PUBLIC void ddekit_thread_schedule() +void ddekit_thread_schedule() { _ddekit_thread_enqueue(current); _ddekit_thread_schedule(); @@ -75,7 +75,7 @@ PUBLIC void ddekit_thread_schedule() /***************************************************************************** * ddekit_thread_create * ****************************************************************************/ -PUBLIC ddekit_thread_t * +ddekit_thread_t * ddekit_thread_create(void (*fun)(void *), void *arg, const char *name) { ddekit_thread_t *th = @@ -130,7 +130,7 @@ ddekit_thread_create(void (*fun)(void *), void *arg, const char *name) /***************************************************************************** * ddekit_thread_get_data * ****************************************************************************/ -PUBLIC void *ddekit_thread_get_data(ddekit_thread_t *thread) +void *ddekit_thread_get_data(ddekit_thread_t *thread) { return thread->data; } @@ -138,7 +138,7 @@ PUBLIC void *ddekit_thread_get_data(ddekit_thread_t *thread) /***************************************************************************** * ddekit_thread_get_my_data * ****************************************************************************/ -PUBLIC void *ddekit_thread_get_my_data(void) +void *ddekit_thread_get_my_data(void) { return current->data; } @@ -146,7 +146,7 @@ PUBLIC void *ddekit_thread_get_my_data(void) /***************************************************************************** * ddekit_thread_myself * ****************************************************************************/ -PUBLIC + ddekit_thread_t *ddekit_thread_myself(void) { return current; @@ -155,7 +155,7 @@ ddekit_thread_t *ddekit_thread_myself(void) /***************************************************************************** * ddekit_thread_setup_myself * ****************************************************************************/ -PUBLIC + ddekit_thread_t *ddekit_thread_setup_myself(const char *name) { ddekit_thread_t *th = (ddekit_thread_t *) ddekit_simple_malloc(sizeof(ddekit_thread_t)); @@ -176,7 +176,7 @@ ddekit_thread_t *ddekit_thread_setup_myself(const char *name) { /***************************************************************************** * ddekit_thread_set_data * ****************************************************************************/ -PUBLIC void ddekit_thread_set_data(ddekit_thread_t *thread, void *data) +void ddekit_thread_set_data(ddekit_thread_t *thread, void *data) { thread->data=data; } @@ -184,7 +184,7 @@ PUBLIC void ddekit_thread_set_data(ddekit_thread_t *thread, void *data) /***************************************************************************** * ddekit_thread_set_my_data * ****************************************************************************/ -PUBLIC void ddekit_thread_set_my_data(void *data) +void ddekit_thread_set_my_data(void *data) { current->data = data; } @@ -217,7 +217,7 @@ void ddekit_thread_usleep(unsigned long usecs) /***************************************************************************** * ddekit_thread_nsleep * ****************************************************************************/ -PUBLIC void ddekit_thread_nsleep(unsigned long nsecs) +void ddekit_thread_nsleep(unsigned long nsecs) { /* * Cannot use usleep here, because it's implemented in vfs. @@ -242,7 +242,7 @@ PUBLIC void ddekit_thread_nsleep(unsigned long nsecs) /***************************************************************************** * ddekit_thread_msleep * ****************************************************************************/ -PUBLIC void ddekit_thread_msleep(unsigned long msecs) +void ddekit_thread_msleep(unsigned long msecs) { unsigned long to; @@ -270,7 +270,7 @@ PUBLIC void ddekit_thread_msleep(unsigned long msecs) /***************************************************************************** * ddekit_thread_sleep * ****************************************************************************/ -PUBLIC void ddekit_thread_sleep(ddekit_lock_t *lock) +void ddekit_thread_sleep(ddekit_lock_t *lock) { WARN_UNIMPL; } @@ -278,7 +278,7 @@ PUBLIC void ddekit_thread_sleep(ddekit_lock_t *lock) /***************************************************************************** * ddekit_thread_exit * ****************************************************************************/ -PUBLIC void ddekit_thread_exit() +void ddekit_thread_exit() { ddekit_sem_down(current->sleep_sem); ddekit_panic("thread running after exit!\n"); @@ -289,7 +289,7 @@ PUBLIC void ddekit_thread_exit() /***************************************************************************** * ddekit_thread_terminate * ****************************************************************************/ -PUBLIC void ddekit_thread_terminate(ddekit_thread_t *thread) +void ddekit_thread_terminate(ddekit_thread_t *thread) { /* todo */ } @@ -297,7 +297,7 @@ PUBLIC void ddekit_thread_terminate(ddekit_thread_t *thread) /***************************************************************************** * ddekit_thread_get_name * ****************************************************************************/ -PUBLIC const char *ddekit_thread_get_name(ddekit_thread_t *thread) +const char *ddekit_thread_get_name(ddekit_thread_t *thread) { return thread->name; } @@ -305,7 +305,7 @@ PUBLIC const char *ddekit_thread_get_name(ddekit_thread_t *thread) /***************************************************************************** * ddekit_thread_get_id * ****************************************************************************/ -PUBLIC int ddekit_thread_get_id(ddekit_thread_t *thread) +int ddekit_thread_get_id(ddekit_thread_t *thread) { return thread->id; } @@ -313,7 +313,7 @@ PUBLIC int ddekit_thread_get_id(ddekit_thread_t *thread) /***************************************************************************** * ddekit_init_threads * ****************************************************************************/ -PUBLIC void ddekit_init_threads(void) +void ddekit_init_threads(void) { int i; @@ -333,7 +333,7 @@ PUBLIC void ddekit_init_threads(void) /***************************************************************************** * _ddekit_thread_schedule * ****************************************************************************/ -PUBLIC void _ddekit_thread_schedule() +void _ddekit_thread_schedule() { DDEBUG_MSG_VERBOSE("called schedule id: %d name %s, prio: %d", @@ -381,7 +381,7 @@ PUBLIC void _ddekit_thread_schedule() /***************************************************************************** * _ddekit_thread_enqueue * ****************************************************************************/ -PUBLIC void _ddekit_thread_enqueue(ddekit_thread_t *th) +void _ddekit_thread_enqueue(ddekit_thread_t *th) { DDEBUG_MSG_VERBOSE("enqueueing thread: id: %d name %s, prio: %d", @@ -407,7 +407,7 @@ PUBLIC void _ddekit_thread_enqueue(ddekit_thread_t *th) /***************************************************************************** * _ddekit_thread_set_myprio * ****************************************************************************/ -PUBLIC void _ddekit_thread_set_myprio(int prio) +void _ddekit_thread_set_myprio(int prio) { DDEBUG_MSG_VERBOSE("changing thread prio, id: %d name %s, old prio: %d, " "new prio: %d", current->id, current->name, current->prio); @@ -419,7 +419,7 @@ PUBLIC void _ddekit_thread_set_myprio(int prio) /***************************************************************************** * _ddekit_thread_wakeup_sleeping * ****************************************************************************/ -PUBLIC void _ddekit_thread_wakeup_sleeping() +void _ddekit_thread_wakeup_sleeping() { ddekit_thread_t *th = sleep_queue; @@ -464,7 +464,7 @@ PUBLIC void _ddekit_thread_wakeup_sleeping() /***************************************************************************** * _ddekit_print_backtrace * ****************************************************************************/ -PUBLIC void _ddekit_print_backtrace(ddekit_thread_t *th) +void _ddekit_print_backtrace(ddekit_thread_t *th) { unsigned long bp, pc, hbp; diff --git a/lib/libddekit/src/timer.c b/lib/libddekit/src/timer.c index b9c5da6a6..818fd419c 100644 --- a/lib/libddekit/src/timer.c +++ b/lib/libddekit/src/timer.c @@ -28,26 +28,26 @@ struct ddekit_timer_s { }; -PRIVATE ddekit_sem_t *pending_timer_ints; +static ddekit_sem_t *pending_timer_ints; /* are we currently expecting a alarm notify? */ int _ddekit_timer_pending = 0; -PUBLIC unsigned long long jiffies; -PUBLIC unsigned long HZ; +unsigned long long jiffies; +unsigned long HZ; -PRIVATE struct ddekit_timer_s list = {0,0,-1,1,0}; -PRIVATE int _id = 0 ; -PRIVATE ddekit_thread_t *th; -PRIVATE ddekit_lock_t lock; +static struct ddekit_timer_s list = {0,0,-1,1,0}; +static int _id = 0 ; +static ddekit_thread_t *th; +static ddekit_lock_t lock; -FORWARD void lock_timer(void); -FORWARD void unlock_timer(void); -FORWARD clock_t get_current_clock(void); -FORWARD void remove_timer(int id); -FORWARD int insert_timer(struct ddekit_timer_s *t); -FORWARD struct ddekit_timer_s * get_next( myclock_t exp ); -FORWARD void ddekit_timer_thread(void *data); +static void lock_timer(void); +static void unlock_timer(void); +static clock_t get_current_clock(void); +static void remove_timer(int id); +static int insert_timer(struct ddekit_timer_s *t); +static struct ddekit_timer_s * get_next( myclock_t exp ); +static void ddekit_timer_thread(void *data); /**************************************************************************** * Private funtions * @@ -56,7 +56,7 @@ FORWARD void ddekit_timer_thread(void *data); /***************************************************************************** * lock_timer * ****************************************************************************/ -PRIVATE void lock_timer() +static void lock_timer() { ddekit_lock_lock(&lock); } @@ -83,7 +83,7 @@ static myclock_t get_current_clock() /***************************************************************************** * remove_timer * ****************************************************************************/ -PRIVATE void remove_timer(int id) +static void remove_timer(int id) { /* removes a timer from the timer list */ struct ddekit_timer_s *l,*m; @@ -112,7 +112,7 @@ PRIVATE void remove_timer(int id) /***************************************************************************** * insert_timer * ****************************************************************************/ -PRIVATE int insert_timer(struct ddekit_timer_s *t) +static int insert_timer(struct ddekit_timer_s *t) { /* inserts a timer to the timer list */ int ret; @@ -146,7 +146,7 @@ PRIVATE int insert_timer(struct ddekit_timer_s *t) /***************************************************************************** * get_next * ****************************************************************************/ -PRIVATE struct ddekit_timer_s * get_next( myclock_t exp ) +static struct ddekit_timer_s * get_next( myclock_t exp ) { /* * this one get the next timer, which's timeout expired, @@ -169,7 +169,7 @@ PRIVATE struct ddekit_timer_s * get_next( myclock_t exp ) /***************************************************************************** * ddekit_timer_thread * ****************************************************************************/ -PRIVATE void ddekit_timer_thread(void * data) +static void ddekit_timer_thread(void * data) { struct ddekit_timer_s * l; @@ -199,7 +199,7 @@ PRIVATE void ddekit_timer_thread(void * data) /***************************************************************************** * ddekit_add_timer * ****************************************************************************/ -PUBLIC int ddekit_add_timer +int ddekit_add_timer (void (*fn)(void *), void *args, unsigned long timeout) { struct ddekit_timer_s *t; @@ -217,7 +217,7 @@ PUBLIC int ddekit_add_timer /***************************************************************************** * ddekit_del_timer * ****************************************************************************/ -PUBLIC int ddekit_del_timer(int timer) +int ddekit_del_timer(int timer) { remove_timer(timer); return 0; @@ -226,7 +226,7 @@ PUBLIC int ddekit_del_timer(int timer) /***************************************************************************** * ddekit_timer_pending * ****************************************************************************/ -PUBLIC int ddekit_timer_pending(int timer) +int ddekit_timer_pending(int timer) { int ret=0; struct ddekit_timer_s *t; @@ -244,7 +244,7 @@ PUBLIC int ddekit_timer_pending(int timer) /***************************************************************************** * ddekit_init_timers * ****************************************************************************/ -PUBLIC void ddekit_init_timers(void) +void ddekit_init_timers(void) { static int first_time=0; @@ -263,7 +263,7 @@ PUBLIC void ddekit_init_timers(void) /***************************************************************************** * ddekit_get_timer_thread * ****************************************************************************/ -PUBLIC ddekit_thread_t *ddekit_get_timer_thread(void) +ddekit_thread_t *ddekit_get_timer_thread(void) { return th; } @@ -275,7 +275,7 @@ PUBLIC ddekit_thread_t *ddekit_get_timer_thread(void) /***************************************************************************** * _ddekit_timer_interrupt * ****************************************************************************/ -PUBLIC void _ddekit_timer_interrupt(void) +void _ddekit_timer_interrupt(void) { jiffies = get_current_clock(); DDEBUG_MSG_VERBOSE("now: %d", jiffies); @@ -285,7 +285,7 @@ PUBLIC void _ddekit_timer_interrupt(void) /***************************************************************************** * _ddekit_timer_update * ****************************************************************************/ -PUBLIC void _ddekit_timer_update() +void _ddekit_timer_update() { lock_timer(); diff --git a/lib/libddekit/src/usb_client.c b/lib/libddekit/src/usb_client.c index 213fd6ae0..eaac5d90e 100644 --- a/lib/libddekit/src/usb_client.c +++ b/lib/libddekit/src/usb_client.c @@ -17,12 +17,12 @@ struct ddekit_usb_dev dev_list_head = { .prev = &dev_list_head, }; -PRIVATE struct ddekit_usb_driver *d_usb_driver; +static struct ddekit_usb_driver *d_usb_driver; -FORWARD void _ddekit_usb_completion(struct usb_urb *mx); -FORWARD void _ddekit_usb_connect( unsigned int dev_id, unsigned int +static void _ddekit_usb_completion(struct usb_urb *mx); +static void _ddekit_usb_connect( unsigned int dev_id, unsigned int interfaces); -FORWARD void _ddekit_usb_disconnect(unsigned dev_id); +static void _ddekit_usb_disconnect(unsigned dev_id); struct usb_driver mx_usb_driver = { .urb_completion = _ddekit_usb_completion, @@ -33,7 +33,7 @@ struct usb_driver mx_usb_driver = { /***************************************************************************** * _ddekit_usb_completion * ****************************************************************************/ -PRIVATE void _ddekit_usb_completion(struct usb_urb *mx_urb) +static void _ddekit_usb_completion(struct usb_urb *mx_urb) { struct ddekit_usb_urb *d_urb = (struct ddekit_usb_urb *) mx_urb->priv; @@ -72,7 +72,7 @@ PRIVATE void _ddekit_usb_completion(struct usb_urb *mx_urb) /***************************************************************************** * _ddekit_usb_connect * ****************************************************************************/ -PRIVATE void _ddekit_usb_connect(unsigned int dev_id, unsigned int interfaces) +static void _ddekit_usb_connect(unsigned int dev_id, unsigned int interfaces) { struct ddekit_usb_dev *d_dev = (struct ddekit_usb_dev *) ddekit_simple_malloc(sizeof(struct ddekit_usb_dev)); @@ -94,7 +94,7 @@ PRIVATE void _ddekit_usb_connect(unsigned int dev_id, unsigned int interfaces) /***************************************************************************** * _ddekit_usb_disconnect * ****************************************************************************/ -PUBLIC void _ddekit_usb_disconnect(unsigned dev_id) +void _ddekit_usb_disconnect(unsigned dev_id) { /* find dev */ struct ddekit_usb_dev *it; @@ -118,7 +118,7 @@ PUBLIC void _ddekit_usb_disconnect(unsigned dev_id) /***************************************************************************** * ddekit_usb_dev_set_data * ****************************************************************************/ -PUBLIC int ddekit_usb_dev_set_data(struct ddekit_usb_dev *dev, void *data) +int ddekit_usb_dev_set_data(struct ddekit_usb_dev *dev, void *data) { dev->data = data; return 0; @@ -127,7 +127,7 @@ PUBLIC int ddekit_usb_dev_set_data(struct ddekit_usb_dev *dev, void *data) /***************************************************************************** * ddekit_usb_dev_get_data * ****************************************************************************/ -PUBLIC void *ddekit_usb_dev_get_data(struct ddekit_usb_dev *dev) +void *ddekit_usb_dev_get_data(struct ddekit_usb_dev *dev) { return dev->data; } @@ -135,7 +135,7 @@ PUBLIC void *ddekit_usb_dev_get_data(struct ddekit_usb_dev *dev) /***************************************************************************** * ddekit_usb_submit_urb * ****************************************************************************/ -PUBLIC int ddekit_usb_submit_urb(struct ddekit_usb_urb *d_urb) +int ddekit_usb_submit_urb(struct ddekit_usb_urb *d_urb) { int res; unsigned urb_size = USB_URBSIZE(d_urb->size, d_urb->number_of_packets); @@ -180,7 +180,7 @@ PUBLIC int ddekit_usb_submit_urb(struct ddekit_usb_urb *d_urb) /***************************************************************************** * ddekit_usb_cancle_urb * ****************************************************************************/ -PUBLIC int ddekit_usb_cancle_urb(struct ddekit_usb_urb *d_urb) +int ddekit_usb_cancle_urb(struct ddekit_usb_urb *d_urb) { int res; @@ -208,7 +208,7 @@ static void _ddekit_usb_thread() /***************************************************************************** * ddekit_usb_init * ****************************************************************************/ -PUBLIC int ddekit_usb_init +int ddekit_usb_init (struct ddekit_usb_driver *drv, ddekit_usb_malloc_fn *unused, ddekit_usb_free_fn *_unused) diff --git a/lib/libddekit/src/usb_server.c b/lib/libddekit/src/usb_server.c index bce70d45e..67059587d 100644 --- a/lib/libddekit/src/usb_server.c +++ b/lib/libddekit/src/usb_server.c @@ -58,29 +58,29 @@ struct minix_usb_device { unsigned int interfaces; }; -FORWARD struct minix_usb_driver *find_driver(endpoint_t ep); -FORWARD struct minix_usb_driver *find_unused_driver(void); -FORWARD int add_to_pending_urbs(struct minix_usb_driver *drv, struct +static struct minix_usb_driver *find_driver(endpoint_t ep); +static struct minix_usb_driver *find_unused_driver(void); +static int add_to_pending_urbs(struct minix_usb_driver *drv, struct ddekit_usb_urb *urb); -FORWARD int remove_from_pending_urbs(struct minix_usb_driver *drv, +static int remove_from_pending_urbs(struct minix_usb_driver *drv, struct ddekit_usb_urb *urb); -FORWARD struct ddekit_usb_urb * find_pending_urb(struct minix_usb_driver +static struct ddekit_usb_urb * find_pending_urb(struct minix_usb_driver *drv, unsigned urb_id); -FORWARD void register_driver(message *msg); -FORWARD struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb(struct usb_urb +static void register_driver(message *msg); +static struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb(struct usb_urb *mx_urb); -FORWARD void submit_urb(message *msg); -FORWARD void cancle_urb(message *msg); -FORWARD void completion_callback(void *priv); +static void submit_urb(message *msg); +static void cancle_urb(message *msg); +static void completion_callback(void *priv); -FORWARD void prepare_devman_usbdev(struct ddekit_usb_dev * dev, int +static void prepare_devman_usbdev(struct ddekit_usb_dev * dev, int dev_id, unsigned int interfaces, struct devman_usb_dev *dudev); -FORWARD void device_disconnect_callback(struct ddekit_usb_dev * dev); -FORWARD int add_acl(int dev_id, unsigned interfaces, endpoint_t ep); -FORWARD int del_acl(int dev_id, unsigned interaces, endpoint_t ep); -FORWARD int handle_msg(message *msg); -FORWARD void _ddekit_usb_thread(); -FORWARD void device_connect_callback(struct ddekit_usb_dev * dev, +static void device_disconnect_callback(struct ddekit_usb_dev * dev); +static int add_acl(int dev_id, unsigned interfaces, endpoint_t ep); +static int del_acl(int dev_id, unsigned interaces, endpoint_t ep); +static int handle_msg(message *msg); +static void _ddekit_usb_thread(); +static void device_connect_callback(struct ddekit_usb_dev * dev, unsigned int interfaces); char *_ddekit_usb_get_manufacturer(struct ddekit_usb_dev *ddev); @@ -92,12 +92,12 @@ usb_interface_descriptor_t *_ddekit_usb_get_interface_desc(struct ddekit_usb_dev *ddev, int inum); -PRIVATE ddekit_usb_malloc_fn my_malloc; -PRIVATE ddekit_usb_free_fn my_free; -PRIVATE struct minix_usb_driver gbl_drivers[MAX_DRIVERS]; -PRIVATE struct minix_usb_device _devices[MAX_DEVS]; +static ddekit_usb_malloc_fn my_malloc; +static ddekit_usb_free_fn my_free; +static struct minix_usb_driver gbl_drivers[MAX_DRIVERS]; +static struct minix_usb_device _devices[MAX_DEVS]; -PRIVATE struct ddekit_usb_driver my_driver = { +static struct ddekit_usb_driver my_driver = { .completion = completion_callback, .connect = device_connect_callback, .disconnect = device_disconnect_callback, @@ -107,7 +107,7 @@ PRIVATE struct ddekit_usb_driver my_driver = { /***************************************************************************** * find_driver * ****************************************************************************/ -PRIVATE struct minix_usb_driver *find_driver(endpoint_t ep) +static struct minix_usb_driver *find_driver(endpoint_t ep) { int i; for (i = 0; i < MAX_DRIVERS; i++ ){ @@ -121,7 +121,7 @@ PRIVATE struct minix_usb_driver *find_driver(endpoint_t ep) /***************************************************************************** * find_unused_driver * ****************************************************************************/ -PRIVATE struct minix_usb_driver *find_unused_driver() +static struct minix_usb_driver *find_unused_driver() { int i; for (i = 0; i < MAX_DRIVERS; i++ ){ @@ -135,7 +135,7 @@ PRIVATE struct minix_usb_driver *find_unused_driver() /***************************************************************************** * add_to_pending_urbs * ****************************************************************************/ -PRIVATE int add_to_pending_urbs(struct minix_usb_driver *drv, +static int add_to_pending_urbs(struct minix_usb_driver *drv, struct ddekit_usb_urb *urb) { int i; @@ -153,7 +153,7 @@ PRIVATE int add_to_pending_urbs(struct minix_usb_driver *drv, /***************************************************************************** * remove_from_pending_urbs * ****************************************************************************/ -PRIVATE int remove_from_pending_urbs(struct minix_usb_driver *drv, +static int remove_from_pending_urbs(struct minix_usb_driver *drv, struct ddekit_usb_urb *urb) { int i; @@ -171,7 +171,7 @@ PRIVATE int remove_from_pending_urbs(struct minix_usb_driver *drv, /***************************************************************************** * find_pending_urb * ****************************************************************************/ -PRIVATE struct ddekit_usb_urb * find_pending_urb(struct minix_usb_driver *drv, +static struct ddekit_usb_urb * find_pending_urb(struct minix_usb_driver *drv, unsigned urb_id) { int i; @@ -188,7 +188,7 @@ PRIVATE struct ddekit_usb_urb * find_pending_urb(struct minix_usb_driver *drv, /***************************************************************************** * register_driver * ****************************************************************************/ -PRIVATE void register_driver(message *msg) +static void register_driver(message *msg) { endpoint_t ep = msg->m_source; struct minix_usb_driver *drv; @@ -222,7 +222,7 @@ PRIVATE void register_driver(message *msg) /***************************************************************************** * deregister_driver * ****************************************************************************/ -PRIVATE void deregister_driver(message *msg) +static void deregister_driver(message *msg) { endpoint_t ep = msg->m_source; @@ -245,7 +245,7 @@ PRIVATE void deregister_driver(message *msg) /***************************************************************************** * ddekit_usb_urb_from_mx_urb * ****************************************************************************/ -PRIVATE struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb(struct usb_urb *mx_urb) +static struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb(struct usb_urb *mx_urb) { /* * A helper function that generates (allocates and initializes) @@ -284,7 +284,7 @@ PRIVATE struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb(struct usb_urb *mx_urb /***************************************************************************** * submit_urb * ****************************************************************************/ -PRIVATE void submit_urb(message *msg) +static void submit_urb(message *msg) { /* * submit_urb @@ -410,7 +410,7 @@ out: /***************************************************************************** * cancle_urb * ****************************************************************************/ -PRIVATE void cancle_urb(message *msg) +static void cancle_urb(message *msg) { endpoint_t ep = msg->m_source; @@ -444,7 +444,7 @@ PRIVATE void cancle_urb(message *msg) /***************************************************************************** * completion_callback * ****************************************************************************/ -PRIVATE void completion_callback(void *priv) +static void completion_callback(void *priv) { /* * completion_callback @@ -497,7 +497,7 @@ PRIVATE void completion_callback(void *priv) /***************************************************************************** * prepare_devman_usbdev * ****************************************************************************/ -PRIVATE void prepare_devman_usbdev +static void prepare_devman_usbdev (struct ddekit_usb_dev * dev, int dev_id, unsigned int interfaces, struct devman_usb_dev *dudev) { @@ -531,7 +531,7 @@ PRIVATE void prepare_devman_usbdev /***************************************************************************** * device_connect_callback * ****************************************************************************/ -PRIVATE void +static void device_connect_callback (struct ddekit_usb_dev * dev, unsigned int interfaces) { @@ -574,7 +574,7 @@ device_connect_callback /***************************************************************************** * device_disconnect_callback * ****************************************************************************/ -PRIVATE void device_disconnect_callback(struct ddekit_usb_dev * dev) +static void device_disconnect_callback(struct ddekit_usb_dev * dev) { int i; @@ -616,7 +616,7 @@ PRIVATE void device_disconnect_callback(struct ddekit_usb_dev * dev) /***************************************************************************** * add_acl * ****************************************************************************/ -PRIVATE int add_acl(int dev_id, unsigned interfaces, endpoint_t ep) +static int add_acl(int dev_id, unsigned interfaces, endpoint_t ep) { /* * This functions binds a specific USB interface to a client. @@ -657,7 +657,7 @@ PRIVATE int add_acl(int dev_id, unsigned interfaces, endpoint_t ep) /***************************************************************************** * del_acl * ****************************************************************************/ -PRIVATE int del_acl(int dev_id, unsigned interfaces, endpoint_t ep) +static int del_acl(int dev_id, unsigned interfaces, endpoint_t ep) { struct minix_usb_driver *drv; int dev, withdraw = 0; @@ -692,7 +692,7 @@ PRIVATE int del_acl(int dev_id, unsigned interfaces, endpoint_t ep) /***************************************************************************** * handle_msg * ****************************************************************************/ -PRIVATE int handle_msg(message *msg) +static int handle_msg(message *msg) { /* * handle_msg @@ -721,7 +721,7 @@ PRIVATE int handle_msg(message *msg) /***************************************************************************** * devman_tread * ****************************************************************************/ -PRIVATE void devman_thread(void *unused) +static void devman_thread(void *unused) { struct ddekit_minix_msg_q *mq = ddekit_minix_create_msg_q(DEVMAN_BASE, DEVMAN_BASE + 0xff); @@ -736,7 +736,7 @@ PRIVATE void devman_thread(void *unused) /***************************************************************************** * _ddekit_usb_thread * ****************************************************************************/ -PRIVATE void _ddekit_usb_thread(void * unused) +static void _ddekit_usb_thread(void * unused) { struct ddekit_minix_msg_q *mq = ddekit_minix_create_msg_q(USB_BASE, USB_BASE + 0xff); @@ -758,7 +758,7 @@ PRIVATE void _ddekit_usb_thread(void * unused) /***************************************************************************** * bind_cb * ****************************************************************************/ -PRIVATE int bind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) +static int bind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) { if(data) { return add_acl(data->dev_id, data->interface, ep); @@ -771,7 +771,7 @@ PRIVATE int bind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) /***************************************************************************** * unbind_cb * ****************************************************************************/ -PRIVATE int unbind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) +static int unbind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) { if(data) { return del_acl(data->dev_id, data->interface, ep); @@ -784,7 +784,7 @@ PRIVATE int unbind_cb (struct devman_usb_bind_cb_data *data, endpoint_t ep) /***************************************************************************** * ddekit_usb_server_init * ****************************************************************************/ -PUBLIC void ddekit_usb_server_init() +void ddekit_usb_server_init() { int i; /* diff --git a/lib/libdevman/generic.c b/lib/libdevman/generic.c index b1d29a4ef..ff77cc992 100644 --- a/lib/libdevman/generic.c +++ b/lib/libdevman/generic.c @@ -12,16 +12,16 @@ #include "local.h" -PRIVATE endpoint_t devman_ep; +static endpoint_t devman_ep; -FORWARD int save_string(char *buffer, char *src, size_t *offset); +static int save_string(char *buffer, char *src, size_t *offset); -PRIVATE TAILQ_HEAD(devlist_head, devman_dev) dev_list; +static TAILQ_HEAD(devlist_head, devman_dev) dev_list; /**************************************************************************** * save_string * ***************************************************************************/ -PRIVATE int save_string(char *buffer, char *src, size_t *offset) +static int save_string(char *buffer, char *src, size_t *offset) { unsigned old_offset = *offset; size_t len = strlen(src) + 1; @@ -33,7 +33,7 @@ PRIVATE int save_string(char *buffer, char *src, size_t *offset) /**************************************************************************** * serialize_dev * ***************************************************************************/ -PUBLIC void *serialize_dev(struct devman_dev *dev, size_t *overall_size) +void *serialize_dev(struct devman_dev *dev, size_t *overall_size) { /* determine size of serialized version of dev */ char *buffer; @@ -99,7 +99,7 @@ PUBLIC void *serialize_dev(struct devman_dev *dev, size_t *overall_size) /**************************************************************************** * devman_add_device * ***************************************************************************/ -PUBLIC int devman_add_device(struct devman_dev *dev) +int devman_add_device(struct devman_dev *dev) { message msg; int res; @@ -148,7 +148,7 @@ PUBLIC int devman_add_device(struct devman_dev *dev) /**************************************************************************** * devman_del_device * ***************************************************************************/ -PUBLIC int devman_del_device(struct devman_dev *dev) +int devman_del_device(struct devman_dev *dev) { message msg; int res; @@ -182,7 +182,7 @@ PUBLIC int devman_del_device(struct devman_dev *dev) /**************************************************************************** * devman_get_ep * ***************************************************************************/ -PUBLIC endpoint_t devman_get_ep() +endpoint_t devman_get_ep() { return devman_ep; } @@ -190,7 +190,7 @@ PUBLIC endpoint_t devman_get_ep() /**************************************************************************** * devman_init * ***************************************************************************/ -PUBLIC int devman_init() +int devman_init() { int res; @@ -209,7 +209,7 @@ PUBLIC int devman_init() /**************************************************************************** * do_bind * ***************************************************************************/ -PRIVATE void do_bind(message *m) +static void do_bind(message *m) { struct devman_dev *dev; int res; @@ -235,7 +235,7 @@ PRIVATE void do_bind(message *m) /**************************************************************************** * do_unbind * ***************************************************************************/ -PRIVATE void do_unbind(message *m) +static void do_unbind(message *m) { struct devman_dev *dev; int res; @@ -260,7 +260,7 @@ PRIVATE void do_unbind(message *m) /**************************************************************************** * devman_handle_msg * ***************************************************************************/ -PUBLIC int devman_handle_msg(message *m) +int devman_handle_msg(message *m) { /* make sure msg comes from devman server */ if (m->m_source != devman_ep) { diff --git a/lib/libdevman/usb.c b/lib/libdevman/usb.c index 001f91393..699f45c48 100644 --- a/lib/libdevman/usb.c +++ b/lib/libdevman/usb.c @@ -21,7 +21,7 @@ static int (*unbind_cb) (struct devman_usb_bind_cb_data *data, endpoint_t ep); /**************************************************************************** * devman_usb_add_attr * ***************************************************************************/ -PRIVATE void +static void devman_usb_add_attr (struct devman_dev *dev, char *name, char *data) { @@ -41,7 +41,7 @@ devman_usb_add_attr /**************************************************************************** * add_device_attributes * ***************************************************************************/ -PRIVATE void +static void add_device_attributes (struct devman_usb_dev *udev) { @@ -90,7 +90,7 @@ add_device_attributes /**************************************************************************** * add_interface_attributes * ***************************************************************************/ -PRIVATE void +static void add_interface_attributes (struct devman_usb_interface *intf) { @@ -140,7 +140,7 @@ add_interface_attributes /**************************************************************************** * devman_usb_device_new * ***************************************************************************/ -PUBLIC struct devman_usb_dev* +struct devman_usb_dev* devman_usb_device_new (int dev_id) { @@ -171,7 +171,7 @@ devman_usb_device_new /**************************************************************************** * devman_usb_device_delete * ***************************************************************************/ -PUBLIC void devman_usb_device_delete(struct devman_usb_dev *udev) +void devman_usb_device_delete(struct devman_usb_dev *udev) { int i; struct devman_static_attribute *attr,*temp; @@ -197,7 +197,7 @@ PUBLIC void devman_usb_device_delete(struct devman_usb_dev *udev) free(udev); } -PRIVATE int devman_usb_bind_cb(void *data, endpoint_t ep) { +static int devman_usb_bind_cb(void *data, endpoint_t ep) { if (bind_cb) { return bind_cb((struct devman_usb_bind_cb_data *) data, ep); } else { @@ -205,7 +205,7 @@ PRIVATE int devman_usb_bind_cb(void *data, endpoint_t ep) { } } -PRIVATE int devman_usb_unbind_cb(void *data, endpoint_t ep) { +static int devman_usb_unbind_cb(void *data, endpoint_t ep) { if (unbind_cb) { return unbind_cb((struct devman_usb_bind_cb_data *) data, ep); } else { @@ -216,7 +216,7 @@ PRIVATE int devman_usb_unbind_cb(void *data, endpoint_t ep) { /**************************************************************************** * devman_usb_device_add * ***************************************************************************/ -PUBLIC int devman_usb_device_add(struct devman_usb_dev *dev) +int devman_usb_device_add(struct devman_usb_dev *dev) { int i,res = 0; add_device_attributes(dev); @@ -273,7 +273,7 @@ PUBLIC int devman_usb_device_add(struct devman_usb_dev *dev) /**************************************************************************** * devman_usb_device_remove * ***************************************************************************/ -PUBLIC int devman_usb_device_remove(struct devman_usb_dev *dev) +int devman_usb_device_remove(struct devman_usb_dev *dev) { int i, res = 0; @@ -292,7 +292,7 @@ PUBLIC int devman_usb_device_remove(struct devman_usb_dev *dev) /**************************************************************************** * devman_usb_init * ***************************************************************************/ -PUBLIC void devman_usb_init +void devman_usb_init (int (*_bind_cb) (struct devman_usb_bind_cb_data *data, endpoint_t ep), int (*_unbind_cb) (struct devman_usb_bind_cb_data *data, endpoint_t ep)) { diff --git a/lib/libedit/editline.c b/lib/libedit/editline.c index e32b71464..ac756ca2a 100644 --- a/lib/libedit/editline.c +++ b/lib/libedit/editline.c @@ -81,8 +81,8 @@ STATIC int Point; STATIC int PushBack; STATIC int Pushed; STATIC int Signal; -FORWARD KEYMAP Map[33]; -FORWARD KEYMAP MetaMap[17]; +static KEYMAP Map[33]; +static KEYMAP MetaMap[17]; STATIC SIZE_T Length; STATIC SIZE_T ScreenCount; STATIC SIZE_T ScreenSize; diff --git a/lib/libhgfs/attr.c b/lib/libhgfs/attr.c index e68138fd0..85004d443 100644 --- a/lib/libhgfs/attr.c +++ b/lib/libhgfs/attr.c @@ -7,7 +7,7 @@ /*===========================================================================* * attr_get * *===========================================================================*/ -PUBLIC void attr_get(attr) +void attr_get(attr) struct hgfs_attr *attr; { /* Get attribute information from the RPC buffer, storing the requested parts @@ -35,7 +35,7 @@ struct hgfs_attr *attr; /*===========================================================================* * hgfs_getattr * *===========================================================================*/ -PUBLIC int hgfs_getattr(path, attr) +int hgfs_getattr(path, attr) char *path; struct hgfs_attr *attr; { @@ -58,7 +58,7 @@ struct hgfs_attr *attr; /*===========================================================================* * hgfs_setattr * *===========================================================================*/ -PUBLIC int hgfs_setattr(path, attr) +int hgfs_setattr(path, attr) char *path; struct hgfs_attr *attr; { diff --git a/lib/libhgfs/channel.c b/lib/libhgfs/channel.c index 8ed97f4c0..3fca1beec 100644 --- a/lib/libhgfs/channel.c +++ b/lib/libhgfs/channel.c @@ -19,7 +19,7 @@ enum { /*===========================================================================* * channel_open * *===========================================================================*/ -PUBLIC int channel_open(ch, type) +int channel_open(ch, type) struct channel *ch; /* struct describing the new channel */ u32_t type; /* channel type: CH_IN or CH_OUT */ { @@ -46,7 +46,7 @@ u32_t type; /* channel type: CH_IN or CH_OUT */ /*===========================================================================* * channel_close * *===========================================================================*/ -PUBLIC void channel_close(ch) +void channel_close(ch) struct channel *ch; /* backdoor channel to close */ { /* Close a previously opened backdoor channel. @@ -64,7 +64,7 @@ struct channel *ch; /* backdoor channel to close */ /*===========================================================================* * channel_send * *===========================================================================*/ -PUBLIC int channel_send(ch, buf, len) +int channel_send(ch, buf, len) struct channel *ch; /* backdoor channel to send to */ char *buf; /* buffer to send data from */ int len; /* size of the data to send */ @@ -101,7 +101,7 @@ int len; /* size of the data to send */ /*===========================================================================* * channel_recv * *===========================================================================*/ -PUBLIC int channel_recv(ch, buf, max) +int channel_recv(ch, buf, max) struct channel *ch; /* backdoor channel to receive from */ char *buf; /* buffer to receive data into */ int max; /* size of the buffer */ diff --git a/lib/libhgfs/dir.c b/lib/libhgfs/dir.c index 1f0081b9a..f2a220f2a 100644 --- a/lib/libhgfs/dir.c +++ b/lib/libhgfs/dir.c @@ -5,7 +5,7 @@ /*===========================================================================* * hgfs_opendir * *===========================================================================*/ -PUBLIC int hgfs_opendir(path, handle) +int hgfs_opendir(path, handle) char *path; hgfs_dir_t *handle; { @@ -28,7 +28,7 @@ hgfs_dir_t *handle; /*===========================================================================* * hgfs_readdir * *===========================================================================*/ -PUBLIC int hgfs_readdir(handle, index, buf, size, attr) +int hgfs_readdir(handle, index, buf, size, attr) hgfs_dir_t handle; unsigned int index; char *buf; @@ -58,7 +58,7 @@ struct hgfs_attr *attr; /*===========================================================================* * hgfs_closedir * *===========================================================================*/ -PUBLIC int hgfs_closedir(handle) +int hgfs_closedir(handle) hgfs_dir_t handle; { /* Close an open directory. diff --git a/lib/libhgfs/error.c b/lib/libhgfs/error.c index af38fd9d2..a926fc7bf 100644 --- a/lib/libhgfs/error.c +++ b/lib/libhgfs/error.c @@ -6,7 +6,7 @@ * that weren't in the original protocol, are being returned now. */ #define NERRS 16 -PRIVATE int error_map[NERRS] = { +static int error_map[NERRS] = { OK, /* no error */ ENOENT, /* no such file/directory */ EBADF, /* invalid handle */ @@ -28,7 +28,7 @@ PRIVATE int error_map[NERRS] = { /*===========================================================================* * error_convert * *===========================================================================*/ -PUBLIC int error_convert(err) +int error_convert(err) int err; { /* Convert a HGFS error into an errno error code. diff --git a/lib/libhgfs/file.c b/lib/libhgfs/file.c index 24bdbd157..fb3447b22 100644 --- a/lib/libhgfs/file.c +++ b/lib/libhgfs/file.c @@ -8,7 +8,7 @@ /*===========================================================================* * hgfs_open * *===========================================================================*/ -PUBLIC int hgfs_open(path, flags, mode, handle) +int hgfs_open(path, flags, mode, handle) char *path; /* path name to open */ int flags; /* open flags to use */ int mode; /* mode to create (user bits only) */ @@ -50,7 +50,7 @@ hgfs_file_t *handle; /* place to store resulting handle */ /*===========================================================================* * hgfs_read * *===========================================================================*/ -PUBLIC int hgfs_read(handle, buf, size, off) +int hgfs_read(handle, buf, size, off) hgfs_file_t handle; /* handle to open file */ char *buf; /* data buffer or NULL */ size_t size; /* maximum number of bytes to read */ @@ -84,7 +84,7 @@ u64_t off; /* file offset */ /*===========================================================================* * hgfs_write * *===========================================================================*/ -PUBLIC int hgfs_write(handle, buf, len, off, append) +int hgfs_write(handle, buf, len, off, append) hgfs_file_t handle; /* handle to open file */ const char *buf; /* data buffer or NULL */ size_t len; /* number of bytes to write */ @@ -125,7 +125,7 @@ int append; /* if set, append to file (ignore offset) */ /*===========================================================================* * hgfs_close * *===========================================================================*/ -PUBLIC int hgfs_close(handle) +int hgfs_close(handle) hgfs_file_t handle; /* handle to open file */ { /* Close an open file. @@ -140,7 +140,7 @@ hgfs_file_t handle; /* handle to open file */ /*===========================================================================* * hgfs_readbuf * *===========================================================================*/ -PUBLIC size_t hgfs_readbuf(ptr) +size_t hgfs_readbuf(ptr) char **ptr; { /* Return information about the read buffer, for zero-copy purposes. Store a @@ -162,7 +162,7 @@ char **ptr; /*===========================================================================* * hgfs_writebuf * *===========================================================================*/ -PUBLIC size_t hgfs_writebuf(ptr) +size_t hgfs_writebuf(ptr) char **ptr; { /* Return information about the write buffer, for zero-copy purposes. Store a diff --git a/lib/libhgfs/link.c b/lib/libhgfs/link.c index 274dbb46d..fc0c24f90 100644 --- a/lib/libhgfs/link.c +++ b/lib/libhgfs/link.c @@ -7,7 +7,7 @@ /*===========================================================================* * hgfs_mkdir * *===========================================================================*/ -PUBLIC int hgfs_mkdir(path, mode) +int hgfs_mkdir(path, mode) char *path; int mode; { @@ -25,7 +25,7 @@ int mode; /*===========================================================================* * hgfs_unlink * *===========================================================================*/ -PUBLIC int hgfs_unlink(path) +int hgfs_unlink(path) char *path; { /* Delete a file. @@ -41,7 +41,7 @@ char *path; /*===========================================================================* * hgfs_rmdir * *===========================================================================*/ -PUBLIC int hgfs_rmdir(path) +int hgfs_rmdir(path) char *path; { /* Remove an empty directory. @@ -57,7 +57,7 @@ char *path; /*===========================================================================* * hgfs_rename * *===========================================================================*/ -PUBLIC int hgfs_rename(opath, npath) +int hgfs_rename(opath, npath) char *opath; char *npath; { diff --git a/lib/libhgfs/misc.c b/lib/libhgfs/misc.c index 1acda1a08..9ddb4231c 100644 --- a/lib/libhgfs/misc.c +++ b/lib/libhgfs/misc.c @@ -5,7 +5,7 @@ /*===========================================================================* * hgfs_init * *===========================================================================*/ -PUBLIC int hgfs_init() +int hgfs_init() { /* Initialize the library. Return OK on success, or a negative error code * otherwise. If EAGAIN is returned, shared folders are disabled; in that @@ -20,7 +20,7 @@ PUBLIC int hgfs_init() /*===========================================================================* * hgfs_cleanup * *===========================================================================*/ -PUBLIC void hgfs_cleanup() +void hgfs_cleanup() { /* Clean up state. */ @@ -31,7 +31,7 @@ PUBLIC void hgfs_cleanup() /*===========================================================================* * hgfs_enabled * *===========================================================================*/ -PUBLIC int hgfs_enabled() +int hgfs_enabled() { /* Check if shared folders are enabled. Return OK if so, EAGAIN if not, and * another negative error code on error. @@ -43,7 +43,7 @@ PUBLIC int hgfs_enabled() /*===========================================================================* * hgfs_queryvol * *===========================================================================*/ -PUBLIC int hgfs_queryvol(path, free, total) +int hgfs_queryvol(path, free, total) char *path; u64_t *free; u64_t *total; diff --git a/lib/libhgfs/path.c b/lib/libhgfs/path.c index 6a2a2a110..e10f817b7 100644 --- a/lib/libhgfs/path.c +++ b/lib/libhgfs/path.c @@ -7,7 +7,7 @@ /*===========================================================================* * path_put * *===========================================================================*/ -PUBLIC void path_put(path) +void path_put(path) char *path; { /* Append the given path name in HGFS format to the RPC buffer. Truncate it @@ -42,7 +42,7 @@ char *path; /*===========================================================================* * path_get * *===========================================================================*/ -PUBLIC int path_get(path, max) +int path_get(path, max) char *path; int max; { diff --git a/lib/libhgfs/rpc.c b/lib/libhgfs/rpc.c index 3345ea346..08a6655d9 100644 --- a/lib/libhgfs/rpc.c +++ b/lib/libhgfs/rpc.c @@ -2,15 +2,15 @@ #include "inc.h" -PUBLIC char rpc_buf[RPC_BUF_SIZE]; -PUBLIC char *rpc_ptr; +char rpc_buf[RPC_BUF_SIZE]; +char *rpc_ptr; -PRIVATE struct channel rpc_chan; +static struct channel rpc_chan; /*===========================================================================* * rpc_open * *===========================================================================*/ -PUBLIC int rpc_open() +int rpc_open() { /* Open a HGFS RPC backdoor channel to the VMware host, and make sure that it * is working. Return OK upon success, or a negative error code otherwise. @@ -31,7 +31,7 @@ PUBLIC int rpc_open() /*===========================================================================* * rpc_query * *===========================================================================*/ -PUBLIC int rpc_query() +int rpc_query() { /* Send a HGFS RPC query over the backdoor channel. Return OK upon success, or * a negative error code otherwise; EAGAIN is returned if shared folders are @@ -69,7 +69,7 @@ PUBLIC int rpc_query() /*===========================================================================* * rpc_test * *===========================================================================*/ -PUBLIC int rpc_test() +int rpc_test() { /* Test whether HGFS communication is working. Return OK on success, EAGAIN if * shared folders are disabled, or another negative error code upon error. @@ -85,7 +85,7 @@ PUBLIC int rpc_test() /*===========================================================================* * rpc_close * *===========================================================================*/ -PUBLIC void rpc_close() +void rpc_close() { /* Close the HGFS RPC backdoor channel. */ diff --git a/lib/libhgfs/time.c b/lib/libhgfs/time.c index 5daab9251..b14d52688 100644 --- a/lib/libhgfs/time.c +++ b/lib/libhgfs/time.c @@ -2,12 +2,12 @@ #include "inc.h" -PRIVATE u64_t time_offset; +static u64_t time_offset; /*===========================================================================* * time_init * *===========================================================================*/ -PUBLIC void time_init() +void time_init() { /* Initialize the time conversion module. */ @@ -24,7 +24,7 @@ PUBLIC void time_init() /*===========================================================================* * time_put * *===========================================================================*/ -PUBLIC void time_put(timep) +void time_put(timep) time_t *timep; { /* Store a UNIX timestamp pointed to by the given pointer onto the RPC buffer, @@ -47,7 +47,7 @@ time_t *timep; /*===========================================================================* * time_get * *===========================================================================*/ -PUBLIC void time_get(timep) +void time_get(timep) time_t *timep; { /* Get a HGFS timestamp from the RPC buffer, convert it into a UNIX timestamp, diff --git a/lib/libminlib/fslib.c b/lib/libminlib/fslib.c index 0ef6ad30b..0ededda08 100644 --- a/lib/libminlib/fslib.c +++ b/lib/libminlib/fslib.c @@ -31,7 +31,7 @@ * unlikely, but negative bit counts are now possible (though unlikely) * and give silly results. */ -PUBLIC int bitmapsize(nr_bits, block_size) +int bitmapsize(nr_bits, block_size) bit_t nr_bits; int block_size; { @@ -46,7 +46,7 @@ int block_size; /*===========================================================================* * conv2 * *===========================================================================*/ -PUBLIC unsigned conv2(norm, w) +unsigned conv2(norm, w) int norm; /* TRUE if no swap, FALSE for byte swap */ int w; /* promotion of 16-bit word to be swapped */ { @@ -60,7 +60,7 @@ int w; /* promotion of 16-bit word to be swapped */ /*===========================================================================* * conv4 * *===========================================================================*/ -PUBLIC long conv4(norm, x) +long conv4(norm, x) int norm; /* TRUE if no swap, FALSE for byte swap */ long x; /* 32-bit long to be byte swapped */ { @@ -80,7 +80,7 @@ long x; /* 32-bit long to be byte swapped */ /*===========================================================================* * conv_inode * *===========================================================================*/ -PUBLIC void conv_inode(rip, dip, dip2, rw_flag, magic) +void conv_inode(rip, dip, dip2, rw_flag, magic) register struct inode *rip; /* pointer to the in-core inode struct */ register d1_inode *dip; /* pointer to the V1 on-disk inode struct */ register d2_inode *dip2; /* pointer to the V2 on-disk inode struct */ @@ -103,7 +103,7 @@ int magic; /* magic number of file system */ /*===========================================================================* * old_icopy * *===========================================================================*/ -PUBLIC void old_icopy(rip, dip, direction, norm) +void old_icopy(rip, dip, direction, norm) register struct inode *rip; /* pointer to the in-core inode struct */ register d1_inode *dip; /* pointer to the d1_inode inode struct */ int direction; /* READING (from disk) or WRITING (to disk) */ @@ -150,7 +150,7 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */ /*===========================================================================* * new_icopy * *===========================================================================*/ -PUBLIC void new_icopy(rip, dip, direction, norm) +void new_icopy(rip, dip, direction, norm) register struct inode *rip; /* pointer to the in-core inode struct */ register d2_inode *dip; /* pointer to the d2_inode struct */ int direction; /* READING (from disk) or WRITING (to disk) */ diff --git a/lib/libminlib/getngid.c b/lib/libminlib/getngid.c index d1c9b06d4..60b9ac094 100644 --- a/lib/libminlib/getngid.c +++ b/lib/libminlib/getngid.c @@ -1,7 +1,7 @@ #include #include -PUBLIC gid_t getngid(endpoint_t proc_ep) +gid_t getngid(endpoint_t proc_ep) { message m; m.m1_i1 = proc_ep; /* search gid for this process */ diff --git a/lib/libminlib/getnpid.c b/lib/libminlib/getnpid.c index 01ece33d5..3f88cc196 100644 --- a/lib/libminlib/getnpid.c +++ b/lib/libminlib/getnpid.c @@ -1,7 +1,7 @@ #include #include -PUBLIC pid_t getnpid(endpoint_t proc_ep) +pid_t getnpid(endpoint_t proc_ep) { message m; m.m1_i1 = proc_ep; /* search pid for this process */ diff --git a/lib/libminlib/getnprocnr.c b/lib/libminlib/getnprocnr.c index 9f69e31bb..85521cb27 100644 --- a/lib/libminlib/getnprocnr.c +++ b/lib/libminlib/getnprocnr.c @@ -2,7 +2,7 @@ #include -PUBLIC int getnprocnr(pid_t pid) +int getnprocnr(pid_t pid) { message m; int t = GETPROCNR; diff --git a/lib/libminlib/getnucred.c b/lib/libminlib/getnucred.c index 8fbe905e3..cbddc7bb9 100644 --- a/lib/libminlib/getnucred.c +++ b/lib/libminlib/getnucred.c @@ -3,7 +3,7 @@ #include #include -PUBLIC int getnucred(endpoint_t proc_ep, struct ucred *ucred) +int getnucred(endpoint_t proc_ep, struct ucred *ucred) { message m; pid_t pid; diff --git a/lib/libminlib/getnuid.c b/lib/libminlib/getnuid.c index b09c8637d..f02d1dbd9 100644 --- a/lib/libminlib/getnuid.c +++ b/lib/libminlib/getnuid.c @@ -1,7 +1,7 @@ #include #include -PUBLIC uid_t getnuid(endpoint_t proc_ep) +uid_t getnuid(endpoint_t proc_ep) { message m; m.m1_i1 = proc_ep; /* search uid for this process */ diff --git a/lib/libminlib/getprocnr.c b/lib/libminlib/getprocnr.c index 3f5238fb7..2f0d1e6fc 100644 --- a/lib/libminlib/getprocnr.c +++ b/lib/libminlib/getprocnr.c @@ -2,7 +2,7 @@ #include -PUBLIC int getprocnr() +int getprocnr() { message m; m.m1_i1 = -1; /* don't pass pid to search for */ diff --git a/lib/libminlib/itoa.c b/lib/libminlib/itoa.c index 519505306..81181b458 100644 --- a/lib/libminlib/itoa.c +++ b/lib/libminlib/itoa.c @@ -1,8 +1,8 @@ #include /* Integer to ASCII for signed decimal integers. */ -PRIVATE int next; -PRIVATE char qbuf[8]; +static int next; +static char qbuf[8]; char *itoa(int n); diff --git a/lib/libminlib/mapdriver.c b/lib/libminlib/mapdriver.c index 1b3130f63..34c674e64 100644 --- a/lib/libminlib/mapdriver.c +++ b/lib/libminlib/mapdriver.c @@ -3,7 +3,7 @@ #include -PUBLIC int mapdriver(label, major, dev_style, flags) +int mapdriver(label, major, dev_style, flags) char *label; int major; int dev_style; diff --git a/lib/libminlib/vm_memctl.c b/lib/libminlib/vm_memctl.c index 921ff076a..92e2b0c80 100644 --- a/lib/libminlib/vm_memctl.c +++ b/lib/libminlib/vm_memctl.c @@ -1,7 +1,7 @@ #include #include -PUBLIC int vm_memctl(endpoint_t ep, int req) +int vm_memctl(endpoint_t ep, int req) { message m; m.VM_RS_CTL_ENDPT = ep; diff --git a/lib/libminlib/vm_query_exit.c b/lib/libminlib/vm_query_exit.c index 9f5596387..df109dde2 100644 --- a/lib/libminlib/vm_query_exit.c +++ b/lib/libminlib/vm_query_exit.c @@ -8,7 +8,7 @@ * return 0, when there are no more processes. * note that for the return value of 0 and 1, the 'endpt' is set accordingly. */ -PUBLIC int vm_query_exit(int *endpt) +int vm_query_exit(int *endpt) { message m; int r; @@ -23,7 +23,7 @@ PUBLIC int vm_query_exit(int *endpt) return (m.VM_QUERY_IS_MORE ? 1 : 0); } -PUBLIC int vm_watch_exit(endpoint_t ep) +int vm_watch_exit(endpoint_t ep) { message m; diff --git a/lib/libminlib/vm_set_priv.c b/lib/libminlib/vm_set_priv.c index 969acf686..ea286526a 100644 --- a/lib/libminlib/vm_set_priv.c +++ b/lib/libminlib/vm_set_priv.c @@ -1,7 +1,7 @@ #include #include -PUBLIC int vm_set_priv(int nr, void *buf) +int vm_set_priv(int nr, void *buf) { message m; m.VM_RS_NR = nr; diff --git a/lib/libminlib/vm_update.c b/lib/libminlib/vm_update.c index 9e860c8e6..e3e731325 100644 --- a/lib/libminlib/vm_update.c +++ b/lib/libminlib/vm_update.c @@ -1,7 +1,7 @@ #include #include -PUBLIC int vm_update(endpoint_t src_e, endpoint_t dst_e) +int vm_update(endpoint_t src_e, endpoint_t dst_e) { message m; m.VM_RS_SRC_ENDPT = src_e; diff --git a/lib/libmthread/allocate.c b/lib/libmthread/allocate.c index ef28ee895..d1ede902c 100644 --- a/lib/libmthread/allocate.c +++ b/lib/libmthread/allocate.c @@ -7,20 +7,20 @@ #include "global.h" #include "proto.h" -FORWARD int mthread_increase_thread_pool(void); -FORWARD void mthread_thread_init(mthread_thread_t thread, mthread_attr_t +static int mthread_increase_thread_pool(void); +static void mthread_thread_init(mthread_thread_t thread, mthread_attr_t *tattr, void *(*proc)(void *), void *arg); -FORWARD void mthread_thread_stop(mthread_thread_t thread); -FORWARD void mthread_trampoline(void); +static void mthread_thread_stop(mthread_thread_t thread); +static void mthread_trampoline(void); -PRIVATE int initialized = 0; +static int initialized = 0; #ifndef PGSHIFT # define PGSHIFT 12 /* XXX: temporarily for ACK */ #endif #define MTHREAD_GUARDSIZE (1 << PGSHIFT) /* 1 page */ -PRIVATE struct __mthread_attr default_attr = { MTHREAD_STACK_MIN, +static struct __mthread_attr default_attr = { MTHREAD_STACK_MIN, NULL, MTHREAD_CREATE_JOINABLE, NULL, NULL }; @@ -28,7 +28,7 @@ PRIVATE struct __mthread_attr default_attr = { MTHREAD_STACK_MIN, /*===========================================================================* * mthread_equal * *===========================================================================*/ -PUBLIC int mthread_equal(l, r) +int mthread_equal(l, r) mthread_thread_t l; mthread_thread_t r; { @@ -42,7 +42,7 @@ mthread_thread_t r; /*===========================================================================* * mthread_create * *===========================================================================*/ -PUBLIC int mthread_create(threadid, tattr, proc, arg) +int mthread_create(threadid, tattr, proc, arg) mthread_thread_t *threadid; mthread_attr_t *tattr; void *(*proc)(void *); @@ -78,7 +78,7 @@ void *arg; /*===========================================================================* * mthread_detach * *===========================================================================*/ -PUBLIC int mthread_detach(detach) +int mthread_detach(detach) mthread_thread_t detach; { /* Mark a thread as detached. Consequently, upon exit, resources allocated for @@ -107,7 +107,7 @@ mthread_thread_t detach; /*===========================================================================* * mthread_exit * *===========================================================================*/ -PUBLIC void mthread_exit(value) +void mthread_exit(value) void *value; { /* Make a thread stop running and store the result value. */ @@ -143,7 +143,7 @@ void *value; /*===========================================================================* * mthread_find_tcb * *===========================================================================*/ -PUBLIC mthread_tcb_t * mthread_find_tcb(thread) +mthread_tcb_t * mthread_find_tcb(thread) mthread_thread_t thread; { mthread_tcb_t *rt = NULL; @@ -162,7 +162,7 @@ mthread_thread_t thread; /*===========================================================================* * mthread_increase_thread_pool * *===========================================================================*/ -PRIVATE int mthread_increase_thread_pool(void) +static int mthread_increase_thread_pool(void) { /* Increase thread pool. No fancy algorithms, just double the size. */ mthread_tcb_t **new_tcb; @@ -223,7 +223,7 @@ PRIVATE int mthread_increase_thread_pool(void) /*===========================================================================* * mthread_init * *===========================================================================*/ -PUBLIC void mthread_init(void) +void mthread_init(void) { /* Initialize thread system; allocate thread structures and start creating * threads. @@ -256,7 +256,7 @@ PUBLIC void mthread_init(void) /*===========================================================================* * mthread_join * *===========================================================================*/ -PUBLIC int mthread_join(join, value) +int mthread_join(join, value) mthread_thread_t join; void **value; { @@ -314,7 +314,7 @@ void **value; /*===========================================================================* * mthread_once * *===========================================================================*/ -PUBLIC int mthread_once(once, proc) +int mthread_once(once, proc) mthread_once_t *once; void (*proc)(void); { @@ -334,7 +334,7 @@ void (*proc)(void); /*===========================================================================* * mthread_self * *===========================================================================*/ -PUBLIC mthread_thread_t mthread_self(void) +mthread_thread_t mthread_self(void) { /* Return the thread id of the thread calling this function. */ @@ -347,7 +347,7 @@ PUBLIC mthread_thread_t mthread_self(void) /*===========================================================================* * mthread_thread_init * *===========================================================================*/ -PRIVATE void mthread_thread_init(thread, tattr, proc, arg) +static void mthread_thread_init(thread, tattr, proc, arg) mthread_thread_t thread; mthread_attr_t *tattr; void *(*proc)(void *); @@ -447,7 +447,7 @@ void *arg; /*===========================================================================* * mthread_thread_reset * *===========================================================================*/ -PUBLIC void mthread_thread_reset(thread) +void mthread_thread_reset(thread) mthread_thread_t thread; { /* Reset the thread to its default values. Free the allocated stack space. */ @@ -480,7 +480,7 @@ mthread_thread_t thread; /*===========================================================================* * mthread_thread_stop * *===========================================================================*/ -PRIVATE void mthread_thread_stop(thread) +static void mthread_thread_stop(thread) mthread_thread_t thread; { /* Stop thread from running. Deallocate resources. */ @@ -513,7 +513,7 @@ mthread_thread_t thread; /*===========================================================================* * mthread_trampoline * *===========================================================================*/ -PRIVATE void mthread_trampoline(void) +static void mthread_trampoline(void) { /* Execute the /current_thread's/ procedure. Store its result. */ diff --git a/lib/libmthread/attribute.c b/lib/libmthread/attribute.c index 7bd083803..763df02f5 100644 --- a/lib/libmthread/attribute.c +++ b/lib/libmthread/attribute.c @@ -2,15 +2,15 @@ #include "global.h" #include "proto.h" -PRIVATE struct __mthread_attr *va_front, *va_rear; -FORWARD void mthread_attr_add(mthread_attr_t *a); -FORWARD void mthread_attr_remove(mthread_attr_t *a); -FORWARD int mthread_attr_valid(mthread_attr_t *a); +static struct __mthread_attr *va_front, *va_rear; +static void mthread_attr_add(mthread_attr_t *a); +static void mthread_attr_remove(mthread_attr_t *a); +static int mthread_attr_valid(mthread_attr_t *a); /*===========================================================================* * mthread_init_valid_attributes * *===========================================================================*/ -PUBLIC void mthread_init_valid_attributes(void) +void mthread_init_valid_attributes(void) { /* Initialize list of valid attributs */ va_front = va_rear = NULL; @@ -20,7 +20,7 @@ PUBLIC void mthread_init_valid_attributes(void) /*===========================================================================* * mthread_attr_add * *===========================================================================*/ -PRIVATE void mthread_attr_add(a) +static void mthread_attr_add(a) mthread_attr_t *a; { /* Add attribute to list of valid, initialized attributes */ @@ -41,7 +41,7 @@ mthread_attr_t *a; /*===========================================================================* * mthread_attr_destroy * *===========================================================================*/ -PUBLIC int mthread_attr_destroy(attr) +int mthread_attr_destroy(attr) mthread_attr_t *attr; { /* Invalidate attribute and deallocate resources. */ @@ -66,7 +66,7 @@ mthread_attr_t *attr; /*===========================================================================* * mthread_attr_init * *===========================================================================*/ -PUBLIC int mthread_attr_init(attr) +int mthread_attr_init(attr) mthread_attr_t *attr; /* Attribute */ { /* Initialize the attribute to a known state. */ @@ -95,7 +95,7 @@ mthread_attr_t *attr; /* Attribute */ /*===========================================================================* * mthread_attr_getdetachstate * *===========================================================================*/ -PUBLIC int mthread_attr_getdetachstate(attr, detachstate) +int mthread_attr_getdetachstate(attr, detachstate) mthread_attr_t *attr; int *detachstate; { @@ -120,7 +120,7 @@ int *detachstate; /*===========================================================================* * mthread_attr_setdetachstate * *===========================================================================*/ -PUBLIC int mthread_attr_setdetachstate(attr, detachstate) +int mthread_attr_setdetachstate(attr, detachstate) mthread_attr_t *attr; int detachstate; { @@ -148,7 +148,7 @@ int detachstate; /*===========================================================================* * mthread_attr_getstack * *===========================================================================*/ -PUBLIC int mthread_attr_getstack(attr, stackaddr, stacksize) +int mthread_attr_getstack(attr, stackaddr, stacksize) mthread_attr_t *attr; void **stackaddr; size_t *stacksize; @@ -175,7 +175,7 @@ size_t *stacksize; /*===========================================================================* * mthread_attr_getstacksize * *===========================================================================*/ -PUBLIC int mthread_attr_getstacksize(attr, stacksize) +int mthread_attr_getstacksize(attr, stacksize) mthread_attr_t *attr; size_t *stacksize; { @@ -200,7 +200,7 @@ size_t *stacksize; /*===========================================================================* * mthread_attr_setstack * *===========================================================================*/ -PUBLIC int mthread_attr_setstack(attr, stackaddr, stacksize) +int mthread_attr_setstack(attr, stackaddr, stacksize) mthread_attr_t *attr; void *stackaddr; size_t stacksize; @@ -232,7 +232,7 @@ size_t stacksize; /*===========================================================================* * mthread_attr_setstacksize * *===========================================================================*/ -PUBLIC int mthread_attr_setstacksize(attr, stacksize) +int mthread_attr_setstacksize(attr, stacksize) mthread_attr_t *attr; size_t stacksize; { @@ -257,7 +257,7 @@ size_t stacksize; /*===========================================================================* * mthread_attr_remove * *===========================================================================*/ -PRIVATE void mthread_attr_remove(a) +static void mthread_attr_remove(a) mthread_attr_t *a; { /* Remove attribute from list of valid, initialized attributes */ @@ -277,7 +277,7 @@ mthread_attr_t *a; /*===========================================================================* * mthread_attr_valid * *===========================================================================*/ -PRIVATE int mthread_attr_valid(a) +static int mthread_attr_valid(a) mthread_attr_t *a; { /* Check to see if attribute is on the list of valid attributes */ @@ -302,7 +302,7 @@ mthread_attr_t *a; * mthread_attr_verify * *===========================================================================*/ #ifdef MDEBUG -PUBLIC int mthread_attr_verify(void) +int mthread_attr_verify(void) { /* Return true when no attributes are in use */ struct __mthread_attr *loopitem; diff --git a/lib/libmthread/condition.c b/lib/libmthread/condition.c index 82e6c2bfb..8ec60f443 100644 --- a/lib/libmthread/condition.c +++ b/lib/libmthread/condition.c @@ -3,10 +3,10 @@ #include "proto.h" #ifdef MTHREAD_STRICT -PRIVATE struct __mthread_cond *vc_front, *vc_rear; -FORWARD void mthread_cond_add(mthread_cond_t *c); -FORWARD void mthread_cond_remove(mthread_cond_t *c); -FORWARD int mthread_cond_valid(mthread_cond_t *c); +static struct __mthread_cond *vc_front, *vc_rear; +static void mthread_cond_add(mthread_cond_t *c); +static void mthread_cond_remove(mthread_cond_t *c); +static int mthread_cond_valid(mthread_cond_t *c); #else # define mthread_cond_add(c) ((*c)->mc_magic = MTHREAD_INIT_MAGIC) # define mthread_cond_remove(c) ((*c)->mc_magic = MTHREAD_NOT_INUSE) @@ -17,7 +17,7 @@ FORWARD int mthread_cond_valid(mthread_cond_t *c); /*===========================================================================* * mthread_init_valid_conditions * *===========================================================================*/ -PUBLIC void mthread_init_valid_conditions(void) +void mthread_init_valid_conditions(void) { #ifdef MTHREAD_STRICT /* Initialize condition variable list */ @@ -30,7 +30,7 @@ PUBLIC void mthread_init_valid_conditions(void) * mthread_cond_add * *===========================================================================*/ #ifdef MTHREAD_STRICT -PRIVATE void mthread_cond_add(c) +static void mthread_cond_add(c) mthread_cond_t *c; { /* Add condition to list of valid, initialized conditions */ @@ -51,7 +51,7 @@ mthread_cond_t *c; /*===========================================================================* * mthread_cond_broadcast * *===========================================================================*/ -PUBLIC int mthread_cond_broadcast(cond) +int mthread_cond_broadcast(cond) mthread_cond_t *cond; { /* Signal all threads waiting for condition 'cond'. */ @@ -82,7 +82,7 @@ mthread_cond_t *cond; /*===========================================================================* * mthread_cond_destroy * *===========================================================================*/ -PUBLIC int mthread_cond_destroy(cond) +int mthread_cond_destroy(cond) mthread_cond_t *cond; { /* Destroy a condition variable. Make sure it's not in use */ @@ -119,7 +119,7 @@ mthread_cond_t *cond; /*===========================================================================* * mthread_cond_init * *===========================================================================*/ -PUBLIC int mthread_cond_init(cond, cattr) +int mthread_cond_init(cond, cattr) mthread_cond_t *cond; mthread_condattr_t *cattr; { @@ -153,7 +153,7 @@ mthread_condattr_t *cattr; * mthread_cond_remove * *===========================================================================*/ #ifdef MTHREAD_STRICT -PRIVATE void mthread_cond_remove(c) +static void mthread_cond_remove(c) mthread_cond_t *c; { /* Remove condition from list of valid, initialized conditions */ @@ -174,7 +174,7 @@ mthread_cond_t *c; /*===========================================================================* * mthread_cond_signal * *===========================================================================*/ -PUBLIC int mthread_cond_signal(cond) +int mthread_cond_signal(cond) mthread_cond_t *cond; { /* Signal a thread that condition 'cond' was met. Just a single thread. */ @@ -208,7 +208,7 @@ mthread_cond_t *cond; * mthread_cond_valid * *===========================================================================*/ #ifdef MTHREAD_STRICT -PRIVATE int mthread_cond_valid(c) +static int mthread_cond_valid(c) mthread_cond_t *c; { /* Check to see if cond is on the list of valid conditions */ @@ -233,7 +233,7 @@ mthread_cond_t *c; * mthread_cond_verify * *===========================================================================*/ #ifdef MDEBUG -PUBLIC int mthread_cond_verify(void) +int mthread_cond_verify(void) { /* Return true in case no condition variables are in use. */ @@ -247,7 +247,7 @@ PUBLIC int mthread_cond_verify(void) /*===========================================================================* * mthread_cond_wait * *===========================================================================*/ -PUBLIC int mthread_cond_wait(cond, mutex) +int mthread_cond_wait(cond, mutex) mthread_cond_t *cond; mthread_mutex_t *mutex; { diff --git a/lib/libmthread/event.c b/lib/libmthread/event.c index 9f52ca5f2..1dea4e87e 100644 --- a/lib/libmthread/event.c +++ b/lib/libmthread/event.c @@ -4,7 +4,7 @@ /*===========================================================================* * mthread_event_init * *===========================================================================*/ -PUBLIC int mthread_event_init(event) +int mthread_event_init(event) mthread_event_t *event; /* The event to be initialized */ { /* Initialize an event object. @@ -29,7 +29,7 @@ mthread_event_t *event; /* The event to be initialized */ /*===========================================================================* * mthread_event_destroy * *===========================================================================*/ -PUBLIC int mthread_event_destroy(event) +int mthread_event_destroy(event) mthread_event_t *event; /* The event to be destroyed */ { /* Destroy an event object. @@ -49,7 +49,7 @@ mthread_event_t *event; /* The event to be destroyed */ /*===========================================================================* * mthread_event_wait * *===========================================================================*/ -PUBLIC int mthread_event_wait(event) +int mthread_event_wait(event) mthread_event_t *event; /* The event to be waited on */ { /* Wait for an event, blocking the current thread in the process. @@ -75,7 +75,7 @@ mthread_event_t *event; /* The event to be waited on */ /*===========================================================================* * mthread_event_fire * *===========================================================================*/ -PUBLIC int mthread_event_fire(event) +int mthread_event_fire(event) mthread_event_t *event; /* The event to be fired */ { /* Fire an event, waking up any thread blocked on it. @@ -102,7 +102,7 @@ mthread_event_t *event; /* The event to be fired */ /*===========================================================================* * mthread_event_fire_all * *===========================================================================*/ -PUBLIC int mthread_event_fire_all(event) +int mthread_event_fire_all(event) mthread_event_t *event; /* The event to be fired */ { /* Fire an event, waking up any thread blocked on it. diff --git a/lib/libmthread/key.c b/lib/libmthread/key.c index 01c6b84b0..db80ea9d6 100644 --- a/lib/libmthread/key.c +++ b/lib/libmthread/key.c @@ -3,8 +3,8 @@ #include "global.h" #include "proto.h" -PRIVATE int keys_used = 0; -PRIVATE struct { +static int keys_used = 0; +static struct { int used; int nvalues; void *mvalue; @@ -15,7 +15,7 @@ PRIVATE struct { /*===========================================================================* * mthread_init_keys * *===========================================================================*/ -PUBLIC void mthread_init_keys(void) +void mthread_init_keys(void) { /* Initialize the table of key entries. */ @@ -28,7 +28,7 @@ PUBLIC void mthread_init_keys(void) /*===========================================================================* * mthread_key_create * *===========================================================================*/ -PUBLIC int mthread_key_create(mthread_key_t *key, void (*destructor)(void *)) +int mthread_key_create(mthread_key_t *key, void (*destructor)(void *)) { /* Allocate a key. */ @@ -60,7 +60,7 @@ PUBLIC int mthread_key_create(mthread_key_t *key, void (*destructor)(void *)) /*===========================================================================* * mthread_key_delete * *===========================================================================*/ -PUBLIC int mthread_key_delete(mthread_key_t key) +int mthread_key_delete(mthread_key_t key) { /* Free up a key, as well as any associated storage space. */ @@ -80,7 +80,7 @@ PUBLIC int mthread_key_delete(mthread_key_t key) /*===========================================================================* * mthread_getspecific * *===========================================================================*/ -PUBLIC void *mthread_getspecific(mthread_key_t key) +void *mthread_getspecific(mthread_key_t key) { /* Get this thread's local value for the given key. The default is NULL. */ @@ -102,7 +102,7 @@ PUBLIC void *mthread_getspecific(mthread_key_t key) /*===========================================================================* * mthread_setspecific * *===========================================================================*/ -PUBLIC int mthread_setspecific(mthread_key_t key, void *value) +int mthread_setspecific(mthread_key_t key, void *value) { /* Set this thread's value for the given key. Allocate more resources as * necessary. @@ -143,7 +143,7 @@ PUBLIC int mthread_setspecific(mthread_key_t key, void *value) /*===========================================================================* * mthread_cleanup_values * *===========================================================================*/ -PUBLIC void mthread_cleanup_values(void) +void mthread_cleanup_values(void) { /* Clean up all the values associated with an exiting thread, calling keys' * destruction procedures as appropriate. diff --git a/lib/libmthread/misc.c b/lib/libmthread/misc.c index e90ac40b3..ae7a9b2df 100644 --- a/lib/libmthread/misc.c +++ b/lib/libmthread/misc.c @@ -7,7 +7,7 @@ * mthread_debug_f * *===========================================================================*/ #ifdef MDEBUG -PUBLIC void mthread_debug_f(const char *file, int line, const char *msg) +void mthread_debug_f(const char *file, int line, const char *msg) { /* Print debug message */ printf("MTH (%s:%d): %s\n", file, line, msg); @@ -18,7 +18,7 @@ PUBLIC void mthread_debug_f(const char *file, int line, const char *msg) * mthread_panic_f * *===========================================================================*/ #ifdef MDEBUG -PUBLIC void mthread_panic_f(const char *file, int line, const char *msg) +void mthread_panic_f(const char *file, int line, const char *msg) { /* Print panic message to stdout and exit */ volatile int *sf; @@ -33,7 +33,7 @@ PUBLIC void mthread_panic_f(const char *file, int line, const char *msg) exit(1); } #else -PUBLIC void mthread_panic_s(void) +void mthread_panic_s(void) { /* Silent panic */ volatile int *sf; @@ -49,7 +49,7 @@ PUBLIC void mthread_panic_s(void) * mthread_verify_f * *===========================================================================*/ #ifdef MDEBUG -PUBLIC void mthread_verify_f(char *file, int line) +void mthread_verify_f(char *file, int line) { /* Verify library state. It is assumed this function is never called from * a spawned thread, but from the 'main' thread. The library should be @@ -84,7 +84,7 @@ PUBLIC void mthread_verify_f(char *file, int line) /*===========================================================================* * mthread_stats * *===========================================================================*/ -PUBLIC void mthread_stats(void) +void mthread_stats(void) { mthread_thread_t t; mthread_tcb_t *tcb; diff --git a/lib/libmthread/mutex.c b/lib/libmthread/mutex.c index 3ab6fed23..23002acb4 100644 --- a/lib/libmthread/mutex.c +++ b/lib/libmthread/mutex.c @@ -3,9 +3,9 @@ #include "proto.h" #ifdef MTHREAD_STRICT -PRIVATE struct __mthread_mutex *vm_front, *vm_rear; -FORWARD void mthread_mutex_add(mthread_mutex_t *m); -FORWARD void mthread_mutex_remove(mthread_mutex_t *m); +static struct __mthread_mutex *vm_front, *vm_rear; +static void mthread_mutex_add(mthread_mutex_t *m); +static void mthread_mutex_remove(mthread_mutex_t *m); #else # define mthread_mutex_add(m) ((*m)->mm_magic = MTHREAD_INIT_MAGIC) # define mthread_mutex_remove(m) ((*m)->mm_magic = MTHREAD_NOT_INUSE) @@ -14,7 +14,7 @@ FORWARD void mthread_mutex_remove(mthread_mutex_t *m); /*===========================================================================* * mthread_init_valid_mutexes * *===========================================================================*/ -PUBLIC void mthread_init_valid_mutexes(void) +void mthread_init_valid_mutexes(void) { #ifdef MTHREAD_STRICT /* Initialize list of valid mutexes */ @@ -27,7 +27,7 @@ PUBLIC void mthread_init_valid_mutexes(void) * mthread_mutex_add * *===========================================================================*/ #ifdef MTHREAD_STRICT -PRIVATE void mthread_mutex_add(m) +static void mthread_mutex_add(m) mthread_mutex_t *m; { /* Add mutex to list of valid, initialized mutexes */ @@ -48,7 +48,7 @@ mthread_mutex_t *m; /*===========================================================================* * mthread_mutex_destroy * *===========================================================================*/ -PUBLIC int mthread_mutex_destroy(mutex) +int mthread_mutex_destroy(mutex) mthread_mutex_t *mutex; { /* Invalidate mutex and deallocate resources. */ @@ -87,7 +87,7 @@ mthread_mutex_t *mutex; /*===========================================================================* * mthread_mutex_init * *===========================================================================*/ -PUBLIC int mthread_mutex_init(mutex, mattr) +int mthread_mutex_init(mutex, mattr) mthread_mutex_t *mutex; /* Mutex that is to be initialized */ mthread_mutexattr_t *mattr; /* Mutex attribute */ { @@ -119,7 +119,7 @@ mthread_mutexattr_t *mattr; /* Mutex attribute */ /*===========================================================================* * mthread_mutex_lock * *===========================================================================*/ -PUBLIC int mthread_mutex_lock(mutex) +int mthread_mutex_lock(mutex) mthread_mutex_t *mutex; /* Mutex that is to be locked */ { /* Try to lock this mutex. If already locked, append the current thread to @@ -153,7 +153,7 @@ mthread_mutex_t *mutex; /* Mutex that is to be locked */ * mthread_mutex_remove * *===========================================================================*/ #ifdef MTHREAD_STRICT -PRIVATE void mthread_mutex_remove(m) +static void mthread_mutex_remove(m) mthread_mutex_t *m; { /* Remove mutex from list of valid, initialized mutexes */ @@ -173,7 +173,7 @@ mthread_mutex_t *m; /*===========================================================================* * mthread_mutex_trylock * *===========================================================================*/ -PUBLIC int mthread_mutex_trylock(mutex) +int mthread_mutex_trylock(mutex) mthread_mutex_t *mutex; /* Mutex that is to be locked */ { /* Try to lock this mutex and return OK. If already locked, return error. */ @@ -202,7 +202,7 @@ mthread_mutex_t *mutex; /* Mutex that is to be locked */ /*===========================================================================* * mthread_mutex_unlock * *===========================================================================*/ -PUBLIC int mthread_mutex_unlock(mutex) +int mthread_mutex_unlock(mutex) mthread_mutex_t *mutex; /* Mutex that is to be unlocked */ { /* Unlock a previously locked mutex. If there is a pending lock for this mutex @@ -231,7 +231,7 @@ mthread_mutex_t *mutex; /* Mutex that is to be unlocked */ * mthread_mutex_valid * *===========================================================================*/ #ifdef MTHREAD_STRICT -PUBLIC int mthread_mutex_valid(m) +int mthread_mutex_valid(m) mthread_mutex_t *m; { /* Check to see if mutex is on the list of valid mutexes */ @@ -256,7 +256,7 @@ mthread_mutex_t *m; * mthread_mutex_verify * *===========================================================================*/ #ifdef MDEBUG -PUBLIC int mthread_mutex_verify(void) +int mthread_mutex_verify(void) { /* Return true when no mutexes are in use */ int r = 1; diff --git a/lib/libmthread/queue.c b/lib/libmthread/queue.c index 266c69677..333d5458e 100644 --- a/lib/libmthread/queue.c +++ b/lib/libmthread/queue.c @@ -5,7 +5,7 @@ /*===========================================================================* * mthread_queue_add * *===========================================================================*/ -PUBLIC void mthread_queue_add(queue, thread) +void mthread_queue_add(queue, thread) mthread_queue_t *queue; /* Queue we want thread to append to */ mthread_thread_t thread; { @@ -32,7 +32,7 @@ mthread_thread_t thread; /*===========================================================================* * mthread_queue_init * *===========================================================================*/ -PUBLIC void mthread_queue_init(queue) +void mthread_queue_init(queue) mthread_queue_t *queue; /* Queue that has to be initialized */ { /* Initialize queue to a known state */ @@ -44,7 +44,7 @@ mthread_queue_t *queue; /* Queue that has to be initialized */ /*===========================================================================* * mthread_queue_isempty * *===========================================================================*/ -PUBLIC int mthread_queue_isempty(queue) +int mthread_queue_isempty(queue) mthread_queue_t *queue; { return(queue->mq_head == NULL); @@ -55,7 +55,7 @@ mthread_queue_t *queue; * mthread_dump_queue * *===========================================================================*/ #ifdef MDEBUG -PUBLIC void mthread_dump_queue(queue) +void mthread_dump_queue(queue) mthread_queue_t *queue; { int threshold, count = 0; @@ -90,7 +90,7 @@ mthread_queue_t *queue; /*===========================================================================* * mthread_queue_remove * *===========================================================================*/ -PUBLIC mthread_thread_t mthread_queue_remove(queue) +mthread_thread_t mthread_queue_remove(queue) mthread_queue_t *queue; /* Queue we want a thread from */ { /* Get the first thread in this queue, if there is one. */ diff --git a/lib/libmthread/rwlock.c b/lib/libmthread/rwlock.c index e223828f7..f06c41cb6 100644 --- a/lib/libmthread/rwlock.c +++ b/lib/libmthread/rwlock.c @@ -4,7 +4,7 @@ /*===========================================================================* * mthread_rwlock_init * *===========================================================================*/ -PUBLIC int mthread_rwlock_init(rwlock) +int mthread_rwlock_init(rwlock) mthread_rwlock_t *rwlock; /* The rwlock to be initialized */ { /* Initialize a readers/writer lock. */ @@ -30,7 +30,7 @@ mthread_rwlock_t *rwlock; /* The rwlock to be initialized */ /*===========================================================================* * mthread_rwlock_destroy * *===========================================================================*/ -PUBLIC int mthread_rwlock_destroy(rwlock) +int mthread_rwlock_destroy(rwlock) mthread_rwlock_t *rwlock; /* The rwlock to be destroyed */ { /* Destroy a readers/writer lock. */ @@ -52,7 +52,7 @@ mthread_rwlock_t *rwlock; /* The rwlock to be destroyed */ /*===========================================================================* * mthread_rwlock_rdlock * *===========================================================================*/ -PUBLIC int mthread_rwlock_rdlock(rwlock) +int mthread_rwlock_rdlock(rwlock) mthread_rwlock_t *rwlock; /* The rwlock to be read locked */ { /* Acquire a reader lock. */ @@ -77,7 +77,7 @@ mthread_rwlock_t *rwlock; /* The rwlock to be read locked */ /*===========================================================================* * mthread_rwlock_wrlock * *===========================================================================*/ -PUBLIC int mthread_rwlock_wrlock(rwlock) +int mthread_rwlock_wrlock(rwlock) mthread_rwlock_t *rwlock; /* The rwlock to be write locked */ { /* Acquire a writer lock. */ @@ -104,7 +104,7 @@ mthread_rwlock_t *rwlock; /* The rwlock to be write locked */ /*===========================================================================* * mthread_rwlock_unlock * *===========================================================================*/ -PUBLIC int mthread_rwlock_unlock(rwlock) +int mthread_rwlock_unlock(rwlock) mthread_rwlock_t *rwlock; /* The rwlock to be unlocked */ { /* Release a lock. */ diff --git a/lib/libmthread/scheduler.c b/lib/libmthread/scheduler.c index beb4ddeb8..9aa6310c0 100644 --- a/lib/libmthread/scheduler.c +++ b/lib/libmthread/scheduler.c @@ -7,12 +7,12 @@ #define OLD_CTX &(threads[old_thread]->m_context) #define CURRENT_CTX &(threads[current_thread]->m_context) #define CURRENT_STATE threads[current_thread]->m_state -PRIVATE int yield_all; +static int yield_all; /*===========================================================================* * mthread_getcontext * *===========================================================================*/ -PUBLIC int mthread_getcontext(ctx) +int mthread_getcontext(ctx) ucontext_t *ctx; { /* Retrieve this process' current state.*/ @@ -28,7 +28,7 @@ ucontext_t *ctx; /*===========================================================================* * mthread_schedule * *===========================================================================*/ -PUBLIC void mthread_schedule(void) +void mthread_schedule(void) { /* Pick a new thread to run and run it. In practice, this involves taking the * first thread off the (FIFO) run queue and resuming that thread. @@ -80,7 +80,7 @@ PUBLIC void mthread_schedule(void) /*===========================================================================* * mthread_init_scheduler * *===========================================================================*/ -PUBLIC void mthread_init_scheduler(void) +void mthread_init_scheduler(void) { /* Initialize the scheduler */ mthread_queue_init(&run_queue); @@ -92,7 +92,7 @@ PUBLIC void mthread_init_scheduler(void) /*===========================================================================* * mthread_suspend * *===========================================================================*/ -PUBLIC void mthread_suspend(state) +void mthread_suspend(state) mthread_state_t state; { /* Stop the current thread from running. There can be multiple reasons for @@ -131,7 +131,7 @@ mthread_state_t state; /*===========================================================================* * mthread_unsuspend * *===========================================================================*/ -PUBLIC void mthread_unsuspend(thread) +void mthread_unsuspend(thread) mthread_thread_t thread; /* Thread to make runnable */ { /* Mark the state of a thread runnable and add it to the run queue */ @@ -148,7 +148,7 @@ mthread_thread_t thread; /* Thread to make runnable */ /*===========================================================================* * mthread_yield * *===========================================================================*/ -PUBLIC int mthread_yield(void) +int mthread_yield(void) { /* Defer further execution of the current thread and let another thread run. */ mthread_tcb_t *tcb; @@ -186,7 +186,7 @@ PUBLIC int mthread_yield(void) /*===========================================================================* * mthread_yield_all * *===========================================================================*/ -PUBLIC void mthread_yield_all(void) +void mthread_yield_all(void) { /* Yield until there are no more runnable threads left. Two threads calling * this function will lead to a deadlock. diff --git a/lib/libnetdriver/netdriver.c b/lib/libnetdriver/netdriver.c index 6d5cc3730..8b49017d4 100644 --- a/lib/libnetdriver/netdriver.c +++ b/lib/libnetdriver/netdriver.c @@ -14,12 +14,12 @@ #include #include -PRIVATE int conf_expected = TRUE; +static int conf_expected = TRUE; /*===========================================================================* * netdriver_announce * *===========================================================================*/ -PUBLIC void netdriver_announce() +void netdriver_announce() { /* Announce we are up after a fresh start or restart. */ int r; @@ -44,7 +44,7 @@ PUBLIC void netdriver_announce() /*===========================================================================* * netdriver_receive * *===========================================================================*/ -PUBLIC int netdriver_receive(src, m_ptr, status_ptr) +int netdriver_receive(src, m_ptr, status_ptr) endpoint_t src; message *m_ptr; int *status_ptr; diff --git a/lib/libpuffs/inode.c b/lib/libpuffs/inode.c index 510260be7..27b1ce13a 100644 --- a/lib/libpuffs/inode.c +++ b/lib/libpuffs/inode.c @@ -31,7 +31,7 @@ void release_node(struct puffs_usermount *pu, struct puffs_node *pn) /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode(void) +int fs_putnode(void) { /* Find the pnode specified by the request message and decrease its counter. * Release unused pnode. diff --git a/lib/libpuffs/link.c b/lib/libpuffs/link.c index 05c3034a5..e63599fcc 100644 --- a/lib/libpuffs/link.c +++ b/lib/libpuffs/link.c @@ -12,7 +12,7 @@ /*===========================================================================* * fs_ftrunc * *===========================================================================*/ -PUBLIC int fs_ftrunc(void) +int fs_ftrunc(void) { int r; struct puffs_node *pn; @@ -68,7 +68,7 @@ PUBLIC int fs_ftrunc(void) /*===========================================================================* * fs_link * *===========================================================================*/ -PUBLIC int fs_link() +int fs_link() { /* Perform the link(name1, name2) system call. */ @@ -152,7 +152,7 @@ PUBLIC int fs_link() /*===========================================================================* * fs_rdlink * *===========================================================================*/ -PUBLIC int fs_rdlink() +int fs_rdlink() { register int r; /* return value */ size_t copylen; @@ -193,7 +193,7 @@ PUBLIC int fs_rdlink() /*===========================================================================* * fs_rename * *===========================================================================*/ -PUBLIC int fs_rename() +int fs_rename() { /* Perform the rename(name1, name2) system call. */ struct puffs_node *old_dirp, *old_ip; /* ptrs to old dir, file pnodes */ @@ -385,15 +385,15 @@ rename_out: return(r); } -FORWARD int remove_dir(struct puffs_node *pn_dir, struct puffs_node *pn, +static int remove_dir(struct puffs_node *pn_dir, struct puffs_node *pn, struct puffs_cn *pcn); -FORWARD int unlink_file(struct puffs_node *dirp, struct puffs_node *pn, +static int unlink_file(struct puffs_node *dirp, struct puffs_node *pn, struct puffs_cn *pcn); /*===========================================================================* * fs_unlink * *===========================================================================*/ -PUBLIC int fs_unlink() +int fs_unlink() { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -467,7 +467,7 @@ PUBLIC int fs_unlink() /*===========================================================================* * remove_dir * *===========================================================================*/ -PRIVATE int remove_dir(pn_dir, pn, pcn) +static int remove_dir(pn_dir, pn, pcn) struct puffs_node *pn_dir; /* parent directory */ struct puffs_node *pn; /* directory to be removed */ struct puffs_cn *pcn; /* Name, creads of directory */ @@ -525,7 +525,7 @@ struct puffs_cn *pcn; /* Name, creads of directory */ /*===========================================================================* * unlink_file * *===========================================================================*/ -PRIVATE int unlink_file(dirp, pn, pcn) +static int unlink_file(dirp, pn, pcn) struct puffs_node *dirp; /* parent directory of file */ struct puffs_node *pn; /* pnode of file, may be NULL too. */ struct puffs_cn *pcn; /* Name, creads of file */ diff --git a/lib/libpuffs/misc.c b/lib/libpuffs/misc.c index 04f452ebd..4de047ee7 100644 --- a/lib/libpuffs/misc.c +++ b/lib/libpuffs/misc.c @@ -12,7 +12,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -PUBLIC int fs_sync() +int fs_sync() { /* Perform the sync() system call. Flush all the tables. * The order in which the various tables are flushed is critical. @@ -35,7 +35,7 @@ PUBLIC int fs_sync() /*===========================================================================* * fs_flush * *===========================================================================*/ -PUBLIC int fs_flush() +int fs_flush() { /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. @@ -56,7 +56,7 @@ PUBLIC int fs_flush() /*===========================================================================* * fs_new_driver * *===========================================================================*/ -PUBLIC int fs_new_driver(void) +int fs_new_driver(void) { /* Do not do anything. */ diff --git a/lib/libpuffs/mount.c b/lib/libpuffs/mount.c index 3173198f3..beaa2533b 100644 --- a/lib/libpuffs/mount.c +++ b/lib/libpuffs/mount.c @@ -15,7 +15,7 @@ /*===========================================================================* * fs_readsuper * *===========================================================================*/ -PUBLIC int fs_readsuper() +int fs_readsuper() { struct vattr *root_va; @@ -42,7 +42,7 @@ PUBLIC int fs_readsuper() /*===========================================================================* * fs_mountpoint * *===========================================================================*/ -PUBLIC int fs_mountpoint() +int fs_mountpoint() { /* This function looks up the mount point, it checks the condition whether * the partition can be mounted on the pnode or not. @@ -75,7 +75,7 @@ PUBLIC int fs_mountpoint() /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount() +int fs_unmount() { int error; diff --git a/lib/libpuffs/open.c b/lib/libpuffs/open.c index 1ff9834e5..c9a64bcca 100644 --- a/lib/libpuffs/open.c +++ b/lib/libpuffs/open.c @@ -16,7 +16,7 @@ /*===========================================================================* * fs_create * *===========================================================================*/ -PUBLIC int fs_create() +int fs_create() { int r; struct puffs_node *pn_dir; @@ -114,7 +114,7 @@ PUBLIC int fs_create() /*===========================================================================* * fs_mknod * *===========================================================================*/ -PUBLIC int fs_mknod() +int fs_mknod() { int r; struct puffs_node *pn_dir; @@ -197,7 +197,7 @@ PUBLIC int fs_mknod() /*===========================================================================* * fs_mkdir * *===========================================================================*/ -PUBLIC int fs_mkdir() +int fs_mkdir() { int r; struct puffs_node *pn_dir; @@ -280,7 +280,7 @@ PUBLIC int fs_mkdir() /*===========================================================================* * fs_slink * *===========================================================================*/ -PUBLIC int fs_slink() +int fs_slink() { int r; struct pnode *pn; /* pnode containing symbolic link */ @@ -372,7 +372,7 @@ PUBLIC int fs_slink() /*===========================================================================* * fs_inhibread * *===========================================================================*/ -PUBLIC int fs_inhibread() +int fs_inhibread() { return(OK); } diff --git a/lib/libpuffs/path.c b/lib/libpuffs/path.c index 323b8c613..e4a2fd855 100644 --- a/lib/libpuffs/path.c +++ b/lib/libpuffs/path.c @@ -25,17 +25,17 @@ #include "puffs.h" #include "puffs_priv.h" -PUBLIC char dot2[3] = ".."; /* permissions for . and .. */ +char dot2[3] = ".."; /* permissions for . and .. */ -FORWARD char *get_name(char *name, char string[NAME_MAX+1]); -FORWARD int ltraverse(struct puffs_node *pn, char *suffix); -FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct +static char *get_name(char *name, char string[NAME_MAX+1]); +static int ltraverse(struct puffs_node *pn, char *suffix); +static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct puffs_node **res_inop, size_t *offsetp, int *symlinkp); /*===========================================================================* * fs_lookup * *===========================================================================*/ -PUBLIC int fs_lookup() +int fs_lookup() { cp_grant_id_t grant; int r, r1, flags, symlinks; @@ -128,7 +128,7 @@ PUBLIC int fs_lookup() /*===========================================================================* * parse_path * *===========================================================================*/ -PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) +static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) ino_t dir_ino; ino_t root_ino; int flags; @@ -279,7 +279,7 @@ int *symlinkp; /*===========================================================================* * ltraverse * *===========================================================================*/ -PRIVATE int ltraverse(pn, suffix) +static int ltraverse(pn, suffix) register struct puffs_node *pn;/* symbolic link */ char *suffix; /* current remaining path. Has to point in the * user_path buffer @@ -355,7 +355,7 @@ char *suffix; /* current remaining path. Has to point in the /*===========================================================================* * advance * *===========================================================================*/ -PUBLIC struct puffs_node *advance(pn_dir, string, chk_perm) +struct puffs_node *advance(pn_dir, string, chk_perm) struct puffs_node *pn_dir; /* pnode for directory to be searched */ char string[NAME_MAX + 1]; /* component name to look for */ int chk_perm; /* check permissions when string is looked up*/ @@ -501,7 +501,7 @@ int chk_perm; /* check permissions when string is looked up*/ /*===========================================================================* * get_name * *===========================================================================*/ -PRIVATE char *get_name(path_name, string) +static char *get_name(path_name, string) char *path_name; /* path name to parse */ char string[NAME_MAX+1]; /* component extracted from 'old_name' */ { diff --git a/lib/libpuffs/protect.c b/lib/libpuffs/protect.c index b39711ea2..f4abe5b11 100644 --- a/lib/libpuffs/protect.c +++ b/lib/libpuffs/protect.c @@ -8,13 +8,13 @@ #include "puffs.h" #include "puffs_priv.h" -FORWARD int in_group(gid_t grp); +static int in_group(gid_t grp); /*===========================================================================* * fs_chmod * *===========================================================================*/ -PUBLIC int fs_chmod() +int fs_chmod() { /* Perform the chmod(name, mode) system call. */ struct puffs_node *pn; @@ -49,7 +49,7 @@ PUBLIC int fs_chmod() /*===========================================================================* * fs_chown * *===========================================================================*/ -PUBLIC int fs_chown() +int fs_chown() { struct puffs_node *pn; struct vattr va; @@ -81,7 +81,7 @@ PUBLIC int fs_chown() /*===========================================================================* * forbidden * *===========================================================================*/ -PUBLIC int forbidden(register struct puffs_node *pn, mode_t access_desired) +int forbidden(register struct puffs_node *pn, mode_t access_desired) { /* Given a pointer to an pnode, 'pn', and the access desired, determine * if the access is allowed, and if not why not. The routine looks up the @@ -132,7 +132,7 @@ PUBLIC int forbidden(register struct puffs_node *pn, mode_t access_desired) /*===========================================================================* * in_group * *===========================================================================*/ -PRIVATE int in_group(gid_t grp) +static int in_group(gid_t grp) { int i; for(i = 0; i < credentials.vu_ngroups; i++) diff --git a/lib/libpuffs/puffs.c b/lib/libpuffs/puffs.c index c38f21822..e6eaea70c 100644 --- a/lib/libpuffs/puffs.c +++ b/lib/libpuffs/puffs.c @@ -67,13 +67,13 @@ pthread_mutex_t pu_lock = PTHREAD_MUTEX_INITIALIZER; /* Declare some local functions. */ -FORWARD void get_work(message *m_in); -FORWARD void reply(endpoint_t who, message *m_out); +static void get_work(message *m_in); +static void reply(endpoint_t who, message *m_out); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); EXTERN int env_argc; EXTERN char **env_argv; @@ -671,7 +671,7 @@ puffs_mainloop(struct puffs_usermount *pu) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -689,7 +689,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the Minix file server. */ SELF_E = getprocnr(); @@ -699,7 +699,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -724,7 +724,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_in) +static void get_work(m_in) message *m_in; /* pointer to message */ { int r, srcok = 0; @@ -761,7 +761,7 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply( +static void reply( endpoint_t who, message *m_out /* report result */ ) diff --git a/lib/libpuffs/read.c b/lib/libpuffs/read.c index 4c4516b0f..6f39e3d2e 100644 --- a/lib/libpuffs/read.c +++ b/lib/libpuffs/read.c @@ -18,16 +18,16 @@ #define GETDENTS_BUFSIZ 4096 -PRIVATE char getdents_buf[GETDENTS_BUFSIZ]; +static char getdents_buf[GETDENTS_BUFSIZ]; #define RW_BUFSIZ (128 << 10) -PRIVATE char rw_buf[RW_BUFSIZ]; +static char rw_buf[RW_BUFSIZ]; /*===========================================================================* * fs_readwrite * *===========================================================================*/ -PUBLIC int fs_readwrite(void) +int fs_readwrite(void) { int r = OK, rw_flag; cp_grant_id_t gid; @@ -108,7 +108,7 @@ PUBLIC int fs_readwrite(void) /*===========================================================================* * fs_breadwrite * *===========================================================================*/ -PUBLIC int fs_breadwrite(void) +int fs_breadwrite(void) { /* We do not support breads/writes */ panic("bread write requested, but FS doesn't support it!\n"); @@ -119,7 +119,7 @@ PUBLIC int fs_breadwrite(void) /*===========================================================================* * fs_getdents * *===========================================================================*/ -PUBLIC int fs_getdents(void) +int fs_getdents(void) { int r; register struct puffs_node *pn; diff --git a/lib/libpuffs/stadir.c b/lib/libpuffs/stadir.c index ecea24c34..2dbd4ce08 100644 --- a/lib/libpuffs/stadir.c +++ b/lib/libpuffs/stadir.c @@ -15,7 +15,7 @@ /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_fstatfs() +int fs_fstatfs() { int r; struct statvfs st_vfs; @@ -39,7 +39,7 @@ PUBLIC int fs_fstatfs() /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat() +int fs_stat() { register int r; /* return value */ register struct puffs_node *pn; /* target pnode */ @@ -97,7 +97,7 @@ PUBLIC int fs_stat() /*===========================================================================* * fs_statvfs * *===========================================================================*/ -PUBLIC int fs_statvfs() +int fs_statvfs() { int r; struct statvfs st; diff --git a/lib/libpuffs/table.c b/lib/libpuffs/table.c index f10244f6b..50f5bddb6 100644 --- a/lib/libpuffs/table.c +++ b/lib/libpuffs/table.c @@ -9,7 +9,7 @@ #include "fs.h" -PUBLIC int (*fs_call_vec[])(void) = { +int (*fs_call_vec[])(void) = { no_sys, /* 0 not used */ no_sys, /* 1 */ /* Was: fs_getnode */ fs_putnode, /* 2 */ diff --git a/lib/libpuffs/time.c b/lib/libpuffs/time.c index 26b1b3cc0..df986277f 100644 --- a/lib/libpuffs/time.c +++ b/lib/libpuffs/time.c @@ -14,7 +14,7 @@ /*===========================================================================* * fs_utime * *===========================================================================*/ -PUBLIC int fs_utime() +int fs_utime() { struct puffs_node *pn; struct vattr va; diff --git a/lib/libpuffs/utility.c b/lib/libpuffs/utility.c index 5b49869e2..0985c587d 100644 --- a/lib/libpuffs/utility.c +++ b/lib/libpuffs/utility.c @@ -13,7 +13,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* Somebody has used an illegal system call number */ lpuffs_debug("no_sys: invalid call %d\n", req_nr); @@ -24,7 +24,7 @@ PUBLIC int no_sys() /*===========================================================================* * mfs_nul * *===========================================================================*/ -PUBLIC void mfs_nul_f(const char *file, int line, char *str, unsigned int len, +void mfs_nul_f(const char *file, int line, char *str, unsigned int len, unsigned int maxlen) { if (len < maxlen && str[len-1] != '\0') { @@ -37,7 +37,7 @@ PUBLIC void mfs_nul_f(const char *file, int line, char *str, unsigned int len, /*===========================================================================* * clock_time * *===========================================================================*/ -PUBLIC time_t clock_time() +time_t clock_time() { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant @@ -58,7 +58,7 @@ PUBLIC time_t clock_time() /*===========================================================================* * update_times * *===========================================================================*/ -PUBLIC int update_times(struct puffs_node *pn, int flags, time_t t) +int update_times(struct puffs_node *pn, int flags, time_t t) { int r; struct vattr va; @@ -103,7 +103,7 @@ PUBLIC int update_times(struct puffs_node *pn, int flags, time_t t) /*===========================================================================* * lpuffs_debug * *===========================================================================*/ -PUBLIC void lpuffs_debug(const char *format, ...) +void lpuffs_debug(const char *format, ...) { char buffer[256]; va_list args; diff --git a/lib/libsys/asynsend.c b/lib/libsys/asynsend.c index 3893572b6..f5f8957ce 100644 --- a/lib/libsys/asynsend.c +++ b/lib/libsys/asynsend.c @@ -18,14 +18,14 @@ #include #define ASYN_NR (2*_NR_PROCS) -PRIVATE asynmsg_t msgtable[ASYN_NR]; -PRIVATE int first_slot = 0, next_slot = 0; -PRIVATE int initialized = 0; +static asynmsg_t msgtable[ASYN_NR]; +static int first_slot = 0, next_slot = 0; +static int initialized = 0; /*===========================================================================* * asynsend3 * *===========================================================================*/ -PUBLIC int asynsend3(dst, mp, fl) +int asynsend3(dst, mp, fl) endpoint_t dst; message *mp; int fl; @@ -147,7 +147,7 @@ int fl; /*===========================================================================* * asyn_geterror * *===========================================================================*/ -PUBLIC int asyn_geterror(endpoint_t *dst, message *msg, int *err) +int asyn_geterror(endpoint_t *dst, message *msg, int *err) { int src_ind, flags, result; diff --git a/lib/libsys/ds.c b/lib/libsys/ds.c index 753c8f8a3..fc4245664 100644 --- a/lib/libsys/ds.c +++ b/lib/libsys/ds.c @@ -6,7 +6,7 @@ static message m; -PRIVATE int do_invoke_ds(int type, const char *ds_name) +static int do_invoke_ds(int type, const char *ds_name) { cp_grant_id_t g_key; size_t len_key; diff --git a/lib/libsys/env_get_prm.c b/lib/libsys/env_get_prm.c index 3272f09a4..da2031bee 100644 --- a/lib/libsys/env_get_prm.c +++ b/lib/libsys/env_get_prm.c @@ -1,15 +1,15 @@ #include "sysutil.h" #include -PUBLIC int env_argc = 0; -PUBLIC char **env_argv = NULL; +int env_argc = 0; +char **env_argv = NULL; -FORWARD char *find_key(const char *params, const char *key); +static char *find_key(const char *params, const char *key); /*===========================================================================* * env_setargs * *===========================================================================*/ -PUBLIC void env_setargs(arg_c, arg_v) +void env_setargs(arg_c, arg_v) int arg_c; char *arg_v[]; { @@ -20,7 +20,7 @@ char *arg_v[]; /*===========================================================================* * env_get_param * *===========================================================================*/ -PUBLIC int env_get_param(key, value, max_len) +int env_get_param(key, value, max_len) char *key; /* which key to look up */ char *value; /* where to store value */ int max_len; /* maximum length of value */ @@ -80,7 +80,7 @@ int max_len; /* maximum length of value */ /*==========================================================================* * find_key * *==========================================================================*/ -PRIVATE char *find_key(params,name) +static char *find_key(params,name) const char *params; const char *name; { diff --git a/lib/libsys/env_panic.c b/lib/libsys/env_panic.c index d487cc5d0..a1622fef4 100644 --- a/lib/libsys/env_panic.c +++ b/lib/libsys/env_panic.c @@ -4,7 +4,7 @@ /*=========================================================================* * env_panic * *=========================================================================*/ -PUBLIC void env_panic(key) +void env_panic(key) char *key; /* environment variable whose value is bogus */ { static char value[EP_BUF_SIZE] = ""; diff --git a/lib/libsys/env_parse.c b/lib/libsys/env_parse.c index fbe6d4222..b48d763b5 100644 --- a/lib/libsys/env_parse.c +++ b/lib/libsys/env_parse.c @@ -7,7 +7,7 @@ /*=========================================================================* * env_parse * *=========================================================================*/ -PUBLIC int env_parse(env, fmt, field, param, min, max) +int env_parse(env, fmt, field, param, min, max) char *env; /* environment variable to inspect */ char *fmt; /* template to parse it with */ int field; /* field number of value to return */ @@ -93,7 +93,7 @@ badenv: * env_memory_parse * *=========================================================================*/ -PUBLIC int env_memory_parse(mem_chunks, maxchunks) +int env_memory_parse(mem_chunks, maxchunks) struct memory *mem_chunks; /* where to store the memory bits */ int maxchunks; /* how many were found */ { diff --git a/lib/libsys/env_prefix.c b/lib/libsys/env_prefix.c index b76232aab..5ef297917 100644 --- a/lib/libsys/env_prefix.c +++ b/lib/libsys/env_prefix.c @@ -5,7 +5,7 @@ /*=========================================================================* * env_prefix * *=========================================================================*/ -PUBLIC int env_prefix(env, prefix) +int env_prefix(env, prefix) char *env; /* environment variable to inspect */ char *prefix; /* prefix to test for */ { diff --git a/lib/libsys/fkey_ctl.c b/lib/libsys/fkey_ctl.c index 38ea0f209..afe63c140 100644 --- a/lib/libsys/fkey_ctl.c +++ b/lib/libsys/fkey_ctl.c @@ -3,7 +3,7 @@ /*===========================================================================* * fkey_ctl * *===========================================================================*/ -PUBLIC int fkey_ctl(request, fkeys, sfkeys) +int fkey_ctl(request, fkeys, sfkeys) int request; /* request to perform */ int *fkeys; /* bit masks for F1-F12 keys */ int *sfkeys; /* bit masks for Shift F1-F12 keys */ diff --git a/lib/libsys/get_randomness.c b/lib/libsys/get_randomness.c index 421618570..720f67472 100644 --- a/lib/libsys/get_randomness.c +++ b/lib/libsys/get_randomness.c @@ -11,7 +11,7 @@ /*===========================================================================* * get_randomness * *===========================================================================*/ -PUBLIC void get_randomness(rand, source) +void get_randomness(rand, source) struct k_randomness *rand; int source; { diff --git a/lib/libsys/getsysinfo.c b/lib/libsys/getsysinfo.c index 79eacb2fe..bb841b61c 100644 --- a/lib/libsys/getsysinfo.c +++ b/lib/libsys/getsysinfo.c @@ -3,7 +3,7 @@ #include #include -PUBLIC int getsysinfo( +int getsysinfo( endpoint_t who, /* from whom to request info */ int what, /* what information is requested */ void *where, /* where to put it */ diff --git a/lib/libsys/getuptime.c b/lib/libsys/getuptime.c index 481826224..24d2eb5e6 100644 --- a/lib/libsys/getuptime.c +++ b/lib/libsys/getuptime.c @@ -3,7 +3,7 @@ /*===========================================================================* * getuptime * *===========================================================================*/ -PUBLIC int getuptime(ticks) +int getuptime(ticks) clock_t *ticks; /* uptime in ticks */ { message m; diff --git a/lib/libsys/getuptime2.c b/lib/libsys/getuptime2.c index ad7a0497e..252664602 100644 --- a/lib/libsys/getuptime2.c +++ b/lib/libsys/getuptime2.c @@ -3,7 +3,7 @@ /*===========================================================================* * getuptime2 * *===========================================================================*/ -PUBLIC int getuptime2(ticks, boottime) +int getuptime2(ticks, boottime) clock_t *ticks; /* uptime in ticks */ time_t *boottime; { diff --git a/lib/libsys/input.c b/lib/libsys/input.c index 6143d2492..abb4639a3 100644 --- a/lib/libsys/input.c +++ b/lib/libsys/input.c @@ -3,7 +3,7 @@ /***************************************************************************** * tty_inject_event * *****************************************************************************/ -PUBLIC int tty_inject_event(type, code, val) +int tty_inject_event(type, code, val) int type; int code; int val; diff --git a/lib/libsys/kernel_call.c b/lib/libsys/kernel_call.c index c26a01350..264547325 100644 --- a/lib/libsys/kernel_call.c +++ b/lib/libsys/kernel_call.c @@ -1,7 +1,7 @@ #include #include -PUBLIC int _kernel_call(int syscallnr, message *msgptr) +int _kernel_call(int syscallnr, message *msgptr) { msgptr->m_type = syscallnr; _do_kernel_call(msgptr); diff --git a/lib/libsys/optset.c b/lib/libsys/optset.c index 32d8dad49..fe9bedaea 100644 --- a/lib/libsys/optset.c +++ b/lib/libsys/optset.c @@ -19,13 +19,13 @@ #include #include -FORWARD void optset_parse_entry(struct optset *entry, char *ptr, int +static void optset_parse_entry(struct optset *entry, char *ptr, int len); /*===========================================================================* * optset_parse_entry * *===========================================================================*/ -PRIVATE void optset_parse_entry(entry, ptr, len) +static void optset_parse_entry(entry, ptr, len) struct optset *entry; char *ptr; int len; @@ -68,7 +68,7 @@ int len; /*===========================================================================* * optset_parse * *===========================================================================*/ -PUBLIC void optset_parse(table, string) +void optset_parse(table, string) struct optset *table; char *string; { diff --git a/lib/libsys/panic.c b/lib/libsys/panic.c index 00e281a01..711859bf9 100644 --- a/lib/libsys/panic.c +++ b/lib/libsys/panic.c @@ -9,7 +9,7 @@ /*===========================================================================* * panic * *===========================================================================*/ -PUBLIC void panic(const char *fmt, ...) +void panic(const char *fmt, ...) { /* Something awful has happened. Panics are caused when an internal * inconsistency is detected, e.g., a programming error or illegal diff --git a/lib/libsys/pci_attr_r16.c b/lib/libsys/pci_attr_r16.c index e040c6bfe..c475fba7c 100644 --- a/lib/libsys/pci_attr_r16.c +++ b/lib/libsys/pci_attr_r16.c @@ -9,7 +9,7 @@ pci_attr_r16.c /*===========================================================================* * pci_attr_r16 * *===========================================================================*/ -PUBLIC u16_t pci_attr_r16(devind, port) +u16_t pci_attr_r16(devind, port) int devind; int port; { diff --git a/lib/libsys/pci_attr_r32.c b/lib/libsys/pci_attr_r32.c index ef3b23af9..55b91a538 100644 --- a/lib/libsys/pci_attr_r32.c +++ b/lib/libsys/pci_attr_r32.c @@ -9,7 +9,7 @@ pci_attr_r32.c /*===========================================================================* * pci_attr_r32 * *===========================================================================*/ -PUBLIC u32_t pci_attr_r32(devind, port) +u32_t pci_attr_r32(devind, port) int devind; int port; { diff --git a/lib/libsys/pci_attr_r8.c b/lib/libsys/pci_attr_r8.c index 4ee072d17..cc890b658 100644 --- a/lib/libsys/pci_attr_r8.c +++ b/lib/libsys/pci_attr_r8.c @@ -9,7 +9,7 @@ pci_attr_r8.c /*===========================================================================* * pci_attr_r8 * *===========================================================================*/ -PUBLIC u8_t pci_attr_r8(devind, port) +u8_t pci_attr_r8(devind, port) int devind; int port; { diff --git a/lib/libsys/pci_attr_w16.c b/lib/libsys/pci_attr_w16.c index c371c9e70..8296544be 100644 --- a/lib/libsys/pci_attr_w16.c +++ b/lib/libsys/pci_attr_w16.c @@ -9,7 +9,7 @@ pci_attr_w16.c /*===========================================================================* * pci_attr_w16 * *===========================================================================*/ -PUBLIC void pci_attr_w16(int devind, int port, u16_t value) +void pci_attr_w16(int devind, int port, u16_t value) { int r; message m; diff --git a/lib/libsys/pci_attr_w32.c b/lib/libsys/pci_attr_w32.c index 491b0b15d..240cca358 100644 --- a/lib/libsys/pci_attr_w32.c +++ b/lib/libsys/pci_attr_w32.c @@ -9,7 +9,7 @@ pci_attr_w32.c /*===========================================================================* * pci_attr_w32 * *===========================================================================*/ -PUBLIC void pci_attr_w32(int devind, int port, u32_t value) +void pci_attr_w32(int devind, int port, u32_t value) { int r; message m; diff --git a/lib/libsys/pci_attr_w8.c b/lib/libsys/pci_attr_w8.c index 066fffad9..eb67e6bd8 100644 --- a/lib/libsys/pci_attr_w8.c +++ b/lib/libsys/pci_attr_w8.c @@ -9,7 +9,7 @@ pci_attr_w8.c /*===========================================================================* * pci_attr_w8 * *===========================================================================*/ -PUBLIC void pci_attr_w8(int devind, int port, u8_t value) +void pci_attr_w8(int devind, int port, u8_t value) { int r; message m; diff --git a/lib/libsys/pci_del_acl.c b/lib/libsys/pci_del_acl.c index 8ac893594..caab03446 100644 --- a/lib/libsys/pci_del_acl.c +++ b/lib/libsys/pci_del_acl.c @@ -12,7 +12,7 @@ pci_del_acl.c /*===========================================================================* * pci_del_acl * *===========================================================================*/ -PUBLIC int pci_del_acl(proc_ep) +int pci_del_acl(proc_ep) endpoint_t proc_ep; { int r; diff --git a/lib/libsys/pci_dev_name.c b/lib/libsys/pci_dev_name.c index b4dfb1ba1..ba9e9afd7 100644 --- a/lib/libsys/pci_dev_name.c +++ b/lib/libsys/pci_dev_name.c @@ -9,7 +9,7 @@ pci_dev_name.c /*===========================================================================* * pci_dev_name * *===========================================================================*/ -PUBLIC char *pci_dev_name(u16_t vid, u16_t did) +char *pci_dev_name(u16_t vid, u16_t did) { static char name[80]; /* We need a better interface for this */ diff --git a/lib/libsys/pci_find_dev.c b/lib/libsys/pci_find_dev.c index 6b04bad3e..06388a292 100644 --- a/lib/libsys/pci_find_dev.c +++ b/lib/libsys/pci_find_dev.c @@ -9,7 +9,7 @@ pci_find_dev.c /*===========================================================================* * pci_find_dev * *===========================================================================*/ -PUBLIC int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) +int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp) { int r; message m; diff --git a/lib/libsys/pci_first_dev.c b/lib/libsys/pci_first_dev.c index 9937c278a..8449cfccc 100644 --- a/lib/libsys/pci_first_dev.c +++ b/lib/libsys/pci_first_dev.c @@ -9,7 +9,7 @@ pci_first_dev.c /*===========================================================================* * pci_first_dev * *===========================================================================*/ -PUBLIC int pci_first_dev(devindp, vidp, didp) +int pci_first_dev(devindp, vidp, didp) int *devindp; u16_t *vidp; u16_t *didp; diff --git a/lib/libsys/pci_get_bar.c b/lib/libsys/pci_get_bar.c index 6d977f9c7..d31553dae 100644 --- a/lib/libsys/pci_get_bar.c +++ b/lib/libsys/pci_get_bar.c @@ -9,7 +9,7 @@ pci_get_bar.c /*===========================================================================* * pci_get_bar * *===========================================================================*/ -PUBLIC int pci_get_bar(devind, port, base, size, ioflag) +int pci_get_bar(devind, port, base, size, ioflag) int devind; int port; u32_t *base; diff --git a/lib/libsys/pci_ids.c b/lib/libsys/pci_ids.c index 910db54af..8e9b08454 100644 --- a/lib/libsys/pci_ids.c +++ b/lib/libsys/pci_ids.c @@ -9,7 +9,7 @@ pci_ids.c /*===========================================================================* * pci_ids * *===========================================================================*/ -PUBLIC void pci_ids(devind, vidp, didp) +void pci_ids(devind, vidp, didp) int devind; u16_t *vidp; u16_t *didp; diff --git a/lib/libsys/pci_init.c b/lib/libsys/pci_init.c index d7f79915f..d170a4b39 100644 --- a/lib/libsys/pci_init.c +++ b/lib/libsys/pci_init.c @@ -11,7 +11,7 @@ endpoint_t pci_procnr= ANY; /*===========================================================================* * pci_init * *===========================================================================*/ -PUBLIC void pci_init(void) +void pci_init(void) { int r; message m; diff --git a/lib/libsys/pci_next_dev.c b/lib/libsys/pci_next_dev.c index 5bd989510..6fb74595a 100644 --- a/lib/libsys/pci_next_dev.c +++ b/lib/libsys/pci_next_dev.c @@ -9,7 +9,7 @@ pci_next_dev.c /*===========================================================================* * pci_next_dev * *===========================================================================*/ -PUBLIC int pci_next_dev(devindp, vidp, didp) +int pci_next_dev(devindp, vidp, didp) int *devindp; u16_t *vidp; u16_t *didp; diff --git a/lib/libsys/pci_rescan_bus.c b/lib/libsys/pci_rescan_bus.c index fa3f18001..933055cfe 100644 --- a/lib/libsys/pci_rescan_bus.c +++ b/lib/libsys/pci_rescan_bus.c @@ -9,7 +9,7 @@ pci_rescan_bus.c /*===========================================================================* * pci_rescan_bus * *===========================================================================*/ -PUBLIC void pci_rescan_bus(u8_t busnr) +void pci_rescan_bus(u8_t busnr) { int r; message m; diff --git a/lib/libsys/pci_reserve.c b/lib/libsys/pci_reserve.c index 493b918a7..4cdc2da10 100644 --- a/lib/libsys/pci_reserve.c +++ b/lib/libsys/pci_reserve.c @@ -9,7 +9,7 @@ pci_reserve.c /*===========================================================================* * pci_reserve * *===========================================================================*/ -PUBLIC void pci_reserve(devind) +void pci_reserve(devind) int devind; { int r; @@ -29,7 +29,7 @@ int devind; /*===========================================================================* * pci_reserve_ok * *===========================================================================*/ -PUBLIC int pci_reserve_ok(int devind) +int pci_reserve_ok(int devind) { message m; diff --git a/lib/libsys/pci_set_acl.c b/lib/libsys/pci_set_acl.c index ab84553fb..1f7a7492b 100644 --- a/lib/libsys/pci_set_acl.c +++ b/lib/libsys/pci_set_acl.c @@ -12,7 +12,7 @@ pci_set_acl.c /*===========================================================================* * pci_set_acl * *===========================================================================*/ -PUBLIC int pci_set_acl(rs_pci) +int pci_set_acl(rs_pci) struct rs_pci *rs_pci; { int r; diff --git a/lib/libsys/pci_slot_name.c b/lib/libsys/pci_slot_name.c index e9ff0f8a2..08ff6dc5e 100644 --- a/lib/libsys/pci_slot_name.c +++ b/lib/libsys/pci_slot_name.c @@ -9,7 +9,7 @@ pci_slot_name.c /*===========================================================================* * pci_slot_name * *===========================================================================*/ -PUBLIC char *pci_slot_name(devind) +char *pci_slot_name(devind) int devind; { static char name[80]; /* We need a better interface for this */ diff --git a/lib/libsys/profile.c b/lib/libsys/profile.c index e6519de83..86032a9be 100644 --- a/lib/libsys/profile.c +++ b/lib/libsys/profile.c @@ -20,9 +20,9 @@ #include #include -PRIVATE char cpath[CPROF_CPATH_MAX_LEN]; /* current call path string */ -PRIVATE int cpath_len; /* current call path len */ -PRIVATE struct cprof_tbl_s *cprof_slot; /* slot of current function */ +static char cpath[CPROF_CPATH_MAX_LEN]; /* current call path string */ +static int cpath_len; /* current call path len */ +static struct cprof_tbl_s *cprof_slot; /* slot of current function */ struct stack_s { /* stack entry */ int cpath_len; /* call path len */ struct cprof_tbl_s *slot; /* table slot */ @@ -30,22 +30,22 @@ struct stack_s { /* stack entry */ u64_t start_2; /* count @ end of procentry */ u64_t spent_deeper; /* spent in called functions */ }; -PRIVATE struct stack_s cprof_stk[CPROF_STACK_SIZE]; /* stack */ -PRIVATE int cprof_stk_top; /* top of stack */ +static struct stack_s cprof_stk[CPROF_STACK_SIZE]; /* stack */ +static int cprof_stk_top; /* top of stack */ EXTERN struct cprof_tbl_s cprof_tbl[]; /* hash table */ -PRIVATE int cprof_tbl_size; /* nr of slots */ -PRIVATE struct cprof_tbl_s *idx[CPROF_INDEX_SIZE]; /* index to table */ -PRIVATE struct cprof_ctl_s control; /* for comms with kernel */ -PRIVATE int cprof_announce; /* announce on n-th execution +static int cprof_tbl_size; /* nr of slots */ +static struct cprof_tbl_s *idx[CPROF_INDEX_SIZE]; /* index to table */ +static struct cprof_ctl_s control; /* for comms with kernel */ +static int cprof_announce; /* announce on n-th execution * of procentry */ -PRIVATE int cprof_locked; /* for reentrancy */ +static int cprof_locked; /* for reentrancy */ -FORWARD void cprof_init(void); -FORWARD void reset(void); -FORWARD void clear_tbl(void); +static void cprof_init(void); +static void reset(void); +static void clear_tbl(void); -PUBLIC void procentry (char *name) +void procentry (char *name) { static int init = 0; unsigned hash = 0, x = 0; @@ -168,7 +168,7 @@ PUBLIC void procentry (char *name) } -PUBLIC void procexit (char *UNUSED(name)) +void procexit (char *UNUSED(name)) { u64_t stop, spent; u32_t tsc_lo, tsc_hi; @@ -226,7 +226,7 @@ PUBLIC void procexit (char *UNUSED(name)) } -PRIVATE void cprof_init() +static void cprof_init() { int i; @@ -249,14 +249,14 @@ PRIVATE void cprof_init() } -PRIVATE void reset() +static void reset() { clear_tbl(); control.reset = 0; } -PRIVATE void clear_tbl() +static void clear_tbl() { int i; diff --git a/lib/libsys/profile_extern.c b/lib/libsys/profile_extern.c index 73af23e4e..a114aa114 100644 --- a/lib/libsys/profile_extern.c +++ b/lib/libsys/profile_extern.c @@ -20,13 +20,13 @@ struct cprof_tbl_s cprof_tbl[CPROF_TABLE_SIZE_OTHER]; /* Function that returns table size. */ -PUBLIC int profile_get_tbl_size(void) +int profile_get_tbl_size(void) { return CPROF_TABLE_SIZE_OTHER; } /* Function that returns on which execution of procentry to announce. */ -PUBLIC int profile_get_announce(void) +int profile_get_announce(void) { return CPROF_ANNOUNCE_OTHER; } @@ -35,7 +35,7 @@ PUBLIC int profile_get_announce(void) * Userspace processes announce their control struct and table locations * to the kernel through this function. */ -PUBLIC void profile_register(ctl_ptr, tbl_ptr) +void profile_register(ctl_ptr, tbl_ptr) void *ctl_ptr; void *tbl_ptr; { diff --git a/lib/libsys/safecopies.c b/lib/libsys/safecopies.c index 2176c68a8..f4f7f83bd 100644 --- a/lib/libsys/safecopies.c +++ b/lib/libsys/safecopies.c @@ -45,11 +45,11 @@ } #define NR_STATIC_GRANTS 2 -PRIVATE cp_grant_t static_grants[NR_STATIC_GRANTS]; -PRIVATE cp_grant_t *grants = NULL; -PRIVATE int ngrants = 0; +static cp_grant_t static_grants[NR_STATIC_GRANTS]; +static cp_grant_t *grants = NULL; +static int ngrants = 0; -PRIVATE void +static void cpf_grow(void) { /* Grow the grants table if possible. */ @@ -92,7 +92,7 @@ cpf_grow(void) ngrants = new_size; } -PRIVATE cp_grant_id_t +static cp_grant_id_t cpf_new_grantslot(void) { /* Find a new, free grant slot in the grant table, grow it if @@ -129,7 +129,7 @@ cpf_new_grantslot(void) return g; } -PUBLIC cp_grant_id_t +cp_grant_id_t cpf_grant_direct(endpoint_t who_to, vir_bytes addr, size_t bytes, int access) { cp_grant_id_t g; @@ -152,7 +152,7 @@ cpf_grant_direct(endpoint_t who_to, vir_bytes addr, size_t bytes, int access) return g; } -PUBLIC cp_grant_id_t +cp_grant_id_t cpf_grant_indirect(endpoint_t who_to, endpoint_t who_from, cp_grant_id_t gr) { /* Grant process A access into process B. B has granted us access as grant @@ -180,7 +180,7 @@ cpf_grant_indirect(endpoint_t who_to, endpoint_t who_from, cp_grant_id_t gr) return g; } -PUBLIC cp_grant_id_t +cp_grant_id_t cpf_grant_magic(endpoint_t who_to, endpoint_t who_from, vir_bytes addr, size_t bytes, int access) { @@ -209,7 +209,7 @@ cpf_grant_magic(endpoint_t who_to, endpoint_t who_from, return g; } -PUBLIC int +int cpf_revoke(cp_grant_id_t g) { /* Revoke previously granted access, identified by grant id. */ @@ -231,7 +231,7 @@ cpf_revoke(cp_grant_id_t g) return 0; } -PUBLIC int +int cpf_lookup(cp_grant_id_t g, endpoint_t *granter, endpoint_t *grantee) { /* First check slot validity, and if it's in use currently. */ @@ -248,7 +248,7 @@ cpf_lookup(cp_grant_id_t g, endpoint_t *granter, endpoint_t *grantee) return 0; } -PUBLIC int +int cpf_getgrants(cp_grant_id_t *grant_ids, int n) { int i; @@ -263,7 +263,7 @@ cpf_getgrants(cp_grant_id_t *grant_ids, int n) return i; } -PUBLIC int +int cpf_setgrant_direct(gid, who, addr, bytes, access) cp_grant_id_t gid; endpoint_t who; @@ -288,7 +288,7 @@ int access; return 0; } -PUBLIC int +int cpf_setgrant_indirect(gid, who_to, who_from, his_gid) cp_grant_id_t gid; endpoint_t who_to, who_from; @@ -305,7 +305,7 @@ cp_grant_id_t his_gid; return 0; } -PUBLIC int +int cpf_setgrant_magic(gid, who_to, who_from, addr, bytes, access) cp_grant_id_t gid; endpoint_t who_to, who_from; @@ -331,7 +331,7 @@ int access; return 0; } -PUBLIC int +int cpf_setgrant_disable(gid) cp_grant_id_t gid; { @@ -343,7 +343,7 @@ cp_grant_id_t gid; return 0; } -PUBLIC void +void cpf_reload(void) { /* Inform the kernel about the location of the grant table. This is needed diff --git a/lib/libsys/sched_start.c b/lib/libsys/sched_start.c index 0f8f2402d..2b49fc95f 100644 --- a/lib/libsys/sched_start.c +++ b/lib/libsys/sched_start.c @@ -11,7 +11,7 @@ /*===========================================================================* * sched_inherit * *===========================================================================*/ -PUBLIC int sched_inherit(endpoint_t scheduler_e, +int sched_inherit(endpoint_t scheduler_e, endpoint_t schedulee_e, endpoint_t parent_e, unsigned maxprio, endpoint_t *newscheduler_e) { @@ -46,7 +46,7 @@ PUBLIC int sched_inherit(endpoint_t scheduler_e, /*===========================================================================* * sched_start * *===========================================================================*/ -PUBLIC int sched_start(endpoint_t scheduler_e, +int sched_start(endpoint_t scheduler_e, endpoint_t schedulee_e, endpoint_t parent_e, int maxprio, diff --git a/lib/libsys/sched_stop.c b/lib/libsys/sched_stop.c index d31b28dff..e53a2d728 100644 --- a/lib/libsys/sched_stop.c +++ b/lib/libsys/sched_stop.c @@ -4,7 +4,7 @@ /*===========================================================================* * sched_stop * *===========================================================================*/ -PUBLIC int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e) +int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e) { int rv; message m; diff --git a/lib/libsys/sef.c b/lib/libsys/sef.c index ae27af9f7..27f0aab0e 100644 --- a/lib/libsys/sef.c +++ b/lib/libsys/sef.c @@ -8,21 +8,21 @@ /* Self variables. */ #define SEF_SELF_NAME_MAXLEN 20 -PUBLIC char sef_self_name[SEF_SELF_NAME_MAXLEN]; -PUBLIC endpoint_t sef_self_endpoint; -PUBLIC int sef_self_priv_flags; -PUBLIC int sef_self_first_receive_done; +char sef_self_name[SEF_SELF_NAME_MAXLEN]; +endpoint_t sef_self_endpoint; +int sef_self_priv_flags; +int sef_self_first_receive_done; /* Debug. */ #if SEF_INIT_DEBUG || SEF_LU_DEBUG || SEF_PING_DEBUG || SEF_SIGNAL_DEBUG #define SEF_DEBUG_HEADER_MAXLEN 32 -PRIVATE time_t sef_debug_boottime = 0; -PRIVATE u32_t sef_debug_system_hz = 0; -PRIVATE time_t sef_debug_time_sec = 0; -PRIVATE time_t sef_debug_time_us = 0; -PRIVATE char sef_debug_header_buff[SEF_DEBUG_HEADER_MAXLEN]; -FORWARD void sef_debug_refresh_params(void); -PUBLIC char* sef_debug_header(void); +static time_t sef_debug_boottime = 0; +static u32_t sef_debug_system_hz = 0; +static time_t sef_debug_time_sec = 0; +static time_t sef_debug_time_us = 0; +static char sef_debug_header_buff[SEF_DEBUG_HEADER_MAXLEN]; +static void sef_debug_refresh_params(void); +char* sef_debug_header(void); #endif /* SEF Init prototypes. */ @@ -45,7 +45,7 @@ EXTERN int do_sef_signal_request(message *m_ptr); /*===========================================================================* * sef_startup * *===========================================================================*/ -PUBLIC void sef_startup() +void sef_startup() { /* SEF startup interface for system services. */ int r, status; @@ -114,7 +114,7 @@ PUBLIC void sef_startup() /*===========================================================================* * sef_receive_status * *===========================================================================*/ -PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr) +int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr) { /* SEF receive() interface for system services. */ int r, status; @@ -183,7 +183,7 @@ PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr) /*===========================================================================* * sef_exit * *===========================================================================*/ -PUBLIC void sef_exit(int status) +void sef_exit(int status) { /* System services use a special version of exit() that generates a * self-termination signal. @@ -205,7 +205,7 @@ PUBLIC void sef_exit(int status) /*===========================================================================* * _exit * *===========================================================================*/ -PUBLIC void _exit(int status) +void _exit(int status) { /* Make exit() an alias for sef_exit() for system services. */ sef_exit(status); @@ -215,7 +215,7 @@ PUBLIC void _exit(int status) /*===========================================================================* * __exit * *===========================================================================*/ -PUBLIC void __exit(int status) +void __exit(int status) { /* Make exit() an alias for sef_exit() for system services. */ sef_exit(status); @@ -226,7 +226,7 @@ PUBLIC void __exit(int status) /*===========================================================================* * sef_debug_refresh_params * *===========================================================================*/ -PRIVATE void sef_debug_refresh_params(void) +static void sef_debug_refresh_params(void) { /* Refresh SEF debug params. */ clock_t uptime; @@ -274,7 +274,7 @@ PRIVATE void sef_debug_refresh_params(void) /*===========================================================================* * sef_debug_header * *===========================================================================*/ -PUBLIC char* sef_debug_header(void) +char* sef_debug_header(void) { /* Build and return a SEF debug header. */ sef_debug_refresh_params(); diff --git a/lib/libsys/sef_gcov.c b/lib/libsys/sef_gcov.c index dfc4a75ef..dc842eb0e 100644 --- a/lib/libsys/sef_gcov.c +++ b/lib/libsys/sef_gcov.c @@ -4,12 +4,12 @@ #include #include -PRIVATE sef_cb_gcov_t sef_cb_gcov = do_gcov_flush_impl; +static sef_cb_gcov_t sef_cb_gcov = do_gcov_flush_impl; /*===========================================================================* * do_sef_gcov_request * *===========================================================================*/ -PUBLIC int do_sef_gcov_request(message *m_ptr) +int do_sef_gcov_request(message *m_ptr) { if(!sef_cb_gcov) return ENOSYS; @@ -22,7 +22,7 @@ PUBLIC int do_sef_gcov_request(message *m_ptr) /*===========================================================================* * sef_setcb_gcov * *===========================================================================*/ -PUBLIC void sef_setcb_gcov(sef_cb_gcov_t cb) +void sef_setcb_gcov(sef_cb_gcov_t cb) { sef_cb_gcov = cb; } diff --git a/lib/libsys/sef_init.c b/lib/libsys/sef_init.c index 66c502e1f..049009ccd 100644 --- a/lib/libsys/sef_init.c +++ b/lib/libsys/sef_init.c @@ -4,7 +4,7 @@ #include /* SEF Init callbacks. */ -PRIVATE struct sef_cbs { +static struct sef_cbs { sef_cb_init_t sef_cb_init_fresh; sef_cb_init_t sef_cb_init_lu; sef_cb_init_t sef_cb_init_restart; @@ -17,8 +17,8 @@ PRIVATE struct sef_cbs { }; /* SEF Init prototypes for sef_startup(). */ -PUBLIC int do_sef_rs_init(endpoint_t old_endpoint); -PUBLIC int do_sef_init_request(message *m_ptr); +int do_sef_rs_init(endpoint_t old_endpoint); +int do_sef_init_request(message *m_ptr); /* Debug. */ EXTERN char* sef_debug_header(void); @@ -30,7 +30,7 @@ EXTERN endpoint_t sef_self_priv_flags; /*===========================================================================* * process_init * *===========================================================================*/ -PRIVATE int process_init(int type, sef_init_info_t *info) +static int process_init(int type, sef_init_info_t *info) { /* Process initialization. */ int r, result; @@ -73,7 +73,7 @@ PRIVATE int process_init(int type, sef_init_info_t *info) /*===========================================================================* * do_sef_rs_init * *===========================================================================*/ -PUBLIC int do_sef_rs_init(endpoint_t old_endpoint) +int do_sef_rs_init(endpoint_t old_endpoint) { /* Special SEF Init for RS. */ int r; @@ -101,7 +101,7 @@ PUBLIC int do_sef_rs_init(endpoint_t old_endpoint) /*===========================================================================* * do_sef_init_request * *===========================================================================*/ -PUBLIC int do_sef_init_request(message *m_ptr) +int do_sef_init_request(message *m_ptr) { /* Handle a SEF Init request. */ int r; @@ -123,7 +123,7 @@ PUBLIC int do_sef_init_request(message *m_ptr) /*===========================================================================* * sef_setcb_init_fresh * *===========================================================================*/ -PUBLIC void sef_setcb_init_fresh(sef_cb_init_t cb) +void sef_setcb_init_fresh(sef_cb_init_t cb) { assert(cb != NULL); sef_cbs.sef_cb_init_fresh = cb; @@ -132,7 +132,7 @@ PUBLIC void sef_setcb_init_fresh(sef_cb_init_t cb) /*===========================================================================* * sef_setcb_init_lu * *===========================================================================*/ -PUBLIC void sef_setcb_init_lu(sef_cb_init_t cb) +void sef_setcb_init_lu(sef_cb_init_t cb) { assert(cb != NULL); sef_cbs.sef_cb_init_lu = cb; @@ -141,7 +141,7 @@ PUBLIC void sef_setcb_init_lu(sef_cb_init_t cb) /*===========================================================================* * sef_setcb_init_restart * *===========================================================================*/ -PUBLIC void sef_setcb_init_restart(sef_cb_init_t cb) +void sef_setcb_init_restart(sef_cb_init_t cb) { assert(cb != NULL); sef_cbs.sef_cb_init_restart = cb; @@ -150,7 +150,7 @@ PUBLIC void sef_setcb_init_restart(sef_cb_init_t cb) /*===========================================================================* * sef_setcb_init_response * *===========================================================================*/ -PUBLIC void sef_setcb_init_response(sef_cb_init_response_t cb) +void sef_setcb_init_response(sef_cb_init_response_t cb) { assert(cb != NULL); sef_cbs.sef_cb_init_response = cb; @@ -159,7 +159,7 @@ PUBLIC void sef_setcb_init_response(sef_cb_init_response_t cb) /*===========================================================================* * sef_cb_init_null * *===========================================================================*/ -PUBLIC int sef_cb_init_null(int UNUSED(type), +int sef_cb_init_null(int UNUSED(type), sef_init_info_t *UNUSED(info)) { return OK; @@ -168,7 +168,7 @@ PUBLIC int sef_cb_init_null(int UNUSED(type), /*===========================================================================* * sef_cb_init_response_null * *===========================================================================*/ -PUBLIC int sef_cb_init_response_null(message * UNUSED(m_ptr)) +int sef_cb_init_response_null(message * UNUSED(m_ptr)) { return ENOSYS; } @@ -176,7 +176,7 @@ PUBLIC int sef_cb_init_response_null(message * UNUSED(m_ptr)) /*===========================================================================* * sef_cb_init_fail * *===========================================================================*/ -PUBLIC int sef_cb_init_fail(int UNUSED(type), sef_init_info_t *UNUSED(info)) +int sef_cb_init_fail(int UNUSED(type), sef_init_info_t *UNUSED(info)) { return ENOSYS; } @@ -184,7 +184,7 @@ PUBLIC int sef_cb_init_fail(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_init_reset * *===========================================================================*/ -PUBLIC int sef_cb_init_reset(int UNUSED(type), sef_init_info_t *UNUSED(info)) +int sef_cb_init_reset(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Tell RS to reincarnate us, with no old resources, and a new endpoint. */ return ERESTART; @@ -193,7 +193,7 @@ PUBLIC int sef_cb_init_reset(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_init_crash * *===========================================================================*/ -PUBLIC int sef_cb_init_crash(int UNUSED(type), sef_init_info_t *UNUSED(info)) +int sef_cb_init_crash(int UNUSED(type), sef_init_info_t *UNUSED(info)) { panic("Simulating a crash at initialization time..."); @@ -203,7 +203,7 @@ PUBLIC int sef_cb_init_crash(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_init_response_rs_reply * *===========================================================================*/ -PUBLIC int sef_cb_init_response_rs_reply(message *m_ptr) +int sef_cb_init_response_rs_reply(message *m_ptr) { int r; diff --git a/lib/libsys/sef_liveupdate.c b/lib/libsys/sef_liveupdate.c index 12a65773d..4219eeb70 100644 --- a/lib/libsys/sef_liveupdate.c +++ b/lib/libsys/sef_liveupdate.c @@ -3,10 +3,10 @@ #include /* SEF Live update variables. */ -PRIVATE int sef_lu_state; +static int sef_lu_state; /* SEF Live update callbacks. */ -PRIVATE struct sef_cbs { +static struct sef_cbs { sef_cb_lu_prepare_t sef_cb_lu_prepare; sef_cb_lu_state_isvalid_t sef_cb_lu_state_isvalid; sef_cb_lu_state_changed_t sef_cb_lu_state_changed; @@ -23,15 +23,15 @@ PRIVATE struct sef_cbs { }; /* SEF Live update prototypes for sef_receive(). */ -PUBLIC void do_sef_lu_before_receive(void); -PUBLIC int do_sef_lu_request(message *m_ptr); +void do_sef_lu_before_receive(void); +int do_sef_lu_request(message *m_ptr); /* SEF Live update helpers. */ -PRIVATE void sef_lu_ready(int result); +static void sef_lu_ready(int result); /* Debug. */ EXTERN char* sef_debug_header(void); -PRIVATE int sef_lu_debug_cycle = 0; +static int sef_lu_debug_cycle = 0; /* Information about SELF. */ EXTERN endpoint_t sef_self_endpoint; @@ -40,7 +40,7 @@ EXTERN int sef_self_first_receive_done; /*===========================================================================* * do_sef_lu_before_receive * *===========================================================================*/ -PUBLIC void do_sef_lu_before_receive() +void do_sef_lu_before_receive() { /* Handle SEF Live update before receive events. */ int r; @@ -80,7 +80,7 @@ PUBLIC void do_sef_lu_before_receive() /*===========================================================================* * do_sef_lu_request * *===========================================================================*/ -PUBLIC int do_sef_lu_request(message *m_ptr) +int do_sef_lu_request(message *m_ptr) { /* Handle a SEF Live update request. */ int state, old_state, is_valid_state; @@ -121,7 +121,7 @@ PUBLIC int do_sef_lu_request(message *m_ptr) /*===========================================================================* * sef_lu_ready * *===========================================================================*/ -PRIVATE void sef_lu_ready(int result) +static void sef_lu_ready(int result) { message m; int old_state, r; @@ -177,7 +177,7 @@ PRIVATE void sef_lu_ready(int result) /*===========================================================================* * sef_setcb_lu_prepare * *===========================================================================*/ -PUBLIC void sef_setcb_lu_prepare(sef_cb_lu_prepare_t cb) +void sef_setcb_lu_prepare(sef_cb_lu_prepare_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_prepare = cb; @@ -186,7 +186,7 @@ PUBLIC void sef_setcb_lu_prepare(sef_cb_lu_prepare_t cb) /*===========================================================================* * sef_setcb_lu_state_isvalid * *===========================================================================*/ -PUBLIC void sef_setcb_lu_state_isvalid(sef_cb_lu_state_isvalid_t cb) +void sef_setcb_lu_state_isvalid(sef_cb_lu_state_isvalid_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_state_isvalid = cb; @@ -195,7 +195,7 @@ PUBLIC void sef_setcb_lu_state_isvalid(sef_cb_lu_state_isvalid_t cb) /*===========================================================================* * sef_setcb_lu_state_changed * *===========================================================================*/ -PUBLIC void sef_setcb_lu_state_changed(sef_cb_lu_state_changed_t cb) +void sef_setcb_lu_state_changed(sef_cb_lu_state_changed_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_state_changed = cb; @@ -204,7 +204,7 @@ PUBLIC void sef_setcb_lu_state_changed(sef_cb_lu_state_changed_t cb) /*===========================================================================* * sef_setcb_lu_state_dump * *===========================================================================*/ -PUBLIC void sef_setcb_lu_state_dump(sef_cb_lu_state_dump_t cb) +void sef_setcb_lu_state_dump(sef_cb_lu_state_dump_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_state_dump = cb; @@ -213,7 +213,7 @@ PUBLIC void sef_setcb_lu_state_dump(sef_cb_lu_state_dump_t cb) /*===========================================================================* * sef_setcb_lu_state_save * *===========================================================================*/ -PUBLIC void sef_setcb_lu_state_save(sef_cb_lu_state_save_t cb) +void sef_setcb_lu_state_save(sef_cb_lu_state_save_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_state_save = cb; @@ -222,7 +222,7 @@ PUBLIC void sef_setcb_lu_state_save(sef_cb_lu_state_save_t cb) /*===========================================================================* * sef_setcb_lu_response * *===========================================================================*/ -PUBLIC void sef_setcb_lu_response(sef_cb_lu_response_t cb) +void sef_setcb_lu_response(sef_cb_lu_response_t cb) { assert(cb != NULL); sef_cbs.sef_cb_lu_response = cb; @@ -231,7 +231,7 @@ PUBLIC void sef_setcb_lu_response(sef_cb_lu_response_t cb) /*===========================================================================* * sef_cb_lu_prepare_null * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare_null(int UNUSED(state)) +int sef_cb_lu_prepare_null(int UNUSED(state)) { return ENOTREADY; } @@ -239,7 +239,7 @@ PUBLIC int sef_cb_lu_prepare_null(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_state_isvalid_null * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid_null(int UNUSED(state)) +int sef_cb_lu_state_isvalid_null(int UNUSED(state)) { return FALSE; } @@ -247,7 +247,7 @@ PUBLIC int sef_cb_lu_state_isvalid_null(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_state_changed_null * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_changed_null(int UNUSED(old_state), +void sef_cb_lu_state_changed_null(int UNUSED(old_state), int UNUSED(state)) { } @@ -255,7 +255,7 @@ PUBLIC void sef_cb_lu_state_changed_null(int UNUSED(old_state), /*===========================================================================* * sef_cb_lu_state_dump_null * *===========================================================================*/ -PUBLIC void sef_cb_lu_state_dump_null(int UNUSED(state)) +void sef_cb_lu_state_dump_null(int UNUSED(state)) { sef_lu_dprint("NULL\n"); } @@ -263,7 +263,7 @@ PUBLIC void sef_cb_lu_state_dump_null(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_state_save_null * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_save_null(int UNUSED(result)) +int sef_cb_lu_state_save_null(int UNUSED(result)) { return OK; } @@ -271,7 +271,7 @@ PUBLIC int sef_cb_lu_state_save_null(int UNUSED(result)) /*===========================================================================* * sef_cb_lu_response_null * *===========================================================================*/ -PUBLIC int sef_cb_lu_response_null(message * UNUSED(m_ptr)) +int sef_cb_lu_response_null(message * UNUSED(m_ptr)) { return ENOSYS; } @@ -279,7 +279,7 @@ PUBLIC int sef_cb_lu_response_null(message * UNUSED(m_ptr)) /*===========================================================================* * sef_cb_lu_prepare_always_ready * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare_always_ready(int UNUSED(state)) +int sef_cb_lu_prepare_always_ready(int UNUSED(state)) { return OK; } @@ -287,7 +287,7 @@ PUBLIC int sef_cb_lu_prepare_always_ready(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_prepare_never_ready * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare_never_ready(int UNUSED(state)) +int sef_cb_lu_prepare_never_ready(int UNUSED(state)) { #if SEF_LU_DEBUG sef_lu_debug_begin(); @@ -302,7 +302,7 @@ PUBLIC int sef_cb_lu_prepare_never_ready(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_prepare_crash * *===========================================================================*/ -PUBLIC int sef_cb_lu_prepare_crash(int UNUSED(state)) +int sef_cb_lu_prepare_crash(int UNUSED(state)) { panic("Simulating a crash at update prepare time..."); @@ -312,7 +312,7 @@ PUBLIC int sef_cb_lu_prepare_crash(int UNUSED(state)) /*===========================================================================* * sef_cb_lu_state_isvalid_standard * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid_standard(int state) +int sef_cb_lu_state_isvalid_standard(int state) { return SEF_LU_STATE_IS_STANDARD(state); } @@ -320,7 +320,7 @@ PUBLIC int sef_cb_lu_state_isvalid_standard(int state) /*===========================================================================* * sef_cb_lu_state_isvalid_workfree * *===========================================================================*/ -PUBLIC int sef_cb_lu_state_isvalid_workfree(int state) +int sef_cb_lu_state_isvalid_workfree(int state) { return (state == SEF_LU_STATE_WORK_FREE); } @@ -328,7 +328,7 @@ PUBLIC int sef_cb_lu_state_isvalid_workfree(int state) /*===========================================================================* * sef_cb_lu_response_rs_reply * *===========================================================================*/ -PUBLIC int sef_cb_lu_response_rs_reply(message *m_ptr) +int sef_cb_lu_response_rs_reply(message *m_ptr) { int r; diff --git a/lib/libsys/sef_ping.c b/lib/libsys/sef_ping.c index 2ac9c5102..057b95b72 100644 --- a/lib/libsys/sef_ping.c +++ b/lib/libsys/sef_ping.c @@ -3,14 +3,14 @@ #include /* SEF Ping callbacks. */ -PRIVATE struct sef_cbs { +static struct sef_cbs { sef_cb_ping_reply_t sef_cb_ping_reply; } sef_cbs = { SEF_CB_PING_REPLY_DEFAULT }; /* SEF Ping prototypes for sef_receive(). */ -PUBLIC int do_sef_ping_request(message *m_ptr); +int do_sef_ping_request(message *m_ptr); /* Debug. */ EXTERN char* sef_debug_header(void); @@ -18,7 +18,7 @@ EXTERN char* sef_debug_header(void); /*===========================================================================* * do_sef_ping_request * *===========================================================================*/ -PUBLIC int do_sef_ping_request(message *m_ptr) +int do_sef_ping_request(message *m_ptr) { /* Handle a SEF Ping request. */ @@ -40,7 +40,7 @@ PUBLIC int do_sef_ping_request(message *m_ptr) /*===========================================================================* * sef_setcb_ping_reply * *===========================================================================*/ -PUBLIC void sef_setcb_ping_reply(sef_cb_ping_reply_t cb) +void sef_setcb_ping_reply(sef_cb_ping_reply_t cb) { assert(cb != NULL); sef_cbs.sef_cb_ping_reply = cb; @@ -49,14 +49,14 @@ PUBLIC void sef_setcb_ping_reply(sef_cb_ping_reply_t cb) /*===========================================================================* * sef_cb_ping_reply_null * *===========================================================================*/ -PUBLIC void sef_cb_ping_reply_null(endpoint_t UNUSED(source)) +void sef_cb_ping_reply_null(endpoint_t UNUSED(source)) { } /*===========================================================================* * sef_cb_ping_reply_pong * *===========================================================================*/ -PUBLIC void sef_cb_ping_reply_pong(endpoint_t source) +void sef_cb_ping_reply_pong(endpoint_t source) { notify(source); } diff --git a/lib/libsys/sef_signal.c b/lib/libsys/sef_signal.c index 100c1506f..8136c21d6 100644 --- a/lib/libsys/sef_signal.c +++ b/lib/libsys/sef_signal.c @@ -4,7 +4,7 @@ #include /* SEF Signal callbacks. */ -PRIVATE struct sef_cbs { +static struct sef_cbs { sef_cb_signal_handler_t sef_cb_signal_handler; sef_cb_signal_manager_t sef_cb_signal_manager; } sef_cbs = { @@ -13,7 +13,7 @@ PRIVATE struct sef_cbs { }; /* SEF Signal prototypes for sef_receive(). */ -PUBLIC int do_sef_signal_request(message *m_ptr); +int do_sef_signal_request(message *m_ptr); /* Debug. */ EXTERN char* sef_debug_header(void); @@ -24,7 +24,7 @@ EXTERN endpoint_t sef_self_endpoint; /*===========================================================================* * process_sigmgr_signals * *===========================================================================*/ -PRIVATE void process_sigmgr_signals(void) +static void process_sigmgr_signals(void) { /* A signal manager has pending signals in the kernel. Process them. */ endpoint_t target; @@ -65,7 +65,7 @@ PRIVATE void process_sigmgr_signals(void) /*===========================================================================* * process_sigmgr_self_signals * *===========================================================================*/ -PRIVATE void process_sigmgr_self_signals(sigset_t sigset) +static void process_sigmgr_self_signals(sigset_t sigset) { /* A signal manager has pending signals for itself. Process them. */ int signo; @@ -81,7 +81,7 @@ PRIVATE void process_sigmgr_self_signals(sigset_t sigset) /*===========================================================================* * do_sef_signal_request * *===========================================================================*/ -PUBLIC int do_sef_signal_request(message *m_ptr) +int do_sef_signal_request(message *m_ptr) { /* Handle a SEF Signal request. */ int signo; @@ -129,7 +129,7 @@ PUBLIC int do_sef_signal_request(message *m_ptr) /*===========================================================================* * sef_setcb_signal_handler * *===========================================================================*/ -PUBLIC void sef_setcb_signal_handler(sef_cb_signal_handler_t cb) +void sef_setcb_signal_handler(sef_cb_signal_handler_t cb) { assert(cb != NULL); sef_cbs.sef_cb_signal_handler = cb; @@ -138,7 +138,7 @@ PUBLIC void sef_setcb_signal_handler(sef_cb_signal_handler_t cb) /*===========================================================================* * sef_setcb_signal_manager * *===========================================================================*/ -PUBLIC void sef_setcb_signal_manager(sef_cb_signal_manager_t cb) +void sef_setcb_signal_manager(sef_cb_signal_manager_t cb) { assert(cb != NULL); sef_cbs.sef_cb_signal_manager = cb; @@ -147,14 +147,14 @@ PUBLIC void sef_setcb_signal_manager(sef_cb_signal_manager_t cb) /*===========================================================================* * sef_cb_signal_handler_null * *===========================================================================*/ -PUBLIC void sef_cb_signal_handler_null(int signo) +void sef_cb_signal_handler_null(int signo) { } /*===========================================================================* * sef_cb_signal_manager_null * *===========================================================================*/ -PUBLIC int sef_cb_signal_manager_null(endpoint_t target, int signo) +int sef_cb_signal_manager_null(endpoint_t target, int signo) { return OK; } @@ -162,7 +162,7 @@ PUBLIC int sef_cb_signal_manager_null(endpoint_t target, int signo) /*===========================================================================* * sef_cb_signal_handler_term * *===========================================================================*/ -PUBLIC void sef_cb_signal_handler_term(int signo) +void sef_cb_signal_handler_term(int signo) { /* Terminate in case of SIGTERM, ignore other signals. */ if(signo == SIGTERM) { @@ -173,7 +173,7 @@ PUBLIC void sef_cb_signal_handler_term(int signo) /*===========================================================================* * sef_cb_signal_handler_posix_default * *===========================================================================*/ -PUBLIC void sef_cb_signal_handler_posix_default(int signo) +void sef_cb_signal_handler_posix_default(int signo) { switch(signo) { /* Ignore when possible. */ diff --git a/lib/libsys/ser_putc.c b/lib/libsys/ser_putc.c index f39a3971b..133b713c1 100644 --- a/lib/libsys/ser_putc.c +++ b/lib/libsys/ser_putc.c @@ -8,7 +8,7 @@ /*===========================================================================* * ser_putc * *===========================================================================*/ -PUBLIC void ser_putc(char c) +void ser_putc(char c) { u32_t b; int i; diff --git a/lib/libsys/spin.c b/lib/libsys/spin.c index ce06b0dde..3e47c0d96 100644 --- a/lib/libsys/spin.c +++ b/lib/libsys/spin.c @@ -28,7 +28,7 @@ enum { STATE_UPTIME /* use the clock to spin */ }; -PUBLIC void spin_init(spin_t *s, u32_t usecs) +void spin_init(spin_t *s, u32_t usecs) { /* Initialize the given spin state structure, set to spin at most the * given number of microseconds. @@ -38,7 +38,7 @@ PUBLIC void spin_init(spin_t *s, u32_t usecs) s->s_timeout = FALSE; } -PUBLIC int spin_check(spin_t *s) +int spin_check(spin_t *s) { /* Check whether a timeout has taken place. Return TRUE if the caller * should continue spinning, and FALSE if a timeout has occurred. The diff --git a/lib/libsys/sys_abort.c b/lib/libsys/sys_abort.c index afcb79457..747537b42 100644 --- a/lib/libsys/sys_abort.c +++ b/lib/libsys/sys_abort.c @@ -2,7 +2,7 @@ #include #include -PUBLIC int sys_abort(int how, ...) +int sys_abort(int how, ...) { /* Something awful has happened. Abandon ship. */ diff --git a/lib/libsys/sys_clear.c b/lib/libsys/sys_clear.c index 68a6a720b..e5f9a25a7 100644 --- a/lib/libsys/sys_clear.c +++ b/lib/libsys/sys_clear.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_clear * *===========================================================================*/ -PUBLIC int sys_clear(proc_ep) +int sys_clear(proc_ep) endpoint_t proc_ep; /* which process has exited */ { /* A process has exited. PM tells the kernel. diff --git a/lib/libsys/sys_cprof.c b/lib/libsys/sys_cprof.c index b22643c92..397b32960 100644 --- a/lib/libsys/sys_cprof.c +++ b/lib/libsys/sys_cprof.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_cprof * *===========================================================================*/ -PUBLIC int sys_cprof(action, size, endpt, ctl_ptr, mem_ptr) +int sys_cprof(action, size, endpt, ctl_ptr, mem_ptr) int action; /* get/reset profiling tables */ int size; /* size of allocated memory */ endpoint_t endpt; /* caller endpoint */ diff --git a/lib/libsys/sys_endsig.c b/lib/libsys/sys_endsig.c index 63dbe4d1c..7226f2bbc 100644 --- a/lib/libsys/sys_endsig.c +++ b/lib/libsys/sys_endsig.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_endksig * *===========================================================================*/ -PUBLIC int sys_endksig(proc_ep) +int sys_endksig(proc_ep) endpoint_t proc_ep; /* process number */ { message m; diff --git a/lib/libsys/sys_eniop.c b/lib/libsys/sys_eniop.c index 0dd7b1fa2..ca0681b44 100644 --- a/lib/libsys/sys_eniop.c +++ b/lib/libsys/sys_eniop.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_enable_iop * *===========================================================================*/ -PUBLIC int sys_enable_iop(proc_ep) +int sys_enable_iop(proc_ep) endpoint_t proc_ep; /* number of process to allow I/O */ { message m_iop; diff --git a/lib/libsys/sys_exec.c b/lib/libsys/sys_exec.c index 6e5d5466d..cd84d6a39 100644 --- a/lib/libsys/sys_exec.c +++ b/lib/libsys/sys_exec.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_exec(proc_ep, ptr, prog_name, initpc) +int sys_exec(proc_ep, ptr, prog_name, initpc) endpoint_t proc_ep; /* process that did exec */ char *ptr; /* new stack pointer */ char *prog_name; /* name of the new program */ diff --git a/lib/libsys/sys_exit.c b/lib/libsys/sys_exit.c index 88e95acd4..9b9b447d3 100644 --- a/lib/libsys/sys_exit.c +++ b/lib/libsys/sys_exit.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_exit * *===========================================================================*/ -PUBLIC int sys_exit() +int sys_exit() { /* A system process requests to exit. */ message m; diff --git a/lib/libsys/sys_fork.c b/lib/libsys/sys_fork.c index 0282b0f84..f978f40eb 100644 --- a/lib/libsys/sys_fork.c +++ b/lib/libsys/sys_fork.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_fork(parent, child, child_endpoint, map_ptr, flags, msgaddr) +int sys_fork(parent, child, child_endpoint, map_ptr, flags, msgaddr) endpoint_t parent; /* process doing the fork */ endpoint_t child; /* which proc has been created by the fork */ endpoint_t *child_endpoint; diff --git a/lib/libsys/sys_getinfo.c b/lib/libsys/sys_getinfo.c index cbfc94bbd..5ec1ee37c 100644 --- a/lib/libsys/sys_getinfo.c +++ b/lib/libsys/sys_getinfo.c @@ -6,7 +6,7 @@ /*===========================================================================* * sys_getinfo * *===========================================================================*/ -PUBLIC int sys_getinfo(request, ptr, len, ptr2, len2) +int sys_getinfo(request, ptr, len, ptr2, len2) int request; /* system info requested */ void *ptr; /* pointer where to store it */ int len; /* max length of value to get */ @@ -28,7 +28,7 @@ int len2; /* length or process nr */ /*===========================================================================* * sys_whoami * *===========================================================================*/ -PUBLIC int sys_whoami(endpoint_t *who_ep, char *who_name, int len, +int sys_whoami(endpoint_t *who_ep, char *who_name, int len, int *priv_flags) { message m; diff --git a/lib/libsys/sys_getsig.c b/lib/libsys/sys_getsig.c index c81c09961..dc993c16f 100644 --- a/lib/libsys/sys_getsig.c +++ b/lib/libsys/sys_getsig.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_getksig * *===========================================================================*/ -PUBLIC int sys_getksig(proc_ep, k_sig_map) +int sys_getksig(proc_ep, k_sig_map) endpoint_t *proc_ep; /* return process number here */ sigset_t *k_sig_map; /* return signal map here */ { diff --git a/lib/libsys/sys_in.c b/lib/libsys/sys_in.c index dca155e71..3044e77f8 100644 --- a/lib/libsys/sys_in.c +++ b/lib/libsys/sys_in.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_in * *===========================================================================*/ -PUBLIC int sys_in(port, value, type) +int sys_in(port, value, type) int port; /* port address to read from */ u32_t *value; /* pointer where to store value */ int type; /* byte, word, long */ diff --git a/lib/libsys/sys_int86.c b/lib/libsys/sys_int86.c index 86d62dc9f..f697819cb 100644 --- a/lib/libsys/sys_int86.c +++ b/lib/libsys/sys_int86.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_int86 * *===========================================================================*/ -PUBLIC int sys_int86(reg86p) +int sys_int86(reg86p) struct reg86u *reg86p; { message m; diff --git a/lib/libsys/sys_irqctl.c b/lib/libsys/sys_irqctl.c index abaac999d..58578d707 100644 --- a/lib/libsys/sys_irqctl.c +++ b/lib/libsys/sys_irqctl.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_irqctl * *===========================================================================*/ -PUBLIC int sys_irqctl(req, irq_vec, policy, hook_id) +int sys_irqctl(req, irq_vec, policy, hook_id) int req; /* IRQ control request */ int irq_vec; /* IRQ vector to control */ int policy; /* bit mask for policy flags */ diff --git a/lib/libsys/sys_kill.c b/lib/libsys/sys_kill.c index fdca534cb..71b84505e 100644 --- a/lib/libsys/sys_kill.c +++ b/lib/libsys/sys_kill.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_kill(proc_ep, signr) +int sys_kill(proc_ep, signr) endpoint_t proc_ep; /* which proc_ep has exited */ int signr; /* signal number: 1 - 16 */ { diff --git a/lib/libsys/sys_mcontext.c b/lib/libsys/sys_mcontext.c index 164c06636..6b4b69533 100644 --- a/lib/libsys/sys_mcontext.c +++ b/lib/libsys/sys_mcontext.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_getmcontext(proc, mcp) +int sys_getmcontext(proc, mcp) endpoint_t proc; /* process retrieving context */ mcontext_t *mcp; /* where to store context */ { @@ -15,7 +15,7 @@ mcontext_t *mcp; /* where to store context */ return r; } -PUBLIC int sys_setmcontext(proc, mcp) +int sys_setmcontext(proc, mcp) endpoint_t proc; /* process setting context */ mcontext_t *mcp; /* where to get context from */ { diff --git a/lib/libsys/sys_memset.c b/lib/libsys/sys_memset.c index dbd7423ec..483ec032f 100644 --- a/lib/libsys/sys_memset.c +++ b/lib/libsys/sys_memset.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_memset(unsigned long pattern, phys_bytes base, phys_bytes bytes) +int sys_memset(unsigned long pattern, phys_bytes base, phys_bytes bytes) { /* Zero a block of data. */ message mess; diff --git a/lib/libsys/sys_newmap.c b/lib/libsys/sys_newmap.c index f4b4f884d..764a703e1 100644 --- a/lib/libsys/sys_newmap.c +++ b/lib/libsys/sys_newmap.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_newmap( +int sys_newmap( endpoint_t proc_ep, /* process whose map is to be changed */ struct mem_map *ptr /* pointer to new map */ ) diff --git a/lib/libsys/sys_out.c b/lib/libsys/sys_out.c index f73ce11d4..e113846f9 100644 --- a/lib/libsys/sys_out.c +++ b/lib/libsys/sys_out.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_out * *===========================================================================*/ -PUBLIC int sys_out(port, value, type) +int sys_out(port, value, type) int port; /* port address to write to */ u32_t value; /* value to write */ int type; /* byte, word, long */ diff --git a/lib/libsys/sys_physcopy.c b/lib/libsys/sys_physcopy.c index cfdc1d232..c678b67de 100644 --- a/lib/libsys/sys_physcopy.c +++ b/lib/libsys/sys_physcopy.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_physcopy(src_proc, src_seg, src_vir, +int sys_physcopy(src_proc, src_seg, src_vir, dst_proc, dst_seg, dst_vir, bytes) endpoint_t src_proc; /* source process */ int src_seg; /* source memory segment */ diff --git a/lib/libsys/sys_profbuf.c b/lib/libsys/sys_profbuf.c index 2534f8a9d..834226722 100644 --- a/lib/libsys/sys_profbuf.c +++ b/lib/libsys/sys_profbuf.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_profbuf * *===========================================================================*/ -PUBLIC int sys_profbuf(ctl_ptr, mem_ptr) +int sys_profbuf(ctl_ptr, mem_ptr) void *ctl_ptr; /* pointer to control structure */ void *mem_ptr; /* pointer to profiling table */ { diff --git a/lib/libsys/sys_readbios.c b/lib/libsys/sys_readbios.c index 8c043e53c..3e3f555e8 100644 --- a/lib/libsys/sys_readbios.c +++ b/lib/libsys/sys_readbios.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_readbios(address, buf, size) +int sys_readbios(address, buf, size) phys_bytes address; /* Absolute memory address */ void *buf; /* Buffer to store the results */ size_t size; /* Amount of data to read */ diff --git a/lib/libsys/sys_runctl.c b/lib/libsys/sys_runctl.c index f0d35a70d..1b2dba971 100644 --- a/lib/libsys/sys_runctl.c +++ b/lib/libsys/sys_runctl.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_runctl * *===========================================================================*/ -PUBLIC int sys_runctl(endpoint_t proc_ep, int action, int flags) +int sys_runctl(endpoint_t proc_ep, int action, int flags) { message m; diff --git a/lib/libsys/sys_safecopy.c b/lib/libsys/sys_safecopy.c index 2a876d8ae..0f569f518 100644 --- a/lib/libsys/sys_safecopy.c +++ b/lib/libsys/sys_safecopy.c @@ -3,7 +3,7 @@ #include -PUBLIC int sys_safecopyfrom(endpoint_t src_e, +int sys_safecopyfrom(endpoint_t src_e, cp_grant_id_t gr_id, vir_bytes offset, vir_bytes address, size_t bytes, int my_seg) @@ -25,7 +25,7 @@ PUBLIC int sys_safecopyfrom(endpoint_t src_e, } -PUBLIC int sys_safecopyto(endpoint_t dst_e, +int sys_safecopyto(endpoint_t dst_e, cp_grant_id_t gr_id, vir_bytes offset, vir_bytes address, size_t bytes, int my_seg) diff --git a/lib/libsys/sys_safemap.c b/lib/libsys/sys_safemap.c index 26bfbcbb4..2e346edaf 100644 --- a/lib/libsys/sys_safemap.c +++ b/lib/libsys/sys_safemap.c @@ -6,7 +6,7 @@ /*===========================================================================* * sys_safemap * *===========================================================================*/ -PUBLIC int sys_safemap(endpoint_t grantor, cp_grant_id_t grant, +int sys_safemap(endpoint_t grantor, cp_grant_id_t grant, vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg, int writable) { @@ -31,7 +31,7 @@ PUBLIC int sys_safemap(endpoint_t grantor, cp_grant_id_t grant, /*===========================================================================* * sys_saferevmap_gid * *===========================================================================*/ -PUBLIC int sys_saferevmap_gid(cp_grant_id_t grant) +int sys_saferevmap_gid(cp_grant_id_t grant) { /* Grantor revokes safemap by grant id. */ message copy_mess; @@ -45,7 +45,7 @@ PUBLIC int sys_saferevmap_gid(cp_grant_id_t grant) /*===========================================================================* * sys_saferevmap_addr * *===========================================================================*/ -PUBLIC int sys_saferevmap_addr(vir_bytes addr) +int sys_saferevmap_addr(vir_bytes addr) { /* Grantor revokes safemap by address. */ message copy_mess; @@ -59,7 +59,7 @@ PUBLIC int sys_saferevmap_addr(vir_bytes addr) /*===========================================================================* * sys_safeunmap * *===========================================================================*/ -PUBLIC int sys_safeunmap(int my_seg, vir_bytes my_address) +int sys_safeunmap(int my_seg, vir_bytes my_address) { /* Requestor unmaps safemap. */ message copy_mess; diff --git a/lib/libsys/sys_schedctl.c b/lib/libsys/sys_schedctl.c index b7b975e4c..97ff4832c 100644 --- a/lib/libsys/sys_schedctl.c +++ b/lib/libsys/sys_schedctl.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_schedctl(unsigned flags, +int sys_schedctl(unsigned flags, endpoint_t proc_ep, int priority, int quantum, diff --git a/lib/libsys/sys_schedule.c b/lib/libsys/sys_schedule.c index f7664c47c..40d5a1ea1 100644 --- a/lib/libsys/sys_schedule.c +++ b/lib/libsys/sys_schedule.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_schedule(endpoint_t proc_ep, +int sys_schedule(endpoint_t proc_ep, int priority, int quantum, int cpu) diff --git a/lib/libsys/sys_sdevio.c b/lib/libsys/sys_sdevio.c index 0e1796a79..876ceb6cf 100644 --- a/lib/libsys/sys_sdevio.c +++ b/lib/libsys/sys_sdevio.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_sdevio * *===========================================================================*/ -PUBLIC int sys_sdevio(req, port, proc_nr, buffer, count, offset) +int sys_sdevio(req, port, proc_nr, buffer, count, offset) int req; /* request: DIO_{IN,OUT}PUT_* */ long port; /* port address to read from */ endpoint_t proc_nr; /* process where buffer is */ diff --git a/lib/libsys/sys_setalarm.c b/lib/libsys/sys_setalarm.c index 6d6331575..39d601732 100644 --- a/lib/libsys/sys_setalarm.c +++ b/lib/libsys/sys_setalarm.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_setalarm * *===========================================================================*/ -PUBLIC int sys_setalarm(exp_time, abs_time) +int sys_setalarm(exp_time, abs_time) clock_t exp_time; /* expiration time for the alarm */ int abs_time; /* use absolute or relative expiration time */ { diff --git a/lib/libsys/sys_sigreturn.c b/lib/libsys/sys_sigreturn.c index 38f2c9537..116ac728c 100644 --- a/lib/libsys/sys_sigreturn.c +++ b/lib/libsys/sys_sigreturn.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_sigreturn * *===========================================================================*/ -PUBLIC int sys_sigreturn(proc_ep, sig_ctxt) +int sys_sigreturn(proc_ep, sig_ctxt) endpoint_t proc_ep; /* for which process */ struct sigmsg *sig_ctxt; /* POSIX style handling */ { diff --git a/lib/libsys/sys_sigsend.c b/lib/libsys/sys_sigsend.c index 39f643ce7..90683a592 100644 --- a/lib/libsys/sys_sigsend.c +++ b/lib/libsys/sys_sigsend.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_sigsend * *===========================================================================*/ -PUBLIC int sys_sigsend(proc_ep, sig_ctxt) +int sys_sigsend(proc_ep, sig_ctxt) endpoint_t proc_ep; /* for which process */ struct sigmsg *sig_ctxt; /* POSIX style handling */ { diff --git a/lib/libsys/sys_sprof.c b/lib/libsys/sys_sprof.c index 486cb0da0..380609f92 100644 --- a/lib/libsys/sys_sprof.c +++ b/lib/libsys/sys_sprof.c @@ -5,7 +5,7 @@ /*===========================================================================* * sys_sprof * *===========================================================================*/ -PUBLIC int sys_sprof(action, size, freq, type, endpt, ctl_ptr, mem_ptr) +int sys_sprof(action, size, freq, type, endpt, ctl_ptr, mem_ptr) int action; /* start/stop profiling */ int size; /* available profiling memory */ int freq; /* sample frequency */ diff --git a/lib/libsys/sys_statectl.c b/lib/libsys/sys_statectl.c index 38b8ca869..d5d4ec7b5 100644 --- a/lib/libsys/sys_statectl.c +++ b/lib/libsys/sys_statectl.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_statectl(int request) +int sys_statectl(int request) { message m; diff --git a/lib/libsys/sys_stime.c b/lib/libsys/sys_stime.c index 94034e12a..e2b2bb587 100644 --- a/lib/libsys/sys_stime.c +++ b/lib/libsys/sys_stime.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_stime(boottime) +int sys_stime(boottime) time_t boottime; /* New boottime */ { message m; diff --git a/lib/libsys/sys_sysctl.c b/lib/libsys/sys_sysctl.c index e9458656b..443a9cc97 100644 --- a/lib/libsys/sys_sysctl.c +++ b/lib/libsys/sys_sysctl.c @@ -1,7 +1,7 @@ #include "syslib.h" -PUBLIC int sys_sysctl(int code, char *arg1, int arg2) +int sys_sysctl(int code, char *arg1, int arg2) { message m; @@ -13,7 +13,7 @@ PUBLIC int sys_sysctl(int code, char *arg1, int arg2) } -PUBLIC int sys_sysctl_stacktrace(endpoint_t ep) +int sys_sysctl_stacktrace(endpoint_t ep) { return sys_sysctl(SYSCTL_CODE_STACKTRACE, NULL, ep); } diff --git a/lib/libsys/sys_times.c b/lib/libsys/sys_times.c index 714fd419c..1ad3bc979 100644 --- a/lib/libsys/sys_times.c +++ b/lib/libsys/sys_times.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_times(proc_ep, user_time, sys_time, uptime, boottime) +int sys_times(proc_ep, user_time, sys_time, uptime, boottime) endpoint_t proc_ep; /* proc_ep whose times are needed */ clock_t *user_time; /* time spend in the process itself */ clock_t *sys_time; /* time spend in system on behalf of the diff --git a/lib/libsys/sys_trace.c b/lib/libsys/sys_trace.c index 003d7f3bf..483e16783 100644 --- a/lib/libsys/sys_trace.c +++ b/lib/libsys/sys_trace.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_trace(req, proc_ep, addr, data_p) +int sys_trace(req, proc_ep, addr, data_p) int req; endpoint_t proc_ep; long addr, *data_p; diff --git a/lib/libsys/sys_umap.c b/lib/libsys/sys_umap.c index 0f4f5a371..66b9c9a59 100644 --- a/lib/libsys/sys_umap.c +++ b/lib/libsys/sys_umap.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_umap * *===========================================================================*/ -PUBLIC int sys_umap(proc_ep, seg, vir_addr, bytes, phys_addr) +int sys_umap(proc_ep, seg, vir_addr, bytes, phys_addr) endpoint_t proc_ep; /* process number to do umap for */ int seg; /* T, D, or S segment */ vir_bytes vir_addr; /* address in bytes with segment*/ diff --git a/lib/libsys/sys_umap_remote.c b/lib/libsys/sys_umap_remote.c index 876f2e996..dd03c045a 100755 --- a/lib/libsys/sys_umap_remote.c +++ b/lib/libsys/sys_umap_remote.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_umap_remote * *===========================================================================*/ -PUBLIC int sys_umap_remote(proc_ep, grantee, seg, vir_addr, bytes, phys_addr) +int sys_umap_remote(proc_ep, grantee, seg, vir_addr, bytes, phys_addr) endpoint_t proc_ep; /* process number to do umap for */ endpoint_t grantee; /* process nr to check as grantee */ int seg; /* T, D, or S segment */ diff --git a/lib/libsys/sys_vinb.c b/lib/libsys/sys_vinb.c index c973fd7bc..3dcc040e1 100644 --- a/lib/libsys/sys_vinb.c +++ b/lib/libsys/sys_vinb.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_vinb * *===========================================================================*/ -PUBLIC int sys_vinb(pvb_pairs, nr_ports) +int sys_vinb(pvb_pairs, nr_ports) pvb_pair_t *pvb_pairs; /* (port,byte-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_vinl.c b/lib/libsys/sys_vinl.c index e2ef972dd..d3fe9d4f8 100644 --- a/lib/libsys/sys_vinl.c +++ b/lib/libsys/sys_vinl.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_vinl * *===========================================================================*/ -PUBLIC int sys_vinl(pvl_pairs, nr_ports) +int sys_vinl(pvl_pairs, nr_ports) pvl_pair_t *pvl_pairs; /* (port,long-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_vinw.c b/lib/libsys/sys_vinw.c index 168186511..19c718dcc 100644 --- a/lib/libsys/sys_vinw.c +++ b/lib/libsys/sys_vinw.c @@ -4,7 +4,7 @@ /*===========================================================================* * sys_vinw * *===========================================================================*/ -PUBLIC int sys_vinw(pvw_pairs, nr_ports) +int sys_vinw(pvw_pairs, nr_ports) pvw_pair_t *pvw_pairs; /* (port,word-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_vircopy.c b/lib/libsys/sys_vircopy.c index 924b73062..cb9cbb36d 100644 --- a/lib/libsys/sys_vircopy.c +++ b/lib/libsys/sys_vircopy.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_vircopy(src_proc, src_seg, src_vir, +int sys_vircopy(src_proc, src_seg, src_vir, dst_proc, dst_seg, dst_vir, bytes) endpoint_t src_proc; /* source process */ int src_seg; /* source memory segment */ diff --git a/lib/libsys/sys_vmctl.c b/lib/libsys/sys_vmctl.c index 965671054..c0aef7fec 100644 --- a/lib/libsys/sys_vmctl.c +++ b/lib/libsys/sys_vmctl.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_vmctl(endpoint_t who, int param, u32_t value) +int sys_vmctl(endpoint_t who, int param, u32_t value) { message m; int r; @@ -12,7 +12,7 @@ PUBLIC int sys_vmctl(endpoint_t who, int param, u32_t value) return(r); } -PUBLIC int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3) +int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3) { message m; int r; @@ -26,7 +26,7 @@ PUBLIC int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3) return(r); } -PUBLIC int sys_vmctl_set_addrspace(endpoint_t who, +int sys_vmctl_set_addrspace(endpoint_t who, phys_bytes ptroot, void *ptroot_v) { message m; @@ -41,7 +41,7 @@ PUBLIC int sys_vmctl_set_addrspace(endpoint_t who, return(r); } -PUBLIC int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem, +int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem, vir_bytes *len, int *wrflag, endpoint_t *who_s, vir_bytes *mem_s, endpoint_t *requestor) { @@ -63,7 +63,7 @@ PUBLIC int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem, return r; } -PUBLIC int sys_vmctl_enable_paging(void * data) +int sys_vmctl_enable_paging(void * data) { message m; m.SVMCTL_WHO = SELF; @@ -72,7 +72,7 @@ PUBLIC int sys_vmctl_enable_paging(void * data) return _kernel_call(SYS_VMCTL, &m); } -PUBLIC int sys_vmctl_get_mapping(int index, +int sys_vmctl_get_mapping(int index, phys_bytes *addr, phys_bytes *len, int *flags) { int r; @@ -94,7 +94,7 @@ PUBLIC int sys_vmctl_get_mapping(int index, return OK; } -PUBLIC int sys_vmctl_reply_mapping(int index, vir_bytes addr) +int sys_vmctl_reply_mapping(int index, vir_bytes addr) { message m; diff --git a/lib/libsys/sys_voutb.c b/lib/libsys/sys_voutb.c index 040d9dddb..1e7fe12cf 100644 --- a/lib/libsys/sys_voutb.c +++ b/lib/libsys/sys_voutb.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_voutb * *===========================================================================*/ -PUBLIC int sys_voutb(pvb_pairs, nr_ports) +int sys_voutb(pvb_pairs, nr_ports) pvb_pair_t *pvb_pairs; /* (port,byte-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_voutl.c b/lib/libsys/sys_voutl.c index 8cf7f2b07..e56e6aec5 100644 --- a/lib/libsys/sys_voutl.c +++ b/lib/libsys/sys_voutl.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_voutl * *===========================================================================*/ -PUBLIC int sys_voutl(pvl_pairs, nr_ports) +int sys_voutl(pvl_pairs, nr_ports) pvl_pair_t *pvl_pairs; /* (port,long-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_voutw.c b/lib/libsys/sys_voutw.c index a497e3b60..6d252720d 100644 --- a/lib/libsys/sys_voutw.c +++ b/lib/libsys/sys_voutw.c @@ -4,7 +4,7 @@ /*===========================================================================* * sys_voutw * *===========================================================================*/ -PUBLIC int sys_voutw(pvw_pairs, nr_ports) +int sys_voutw(pvw_pairs, nr_ports) pvw_pair_t *pvw_pairs; /* (port,word-value)-pairs */ int nr_ports; /* nr of pairs to be processed */ { diff --git a/lib/libsys/sys_vsafecopy.c b/lib/libsys/sys_vsafecopy.c index e223a5014..cd544553f 100644 --- a/lib/libsys/sys_vsafecopy.c +++ b/lib/libsys/sys_vsafecopy.c @@ -3,7 +3,7 @@ #include -PUBLIC int sys_vsafecopy(struct vscp_vec *vec, int els) +int sys_vsafecopy(struct vscp_vec *vec, int els) { /* Vectored variant of sys_safecopy*. */ diff --git a/lib/libsys/sys_vtimer.c b/lib/libsys/sys_vtimer.c index 2e3706866..794a09398 100644 --- a/lib/libsys/sys_vtimer.c +++ b/lib/libsys/sys_vtimer.c @@ -1,6 +1,6 @@ #include "syslib.h" -PUBLIC int sys_vtimer(proc, which, newval, oldval) +int sys_vtimer(proc, which, newval, oldval) endpoint_t proc; /* proc to retrieve/set the timer for */ int which; /* timer to retrieve/set */ clock_t *newval; /* if non-NULL, set to this new value */ diff --git a/lib/libsys/sys_vumap.c b/lib/libsys/sys_vumap.c index 2ceaeb755..a84555180 100644 --- a/lib/libsys/sys_vumap.c +++ b/lib/libsys/sys_vumap.c @@ -3,7 +3,7 @@ /*===========================================================================* * sys_vumap * *===========================================================================*/ -PUBLIC int sys_vumap( +int sys_vumap( endpoint_t endpt, /* source process endpoint, or SELF */ struct vumap_vir *vvec, /* virtual (input) vector */ int vcount, /* number of elements in vvec */ diff --git a/lib/libsys/taskcall.c b/lib/libsys/taskcall.c index 6cd5f98e3..f6778699a 100644 --- a/lib/libsys/taskcall.c +++ b/lib/libsys/taskcall.c @@ -6,7 +6,7 @@ #include #include -PUBLIC int _taskcall(who, syscallnr, msgptr) +int _taskcall(who, syscallnr, msgptr) endpoint_t who; int syscallnr; register message *msgptr; diff --git a/lib/libsys/tickdelay.c b/lib/libsys/tickdelay.c index c7b3ae7ce..d7f98450d 100644 --- a/lib/libsys/tickdelay.c +++ b/lib/libsys/tickdelay.c @@ -4,7 +4,7 @@ /*===========================================================================* * tickdelay * *===========================================================================*/ -PUBLIC int tickdelay(ticks) +int tickdelay(ticks) long ticks; /* number of ticks to wait */ { /* This function uses the synchronous alarm to delay for a while. This works diff --git a/lib/libsys/timers.c b/lib/libsys/timers.c index 06cfffdf3..d794b812a 100644 --- a/lib/libsys/timers.c +++ b/lib/libsys/timers.c @@ -15,13 +15,13 @@ #include #include -PRIVATE timer_t *timers = NULL; -PRIVATE int expiring = 0; +static timer_t *timers = NULL; +static int expiring = 0; /*===========================================================================* * init_timer * *===========================================================================*/ -PUBLIC void init_timer(timer_t *tp) +void init_timer(timer_t *tp) { tmr_inittimer(tp); } @@ -29,7 +29,7 @@ PUBLIC void init_timer(timer_t *tp) /*===========================================================================* * set_timer * *===========================================================================*/ -PUBLIC void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg) +void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg) { int r; clock_t now, prev_time = 0, next_time; @@ -51,7 +51,7 @@ PUBLIC void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg) /*===========================================================================* * cancel_timer * *===========================================================================*/ -PUBLIC void cancel_timer(timer_t *tp) +void cancel_timer(timer_t *tp) { clock_t next_time, prev_time; prev_time = tmrs_clrtimer(&timers, tp, &next_time); @@ -69,7 +69,7 @@ PUBLIC void cancel_timer(timer_t *tp) /*===========================================================================* * expire_timers * *===========================================================================*/ -PUBLIC void expire_timers(clock_t now) +void expire_timers(clock_t now) { clock_t next_time; diff --git a/lib/libsys/vm_brk.c b/lib/libsys/vm_brk.c index 2a94e09b3..88fb80941 100644 --- a/lib/libsys/vm_brk.c +++ b/lib/libsys/vm_brk.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_brk * *===========================================================================*/ -PUBLIC int vm_brk(endpoint_t ep, char *addr) +int vm_brk(endpoint_t ep, char *addr) { message m; diff --git a/lib/libsys/vm_exec_newmem.c b/lib/libsys/vm_exec_newmem.c index 3f1394771..82d69e897 100644 --- a/lib/libsys/vm_exec_newmem.c +++ b/lib/libsys/vm_exec_newmem.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_exec_newmem * *===========================================================================*/ -PUBLIC int vm_exec_newmem(endpoint_t ep, struct exec_newmem *args, +int vm_exec_newmem(endpoint_t ep, struct exec_newmem *args, int argssize, char **ret_stack_top, int *ret_flags) { message m; diff --git a/lib/libsys/vm_exit.c b/lib/libsys/vm_exit.c index 77500b239..35a0e4065 100644 --- a/lib/libsys/vm_exit.c +++ b/lib/libsys/vm_exit.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_exit * *===========================================================================*/ -PUBLIC int vm_exit(endpoint_t ep) +int vm_exit(endpoint_t ep) { message m; int result; @@ -21,7 +21,7 @@ PUBLIC int vm_exit(endpoint_t ep) /*===========================================================================* * vm_willexit * *===========================================================================*/ -PUBLIC int vm_willexit(endpoint_t ep) +int vm_willexit(endpoint_t ep) { message m; int result; diff --git a/lib/libsys/vm_fork.c b/lib/libsys/vm_fork.c index 7a433b697..5931f756d 100644 --- a/lib/libsys/vm_fork.c +++ b/lib/libsys/vm_fork.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_fork * *===========================================================================*/ -PUBLIC int vm_fork(endpoint_t ep, int slot, endpoint_t *childep) +int vm_fork(endpoint_t ep, int slot, endpoint_t *childep) { message m; int result; diff --git a/lib/libsys/vm_info.c b/lib/libsys/vm_info.c index 88fdc07d2..0ff47c978 100644 --- a/lib/libsys/vm_info.c +++ b/lib/libsys/vm_info.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_info_stats * *===========================================================================*/ -PUBLIC int vm_info_stats(struct vm_stats_info *vsi) +int vm_info_stats(struct vm_stats_info *vsi) { message m; @@ -19,7 +19,7 @@ PUBLIC int vm_info_stats(struct vm_stats_info *vsi) /*===========================================================================* * vm_info_usage * *===========================================================================*/ -PUBLIC int vm_info_usage(endpoint_t who, struct vm_usage_info *vui) +int vm_info_usage(endpoint_t who, struct vm_usage_info *vui) { message m; @@ -33,7 +33,7 @@ PUBLIC int vm_info_usage(endpoint_t who, struct vm_usage_info *vui) /*===========================================================================* * vm_info_region * *===========================================================================*/ -PUBLIC int vm_info_region(endpoint_t who, struct vm_region_info *vri, +int vm_info_region(endpoint_t who, struct vm_region_info *vri, int count, vir_bytes *next) { message m; diff --git a/lib/libsys/vm_map_phys.c b/lib/libsys/vm_map_phys.c index affafa277..e98374387 100644 --- a/lib/libsys/vm_map_phys.c +++ b/lib/libsys/vm_map_phys.c @@ -7,7 +7,7 @@ #include #include -PUBLIC void *vm_map_phys(endpoint_t who, void *phaddr, size_t len) +void *vm_map_phys(endpoint_t who, void *phaddr, size_t len) { message m; int r; @@ -23,7 +23,7 @@ PUBLIC void *vm_map_phys(endpoint_t who, void *phaddr, size_t len) return (void *) m.VMMP_VADDR_REPLY; } -PUBLIC int vm_unmap_phys(endpoint_t who, void *vaddr, size_t len) +int vm_unmap_phys(endpoint_t who, void *vaddr, size_t len) { message m; diff --git a/lib/libsys/vm_notify_sig.c b/lib/libsys/vm_notify_sig.c index 3325d6bb7..386bd9d1c 100644 --- a/lib/libsys/vm_notify_sig.c +++ b/lib/libsys/vm_notify_sig.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_notify_sig * *===========================================================================*/ -PUBLIC int vm_notify_sig(endpoint_t ep, endpoint_t ipc_ep) +int vm_notify_sig(endpoint_t ep, endpoint_t ipc_ep) { message m; int result; diff --git a/lib/libsys/vm_push_sig.c b/lib/libsys/vm_push_sig.c index 1f994e537..d9185990c 100644 --- a/lib/libsys/vm_push_sig.c +++ b/lib/libsys/vm_push_sig.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_push_sig * *===========================================================================*/ -PUBLIC int vm_push_sig(endpoint_t ep, vir_bytes *old_sp) +int vm_push_sig(endpoint_t ep, vir_bytes *old_sp) { message m; int result; diff --git a/lib/libsys/vm_umap.c b/lib/libsys/vm_umap.c index abc8285f8..a1967d242 100644 --- a/lib/libsys/vm_umap.c +++ b/lib/libsys/vm_umap.c @@ -6,7 +6,7 @@ /*===========================================================================* * vm_umap * *===========================================================================*/ -PUBLIC int vm_umap(int seg, vir_bytes offset, vir_bytes len, phys_bytes *addr) +int vm_umap(int seg, vir_bytes offset, vir_bytes len, phys_bytes *addr) { message m; int result; diff --git a/lib/libsys/vm_yield_get_block.c b/lib/libsys/vm_yield_get_block.c index 2970bc1e3..b7579651c 100644 --- a/lib/libsys/vm_yield_get_block.c +++ b/lib/libsys/vm_yield_get_block.c @@ -7,7 +7,7 @@ /*===========================================================================* * vm_forgetblocks * *===========================================================================*/ -PUBLIC void vm_forgetblocks(void) +void vm_forgetblocks(void) { message m; _taskcall(VM_PROC_NR, VM_FORGETBLOCKS, &m); @@ -17,7 +17,7 @@ PUBLIC void vm_forgetblocks(void) /*===========================================================================* * vm_forgetblock * *===========================================================================*/ -PUBLIC int vm_forgetblock(u64_t id) +int vm_forgetblock(u64_t id) { message m; @@ -30,7 +30,7 @@ PUBLIC int vm_forgetblock(u64_t id) /*===========================================================================* * vm_yield_block_get_block * *===========================================================================*/ -PUBLIC int vm_yield_block_get_block(u64_t yieldid, u64_t getid, +int vm_yield_block_get_block(u64_t yieldid, u64_t getid, void *mem, vir_bytes len) { message m; diff --git a/lib/libusb/usb.c b/lib/libusb/usb.c index def208c65..0b3ffcdaa 100644 --- a/lib/libusb/usb.c +++ b/lib/libusb/usb.c @@ -9,15 +9,15 @@ #include #include -PRIVATE struct usb_urb * pending_urbs = NULL; -PRIVATE endpoint_t hcd_ep; +static struct usb_urb * pending_urbs = NULL; +static endpoint_t hcd_ep; -FORWARD void _usb_urb_complete(struct usb_driver *ud, long urb_id); +static void _usb_urb_complete(struct usb_driver *ud, long urb_id); /***************************************************************************** * usb_send_urb * ****************************************************************************/ -PUBLIC int usb_send_urb(struct usb_urb* urb) +int usb_send_urb(struct usb_urb* urb) { message msg; int res; @@ -77,7 +77,7 @@ PUBLIC int usb_send_urb(struct usb_urb* urb) /***************************************************************************** * usb_cancle_urb * ****************************************************************************/ -PUBLIC int usb_cancle_urb(struct usb_urb* urb) +int usb_cancle_urb(struct usb_urb* urb) { int res; message msg; @@ -118,7 +118,7 @@ PUBLIC int usb_cancle_urb(struct usb_urb* urb) /***************************************************************************** * usb_init * ****************************************************************************/ -PUBLIC int usb_init(char *name) +int usb_init(char *name) { int res; message msg; @@ -154,7 +154,7 @@ PUBLIC int usb_init(char *name) /***************************************************************************** * _usb_urb_complete * ****************************************************************************/ -PRIVATE void _usb_urb_complete(struct usb_driver *ud, long urb_id) +static void _usb_urb_complete(struct usb_driver *ud, long urb_id) { /* find the corresponding URB in the urb_pending list. */ struct usb_urb * urb = NULL; @@ -193,7 +193,7 @@ PRIVATE void _usb_urb_complete(struct usb_driver *ud, long urb_id) /***************************************************************************** * usb_handle_msg * ****************************************************************************/ -PUBLIC int usb_handle_msg(struct usb_driver *ud, message *msg) +int usb_handle_msg(struct usb_driver *ud, message *msg) { /* * we expect kind of messages: diff --git a/lib/libvtreefs/inode.c b/lib/libvtreefs/inode.c index 792ebc727..6eef9b214 100644 --- a/lib/libvtreefs/inode.c +++ b/lib/libvtreefs/inode.c @@ -3,17 +3,17 @@ #include "inc.h" /* The number of inodes and hash table slots. */ -PRIVATE unsigned int nr_inodes; +static unsigned int nr_inodes; /* The table of all the inodes. */ -PRIVATE struct inode *inode; +static struct inode *inode; /* The list of unused inodes. */ -PRIVATE TAILQ_HEAD(unused_head, inode) unused_inodes; +static TAILQ_HEAD(unused_head, inode) unused_inodes; /* The hash tables for lookup of and to inode. */ -PRIVATE LIST_HEAD(name_head, inode) *parent_name_head; -PRIVATE LIST_HEAD(index_head, inode) *parent_index_head; +static LIST_HEAD(name_head, inode) *parent_name_head; +static LIST_HEAD(index_head, inode) *parent_index_head; /* Internal integrity check. */ #define CHECK_INODE(node) \ @@ -27,7 +27,7 @@ PRIVATE LIST_HEAD(index_head, inode) *parent_index_head; /*===========================================================================* * init_inodes * *===========================================================================*/ -PUBLIC void init_inodes(unsigned int inodes, struct inode_stat *stat, +void init_inodes(unsigned int inodes, struct inode_stat *stat, index_t nr_indexed_entries) { /* Initialize the inode-related state. @@ -90,7 +90,7 @@ PUBLIC void init_inodes(unsigned int inodes, struct inode_stat *stat, /*===========================================================================* * cleanup_inodes * *===========================================================================*/ -PUBLIC void cleanup_inodes(void) +void cleanup_inodes(void) { /* Clean up the inode-related state. */ @@ -104,7 +104,7 @@ PUBLIC void cleanup_inodes(void) /*===========================================================================* * parent_name_hash * *===========================================================================*/ -PRIVATE int parent_name_hash(struct inode *parent, char *name) +static int parent_name_hash(struct inode *parent, char *name) { /* Return the hash value of tuple. */ @@ -123,7 +123,7 @@ PRIVATE int parent_name_hash(struct inode *parent, char *name) /*===========================================================================* * parent_index_hash * *===========================================================================*/ -PRIVATE int parent_index_hash(struct inode *parent, index_t index) +static int parent_index_hash(struct inode *parent, index_t index) { /* Return the hash value of a tuple. */ @@ -134,7 +134,7 @@ PRIVATE int parent_index_hash(struct inode *parent, index_t index) /*===========================================================================* * purge_inode * *===========================================================================*/ -PUBLIC void purge_inode(struct inode *parent) +void purge_inode(struct inode *parent) { /* Delete a deletable inode to make room for a new inode. */ @@ -175,7 +175,7 @@ PUBLIC void purge_inode(struct inode *parent) /*===========================================================================* * add_inode * *===========================================================================*/ -PUBLIC struct inode *add_inode(struct inode *parent, char *name, +struct inode *add_inode(struct inode *parent, char *name, index_t index, struct inode_stat *stat, index_t nr_indexed_entries, cbdata_t cbdata) { @@ -232,7 +232,7 @@ PUBLIC struct inode *add_inode(struct inode *parent, char *name, /*===========================================================================* * get_root_inode * *===========================================================================*/ -PUBLIC struct inode *get_root_inode(void) +struct inode *get_root_inode(void) { /* Return the file system's root inode. */ @@ -244,7 +244,7 @@ PUBLIC struct inode *get_root_inode(void) /*===========================================================================* * get_inode_name * *===========================================================================*/ -PUBLIC char const *get_inode_name(struct inode *node) +char const *get_inode_name(struct inode *node) { /* Return the name that an inode has in its parent directory. */ @@ -257,7 +257,7 @@ PUBLIC char const *get_inode_name(struct inode *node) /*===========================================================================* * get_inode_index * *===========================================================================*/ -PUBLIC index_t get_inode_index(struct inode *node) +index_t get_inode_index(struct inode *node) { /* Return the index that an inode has in its parent directory. */ @@ -270,7 +270,7 @@ PUBLIC index_t get_inode_index(struct inode *node) /*===========================================================================* * get_inode_cbdata * *===========================================================================*/ -PUBLIC cbdata_t get_inode_cbdata(struct inode *node) +cbdata_t get_inode_cbdata(struct inode *node) { /* Return the callback data associated with the given inode. */ @@ -283,7 +283,7 @@ PUBLIC cbdata_t get_inode_cbdata(struct inode *node) /*===========================================================================* * get_parent_inode * *===========================================================================*/ -PUBLIC struct inode *get_parent_inode(struct inode *node) +struct inode *get_parent_inode(struct inode *node) { /* Return an inode's parent inode. */ @@ -300,7 +300,7 @@ PUBLIC struct inode *get_parent_inode(struct inode *node) /*===========================================================================* * get_first_inode * *===========================================================================*/ -PUBLIC struct inode *get_first_inode(struct inode *parent) +struct inode *get_first_inode(struct inode *parent) { /* Return a directory's first (non-deleted) child inode. */ @@ -320,7 +320,7 @@ PUBLIC struct inode *get_first_inode(struct inode *parent) /*===========================================================================* * get_next_inode * *===========================================================================*/ -PUBLIC struct inode *get_next_inode(struct inode *previous) +struct inode *get_next_inode(struct inode *previous) { /* Return a directory's next (non-deleted) child inode. */ @@ -339,7 +339,7 @@ PUBLIC struct inode *get_next_inode(struct inode *previous) /*===========================================================================* * get_inode_number * *===========================================================================*/ -PUBLIC int get_inode_number(struct inode *node) +int get_inode_number(struct inode *node) { /* Return the inode number of the given inode. */ @@ -352,7 +352,7 @@ PUBLIC int get_inode_number(struct inode *node) /*===========================================================================* * get_inode_stat * *===========================================================================*/ -PUBLIC void get_inode_stat(struct inode *node, struct inode_stat *stat) +void get_inode_stat(struct inode *node, struct inode_stat *stat) { /* Retrieve an inode's status. */ @@ -365,7 +365,7 @@ PUBLIC void get_inode_stat(struct inode *node, struct inode_stat *stat) /*===========================================================================* * set_inode_stat * *===========================================================================*/ -PUBLIC void set_inode_stat(struct inode *node, struct inode_stat *stat) +void set_inode_stat(struct inode *node, struct inode_stat *stat) { /* Set an inode's status. */ @@ -378,7 +378,7 @@ PUBLIC void set_inode_stat(struct inode *node, struct inode_stat *stat) /*===========================================================================* * get_inode_by_name * *===========================================================================*/ -PUBLIC struct inode *get_inode_by_name(struct inode *parent, char *name) +struct inode *get_inode_by_name(struct inode *parent, char *name) { /* Look up an inode using a tuple. */ @@ -402,7 +402,7 @@ PUBLIC struct inode *get_inode_by_name(struct inode *parent, char *name) /*===========================================================================* * get_inode_by_index * *===========================================================================*/ -PUBLIC struct inode *get_inode_by_index(struct inode *parent, index_t index) +struct inode *get_inode_by_index(struct inode *parent, index_t index) { /* Look up an inode using a tuple. */ @@ -426,7 +426,7 @@ PUBLIC struct inode *get_inode_by_index(struct inode *parent, index_t index) /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode(ino_t num) +struct inode *find_inode(ino_t num) { /* Retrieve an inode by inode number. */ @@ -442,7 +442,7 @@ PUBLIC struct inode *find_inode(ino_t num) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode(ino_t num) +struct inode *get_inode(ino_t num) { /* Retrieve an inode by inode number, and increase its reference count. */ @@ -458,7 +458,7 @@ PUBLIC struct inode *get_inode(ino_t num) /*===========================================================================* * put_inode * *===========================================================================*/ -PUBLIC void put_inode(struct inode *node) +void put_inode(struct inode *node) { /* Decrease an inode's reference count. */ @@ -478,7 +478,7 @@ PUBLIC void put_inode(struct inode *node) /*===========================================================================* * ref_inode * *===========================================================================*/ -PUBLIC void ref_inode(struct inode *node) +void ref_inode(struct inode *node) { /* Increase an inode's reference count. */ @@ -492,7 +492,7 @@ PUBLIC void ref_inode(struct inode *node) /*===========================================================================* * unlink_inode * *===========================================================================*/ -PRIVATE void unlink_inode(struct inode *node) +static void unlink_inode(struct inode *node) { /* Unlink the given node from its parent, if it is still linked in. */ @@ -517,7 +517,7 @@ PRIVATE void unlink_inode(struct inode *node) /*===========================================================================* * delete_inode * *===========================================================================*/ -PUBLIC void delete_inode(struct inode *node) +void delete_inode(struct inode *node) { /* Delete the given inode. If its reference count is nonzero, or it * still has children that cannot be deleted for the same reason, keep @@ -570,7 +570,7 @@ PUBLIC void delete_inode(struct inode *node) /*===========================================================================* * is_inode_deleted * *===========================================================================*/ -PUBLIC int is_inode_deleted(struct inode *node) +int is_inode_deleted(struct inode *node) { /* Return whether the given inode has been deleted. */ @@ -581,7 +581,7 @@ PUBLIC int is_inode_deleted(struct inode *node) /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode(void) +int fs_putnode(void) { /* Find the inode specified by the request message, and decrease its * reference count. diff --git a/lib/libvtreefs/link.c b/lib/libvtreefs/link.c index 01237e0d7..39aa2ed3e 100644 --- a/lib/libvtreefs/link.c +++ b/lib/libvtreefs/link.c @@ -5,7 +5,7 @@ /*===========================================================================* * fs_rdlink * *===========================================================================*/ -PUBLIC int fs_rdlink(void) +int fs_rdlink(void) { /* Retrieve symbolic link target. */ diff --git a/lib/libvtreefs/mount.c b/lib/libvtreefs/mount.c index 2813e749c..70bb84cd5 100644 --- a/lib/libvtreefs/mount.c +++ b/lib/libvtreefs/mount.c @@ -5,7 +5,7 @@ /*===========================================================================* * fs_readsuper * *===========================================================================*/ -PUBLIC int fs_readsuper(void) +int fs_readsuper(void) { /* This function gets the root inode and sends back its details. */ @@ -45,7 +45,7 @@ PUBLIC int fs_readsuper(void) /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount(void) +int fs_unmount(void) { /* Unmount the file system. */ diff --git a/lib/libvtreefs/path.c b/lib/libvtreefs/path.c index b07aaa7ec..ef8f3a272 100644 --- a/lib/libvtreefs/path.c +++ b/lib/libvtreefs/path.c @@ -5,7 +5,7 @@ /*===========================================================================* * access_as_dir * *===========================================================================*/ -PRIVATE int access_as_dir(struct inode *node, vfs_ucred_t *ucred) +static int access_as_dir(struct inode *node, vfs_ucred_t *ucred) { /* Check whether the given inode may be accessed as directory. * Return OK or an appropriate error code. @@ -41,7 +41,7 @@ PRIVATE int access_as_dir(struct inode *node, vfs_ucred_t *ucred) /*===========================================================================* * next_name * *===========================================================================*/ -PRIVATE int next_name(char **ptr, char **start, char name[PNAME_MAX+1]) +static int next_name(char **ptr, char **start, char name[PNAME_MAX+1]) { /* Get the next path component from a path. */ @@ -71,7 +71,7 @@ PRIVATE int next_name(char **ptr, char **start, char name[PNAME_MAX+1]) /*===========================================================================* * go_up * *===========================================================================*/ -PRIVATE int go_up(struct inode *node, struct inode **parent) +static int go_up(struct inode *node, struct inode **parent) { /* Given a directory inode, progress into the parent directory. */ @@ -90,7 +90,7 @@ PRIVATE int go_up(struct inode *node, struct inode **parent) /*===========================================================================* * go_down * *===========================================================================*/ -PRIVATE int go_down(struct inode *parent, char *name, struct inode **child) +static int go_down(struct inode *parent, char *name, struct inode **child) { /* Given a directory inode and a name, progress into a directory entry. */ @@ -114,7 +114,7 @@ PRIVATE int go_down(struct inode *parent, char *name, struct inode **child) /*===========================================================================* * resolve_link * *===========================================================================*/ -PRIVATE int resolve_link(struct inode *node, char *pptr, char *tail) +static int resolve_link(struct inode *node, char *pptr, char *tail) { /* Given a symbolic link, resolve and return the contents of the link. */ @@ -145,7 +145,7 @@ PRIVATE int resolve_link(struct inode *node, char *pptr, char *tail) /*===========================================================================* * fs_lookup * *===========================================================================*/ -PUBLIC int fs_lookup(void) +int fs_lookup(void) { /* Resolve a path string to an inode. */ diff --git a/lib/libvtreefs/read.c b/lib/libvtreefs/read.c index 98d74e668..5e264d83d 100644 --- a/lib/libvtreefs/read.c +++ b/lib/libvtreefs/read.c @@ -9,7 +9,7 @@ /*===========================================================================* * fs_read * *===========================================================================*/ -PUBLIC int fs_read(void) +int fs_read(void) { /* Read from a file. */ @@ -70,7 +70,7 @@ PUBLIC int fs_read(void) /*===========================================================================* * fs_getdents * *===========================================================================*/ -PUBLIC int fs_getdents(void) +int fs_getdents(void) { /* Retrieve directory entries. */ diff --git a/lib/libvtreefs/sdbm.c b/lib/libvtreefs/sdbm.c index 6efb46a1f..951143b5f 100644 --- a/lib/libvtreefs/sdbm.c +++ b/lib/libvtreefs/sdbm.c @@ -17,7 +17,7 @@ * use: 65599 nice. * 65587 even better. */ -PUBLIC long sdbm_hash(char *str, int len) +long sdbm_hash(char *str, int len) { unsigned long n = 0; diff --git a/lib/libvtreefs/stadir.c b/lib/libvtreefs/stadir.c index b00ef34b2..2317ff8ca 100644 --- a/lib/libvtreefs/stadir.c +++ b/lib/libvtreefs/stadir.c @@ -10,7 +10,7 @@ /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat(void) +int fs_stat(void) { /* Retrieve file status. */ @@ -58,7 +58,7 @@ PUBLIC int fs_stat(void) /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_fstatfs(void) +int fs_fstatfs(void) { /* Retrieve file system statistics. */ @@ -74,7 +74,7 @@ PUBLIC int fs_fstatfs(void) /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_statvfs(void) +int fs_statvfs(void) { /* Retrieve file system statistics. */ diff --git a/lib/libvtreefs/table.c b/lib/libvtreefs/table.c index 319f73e0c..4aef223a0 100644 --- a/lib/libvtreefs/table.c +++ b/lib/libvtreefs/table.c @@ -3,7 +3,7 @@ #define _TABLE #include "inc.h" -PUBLIC int (*fs_call_vec[])(void) = { +int (*fs_call_vec[])(void) = { no_sys, /* 0 */ no_sys, /* 1 getnode */ fs_putnode, /* 2 putnode */ diff --git a/lib/libvtreefs/utility.c b/lib/libvtreefs/utility.c index cf8cecfb3..d4b0e86e6 100644 --- a/lib/libvtreefs/utility.c +++ b/lib/libvtreefs/utility.c @@ -5,7 +5,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys(void) +int no_sys(void) { /* This call is not recognized by VTreeFS. If a message hook is * defined, let it handle the call; otherwise return ENOSYS. @@ -20,7 +20,7 @@ PUBLIC int no_sys(void) /*===========================================================================* * do_noop * *===========================================================================*/ -PUBLIC int do_noop(void) +int do_noop(void) { /* This call has no effect. */ diff --git a/lib/libvtreefs/vtreefs.c b/lib/libvtreefs/vtreefs.c index c0031f302..2131d5301 100644 --- a/lib/libvtreefs/vtreefs.c +++ b/lib/libvtreefs/vtreefs.c @@ -2,18 +2,18 @@ #include "inc.h" -FORWARD int get_work(void); -FORWARD void send_reply(int err, int transid); -FORWARD void got_signal(int signal); +static int get_work(void); +static void send_reply(int err, int transid); +static void got_signal(int signal); -PRIVATE unsigned int inodes; -PRIVATE struct inode_stat *root_stat; -PRIVATE index_t root_entries; +static unsigned int inodes; +static struct inode_stat *root_stat; +static index_t root_entries; /*===========================================================================* * init_server * *===========================================================================*/ -PRIVATE int init_server(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int init_server(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize internal state, and register with VFS. */ @@ -30,7 +30,7 @@ PRIVATE int init_server(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { sef_setcb_init_fresh(init_server); sef_setcb_init_restart(init_server); @@ -45,7 +45,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * start_vtreefs * *===========================================================================*/ -PUBLIC void start_vtreefs(struct fs_hooks *hooks, unsigned int nr_inodes, +void start_vtreefs(struct fs_hooks *hooks, unsigned int nr_inodes, struct inode_stat *stat, index_t nr_indexed_entries) { /* This is the main routine of this service. The main loop consists of @@ -108,7 +108,7 @@ PUBLIC void start_vtreefs(struct fs_hooks *hooks, unsigned int nr_inodes, /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE int get_work(void) +static int get_work(void) { /* Retrieve work. Return the call number. */ @@ -123,7 +123,7 @@ PRIVATE int get_work(void) /*===========================================================================* * send_reply * *===========================================================================*/ -PRIVATE void send_reply(int err, int transid) +static void send_reply(int err, int transid) { /* Send a reply to the caller. */ @@ -141,7 +141,7 @@ PRIVATE void send_reply(int err, int transid) /*===========================================================================* * got_signal * *===========================================================================*/ -PRIVATE void got_signal(int signal) +static void got_signal(int signal) { /* We received a signal. If it is a termination signal, and the file * system has already been unmounted, clean up and exit. diff --git a/servers/devman/bind.c b/servers/devman/bind.c index 9815552e5..82c8eda49 100644 --- a/servers/devman/bind.c +++ b/servers/devman/bind.c @@ -4,7 +4,7 @@ /***************************************************************************** * do_bind_device * ****************************************************************************/ -PUBLIC int do_bind_device(message *m) +int do_bind_device(message *m) { struct devman_device *dev; int res; @@ -53,7 +53,7 @@ PUBLIC int do_bind_device(message *m) /***************************************************************************** * do_unbind_device * ****************************************************************************/ -PUBLIC int do_unbind_device(message *m) +int do_unbind_device(message *m) { struct devman_device *dev; int res; diff --git a/servers/devman/buf.c b/servers/devman/buf.c index c6f1f700f..88c4c5cd9 100755 --- a/servers/devman/buf.c +++ b/servers/devman/buf.c @@ -42,16 +42,16 @@ #include #define BUF_SIZE 4096 -PRIVATE char buf[BUF_SIZE + 1]; -PRIVATE size_t off, left, used; -PRIVATE off_t skip; +static char buf[BUF_SIZE + 1]; +static size_t off, left, used; +static off_t skip; #define MIN(x,y) (xm_type = DEVMAN_REPLY; msg->DEVMAN_RESULT = res; @@ -225,7 +225,7 @@ PRIVATE void do_reply(message *msg, int res) /*===========================================================================* * do_add_device * *===========================================================================*/ -PUBLIC int do_add_device(message *msg) +int do_add_device(message *msg) { endpoint_t ep = msg->m_source; int res; @@ -283,7 +283,7 @@ PUBLIC int do_add_device(message *msg) /*===========================================================================* * _find_dev * *===========================================================================*/ -PRIVATE struct devman_device * +static struct devman_device * _find_dev(struct devman_device *dev, int dev_id) { struct devman_device *_dev; @@ -306,7 +306,7 @@ _find_dev(struct devman_device *dev, int dev_id) /*===========================================================================* * devman_find_dev * *===========================================================================*/ -PUBLIC struct devman_device *devman_find_device(int dev_id) +struct devman_device *devman_find_device(int dev_id) { return _find_dev(&root_dev, dev_id); } @@ -314,7 +314,7 @@ PUBLIC struct devman_device *devman_find_device(int dev_id) /*===========================================================================* * devman_dev_add_static_info * *===========================================================================*/ -PRIVATE int +static int devman_dev_add_static_info (struct devman_device *dev, char * name, char *data) { @@ -345,7 +345,7 @@ devman_dev_add_static_info /*===========================================================================* * devman_dev_add_child * *===========================================================================*/ -PRIVATE struct devman_device* +static struct devman_device* devman_dev_add_child (struct devman_device *parent, struct devman_device_info *devinf) { @@ -398,7 +398,7 @@ devman_dev_add_child /*===========================================================================* * devman_dev_add_info * *===========================================================================*/ -PRIVATE int +static int devman_dev_add_info (struct devman_device *dev, struct devman_device_info_entry *entry, char *buf) { @@ -419,7 +419,7 @@ devman_dev_add_info /*===========================================================================* * do_del_device * *===========================================================================*/ -PUBLIC int do_del_device(message *msg) +int do_del_device(message *msg) { int dev_id = msg->DEVMAN_DEVICE_ID; @@ -455,7 +455,7 @@ PUBLIC int do_del_device(message *msg) /*===========================================================================* * devman_get_device * *===========================================================================*/ -PUBLIC void devman_get_device(struct devman_device *dev) +void devman_get_device(struct devman_device *dev) { if (dev == NULL || dev == &root_dev) { return; @@ -466,7 +466,7 @@ PUBLIC void devman_get_device(struct devman_device *dev) /*===========================================================================* * devman_put_device * *===========================================================================*/ -PUBLIC void devman_put_device(struct devman_device *dev) +void devman_put_device(struct devman_device *dev) { if (dev == NULL || dev == &root_dev ) { return; @@ -480,7 +480,7 @@ PUBLIC void devman_put_device(struct devman_device *dev) /*===========================================================================* * devman_del_device * *===========================================================================*/ -PRIVATE int devman_del_device(struct devman_device *dev) +static int devman_del_device(struct devman_device *dev) { /* does device have children -> error */ /* evtl. remove links */ diff --git a/servers/devman/main.c b/servers/devman/main.c index 30a18529a..98bc45e5c 100644 --- a/servers/devman/main.c +++ b/servers/devman/main.c @@ -35,7 +35,7 @@ #include "devman.h" #include "proto.h" -PRIVATE void init_hook(void) { +static void init_hook(void) { static int first = 1; if (first) { @@ -45,7 +45,7 @@ PRIVATE void init_hook(void) { } -PRIVATE int message_hook (message *m) +static int message_hook (message *m) { switch (m->m_type) { case DEVMAN_ADD_DEV: @@ -60,7 +60,7 @@ PRIVATE int message_hook (message *m) } } -PRIVATE int +static int read_hook (struct inode *inode, off_t offset, char **ptr, size_t *len, cbdata_t cbdata) { @@ -70,7 +70,7 @@ read_hook } -PUBLIC int main (int argc, char* argv[]) +int main (int argc, char* argv[]) { struct fs_hooks hooks; diff --git a/servers/ds/main.c b/servers/ds/main.c index b756b9f30..b2ec89e56 100644 --- a/servers/ds/main.c +++ b/servers/ds/main.c @@ -12,20 +12,20 @@ #include /* Allocate space for the global variables. */ -PRIVATE endpoint_t who_e; /* caller's proc number */ -PRIVATE int callnr; /* system call number */ +static endpoint_t who_e; /* caller's proc number */ +static int callnr; /* system call number */ /* Declare some local functions. */ -FORWARD void get_work(message *m_ptr); -FORWARD void reply(endpoint_t whom, message *m_ptr); +static void get_work(message *m_ptr); +static void reply(endpoint_t whom, message *m_ptr); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -93,7 +93,7 @@ send_reply: /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -108,7 +108,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work( +static void get_work( message *m_ptr /* message buffer */ ) { @@ -122,7 +122,7 @@ PRIVATE void get_work( /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply( +static void reply( endpoint_t who_e, /* destination */ message *m_ptr /* message buffer */ ) diff --git a/servers/ds/store.c b/servers/ds/store.c index 1c8efa4b0..79c58c7f5 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -2,13 +2,13 @@ #include "store.h" /* Allocate space for the data store. */ -PRIVATE struct data_store ds_store[NR_DS_KEYS]; -PRIVATE struct subscription ds_subs[NR_DS_SUBS]; +static struct data_store ds_store[NR_DS_KEYS]; +static struct subscription ds_subs[NR_DS_SUBS]; /*===========================================================================* * alloc_data_slot * *===========================================================================*/ -PRIVATE struct data_store *alloc_data_slot(void) +static struct data_store *alloc_data_slot(void) { /* Allocate a new data slot. */ int i; @@ -24,7 +24,7 @@ PRIVATE struct data_store *alloc_data_slot(void) /*===========================================================================* * alloc_sub_slot * *===========================================================================*/ -PRIVATE struct subscription *alloc_sub_slot(void) +static struct subscription *alloc_sub_slot(void) { /* Allocate a new subscription slot. */ int i; @@ -40,7 +40,7 @@ PRIVATE struct subscription *alloc_sub_slot(void) /*===========================================================================* * lookup_entry * *===========================================================================*/ -PRIVATE struct data_store *lookup_entry(const char *key_name, int type) +static struct data_store *lookup_entry(const char *key_name, int type) { /* Lookup an existing entry by key and type. */ int i; @@ -58,7 +58,7 @@ PRIVATE struct data_store *lookup_entry(const char *key_name, int type) /*===========================================================================* * lookup_label_entry * *===========================================================================*/ -PRIVATE struct data_store *lookup_label_entry(unsigned num) +static struct data_store *lookup_label_entry(unsigned num) { /* Lookup an existing label entry by num. */ int i; @@ -76,7 +76,7 @@ PRIVATE struct data_store *lookup_label_entry(unsigned num) /*===========================================================================* * lookup_sub * *===========================================================================*/ -PRIVATE struct subscription *lookup_sub(const char *owner) +static struct subscription *lookup_sub(const char *owner) { /* Lookup an existing subscription given its owner. */ int i; @@ -93,7 +93,7 @@ PRIVATE struct subscription *lookup_sub(const char *owner) /*===========================================================================* * ds_getprocname * *===========================================================================*/ -PRIVATE char *ds_getprocname(endpoint_t e) +static char *ds_getprocname(endpoint_t e) { /* Get a process name given its endpoint. */ struct data_store *dsp; @@ -113,7 +113,7 @@ PRIVATE char *ds_getprocname(endpoint_t e) /*===========================================================================* * ds_getprocep * *===========================================================================*/ -PRIVATE endpoint_t ds_getprocep(const char *s) +static endpoint_t ds_getprocep(const char *s) { /* Get a process endpoint given its name. */ struct data_store *dsp; @@ -126,7 +126,7 @@ PRIVATE endpoint_t ds_getprocep(const char *s) /*===========================================================================* * check_auth * *===========================================================================*/ -PRIVATE int check_auth(const struct data_store *p, endpoint_t ep, int perm) +static int check_auth(const struct data_store *p, endpoint_t ep, int perm) { /* Check authorization for a given type of permission. */ char *source; @@ -141,7 +141,7 @@ PRIVATE int check_auth(const struct data_store *p, endpoint_t ep, int perm) /*===========================================================================* * get_key_name * *===========================================================================*/ -PRIVATE int get_key_name(const message *m_ptr, char *key_name) +static int get_key_name(const message *m_ptr, char *key_name) { /* Get key name given an input message. */ int r; @@ -169,7 +169,7 @@ PRIVATE int get_key_name(const message *m_ptr, char *key_name) /*===========================================================================* * check_snapshot_index * *===========================================================================*/ -PRIVATE int check_snapshot_index(const struct data_store *dsp, int index) +static int check_snapshot_index(const struct data_store *dsp, int index) { /* See if the given snapshot index is valid. */ int min; @@ -184,7 +184,7 @@ PRIVATE int check_snapshot_index(const struct data_store *dsp, int index) /*===========================================================================* * check_sub_match * *===========================================================================*/ -PRIVATE int check_sub_match(const struct subscription *subp, +static int check_sub_match(const struct subscription *subp, struct data_store *dsp, endpoint_t ep) { /* Check if an entry matches a subscription. Return 1 in case of match. */ @@ -196,7 +196,7 @@ PRIVATE int check_sub_match(const struct subscription *subp, /*===========================================================================* * update_subscribers * *===========================================================================*/ -PRIVATE void update_subscribers(struct data_store *dsp, int set) +static void update_subscribers(struct data_store *dsp, int set) { /* If set = 1, set bit in the sub bitmap of any subscription matching the given * entry, otherwise clear it. In both cases, notify the subscriber. @@ -227,7 +227,7 @@ PRIVATE void update_subscribers(struct data_store *dsp, int set) /*===========================================================================* * map_service * *===========================================================================*/ -PRIVATE int map_service(const struct rprocpub *rpub) +static int map_service(const struct rprocpub *rpub) { /* Map a new service by registering its label. */ struct data_store *dsp; @@ -252,7 +252,7 @@ PRIVATE int map_service(const struct rprocpub *rpub) /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PUBLIC int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) +int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) { /* Initialize the data store server. */ int i, r; @@ -285,7 +285,7 @@ PUBLIC int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) /*===========================================================================* * do_publish * *===========================================================================*/ -PUBLIC int do_publish(message *m_ptr) +int do_publish(message *m_ptr) { struct data_store *dsp; char key_name[DS_MAX_KEYLEN]; @@ -402,7 +402,7 @@ PUBLIC int do_publish(message *m_ptr) /*===========================================================================* * do_retrieve * *===========================================================================*/ -PUBLIC int do_retrieve(message *m_ptr) +int do_retrieve(message *m_ptr) { struct data_store *dsp; char key_name[DS_MAX_KEYLEN]; @@ -493,7 +493,7 @@ PUBLIC int do_retrieve(message *m_ptr) /*===========================================================================* * do_retrieve_label * *===========================================================================*/ -PUBLIC int do_retrieve_label(const message *m_ptr) +int do_retrieve_label(const message *m_ptr) { struct data_store *dsp; int r; @@ -517,7 +517,7 @@ PUBLIC int do_retrieve_label(const message *m_ptr) /*===========================================================================* * do_subscribe * *===========================================================================*/ -PUBLIC int do_subscribe(message *m_ptr) +int do_subscribe(message *m_ptr) { char regex[DS_MAX_KEYLEN+2]; struct subscription *subp; @@ -593,7 +593,7 @@ PUBLIC int do_subscribe(message *m_ptr) /*===========================================================================* * do_check * *===========================================================================*/ -PUBLIC int do_check(message *m_ptr) +int do_check(message *m_ptr) { struct subscription *subp; char *owner; @@ -640,7 +640,7 @@ PUBLIC int do_check(message *m_ptr) /*===========================================================================* * do_delete * *===========================================================================*/ -PUBLIC int do_delete(message *m_ptr) +int do_delete(message *m_ptr) { struct data_store *dsp; char key_name[DS_MAX_KEYLEN]; @@ -729,7 +729,7 @@ PUBLIC int do_delete(message *m_ptr) /*===========================================================================* * do_snapshot * *===========================================================================*/ -PUBLIC int do_snapshot(message *m_ptr) +int do_snapshot(message *m_ptr) { struct data_store *dsp; struct dsi_map *p; @@ -770,7 +770,7 @@ PUBLIC int do_snapshot(message *m_ptr) /*===========================================================================* * do_getsysinfo * *===========================================================================*/ -PUBLIC int do_getsysinfo(const message *m_ptr) +int do_getsysinfo(const message *m_ptr) { vir_bytes src_addr; size_t length; diff --git a/servers/ext2/balloc.c b/servers/ext2/balloc.c index b25b15079..50c43ac56 100644 --- a/servers/ext2/balloc.c +++ b/servers/ext2/balloc.c @@ -20,13 +20,13 @@ #include "const.h" -FORWARD block_t alloc_block_bit(struct super_block *sp, block_t origin, +static block_t alloc_block_bit(struct super_block *sp, block_t origin, struct inode *rip); /*===========================================================================* * discard_preallocated_blocks * *===========================================================================*/ -PUBLIC void discard_preallocated_blocks(struct inode *rip) +void discard_preallocated_blocks(struct inode *rip) { /* When called for rip, discard (free) blocks preallocated for rip, * otherwise discard all preallocated blocks. @@ -68,7 +68,7 @@ PUBLIC void discard_preallocated_blocks(struct inode *rip) /*===========================================================================* * alloc_block * *===========================================================================*/ -PUBLIC block_t alloc_block(struct inode *rip, block_t block) +block_t alloc_block(struct inode *rip, block_t block) { /* Allocate a block for inode. If block is provided, then use it as a goal: * try to allocate this block or his neghbors. @@ -141,13 +141,13 @@ PUBLIC block_t alloc_block(struct inode *rip, block_t block) } -FORWARD void check_block_number(block_t block, struct super_block *sp, +static void check_block_number(block_t block, struct super_block *sp, struct group_desc *gd); /*===========================================================================* * alloc_block_bit * *===========================================================================*/ -PRIVATE block_t alloc_block_bit(sp, goal, rip) +static block_t alloc_block_bit(sp, goal, rip) struct super_block *sp; /* the filesystem to allocate from */ block_t goal; /* try to allocate near this block */ struct inode *rip; /* used for preallocation */ @@ -273,7 +273,7 @@ struct inode *rip; /* used for preallocation */ /*===========================================================================* * free_block * *===========================================================================*/ -PUBLIC void free_block(struct super_block *sp, bit_t bit_returned) +void free_block(struct super_block *sp, bit_t bit_returned) { /* Return a block by turning off its bitmap bit. */ int group; /* group number of bit_returned */ @@ -329,7 +329,7 @@ PUBLIC void free_block(struct super_block *sp, bit_t bit_returned) } -PRIVATE void check_block_number(block_t block, struct super_block *sp, +static void check_block_number(block_t block, struct super_block *sp, struct group_desc *gd) { diff --git a/servers/ext2/cache.c b/servers/ext2/cache.c index f3f52fcbc..919b3f56a 100644 --- a/servers/ext2/cache.c +++ b/servers/ext2/cache.c @@ -25,15 +25,15 @@ #include "super.h" #include "inode.h" -FORWARD void rm_lru(struct buf *bp); -FORWARD void rw_block(struct buf *, int); +static void rm_lru(struct buf *bp); +static void rw_block(struct buf *, int); -PRIVATE int vmcache_avail = -1; /* 0 if not available, >0 if available. */ +static int vmcache_avail = -1; /* 0 if not available, >0 if available. */ /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block( +struct buf *get_block( register dev_t dev, /* on which device is the block? */ register block_t block, /* which block is wanted? */ int only_search /* if NO_READ, don't read, else act normal */ @@ -218,7 +218,7 @@ PUBLIC struct buf *get_block( /*===========================================================================* * put_block * *===========================================================================*/ -PUBLIC void put_block( +void put_block( register struct buf *bp, /* pointer to the buffer to be released */ int block_type /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ ) @@ -281,7 +281,7 @@ PUBLIC void put_block( /*===========================================================================* * rw_block * *===========================================================================*/ -PRIVATE void rw_block( +static void rw_block( register struct buf *bp, /* buffer pointer */ int rw_flag /* READING or WRITING */ ) @@ -327,7 +327,7 @@ PRIVATE void rw_block( /*===========================================================================* * invalidate * *===========================================================================*/ -PUBLIC void invalidate( +void invalidate( dev_t device /* device whose blocks are to be purged */ ) { @@ -344,7 +344,7 @@ PUBLIC void invalidate( /*===========================================================================* * flushall * *===========================================================================*/ -PUBLIC void flushall( +void flushall( dev_t dev /* device to flush */ ) { @@ -373,7 +373,7 @@ PUBLIC void flushall( /*===========================================================================* * rw_scattered * *===========================================================================*/ -PUBLIC void rw_scattered( +void rw_scattered( dev_t dev, /* major-minor device number */ struct buf **bufq, /* pointer to array of buffers */ int bufqsize, /* number of buffers */ @@ -476,7 +476,7 @@ PUBLIC void rw_scattered( /*===========================================================================* * rm_lru * *===========================================================================*/ -PRIVATE void rm_lru( +static void rm_lru( struct buf *bp ) { @@ -500,7 +500,7 @@ PRIVATE void rm_lru( /*===========================================================================* * set_blocksize * *===========================================================================*/ -PUBLIC void set_blocksize(unsigned int blocksize, u32_t blocks, +void set_blocksize(unsigned int blocksize, u32_t blocks, u32_t freeblocks, dev_t majordev) { struct buf *bp; @@ -524,7 +524,7 @@ PUBLIC void set_blocksize(unsigned int blocksize, u32_t blocks, /*===========================================================================* * buf_pool * *===========================================================================*/ -PUBLIC void buf_pool(int new_nr_bufs) +void buf_pool(int new_nr_bufs) { /* Initialize the buffer pool. */ register struct buf *bp; diff --git a/servers/ext2/ialloc.c b/servers/ext2/ialloc.c index 400e2b0e9..03b39f2ac 100644 --- a/servers/ext2/ialloc.c +++ b/servers/ext2/ialloc.c @@ -19,17 +19,17 @@ #include "const.h" -FORWARD bit_t alloc_inode_bit(struct super_block *sp, struct inode +static bit_t alloc_inode_bit(struct super_block *sp, struct inode *parent, int is_dir); -FORWARD void free_inode_bit(struct super_block *sp, bit_t bit_returned, +static void free_inode_bit(struct super_block *sp, bit_t bit_returned, int is_dir); -FORWARD void wipe_inode(struct inode *rip); +static void wipe_inode(struct inode *rip); /*===========================================================================* * alloc_inode * *===========================================================================*/ -PUBLIC struct inode *alloc_inode(struct inode *parent, mode_t bits) +struct inode *alloc_inode(struct inode *parent, mode_t bits) { /* Allocate a free inode on parent's dev, and return a pointer to it. */ @@ -87,7 +87,7 @@ PUBLIC struct inode *alloc_inode(struct inode *parent, mode_t bits) /*===========================================================================* * free_inode * *===========================================================================*/ -PUBLIC void free_inode( +void free_inode( register struct inode *rip /* inode to free */ ) { @@ -108,20 +108,20 @@ PUBLIC void free_inode( } -FORWARD int find_group_dir(struct super_block *sp, struct inode +static int find_group_dir(struct super_block *sp, struct inode *parent); -FORWARD int find_group_hashalloc(struct super_block *sp, struct inode +static int find_group_hashalloc(struct super_block *sp, struct inode *parent); -FORWARD int find_group_any(struct super_block *sp, struct inode +static int find_group_any(struct super_block *sp, struct inode *parent); -FORWARD int find_group_orlov(struct super_block *sp, struct inode +static int find_group_orlov(struct super_block *sp, struct inode *parent); /*===========================================================================* * alloc_inode_bit * *===========================================================================*/ -PRIVATE bit_t alloc_inode_bit(sp, parent, is_dir) +static bit_t alloc_inode_bit(sp, parent, is_dir) struct super_block *sp; /* the filesystem to allocate from */ struct inode *parent; /* parent of newly allocated inode */ int is_dir; /* inode will be a directory if it is TRUE */ @@ -202,7 +202,7 @@ int is_dir; /* inode will be a directory if it is TRUE */ /*===========================================================================* * free_inode_bit * *===========================================================================*/ -PRIVATE void free_inode_bit(struct super_block *sp, bit_t bit_returned, +static void free_inode_bit(struct super_block *sp, bit_t bit_returned, int is_dir) { /* Return an inode by turning off its bitmap bit. */ @@ -252,7 +252,7 @@ PRIVATE void free_inode_bit(struct super_block *sp, bit_t bit_returned, /* it's implemented very close to the linux' find_group_dir() */ -PRIVATE int find_group_dir(struct super_block *sp, struct inode *parent) +static int find_group_dir(struct super_block *sp, struct inode *parent) { int avefreei = sp->s_free_inodes_count / sp->s_groups_count; struct group_desc *gd, *best_gd = NULL; @@ -282,7 +282,7 @@ PRIVATE int find_group_dir(struct super_block *sp, struct inode *parent) * 2) Quadradically rehash on the group number. * 3) Make a linear search for free inode. */ -PRIVATE int find_group_hashalloc(struct super_block *sp, struct inode *parent) +static int find_group_hashalloc(struct super_block *sp, struct inode *parent) { int ngroups = sp->s_groups_count; struct group_desc *gd; @@ -339,7 +339,7 @@ PRIVATE int find_group_hashalloc(struct super_block *sp, struct inode *parent) /* Find first group which has free inode slot. * This is similar to what MFS does. */ -PRIVATE int find_group_any(struct super_block *sp, struct inode *parent) +static int find_group_any(struct super_block *sp, struct inode *parent) { int ngroups = sp->s_groups_count; struct group_desc *gd; @@ -371,7 +371,7 @@ PRIVATE int find_group_any(struct super_block *sp, struct inode *parent) * min_inodes). * */ -PRIVATE int find_group_orlov(struct super_block *sp, struct inode *parent) +static int find_group_orlov(struct super_block *sp, struct inode *parent) { int avefreei = sp->s_free_inodes_count / sp->s_groups_count; int avefreeb = sp->s_free_blocks_count / sp->s_groups_count; @@ -449,7 +449,7 @@ PRIVATE int find_group_orlov(struct super_block *sp, struct inode *parent) /*===========================================================================* * wipe_inode * *===========================================================================*/ -PRIVATE void wipe_inode( +static void wipe_inode( register struct inode *rip /* the inode to be erased */ ) { diff --git a/servers/ext2/inode.c b/servers/ext2/inode.c index 8a30f30bf..f7aeece6f 100644 --- a/servers/ext2/inode.c +++ b/servers/ext2/inode.c @@ -22,16 +22,16 @@ #include "super.h" #include -FORWARD void icopy(struct inode *rip, d_inode *dip, int direction, int +static void icopy(struct inode *rip, d_inode *dip, int direction, int norm); -FORWARD void addhash_inode(struct inode *node); -FORWARD void unhash_inode(struct inode *node); +static void addhash_inode(struct inode *node); +static void unhash_inode(struct inode *node); /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode(void) +int fs_putnode(void) { /* Find the inode specified by the request message and decrease its counter.*/ @@ -70,7 +70,7 @@ PUBLIC int fs_putnode(void) /*===========================================================================* * init_inode_cache * *===========================================================================*/ -PUBLIC void init_inode_cache() +void init_inode_cache() { struct inode *rip; struct inodelist *rlp; @@ -96,7 +96,7 @@ PUBLIC void init_inode_cache() /*===========================================================================* * addhash_inode * *===========================================================================*/ -PRIVATE void addhash_inode(struct inode *node) +static void addhash_inode(struct inode *node) { int hashi = node->i_num & INODE_HASH_MASK; @@ -108,7 +108,7 @@ PRIVATE void addhash_inode(struct inode *node) /*===========================================================================* * unhash_inode * *===========================================================================*/ -PRIVATE void unhash_inode(struct inode *node) +static void unhash_inode(struct inode *node) { /* remove from hash table */ LIST_REMOVE(node, i_hash); @@ -118,7 +118,7 @@ PRIVATE void unhash_inode(struct inode *node) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode( +struct inode *get_inode( dev_t dev, /* device on which inode resides */ ino_t numb /* inode number (ANSI: may not be unshort) */ ) @@ -196,7 +196,7 @@ PUBLIC struct inode *get_inode( /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode( +struct inode *find_inode( dev_t dev, /* device on which inode resides */ ino_t numb /* inode number (ANSI: may not be unshort) */ ) @@ -221,7 +221,7 @@ PUBLIC struct inode *find_inode( /*===========================================================================* * put_inode * *===========================================================================*/ -PUBLIC void put_inode( +void put_inode( register struct inode *rip /* pointer to inode to be released */ ) { @@ -271,7 +271,7 @@ PUBLIC void put_inode( /*===========================================================================* * update_times * *===========================================================================*/ -PUBLIC void update_times( +void update_times( register struct inode *rip /* pointer to inode to be read/written */ ) { @@ -302,7 +302,7 @@ PUBLIC void update_times( /*===========================================================================* * rw_inode * *===========================================================================*/ -PUBLIC void rw_inode( +void rw_inode( register struct inode *rip, /* pointer to inode to be read/written */ int rw_flag /* READING or WRITING */ ) @@ -355,7 +355,7 @@ PUBLIC void rw_inode( /*===========================================================================* * icopy * *===========================================================================*/ -PRIVATE void icopy( +static void icopy( register struct inode *rip, /* pointer to the in-core inode struct */ register d_inode *dip, /* pointer to the on-disk struct */ int direction, /* READING (from disk) or WRITING (to disk) */ @@ -415,7 +415,7 @@ PRIVATE void icopy( /*===========================================================================* * dup_inode * *===========================================================================*/ -PUBLIC void dup_inode( +void dup_inode( struct inode *ip /* The inode to be duplicated. */ ) { diff --git a/servers/ext2/link.c b/servers/ext2/link.c index f4acfec6b..5786076c4 100644 --- a/servers/ext2/link.c +++ b/servers/ext2/link.c @@ -13,14 +13,14 @@ #define SAME 1000 -FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end); -FORWARD int remove_dir(struct inode *rldirp, struct inode *rip, char +static int freesp_inode(struct inode *rip, off_t st, off_t end); +static int remove_dir(struct inode *rldirp, struct inode *rip, char dir_name[NAME_MAX + 1]); -FORWARD int unlink_file(struct inode *dirp, struct inode *rip, char +static int unlink_file(struct inode *dirp, struct inode *rip, char file_name[NAME_MAX + 1]); -FORWARD off_t nextblock(off_t pos, int blocksize); -FORWARD void zeroblock_half(struct inode *i, off_t p, int l); -FORWARD void zeroblock_range(struct inode *i, off_t p, off_t h); +static off_t nextblock(off_t pos, int blocksize); +static void zeroblock_half(struct inode *i, off_t p, int l); +static void zeroblock_range(struct inode *i, off_t p, off_t h); /* Args to zeroblock_half() */ #define FIRST_HALF 0 @@ -30,7 +30,7 @@ FORWARD void zeroblock_range(struct inode *i, off_t p, off_t h); /*===========================================================================* * fs_link * *===========================================================================*/ -PUBLIC int fs_link() +int fs_link() { /* Perform the link(name1, name2) system call. */ @@ -116,7 +116,7 @@ PUBLIC int fs_link() /*===========================================================================* * fs_unlink * *===========================================================================*/ -PUBLIC int fs_unlink() +int fs_unlink() { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -179,7 +179,7 @@ PUBLIC int fs_unlink() /*===========================================================================* * fs_rdlink * *===========================================================================*/ -PUBLIC int fs_rdlink() +int fs_rdlink() { block_t b; /* block containing link text */ struct buf *bp = NULL; /* buffer containing link text */ @@ -232,7 +232,7 @@ PUBLIC int fs_rdlink() /*===========================================================================* * remove_dir * *===========================================================================*/ -PRIVATE int remove_dir(rldirp, rip, dir_name) +static int remove_dir(rldirp, rip, dir_name) struct inode *rldirp; /* parent directory */ struct inode *rip; /* directory to be removed */ char dir_name[NAME_MAX + 1]; /* name of directory to be removed */ @@ -268,7 +268,7 @@ char dir_name[NAME_MAX + 1]; /* name of directory to be removed */ /*===========================================================================* * unlink_file * *===========================================================================*/ -PRIVATE int unlink_file(dirp, rip, file_name) +static int unlink_file(dirp, rip, file_name) struct inode *dirp; /* parent directory of file */ struct inode *rip; /* inode of file, may be NULL too. */ char file_name[NAME_MAX + 1]; /* name of file to be removed */ @@ -304,7 +304,7 @@ char file_name[NAME_MAX + 1]; /* name of file to be removed */ /*===========================================================================* * fs_rename * *===========================================================================*/ -PUBLIC int fs_rename() +int fs_rename() { /* Perform the rename(name1, name2) system call. */ struct inode *old_dirp, *old_ip; /* ptrs to old dir, file inodes */ @@ -517,7 +517,7 @@ PUBLIC int fs_rename() /*===========================================================================* * fs_ftrunc * *===========================================================================*/ -PUBLIC int fs_ftrunc(void) +int fs_ftrunc(void) { struct inode *rip; off_t start, end; @@ -541,7 +541,7 @@ PUBLIC int fs_ftrunc(void) /*===========================================================================* * truncate_inode * *===========================================================================*/ -PUBLIC int truncate_inode(rip, newsize) +int truncate_inode(rip, newsize) register struct inode *rip; /* pointer to inode to be truncated */ off_t newsize; /* inode must become this size */ { @@ -587,7 +587,7 @@ off_t newsize; /* inode must become this size */ /*===========================================================================* * freesp_inode * *===========================================================================*/ -PRIVATE int freesp_inode(rip, start, end) +static int freesp_inode(rip, start, end) register struct inode *rip; /* pointer to inode to be partly freed */ off_t start, end; /* range of bytes to free (end uninclusive) */ { @@ -660,7 +660,7 @@ off_t start, end; /* range of bytes to free (end uninclusive) */ /*===========================================================================* * nextblock * *===========================================================================*/ -PRIVATE off_t nextblock(pos, block_size) +static off_t nextblock(pos, block_size) off_t pos; unsigned short block_size; { @@ -678,7 +678,7 @@ unsigned short block_size; /*===========================================================================* * zeroblock_half * *===========================================================================*/ -PRIVATE void zeroblock_half(rip, pos, half) +static void zeroblock_half(rip, pos, half) struct inode *rip; off_t pos; int half; @@ -708,7 +708,7 @@ int half; /*===========================================================================* * zeroblock_range * *===========================================================================*/ -PRIVATE void zeroblock_range(rip, pos, len) +static void zeroblock_range(rip, pos, len) struct inode *rip; off_t pos; off_t len; diff --git a/servers/ext2/main.c b/servers/ext2/main.c index 13a874758..9c330ef9c 100644 --- a/servers/ext2/main.c +++ b/servers/ext2/main.c @@ -13,18 +13,18 @@ #include "inode.h" /* Declare some local functions. */ -FORWARD void get_work(message *m_in); -FORWARD void reply(endpoint_t who, message *m_out); +static void get_work(message *m_in); +static void reply(endpoint_t who, message *m_out); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); EXTERN int env_argc; EXTERN char **env_argv; -PRIVATE struct optset optset_table[] = { +static struct optset optset_table[] = { { "sb", OPT_INT, &opt.block_with_super, 0 }, { "orlov", OPT_BOOL, &opt.use_orlov, TRUE }, { "oldalloc", OPT_BOOL, &opt.use_orlov, FALSE }, @@ -38,7 +38,7 @@ PRIVATE struct optset optset_table[] = { /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -107,7 +107,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -125,7 +125,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the Minix file server. */ int i; @@ -164,7 +164,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -181,7 +181,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_in) +static void get_work(m_in) message *m_in; /* pointer to message */ { int r, srcok = 0; @@ -209,7 +209,7 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply( +static void reply( endpoint_t who, message *m_out /* report result */ ) diff --git a/servers/ext2/misc.c b/servers/ext2/misc.c index 2ee2e8cf1..be3dc0e37 100644 --- a/servers/ext2/misc.c +++ b/servers/ext2/misc.c @@ -12,7 +12,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -PUBLIC int fs_sync() +int fs_sync() { /* Perform the sync() system call. Flush all the tables. * The order in which the various tables are flushed is critical. The @@ -49,7 +49,7 @@ PUBLIC int fs_sync() /*===========================================================================* * fs_flush * *===========================================================================*/ -PUBLIC int fs_flush() +int fs_flush() { /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. @@ -67,7 +67,7 @@ PUBLIC int fs_flush() /*===========================================================================* * fs_new_driver * *===========================================================================*/ -PUBLIC int fs_new_driver(void) +int fs_new_driver(void) { /* Set a new driver endpoint for this device. */ dev_t dev; diff --git a/servers/ext2/mount.c b/servers/ext2/mount.c index 9d0133154..2952d33f6 100644 --- a/servers/ext2/mount.c +++ b/servers/ext2/mount.c @@ -17,7 +17,7 @@ /*===========================================================================* * fs_readsuper * *===========================================================================*/ -PUBLIC int fs_readsuper() +int fs_readsuper() { /* This function reads the superblock of the partition, gets the root inode * and sends back the details of them. Note, that the FS process does not @@ -170,7 +170,7 @@ PUBLIC int fs_readsuper() /*===========================================================================* * fs_mountpoint * *===========================================================================*/ -PUBLIC int fs_mountpoint() +int fs_mountpoint() { /* This function looks up the mount point, it checks the condition whether * the partition can be mounted on the inode or not. @@ -201,7 +201,7 @@ PUBLIC int fs_mountpoint() /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount() +int fs_unmount() { /* Unmount a file system by device number. */ int count; diff --git a/servers/ext2/open.c b/servers/ext2/open.c index 6ff5b3aab..8c873973d 100644 --- a/servers/ext2/open.c +++ b/servers/ext2/open.c @@ -11,14 +11,14 @@ #include "super.h" #include -FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t +static struct inode *new_node(struct inode *ldirp, char *string, mode_t bits, block_t z0); /*===========================================================================* * fs_create * *===========================================================================*/ -PUBLIC int fs_create() +int fs_create() { phys_bytes len; int r; @@ -78,7 +78,7 @@ PUBLIC int fs_create() /*===========================================================================* * fs_mknod * *===========================================================================*/ -PUBLIC int fs_mknod() +int fs_mknod() { struct inode *ip, *ldirp; char lastc[NAME_MAX + 1]; @@ -114,7 +114,7 @@ PUBLIC int fs_mknod() /*===========================================================================* * fs_mkdir * *===========================================================================*/ -PUBLIC int fs_mkdir() +int fs_mkdir() { int r1, r2; /* status codes */ ino_t dot, dotdot; /* inode numbers for . and .. */ @@ -184,7 +184,7 @@ PUBLIC int fs_mkdir() /*===========================================================================* * fs_slink * *===========================================================================*/ -PUBLIC int fs_slink() +int fs_slink() { phys_bytes len; struct inode *sip; /* inode containing symbolic link */ @@ -275,7 +275,7 @@ PUBLIC int fs_slink() /*===========================================================================* * new_node * *===========================================================================*/ -PRIVATE struct inode *new_node(struct inode *ldirp, +static struct inode *new_node(struct inode *ldirp, char *string, mode_t bits, block_t b0) { /* New_node() is called by fs_open(), fs_mknod(), and fs_mkdir(). @@ -349,7 +349,7 @@ PRIVATE struct inode *new_node(struct inode *ldirp, /*===========================================================================* * fs_inhibread * *===========================================================================*/ -PUBLIC int fs_inhibread() +int fs_inhibread() { struct inode *rip; diff --git a/servers/ext2/path.c b/servers/ext2/path.c index 7e522a2c2..5c8b167a8 100644 --- a/servers/ext2/path.c +++ b/servers/ext2/path.c @@ -23,18 +23,18 @@ #include #include -PUBLIC char dot1[2] = "."; /* used for search_dir to bypass the access */ -PUBLIC char dot2[3] = ".."; /* permissions for . and .. */ +char dot1[2] = "."; /* used for search_dir to bypass the access */ +char dot2[3] = ".."; /* permissions for . and .. */ -FORWARD char *get_name(char *name, char string[NAME_MAX+1]); -FORWARD int ltraverse(struct inode *rip, char *suffix); -FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct +static char *get_name(char *name, char string[NAME_MAX+1]); +static int ltraverse(struct inode *rip, char *suffix); +static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct inode **res_inop, size_t *offsetp, int *symlinkp); /*===========================================================================* * fs_lookup * *===========================================================================*/ -PUBLIC int fs_lookup() +int fs_lookup() { cp_grant_id_t grant; int r, r1, flags, symlinks; @@ -120,7 +120,7 @@ PUBLIC int fs_lookup() /*===========================================================================* * parse_path * *===========================================================================*/ -PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) +static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) ino_t dir_ino; ino_t root_ino; int flags; @@ -280,7 +280,7 @@ int *symlinkp; /*===========================================================================* * ltraverse * *===========================================================================*/ -PRIVATE int ltraverse(rip, suffix) +static int ltraverse(rip, suffix) register struct inode *rip; /* symbolic link */ char *suffix; /* current remaining path. Has to point in the * user_path buffer @@ -363,7 +363,7 @@ char *suffix; /* current remaining path. Has to point in the /*===========================================================================* * advance * *===========================================================================*/ -PUBLIC struct inode *advance(dirp, string, chk_perm) +struct inode *advance(dirp, string, chk_perm) struct inode *dirp; /* inode for directory to be searched */ char string[NAME_MAX + 1]; /* component name to look for */ int chk_perm; /* check permissions when string is looked up*/ @@ -432,7 +432,7 @@ int chk_perm; /* check permissions when string is looked up*/ /*===========================================================================* * get_name * *===========================================================================*/ -PRIVATE char *get_name(path_name, string) +static char *get_name(path_name, string) char *path_name; /* path name to parse */ char string[NAME_MAX+1]; /* component extracted from 'old_name' */ { @@ -482,7 +482,7 @@ char string[NAME_MAX+1]; /* component extracted from 'old_name' */ /*===========================================================================* * search_dir * *===========================================================================*/ -PUBLIC int search_dir(ldir_ptr, string, numb, flag, check_permissions, ftype) +int search_dir(ldir_ptr, string, numb, flag, check_permissions, ftype) register struct inode *ldir_ptr; /* ptr to inode for dir to search */ char string[NAME_MAX + 1]; /* component to search for */ ino_t *numb; /* pointer to inode number */ diff --git a/servers/ext2/protect.c b/servers/ext2/protect.c index 6bea73d29..73b0b54d1 100644 --- a/servers/ext2/protect.c +++ b/servers/ext2/protect.c @@ -7,13 +7,13 @@ #include "super.h" #include -FORWARD int in_group(gid_t grp); +static int in_group(gid_t grp); /*===========================================================================* * fs_chmod * *===========================================================================*/ -PUBLIC int fs_chmod() +int fs_chmod() { /* Perform the chmod(name, mode) system call. */ @@ -42,7 +42,7 @@ PUBLIC int fs_chmod() /*===========================================================================* * fs_chown * *===========================================================================*/ -PUBLIC int fs_chown() +int fs_chown() { register struct inode *rip; register int r; @@ -72,7 +72,7 @@ PUBLIC int fs_chown() /*===========================================================================* * forbidden * *===========================================================================*/ -PUBLIC int forbidden(register struct inode *rip, mode_t access_desired) +int forbidden(register struct inode *rip, mode_t access_desired) { /* Given a pointer to an inode, 'rip', and the access desired, determine * if the access is allowed, and if not why not. The routine looks up the @@ -126,7 +126,7 @@ PUBLIC int forbidden(register struct inode *rip, mode_t access_desired) /*===========================================================================* * in_group * *===========================================================================*/ -PRIVATE int in_group(gid_t grp) +static int in_group(gid_t grp) { int i; @@ -144,7 +144,7 @@ PRIVATE int in_group(gid_t grp) /*===========================================================================* * read_only * *===========================================================================*/ -PUBLIC int read_only(ip) +int read_only(ip) struct inode *ip; /* ptr to inode whose file sys is to be cked */ { /* Check to see if the file system on which the inode 'ip' resides is mounted diff --git a/servers/ext2/read.c b/servers/ext2/read.c index 37c18b008..337f87fb5 100644 --- a/servers/ext2/read.c +++ b/servers/ext2/read.c @@ -16,21 +16,21 @@ #include -FORWARD struct buf *rahead(struct inode *rip, block_t baseblock, u64_t +static struct buf *rahead(struct inode *rip, block_t baseblock, u64_t position, unsigned bytes_ahead); -FORWARD int rw_chunk(struct inode *rip, u64_t position, unsigned off, +static int rw_chunk(struct inode *rip, u64_t position, unsigned off, size_t chunk, unsigned left, int rw_flag, cp_grant_id_t gid, unsigned buf_off, unsigned int block_size, int *completed); -PRIVATE char getdents_buf[GETDENTS_BUFSIZ]; +static char getdents_buf[GETDENTS_BUFSIZ]; -PRIVATE off_t rdahedpos; /* position to read ahead */ -PRIVATE struct inode *rdahed_inode; /* pointer to inode to read ahead */ +static off_t rdahedpos; /* position to read ahead */ +static struct inode *rdahed_inode; /* pointer to inode to read ahead */ /*===========================================================================* * fs_readwrite * *===========================================================================*/ -PUBLIC int fs_readwrite(void) +int fs_readwrite(void) { int r, rw_flag, block_spec; int regular; @@ -139,7 +139,7 @@ PUBLIC int fs_readwrite(void) /*===========================================================================* * fs_breadwrite * *===========================================================================*/ -PUBLIC int fs_breadwrite(void) +int fs_breadwrite(void) { int r, rw_flag, completed; cp_grant_id_t gid; @@ -201,7 +201,7 @@ PUBLIC int fs_breadwrite(void) /*===========================================================================* * rw_chunk * *===========================================================================*/ -PRIVATE int rw_chunk(rip, position, off, chunk, left, rw_flag, gid, +static int rw_chunk(rip, position, off, chunk, left, rw_flag, gid, buf_off, block_size, completed) register struct inode *rip; /* pointer to inode for file to be rd/wr */ u64_t position; /* position within file to read or write */ @@ -290,7 +290,7 @@ int *completed; /* number of bytes copied */ /*===========================================================================* * read_map * *===========================================================================*/ -PUBLIC block_t read_map(rip, position) +block_t read_map(rip, position) register struct inode *rip; /* ptr to inode to map from */ off_t position; /* position in file whose blk wanted */ { @@ -371,7 +371,7 @@ off_t position; /* position in file whose blk wanted */ /*===========================================================================* * rd_indir * *===========================================================================*/ -PUBLIC block_t rd_indir(bp, index) +block_t rd_indir(bp, index) struct buf *bp; /* pointer to indirect block */ int index; /* index into *bp */ { @@ -385,7 +385,7 @@ int index; /* index into *bp */ /*===========================================================================* * read_ahead * *===========================================================================*/ -PUBLIC void read_ahead() +void read_ahead() { /* Read a block into the cache before it is needed. */ unsigned int block_size; @@ -411,7 +411,7 @@ PUBLIC void read_ahead() /*===========================================================================* * rahead * *===========================================================================*/ -PRIVATE struct buf *rahead(rip, baseblock, position, bytes_ahead) +static struct buf *rahead(rip, baseblock, position, bytes_ahead) register struct inode *rip; /* pointer to inode for file to be read */ block_t baseblock; /* block at current position */ u64_t position; /* position within file */ @@ -538,7 +538,7 @@ unsigned bytes_ahead; /* bytes beyond position for immediate use */ /*===========================================================================* * fs_getdents * *===========================================================================*/ -PUBLIC int fs_getdents(void) +int fs_getdents(void) { register struct inode *rip; int o, r, done; diff --git a/servers/ext2/stadir.c b/servers/ext2/stadir.c index 720d5e7ed..85f727b14 100644 --- a/servers/ext2/stadir.c +++ b/servers/ext2/stadir.c @@ -15,7 +15,7 @@ /*===========================================================================* * stat_inode * *===========================================================================*/ -PRIVATE int stat_inode( +static int stat_inode( register struct inode *rip, /* pointer to inode to stat */ endpoint_t who_e, /* Caller endpoint */ cp_grant_id_t gid /* grant for the stat buf */ @@ -63,7 +63,7 @@ PRIVATE int stat_inode( /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_fstatfs() +int fs_fstatfs() { struct statfs st; struct inode *rip; @@ -85,7 +85,7 @@ PUBLIC int fs_fstatfs() /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat() +int fs_stat() { register int r; /* return value */ register struct inode *rip; /* target inode */ @@ -101,7 +101,7 @@ PUBLIC int fs_stat() /*===========================================================================* * fs_statvfs * *===========================================================================*/ -PUBLIC int fs_statvfs() +int fs_statvfs() { struct statvfs st; struct super_block *sp; diff --git a/servers/ext2/super.c b/servers/ext2/super.c index beb3371ed..009b73510 100644 --- a/servers/ext2/super.c +++ b/servers/ext2/super.c @@ -20,22 +20,22 @@ #include "super.h" #include "const.h" -FORWARD off_t ext2_max_size(int block_size); -FORWARD u32_t ext2_count_dirs(struct super_block *sp); +static off_t ext2_max_size(int block_size); +static u32_t ext2_count_dirs(struct super_block *sp); -FORWARD void super_copy(register struct super_block *dest, register +static void super_copy(register struct super_block *dest, register struct super_block *source); -FORWARD void copy_group_descriptors(register struct group_desc +static void copy_group_descriptors(register struct group_desc *dest_array, register struct group_desc *source_array, unsigned int ngroups); -PRIVATE off_t super_block_offset; +static off_t super_block_offset; /*===========================================================================* * get_super * *===========================================================================*/ -PUBLIC struct super_block *get_super( +struct super_block *get_super( dev_t dev /* device number whose super_block is sought */ ) { @@ -51,19 +51,19 @@ PUBLIC struct super_block *get_super( /*===========================================================================* * get_block_size * *===========================================================================*/ -PUBLIC unsigned int get_block_size(dev_t dev) +unsigned int get_block_size(dev_t dev) { if (dev == NO_DEV) panic("request for block size of NO_DEV"); return(fs_block_size); } -PRIVATE struct group_desc *ondisk_group_descs; +static struct group_desc *ondisk_group_descs; /*===========================================================================* * read_super * *===========================================================================*/ -PUBLIC int read_super(sp) +int read_super(sp) register struct super_block *sp; /* pointer to a superblock */ { /* Read a superblock. */ @@ -214,7 +214,7 @@ register struct super_block *sp; /* pointer to a superblock */ /*===========================================================================* * write_super * *===========================================================================*/ -PUBLIC void write_super(sp) +void write_super(sp) struct super_block *sp; /* pointer to a superblock */ { /* Write a superblock and gdt. */ @@ -271,7 +271,7 @@ struct group_desc* get_group_desc(unsigned int bnum) } -PRIVATE u32_t ext2_count_dirs(struct super_block *sp) +static u32_t ext2_count_dirs(struct super_block *sp) { u32_t count = 0; unsigned int i; @@ -302,7 +302,7 @@ PRIVATE u32_t ext2_count_dirs(struct super_block *sp) * Anyway this function is safe for any change. * Note: there is also limitation from VFS (to LONG_MAX, i.e. 2GB). */ -PRIVATE off_t ext2_max_size(int block_size) +static off_t ext2_max_size(int block_size) { /* 12 is EXT2_NDIR_BLOCKS used in calculations. */ if (EXT2_NDIR_BLOCKS != 12) @@ -352,7 +352,7 @@ PRIVATE off_t ext2_max_size(int block_size) /*===========================================================================* * super_copy * *===========================================================================*/ -PRIVATE void super_copy( +static void super_copy( register struct super_block *dest, register struct super_block *source ) @@ -411,7 +411,7 @@ PRIVATE void super_copy( /*===========================================================================* * gd_copy * *===========================================================================*/ -PRIVATE void gd_copy( +static void gd_copy( register struct group_desc *dest, register struct group_desc *source ) @@ -434,7 +434,7 @@ PRIVATE void gd_copy( /*===========================================================================* * copy_group_descriptors * *===========================================================================*/ -PRIVATE void copy_group_descriptors( +static void copy_group_descriptors( register struct group_desc *dest_array, register struct group_desc *source_array, unsigned int ngroups diff --git a/servers/ext2/table.c b/servers/ext2/table.c index 251b7954a..6c384a3d6 100644 --- a/servers/ext2/table.c +++ b/servers/ext2/table.c @@ -12,7 +12,7 @@ #include "buf.h" #include "super.h" -PUBLIC int (*fs_call_vec[])(void) = { +int (*fs_call_vec[])(void) = { no_sys, /* 0 not used */ no_sys, /* 1 */ /* Was: fs_getnode */ fs_putnode, /* 2 */ diff --git a/servers/ext2/time.c b/servers/ext2/time.c index 9ae6170cd..864326b8d 100644 --- a/servers/ext2/time.c +++ b/servers/ext2/time.c @@ -12,7 +12,7 @@ /*===========================================================================* * fs_utime * *===========================================================================*/ -PUBLIC int fs_utime() +int fs_utime() { register struct inode *rip; register int r; diff --git a/servers/ext2/utility.c b/servers/ext2/utility.c index 08f12c074..f03785798 100644 --- a/servers/ext2/utility.c +++ b/servers/ext2/utility.c @@ -11,7 +11,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* Somebody has used an illegal system call number */ printf("no_sys: invalid call %d\n", req_nr); @@ -22,7 +22,7 @@ PUBLIC int no_sys() /*===========================================================================* * conv2 * *===========================================================================*/ -PUBLIC unsigned conv2(norm, w) +unsigned conv2(norm, w) int norm; /* TRUE if no swap, FALSE for byte swap */ int w; /* promotion of 16-bit word to be swapped */ { @@ -35,7 +35,7 @@ int w; /* promotion of 16-bit word to be swapped */ /*===========================================================================* * conv4 * *===========================================================================*/ -PUBLIC long conv4(norm, x) +long conv4(norm, x) int norm; /* TRUE if no swap, FALSE for byte swap */ long x; /* 32-bit long to be byte swapped */ { @@ -54,7 +54,7 @@ long x; /* 32-bit long to be byte swapped */ /*===========================================================================* * clock_time * *===========================================================================*/ -PUBLIC time_t clock_time() +time_t clock_time() { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant @@ -75,7 +75,7 @@ PUBLIC time_t clock_time() /*===========================================================================* * mfs_min * *===========================================================================*/ -PUBLIC int min(unsigned int l, unsigned int r) +int min(unsigned int l, unsigned int r) { if(r >= l) return(l); @@ -86,7 +86,7 @@ PUBLIC int min(unsigned int l, unsigned int r) /*===========================================================================* * mfs_nul * *===========================================================================*/ -PUBLIC void mfs_nul_f(char *file, int line, char *str, unsigned int len, +void mfs_nul_f(char *file, int line, char *str, unsigned int len, unsigned int maxlen) { if(len < maxlen && str[len-1] != '\0') { @@ -102,7 +102,7 @@ PUBLIC void mfs_nul_f(char *file, int line, char *str, unsigned int len, /*===========================================================================* * sanity_check * *===========================================================================*/ -PUBLIC void sanitycheck(char *file, int line) +void sanitycheck(char *file, int line) { MYASSERT(SELF_E > 0); if(superblock->s_dev != NO_DEV) { @@ -116,7 +116,7 @@ PUBLIC void sanitycheck(char *file, int line) /*===========================================================================* * ansi_strcmp * *===========================================================================*/ -PUBLIC int ansi_strcmp(register const char* ansi_s, register const char *s2, +int ansi_strcmp(register const char* ansi_s, register const char *s2, register size_t ansi_s_length) { /* Compare non null-terminated string ansi_s (length=ansi_s_length) @@ -143,7 +143,7 @@ PUBLIC int ansi_strcmp(register const char* ansi_s, register const char *s2, /*===========================================================================* * setbit * *===========================================================================*/ -PUBLIC bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) +bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) { /* Find free bit in bitmap and set. Return number of the bit, * if failed return -1. @@ -192,7 +192,7 @@ PUBLIC bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) /*===========================================================================* * setbyte * *===========================================================================*/ -PUBLIC bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) +bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) { /* Find free byte in bitmap and set it. Return number of the starting bit, * if failed return -1. @@ -233,7 +233,7 @@ PUBLIC bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word) /*===========================================================================* * unsetbit * *===========================================================================*/ -PUBLIC int unsetbit(bitchunk_t *bitmap, bit_t bit) +int unsetbit(bitchunk_t *bitmap, bit_t bit) { /* Unset specified bit. If requested bit is already free return -1, * otherwise return 0. diff --git a/servers/ext2/write.c b/servers/ext2/write.c index 9e5aeae00..689ae0086 100644 --- a/servers/ext2/write.c +++ b/servers/ext2/write.c @@ -16,13 +16,13 @@ #include "inode.h" #include "super.h" -FORWARD void wr_indir(struct buf *bp, int index, block_t block); -FORWARD int empty_indir(struct buf *, struct super_block *); +static void wr_indir(struct buf *bp, int index, block_t block); +static int empty_indir(struct buf *, struct super_block *); /*===========================================================================* * write_map * *===========================================================================*/ -PUBLIC int write_map(rip, position, new_block, op) +int write_map(rip, position, new_block, op) struct inode *rip; /* pointer to inode to be changed */ off_t position; /* file address to be mapped */ block_t new_block; /* block # to be inserted */ @@ -267,7 +267,7 @@ int op; /* special actions */ /*===========================================================================* * wr_indir * *===========================================================================*/ -PRIVATE void wr_indir(bp, index, block) +static void wr_indir(bp, index, block) struct buf *bp; /* pointer to indirect block */ int index; /* index into *bp */ block_t block; /* block to write */ @@ -285,7 +285,7 @@ block_t block; /* block to write */ /*===========================================================================* * empty_indir * *===========================================================================*/ -PRIVATE int empty_indir(bp, sb) +static int empty_indir(bp, sb) struct buf *bp; /* pointer to indirect block */ struct super_block *sb; /* superblock of device block resides on */ { @@ -303,7 +303,7 @@ struct super_block *sb; /* superblock of device block resides on */ /*===========================================================================* * new_block * *===========================================================================*/ -PUBLIC struct buf *new_block(rip, position) +struct buf *new_block(rip, position) register struct inode *rip; /* pointer to inode */ off_t position; /* file pointer */ { @@ -364,7 +364,7 @@ off_t position; /* file pointer */ /*===========================================================================* * zero_block * *===========================================================================*/ -PUBLIC void zero_block(bp) +void zero_block(bp) register struct buf *bp; /* pointer to buffer to zero */ { /* Zero a block. */ diff --git a/servers/hgfs/dentry.c b/servers/hgfs/dentry.c index 5e127b714..26a938c75 100644 --- a/servers/hgfs/dentry.c +++ b/servers/hgfs/dentry.c @@ -12,15 +12,15 @@ #include "inc.h" -PRIVATE LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS]; +static LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS]; -FORWARD void del_one_dentry(struct inode *ino); -FORWARD unsigned int hash_dentry(struct inode *parent, char *name); +static void del_one_dentry(struct inode *ino); +static unsigned int hash_dentry(struct inode *parent, char *name); /*===========================================================================* * init_dentry * *===========================================================================*/ -PUBLIC void init_dentry() +void init_dentry() { /* Initialize the names hashtable. */ @@ -33,7 +33,7 @@ PUBLIC void init_dentry() /*===========================================================================* * lookup_dentry * *===========================================================================*/ -PUBLIC struct inode *lookup_dentry(parent, name) +struct inode *lookup_dentry(parent, name) struct inode *parent; char *name; { @@ -64,7 +64,7 @@ char *name; /*===========================================================================* * add_dentry * *===========================================================================*/ -PUBLIC void add_dentry(parent, name, ino) +void add_dentry(parent, name, ino) struct inode *parent; char *name; struct inode *ino; @@ -92,7 +92,7 @@ struct inode *ino; /*===========================================================================* * del_one_dentry * *===========================================================================*/ -PRIVATE void del_one_dentry(ino) +static void del_one_dentry(ino) struct inode *ino; { /* This inode has become inaccessible by name. Disassociate it from its parent @@ -123,7 +123,7 @@ struct inode *ino; /*===========================================================================* * del_dentry * *===========================================================================*/ -PUBLIC void del_dentry(ino) +void del_dentry(ino) struct inode *ino; { /* Disassociate an inode from its parent, effectively deleting it. Recursively @@ -167,7 +167,7 @@ struct inode *ino; /*===========================================================================* * hash_dentry * *===========================================================================*/ -PRIVATE unsigned int hash_dentry(parent, name) +static unsigned int hash_dentry(parent, name) struct inode *parent; char *name; { diff --git a/servers/hgfs/handle.c b/servers/hgfs/handle.c index 580e53df6..27ee1fe07 100644 --- a/servers/hgfs/handle.c +++ b/servers/hgfs/handle.c @@ -15,7 +15,7 @@ /*===========================================================================* * get_handle * *===========================================================================*/ -PUBLIC int get_handle(ino) +int get_handle(ino) struct inode *ino; { /* Get an open file or directory handle for an inode. @@ -55,7 +55,7 @@ struct inode *ino; /*===========================================================================* * put_handle * *===========================================================================*/ -PUBLIC void put_handle(ino) +void put_handle(ino) struct inode *ino; { /* Close an open file or directory handle associated with an inode. diff --git a/servers/hgfs/inode.c b/servers/hgfs/inode.c index 8e0e6336a..0320bde32 100644 --- a/servers/hgfs/inode.c +++ b/servers/hgfs/inode.c @@ -18,14 +18,14 @@ #include "inc.h" -PRIVATE struct inode inodes[NUM_INODES]; +static struct inode inodes[NUM_INODES]; -PRIVATE TAILQ_HEAD(free_head, inode) free_list; +static TAILQ_HEAD(free_head, inode) free_list; /*===========================================================================* * init_inode * *===========================================================================*/ -PUBLIC struct inode *init_inode() +struct inode *init_inode() { /* Initialize inode table. Return the root inode. */ @@ -65,7 +65,7 @@ PUBLIC struct inode *init_inode() /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode(ino_nr) +struct inode *find_inode(ino_nr) ino_t ino_nr; { /* Get an inode based on its inode number. Do not increase its reference count. @@ -102,7 +102,7 @@ ino_t ino_nr; /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC void get_inode(ino) +void get_inode(ino) struct inode *ino; { /* Increase the given inode's reference count. If both reference and link @@ -126,7 +126,7 @@ struct inode *ino; /*===========================================================================* * put_inode * *===========================================================================*/ -PUBLIC void put_inode(ino) +void put_inode(ino) struct inode *ino; { /* Decrease an inode's reference count. If this count has reached zero, close @@ -166,7 +166,7 @@ struct inode *ino; /*===========================================================================* * link_inode * *===========================================================================*/ -PUBLIC void link_inode(parent, ino) +void link_inode(parent, ino) struct inode *parent; struct inode *ino; { @@ -187,7 +187,7 @@ struct inode *ino; /*===========================================================================* * unlink_inode * *===========================================================================*/ -PUBLIC void unlink_inode(ino) +void unlink_inode(ino) struct inode *ino; { /* Unlink an inode from its parent. If both reference and link count have @@ -213,7 +213,7 @@ struct inode *ino; /*===========================================================================* * get_free_inode * *===========================================================================*/ -PUBLIC struct inode *get_free_inode() +struct inode *get_free_inode() { /* Return a free inode object (with reference count 1), if available. */ @@ -250,7 +250,7 @@ PUBLIC struct inode *get_free_inode() /*===========================================================================* * have_free_inode * *===========================================================================*/ -PUBLIC int have_free_inode() +int have_free_inode() { /* Check whether there are any free inodes at the moment. Kind of lame, but * this allows for easier error recovery in some places. @@ -262,7 +262,7 @@ PUBLIC int have_free_inode() /*===========================================================================* * have_used_inode * *===========================================================================*/ -PUBLIC int have_used_inode() +int have_used_inode() { /* Check whether any inodes are still in use, that is, any of the inodes have * a reference count larger than zero. @@ -279,7 +279,7 @@ PUBLIC int have_used_inode() /*===========================================================================* * do_putnode * *===========================================================================*/ -PUBLIC int do_putnode() +int do_putnode() { /* Decrease an inode's reference count. */ diff --git a/servers/hgfs/link.c b/servers/hgfs/link.c index 47b2bbb7b..51b6d906a 100644 --- a/servers/hgfs/link.c +++ b/servers/hgfs/link.c @@ -15,12 +15,12 @@ #include -FORWARD int force_remove(char *path, int dir); +static int force_remove(char *path, int dir); /*===========================================================================* * do_create * *===========================================================================*/ -PUBLIC int do_create() +int do_create() { /* Create a new file. */ @@ -128,7 +128,7 @@ PUBLIC int do_create() /*===========================================================================* * do_mkdir * *===========================================================================*/ -PUBLIC int do_mkdir() +int do_mkdir() { /* Make a new directory. */ @@ -177,7 +177,7 @@ PUBLIC int do_mkdir() /*===========================================================================* * force_remove * *===========================================================================*/ -PRIVATE int force_remove(path, dir) +static int force_remove(path, dir) char *path; /* path to file or directory */ int dir; /* TRUE iff directory */ { @@ -232,7 +232,7 @@ int dir; /* TRUE iff directory */ /*===========================================================================* * do_unlink * *===========================================================================*/ -PUBLIC int do_unlink() +int do_unlink() { /* Delete a file. */ @@ -279,7 +279,7 @@ PUBLIC int do_unlink() /*===========================================================================* * do_rmdir * *===========================================================================*/ -PUBLIC int do_rmdir() +int do_rmdir() { /* Remove an empty directory. */ @@ -327,7 +327,7 @@ PUBLIC int do_rmdir() /*===========================================================================* * do_rename * *===========================================================================*/ -PUBLIC int do_rename() +int do_rename() { /* Rename a file or directory. */ diff --git a/servers/hgfs/lookup.c b/servers/hgfs/lookup.c index 96753801a..eb0154e97 100644 --- a/servers/hgfs/lookup.c +++ b/servers/hgfs/lookup.c @@ -9,19 +9,19 @@ #include "inc.h" -FORWARD int get_mask(vfs_ucred_t *ucred); -FORWARD int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int +static int get_mask(vfs_ucred_t *ucred); +static int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int uid, int mask); -FORWARD int next_name(char **ptr, char **start, char name[NAME_MAX+1]); -FORWARD int go_up(char path[PATH_MAX], struct inode *ino, struct inode +static int next_name(char **ptr, char **start, char name[NAME_MAX+1]); +static int go_up(char path[PATH_MAX], struct inode *ino, struct inode **res_ino, struct hgfs_attr *attr); -FORWARD int go_down(char path[PATH_MAX], struct inode *ino, char *name, +static int go_down(char path[PATH_MAX], struct inode *ino, char *name, struct inode **res_ino, struct hgfs_attr *attr); /*===========================================================================* * get_mask * *===========================================================================*/ -PRIVATE int get_mask(ucred) +static int get_mask(ucred) vfs_ucred_t *ucred; /* credentials of the caller */ { /* Given the caller's credentials, precompute a search access mask to test @@ -42,7 +42,7 @@ vfs_ucred_t *ucred; /* credentials of the caller */ /*===========================================================================* * access_as_dir * *===========================================================================*/ -PRIVATE int access_as_dir(ino, attr, uid, mask) +static int access_as_dir(ino, attr, uid, mask) struct inode *ino; /* the inode to test */ struct hgfs_attr *attr; /* attributes of the inode */ int uid; /* UID of the caller */ @@ -69,7 +69,7 @@ int mask; /* search access mask of the caller */ /*===========================================================================* * next_name * *===========================================================================*/ -PRIVATE int next_name(ptr, start, name) +static int next_name(ptr, start, name) char **ptr; /* cursor pointer into path (in, out) */ char **start; /* place to store start of name */ char name[NAME_MAX+1]; /* place to store name */ @@ -102,7 +102,7 @@ char name[NAME_MAX+1]; /* place to store name */ /*===========================================================================* * go_up * *===========================================================================*/ -PRIVATE int go_up(path, ino, res_ino, attr) +static int go_up(path, ino, res_ino, attr) char path[PATH_MAX]; /* path to take the last part from */ struct inode *ino; /* inode of the current directory */ struct inode **res_ino; /* place to store resulting inode */ @@ -131,7 +131,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */ /*===========================================================================* * go_down * *===========================================================================*/ -PRIVATE int go_down(path, parent, name, res_ino, attr) +static int go_down(path, parent, name, res_ino, attr) char path[PATH_MAX]; /* path to add the name to */ struct inode *parent; /* inode of the current directory */ char *name; /* name of the directory entry */ @@ -190,7 +190,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */ /*===========================================================================* * do_lookup * *===========================================================================*/ -PUBLIC int do_lookup() +int do_lookup() { /* Resolve a path string to an inode. */ diff --git a/servers/hgfs/main.c b/servers/hgfs/main.c index faec0ddaa..a0c94360f 100644 --- a/servers/hgfs/main.c +++ b/servers/hgfs/main.c @@ -13,10 +13,10 @@ #include #include -FORWARD void get_work(endpoint_t *who_e); -FORWARD void send_reply(int err, int transid); +static void get_work(endpoint_t *who_e); +static void send_reply(int err, int transid); -PRIVATE struct optset optset_table[] = { +static struct optset optset_table[] = { { "prefix", OPT_STRING, opt.prefix, sizeof(opt.prefix) }, { "uid", OPT_INT, &opt.uid, 10 }, { "gid", OPT_INT, &opt.gid, 10 }, @@ -28,14 +28,14 @@ PRIVATE struct optset optset_table[] = { }; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize this file server. Called at startup time. */ @@ -74,7 +74,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -94,7 +94,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -111,7 +111,7 @@ PRIVATE void sef_local_startup(void) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { @@ -166,7 +166,7 @@ char *argv[]; /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(who_e) +static void get_work(who_e) endpoint_t *who_e; { /* Receive a request message from VFS. Return the request call number. @@ -182,7 +182,7 @@ endpoint_t *who_e; /*===========================================================================* * send_reply * *===========================================================================*/ -PRIVATE void send_reply(err, transid) +static void send_reply(err, transid) int err; /* resulting error code */ int transid; { diff --git a/servers/hgfs/misc.c b/servers/hgfs/misc.c index 0cb80566c..7135941dc 100644 --- a/servers/hgfs/misc.c +++ b/servers/hgfs/misc.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_fstatfs * *===========================================================================*/ -PUBLIC int do_fstatfs() +int do_fstatfs() { /* Retrieve file system statistics. */ @@ -31,7 +31,7 @@ PUBLIC int do_fstatfs() /*===========================================================================* * do_statvfs * *===========================================================================*/ -PUBLIC int do_statvfs() +int do_statvfs() { /* Retrieve file system statistics. */ diff --git a/servers/hgfs/mount.c b/servers/hgfs/mount.c index 5f9693069..ab154fe38 100644 --- a/servers/hgfs/mount.c +++ b/servers/hgfs/mount.c @@ -13,7 +13,7 @@ /*===========================================================================* * do_readsuper * *===========================================================================*/ -PUBLIC int do_readsuper() +int do_readsuper() { /* Mount the file system. */ @@ -72,7 +72,7 @@ PUBLIC int do_readsuper() /*===========================================================================* * do_unmount * *===========================================================================*/ -PUBLIC int do_unmount() +int do_unmount() { /* Unmount the file system. */ diff --git a/servers/hgfs/name.c b/servers/hgfs/name.c index 39aa54063..28a8d4254 100644 --- a/servers/hgfs/name.c +++ b/servers/hgfs/name.c @@ -15,7 +15,7 @@ /*===========================================================================* * normalize_name * *===========================================================================*/ -PUBLIC void normalize_name(dst, src) +void normalize_name(dst, src) char dst[NAME_MAX+1]; char *src; { @@ -38,7 +38,7 @@ char *src; /*===========================================================================* * compare_name * *===========================================================================*/ -PUBLIC int compare_name(name1, name2) +int compare_name(name1, name2) char *name1; char *name2; { diff --git a/servers/hgfs/path.c b/servers/hgfs/path.c index 20fff640b..0ba1384be 100644 --- a/servers/hgfs/path.c +++ b/servers/hgfs/path.c @@ -14,7 +14,7 @@ /*===========================================================================* * make_path * *===========================================================================*/ -PUBLIC int make_path(path, ino) +int make_path(path, ino) char path[PATH_MAX]; struct inode *ino; { @@ -68,7 +68,7 @@ struct inode *ino; /*===========================================================================* * push_path * *===========================================================================*/ -PUBLIC int push_path(path, name) +int push_path(path, name) char path[PATH_MAX]; char *name; { @@ -92,7 +92,7 @@ char *name; /*===========================================================================* * pop_path * *===========================================================================*/ -PUBLIC void pop_path(path) +void pop_path(path) char path[PATH_MAX]; { /* Remove the last component from a path. diff --git a/servers/hgfs/read.c b/servers/hgfs/read.c index bd4f8ba53..63c2313a2 100644 --- a/servers/hgfs/read.c +++ b/servers/hgfs/read.c @@ -17,7 +17,7 @@ /*===========================================================================* * do_read * *===========================================================================*/ -PUBLIC int do_read() +int do_read() { /* Read data from a file. */ @@ -77,7 +77,7 @@ PUBLIC int do_read() /*===========================================================================* * do_getdents * *===========================================================================*/ -PUBLIC int do_getdents() +int do_getdents() { /* Retrieve directory entries. */ diff --git a/servers/hgfs/stat.c b/servers/hgfs/stat.c index d7f04eb1b..0924337cd 100644 --- a/servers/hgfs/stat.c +++ b/servers/hgfs/stat.c @@ -15,7 +15,7 @@ /*===========================================================================* * get_mode * *===========================================================================*/ -PUBLIC mode_t get_mode(ino, mode) +mode_t get_mode(ino, mode) struct inode *ino; int mode; { @@ -39,7 +39,7 @@ int mode; /*===========================================================================* * do_stat * *===========================================================================*/ -PUBLIC int do_stat() +int do_stat() { /* Retrieve inode status. */ @@ -102,7 +102,7 @@ PUBLIC int do_stat() /*===========================================================================* * do_chmod * *===========================================================================*/ -PUBLIC int do_chmod() +int do_chmod() { /* Change file mode. */ @@ -139,7 +139,7 @@ PUBLIC int do_chmod() /*===========================================================================* * do_utime * *===========================================================================*/ -PUBLIC int do_utime() +int do_utime() { /* Set file times. */ diff --git a/servers/hgfs/table.c b/servers/hgfs/table.c index fe5d897ec..1744fcbfd 100644 --- a/servers/hgfs/table.c +++ b/servers/hgfs/table.c @@ -7,7 +7,7 @@ #define _TABLE #include "inc.h" -PUBLIC int (*call_vec[])(void) = { +int (*call_vec[])(void) = { no_sys, /* 0 */ no_sys, /* 1 getnode */ do_putnode, /* 2 putnode */ diff --git a/servers/hgfs/util.c b/servers/hgfs/util.c index af463c367..cf23e183a 100644 --- a/servers/hgfs/util.c +++ b/servers/hgfs/util.c @@ -14,7 +14,7 @@ /*===========================================================================* * get_name * *===========================================================================*/ -PUBLIC int get_name(grant, len, name) +int get_name(grant, len, name) cp_grant_id_t grant; /* memory grant for the path component */ size_t len; /* length of the name, including '\0' */ char name[NAME_MAX+1]; /* buffer in which store the result */ @@ -43,7 +43,7 @@ char name[NAME_MAX+1]; /* buffer in which store the result */ /*===========================================================================* * do_noop * *===========================================================================*/ -PUBLIC int do_noop() +int do_noop() { /* Generic handler for no-op system calls. */ @@ -54,7 +54,7 @@ PUBLIC int do_noop() /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* Generic handler for unimplemented system calls. */ diff --git a/servers/hgfs/verify.c b/servers/hgfs/verify.c index cac0f00ca..e4da75d46 100644 --- a/servers/hgfs/verify.c +++ b/servers/hgfs/verify.c @@ -14,7 +14,7 @@ /*===========================================================================* * verify_path * *===========================================================================*/ -PUBLIC int verify_path(path, ino, attr, stale) +int verify_path(path, ino, attr, stale) char path[PATH_MAX]; struct inode *ino; struct hgfs_attr *attr; @@ -60,7 +60,7 @@ int *stale; /*===========================================================================* * verify_inode * *===========================================================================*/ -PUBLIC int verify_inode(ino, path, attr) +int verify_inode(ino, path, attr) struct inode *ino; /* inode to verify */ char path[PATH_MAX]; /* buffer in which to store the path */ struct hgfs_attr *attr; /* buffer for attributes, or NULL */ @@ -87,7 +87,7 @@ struct hgfs_attr *attr; /* buffer for attributes, or NULL */ /*===========================================================================* * verify_dentry * *===========================================================================*/ -PUBLIC int verify_dentry(parent, name, path, res_ino) +int verify_dentry(parent, name, path, res_ino) struct inode *parent; /* parent inode: the inode to verify */ char name[NAME_MAX+1]; /* the given directory entry path component */ char path[PATH_MAX]; /* buffer to store the resulting path in */ diff --git a/servers/hgfs/write.c b/servers/hgfs/write.c index 0f09552b0..5fd5780d1 100644 --- a/servers/hgfs/write.c +++ b/servers/hgfs/write.c @@ -10,13 +10,13 @@ #include "inc.h" -FORWARD int write_file(struct inode *ino, u64_t *posp, size_t *countp, +static int write_file(struct inode *ino, u64_t *posp, size_t *countp, cp_grant_id_t *grantp); /*===========================================================================* * write_file * *===========================================================================*/ -PRIVATE int write_file(ino, posp, countp, grantp) +static int write_file(ino, posp, countp, grantp) struct inode *ino; u64_t *posp; size_t *countp; @@ -79,7 +79,7 @@ cp_grant_id_t *grantp; /*===========================================================================* * do_write * *===========================================================================*/ -PUBLIC int do_write() +int do_write() { /* Write data to a file. */ @@ -116,7 +116,7 @@ PUBLIC int do_write() /*===========================================================================* * do_ftrunc * *===========================================================================*/ -PUBLIC int do_ftrunc() +int do_ftrunc() { /* Change file size or create file holes. */ diff --git a/servers/inet/buf.c b/servers/inet/buf.c index a349c0e19..5a2f20dff 100644 --- a/servers/inet/buf.c +++ b/servers/inet/buf.c @@ -60,53 +60,53 @@ THIS_FILE #if BUF512_NR DECLARE_TYPE(buf512, buf512_t, 512); -PRIVATE acc_t *buf512_freelist; +static acc_t *buf512_freelist; DECLARE_STORAGE(buf512_t, buffers512, BUF512_NR); -FORWARD void bf_512free ARGS(( acc_t *acc )); +static void bf_512free ARGS(( acc_t *acc )); #endif #if BUF2K_NR DECLARE_TYPE(buf2K, buf2K_t, (2*1024)); -PRIVATE acc_t *buf2K_freelist; +static acc_t *buf2K_freelist; DECLARE_STORAGE(buf2K_t, buffers2K, BUF2K_NR); -FORWARD void bf_2Kfree ARGS(( acc_t *acc )); +static void bf_2Kfree ARGS(( acc_t *acc )); #endif #if BUF32K_NR DECLARE_TYPE(buf32K, buf32K_t, (32*1024)); -PRIVATE acc_t *buf32K_freelist; +static acc_t *buf32K_freelist; DECLARE_STORAGE(buf32K_t, buffers32K, BUF32K_NR); -FORWARD void bf_32Kfree ARGS(( acc_t *acc )); +static void bf_32Kfree ARGS(( acc_t *acc )); #endif -PRIVATE acc_t *acc_freelist; +static acc_t *acc_freelist; DECLARE_STORAGE(acc_t, accessors, ACC_NR); -PRIVATE bf_freereq_t freereq[CLIENT_NR]; -PRIVATE size_t bf_buf_gran; +static bf_freereq_t freereq[CLIENT_NR]; +static size_t bf_buf_gran; -PUBLIC size_t bf_free_bufsize; -PUBLIC acc_t *bf_temporary_acc; -PUBLIC acc_t *bf_linkcheck_acc; +size_t bf_free_bufsize; +acc_t *bf_temporary_acc; +acc_t *bf_linkcheck_acc; #ifdef BUF_CONSISTENCY_CHECK int inet_buf_debug; unsigned buf_generation; -PRIVATE bf_checkreq_t checkreq[CLIENT_NR]; +static bf_checkreq_t checkreq[CLIENT_NR]; #endif #ifndef BUF_TRACK_ALLOC_FREE -FORWARD acc_t *bf_small_memreq ARGS(( size_t size )); +static acc_t *bf_small_memreq ARGS(( size_t size )); #else -FORWARD acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line, +static acc_t *_bf_small_memreq ARGS(( char *clnt_file, int clnt_line, size_t size )); #define bf_small_memreq(a) _bf_small_memreq(clnt_file, clnt_line, a) #endif -FORWARD void free_accs ARGS(( void )); +static void free_accs ARGS(( void )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void count_free_bufs ARGS(( acc_t *list )); -FORWARD int report_buffer ARGS(( buf_t *buf, char *label, int i )); +static void count_free_bufs ARGS(( acc_t *list )); +static int report_buffer ARGS(( buf_t *buf, char *label, int i )); #endif -PUBLIC void bf_init() +void bf_init() { int i; size_t buf_s; @@ -189,10 +189,10 @@ PUBLIC void bf_init() } #ifndef BUF_CONSISTENCY_CHECK -PUBLIC void bf_logon(func) +void bf_logon(func) bf_freereq_t func; #else -PUBLIC void bf_logon(func, checkfunc) +void bf_logon(func, checkfunc) bf_freereq_t func; bf_checkreq_t checkfunc; #endif @@ -217,9 +217,9 @@ bf_memreq */ #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_memreq(size) +acc_t *bf_memreq(size) #else -PUBLIC acc_t *_bf_memreq(clnt_file, clnt_line, size) +acc_t *_bf_memreq(clnt_file, clnt_line, size) char *clnt_file; int clnt_line; #endif @@ -322,9 +322,9 @@ bf_small_memreq */ #ifndef BUF_TRACK_ALLOC_FREE -PRIVATE acc_t *bf_small_memreq(size) +static acc_t *bf_small_memreq(size) #else -PRIVATE acc_t *_bf_small_memreq(clnt_file, clnt_line, size) +static acc_t *_bf_small_memreq(clnt_file, clnt_line, size) char *clnt_file; int clnt_line; #endif @@ -334,9 +334,9 @@ size_t size; } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC void bf_afree(acc) +void bf_afree(acc) #else -PUBLIC void _bf_afree(clnt_file, clnt_line, acc) +void _bf_afree(clnt_file, clnt_line, acc) char *clnt_file; int clnt_line; #endif @@ -401,9 +401,9 @@ acc_t *acc; } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_dupacc(acc_ptr) +acc_t *bf_dupacc(acc_ptr) #else -PUBLIC acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr) +acc_t *_bf_dupacc(clnt_file, clnt_line, acc_ptr) char *clnt_file; int clnt_line; #endif @@ -433,7 +433,7 @@ register acc_t *acc_ptr; return new_acc; } -PUBLIC size_t bf_bufsize(acc_ptr) +size_t bf_bufsize(acc_ptr) register acc_t *acc_ptr; { register size_t size; @@ -452,9 +452,9 @@ assert(acc_ptr >= accessors && acc_ptr <= &accessors[ACC_NR-1]); } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_packIffLess(pack, min_len) +acc_t *bf_packIffLess(pack, min_len) #else -PUBLIC acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len) +acc_t *_bf_packIffLess(clnt_file, clnt_line, pack, min_len) char *clnt_file; int clnt_line; #endif @@ -474,9 +474,9 @@ int min_len; } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_pack(old_acc) +acc_t *bf_pack(old_acc) #else -PUBLIC acc_t *_bf_pack(clnt_file, clnt_line, old_acc) +acc_t *_bf_pack(clnt_file, clnt_line, old_acc) char *clnt_file; int clnt_line; #endif @@ -532,9 +532,9 @@ acc_t *old_acc; } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_cut (data, offset, length) +acc_t *bf_cut (data, offset, length) #else -PUBLIC acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length) +acc_t *_bf_cut (clnt_file, clnt_line, data, offset, length) char *clnt_file; int clnt_line; #endif @@ -614,9 +614,9 @@ register unsigned length; } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_delhead (data, offset) +acc_t *bf_delhead (data, offset) #else -PUBLIC acc_t *_bf_delhead (clnt_file, clnt_line, data, offset) +acc_t *_bf_delhead (clnt_file, clnt_line, data, offset) char *clnt_file; int clnt_line; #endif @@ -668,9 +668,9 @@ bf_append */ #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_append(data_first, data_second) +acc_t *bf_append(data_first, data_second) #else -PUBLIC acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second) +acc_t *_bf_append(clnt_file, clnt_line, data_first, data_second) char *clnt_file; int clnt_line; #endif @@ -818,7 +818,7 @@ assert (offset_old < data_second->acc_length); } #if BUF512_NR -PRIVATE void bf_512free(acc) +static void bf_512free(acc) acc_t *acc; { #ifdef BUF_CONSISTENCY_CHECK @@ -830,7 +830,7 @@ acc_t *acc; } #endif #if BUF2K_NR -PRIVATE void bf_2Kfree(acc) +static void bf_2Kfree(acc) acc_t *acc; { #ifdef BUF_CONSISTENCY_CHECK @@ -842,7 +842,7 @@ acc_t *acc; } #endif #if BUF32K_NR -PRIVATE void bf_32Kfree(acc) +static void bf_32Kfree(acc) acc_t *acc; { #ifdef BUF_CONSISTENCY_CHECK @@ -855,7 +855,7 @@ acc_t *acc; #endif #ifdef BUF_CONSISTENCY_CHECK -PUBLIC int bf_consistency_check() +int bf_consistency_check() { acc_t *acc; int silent; @@ -980,7 +980,7 @@ PUBLIC int bf_consistency_check() return !error; } -PRIVATE void count_free_bufs(list) +static void count_free_bufs(list) acc_t *list; { acc_t *acc; @@ -1011,7 +1011,7 @@ acc_t *list; } } -PRIVATE int report_buffer(buf, label, i) +static int report_buffer(buf, label, i) buf_t *buf; char *label; int i; @@ -1047,7 +1047,7 @@ int i; return 1; } -PUBLIC void bf_check_acc(acc) +void bf_check_acc(acc) acc_t *acc; { buf_t *buf; @@ -1081,7 +1081,7 @@ acc_t *acc; } } -PUBLIC void _bf_mark_1acc(clnt_file, clnt_line, acc) +void _bf_mark_1acc(clnt_file, clnt_line, acc) char *clnt_file; int clnt_line; acc_t *acc; @@ -1090,7 +1090,7 @@ acc_t *acc; acc->acc_alloc_line= clnt_line; } -PUBLIC void _bf_mark_acc(clnt_file, clnt_line, acc) +void _bf_mark_acc(clnt_file, clnt_line, acc) char *clnt_file; int clnt_line; acc_t *acc; @@ -1108,7 +1108,7 @@ acc_t *acc; } #endif -PUBLIC int bf_linkcheck(acc) +int bf_linkcheck(acc) acc_t *acc; { int i; @@ -1163,7 +1163,7 @@ acc_t *acc; return 1; } -PRIVATE void free_accs() +static void free_accs() { int i, j; @@ -1190,9 +1190,9 @@ assert(bf_linkcheck(bf_linkcheck_acc)); } #ifndef BUF_TRACK_ALLOC_FREE -PUBLIC acc_t *bf_align(acc, size, alignment) +acc_t *bf_align(acc, size, alignment) #else -PUBLIC acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment) +acc_t *_bf_align(clnt_file, clnt_line, acc, size, alignment) char *clnt_file; int clnt_line; #endif diff --git a/servers/inet/clock.c b/servers/inet/clock.c index d70cc6c0c..a869e684d 100644 --- a/servers/inet/clock.c +++ b/servers/inet/clock.c @@ -12,17 +12,17 @@ Copyright 1995 Philip Homburg THIS_FILE -PUBLIC int clck_call_expire; +int clck_call_expire; -PRIVATE time_t curr_time; -PRIVATE time_t prev_time; -PRIVATE timer_t *timer_chain; -PRIVATE time_t next_timeout; +static time_t curr_time; +static time_t prev_time; +static timer_t *timer_chain; +static time_t next_timeout; -FORWARD void clck_fast_release(timer_t *timer); -FORWARD void set_timer(void); +static void clck_fast_release(timer_t *timer); +static void set_timer(void); -PUBLIC void clck_init() +void clck_init() { clck_call_expire= 0; curr_time= 0; @@ -31,7 +31,7 @@ PUBLIC void clck_init() timer_chain= 0; } -PUBLIC time_t get_time() +time_t get_time() { if (!curr_time) { @@ -42,7 +42,7 @@ PUBLIC time_t get_time() return curr_time; } -PUBLIC void set_time (tim) +void set_time (tim) time_t tim; { if (!curr_time && tim >= prev_time) @@ -59,13 +59,13 @@ time_t tim; } } -PUBLIC void reset_time() +void reset_time() { prev_time= curr_time; curr_time= 0; } -PUBLIC void clck_timer(timer, timeout, func, fd) +void clck_timer(timer, timeout, func, fd) timer_t *timer; time_t timeout; timer_func_t func; @@ -103,14 +103,14 @@ int fd; set_timer(); } -PUBLIC void clck_tick (mess) +void clck_tick (mess) message *mess; { next_timeout= 0; set_timer(); } -PRIVATE void clck_fast_release (timer) +static void clck_fast_release (timer) timer_t *timer; { timer_t *timer_index; @@ -131,7 +131,7 @@ timer_t *timer; timer->tim_active= 0; } -PRIVATE void set_timer() +static void set_timer() { time_t new_time; time_t curr_time; @@ -157,14 +157,14 @@ PRIVATE void set_timer() } } -PUBLIC void clck_untimer (timer) +void clck_untimer (timer) timer_t *timer; { clck_fast_release (timer); set_timer(); } -PUBLIC void clck_expire_timers() +void clck_expire_timers() { time_t curr_time; timer_t *timer_index; diff --git a/servers/inet/generic/arp.c b/servers/inet/generic/arp.c index 7eec870bc..2b68997ed 100644 --- a/servers/inet/generic/arp.c +++ b/servers/inet/generic/arp.c @@ -125,36 +125,36 @@ typedef struct arp_cache #define ACS_VALID 2 #define ACS_UNREACHABLE 3 -PRIVATE struct arp_hash_ent +static struct arp_hash_ent { arp_cache_t *ahe_row[ARP_HASH_WIDTH]; } arp_hash[ARP_HASH_NR]; -PRIVATE arp_port_t *arp_port_table; -PRIVATE arp_cache_t *arp_cache; -PRIVATE int arp_cache_nr; +static arp_port_t *arp_port_table; +static arp_cache_t *arp_cache; +static int arp_cache_nr; -FORWARD acc_t *arp_getdata ARGS(( int fd, size_t offset, +static acc_t *arp_getdata ARGS(( int fd, size_t offset, size_t count, int for_ioctl )); -FORWARD int arp_putdata ARGS(( int fd, size_t offset, +static int arp_putdata ARGS(( int fd, size_t offset, acc_t *data, int for_ioctl )); -FORWARD void arp_main ARGS(( arp_port_t *arp_port )); -FORWARD void arp_timeout ARGS(( int ref, timer_t *timer )); -FORWARD void setup_write ARGS(( arp_port_t *arp_port )); -FORWARD void setup_read ARGS(( arp_port_t *arp_port )); -FORWARD void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg )); -FORWARD void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data )); -FORWARD void client_reply ARGS(( arp_port_t *arp_port, +static void arp_main ARGS(( arp_port_t *arp_port )); +static void arp_timeout ARGS(( int ref, timer_t *timer )); +static void setup_write ARGS(( arp_port_t *arp_port )); +static void setup_read ARGS(( arp_port_t *arp_port )); +static void do_reclist ARGS(( event_t *ev, ev_arg_t ev_arg )); +static void process_arp_pkt ARGS(( arp_port_t *arp_port, acc_t *data )); +static void client_reply ARGS(( arp_port_t *arp_port, ipaddr_t ipaddr, ether_addr_t *ethaddr )); -FORWARD arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port, +static arp_cache_t *find_cache_ent ARGS(( arp_port_t *arp_port, ipaddr_t ipaddr )); -FORWARD arp_cache_t *alloc_cache_ent ARGS(( int flags )); -FORWARD void arp_buffree ARGS(( int priority )); +static arp_cache_t *alloc_cache_ent ARGS(( int flags )); +static void arp_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void arp_bufcheck ARGS(( void )); +static void arp_bufcheck ARGS(( void )); #endif -PUBLIC void arp_prep() +void arp_prep() { arp_port_table= alloc(eth_conf_nr * sizeof(arp_port_table[0])); @@ -168,7 +168,7 @@ PUBLIC void arp_prep() arp_cache= alloc(arp_cache_nr * sizeof(arp_cache[0])); } -PUBLIC void arp_init() +void arp_init() { arp_port_t *arp_port; arp_cache_t *cache; @@ -200,7 +200,7 @@ PUBLIC void arp_init() #endif } -PRIVATE void arp_main(arp_port) +static void arp_main(arp_port) arp_port_t *arp_port; { int result; @@ -264,7 +264,7 @@ arp_port_t *arp_port; } } -PRIVATE acc_t *arp_getdata (fd, offset, count, for_ioctl) +static acc_t *arp_getdata (fd, offset, count, for_ioctl) int fd; size_t offset; size_t count; @@ -345,7 +345,7 @@ int for_ioctl; return 0; } -PRIVATE int arp_putdata (fd, offset, data, for_ioctl) +static int arp_putdata (fd, offset, data, for_ioctl) int fd; size_t offset; acc_t *data; @@ -445,7 +445,7 @@ int for_ioctl; return EGENERIC; } -PRIVATE void setup_read(arp_port) +static void setup_read(arp_port) arp_port_t *arp_port; { int result; @@ -465,7 +465,7 @@ arp_port_t *arp_port; } } -PRIVATE void setup_write(arp_port) +static void setup_write(arp_port) arp_port_t *arp_port; { int result; @@ -510,7 +510,7 @@ arp_port_t *arp_port; } } -PRIVATE void do_reclist(ev, ev_arg) +static void do_reclist(ev, ev_arg) event_t *ev; ev_arg_t ev_arg; { @@ -528,7 +528,7 @@ ev_arg_t ev_arg; } } -PRIVATE void process_arp_pkt (arp_port, data) +static void process_arp_pkt (arp_port, data) arp_port_t *arp_port; acc_t *data; { @@ -690,7 +690,7 @@ acc_t *data; } } -PRIVATE void client_reply (arp_port, ipaddr, ethaddr) +static void client_reply (arp_port, ipaddr, ethaddr) arp_port_t *arp_port; ipaddr_t ipaddr; ether_addr_t *ethaddr; @@ -698,7 +698,7 @@ ether_addr_t *ethaddr; (*arp_port->ap_arp_func)(arp_port->ap_ip_port, ipaddr, ethaddr); } -PRIVATE arp_cache_t *find_cache_ent (arp_port, ipaddr) +static arp_cache_t *find_cache_ent (arp_port, ipaddr) arp_port_t *arp_port; ipaddr_t ipaddr; { @@ -747,7 +747,7 @@ ipaddr_t ipaddr; return NULL; } -PRIVATE arp_cache_t *alloc_cache_ent(flags) +static arp_cache_t *alloc_cache_ent(flags) int flags; { arp_cache_t *cache, *old; @@ -812,7 +812,7 @@ int flags; return old; } -PUBLIC void arp_set_ipaddr (eth_port, ipaddr) +void arp_set_ipaddr (eth_port, ipaddr) int eth_port; ipaddr_t ipaddr; { @@ -829,7 +829,7 @@ ipaddr_t ipaddr; arp_main(arp_port); } -PUBLIC int arp_set_cb(eth_port, ip_port, arp_func) +int arp_set_cb(eth_port, ip_port, arp_func) int eth_port; int ip_port; arp_func_t arp_func; @@ -862,7 +862,7 @@ arp_func_t arp_func; return NW_OK; } -PUBLIC int arp_ip_eth (eth_port, ipaddr, ethaddr) +int arp_ip_eth (eth_port, ipaddr, ethaddr) int eth_port; ipaddr_t ipaddr; ether_addr_t *ethaddr; @@ -960,7 +960,7 @@ ether_addr_t *ethaddr; return NW_SUSPEND; } -PUBLIC int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata) +int arp_ioctl (eth_port, fd, req, get_userdata, put_userdata) int eth_port; int fd; ioreq_t req; @@ -1191,7 +1191,7 @@ put_userdata_t put_userdata; return 0; } -PRIVATE void arp_timeout (ref, timer) +static void arp_timeout (ref, timer) int ref; timer_t *timer; { @@ -1273,7 +1273,7 @@ timer_t *timer; arp_timeout, ref); } -PRIVATE void arp_buffree(priority) +static void arp_buffree(priority) int priority; { int i; @@ -1334,7 +1334,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void arp_bufcheck() +static void arp_bufcheck() { int i; arp_port_t *arp_port; diff --git a/servers/inet/generic/eth.c b/servers/inet/generic/eth.c index 66dafc2e5..e3e9df6e0 100644 --- a/servers/inet/generic/eth.c +++ b/servers/inet/generic/eth.c @@ -60,35 +60,35 @@ typedef struct u16_t vh_vlan; } vlan_hdr_t; -FORWARD int eth_checkopt ARGS(( eth_fd_t *eth_fd )); -FORWARD void hash_fd ARGS(( eth_fd_t *eth_fd )); -FORWARD void unhash_fd ARGS(( eth_fd_t *eth_fd )); -FORWARD void eth_buffree ARGS(( int priority )); +static int eth_checkopt ARGS(( eth_fd_t *eth_fd )); +static void hash_fd ARGS(( eth_fd_t *eth_fd )); +static void unhash_fd ARGS(( eth_fd_t *eth_fd )); +static void eth_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void eth_bufcheck ARGS(( void )); +static void eth_bufcheck ARGS(( void )); #endif -FORWARD int eth_sel_read ARGS(( eth_fd_t * )); -FORWARD void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time )); -FORWARD void reply_thr_get ARGS(( eth_fd_t *eth_fd, +static int eth_sel_read ARGS(( eth_fd_t * )); +static void packet2user ARGS(( eth_fd_t *fd, acc_t *pack, time_t exp_time )); +static void reply_thr_get ARGS(( eth_fd_t *eth_fd, size_t result, int for_ioctl )); -FORWARD void reply_thr_put ARGS(( eth_fd_t *eth_fd, +static void reply_thr_put ARGS(( eth_fd_t *eth_fd, size_t result, int for_ioctl )); -FORWARD void do_rec_conf ARGS(( eth_port_t *eth_port )); -FORWARD u32_t compute_rec_conf ARGS(( eth_port_t *eth_port )); -FORWARD acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack )); +static void do_rec_conf ARGS(( eth_port_t *eth_port )); +static u32_t compute_rec_conf ARGS(( eth_port_t *eth_port )); +static acc_t *insert_vlan_hdr ARGS(( eth_port_t *eth_port, acc_t *pack )); -PUBLIC eth_port_t *eth_port_table; -PUBLIC int no_ethWritePort= 0; +eth_port_t *eth_port_table; +int no_ethWritePort= 0; -PRIVATE eth_fd_t eth_fd_table[ETH_FD_NR]; -PRIVATE ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } }; +static eth_fd_t eth_fd_table[ETH_FD_NR]; +static ether_addr_t broadcast= { { 255, 255, 255, 255, 255, 255 } }; -PUBLIC void eth_prep() +void eth_prep() { eth_port_table= alloc(eth_conf_nr * sizeof(eth_port_table[0])); } -PUBLIC void eth_init() +void eth_init() { int i, j; @@ -123,7 +123,7 @@ PUBLIC void eth_init() osdep_eth_init(); } -PUBLIC int eth_open(port, srfd, get_userdata, put_userdata, put_pkt, +int eth_open(port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port, srfd; get_userdata_t get_userdata; @@ -165,7 +165,7 @@ select_res_t select_res; return i; } -PUBLIC int eth_ioctl(fd, req) +int eth_ioctl(fd, req) int fd; ioreq_t req; { @@ -416,7 +416,7 @@ printf("eth_ioctl: setting etp_getstat in port %d to %p\n", return NW_OK; } -PUBLIC int eth_write(fd, count) +int eth_write(fd, count) int fd; size_t count; { @@ -479,7 +479,7 @@ size_t count; return NW_OK; } -PUBLIC int eth_send(fd, data, data_len) +int eth_send(fd, data, data_len) int fd; acc_t *data; size_t data_len; @@ -564,7 +564,7 @@ size_t data_len; return NW_OK; } -PUBLIC int eth_read (fd, count) +int eth_read (fd, count) int fd; size_t count; { @@ -602,7 +602,7 @@ size_t count; return NW_SUSPEND; } -PUBLIC int eth_cancel(fd, which_operation) +int eth_cancel(fd, which_operation) int fd; int which_operation; { @@ -654,7 +654,7 @@ int which_operation; return NW_OK; } -PUBLIC int eth_select(fd, operations) +int eth_select(fd, operations) int fd; unsigned operations; { @@ -685,7 +685,7 @@ unsigned operations; return resops; } -PUBLIC void eth_close(fd) +void eth_close(fd) int fd; { eth_fd_t *eth_fd; @@ -711,7 +711,7 @@ int fd; do_rec_conf(eth_port); } -PUBLIC void eth_loop_ev(ev, ev_arg) +void eth_loop_ev(ev, ev_arg) event_t *ev; ev_arg_t ev_arg; { @@ -733,7 +733,7 @@ ev_arg_t ev_arg; eth_restart_write(eth_port); } -PRIVATE int eth_checkopt (eth_fd) +static int eth_checkopt (eth_fd) eth_fd_t *eth_fd; { /* bug: we don't check access modes yet */ @@ -769,7 +769,7 @@ eth_fd_t *eth_fd; return NW_OK; } -PRIVATE void hash_fd(eth_fd) +static void hash_fd(eth_fd) eth_fd_t *eth_fd; { eth_port_t *eth_port; @@ -792,7 +792,7 @@ eth_fd_t *eth_fd; } } -PRIVATE void unhash_fd(eth_fd) +static void unhash_fd(eth_fd) eth_fd_t *eth_fd; { eth_port_t *eth_port; @@ -825,7 +825,7 @@ eth_fd_t *eth_fd; *eth_fd_p= curr->ef_type_next; } -PUBLIC void eth_restart_write(eth_port) +void eth_restart_write(eth_port) eth_port_t *eth_port; { eth_fd_t *eth_fd; @@ -845,7 +845,7 @@ eth_port_t *eth_port; } } -PUBLIC void eth_arrive (eth_port, pack, pack_size) +void eth_arrive (eth_port, pack, pack_size) eth_port_t *eth_port; acc_t *pack; size_t pack_size; @@ -1031,7 +1031,7 @@ size_t pack_size; } } -PUBLIC void eth_reg_vlan(eth_port, vlan_port) +void eth_reg_vlan(eth_port, vlan_port) eth_port_t *eth_port; eth_port_t *vlan_port; { @@ -1044,7 +1044,7 @@ eth_port_t *vlan_port; eth_port->etp_vlan_tab[h]= vlan_port; } -PUBLIC void eth_restart_ioctl(eth_port) +void eth_restart_ioctl(eth_port) eth_port_t *eth_port; { int i, r; @@ -1111,7 +1111,7 @@ printf("eth_restart_ioctl: clearing etp_getstat in port %d\n", } } -PRIVATE int eth_sel_read (eth_fd) +static int eth_sel_read (eth_fd) eth_fd_t *eth_fd; { acc_t *tmp_acc, *next_acc; @@ -1136,7 +1136,7 @@ eth_fd_t *eth_fd; return 0; } -PRIVATE void packet2user (eth_fd, pack, exp_time) +static void packet2user (eth_fd, pack, exp_time) eth_fd_t *eth_fd; acc_t *pack; time_t exp_time; @@ -1196,7 +1196,7 @@ time_t exp_time; reply_thr_put(eth_fd, result, FALSE); } -PRIVATE void eth_buffree (priority) +static void eth_buffree (priority) int priority; { int i; @@ -1231,7 +1231,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void eth_bufcheck() +static void eth_bufcheck() { int i; eth_fd_t *eth_fd; @@ -1253,7 +1253,7 @@ PRIVATE void eth_bufcheck() } #endif -PRIVATE void do_rec_conf(eth_port) +static void do_rec_conf(eth_port) eth_port_t *eth_port; { int i; @@ -1276,7 +1276,7 @@ eth_port_t *eth_port; eth_set_rec_conf(eth_port, flags); } -PRIVATE u32_t compute_rec_conf(eth_port) +static u32_t compute_rec_conf(eth_port) eth_port_t *eth_port; { eth_fd_t *eth_fd; @@ -1298,7 +1298,7 @@ eth_port_t *eth_port; return flags; } -PRIVATE void reply_thr_get (eth_fd, result, for_ioctl) +static void reply_thr_get (eth_fd, result, for_ioctl) eth_fd_t *eth_fd; size_t result; int for_ioctl; @@ -1309,7 +1309,7 @@ int for_ioctl; assert (!data); } -PRIVATE void reply_thr_put (eth_fd, result, for_ioctl) +static void reply_thr_put (eth_fd, result, for_ioctl) eth_fd_t *eth_fd; size_t result; int for_ioctl; @@ -1321,7 +1321,7 @@ int for_ioctl; assert(error == NW_OK); } -PRIVATE acc_t *insert_vlan_hdr(eth_port, pack) +static acc_t *insert_vlan_hdr(eth_port, pack) eth_port_t *eth_port; acc_t *pack; { diff --git a/servers/inet/generic/icmp.c b/servers/inet/generic/icmp.c index c7a10da9b..edb97a39a 100644 --- a/servers/inet/generic/icmp.c +++ b/servers/inet/generic/icmp.c @@ -47,50 +47,50 @@ typedef struct icmp_port #define ICPS_MAIN 2 #define ICPS_ERROR 3 -PRIVATE icmp_port_t *icmp_port_table; +static icmp_port_t *icmp_port_table; -FORWARD void icmp_main ARGS(( icmp_port_t *icmp_port )); -FORWARD acc_t *icmp_getdata ARGS(( int port, size_t offset, +static void icmp_main ARGS(( icmp_port_t *icmp_port )); +static acc_t *icmp_getdata ARGS(( int port, size_t offset, size_t count, int for_ioctl )); -FORWARD int icmp_putdata ARGS(( int port, size_t offset, +static int icmp_putdata ARGS(( int port, size_t offset, acc_t *data, int for_ioctl )); -FORWARD void icmp_read ARGS(( icmp_port_t *icmp_port )); -FORWARD void process_data ARGS(( icmp_port_t *icmp_port, +static void icmp_read ARGS(( icmp_port_t *icmp_port )); +static void process_data ARGS(( icmp_port_t *icmp_port, acc_t *data )); -FORWARD u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack )); -FORWARD void icmp_echo_request ARGS(( icmp_port_t *icmp_port, +static u16_t icmp_pack_oneCsum ARGS(( acc_t *ip_pack )); +static void icmp_echo_request ARGS(( icmp_port_t *icmp_port, acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr )); -FORWARD void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port, +static void icmp_dst_unreach ARGS(( icmp_port_t *icmp_port, acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr )); -FORWARD void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port, +static void icmp_time_exceeded ARGS(( icmp_port_t *icmp_port, acc_t *ip_pack, int ip_hdr_len, ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr )); -FORWARD void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port, +static void icmp_router_advertisement ARGS(( icmp_port_t *icmp_port, acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr )); -FORWARD void icmp_redirect ARGS(( icmp_port_t *icmp_port, +static void icmp_redirect ARGS(( icmp_port_t *icmp_port, ip_hdr_t *ip_hdr, acc_t *icmp_pack, int icmp_len, icmp_hdr_t *icmp_hdr )); -FORWARD acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr, +static acc_t *make_repl_ip ARGS(( ip_hdr_t *ip_hdr, int ip_len )); -FORWARD void enqueue_pack ARGS(( icmp_port_t *icmp_port, +static void enqueue_pack ARGS(( icmp_port_t *icmp_port, acc_t *reply_ip_hdr )); -FORWARD int icmp_rate_limit ARGS(( icmp_port_t *icmp_port, +static int icmp_rate_limit ARGS(( icmp_port_t *icmp_port, acc_t *reply_ip_hdr )); -FORWARD void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg )); -FORWARD void icmp_buffree ARGS(( int priority )); -FORWARD acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp )); +static void icmp_write ARGS(( event_t *ev, ev_arg_t ev_arg )); +static void icmp_buffree ARGS(( int priority )); +static acc_t *icmp_err_pack ARGS(( acc_t *pack, icmp_hdr_t **icmp_hdr_pp )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void icmp_bufcheck ARGS(( void )); +static void icmp_bufcheck ARGS(( void )); #endif -PUBLIC void icmp_prep() +void icmp_prep() { icmp_port_table= alloc(ip_conf_nr * sizeof(icmp_port_table[0])); } -PUBLIC void icmp_init() +void icmp_init() { int i; icmp_port_t *icmp_port; @@ -120,7 +120,7 @@ PUBLIC void icmp_init() } } -PRIVATE void icmp_main(icmp_port) +static void icmp_main(icmp_port) icmp_port_t *icmp_port; { int result; @@ -160,7 +160,7 @@ icmp_port_t *icmp_port; } } -PRIVATE acc_t *icmp_getdata(port, offset, count, for_ioctl) +static acc_t *icmp_getdata(port, offset, count, for_ioctl) int port; size_t offset, count; int for_ioctl; @@ -229,7 +229,7 @@ int for_ioctl; return NULL; } -PRIVATE int icmp_putdata(port, offset, data, for_ioctl) +static int icmp_putdata(port, offset, data, for_ioctl) int port; size_t offset; acc_t *data; @@ -270,7 +270,7 @@ int for_ioctl; } } -PRIVATE void icmp_read(icmp_port) +static void icmp_read(icmp_port) icmp_port_t *icmp_port; { int result; @@ -289,7 +289,7 @@ icmp_port_t *icmp_port; } } -PUBLIC void icmp_snd_time_exceeded(port_nr, pack, code) +void icmp_snd_time_exceeded(port_nr, pack, code) int port_nr; acc_t *pack; int code; @@ -315,7 +315,7 @@ int code; enqueue_pack(icmp_port, pack); } -PUBLIC void icmp_snd_redirect(port_nr, pack, code, gw) +void icmp_snd_redirect(port_nr, pack, code, gw) int port_nr; acc_t *pack; int code; @@ -345,7 +345,7 @@ ipaddr_t gw; enqueue_pack(icmp_port, pack); } -PUBLIC void icmp_snd_unreachable(port_nr, pack, code) +void icmp_snd_unreachable(port_nr, pack, code) int port_nr; acc_t *pack; int code; @@ -371,7 +371,7 @@ int code; enqueue_pack(icmp_port, pack); } -PUBLIC void icmp_snd_mtu( +void icmp_snd_mtu( int port_nr, acc_t *pack, u16_t mtu @@ -402,7 +402,7 @@ PUBLIC void icmp_snd_mtu( enqueue_pack(icmp_port, pack); } -PRIVATE void process_data(icmp_port, data) +static void process_data(icmp_port, data) icmp_port_t *icmp_port; acc_t *data; { @@ -499,7 +499,7 @@ acc_t *data; bf_afree(icmp_data); } -PRIVATE void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr, +static void icmp_echo_request(icmp_port, ip_data, ip_len, ip_hdr, icmp_data, icmp_len, icmp_hdr) icmp_port_t *icmp_port; acc_t *ip_data, *icmp_data; @@ -586,7 +586,7 @@ icmp_hdr_t *icmp_hdr; enqueue_pack(icmp_port, repl_ip_hdr); } -PRIVATE u16_t icmp_pack_oneCsum(icmp_pack) +static u16_t icmp_pack_oneCsum(icmp_pack) acc_t *icmp_pack; { u16_t prev; @@ -628,7 +628,7 @@ acc_t *icmp_pack; return prev; } -PRIVATE acc_t *make_repl_ip(ip_hdr, ip_len) +static acc_t *make_repl_ip(ip_hdr, ip_len) ip_hdr_t *ip_hdr; int ip_len; { @@ -658,7 +658,7 @@ int ip_len; return repl; } -PRIVATE void enqueue_pack(icmp_port, reply_ip_hdr) +static void enqueue_pack(icmp_port, reply_ip_hdr) icmp_port_t *icmp_port; acc_t *reply_ip_hdr; { @@ -702,7 +702,7 @@ acc_t *reply_ip_hdr; } } -PRIVATE int icmp_rate_limit(icmp_port, reply_ip_hdr) +static int icmp_rate_limit(icmp_port, reply_ip_hdr) icmp_port_t *icmp_port; acc_t *reply_ip_hdr; { @@ -773,7 +773,7 @@ acc_t *reply_ip_hdr; return -1; } -PRIVATE void icmp_write(ev, ev_arg) +static void icmp_write(ev, ev_arg) event_t *ev; ev_arg_t ev_arg; { @@ -816,7 +816,7 @@ ev_arg_t ev_arg; icmp_port->icp_flags &= ~ICPF_WRITE_IP; } -PRIVATE void icmp_buffree(priority) +static void icmp_buffree(priority) int priority; { acc_t *tmp_acc; @@ -840,7 +840,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void icmp_bufcheck() +static void icmp_bufcheck() { int i; icmp_port_t *icmp_port; @@ -858,7 +858,7 @@ PRIVATE void icmp_bufcheck() } #endif -PRIVATE void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack, +static void icmp_dst_unreach(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack, icmp_len, icmp_hdr) icmp_port_t *icmp_port; acc_t *ip_pack; @@ -941,7 +941,7 @@ icmp_hdr_t *icmp_hdr; bf_afree(old_ip_pack); } -PRIVATE void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr, +static void icmp_time_exceeded(icmp_port, ip_pack, ip_hdr_len, ip_hdr, icmp_pack, icmp_len, icmp_hdr) icmp_port_t *icmp_port; acc_t *ip_pack; @@ -990,7 +990,7 @@ icmp_hdr_t *icmp_hdr; bf_afree(old_ip_pack); } -PRIVATE void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr) +static void icmp_router_advertisement(icmp_port, icmp_pack, icmp_len, icmp_hdr) icmp_port_t *icmp_port; acc_t *icmp_pack; int icmp_len; @@ -1063,7 +1063,7 @@ icmp_hdr_t *icmp_hdr; } } -PRIVATE void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr) +static void icmp_redirect(icmp_port, ip_hdr, icmp_pack, icmp_len, icmp_hdr) icmp_port_t *icmp_port; ip_hdr_t *ip_hdr; acc_t *icmp_pack; @@ -1108,7 +1108,7 @@ icmp_hdr_t *icmp_hdr; bf_afree(old_ip_pack); } -PRIVATE acc_t *icmp_err_pack(pack, icmp_hdr_pp) +static acc_t *icmp_err_pack(pack, icmp_hdr_pp) acc_t *pack; icmp_hdr_t **icmp_hdr_pp; { diff --git a/servers/inet/generic/io.c b/servers/inet/generic/io.c index 13c252ca1..7b861d20a 100644 --- a/servers/inet/generic/io.c +++ b/servers/inet/generic/io.c @@ -9,7 +9,7 @@ Copyright 1995 Philip Homburg #include "inet.h" #include "io.h" -PUBLIC void writeIpAddr(addr) +void writeIpAddr(addr) ipaddr_t addr; { #define addrInBytes ((u8_t *)&addr) @@ -19,7 +19,7 @@ ipaddr_t addr; #undef addrInBytes } -PUBLIC void writeEtherAddr(addr) +void writeEtherAddr(addr) ether_addr_t *addr; { #define addrInBytes ((u8_t *)addr->ea_addr) diff --git a/servers/inet/generic/ip.c b/servers/inet/generic/ip.c index a80ac337f..659e552d8 100644 --- a/servers/inet/generic/ip.c +++ b/servers/inet/generic/ip.c @@ -23,27 +23,27 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void ip_close ARGS(( int fd )); -FORWARD int ip_cancel ARGS(( int fd, int which_operation )); -FORWARD int ip_select ARGS(( int fd, unsigned operations )); +static void ip_close ARGS(( int fd )); +static int ip_cancel ARGS(( int fd, int which_operation )); +static int ip_select ARGS(( int fd, unsigned operations )); -FORWARD void ip_buffree ARGS(( int priority )); +static void ip_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void ip_bufcheck ARGS(( void )); +static void ip_bufcheck ARGS(( void )); #endif -FORWARD void ip_bad_callback ARGS(( struct ip_port *ip_port )); +static void ip_bad_callback ARGS(( struct ip_port *ip_port )); -PUBLIC ip_port_t *ip_port_table; -PUBLIC ip_fd_t ip_fd_table[IP_FD_NR]; -PUBLIC ip_ass_t ip_ass_table[IP_ASS_NR]; +ip_port_t *ip_port_table; +ip_fd_t ip_fd_table[IP_FD_NR]; +ip_ass_t ip_ass_table[IP_ASS_NR]; -PUBLIC void ip_prep() +void ip_prep() { ip_port_table= alloc(ip_conf_nr * sizeof(ip_port_table[0])); icmp_prep(); } -PUBLIC void ip_init() +void ip_init() { int i, j, result; ip_ass_t *ip_ass; @@ -137,7 +137,7 @@ PUBLIC void ip_init() } } -PRIVATE int ip_cancel (fd, which_operation) +static int ip_cancel (fd, which_operation) int fd; int which_operation; { @@ -180,7 +180,7 @@ int which_operation; return NW_OK; } -PRIVATE int ip_select(fd, operations) +static int ip_select(fd, operations) int fd; unsigned operations; { @@ -211,7 +211,7 @@ unsigned operations; return resops; } -PUBLIC int ip_open (port, srfd, get_userdata, put_userdata, put_pkt, +int ip_open (port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port; int srfd; @@ -258,7 +258,7 @@ select_res_t select_res; return i; } -PRIVATE void ip_close (fd) +static void ip_close (fd) int fd; { ip_fd_t *ip_fd; @@ -280,7 +280,7 @@ int fd; ip_fd->if_flags= IFF_EMPTY; } -PRIVATE void ip_buffree(priority) +static void ip_buffree(priority) int priority; { int i; @@ -423,7 +423,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void ip_bufcheck() +static void ip_bufcheck() { int i; ip_port_t *ip_port; @@ -482,7 +482,7 @@ PRIVATE void ip_bufcheck() } #endif /* BUF_CONSISTENCY_CHECK */ -PRIVATE void ip_bad_callback(ip_port) +static void ip_bad_callback(ip_port) struct ip_port *ip_port; { ip_panic(( "no callback filled in for port %d", ip_port->ip_port )); diff --git a/servers/inet/generic/ip_eth.c b/servers/inet/generic/ip_eth.c index c92141012..26e47b385 100644 --- a/servers/inet/generic/ip_eth.c +++ b/servers/inet/generic/ip_eth.c @@ -29,34 +29,34 @@ typedef struct xmit_hdr ipaddr_t xh_ipaddr; } xmit_hdr_t; -PRIVATE ether_addr_t broadcast_ethaddr= +static ether_addr_t broadcast_ethaddr= { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; -PRIVATE ether_addr_t ipmulticast_ethaddr= +static ether_addr_t ipmulticast_ethaddr= { { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 } }; -FORWARD void do_eth_read ARGS(( ip_port_t *port )); -FORWARD acc_t *get_eth_data ARGS(( int fd, size_t offset, +static void do_eth_read ARGS(( ip_port_t *port )); +static acc_t *get_eth_data ARGS(( int fd, size_t offset, size_t count, int for_ioctl )); -FORWARD int put_eth_data ARGS(( int fd, size_t offset, +static int put_eth_data ARGS(( int fd, size_t offset, acc_t *data, int for_ioctl )); -FORWARD void ipeth_main ARGS(( ip_port_t *port )); -FORWARD void ipeth_set_ipaddr ARGS(( ip_port_t *port )); -FORWARD void ipeth_restart_send ARGS(( ip_port_t *ip_port )); -FORWARD int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest, +static void ipeth_main ARGS(( ip_port_t *port )); +static void ipeth_set_ipaddr ARGS(( ip_port_t *port )); +static void ipeth_restart_send ARGS(( ip_port_t *ip_port )); +static int ipeth_send ARGS(( struct ip_port *ip_port, ipaddr_t dest, acc_t *pack, int type )); -FORWARD void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr, +static void ipeth_arp_reply ARGS(( int ip_port_nr, ipaddr_t ipaddr, ether_addr_t *dst_ether_ptr )); -FORWARD int ipeth_update_ttl ARGS(( time_t enq_time, time_t now, +static int ipeth_update_ttl ARGS(( time_t enq_time, time_t now, acc_t *eth_pack )); -FORWARD void ip_eth_arrived ARGS(( int port, acc_t *pack, +static void ip_eth_arrived ARGS(( int port, acc_t *pack, size_t pack_size )); -PUBLIC int ipeth_init(ip_port) +int ipeth_init(ip_port) ip_port_t *ip_port; { assert(BUF_S >= sizeof(xmit_hdr_t)); @@ -85,7 +85,7 @@ ip_port_t *ip_port; return 0; } -PRIVATE void ipeth_main(ip_port) +static void ipeth_main(ip_port) ip_port_t *ip_port; { int result; @@ -137,7 +137,7 @@ ip_port_t *ip_port; } } -PRIVATE acc_t *get_eth_data (fd, offset, count, for_ioctl) +static acc_t *get_eth_data (fd, offset, count, for_ioctl) int fd; size_t offset; size_t count; @@ -206,7 +206,7 @@ int for_ioctl; return 0; } -PRIVATE int put_eth_data (port, offset, data, for_ioctl) +static int put_eth_data (port, offset, data, for_ioctl) int port; size_t offset; acc_t *data; @@ -254,7 +254,7 @@ int for_ioctl; return -1; } -PRIVATE void ipeth_set_ipaddr(ip_port) +static void ipeth_set_ipaddr(ip_port) ip_port_t *ip_port; { arp_set_ipaddr (ip_port->ip_dl.dl_eth.de_port, ip_port->ip_ipaddr); @@ -262,7 +262,7 @@ ip_port_t *ip_port; ipeth_main(ip_port); } -PRIVATE int ipeth_send(ip_port, dest, pack, type) +static int ipeth_send(ip_port, dest, pack, type) struct ip_port *ip_port; ipaddr_t dest; acc_t *pack; @@ -403,7 +403,7 @@ int type; return NW_OK; } -PRIVATE void ipeth_restart_send(ip_port) +static void ipeth_restart_send(ip_port) ip_port_t *ip_port; { time_t now, enq_time; @@ -514,7 +514,7 @@ ip_port_t *ip_port; } -PRIVATE void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr) +static void ipeth_arp_reply(ip_port_nr, ipaddr, eth_addr) int ip_port_nr; ipaddr_t ipaddr; ether_addr_t *eth_addr; @@ -630,7 +630,7 @@ ether_addr_t *eth_addr; ipeth_restart_send(ip_port); } -PRIVATE int ipeth_update_ttl(enq_time, now, eth_pack) +static int ipeth_update_ttl(enq_time, now, eth_pack) time_t enq_time; time_t now; acc_t *eth_pack; @@ -670,7 +670,7 @@ acc_t *eth_pack; return NW_OK; } -PRIVATE void do_eth_read(ip_port) +static void do_eth_read(ip_port) ip_port_t *ip_port; { int result; @@ -698,7 +698,7 @@ ip_port_t *ip_port; } } -PRIVATE void ip_eth_arrived(port, pack, pack_size) +static void ip_eth_arrived(port, pack, pack_size) int port; acc_t *pack; size_t pack_size; diff --git a/servers/inet/generic/ip_ioctl.c b/servers/inet/generic/ip_ioctl.c index 055d6c72c..327e85106 100644 --- a/servers/inet/generic/ip_ioctl.c +++ b/servers/inet/generic/ip_ioctl.c @@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD int ip_checkopt ARGS(( ip_fd_t *ip_fd )); -FORWARD void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t +static int ip_checkopt ARGS(( ip_fd_t *ip_fd )); +static void reply_thr_get ARGS(( ip_fd_t *ip_fd, size_t reply, int for_ioctl )); -FORWARD void report_addr ARGS(( ip_port_t *ip_port )); +static void report_addr ARGS(( ip_port_t *ip_port )); -PUBLIC int ip_ioctl (fd, req) +int ip_ioctl (fd, req) int fd; ioreq_t req; { @@ -450,7 +450,7 @@ ioreq_t req; (acc_t *)0, TRUE); } -PUBLIC void ip_hash_proto(ip_fd) +void ip_hash_proto(ip_fd) ip_fd_t *ip_fd; { ip_port_t *ip_port; @@ -470,7 +470,7 @@ ip_fd_t *ip_fd; } } -PUBLIC void ip_unhash_proto(ip_fd) +void ip_unhash_proto(ip_fd) ip_fd_t *ip_fd; { ip_port_t *ip_port; @@ -500,7 +500,7 @@ ip_fd_t *ip_fd; *ip_fd_p= curr->if_proto_next; } -PUBLIC int ip_setconf(ip_port_nr, ipconf) +int ip_setconf(ip_port_nr, ipconf) int ip_port_nr; nwio_ipconf_t *ipconf; { @@ -576,7 +576,7 @@ nwio_ipconf_t *ipconf; return 0; } -PRIVATE int ip_checkopt (ip_fd) +static int ip_checkopt (ip_fd) ip_fd_t *ip_fd; { /* bug: we don't check access modes yet */ @@ -621,7 +621,7 @@ ip_fd_t *ip_fd; return NW_OK; } -PRIVATE void reply_thr_get(ip_fd, reply, for_ioctl) +static void reply_thr_get(ip_fd, reply, for_ioctl) ip_fd_t *ip_fd; size_t reply; int for_ioctl; @@ -632,7 +632,7 @@ int for_ioctl; assert (!result); } -PRIVATE void report_addr(ip_port) +static void report_addr(ip_port) ip_port_t *ip_port; { int i, hdr_len; diff --git a/servers/inet/generic/ip_lib.c b/servers/inet/generic/ip_lib.c index a921686c4..639ccb768 100644 --- a/servers/inet/generic/ip_lib.c +++ b/servers/inet/generic/ip_lib.c @@ -15,12 +15,12 @@ Copyright 1995 Philip Homburg THIS_FILE -PUBLIC ipaddr_t ip_get_netmask (ipaddr_t hostaddr) +ipaddr_t ip_get_netmask (ipaddr_t hostaddr) { return ip_netmask(ip_nettype(hostaddr)); } -PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen) +int ip_chk_hdropt (u8_t *opt, int optlen) { int i, security_present= FALSE, lose_source_present= FALSE, strict_source_present= FALSE, record_route_present= FALSE, @@ -119,7 +119,7 @@ PUBLIC int ip_chk_hdropt (u8_t *opt, int optlen) return NW_OK; } -PUBLIC void ip_print_frags(acc_t *acc) +void ip_print_frags(acc_t *acc) { #if DEBUG ip_hdr_t *ip_hdr; @@ -147,14 +147,14 @@ assert (acc->acc_length >= IP_MIN_HDR_SIZE); #endif } -PUBLIC ipaddr_t ip_get_ifaddr(int port_nr) +ipaddr_t ip_get_ifaddr(int port_nr) { assert(port_nr >= 0 && port_nr < ip_conf_nr); return ip_port_table[port_nr].ip_ipaddr; } -PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr) +nettype_t ip_nettype(ipaddr_t ipaddr) { u8_t highbyte; nettype_t nettype; @@ -192,7 +192,7 @@ PUBLIC nettype_t ip_nettype(ipaddr_t ipaddr) return nettype; } -PUBLIC ipaddr_t ip_netmask(nettype_t nettype) +ipaddr_t ip_netmask(nettype_t nettype) { switch(nettype) { @@ -206,7 +206,7 @@ PUBLIC ipaddr_t ip_netmask(nettype_t nettype) } #if 0 -PUBLIC char *ip_nettoa(nettype_t nettype) +char *ip_nettoa(nettype_t nettype) { switch(nettype) { diff --git a/servers/inet/generic/ip_ps.c b/servers/inet/generic/ip_ps.c index 9e8f90658..f3b69c8e5 100644 --- a/servers/inet/generic/ip_ps.c +++ b/servers/inet/generic/ip_ps.c @@ -19,12 +19,12 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void ipps_main ARGS(( ip_port_t *ip_port )); -FORWARD void ipps_set_ipaddr ARGS(( ip_port_t *ip_port )); -FORWARD int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest, +static void ipps_main ARGS(( ip_port_t *ip_port )); +static void ipps_set_ipaddr ARGS(( ip_port_t *ip_port )); +static int ipps_send ARGS(( struct ip_port *ip_port, ipaddr_t dest, acc_t *pack, int type )); -PUBLIC int ipps_init(ip_port) +int ipps_init(ip_port) ip_port_t *ip_port; { int result; @@ -40,7 +40,7 @@ ip_port_t *ip_port; return result; } -PUBLIC void ipps_get(ip_port_nr) +void ipps_get(ip_port_nr) int ip_port_nr; { int result; @@ -112,7 +112,7 @@ int ip_port_nr; } } -PUBLIC void ipps_put(ip_port_nr, nexthop, pack) +void ipps_put(ip_port_nr, nexthop, pack) int ip_port_nr; ipaddr_t nexthop; acc_t *pack; @@ -128,18 +128,18 @@ acc_t *pack; ip_arrived(ip_port, pack); } -PRIVATE void ipps_main(ip_port) +static void ipps_main(ip_port) ip_port_t *ip_port; { /* nothing to do */ } -PRIVATE void ipps_set_ipaddr(ip_port) +static void ipps_set_ipaddr(ip_port) ip_port_t *ip_port; { } -PRIVATE int ipps_send(ip_port, dest, pack, type) +static int ipps_send(ip_port, dest, pack, type) struct ip_port *ip_port; ipaddr_t dest; acc_t *pack; diff --git a/servers/inet/generic/ip_read.c b/servers/inet/generic/ip_read.c index 07655c9f1..24bd92481 100644 --- a/servers/inet/generic/ip_read.c +++ b/servers/inet/generic/ip_read.c @@ -20,16 +20,16 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id, +static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id, ipproto_t proto, ipaddr_t src, ipaddr_t dst )); -FORWARD acc_t *merge_frags ARGS(( acc_t *first, acc_t *second )); -FORWARD int ip_frag_chk ARGS(( acc_t *pack )); -FORWARD acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack, +static acc_t *merge_frags ARGS(( acc_t *first, acc_t *second )); +static int ip_frag_chk ARGS(( acc_t *pack )); +static acc_t *reassemble ARGS(( ip_port_t *ip_port, acc_t *pack, ip_hdr_t *ip_hdr )); -FORWARD void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg )); -FORWARD int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest )); +static void route_packets ARGS(( event_t *ev, ev_arg_t ev_arg )); +static int broadcast_dst ARGS(( ip_port_t *ip_port, ipaddr_t dest )); -PUBLIC int ip_read(int fd, size_t count) +int ip_read(int fd, size_t count) { ip_fd_t *ip_fd; acc_t *pack; @@ -65,7 +65,7 @@ PUBLIC int ip_read(int fd, size_t count) return NW_SUSPEND; } -PRIVATE acc_t *reassemble (ip_port, pack, pack_hdr) +static acc_t *reassemble (ip_port, pack, pack_hdr) ip_port_t *ip_port; acc_t *pack; ip_hdr_t *pack_hdr; @@ -167,7 +167,7 @@ ip_hdr_t *pack_hdr; return NULL; } -PRIVATE acc_t *merge_frags (first, second) +static acc_t *merge_frags (first, second) acc_t *first, *second; { ip_hdr_t *first_hdr, *second_hdr; @@ -237,7 +237,7 @@ assert (first_hdr_size + first_datasize == bf_bufsize(first)); return first; } -PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id, +static ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id, ipproto_t proto, ipaddr_t src, ipaddr_t dst )) { ip_ass_t *new_ass_ent, *tmp_ass_ent; @@ -311,7 +311,7 @@ PRIVATE ip_ass_t *find_ass_ent ARGS(( ip_port_t *ip_port, u16_t id, return new_ass_ent; } -PRIVATE int ip_frag_chk(pack) +static int ip_frag_chk(pack) acc_t *pack; { ip_hdr_t *ip_hdr; @@ -362,7 +362,7 @@ acc_t *pack; return TRUE; } -PUBLIC int ip_sel_read (ip_fd_t *ip_fd) +int ip_sel_read (ip_fd_t *ip_fd) { acc_t *pack; @@ -384,7 +384,7 @@ PUBLIC int ip_sel_read (ip_fd_t *ip_fd) return 0; } -PUBLIC void ip_packet2user (ip_fd, pack, exp_time, data_len) +void ip_packet2user (ip_fd, pack, exp_time, data_len) ip_fd_t *ip_fd; acc_t *pack; time_t exp_time; @@ -471,7 +471,7 @@ size_t data_len; assert (result >= 0); } -PUBLIC void ip_port_arrive (ip_port, pack, ip_hdr) +void ip_port_arrive (ip_port, pack, ip_hdr) ip_port_t *ip_port; acc_t *pack; ip_hdr_t *ip_hdr; @@ -589,7 +589,7 @@ ip_hdr_t *ip_hdr; } } -PUBLIC void ip_arrived(ip_port, pack) +void ip_arrived(ip_port, pack) ip_port_t *ip_port; acc_t *pack; { @@ -718,7 +718,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE); ev_enqueue(&ip_port->ip_routeq_event, route_packets, ev_arg); } -PUBLIC void ip_arrived_broadcast(ip_port, pack) +void ip_arrived_broadcast(ip_port, pack) ip_port_t *ip_port; acc_t *pack; { @@ -784,7 +784,7 @@ assert (pack->acc_length >= IP_MIN_HDR_SIZE); ip_port_arrive (ip_port, pack, ip_hdr); } -PRIVATE void route_packets(ev, ev_arg) +static void route_packets(ev, ev_arg) event_t *ev; ev_arg_t ev_arg; { @@ -992,7 +992,7 @@ ev_arg_t ev_arg; } } -PRIVATE int broadcast_dst(ip_port, dest) +static int broadcast_dst(ip_port, dest) ip_port_t *ip_port; ipaddr_t dest; { diff --git a/servers/inet/generic/ip_write.c b/servers/inet/generic/ip_write.c index 75028ae3a..b363036e1 100644 --- a/servers/inet/generic/ip_write.c +++ b/servers/inet/generic/ip_write.c @@ -21,9 +21,9 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void error_reply ARGS(( ip_fd_t *fd, int error )); +static void error_reply ARGS(( ip_fd_t *fd, int error )); -PUBLIC int ip_write (fd, count) +int ip_write (fd, count) int fd; size_t count; { @@ -51,7 +51,7 @@ size_t count; return NW_OK; } -PUBLIC int ip_send(fd, data, data_len) +int ip_send(fd, data, data_len) int fd; acc_t *data; size_t data_len; @@ -336,7 +336,7 @@ size_t data_len; return r; } -PUBLIC void ip_hdr_chksum(ip_hdr, ip_hdr_len) +void ip_hdr_chksum(ip_hdr, ip_hdr_len) ip_hdr_t *ip_hdr; int ip_hdr_len; { @@ -344,7 +344,7 @@ int ip_hdr_len; ip_hdr->ih_hdr_chk= ~oneC_sum (0, (u16_t *)ip_hdr, ip_hdr_len); } -PUBLIC acc_t *ip_split_pack (ip_port, ref_last, mtu) +acc_t *ip_split_pack (ip_port, ref_last, mtu) ip_port_t *ip_port; acc_t **ref_last; int mtu; @@ -497,7 +497,7 @@ int mtu; return first_pack; } -PRIVATE void error_reply (ip_fd, error) +static void error_reply (ip_fd, error) ip_fd_t *ip_fd; int error; { diff --git a/servers/inet/generic/ipr.c b/servers/inet/generic/ipr.c index 5aaaaa546..e620d089f 100644 --- a/servers/inet/generic/ipr.c +++ b/servers/inet/generic/ipr.c @@ -35,10 +35,10 @@ typedef struct oroute_hash oroute_t *orh_route; } oroute_hash_t; -PRIVATE oroute_t oroute_table[OROUTE_NR]; -PRIVATE oroute_t *oroute_head; -PRIVATE int static_oroute_nr; -PRIVATE oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR]; +static oroute_t oroute_table[OROUTE_NR]; +static oroute_t *oroute_head; +static int static_oroute_nr; +static oroute_hash_t oroute_hash_table[OROUTE_HASH_NR][OROUTE_HASH_ASS_NR]; #define IROUTE_NR 512 #define IROUTE_HASH_ASS_NR 4 @@ -57,17 +57,17 @@ typedef struct iroute_hash iroute_t *irh_route; } iroute_hash_t; -PRIVATE iroute_t iroute_table[IROUTE_NR]; -PRIVATE iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR]; +static iroute_t iroute_table[IROUTE_NR]; +static iroute_hash_t iroute_hash_table[IROUTE_HASH_NR][IROUTE_HASH_ASS_NR]; -FORWARD oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest )); -FORWARD void oroute_del ARGS(( oroute_t *oroute )); -FORWARD oroute_t *sort_dists ARGS(( oroute_t *oroute )); -FORWARD oroute_t *sort_gws ARGS(( oroute_t *oroute )); -FORWARD void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask )); -FORWARD void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask )); +static oroute_t *oroute_find_ent ARGS(( int port_nr, ipaddr_t dest )); +static void oroute_del ARGS(( oroute_t *oroute )); +static oroute_t *sort_dists ARGS(( oroute_t *oroute )); +static oroute_t *sort_gws ARGS(( oroute_t *oroute )); +static void oroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask )); +static void iroute_uncache_nw ARGS(( ipaddr_t dest, ipaddr_t netmask )); -PUBLIC void ipr_init() +void ipr_init() { int i; oroute_t *oroute; @@ -84,7 +84,7 @@ PUBLIC void ipr_init() } -PUBLIC iroute_t *iroute_frag(port_nr, dest) +iroute_t *iroute_frag(port_nr, dest) int port_nr; ipaddr_t dest; { @@ -184,7 +184,7 @@ ipaddr_t dest; return bestroute; } -PUBLIC int oroute_frag(port_nr, dest, ttl, msgsize, nexthop) +int oroute_frag(port_nr, dest, ttl, msgsize, nexthop) int port_nr; ipaddr_t dest; int ttl; @@ -207,7 +207,7 @@ ipaddr_t *nexthop; } -PUBLIC int ipr_add_oroute(port_nr, dest, subnetmask, gateway, +int ipr_add_oroute(port_nr, dest, subnetmask, gateway, timeout, dist, mtu, static_route, preference, oroute_p) int port_nr; ipaddr_t dest; @@ -408,7 +408,7 @@ oroute_t **oroute_p; return NW_OK; } -PUBLIC int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route) +int ipr_del_oroute(port_nr, dest, subnetmask, gateway, static_route) int port_nr; ipaddr_t dest; ipaddr_t subnetmask; @@ -447,7 +447,7 @@ int static_route; -PUBLIC void ipr_chk_otab(port_nr, addr, mask) +void ipr_chk_otab(port_nr, addr, mask) int port_nr; ipaddr_t addr; ipaddr_t mask; @@ -495,7 +495,7 @@ ipaddr_t mask; } -PUBLIC void ipr_gateway_down(port_nr, gateway, timeout) +void ipr_gateway_down(port_nr, gateway, timeout) int port_nr; ipaddr_t gateway; time_t timeout; @@ -523,7 +523,7 @@ time_t timeout; } -PUBLIC void ipr_destunrch(port_nr, dest, netmask, timeout) +void ipr_destunrch(port_nr, dest, netmask, timeout) int port_nr; ipaddr_t dest; ipaddr_t netmask; @@ -548,7 +548,7 @@ time_t timeout; } -PUBLIC void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway, +void ipr_redirect(port_nr, dest, netmask, old_gateway, new_gateway, timeout) int port_nr; ipaddr_t dest; @@ -611,7 +611,7 @@ time_t timeout; } -PUBLIC void ipr_ttl_exc(port_nr, dest, netmask, timeout) +void ipr_ttl_exc(port_nr, dest, netmask, timeout) int port_nr; ipaddr_t dest; ipaddr_t netmask; @@ -651,7 +651,7 @@ time_t timeout; assert(result == NW_OK); } -PUBLIC void ipr_mtu( +void ipr_mtu( int port_nr, ipaddr_t dest, u16_t mtu, @@ -683,7 +683,7 @@ PUBLIC void ipr_mtu( } -PUBLIC int ipr_get_oroute(ent_no, route_ent) +int ipr_get_oroute(ent_no, route_ent) int ent_no; nwio_route_t *route_ent; { @@ -720,7 +720,7 @@ nwio_route_t *route_ent; } -PRIVATE oroute_t *oroute_find_ent(port_nr, dest) +static oroute_t *oroute_find_ent(port_nr, dest) int port_nr; ipaddr_t dest; { @@ -812,7 +812,7 @@ ipaddr_t dest; } -PRIVATE void oroute_del(oroute) +static void oroute_del(oroute) oroute_t *oroute; { oroute_t *prev, *nw_route, *gw_route, *dist_route, *prev_route; @@ -888,7 +888,7 @@ oroute_t *oroute; } -PRIVATE oroute_t *sort_dists(oroute) +static oroute_t *sort_dists(oroute) oroute_t *oroute; { oroute_t *r, *prev, *best, *best_prev; @@ -932,7 +932,7 @@ oroute_t *oroute; } -PRIVATE oroute_t *sort_gws(oroute) +static oroute_t *sort_gws(oroute) oroute_t *oroute; { oroute_t *r, *prev, *best, *best_prev; @@ -976,7 +976,7 @@ oroute_t *oroute; } -PRIVATE void oroute_uncache_nw(dest, netmask) +static void oroute_uncache_nw(dest, netmask) ipaddr_t dest; ipaddr_t netmask; { @@ -1002,7 +1002,7 @@ ipaddr_t netmask; * Input routing */ -PUBLIC int ipr_get_iroute(ent_no, route_ent) +int ipr_get_iroute(ent_no, route_ent) int ent_no; nwio_route_t *route_ent; { @@ -1035,7 +1035,7 @@ nwio_route_t *route_ent; } -PUBLIC int ipr_add_iroute(port_nr, dest, subnetmask, gateway, +int ipr_add_iroute(port_nr, dest, subnetmask, gateway, dist, mtu, static_route, iroute_p) int port_nr; ipaddr_t dest; @@ -1124,7 +1124,7 @@ iroute_t **iroute_p; } -PUBLIC int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route) +int ipr_del_iroute(port_nr, dest, subnetmask, gateway, static_route) int port_nr; ipaddr_t dest; ipaddr_t subnetmask; @@ -1162,7 +1162,7 @@ int static_route; } -PUBLIC void ipr_chk_itab(port_nr, addr, mask) +void ipr_chk_itab(port_nr, addr, mask) int port_nr; ipaddr_t addr; ipaddr_t mask; @@ -1218,7 +1218,7 @@ ipaddr_t mask; } -PRIVATE void iroute_uncache_nw(dest, netmask) +static void iroute_uncache_nw(dest, netmask) ipaddr_t dest; ipaddr_t netmask; { diff --git a/servers/inet/generic/psip.c b/servers/inet/generic/psip.c index 586056442..28dbc66b6 100644 --- a/servers/inet/generic/psip.c +++ b/servers/inet/generic/psip.c @@ -55,36 +55,36 @@ typedef struct psip_fd #define PFF_PROMISC 4 #define PFF_NEXTHOP 8 -PRIVATE psip_port_t *psip_port_table; -PRIVATE psip_fd_t psip_fd_table[PSIP_FD_NR]; +static psip_port_t *psip_port_table; +static psip_fd_t psip_fd_table[PSIP_FD_NR]; -FORWARD int psip_open ARGS(( int port, int srfd, +static int psip_open ARGS(( int port, int srfd, get_userdata_t get_userdata, put_userdata_t put_userdata, put_pkt_t pkt_pkt, select_res_t select_res )); -FORWARD int psip_ioctl ARGS(( int fd, ioreq_t req )); -FORWARD int psip_read ARGS(( int fd, size_t count )); -FORWARD int psip_write ARGS(( int fd, size_t count )); -FORWARD int psip_select ARGS(( int port_nr, unsigned operations )); -FORWARD void psip_close ARGS(( int fd )); -FORWARD int psip_cancel ARGS(( int fd, int which_operation )); -FORWARD void promisc_restart_read ARGS(( psip_port_t *psip_port )); -FORWARD int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp )); -FORWARD void psip_buffree ARGS(( int priority )); -FORWARD void check_promisc ARGS(( psip_port_t *psip_port )); +static int psip_ioctl ARGS(( int fd, ioreq_t req )); +static int psip_read ARGS(( int fd, size_t count )); +static int psip_write ARGS(( int fd, size_t count )); +static int psip_select ARGS(( int port_nr, unsigned operations )); +static void psip_close ARGS(( int fd )); +static int psip_cancel ARGS(( int fd, int which_operation )); +static void promisc_restart_read ARGS(( psip_port_t *psip_port )); +static int psip_setopt ARGS(( psip_fd_t *psip_fd, nwio_psipopt_t *newoptp )); +static void psip_buffree ARGS(( int priority )); +static void check_promisc ARGS(( psip_port_t *psip_port )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void psip_bufcheck ARGS(( void )); +static void psip_bufcheck ARGS(( void )); #endif -FORWARD void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply, +static void reply_thr_put ARGS(( psip_fd_t *psip_fd, int reply, int for_ioctl )); -FORWARD void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply, +static void reply_thr_get ARGS(( psip_fd_t *psip_fd, int reply, int for_ioctl )); -PUBLIC void psip_prep() +void psip_prep() { psip_port_table= alloc(psip_conf_nr * sizeof(psip_port_table[0])); } -PUBLIC void psip_init() +void psip_init() { int i; psip_port_t *psip_port; @@ -111,7 +111,7 @@ PUBLIC void psip_init() #endif } -PUBLIC int psip_enable(port_nr, ip_port_nr) +int psip_enable(port_nr, ip_port_nr) int port_nr; int ip_port_nr; { @@ -135,7 +135,7 @@ int ip_port_nr; return NW_OK; } -PUBLIC int psip_send(port_nr, dest, pack) +int psip_send(port_nr, dest, pack) int port_nr; ipaddr_t dest; acc_t *pack; @@ -248,7 +248,7 @@ acc_t *pack; return NW_SUSPEND; } -PRIVATE int psip_open(port, srfd, get_userdata, put_userdata, put_pkt, +static int psip_open(port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port; int srfd; @@ -285,7 +285,7 @@ select_res_t select_res; return i; } -PRIVATE int psip_ioctl(fd, req) +static int psip_ioctl(fd, req) int fd; ioreq_t req; { @@ -370,7 +370,7 @@ ioreq_t req; return NW_OK; } -PRIVATE int psip_read(fd, count) +static int psip_read(fd, count) int fd; size_t count; { @@ -422,7 +422,7 @@ size_t count; return NW_OK; } -PRIVATE int psip_write(fd, count) +static int psip_write(fd, count) int fd; size_t count; { @@ -507,7 +507,7 @@ size_t count; return NW_OK; } -PRIVATE int psip_select(fd, operations) +static int psip_select(fd, operations) int fd; unsigned operations; { @@ -515,7 +515,7 @@ unsigned operations; return 0; } -PRIVATE void psip_close(fd) +static void psip_close(fd) int fd; { psip_port_t *psip_port; @@ -540,7 +540,7 @@ int fd; } -PRIVATE int psip_cancel(fd, which_operation) +static int psip_cancel(fd, which_operation) int fd; int which_operation; { @@ -587,7 +587,7 @@ int which_operation; return NW_OK; } -PRIVATE void promisc_restart_read(psip_port) +static void promisc_restart_read(psip_port) psip_port_t *psip_port; { psip_fd_t *psip_fd, *prev, *next; @@ -648,7 +648,7 @@ again: } } -PRIVATE int psip_setopt(psip_fd, newoptp) +static int psip_setopt(psip_fd, newoptp) psip_fd_t *psip_fd; nwio_psipopt_t *newoptp; { @@ -691,7 +691,7 @@ nwio_psipopt_t *newoptp; return NW_OK; } -PRIVATE void check_promisc(psip_port) +static void check_promisc(psip_port) psip_port_t *psip_port; { int i; @@ -733,7 +733,7 @@ psip_port_t *psip_port; } } -PRIVATE void psip_buffree (priority) +static void psip_buffree (priority) int priority; { int i; @@ -763,7 +763,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void psip_bufcheck() +static void psip_bufcheck() { int i; psip_port_t *psip_port; @@ -785,7 +785,7 @@ PRIVATE void psip_bufcheck() reply_thr_put */ -PRIVATE void reply_thr_put(psip_fd, reply, for_ioctl) +static void reply_thr_put(psip_fd, reply, for_ioctl) psip_fd_t *psip_fd; int reply; int for_ioctl; @@ -801,7 +801,7 @@ int for_ioctl; reply_thr_get */ -PRIVATE void reply_thr_get(psip_fd, reply, for_ioctl) +static void reply_thr_get(psip_fd, reply, for_ioctl) psip_fd_t *psip_fd; int reply; int for_ioctl; diff --git a/servers/inet/generic/rand256.c b/servers/inet/generic/rand256.c index 6d9931fe7..f75777532 100644 --- a/servers/inet/generic/rand256.c +++ b/servers/inet/generic/rand256.c @@ -14,15 +14,15 @@ Generate 256-bit random numbers #include "inet.h" #include "rand256.h" -PRIVATE u32_t base_bits[8]; +static u32_t base_bits[8]; -PUBLIC void init_rand256(bits) +void init_rand256(bits) u8_t bits[32]; { memcpy(base_bits, bits, sizeof(base_bits)); } -PUBLIC void rand256(bits) +void rand256(bits) u8_t bits[32]; { u32_t a; diff --git a/servers/inet/generic/tcp.c b/servers/inet/generic/tcp.c index df1295336..d2427b0f2 100644 --- a/servers/inet/generic/tcp.c +++ b/servers/inet/generic/tcp.c @@ -20,53 +20,53 @@ Copyright 1995 Philip Homburg THIS_FILE -PUBLIC tcp_port_t *tcp_port_table; -PUBLIC tcp_fd_t tcp_fd_table[TCP_FD_NR]; -PUBLIC tcp_conn_t tcp_conn_table[TCP_CONN_NR]; -PUBLIC sr_cancel_t tcp_cancel_f; - -FORWARD void tcp_main ARGS(( tcp_port_t *port )); -FORWARD int tcp_select ARGS(( int fd, unsigned operations )); -FORWARD acc_t *tcp_get_data ARGS(( int fd, size_t offset, +tcp_port_t *tcp_port_table; +tcp_fd_t tcp_fd_table[TCP_FD_NR]; +tcp_conn_t tcp_conn_table[TCP_CONN_NR]; +sr_cancel_t tcp_cancel_f; + +static void tcp_main ARGS(( tcp_port_t *port )); +static int tcp_select ARGS(( int fd, unsigned operations )); +static acc_t *tcp_get_data ARGS(( int fd, size_t offset, size_t count, int for_ioctl )); -FORWARD int tcp_put_data ARGS(( int fd, size_t offset, +static int tcp_put_data ARGS(( int fd, size_t offset, acc_t *data, int for_ioctl )); -FORWARD void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen )); -FORWARD void read_ip_packets ARGS(( tcp_port_t *port )); -FORWARD int tcp_setconf ARGS(( tcp_fd_t *tcp_fd )); -FORWARD int tcp_setopt ARGS(( tcp_fd_t *tcp_fd )); -FORWARD int tcp_connect ARGS(( tcp_fd_t *tcp_fd )); -FORWARD int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq )); -FORWARD int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd )); -FORWARD tcpport_t find_unused_port ARGS(( int fd )); -FORWARD int is_unused_port ARGS(( tcpport_t port )); -FORWARD int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply, +static void tcp_put_pkt ARGS(( int fd, acc_t *data, size_t datalen )); +static void read_ip_packets ARGS(( tcp_port_t *port )); +static int tcp_setconf ARGS(( tcp_fd_t *tcp_fd )); +static int tcp_setopt ARGS(( tcp_fd_t *tcp_fd )); +static int tcp_connect ARGS(( tcp_fd_t *tcp_fd )); +static int tcp_listen ARGS(( tcp_fd_t *tcp_fd, int do_listenq )); +static int tcp_acceptto ARGS(( tcp_fd_t *tcp_fd )); +static tcpport_t find_unused_port ARGS(( int fd )); +static int is_unused_port ARGS(( tcpport_t port )); +static int reply_thr_put ARGS(( tcp_fd_t *tcp_fd, int reply, int for_ioctl )); -FORWARD void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply, +static void reply_thr_get ARGS(( tcp_fd_t *tcp_fd, int reply, int for_ioctl )); -FORWARD tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport, +static tcp_conn_t *find_conn_entry ARGS(( tcpport_t locport, ipaddr_t locaddr, tcpport_t remport, ipaddr_t readaddr )); -FORWARD tcp_conn_t *find_empty_conn ARGS(( void )); -FORWARD tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr, +static tcp_conn_t *find_empty_conn ARGS(( void )); +static tcp_conn_t *find_best_conn ARGS(( ip_hdr_t *ip_hdr, tcp_hdr_t *tcp_hdr )); -FORWARD tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd )); -FORWARD int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport, +static tcp_conn_t *new_conn_for_queue ARGS(( tcp_fd_t *tcp_fd )); +static int maybe_listen ARGS(( ipaddr_t locaddr, tcpport_t locport, ipaddr_t remaddr, tcpport_t remport )); -FORWARD int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd )); -FORWARD void tcp_buffree ARGS(( int priority )); +static int tcp_su4connect ARGS(( tcp_fd_t *tcp_fd )); +static void tcp_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void tcp_bufcheck ARGS(( void )); +static void tcp_bufcheck ARGS(( void )); #endif -FORWARD void tcp_setup_conn ARGS(( tcp_port_t *tcp_port, +static void tcp_setup_conn ARGS(( tcp_port_t *tcp_port, tcp_conn_t *tcp_conn )); -FORWARD u32_t tcp_rand32 ARGS(( void )); +static u32_t tcp_rand32 ARGS(( void )); -PUBLIC void tcp_prep() +void tcp_prep() { tcp_port_table= alloc(tcp_conf_nr * sizeof(tcp_port_table[0])); } -PUBLIC void tcp_init() +void tcp_init() { int i, j, k, ifno; tcp_fd_t *tcp_fd; @@ -124,7 +124,7 @@ PUBLIC void tcp_init() tcp_cancel_f= tcp_cancel; } -PRIVATE void tcp_main(tcp_port) +static void tcp_main(tcp_port) tcp_port_t *tcp_port; { int result, i; @@ -245,7 +245,7 @@ tcp_port_t *tcp_port; } } -PRIVATE int tcp_select(fd, operations) +static int tcp_select(fd, operations) int fd; unsigned operations; { @@ -341,7 +341,7 @@ unsigned operations; return resops; } -PRIVATE acc_t *tcp_get_data (port, offset, count, for_ioctl) +static acc_t *tcp_get_data (port, offset, count, for_ioctl) int port; size_t offset; size_t count; @@ -435,7 +435,7 @@ assert (count == sizeof(struct nwio_ipopt)); return NW_OK; } -PRIVATE int tcp_put_data (fd, offset, data, for_ioctl) +static int tcp_put_data (fd, offset, data, for_ioctl) int fd; size_t offset; acc_t *data; @@ -512,7 +512,7 @@ assert (ipconf->nwic_flags & NWIC_IPADDR_SET); tcp_put_pkt */ -PRIVATE void tcp_put_pkt(fd, data, datalen) +static void tcp_put_pkt(fd, data, datalen) int fd; acc_t *data; size_t datalen; @@ -710,7 +710,7 @@ size_t datalen; } -PUBLIC int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt, +int tcp_open (port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port; int srfd; @@ -754,7 +754,7 @@ select_res_t select_res; /* tcp_ioctl */ -PUBLIC int tcp_ioctl (fd, req) +int tcp_ioctl (fd, req) int fd; ioreq_t req; { @@ -969,7 +969,7 @@ assert (conf_acc->acc_length == sizeof(*tcp_conf)); tcp_setconf */ -PRIVATE int tcp_setconf(tcp_fd) +static int tcp_setconf(tcp_fd) tcp_fd_t *tcp_fd; { nwio_tcpconf_t *tcpconf; @@ -1160,7 +1160,7 @@ assert (new_di_flags & NWTC_REMPORT_MASK); tcp_setopt */ -PRIVATE int tcp_setopt(tcp_fd) +static int tcp_setopt(tcp_fd) tcp_fd_t *tcp_fd; { nwio_tcpopt_t *tcpopt; @@ -1276,7 +1276,7 @@ assert (data->acc_length == sizeof(nwio_tcpopt_t)); } -PRIVATE tcpport_t find_unused_port(int fd) +static tcpport_t find_unused_port(int fd) { tcpport_t port, nw_port; @@ -1296,7 +1296,7 @@ PRIVATE tcpport_t find_unused_port(int fd) return 0; } -PRIVATE int is_unused_port(tcpport_t port) +static int is_unused_port(tcpport_t port) { int i; tcp_fd_t *tcp_fd; @@ -1322,7 +1322,7 @@ PRIVATE int is_unused_port(tcpport_t port) return TRUE; } -PRIVATE int reply_thr_put(tcp_fd, reply, for_ioctl) +static int reply_thr_put(tcp_fd, reply, for_ioctl) tcp_fd_t *tcp_fd; int reply; int for_ioctl; @@ -1333,7 +1333,7 @@ int for_ioctl; (acc_t *)0, for_ioctl); } -PRIVATE void reply_thr_get(tcp_fd, reply, for_ioctl) +static void reply_thr_get(tcp_fd, reply, for_ioctl) tcp_fd_t *tcp_fd; int reply; int for_ioctl; @@ -1345,7 +1345,7 @@ int for_ioctl; assert (!result); } -PUBLIC int tcp_su4listen(tcp_fd, tcp_conn, do_listenq) +int tcp_su4listen(tcp_fd, tcp_conn, do_listenq) tcp_fd_t *tcp_fd; tcp_conn_t *tcp_conn; int do_listenq; @@ -1384,7 +1384,7 @@ This includes connections that are never used, and connections without a user that are not used for a while. */ -PRIVATE tcp_conn_t *find_empty_conn() +static tcp_conn_t *find_empty_conn() { int i; tcp_conn_t *tcp_conn; @@ -1424,7 +1424,7 @@ If no such connection exists NULL is returned. If a connection exists without mainuser it is closed. */ -PRIVATE tcp_conn_t *find_conn_entry( +static tcp_conn_t *find_conn_entry( tcpport_t locport, ipaddr_t locaddr, tcpport_t remport, @@ -1460,7 +1460,7 @@ PRIVATE tcp_conn_t *find_conn_entry( return NULL; } -PRIVATE void read_ip_packets(tcp_port) +static void read_ip_packets(tcp_port) tcp_port_t *tcp_port; { int result; @@ -1483,7 +1483,7 @@ tcp_port_t *tcp_port; find_best_conn */ -PRIVATE tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr) +static tcp_conn_t *find_best_conn(ip_hdr, tcp_hdr) ip_hdr_t *ip_hdr; tcp_hdr_t *tcp_hdr; { @@ -1654,7 +1654,7 @@ tcp_hdr_t *tcp_hdr; /* new_conn_for_queue */ -PRIVATE tcp_conn_t *new_conn_for_queue(tcp_fd) +static tcp_conn_t *new_conn_for_queue(tcp_fd) tcp_fd_t *tcp_fd; { int i; @@ -1681,7 +1681,7 @@ tcp_fd_t *tcp_fd; /* maybe_listen */ -PRIVATE int maybe_listen( +static int maybe_listen( ipaddr_t locaddr, tcpport_t locport, ipaddr_t remaddr, @@ -1730,7 +1730,7 @@ PRIVATE int maybe_listen( } -PUBLIC void tcp_reply_ioctl(tcp_fd, reply) +void tcp_reply_ioctl(tcp_fd, reply) tcp_fd_t *tcp_fd; int reply; { @@ -1745,7 +1745,7 @@ int reply; reply_thr_get (tcp_fd, reply, TRUE); } -PUBLIC void tcp_reply_write(tcp_fd, reply) +void tcp_reply_write(tcp_fd, reply) tcp_fd_t *tcp_fd; size_t reply; { @@ -1755,7 +1755,7 @@ size_t reply; reply_thr_get (tcp_fd, reply, FALSE); } -PUBLIC void tcp_reply_read(tcp_fd, reply) +void tcp_reply_read(tcp_fd, reply) tcp_fd_t *tcp_fd; size_t reply; { @@ -1765,7 +1765,7 @@ size_t reply; reply_thr_put (tcp_fd, reply, FALSE); } -PUBLIC int tcp_write(fd, count) +int tcp_write(fd, count) int fd; size_t count; { @@ -1818,7 +1818,7 @@ size_t count; return NW_SUSPEND; } -PUBLIC int +int tcp_read(fd, count) int fd; size_t count; @@ -1858,7 +1858,7 @@ reply the success or failure of a connect to the user. */ -PUBLIC void tcp_restart_connect(tcp_conn) +void tcp_restart_connect(tcp_conn) tcp_conn_t *tcp_conn; { tcp_fd_t *tcp_fd; @@ -1932,7 +1932,7 @@ tcp_conn_t *tcp_conn; tcp_close */ -PUBLIC void tcp_close(fd) +void tcp_close(fd) int fd; { int i; @@ -2029,7 +2029,7 @@ int fd; tcp_close_connection(tcp_conn, ENOTCONN); } -PUBLIC int tcp_cancel(fd, which_operation) +int tcp_cancel(fd, which_operation) int fd; int which_operation; { @@ -2108,7 +2108,7 @@ assert (tcp_fd->tf_flags & TFF_IOCTL_IP); tcp_connect */ -PRIVATE int tcp_connect(tcp_fd) +static int tcp_connect(tcp_fd) tcp_fd_t *tcp_fd; { tcp_conn_t *tcp_conn; @@ -2192,7 +2192,7 @@ tcp_fd_t *tcp_fd; tcp_su4connect */ -PRIVATE int tcp_su4connect(tcp_fd) +static int tcp_su4connect(tcp_fd) tcp_fd_t *tcp_fd; { tcp_conn_t *tcp_conn; @@ -2231,7 +2231,7 @@ tcp_fd_t *tcp_fd; tcp_listen */ -PRIVATE int tcp_listen(tcp_fd, do_listenq) +static int tcp_listen(tcp_fd, do_listenq) tcp_fd_t *tcp_fd; int do_listenq; { @@ -2284,7 +2284,7 @@ int do_listenq; tcp_acceptto */ -PRIVATE int tcp_acceptto(tcp_fd) +static int tcp_acceptto(tcp_fd) tcp_fd_t *tcp_fd; { int i, dst_nr; @@ -2357,7 +2357,7 @@ tcp_fd_t *tcp_fd; } -PRIVATE void tcp_buffree (priority) +static void tcp_buffree (priority) int priority; { int i; @@ -2440,7 +2440,7 @@ int priority; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void tcp_bufcheck() +static void tcp_bufcheck() { int i; tcp_conn_t *tcp_conn; @@ -2470,7 +2470,7 @@ PRIVATE void tcp_bufcheck() } #endif -PUBLIC void tcp_notreach(tcp_conn, error) +void tcp_notreach(tcp_conn, error) tcp_conn_t *tcp_conn; int error; { @@ -2497,7 +2497,7 @@ int error; tcp_conn_write(tcp_conn, 1); } -FORWARD u32_t mtu_table[]= +static u32_t mtu_table[]= { /* From RFC-1191 */ /* Plateau MTU Comments Reference */ /* ------ --- -------- --------- */ @@ -2535,7 +2535,7 @@ FORWARD u32_t mtu_table[]= 0, /* End of list */ }; -PUBLIC void tcp_mtu_exceeded(tcp_conn) +void tcp_mtu_exceeded(tcp_conn) tcp_conn_t *tcp_conn; { u16_t mtu; @@ -2600,7 +2600,7 @@ tcp_conn_t *tcp_conn; tcp_conn_write(tcp_conn, 1); } -PUBLIC void tcp_mtu_incr(tcp_conn) +void tcp_mtu_incr(tcp_conn) tcp_conn_t *tcp_conn; { clock_t curr_time; @@ -2637,7 +2637,7 @@ tcp_conn_t *tcp_conn; tcp_setup_conn */ -PRIVATE void tcp_setup_conn(tcp_port, tcp_conn) +static void tcp_setup_conn(tcp_port, tcp_conn) tcp_port_t *tcp_port; tcp_conn_t *tcp_conn; { @@ -2714,7 +2714,7 @@ tcp_conn_t *tcp_conn; tcp_conn->tc_transmit_seq= 0; } -PRIVATE u32_t tcp_rand32() +static u32_t tcp_rand32() { u8_t bits[RAND256_BUFSIZE]; diff --git a/servers/inet/generic/tcp_lib.c b/servers/inet/generic/tcp_lib.c index 6cf6616aa..a25671beb 100644 --- a/servers/inet/generic/tcp_lib.c +++ b/servers/inet/generic/tcp_lib.c @@ -17,7 +17,7 @@ Copyright 1995 Philip Homburg THIS_FILE #undef tcp_LEmod4G -PUBLIC int tcp_LEmod4G(n1, n2) +int tcp_LEmod4G(n1, n2) u32_t n1; u32_t n2; { @@ -25,7 +25,7 @@ u32_t n2; } #undef tcp_GEmod4G -PUBLIC int tcp_GEmod4G(n1, n2) +int tcp_GEmod4G(n1, n2) u32_t n1; u32_t n2; { @@ -33,7 +33,7 @@ u32_t n2; } #undef tcp_Lmod4G -PUBLIC int tcp_Lmod4G(n1, n2) +int tcp_Lmod4G(n1, n2) u32_t n1; u32_t n2; { @@ -41,14 +41,14 @@ u32_t n2; } #undef tcp_Gmod4G -PUBLIC int tcp_Gmod4G(n1, n2) +int tcp_Gmod4G(n1, n2) u32_t n1; u32_t n2; { return !!((u32_t)(n2-n1) & 0x80000000L); } -PUBLIC void tcp_extract_ipopt(tcp_conn, ip_hdr) +void tcp_extract_ipopt(tcp_conn, ip_hdr) tcp_conn_t *tcp_conn; ip_hdr_t *ip_hdr; { @@ -61,7 +61,7 @@ ip_hdr_t *ip_hdr; DBLOCK(1, printf("ip_hdr options NOT supported (yet?)\n")); } -PUBLIC void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp) +void tcp_extract_tcpopt(tcp_conn, tcp_hdr, mssp) tcp_conn_t *tcp_conn; tcp_hdr_t *tcp_hdr; size_t *mssp; @@ -119,7 +119,7 @@ size_t *mssp; } } -PUBLIC u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack) +u16_t tcp_pack_oneCsum(ip_hdr, tcp_pack) ip_hdr_t *ip_hdr; acc_t *tcp_pack; { @@ -165,7 +165,7 @@ acc_t *tcp_pack; return sum; } -PUBLIC void tcp_get_ipopt(tcp_conn, ip_hdropt) +void tcp_get_ipopt(tcp_conn, ip_hdropt) tcp_conn_t *tcp_conn; ip_hdropt_t *ip_hdropt; { @@ -179,7 +179,7 @@ ip_hdropt_t *ip_hdropt; return; } -PUBLIC void tcp_get_tcpopt(tcp_conn, tcp_hdropt) +void tcp_get_tcpopt(tcp_conn, tcp_hdropt) tcp_conn_t *tcp_conn; tcp_hdropt_t *tcp_hdropt; { @@ -204,7 +204,7 @@ tcp_hdropt_t *tcp_hdropt; return; } -PUBLIC acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data) +acc_t *tcp_make_header(tcp_conn, ref_ip_hdr, ref_tcp_hdr, data) tcp_conn_t *tcp_conn; ip_hdr_t **ref_ip_hdr; tcp_hdr_t **ref_tcp_hdr; @@ -295,7 +295,7 @@ acc_t *data; return hdr_acc; } -PUBLIC void tcp_print_state (tcp_conn) +void tcp_print_state (tcp_conn) tcp_conn_t *tcp_conn; { #if DEBUG @@ -319,7 +319,7 @@ tcp_conn_t *tcp_conn; #endif } -PUBLIC int tcp_check_conn(tcp_conn) +int tcp_check_conn(tcp_conn) tcp_conn_t *tcp_conn; { int allright; @@ -480,7 +480,7 @@ tcp_conn_t *tcp_conn; return allright; } -PUBLIC void tcp_print_pack(ip_hdr, tcp_hdr) +void tcp_print_pack(ip_hdr, tcp_hdr) ip_hdr_t *ip_hdr; tcp_hdr_t *tcp_hdr; { @@ -516,7 +516,7 @@ tcp_hdr_t *tcp_hdr; printf(" ", tcp_hdr_len-TCP_MIN_HDR_SIZE); } -PUBLIC void tcp_print_conn(tcp_conn) +void tcp_print_conn(tcp_conn) tcp_conn_t *tcp_conn; { u32_t iss, irs; diff --git a/servers/inet/generic/tcp_recv.c b/servers/inet/generic/tcp_recv.c index 5264f7196..41390c2de 100644 --- a/servers/inet/generic/tcp_recv.c +++ b/servers/inet/generic/tcp_recv.c @@ -18,14 +18,14 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void create_RST ARGS(( tcp_conn_t *tcp_conn, +static void create_RST ARGS(( tcp_conn_t *tcp_conn, ip_hdr_t *ip_hdr, tcp_hdr_t *tcp_hdr, int data_len )); -FORWARD void process_data ARGS(( tcp_conn_t *tcp_conn, +static void process_data ARGS(( tcp_conn_t *tcp_conn, tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len )); -FORWARD void process_advanced_data ARGS(( tcp_conn_t *tcp_conn, +static void process_advanced_data ARGS(( tcp_conn_t *tcp_conn, tcp_hdr_t *tcp_hdr, acc_t *tcp_data, int data_len )); -PUBLIC void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len) +void tcp_frag2conn(tcp_conn, ip_hdr, tcp_hdr, tcp_data, data_len) tcp_conn_t *tcp_conn; ip_hdr_t *ip_hdr; tcp_hdr_t *tcp_hdr; @@ -796,7 +796,7 @@ TIME-WAIT: } -PRIVATE void +static void process_data(tcp_conn, tcp_hdr, tcp_data, data_len) tcp_conn_t *tcp_conn; tcp_hdr_t *tcp_hdr; @@ -1058,7 +1058,7 @@ int data_len; } } -PRIVATE void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len) +static void process_advanced_data(tcp_conn, tcp_hdr, tcp_data, data_len) tcp_conn_t *tcp_conn; tcp_hdr_t *tcp_hdr; acc_t *tcp_data; @@ -1120,7 +1120,7 @@ int data_len; tcp_conn->tc_adv_seq= adv_seq; } -PRIVATE void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len) +static void create_RST(tcp_conn, ip_hdr, tcp_hdr, data_len) tcp_conn_t *tcp_conn; ip_hdr_t *ip_hdr; tcp_hdr_t *tcp_hdr; @@ -1218,7 +1218,7 @@ int data_len; tcp_conn_write(tcp_conn, 1); } -PUBLIC void +void tcp_fd_read(tcp_conn, enq) tcp_conn_t *tcp_conn; int enq; /* Enqueue writes. */ @@ -1390,7 +1390,7 @@ int enq; /* Enqueue writes. */ } } -PUBLIC unsigned +unsigned tcp_sel_read(tcp_conn) tcp_conn_t *tcp_conn; { @@ -1426,7 +1426,7 @@ tcp_conn_t *tcp_conn; return 1; } -PUBLIC void +void tcp_rsel_read(tcp_conn) tcp_conn_t *tcp_conn; { @@ -1443,7 +1443,7 @@ tcp_conn_t *tcp_conn; printf("tcp_rsel_read: no select_res\n"); } -PUBLIC void tcp_bytesavailable(tcp_fd, bytesp) +void tcp_bytesavailable(tcp_fd, bytesp) tcp_fd_t *tcp_fd; int *bytesp; { diff --git a/servers/inet/generic/tcp_send.c b/servers/inet/generic/tcp_send.c index b1d608857..ad7fa36ed 100644 --- a/servers/inet/generic/tcp_send.c +++ b/servers/inet/generic/tcp_send.c @@ -19,11 +19,11 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn )); -FORWARD void tcp_send_timeout ARGS(( int conn, struct timer *timer )); -FORWARD void do_snd_event ARGS(( event_t *ev, ev_arg_t arg )); +static acc_t *make_pack ARGS(( tcp_conn_t *tcp_conn )); +static void tcp_send_timeout ARGS(( int conn, struct timer *timer )); +static void do_snd_event ARGS(( event_t *ev, ev_arg_t arg )); -PUBLIC void tcp_conn_write (tcp_conn, enq) +void tcp_conn_write (tcp_conn, enq) tcp_conn_t *tcp_conn; int enq; /* Writes need to be enqueued. */ { @@ -69,7 +69,7 @@ int enq; /* Writes need to be enqueued. */ } } -PRIVATE void do_snd_event(ev, arg) +static void do_snd_event(ev, arg) event_t *ev; ev_arg_t arg; { @@ -81,7 +81,7 @@ ev_arg_t arg; tcp_port_write(tcp_port); } -PUBLIC void tcp_port_write(tcp_port) +void tcp_port_write(tcp_port) tcp_port_t *tcp_port; { tcp_conn_t *tcp_conn; @@ -158,7 +158,7 @@ tcp_port_t *tcp_port; } } -PRIVATE acc_t *make_pack(tcp_conn) +static acc_t *make_pack(tcp_conn) tcp_conn_t *tcp_conn; { acc_t *pack2write, *tmp_pack, *tcp_pack; @@ -530,7 +530,7 @@ after_data: tcp_release_retrans */ -PUBLIC void tcp_release_retrans( +void tcp_release_retrans( tcp_conn_t *tcp_conn, u32_t seg_ack, u16_t new_win @@ -766,7 +766,7 @@ PUBLIC void tcp_release_retrans( tcp_fast_retrans */ -PUBLIC void tcp_fast_retrans(tcp_conn) +void tcp_fast_retrans(tcp_conn) tcp_conn_t *tcp_conn; { u16_t mss, mss2; @@ -797,7 +797,7 @@ tcp_conn_t *tcp_conn; } #if 0 -PUBLIC void do_tcp_timeout(tcp_conn) +void do_tcp_timeout(tcp_conn) tcp_conn_t *tcp_conn; { tcp_send_timeout(tcp_conn-tcp_conn_table, @@ -809,7 +809,7 @@ tcp_conn_t *tcp_conn; tcp_send_timeout */ -PRIVATE void tcp_send_timeout(conn, timer) +static void tcp_send_timeout(conn, timer) int conn; struct timer *timer; { @@ -1060,7 +1060,7 @@ struct timer *timer; } -PUBLIC void tcp_fd_write(tcp_conn) +void tcp_fd_write(tcp_conn) tcp_conn_t *tcp_conn; { tcp_fd_t *tcp_fd; @@ -1182,7 +1182,7 @@ tcp_conn_t *tcp_conn; } } -PUBLIC unsigned tcp_sel_write(tcp_conn) +unsigned tcp_sel_write(tcp_conn) tcp_conn_t *tcp_conn; { tcp_fd_t *tcp_fd; @@ -1222,7 +1222,7 @@ tcp_conn_t *tcp_conn; return 0; } -PUBLIC void +void tcp_rsel_write(tcp_conn) tcp_conn_t *tcp_conn; { @@ -1243,7 +1243,7 @@ tcp_conn_t *tcp_conn; tcp_shutdown */ -PUBLIC void tcp_shutdown(tcp_conn) +void tcp_shutdown(tcp_conn) tcp_conn_t *tcp_conn; { switch (tcp_conn->tc_state) @@ -1272,7 +1272,7 @@ tcp_conn_t *tcp_conn; tcp_set_send_timer(tcp_conn); } -PUBLIC void tcp_set_send_timer(tcp_conn) +void tcp_set_send_timer(tcp_conn) tcp_conn_t *tcp_conn; { clock_t curr_time; @@ -1300,7 +1300,7 @@ tcp_close_connection */ -PUBLIC void tcp_close_connection(tcp_conn, error) +void tcp_close_connection(tcp_conn, error) tcp_conn_t *tcp_conn; int error; { diff --git a/servers/inet/generic/udp.c b/servers/inet/generic/udp.c index f173f4ed2..9a4021845 100644 --- a/servers/inet/generic/udp.c +++ b/servers/inet/generic/udp.c @@ -19,45 +19,45 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void read_ip_packets ARGS(( udp_port_t *udp_port )); -FORWARD void udp_buffree ARGS(( int priority )); +static void read_ip_packets ARGS(( udp_port_t *udp_port )); +static void udp_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void udp_bufcheck ARGS(( void )); +static void udp_bufcheck ARGS(( void )); #endif -FORWARD void udp_main ARGS(( udp_port_t *udp_port )); -FORWARD int udp_select ARGS(( int fd, unsigned operations )); -FORWARD acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count, +static void udp_main ARGS(( udp_port_t *udp_port )); +static int udp_select ARGS(( int fd, unsigned operations )); +static acc_t *udp_get_data ARGS(( int fd, size_t offset, size_t count, int for_ioctl )); -FORWARD int udp_put_data ARGS(( int fd, size_t offset, acc_t *data, +static int udp_put_data ARGS(( int fd, size_t offset, acc_t *data, int for_ioctl )); -FORWARD int udp_peek ARGS(( udp_fd_t * )); -FORWARD int udp_sel_read ARGS(( udp_fd_t * )); -FORWARD void udp_restart_write_port ARGS(( udp_port_t *udp_port )); -FORWARD void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size )); -FORWARD void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply, +static int udp_peek ARGS(( udp_fd_t * )); +static int udp_sel_read ARGS(( udp_fd_t * )); +static void udp_restart_write_port ARGS(( udp_port_t *udp_port )); +static void udp_ip_arrived ARGS(( int port, acc_t *pack, size_t pack_size )); +static void reply_thr_put ARGS(( udp_fd_t *udp_fd, int reply, int for_ioctl )); -FORWARD void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply, +static void reply_thr_get ARGS(( udp_fd_t *udp_fd, int reply, int for_ioctl )); -FORWARD int udp_setopt ARGS(( udp_fd_t *udp_fd )); -FORWARD udpport_t find_unused_port ARGS(( int fd )); -FORWARD int is_unused_port ARGS(( udpport_t port )); -FORWARD int udp_packet2user ARGS(( udp_fd_t *udp_fd )); -FORWARD void restart_write_fd ARGS(( udp_fd_t *udp_fd )); -FORWARD u16_t pack_oneCsum ARGS(( acc_t *pack )); -FORWARD void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack, +static int udp_setopt ARGS(( udp_fd_t *udp_fd )); +static udpport_t find_unused_port ARGS(( int fd )); +static int is_unused_port ARGS(( udpport_t port )); +static int udp_packet2user ARGS(( udp_fd_t *udp_fd )); +static void restart_write_fd ARGS(( udp_fd_t *udp_fd )); +static u16_t pack_oneCsum ARGS(( acc_t *pack )); +static void udp_rd_enqueue ARGS(( udp_fd_t *udp_fd, acc_t *pack, clock_t exp_tim )); -FORWARD void hash_fd ARGS(( udp_fd_t *udp_fd )); -FORWARD void unhash_fd ARGS(( udp_fd_t *udp_fd )); +static void hash_fd ARGS(( udp_fd_t *udp_fd )); +static void unhash_fd ARGS(( udp_fd_t *udp_fd )); -PUBLIC udp_port_t *udp_port_table; -PUBLIC udp_fd_t udp_fd_table[UDP_FD_NR]; +udp_port_t *udp_port_table; +udp_fd_t udp_fd_table[UDP_FD_NR]; -PUBLIC void udp_prep() +void udp_prep() { udp_port_table= alloc(udp_conf_nr * sizeof(udp_port_table[0])); } -PUBLIC void udp_init() +void udp_init() { udp_fd_t *udp_fd; udp_port_t *udp_port; @@ -104,7 +104,7 @@ PUBLIC void udp_init() } } -PUBLIC int udp_open (port, srfd, get_userdata, put_userdata, put_pkt, +int udp_open (port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port; int srfd; @@ -141,7 +141,7 @@ select_res_t select_res; } -PUBLIC int udp_ioctl (fd, req) +int udp_ioctl (fd, req) int fd; ioreq_t req; { @@ -192,7 +192,7 @@ assert (opt_acc->acc_length == sizeof(*udp_opt)); return result; } -PUBLIC int udp_read (fd, count) +int udp_read (fd, count) int fd; size_t count; { @@ -225,7 +225,7 @@ size_t count; return NW_SUSPEND; } -PRIVATE void udp_main(udp_port) +static void udp_main(udp_port) udp_port_t *udp_port; { udp_fd_t *udp_fd; @@ -292,7 +292,7 @@ udp_port_t *udp_port; } } -PRIVATE int udp_select(fd, operations) +static int udp_select(fd, operations) int fd; unsigned operations; { @@ -323,7 +323,7 @@ unsigned operations; return resops; } -PRIVATE acc_t *udp_get_data (port, offset, count, for_ioctl) +static acc_t *udp_get_data (port, offset, count, for_ioctl) int port; size_t offset; size_t count; @@ -409,7 +409,7 @@ assert (udp_port->up_wr_pack); return NULL; } -PRIVATE int udp_put_data (fd, offset, data, for_ioctl) +static int udp_put_data (fd, offset, data, for_ioctl) int fd; size_t offset; acc_t *data; @@ -478,7 +478,7 @@ assert (!offset); /* This isn't a valid assertion but ip sends only return NW_OK; } -PRIVATE int udp_setopt(udp_fd) +static int udp_setopt(udp_fd) udp_fd_t *udp_fd; { udp_fd_t *fd_ptr; @@ -676,7 +676,7 @@ assert (data->acc_length == sizeof(nwio_udpopt_t)); return NW_OK; } -PRIVATE udpport_t find_unused_port(int fd) +static udpport_t find_unused_port(int fd) { udpport_t port, nw_port; @@ -700,7 +700,7 @@ PRIVATE udpport_t find_unused_port(int fd) reply_thr_put */ -PRIVATE void reply_thr_put(udp_fd, reply, for_ioctl) +static void reply_thr_put(udp_fd, reply, for_ioctl) udp_fd_t *udp_fd; int reply; int for_ioctl; @@ -716,7 +716,7 @@ int for_ioctl; reply_thr_get */ -PRIVATE void reply_thr_get(udp_fd, reply, for_ioctl) +static void reply_thr_get(udp_fd, reply, for_ioctl) udp_fd_t *udp_fd; int reply; int for_ioctl; @@ -727,7 +727,7 @@ int for_ioctl; assert (!result); } -PRIVATE int is_unused_port(udpport_t port) +static int is_unused_port(udpport_t port) { int i; udp_fd_t *udp_fd; @@ -743,7 +743,7 @@ PRIVATE int is_unused_port(udpport_t port) return TRUE; } -PRIVATE void read_ip_packets(udp_port) +static void read_ip_packets(udp_port) udp_port_t *udp_port; { int result; @@ -763,7 +763,7 @@ assert(result == NW_OK); } -PRIVATE int udp_peek (udp_fd) +static int udp_peek (udp_fd) udp_fd_t *udp_fd; { acc_t *pack, *tmp_acc, *next_acc; @@ -804,7 +804,7 @@ udp_fd_t *udp_fd; return NW_SUSPEND; } -PRIVATE int udp_sel_read (udp_fd_t *udp_fd) +static int udp_sel_read (udp_fd_t *udp_fd) { acc_t *tmp_acc, *next_acc; @@ -828,7 +828,7 @@ PRIVATE int udp_sel_read (udp_fd_t *udp_fd) return 0; } -PRIVATE int udp_packet2user (udp_fd) +static int udp_packet2user (udp_fd) udp_fd_t *udp_fd; { acc_t *pack, *tmp_pack; @@ -889,7 +889,7 @@ udp_fd_t *udp_fd; return result; } -PRIVATE void udp_ip_arrived(port, pack, pack_size) +static void udp_ip_arrived(port, pack, pack_size) int port; acc_t *pack; size_t pack_size; @@ -1158,7 +1158,7 @@ size_t pack_size; bf_afree(udp_acc); } -PUBLIC void udp_close(fd) +void udp_close(fd) int fd; { udp_fd_t *udp_fd; @@ -1182,7 +1182,7 @@ int fd; udp_fd->uf_rdbuf_head= NULL; } -PUBLIC int udp_write(int fd, size_t count) +int udp_write(int fd, size_t count) { udp_fd_t *udp_fd; @@ -1214,7 +1214,7 @@ assert (!(udp_fd->uf_flags & UFF_WRITE_IP)); } } -PRIVATE void restart_write_fd(udp_fd) +static void restart_write_fd(udp_fd) udp_fd_t *udp_fd; { udp_port_t *udp_port; @@ -1375,7 +1375,7 @@ assert (!(udp_port->up_flags & UPF_WRITE_IP)); reply_thr_get (udp_fd, udp_fd->uf_wr_count, FALSE); } -PRIVATE u16_t pack_oneCsum(pack) +static u16_t pack_oneCsum(pack) acc_t *pack; { u16_t prev; @@ -1423,7 +1423,7 @@ acc_t *pack; return prev; } -PRIVATE void udp_restart_write_port(udp_port ) +static void udp_restart_write_port(udp_port ) udp_port_t *udp_port; { udp_fd_t *udp_fd; @@ -1459,7 +1459,7 @@ assert (!(udp_port->up_flags & (UPF_WRITE_IP|UPF_WRITE_SP))); } } -PUBLIC int udp_cancel(fd, which_operation) +int udp_cancel(fd, which_operation) int fd; int which_operation; { @@ -1495,7 +1495,7 @@ assert (udp_fd->uf_flags & UFF_IOCTL_IP); return NW_OK; } -PRIVATE void udp_buffree (priority) +static void udp_buffree (priority) int priority; { int i; @@ -1530,7 +1530,7 @@ int priority; } } -PRIVATE void udp_rd_enqueue(udp_fd, pack, exp_tim) +static void udp_rd_enqueue(udp_fd, pack, exp_tim) udp_fd_t *udp_fd; acc_t *pack; clock_t exp_tim; @@ -1578,7 +1578,7 @@ clock_t exp_tim; } } -PRIVATE void hash_fd(udp_fd) +static void hash_fd(udp_fd) udp_fd_t *udp_fd; { udp_port_t *udp_port; @@ -1602,7 +1602,7 @@ udp_fd_t *udp_fd; } } -PRIVATE void unhash_fd(udp_fd) +static void unhash_fd(udp_fd) udp_fd_t *udp_fd; { udp_port_t *udp_port; @@ -1637,7 +1637,7 @@ udp_fd_t *udp_fd; } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void udp_bufcheck() +static void udp_bufcheck() { int i; udp_port_t *udp_port; diff --git a/servers/inet/inet.c b/servers/inet/inet.c index 3fe003581..05314080b 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -82,15 +82,15 @@ extern int inet_buf_debug; u32_t system_hz; #endif -FORWARD void nw_conf(void); -FORWARD void nw_init(void); -FORWARD void ds_event(void); +static void nw_conf(void); +static void nw_init(void); +static void ds_event(void); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { mq_t *mq; int ipc_status; @@ -188,7 +188,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -203,7 +203,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the inet server. */ int r; @@ -301,7 +301,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) return(OK); } -PRIVATE void nw_conf() +static void nw_conf() { read_conf(); eth_prep(); @@ -312,7 +312,7 @@ PRIVATE void nw_conf() udp_prep(); } -PRIVATE void nw_init() +static void nw_init() { mq_init(); bf_init(); @@ -330,7 +330,7 @@ PRIVATE void nw_init() /*===========================================================================* * ds_event * *===========================================================================*/ -PRIVATE void ds_event() +static void ds_event() { char key[DS_MAX_KEYLEN]; char *driver_prefix = "drv.net."; @@ -370,14 +370,14 @@ PRIVATE void ds_event() printf("inet: ds_event: ds_check failed: %d\n", r); } -PUBLIC void panic0(file, line) +void panic0(file, line) char *file; int line; { printf("panic at %s, %d: ", file, line); } -PUBLIC void inet_panic() +void inet_panic() { printf("\ninet stacktrace: "); util_stacktrace(); @@ -386,7 +386,7 @@ PUBLIC void inet_panic() } #if !NDEBUG -PUBLIC void bad_assertion(file, line, what) +void bad_assertion(file, line, what) char *file; int line; char *what; @@ -397,7 +397,7 @@ char *what; } -PUBLIC void bad_compare(file, line, lhs, what, rhs) +void bad_compare(file, line, lhs, what, rhs) char *file; int line; int lhs; diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index af3a97dc4..d3967eb92 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -21,14 +21,14 @@ Copyright 1995 Philip Homburg THIS_FILE -FORWARD void setup_read(eth_port_t *eth_port); -FORWARD void read_int(eth_port_t *eth_port, int count); -FORWARD void eth_issue_send(eth_port_t *eth_port); -FORWARD void write_int(eth_port_t *eth_port); -FORWARD void eth_restart(eth_port_t *eth_port, endpoint_t endpoint); -FORWARD void send_getstat(eth_port_t *eth_port); - -PUBLIC void osdep_eth_init() +static void setup_read(eth_port_t *eth_port); +static void read_int(eth_port_t *eth_port, int count); +static void eth_issue_send(eth_port_t *eth_port); +static void write_int(eth_port_t *eth_port); +static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint); +static void send_getstat(eth_port_t *eth_port); + +void osdep_eth_init() { int i, j, rport; struct eth_conf *ecp; @@ -155,7 +155,7 @@ PUBLIC void osdep_eth_init() } } -PUBLIC void eth_write_port(eth_port, pack) +void eth_write_port(eth_port, pack) eth_port_t *eth_port; acc_t *pack; { @@ -175,7 +175,7 @@ acc_t *pack; eth_issue_send(eth_port); } -PUBLIC void eth_rec(message *m) +void eth_rec(message *m) { int i, r, m_type, flags; eth_port_t *loc_port, *vlan_port; @@ -362,7 +362,7 @@ PUBLIC void eth_rec(message *m) } } -PUBLIC void eth_check_driver(char *label, endpoint_t endpoint) +void eth_check_driver(char *label, endpoint_t endpoint) { int i; eth_port_t *loc_port; @@ -384,7 +384,7 @@ PUBLIC void eth_check_driver(char *label, endpoint_t endpoint) } } -PUBLIC int eth_get_stat(eth_port, eth_stat) +int eth_get_stat(eth_port, eth_stat) eth_port_t *eth_port; eth_stat_t *eth_stat; { @@ -417,7 +417,7 @@ eth_stat_t *eth_stat; return SUSPEND; } -PUBLIC void eth_set_rec_conf (eth_port, flags) +void eth_set_rec_conf (eth_port, flags) eth_port_t *eth_port; u32_t flags; { @@ -478,7 +478,7 @@ u32_t flags; } } -PRIVATE void eth_issue_send(eth_port) +static void eth_issue_send(eth_port) eth_port_t *eth_port; { int i, r, pack_size; @@ -557,7 +557,7 @@ eth_port_t *eth_port; eth_port->etp_osdep.etp_state= OEPS_SEND_SENT; } -PRIVATE void write_int(eth_port_t *eth_port) +static void write_int(eth_port_t *eth_port) { acc_t *pack; int multicast; @@ -590,7 +590,7 @@ PRIVATE void write_int(eth_port_t *eth_port) eth_restart_write(eth_port); } -PRIVATE void read_int(eth_port, count) +static void read_int(eth_port, count) eth_port_t *eth_port; int count; { @@ -654,7 +654,7 @@ int count; setup_read(eth_port); } -PRIVATE void setup_read(eth_port) +static void setup_read(eth_port) eth_port_t *eth_port; { acc_t *pack, *pack_ptr; @@ -812,7 +812,7 @@ static void eth_restart(eth_port_t *eth_port, endpoint_t endpoint) } -PRIVATE void send_getstat(eth_port) +static void send_getstat(eth_port) eth_port_t *eth_port; { int r; diff --git a/servers/inet/mq.c b/servers/inet/mq.c index 863156402..c0299776e 100644 --- a/servers/inet/mq.c +++ b/servers/inet/mq.c @@ -14,8 +14,8 @@ THIS_FILE #define MQ_SIZE 128 -PRIVATE mq_t mq_list[MQ_SIZE]; -PRIVATE mq_t *mq_freelist; +static mq_t mq_list[MQ_SIZE]; +static mq_t *mq_freelist; void mq_init() { diff --git a/servers/inet/qp.c b/servers/inet/qp.c index 8f47c4096..df09c856b 100644 --- a/servers/inet/qp.c +++ b/servers/inet/qp.c @@ -42,9 +42,9 @@ typedef struct qp_fd #define QFF_EMPTY 0 #define QFF_INUSE 1 -PRIVATE qp_fd_t qp_fd_table[QP_FD_NR]; +static qp_fd_t qp_fd_table[QP_FD_NR]; -PRIVATE struct export_param_list inet_ex_list[]= +static struct export_param_list inet_ex_list[]= { QP_VARIABLE(sr_fd_table), QP_VARIABLE(ip_dev), @@ -56,9 +56,9 @@ PRIVATE struct export_param_list inet_ex_list[]= QP_END() }; -PRIVATE struct export_params inet_ex_params= { inet_ex_list, NULL }; +static struct export_params inet_ex_params= { inet_ex_list, NULL }; -PRIVATE struct queryvars { +static struct queryvars { /* Input */ acc_t *param; @@ -73,25 +73,25 @@ PRIVATE struct queryvars { } *qvars; -FORWARD int qp_open ARGS(( int port, int srfd, +static int qp_open ARGS(( int port, int srfd, get_userdata_t get_userdata, put_userdata_t put_userdata, put_pkt_t put_pkt, select_res_t select_res )); -FORWARD void qp_close ARGS(( int fd )); -FORWARD int qp_read ARGS(( int fd, size_t count )); -FORWARD int qp_write ARGS(( int fd, size_t count )); -FORWARD int qp_ioctl ARGS(( int fd, ioreq_t req )); -FORWARD int qp_cancel ARGS(( int fd, int which_operation )); -FORWARD int qp_select ARGS(( int fd, unsigned operations )); -FORWARD qp_fd_t *get_qp_fd ARGS(( int fd )); -FORWARD int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count )); -FORWARD int qp_getc ARGS(( void )); -FORWARD void qp_putc ARGS(( struct queryvars *qv, int c )); -FORWARD void qp_buffree ARGS(( int priority )); +static void qp_close ARGS(( int fd )); +static int qp_read ARGS(( int fd, size_t count )); +static int qp_write ARGS(( int fd, size_t count )); +static int qp_ioctl ARGS(( int fd, ioreq_t req )); +static int qp_cancel ARGS(( int fd, int which_operation )); +static int qp_select ARGS(( int fd, unsigned operations )); +static qp_fd_t *get_qp_fd ARGS(( int fd )); +static int do_query ARGS(( qp_fd_t *qp_fd, acc_t *pkt, int count )); +static int qp_getc ARGS(( void )); +static void qp_putc ARGS(( struct queryvars *qv, int c )); +static void qp_buffree ARGS(( int priority )); #ifdef BUF_CONSISTENCY_CHECK -FORWARD void qp_bufcheck ARGS(( void )); +static void qp_bufcheck ARGS(( void )); #endif -PUBLIC void qp_init() +void qp_init() { int i; @@ -110,7 +110,7 @@ PUBLIC void qp_init() qp_ioctl, qp_cancel, qp_select); } -PRIVATE int qp_open(port, srfd, get_userdata, put_userdata, put_pkt, +static int qp_open(port, srfd, get_userdata, put_userdata, put_pkt, select_res) int port; int srfd; @@ -139,7 +139,7 @@ select_res_t select_res; return i; } -PRIVATE void qp_close(fd) +static void qp_close(fd) int fd; { qp_fd_t *qp_fd; @@ -153,7 +153,7 @@ int fd; } } -PRIVATE int qp_read(fd, count) +static int qp_read(fd, count) int fd; size_t count; { @@ -177,7 +177,7 @@ size_t count; return OK; } -PRIVATE int qp_write(fd, count) +static int qp_write(fd, count) int fd; size_t count; { @@ -210,7 +210,7 @@ size_t count; return OK; } -PRIVATE int qp_ioctl(fd, req) +static int qp_ioctl(fd, req) int fd; ioreq_t req; { @@ -222,7 +222,7 @@ ioreq_t req; return OK; } -PRIVATE int qp_cancel(fd, which_operation) +static int qp_cancel(fd, which_operation) int fd; int which_operation; { @@ -230,7 +230,7 @@ int which_operation; return OK; } -PRIVATE int qp_select(fd, operations) +static int qp_select(fd, operations) int fd; unsigned operations; { @@ -244,7 +244,7 @@ unsigned operations; return resops; } -PRIVATE qp_fd_t *get_qp_fd(fd) +static qp_fd_t *get_qp_fd(fd) int fd; { qp_fd_t *qp_fd; @@ -255,7 +255,7 @@ int fd; return qp_fd; } -PRIVATE int do_query(qp_fd, pkt, count) +static int do_query(qp_fd, pkt, count) qp_fd_t *qp_fd; acc_t *pkt; int count; @@ -297,7 +297,7 @@ int count; return qv.fd_offset; } -PRIVATE int qp_getc() +static int qp_getc() { /* Return one character of the names to search for. */ acc_t *pkt; @@ -322,7 +322,7 @@ PRIVATE int qp_getc() return c; } -PRIVATE void qp_putc(qv, c) +static void qp_putc(qv, c) struct queryvars *qv; int c; { @@ -358,14 +358,14 @@ int c; qv->outbuf_off= 0; } -PRIVATE void qp_buffree (priority) +static void qp_buffree (priority) int priority; { /* For the moment, we are not going to free anything */ } #ifdef BUF_CONSISTENCY_CHECK -PRIVATE void qp_bufcheck() +static void qp_bufcheck() { int i; qp_fd_t *qp_fd; diff --git a/servers/inet/sr.c b/servers/inet/sr.c index 3aaeb7e05..2b16845bf 100644 --- a/servers/inet/sr.c +++ b/servers/inet/sr.c @@ -70,37 +70,37 @@ THIS_FILE -PUBLIC sr_fd_t sr_fd_table[FD_NR]; - -PRIVATE mq_t *repl_queue, *repl_queue_tail; -PRIVATE struct vscp_vec s_cp_req[SCPVEC_NR]; - -FORWARD int sr_open(message *m); -FORWARD void sr_close(message *m); -FORWARD int sr_rwio(mq_t *m); -FORWARD int sr_restart_read(sr_fd_t *fdp); -FORWARD int sr_restart_write(sr_fd_t *fdp); -FORWARD int sr_restart_ioctl(sr_fd_t *fdp); -FORWARD int sr_cancel(message *m); -FORWARD int sr_select(message *m); -FORWARD void sr_status(message *m); -FORWARD void sr_reply_(mq_t *m, int reply, int is_revive); -FORWARD sr_fd_t *sr_getchannel(int minor); -FORWARD acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int +sr_fd_t sr_fd_table[FD_NR]; + +static mq_t *repl_queue, *repl_queue_tail; +static struct vscp_vec s_cp_req[SCPVEC_NR]; + +static int sr_open(message *m); +static void sr_close(message *m); +static int sr_rwio(mq_t *m); +static int sr_restart_read(sr_fd_t *fdp); +static int sr_restart_write(sr_fd_t *fdp); +static int sr_restart_ioctl(sr_fd_t *fdp); +static int sr_cancel(message *m); +static int sr_select(message *m); +static void sr_status(message *m); +static void sr_reply_(mq_t *m, int reply, int is_revive); +static sr_fd_t *sr_getchannel(int minor); +static acc_t *sr_get_userdata(int fd, size_t offset, size_t count, int for_ioctl); -FORWARD int sr_put_userdata(int fd, size_t offset, acc_t *data, int +static int sr_put_userdata(int fd, size_t offset, acc_t *data, int for_ioctl); -FORWARD void sr_select_res(int fd, unsigned ops); -FORWARD int sr_repl_queue(int proc, int ref, int operation); -FORWARD int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t +static void sr_select_res(int fd, unsigned ops); +static int sr_repl_queue(int proc, int ref, int operation); +static int walk_queue(sr_fd_t *sr_fd, mq_t **q_head_ptr, mq_t **q_tail_ptr, int type, int proc_nr, int ref, int first_flag); -FORWARD void sr_event(event_t *evp, ev_arg_t arg); -FORWARD int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset, +static void sr_event(event_t *evp, ev_arg_t arg); +static int cp_u2b(endpoint_t proc, cp_grant_id_t gid, vir_bytes offset, acc_t **var_acc_ptr, int size); -FORWARD int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid, +static int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid, vir_bytes offset); -PUBLIC void sr_init() +void sr_init() { int i; @@ -114,7 +114,7 @@ PUBLIC void sr_init() repl_queue= NULL; } -PUBLIC void sr_rec(m) +void sr_rec(m) mq_t *m; { int result; @@ -190,7 +190,7 @@ mq_t *m; mq_free(m); } -PUBLIC void sr_add_minor(minor, port, openf, closef, readf, writef, +void sr_add_minor(minor, port, openf, closef, readf, writef, ioctlf, cancelf, selectf) int minor; int port; @@ -221,7 +221,7 @@ sr_select_t selectf; sr_fd->srf_select= selectf; } -PRIVATE int sr_open(m) +static int sr_open(m) message *m; { sr_fd_t *sr_fd; @@ -262,7 +262,7 @@ message *m; return i; } -PRIVATE void sr_close(m) +static void sr_close(m) message *m; { sr_fd_t *sr_fd; @@ -278,7 +278,7 @@ message *m; sr_fd->srf_flags= SFF_FREE; } -PRIVATE int sr_rwio(m) +static int sr_rwio(m) mq_t *m; { sr_fd_t *sr_fd; @@ -375,7 +375,7 @@ mq_t *m; return r; } -PRIVATE int sr_restart_read(sr_fd) +static int sr_restart_read(sr_fd) sr_fd_t *sr_fd; { mq_t *mp; @@ -401,7 +401,7 @@ sr_fd_t *sr_fd; return r; } -PRIVATE int sr_restart_write(sr_fd) +static int sr_restart_write(sr_fd) sr_fd_t *sr_fd; { mq_t *mp; @@ -427,7 +427,7 @@ sr_fd_t *sr_fd; return r; } -PRIVATE int sr_restart_ioctl(sr_fd) +static int sr_restart_ioctl(sr_fd) sr_fd_t *sr_fd; { mq_t *mp; @@ -453,7 +453,7 @@ sr_fd_t *sr_fd; return r; } -PRIVATE int sr_cancel(m) +static int sr_cancel(m) message *m; { sr_fd_t *sr_fd; @@ -492,7 +492,7 @@ message *m; return result; } -PRIVATE int sr_select(m) +static int sr_select(m) message *m; { sr_fd_t *sr_fd; @@ -522,7 +522,7 @@ message *m; return m_ops; } -PRIVATE void sr_status(m) +static void sr_status(m) message *m; { int fd, result; @@ -581,7 +581,7 @@ message *m; ip_panic(("unable to send")); } -PRIVATE int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref, +static int walk_queue(sr_fd, q_head_ptr, q_tail_ptr, type, proc_nr, ref, first_flag) sr_fd_t *sr_fd; mq_t **q_head_ptr; @@ -626,7 +626,7 @@ int first_flag; return EAGAIN; } -PRIVATE sr_fd_t *sr_getchannel(minor) +static sr_fd_t *sr_getchannel(minor) int minor; { sr_fd_t *loc_fd; @@ -642,7 +642,7 @@ int minor; return loc_fd; } -PRIVATE void sr_reply_(mq, status, is_revive) +static void sr_reply_(mq, status, is_revive) mq_t *mq; int status; int is_revive; @@ -688,7 +688,7 @@ int is_revive; mq_free(mq); } -PRIVATE acc_t *sr_get_userdata (fd, offset, count, for_ioctl) +static acc_t *sr_get_userdata (fd, offset, count, for_ioctl) int fd; size_t offset; size_t count; @@ -750,7 +750,7 @@ int for_ioctl; return result<0 ? NULL : acc; } -PRIVATE int sr_put_userdata (fd, offset, data, for_ioctl) +static int sr_put_userdata (fd, offset, data, for_ioctl) int fd; size_t offset; acc_t *data; @@ -809,7 +809,7 @@ int for_ioctl; (int)(*head_ptr)->mq_mess.IO_GRANT, offset); } -PRIVATE void sr_select_res(int fd, unsigned ops) +static void sr_select_res(int fd, unsigned ops) { sr_fd_t *sr_fd; @@ -822,7 +822,7 @@ PRIVATE void sr_select_res(int fd, unsigned ops) notify(sr_fd->srf_select_proc); } -PRIVATE void sr_event(evp, arg) +static void sr_event(evp, arg) event_t *evp; ev_arg_t arg; { @@ -863,7 +863,7 @@ ev_arg_t arg; ip_panic(("sr_event: unknown event\n")); } -PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size) +static int cp_u2b(proc, gid, offset, var_acc_ptr, size) endpoint_t proc; cp_grant_id_t gid; vir_bytes offset; @@ -926,7 +926,7 @@ int size; return OK; } -PRIVATE int cp_b2u(acc_ptr, proc, gid, offset) +static int cp_b2u(acc_ptr, proc, gid, offset) acc_t *acc_ptr; endpoint_t proc; cp_grant_id_t gid; @@ -989,7 +989,7 @@ vir_bytes offset; return OK; } -PRIVATE int sr_repl_queue(proc, ref, operation) +static int sr_repl_queue(proc, ref, operation) int proc; int ref; int operation; diff --git a/servers/ipc/main.c b/servers/ipc/main.c index f2fc47767..ef92bb17f 100644 --- a/servers/ipc/main.c +++ b/servers/ipc/main.c @@ -1,11 +1,11 @@ #include "inc.h" -PUBLIC int identifier = 0x1234; -PUBLIC endpoint_t who_e; -PUBLIC int call_type; -PUBLIC endpoint_t SELF_E; +int identifier = 0x1234; +endpoint_t who_e; +int call_type; +endpoint_t SELF_E; -PRIVATE struct { +static struct { int type; int (*func)(message *); int reply; /* whether the reply action is passed through */ @@ -21,14 +21,14 @@ PRIVATE struct { #define SIZE(a) (sizeof(a)/sizeof(a[0])) -PRIVATE int verbose = 0; +static int verbose = 0; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { message m; @@ -107,7 +107,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -125,7 +125,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the ipc server. */ @@ -140,7 +140,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; diff --git a/servers/ipc/sem.c b/servers/ipc/sem.c index a237f987a..1212051ac 100644 --- a/servers/ipc/sem.c +++ b/servers/ipc/sem.c @@ -25,10 +25,10 @@ struct sem_struct { struct semaphore sems[SEMMSL]; }; -PRIVATE struct sem_struct sem_list[SEMMNI]; -PRIVATE int sem_list_nr = 0; +static struct sem_struct sem_list[SEMMNI]; +static int sem_list_nr = 0; -PRIVATE struct sem_struct *sem_find_key(key_t key) +static struct sem_struct *sem_find_key(key_t key) { int i; if (key == IPC_PRIVATE) @@ -39,7 +39,7 @@ PRIVATE struct sem_struct *sem_find_key(key_t key) return NULL; } -PRIVATE struct sem_struct *sem_find_id(int id) +static struct sem_struct *sem_find_id(int id) { int i; for (i = 0; i < sem_list_nr; i++) @@ -51,7 +51,7 @@ PRIVATE struct sem_struct *sem_find_id(int id) /*===========================================================================* * do_semget * *===========================================================================*/ -PUBLIC int do_semget(message *m) +int do_semget(message *m) { key_t key; int nsems, flag, id; @@ -98,7 +98,7 @@ PUBLIC int do_semget(message *m) return OK; } -PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore) +static void send_message_to_process(endpoint_t who, int ret, int ignore) { message m; @@ -106,7 +106,7 @@ PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore) sendnb(who, &m); } -PRIVATE void remove_semaphore(struct sem_struct *sem) +static void remove_semaphore(struct sem_struct *sem) { int i, nr; @@ -129,7 +129,7 @@ PRIVATE void remove_semaphore(struct sem_struct *sem) } #if 0 -PRIVATE void show_semaphore(void) +static void show_semaphore(void) { int i, j, k; @@ -164,7 +164,7 @@ PRIVATE void show_semaphore(void) } #endif -PRIVATE void remove_process(endpoint_t pt) +static void remove_process(endpoint_t pt) { int i; @@ -210,7 +210,7 @@ PRIVATE void remove_process(endpoint_t pt) } } -PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove) +static void update_one_semaphore(struct sem_struct *sem, int is_remove) { int i, j, nr; struct semaphore *semaphore; @@ -266,7 +266,7 @@ PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove) } } -PRIVATE void update_semaphores(void) +static void update_semaphores(void) { int i; @@ -277,7 +277,7 @@ PRIVATE void update_semaphores(void) /*===========================================================================* * do_semctl * *===========================================================================*/ -PUBLIC int do_semctl(message *m) +int do_semctl(message *m) { int r, i; long opt; @@ -437,7 +437,7 @@ PUBLIC int do_semctl(message *m) /*===========================================================================* * do_semop * *===========================================================================*/ -PUBLIC int do_semop(message *m) +int do_semop(message *m) { int id, i, j, r; struct sembuf *sops; @@ -589,7 +589,7 @@ out: /*===========================================================================* * is_sem_nil * *===========================================================================*/ -PUBLIC int is_sem_nil(void) +int is_sem_nil(void) { return (sem_list_nr == 0); } @@ -597,7 +597,7 @@ PUBLIC int is_sem_nil(void) /*===========================================================================* * sem_process_vm_notify * *===========================================================================*/ -PUBLIC void sem_process_vm_notify(void) +void sem_process_vm_notify(void) { endpoint_t pt; int r; diff --git a/servers/ipc/shm.c b/servers/ipc/shm.c index eabb1766f..e3aab7d82 100644 --- a/servers/ipc/shm.c +++ b/servers/ipc/shm.c @@ -9,10 +9,10 @@ struct shm_struct { vir_bytes page; phys_bytes phys; }; -PRIVATE struct shm_struct shm_list[MAX_SHM_NR]; -PRIVATE int shm_list_nr = 0; +static struct shm_struct shm_list[MAX_SHM_NR]; +static int shm_list_nr = 0; -PRIVATE struct shm_struct *shm_find_key(key_t key) +static struct shm_struct *shm_find_key(key_t key) { int i; if (key == IPC_PRIVATE) @@ -23,7 +23,7 @@ PRIVATE struct shm_struct *shm_find_key(key_t key) return NULL; } -PRIVATE struct shm_struct *shm_find_id(int id) +static struct shm_struct *shm_find_id(int id) { int i; for (i = 0; i < shm_list_nr; i++) @@ -35,7 +35,7 @@ PRIVATE struct shm_struct *shm_find_id(int id) /*===========================================================================* * do_shmget * *===========================================================================*/ -PUBLIC int do_shmget(message *m) +int do_shmget(message *m) { struct shm_struct *shm; long key, size, old_size; @@ -106,7 +106,7 @@ PUBLIC int do_shmget(message *m) /*===========================================================================* * do_shmat * *===========================================================================*/ -PUBLIC int do_shmat(message *m) +int do_shmat(message *m) { int id, flag; vir_bytes addr; @@ -150,7 +150,7 @@ PUBLIC int do_shmat(message *m) /*===========================================================================* * update_refcount_and_destroy * *===========================================================================*/ -PUBLIC void update_refcount_and_destroy(void) +void update_refcount_and_destroy(void) { int i, j; @@ -182,7 +182,7 @@ PUBLIC void update_refcount_and_destroy(void) /*===========================================================================* * do_shmdt * *===========================================================================*/ -PUBLIC int do_shmdt(message *m) +int do_shmdt(message *m) { vir_bytes addr; phys_bytes paddr; @@ -216,7 +216,7 @@ PUBLIC int do_shmdt(message *m) /*===========================================================================* * do_shmctl * *===========================================================================*/ -PUBLIC int do_shmctl(message *m) +int do_shmctl(message *m) { int id = m->SHMCTL_ID; int cmd = m->SHMCTL_CMD; @@ -328,7 +328,7 @@ PUBLIC int do_shmctl(message *m) } #if 0 -PRIVATE void list_shm_ds(void) +static void list_shm_ds(void) { int i; printf("key\tid\tpage\n"); @@ -343,7 +343,7 @@ PRIVATE void list_shm_ds(void) /*===========================================================================* * is_shm_nil * *===========================================================================*/ -PUBLIC int is_shm_nil(void) +int is_shm_nil(void) { return (shm_list_nr == 0); } diff --git a/servers/ipc/utility.c b/servers/ipc/utility.c index b17a3ee13..46a84f85b 100644 --- a/servers/ipc/utility.c +++ b/servers/ipc/utility.c @@ -1,6 +1,6 @@ #include "inc.h" -PUBLIC int check_perm(struct ipc_perm *req, endpoint_t who, int mode) +int check_perm(struct ipc_perm *req, endpoint_t who, int mode) { int req_mode; int cur_mode; diff --git a/servers/is/dmp.c b/servers/is/dmp.c index 0c4c4d147..1e8b65e89 100644 --- a/servers/is/dmp.c +++ b/servers/is/dmp.c @@ -43,7 +43,7 @@ struct hook_entry { /*===========================================================================* * map_unmap_keys * *===========================================================================*/ -PUBLIC void map_unmap_fkeys(map) +void map_unmap_fkeys(map) int map; { int fkeys, sfkeys; @@ -70,7 +70,7 @@ int map; *===========================================================================*/ #define pressed(k) ((F1<=(k)&&(k)<=F12 && bit_isset(m->FKEY_FKEYS,((k)-F1+1)))\ || (SF1<=(k) && (k)<=SF12 && bit_isset(m->FKEY_SFKEYS, ((k)-SF1+1)))) -PUBLIC int do_fkey_pressed(m) +int do_fkey_pressed(m) message *m; /* notification message */ { int s, h; @@ -95,7 +95,7 @@ message *m; /* notification message */ /*===========================================================================* * key_name * *===========================================================================*/ -PRIVATE char *key_name(int key) +static char *key_name(int key) { static char name[15]; @@ -112,7 +112,7 @@ PRIVATE char *key_name(int key) /*===========================================================================* * mapping_dmp * *===========================================================================*/ -PUBLIC void mapping_dmp(void) +void mapping_dmp(void) { int h; diff --git a/servers/is/dmp_ds.c b/servers/is/dmp_ds.c index 513a93727..ab7da4af5 100644 --- a/servers/is/dmp_ds.c +++ b/servers/is/dmp_ds.c @@ -3,9 +3,9 @@ #define LINES 22 -PRIVATE struct data_store ds_store[NR_DS_KEYS]; +static struct data_store ds_store[NR_DS_KEYS]; -PUBLIC void data_store_dmp() +void data_store_dmp() { struct data_store *p; static int prev_i = 0; diff --git a/servers/is/dmp_fs.c b/servers/is/dmp_fs.c index a8c2d8f49..4fe27d571 100644 --- a/servers/is/dmp_fs.c +++ b/servers/is/dmp_fs.c @@ -15,13 +15,13 @@ #include "../vfs/dmap.h" #include -PUBLIC struct fproc fproc[NR_PROCS]; -PUBLIC struct dmap dmap[NR_DEVICES]; +struct fproc fproc[NR_PROCS]; +struct dmap dmap[NR_DEVICES]; /*===========================================================================* * fproc_dmp * *===========================================================================*/ -PUBLIC void fproc_dmp() +void fproc_dmp() { struct fproc *fp; int i, n=0; @@ -59,7 +59,7 @@ PUBLIC void fproc_dmp() /*===========================================================================* * dmap_flags * *===========================================================================*/ -PRIVATE char * dmap_flags(int flags) +static char * dmap_flags(int flags) { static char fl[10]; strcpy(fl, "-----"); @@ -70,7 +70,7 @@ PRIVATE char * dmap_flags(int flags) /*===========================================================================* * dmap_style * *===========================================================================*/ -PRIVATE char * dmap_style(int dev_style) +static char * dmap_style(int dev_style) { static char str[16]; switch(dev_style) { @@ -89,7 +89,7 @@ PRIVATE char * dmap_style(int dev_style) /*===========================================================================* * dtab_dmp * *===========================================================================*/ -PUBLIC void dtab_dmp() +void dtab_dmp() { int i; diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index ff537a9ec..77b98a05f 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -41,24 +41,24 @@ static int pagelines; ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024)) /* Declare some local dump procedures. */ -FORWARD char *proc_name(int proc_nr); -FORWARD char *s_traps_str(int flags); -FORWARD char *s_flags_str(int flags); -FORWARD char *p_rts_flags_str(int flags); -FORWARD char *boot_flags_str(int flags); +static char *proc_name(int proc_nr); +static char *s_traps_str(int flags); +static char *s_flags_str(int flags); +static char *p_rts_flags_str(int flags); +static char *boot_flags_str(int flags); /* Some global data that is shared among several dumping procedures. * Note that the process table copy has the same name as in the kernel * so that most macros and definitions from proc.h also apply here. */ -PUBLIC struct proc proc[NR_TASKS + NR_PROCS]; -PUBLIC struct priv priv[NR_SYS_PROCS]; -PUBLIC struct boot_image image[NR_BOOT_PROCS]; +struct proc proc[NR_TASKS + NR_PROCS]; +struct priv priv[NR_SYS_PROCS]; +struct boot_image image[NR_BOOT_PROCS]; /*===========================================================================* * kmessages_dmp * *===========================================================================*/ -PUBLIC void kmessages_dmp() +void kmessages_dmp() { struct kmessages kmess; /* get copy of kernel messages */ char print_buf[_KMESS_BUF_SIZE+1]; /* this one is used to print */ @@ -90,7 +90,7 @@ PUBLIC void kmessages_dmp() /*===========================================================================* * monparams_dmp * *===========================================================================*/ -PUBLIC void monparams_dmp() +void monparams_dmp() { char val[1024]; char *e; @@ -117,7 +117,7 @@ PUBLIC void monparams_dmp() /*===========================================================================* * irqtab_dmp * *===========================================================================*/ -PUBLIC void irqtab_dmp() +void irqtab_dmp() { int i,r; struct irq_hook irq_hooks[NR_IRQ_HOOKS]; @@ -163,7 +163,7 @@ PUBLIC void irqtab_dmp() /*===========================================================================* * boot_flags_str * *===========================================================================*/ -PRIVATE char *boot_flags_str(int flags) +static char *boot_flags_str(int flags) { static char str[10]; str[0] = (flags & PROC_FULLVM) ? 'V' : '-'; @@ -175,7 +175,7 @@ PRIVATE char *boot_flags_str(int flags) /*===========================================================================* * image_dmp * *===========================================================================*/ -PUBLIC void image_dmp() +void image_dmp() { int m, r; struct boot_image *ip; @@ -199,7 +199,7 @@ PUBLIC void image_dmp() /*===========================================================================* * kenv_dmp * *===========================================================================*/ -PUBLIC void kenv_dmp() +void kenv_dmp() { struct kinfo kinfo; struct machine machine; @@ -234,7 +234,7 @@ PUBLIC void kenv_dmp() /*===========================================================================* * s_flags_str * *===========================================================================*/ -PRIVATE char *s_flags_str(int flags) +static char *s_flags_str(int flags) { static char str[10]; str[0] = (flags & PREEMPTIBLE) ? 'P' : '-'; @@ -252,7 +252,7 @@ PRIVATE char *s_flags_str(int flags) /*===========================================================================* * s_traps_str * *===========================================================================*/ -PRIVATE char *s_traps_str(int flags) +static char *s_traps_str(int flags) { static char str[10]; str[0] = (flags & (1 << SEND)) ? 'S' : '-'; @@ -268,7 +268,7 @@ PRIVATE char *s_traps_str(int flags) /*===========================================================================* * privileges_dmp * *===========================================================================*/ -PUBLIC void privileges_dmp() +void privileges_dmp() { register struct proc *rp; static struct proc *oldrp = BEG_PROC_ADDR; @@ -315,7 +315,7 @@ PUBLIC void privileges_dmp() /*===========================================================================* * p_rts_flags_str * *===========================================================================*/ -PRIVATE char *p_rts_flags_str(int flags) +static char *p_rts_flags_str(int flags) { static char str[10]; str[0] = (flags & RTS_PROC_STOP) ? 's' : '-'; @@ -334,7 +334,7 @@ PRIVATE char *p_rts_flags_str(int flags) * proctab_dmp * *===========================================================================*/ #if (CHIP == INTEL) -PUBLIC void proctab_dmp() +void proctab_dmp() { /* Proc table dump */ @@ -371,7 +371,7 @@ PUBLIC void proctab_dmp() /*===========================================================================* * procstack_dmp * *===========================================================================*/ -PUBLIC void procstack_dmp() +void procstack_dmp() { /* Proc table dump, with stack */ @@ -396,7 +396,7 @@ PUBLIC void procstack_dmp() /*===========================================================================* * memmap_dmp * *===========================================================================*/ -PUBLIC void memmap_dmp() +void memmap_dmp() { register struct proc *rp; static struct proc *oldrp = proc; @@ -428,7 +428,7 @@ PUBLIC void memmap_dmp() /*===========================================================================* * proc_name * *===========================================================================*/ -PRIVATE char *proc_name(proc_nr) +static char *proc_name(proc_nr) int proc_nr; { struct proc *p; diff --git a/servers/is/dmp_pm.c b/servers/is/dmp_pm.c index 921f6a31d..d30c9bbf7 100644 --- a/servers/is/dmp_pm.c +++ b/servers/is/dmp_pm.c @@ -13,12 +13,12 @@ #include #include -PUBLIC struct mproc mproc[NR_PROCS]; +struct mproc mproc[NR_PROCS]; /*===========================================================================* * mproc_dmp * *===========================================================================*/ -PRIVATE char *flags_str(int flags) +static char *flags_str(int flags) { static char str[14]; str[0] = (flags & WAITING) ? 'W' : '-'; @@ -39,7 +39,7 @@ PRIVATE char *flags_str(int flags) return str; } -PUBLIC void mproc_dmp() +void mproc_dmp() { struct mproc *mp; int i, n=0; @@ -72,7 +72,7 @@ PUBLIC void mproc_dmp() /*===========================================================================* * sigaction_dmp * *===========================================================================*/ -PUBLIC void sigaction_dmp() +void sigaction_dmp() { struct mproc *mp; int i, n=0; diff --git a/servers/is/dmp_rs.c b/servers/is/dmp_rs.c index 8183147e7..362dd81ae 100644 --- a/servers/is/dmp_rs.c +++ b/servers/is/dmp_rs.c @@ -14,15 +14,15 @@ #include "../rs/const.h" #include "../rs/type.h" -PUBLIC struct rprocpub rprocpub[NR_SYS_PROCS]; -PUBLIC struct rproc rproc[NR_SYS_PROCS]; +struct rprocpub rprocpub[NR_SYS_PROCS]; +struct rproc rproc[NR_SYS_PROCS]; -FORWARD char *s_flags_str(int flags, int sys_flags); +static char *s_flags_str(int flags, int sys_flags); /*===========================================================================* * rproc_dmp * *===========================================================================*/ -PUBLIC void rproc_dmp() +void rproc_dmp() { struct rproc *rp; struct rprocpub *rpub; @@ -56,7 +56,7 @@ PUBLIC void rproc_dmp() } -PRIVATE char *s_flags_str(int flags, int sys_flags) +static char *s_flags_str(int flags, int sys_flags) { static char str[10]; str[0] = (flags & RS_ACTIVE) ? 'A' : '-'; diff --git a/servers/is/dmp_vm.c b/servers/is/dmp_vm.c index 6fafb5b05..6d61ac556 100644 --- a/servers/is/dmp_vm.c +++ b/servers/is/dmp_vm.c @@ -8,7 +8,7 @@ #define LINES 24 -PRIVATE void print_region(struct vm_region_info *vri, int *n) +static void print_region(struct vm_region_info *vri, int *n) { static int vri_count, vri_prev_set; static struct vm_region_info vri_prev; @@ -61,7 +61,7 @@ PRIVATE void print_region(struct vm_region_info *vri, int *n) (*n)++; } -PUBLIC void vm_dmp() +void vm_dmp() { static struct proc proc[NR_TASKS + NR_PROCS]; static struct vm_region_info vri[LINES]; diff --git a/servers/is/main.c b/servers/is/main.c index 51299b167..d8fc19bf4 100644 --- a/servers/is/main.c +++ b/servers/is/main.c @@ -11,26 +11,26 @@ #include /* Allocate space for the global variables. */ -PRIVATE message m_in; /* the input message itself */ -PRIVATE message m_out; /* the output message used for reply */ -PRIVATE endpoint_t who_e; /* caller's proc number */ -PRIVATE int callnr; /* system call number */ +static message m_in; /* the input message itself */ +static message m_out; /* the output message used for reply */ +static endpoint_t who_e; /* caller's proc number */ +static int callnr; /* system call number */ extern int errno; /* error number set by system library */ /* Declare some local functions. */ -FORWARD void get_work(void); -FORWARD void reply(int whom, int result); +static void get_work(void); +static void reply(int whom, int result); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -75,7 +75,7 @@ PUBLIC int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -96,7 +96,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the information server. */ @@ -109,7 +109,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -123,7 +123,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work() +static void get_work() { int status = 0; status = sef_receive(ANY, &m_in); /* this blocks until message arrives */ @@ -136,7 +136,7 @@ PRIVATE void get_work() /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply(who, result) +static void reply(who, result) int who; /* destination */ int result; /* report result to replyee */ { diff --git a/servers/iso9660fs/buf.h b/servers/iso9660fs/buf.h index 41aa034ad..6e588e390 100644 --- a/servers/iso9660fs/buf.h +++ b/servers/iso9660fs/buf.h @@ -1,6 +1,6 @@ #include -PUBLIC struct buf { +struct buf { char b_data[_MAX_BLOCK_SIZE]; /* ordinary user data */ block_t b_blocknr; /* block number of its (minor) device */ char b_count; /* number of users of this buffer */ diff --git a/servers/iso9660fs/cache.c b/servers/iso9660fs/cache.c index 7f171d97d..450695a83 100644 --- a/servers/iso9660fs/cache.c +++ b/servers/iso9660fs/cache.c @@ -17,16 +17,16 @@ #include #include "buf.h" -FORWARD int read_block(struct buf *); +static int read_block(struct buf *); -PUBLIC struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the +struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the * buffer cache to pick up*/ /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block(block) +struct buf *get_block(block) register block_t block; /* which block is wanted? */ { register struct buf *bp, *free_bp; @@ -76,7 +76,7 @@ register block_t block; /* which block is wanted? */ /*===========================================================================* * put_block * *===========================================================================*/ -PUBLIC void put_block(bp) +void put_block(bp) register struct buf *bp; /* pointer to the buffer to be released */ { if (bp == NULL) return; /* it is easier to check here than in caller */ @@ -87,7 +87,7 @@ register struct buf *bp; /* pointer to the buffer to be released */ /*===========================================================================* * read_block * *===========================================================================*/ -PRIVATE int read_block(bp) +static int read_block(bp) register struct buf *bp; /* buffer pointer */ { int r; diff --git a/servers/iso9660fs/inode.c b/servers/iso9660fs/inode.c index 115dd4fb5..d8bae00c8 100644 --- a/servers/iso9660fs/inode.c +++ b/servers/iso9660fs/inode.c @@ -10,7 +10,7 @@ /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode() +int fs_putnode() { /* Find the inode specified by the request message and decrease its counter. */ int count; @@ -40,7 +40,7 @@ PUBLIC int fs_putnode() /*===========================================================================* * release_dir_record * *===========================================================================*/ -PUBLIC int release_dir_record(dir) +int release_dir_record(dir) struct dir_record *dir; { /* Release a dir record (decrement the counter) */ @@ -65,7 +65,7 @@ struct dir_record *dir; /*===========================================================================* * get_free_dir_record * *===========================================================================*/ -PUBLIC struct dir_record *get_free_dir_record(void) +struct dir_record *get_free_dir_record(void) { /* Get a free dir record */ struct dir_record *dir; @@ -85,7 +85,7 @@ PUBLIC struct dir_record *get_free_dir_record(void) /*===========================================================================* * get_dir_record * *===========================================================================*/ -PUBLIC struct dir_record *get_dir_record(id_dir_record) +struct dir_record *get_dir_record(id_dir_record) ino_t id_dir_record; { struct dir_record *dir = NULL; @@ -115,7 +115,7 @@ ino_t id_dir_record; /*===========================================================================* * get_free_ext_attr * *===========================================================================*/ -PUBLIC struct ext_attr_rec *get_free_ext_attr(void) { +struct ext_attr_rec *get_free_ext_attr(void) { /* Get a free extended attribute structure */ struct ext_attr_rec *dir; for(dir = ext_attr_recs; dir < &ext_attr_recs[NR_ATTR_RECS]; dir++) { @@ -132,7 +132,7 @@ PUBLIC struct ext_attr_rec *get_free_ext_attr(void) { /*===========================================================================* * create_ext_attr * *===========================================================================*/ -PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer) +int create_ext_attr(struct ext_attr_rec *ext,char *buffer) { /* Fill an extent structure from the data read on the device */ if (ext == NULL) return(EINVAL); @@ -161,7 +161,7 @@ PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer) /*===========================================================================* * create_ext_attr * *===========================================================================*/ -PUBLIC int create_dir_record(dir,buffer,address) +int create_dir_record(dir,buffer,address) struct dir_record *dir; char *buffer; u32_t address; @@ -218,7 +218,7 @@ u32_t address; /*===========================================================================* * load_dir_record_from_disk * *===========================================================================*/ -PUBLIC struct dir_record *load_dir_record_from_disk(address) +struct dir_record *load_dir_record_from_disk(address) u32_t address; { /* This function load a particular dir record from a specific address diff --git a/servers/iso9660fs/inode.h b/servers/iso9660fs/inode.h index da1a8da5f..72170c400 100644 --- a/servers/iso9660fs/inode.h +++ b/servers/iso9660fs/inode.h @@ -1,6 +1,6 @@ #include "const.h" -PUBLIC struct dir_record { +struct dir_record { u8_t length; /* The length of the record */ u8_t ext_attr_rec_length; u32_t loc_extent_l; /* The same data (in this case loc_extent)is */ @@ -30,7 +30,7 @@ PUBLIC struct dir_record { } dir_records[NR_DIR_RECORDS]; -PUBLIC struct ext_attr_rec { +struct ext_attr_rec { u32_t own_id; u32_t group_id; u16_t permissions; diff --git a/servers/iso9660fs/main.c b/servers/iso9660fs/main.c index 5a45bca99..e4f59d854 100644 --- a/servers/iso9660fs/main.c +++ b/servers/iso9660fs/main.c @@ -8,17 +8,17 @@ #include "glo.h" /* Declare some local functions. */ -FORWARD void get_work(message *m_in); +static void get_work(message *m_in); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) { +int main(void) { endpoint_t who_e; int ind, error, transid; @@ -78,7 +78,7 @@ PUBLIC int main(void) { /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -96,7 +96,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the iso9660fs server. */ @@ -111,7 +111,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -127,7 +127,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_in) +static void get_work(m_in) message *m_in; /* pointer to message */ { int s; /* receive status */ @@ -138,7 +138,7 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PUBLIC void reply(who, m_out) +void reply(who, m_out) int who; message *m_out; /* report result */ { diff --git a/servers/iso9660fs/misc.c b/servers/iso9660fs/misc.c index ae5cab0dc..dffef64c0 100644 --- a/servers/iso9660fs/misc.c +++ b/servers/iso9660fs/misc.c @@ -7,7 +7,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -PUBLIC int fs_sync() +int fs_sync() { /* Always mounted read only, so nothing to sync */ return(OK); /* sync() can't fail */ @@ -17,7 +17,7 @@ PUBLIC int fs_sync() /*===========================================================================* * fs_new_driver * *===========================================================================*/ -PUBLIC int fs_new_driver(void) +int fs_new_driver(void) { /* Set a new driver endpoint for this device. */ dev_t dev; diff --git a/servers/iso9660fs/mount.c b/servers/iso9660fs/mount.c index 1c7ddd0ad..911a9cc98 100644 --- a/servers/iso9660fs/mount.c +++ b/servers/iso9660fs/mount.c @@ -8,7 +8,7 @@ /*===========================================================================* * fs_readsuper * *===========================================================================*/ -PUBLIC int fs_readsuper() { +int fs_readsuper() { cp_grant_id_t label_gid; size_t label_len; @@ -61,7 +61,7 @@ PUBLIC int fs_readsuper() { /*===========================================================================* * fs_mountpoint * *===========================================================================*/ -PUBLIC int fs_mountpoint() +int fs_mountpoint() { /* This function looks up the mount point, it checks the condition whether * the partition can be mounted on the inode or not. @@ -93,7 +93,7 @@ PUBLIC int fs_mountpoint() /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount(void) { +int fs_unmount(void) { release_v_pri(&v_pri); /* Release the super block */ bdev_close(fs_dev); unmountdone = TRUE; diff --git a/servers/iso9660fs/path.c b/servers/iso9660fs/path.c index 07f1e84de..71df671f3 100644 --- a/servers/iso9660fs/path.c +++ b/servers/iso9660fs/path.c @@ -5,15 +5,15 @@ #include "buf.h" -FORWARD char *get_name(char *name, char string[NAME_MAX+1]); -FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct +static char *get_name(char *name, char string[NAME_MAX+1]); +static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct dir_record **res_inop, size_t *offsetp); /*===========================================================================* * fs_lookup * *===========================================================================*/ -PUBLIC int fs_lookup() { +int fs_lookup() { cp_grant_id_t grant; int r, len, flags; size_t offset; @@ -80,7 +80,7 @@ PUBLIC int fs_lookup() { /*===========================================================================* * search_dir * *===========================================================================*/ -PUBLIC int search_dir(ldir_ptr,string,numb) +int search_dir(ldir_ptr,string,numb) register struct dir_record *ldir_ptr; /* dir record parent */ char string[NAME_MAX]; /* component to search for */ ino_t *numb; /* pointer to new dir record */ @@ -182,7 +182,7 @@ PUBLIC int search_dir(ldir_ptr,string,numb) /*===========================================================================* * parse_path * *===========================================================================*/ -PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp) +static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp) ino_t dir_ino; ino_t root_ino; int flags; @@ -281,7 +281,7 @@ size_t *offsetp; /*===========================================================================* * advance * *===========================================================================*/ -PUBLIC int advance(dirp, string, resp) +int advance(dirp, string, resp) struct dir_record *dirp; /* inode for directory to be searched */ char string[NAME_MAX]; /* component name to look for */ struct dir_record **resp; /* resulting inode */ @@ -323,7 +323,7 @@ struct dir_record **resp; /* resulting inode */ /*===========================================================================* * get_name * *===========================================================================*/ -PRIVATE char *get_name(path_name, string) +static char *get_name(path_name, string) char *path_name; /* path name to parse */ char string[NAME_MAX+1]; /* component extracted from 'old_name' */ { diff --git a/servers/iso9660fs/protect.c b/servers/iso9660fs/protect.c index 1210f102b..8cfe9adfd 100644 --- a/servers/iso9660fs/protect.c +++ b/servers/iso9660fs/protect.c @@ -9,7 +9,7 @@ /*===========================================================================* * fs_access * *===========================================================================*/ -PUBLIC int fs_access() +int fs_access() { struct dir_record *rip; int r = OK; diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index e15f58cd9..4d49cef9c 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -7,13 +7,13 @@ #endif #include "buf.h" -PRIVATE char getdents_buf[GETDENTS_BUFSIZ]; +static char getdents_buf[GETDENTS_BUFSIZ]; /*===========================================================================* * fs_read * *===========================================================================*/ -PUBLIC int fs_read(void) { +int fs_read(void) { int r, chunk, block_size; int nrbytes; cp_grant_id_t gid; @@ -76,7 +76,7 @@ PUBLIC int fs_read(void) { /*===========================================================================* * fs_bread * *===========================================================================*/ -PUBLIC int fs_bread(void) +int fs_bread(void) { int r, rw_flag, chunk, block_size; cp_grant_id_t gid; @@ -134,7 +134,7 @@ PUBLIC int fs_bread(void) /*===========================================================================* * fs_getdents * *===========================================================================*/ -PUBLIC int fs_getdents(void) { +int fs_getdents(void) { struct dir_record *dir; ino_t ino; cp_grant_id_t gid; @@ -280,7 +280,7 @@ PUBLIC int fs_getdents(void) { /*===========================================================================* * read_chunk * *===========================================================================*/ -PUBLIC int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed) +int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed) register struct dir_record *dir;/* pointer to inode for file to be rd/wr */ u64_t position; /* position within file to read or write */ unsigned off; /* off within the current block */ diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index 8fa86a4b0..eb933ea26 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -13,7 +13,7 @@ /*===========================================================================* * stat_dir_record * *===========================================================================*/ -PRIVATE int stat_dir_record( +static int stat_dir_record( register struct dir_record *dir, /* pointer to dir record to stat */ int pipe_pos, /* position in a pipe, supplied by fstat() */ endpoint_t who_e, /* Caller endpoint */ @@ -78,7 +78,7 @@ PRIVATE int stat_dir_record( /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat() +int fs_stat() { register int r; /* return value */ struct dir_record *dir; @@ -96,7 +96,7 @@ PUBLIC int fs_stat() /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_fstatfs() +int fs_fstatfs() { struct statfs st; int r; @@ -114,7 +114,7 @@ PUBLIC int fs_fstatfs() /*===========================================================================* * fs_statvfs * *===========================================================================*/ -PUBLIC int fs_statvfs() +int fs_statvfs() { struct statvfs st; int r; diff --git a/servers/iso9660fs/super.c b/servers/iso9660fs/super.c index 5522cea32..6d1381b0c 100644 --- a/servers/iso9660fs/super.c +++ b/servers/iso9660fs/super.c @@ -9,7 +9,7 @@ /* This function is called when the filesystem is umounted. It releases the * super block. */ -PUBLIC int release_v_pri(v_pri) +int release_v_pri(v_pri) register struct iso9660_vd_pri *v_pri; { /* Release the root dir record */ @@ -21,7 +21,7 @@ PUBLIC int release_v_pri(v_pri) /* This function fullfill the super block data structure using the information * contained in the stream buf. Such stream is physically read from the device * . */ -PUBLIC int create_v_pri(v_pri,buf,address) +int create_v_pri(v_pri,buf,address) register struct iso9660_vd_pri *v_pri; register char* buf; register unsigned long address; @@ -80,7 +80,7 @@ PUBLIC int create_v_pri(v_pri,buf,address) /* This function reads from a ISO9660 filesystem (in the device dev) the * super block and saves it in v_pri. */ -PUBLIC int read_vds( +int read_vds( register struct iso9660_vd_pri *v_pri, register dev_t dev ) diff --git a/servers/iso9660fs/super.h b/servers/iso9660fs/super.h index 488b6db0e..363fe350b 100644 --- a/servers/iso9660fs/super.h +++ b/servers/iso9660fs/super.h @@ -12,7 +12,7 @@ #define ROOT_INO_NR 1 /* Structure for the primary volume descriptor */ -PUBLIC struct iso9660_vd_pri { +struct iso9660_vd_pri { u8_t vd_type; char standard_id[ISO9660_SIZE_STANDARD_ID]; u8_t vd_version; diff --git a/servers/iso9660fs/table.c b/servers/iso9660fs/table.c index 2f72587c0..307ff4cda 100644 --- a/servers/iso9660fs/table.c +++ b/servers/iso9660fs/table.c @@ -7,7 +7,7 @@ #include "inc.h" -PUBLIC int (*fs_call_vec[])(void) = { +int (*fs_call_vec[])(void) = { no_sys, /* 0: not used */ no_sys, /* 1: not used */ fs_putnode, /* 2 */ diff --git a/servers/iso9660fs/utility.c b/servers/iso9660fs/utility.c index 63a2bd4dd..d62b75eb7 100644 --- a/servers/iso9660fs/utility.c +++ b/servers/iso9660fs/utility.c @@ -8,7 +8,7 @@ /*===========================================================================* * do_noop * *===========================================================================*/ -PUBLIC int do_noop(void) +int do_noop(void) { /* Do not do anything. */ return(OK); @@ -17,7 +17,7 @@ PUBLIC int do_noop(void) /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys(void) +int no_sys(void) { /* Somebody has used an illegal system call number */ return(EINVAL); diff --git a/servers/mfs/cache.c b/servers/mfs/cache.c index 16d2fb41c..9a99eb0c5 100644 --- a/servers/mfs/cache.c +++ b/servers/mfs/cache.c @@ -26,17 +26,17 @@ #include "super.h" #include "inode.h" -FORWARD void rm_lru(struct buf *bp); -FORWARD void read_block(struct buf *); +static void rm_lru(struct buf *bp); +static void read_block(struct buf *); -PRIVATE int vmcache = 0; /* are we using vm's secondary cache? (initially not) */ +static int vmcache = 0; /* are we using vm's secondary cache? (initially not) */ -PRIVATE block_t super_start = 0, super_end = 0; +static block_t super_start = 0, super_end = 0; /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block( +struct buf *get_block( register dev_t dev, /* on which device is the block? */ register block_t block, /* which block is wanted? */ int only_search /* if NO_READ, don't read, else act normal */ @@ -206,7 +206,7 @@ PUBLIC struct buf *get_block( /*===========================================================================* * put_block * *===========================================================================*/ -PUBLIC void put_block(bp, block_type) +void put_block(bp, block_type) register struct buf *bp; /* pointer to the buffer to be released */ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ { @@ -259,7 +259,7 @@ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ /*===========================================================================* * alloc_zone * *===========================================================================*/ -PUBLIC zone_t alloc_zone( +zone_t alloc_zone( dev_t dev, /* device where zone wanted */ zone_t z /* try to allocate new zone near this one */ ) @@ -302,7 +302,7 @@ PUBLIC zone_t alloc_zone( /*===========================================================================* * free_zone * *===========================================================================*/ -PUBLIC void free_zone( +void free_zone( dev_t dev, /* device where zone located */ zone_t numb /* zone to be returned */ ) @@ -323,7 +323,7 @@ PUBLIC void free_zone( /*===========================================================================* * read_block * *===========================================================================*/ -PRIVATE void read_block(bp) +static void read_block(bp) register struct buf *bp; /* buffer pointer */ { /* Read or write a disk block. This is the only routine in which actual disk @@ -362,7 +362,7 @@ register struct buf *bp; /* buffer pointer */ /*===========================================================================* * invalidate * *===========================================================================*/ -PUBLIC void invalidate( +void invalidate( dev_t device /* device whose blocks are to be purged */ ) { @@ -400,7 +400,7 @@ int block_write_ok(struct buf *bp) /*===========================================================================* * flushall * *===========================================================================*/ -PUBLIC void flushall( +void flushall( dev_t dev /* device to flush */ ) { @@ -437,7 +437,7 @@ PUBLIC void flushall( /*===========================================================================* * rw_scattered * *===========================================================================*/ -PUBLIC void rw_scattered( +void rw_scattered( dev_t dev, /* major-minor device number */ struct buf **bufq, /* pointer to array of buffers */ int bufqsize, /* number of buffers */ @@ -540,7 +540,7 @@ PUBLIC void rw_scattered( /*===========================================================================* * rm_lru * *===========================================================================*/ -PRIVATE void rm_lru(bp) +static void rm_lru(bp) struct buf *bp; { /* Remove a block from its LRU chain. */ @@ -563,7 +563,7 @@ struct buf *bp; /*===========================================================================* * cache_resize * *===========================================================================*/ -PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs) +static void cache_resize(unsigned int blocksize, unsigned int bufs) { struct buf *bp; struct inode *rip; @@ -588,7 +588,7 @@ PRIVATE void cache_resize(unsigned int blocksize, unsigned int bufs) /*===========================================================================* * bufs_heuristic * *===========================================================================*/ -PRIVATE int bufs_heuristic(struct super_block *sp) +static int bufs_heuristic(struct super_block *sp) { u32_t btotal, bfree, bused; @@ -601,7 +601,7 @@ PRIVATE int bufs_heuristic(struct super_block *sp) /*===========================================================================* * set_blocksize * *===========================================================================*/ -PUBLIC void set_blocksize(struct super_block *sp) +void set_blocksize(struct super_block *sp) { int bufs; @@ -626,7 +626,7 @@ PUBLIC void set_blocksize(struct super_block *sp) /*===========================================================================* * buf_pool * *===========================================================================*/ -PUBLIC void buf_pool(int new_nr_bufs) +void buf_pool(int new_nr_bufs) { /* Initialize the buffer pool. */ register struct buf *bp; diff --git a/servers/mfs/inode.c b/servers/mfs/inode.c index 17006c1c4..4e1fa31f4 100644 --- a/servers/mfs/inode.c +++ b/servers/mfs/inode.c @@ -22,21 +22,21 @@ #include "super.h" #include -FORWARD void addhash_inode(struct inode *node); +static void addhash_inode(struct inode *node); -FORWARD void free_inode(dev_t dev, ino_t numb); -FORWARD void new_icopy(struct inode *rip, d2_inode *dip, int direction, +static void free_inode(dev_t dev, ino_t numb); +static void new_icopy(struct inode *rip, d2_inode *dip, int direction, int norm); -FORWARD void old_icopy(struct inode *rip, d1_inode *dip, int direction, +static void old_icopy(struct inode *rip, d1_inode *dip, int direction, int norm); -FORWARD void unhash_inode(struct inode *node); -FORWARD void wipe_inode(struct inode *rip); +static void unhash_inode(struct inode *node); +static void wipe_inode(struct inode *rip); /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode(void) +int fs_putnode(void) { /* Find the inode specified by the request message and decrease its counter.*/ @@ -74,7 +74,7 @@ PUBLIC int fs_putnode(void) /*===========================================================================* * init_inode_cache * *===========================================================================*/ -PUBLIC void init_inode_cache() +void init_inode_cache() { struct inode *rip; struct inodelist *rlp; @@ -100,7 +100,7 @@ PUBLIC void init_inode_cache() /*===========================================================================* * addhash_inode * *===========================================================================*/ -PRIVATE void addhash_inode(struct inode *node) +static void addhash_inode(struct inode *node) { int hashi = (int) (node->i_num & INODE_HASH_MASK); @@ -112,7 +112,7 @@ PRIVATE void addhash_inode(struct inode *node) /*===========================================================================* * unhash_inode * *===========================================================================*/ -PRIVATE void unhash_inode(struct inode *node) +static void unhash_inode(struct inode *node) { /* remove from hash table */ LIST_REMOVE(node, i_hash); @@ -122,7 +122,7 @@ PRIVATE void unhash_inode(struct inode *node) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode( +struct inode *get_inode( dev_t dev, /* device on which inode resides */ ino_t numb /* inode number */ ) @@ -184,7 +184,7 @@ PUBLIC struct inode *get_inode( /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode( +struct inode *find_inode( dev_t dev, /* device on which inode resides */ ino_t numb /* inode number */ ) @@ -210,7 +210,7 @@ PUBLIC struct inode *find_inode( /*===========================================================================* * put_inode * *===========================================================================*/ -PUBLIC void put_inode(rip) +void put_inode(rip) register struct inode *rip; /* pointer to inode to be released */ { /* The caller is no longer using this inode. If no one else is using it either @@ -256,7 +256,7 @@ register struct inode *rip; /* pointer to inode to be released */ /*===========================================================================* * alloc_inode * *===========================================================================*/ -PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits) +struct inode *alloc_inode(dev_t dev, mode_t bits) { /* Allocate a free inode on 'dev', and return a pointer to it. */ @@ -313,7 +313,7 @@ PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits) /*===========================================================================* * wipe_inode * *===========================================================================*/ -PRIVATE void wipe_inode(rip) +static void wipe_inode(rip) register struct inode *rip; /* the inode to be erased */ { /* Erase some fields in the inode. This function is called from alloc_inode() @@ -332,7 +332,7 @@ register struct inode *rip; /* the inode to be erased */ /*===========================================================================* * free_inode * *===========================================================================*/ -PRIVATE void free_inode( +static void free_inode( dev_t dev, /* on which device is the inode? */ ino_t inumb /* number of the inode to be freed */ ) @@ -354,7 +354,7 @@ PRIVATE void free_inode( /*===========================================================================* * update_times * *===========================================================================*/ -PUBLIC void update_times(rip) +void update_times(rip) register struct inode *rip; /* pointer to inode to be read/written */ { /* Various system calls are required by the standard to update atime, ctime, @@ -380,7 +380,7 @@ register struct inode *rip; /* pointer to inode to be read/written */ /*===========================================================================* * rw_inode * *===========================================================================*/ -PUBLIC void rw_inode(rip, rw_flag) +void rw_inode(rip, rw_flag) register struct inode *rip; /* pointer to inode to be read/written */ int rw_flag; /* READING or WRITING */ { @@ -424,7 +424,7 @@ int rw_flag; /* READING or WRITING */ /*===========================================================================* * old_icopy * *===========================================================================*/ -PRIVATE void old_icopy(rip, dip, direction, norm) +static void old_icopy(rip, dip, direction, norm) register struct inode *rip; /* pointer to the in-core inode struct */ register d1_inode *dip; /* pointer to the d1_inode inode struct */ int direction; /* READING (from disk) or WRITING (to disk) */ @@ -470,7 +470,7 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */ /*===========================================================================* * new_icopy * *===========================================================================*/ -PRIVATE void new_icopy(rip, dip, direction, norm) +static void new_icopy(rip, dip, direction, norm) register struct inode *rip; /* pointer to the in-core inode struct */ register d2_inode *dip; /* pointer to the d2_inode struct */ int direction; /* READING (from disk) or WRITING (to disk) */ @@ -513,7 +513,7 @@ int norm; /* TRUE = do not swap bytes; FALSE = swap */ /*===========================================================================* * dup_inode * *===========================================================================*/ -PUBLIC void dup_inode(ip) +void dup_inode(ip) struct inode *ip; /* The inode to be duplicated. */ { /* This routine is a simplified form of get_inode() for the case where diff --git a/servers/mfs/link.c b/servers/mfs/link.c index 7d0e389e8..2c499810b 100644 --- a/servers/mfs/link.c +++ b/servers/mfs/link.c @@ -10,15 +10,15 @@ #define SAME 1000 -FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end); -FORWARD int remove_dir(struct inode *rldirp, struct inode *rip, char +static int freesp_inode(struct inode *rip, off_t st, off_t end); +static int remove_dir(struct inode *rldirp, struct inode *rip, char dir_name[MFS_NAME_MAX]); -FORWARD int unlink_file(struct inode *dirp, struct inode *rip, char +static int unlink_file(struct inode *dirp, struct inode *rip, char file_name[MFS_NAME_MAX]); -FORWARD off_t nextblock(off_t pos, int zone_size); -FORWARD void zerozone_half(struct inode *rip, off_t pos, int half, int +static off_t nextblock(off_t pos, int zone_size); +static void zerozone_half(struct inode *rip, off_t pos, int half, int zone_size); -FORWARD void zerozone_range(struct inode *rip, off_t pos, off_t len); +static void zerozone_range(struct inode *rip, off_t pos, off_t len); /* Args to zerozone_half() */ #define FIRST_HALF 0 @@ -28,7 +28,7 @@ FORWARD void zerozone_range(struct inode *rip, off_t pos, off_t len); /*===========================================================================* * fs_link * *===========================================================================*/ -PUBLIC int fs_link() +int fs_link() { /* Perform the link(name1, name2) system call. */ @@ -108,7 +108,7 @@ PUBLIC int fs_link() /*===========================================================================* * fs_unlink * *===========================================================================*/ -PUBLIC int fs_unlink() +int fs_unlink() { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -170,7 +170,7 @@ PUBLIC int fs_unlink() /*===========================================================================* * fs_rdlink * *===========================================================================*/ -PUBLIC int fs_rdlink() +int fs_rdlink() { block_t b; /* block containing link text */ struct buf *bp; /* buffer containing link text */ @@ -210,7 +210,7 @@ PUBLIC int fs_rdlink() /*===========================================================================* * remove_dir * *===========================================================================*/ -PRIVATE int remove_dir(rldirp, rip, dir_name) +static int remove_dir(rldirp, rip, dir_name) struct inode *rldirp; /* parent directory */ struct inode *rip; /* directory to be removed */ char dir_name[MFS_NAME_MAX]; /* name of directory to be removed */ @@ -246,7 +246,7 @@ char dir_name[MFS_NAME_MAX]; /* name of directory to be removed */ /*===========================================================================* * unlink_file * *===========================================================================*/ -PRIVATE int unlink_file(dirp, rip, file_name) +static int unlink_file(dirp, rip, file_name) struct inode *dirp; /* parent directory of file */ struct inode *rip; /* inode of file, may be NULL too. */ char file_name[MFS_NAME_MAX]; /* name of file to be removed */ @@ -282,7 +282,7 @@ char file_name[MFS_NAME_MAX]; /* name of file to be removed */ /*===========================================================================* * fs_rename * *===========================================================================*/ -PUBLIC int fs_rename() +int fs_rename() { /* Perform the rename(name1, name2) system call. */ struct inode *old_dirp, *old_ip; /* ptrs to old dir, file inodes */ @@ -487,7 +487,7 @@ PUBLIC int fs_rename() /*===========================================================================* * fs_ftrunc * *===========================================================================*/ -PUBLIC int fs_ftrunc(void) +int fs_ftrunc(void) { struct inode *rip; off_t start, end; @@ -515,7 +515,7 @@ PUBLIC int fs_ftrunc(void) /*===========================================================================* * truncate_inode * *===========================================================================*/ -PUBLIC int truncate_inode(rip, newsize) +int truncate_inode(rip, newsize) register struct inode *rip; /* pointer to inode to be truncated */ off_t newsize; /* inode must become this size */ { @@ -559,7 +559,7 @@ off_t newsize; /* inode must become this size */ /*===========================================================================* * freesp_inode * *===========================================================================*/ -PRIVATE int freesp_inode(rip, start, end) +static int freesp_inode(rip, start, end) register struct inode *rip; /* pointer to inode to be partly freed */ off_t start, end; /* range of bytes to free (end uninclusive) */ { @@ -623,7 +623,7 @@ off_t start, end; /* range of bytes to free (end uninclusive) */ /*===========================================================================* * nextblock * *===========================================================================*/ -PRIVATE off_t nextblock(pos, zone_size) +static off_t nextblock(pos, zone_size) off_t pos; int zone_size; { @@ -641,7 +641,7 @@ int zone_size; /*===========================================================================* * zerozone_half * *===========================================================================*/ -PRIVATE void zerozone_half(rip, pos, half, zone_size) +static void zerozone_half(rip, pos, half, zone_size) struct inode *rip; off_t pos; int half; @@ -672,7 +672,7 @@ int zone_size; /*===========================================================================* * zerozone_range * *===========================================================================*/ -PRIVATE void zerozone_range(rip, pos, len) +static void zerozone_range(rip, pos, len) struct inode *rip; off_t pos; off_t len; diff --git a/servers/mfs/main.c b/servers/mfs/main.c index 573e65c71..aa3fa960b 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -12,18 +12,18 @@ /* Declare some local functions. */ -FORWARD void get_work(message *m_in); -FORWARD void reply(endpoint_t who, message *m_out); +static void get_work(message *m_in); +static void reply(endpoint_t who, message *m_out); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -84,7 +84,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -102,7 +102,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the Minix file server. */ int i; @@ -127,7 +127,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -144,7 +144,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_in) +static void get_work(m_in) message *m_in; /* pointer to message */ { int r, srcok = 0; @@ -172,7 +172,7 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply( +static void reply( endpoint_t who, message *m_out /* report result */ ) @@ -186,7 +186,7 @@ PRIVATE void reply( /*===========================================================================* * cch_check * *===========================================================================*/ -PRIVATE void cch_check(void) +static void cch_check(void) { int i; diff --git a/servers/mfs/misc.c b/servers/mfs/misc.c index 93d6b0291..12880dfd5 100644 --- a/servers/mfs/misc.c +++ b/servers/mfs/misc.c @@ -8,7 +8,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -PUBLIC int fs_sync() +int fs_sync() { /* Perform the sync() system call. Flush all the tables. * The order in which the various tables are flushed is critical. The @@ -37,7 +37,7 @@ PUBLIC int fs_sync() /*===========================================================================* * fs_flush * *===========================================================================*/ -PUBLIC int fs_flush() +int fs_flush() { /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. @@ -55,7 +55,7 @@ PUBLIC int fs_flush() /*===========================================================================* * fs_new_driver * *===========================================================================*/ -PUBLIC int fs_new_driver(void) +int fs_new_driver(void) { /* Set a new driver endpoint for this device. */ dev_t dev; diff --git a/servers/mfs/mount.c b/servers/mfs/mount.c index bfb4d7172..43916e394 100644 --- a/servers/mfs/mount.c +++ b/servers/mfs/mount.c @@ -4,12 +4,12 @@ #include #include -PRIVATE int cleanmount = 1; +static int cleanmount = 1; /*===========================================================================* * fs_readsuper * *===========================================================================*/ -PUBLIC int fs_readsuper() +int fs_readsuper() { /* This function reads the superblock of the partition, gets the root inode * and sends back the details of them. Note, that the FS process does not @@ -122,7 +122,7 @@ PUBLIC int fs_readsuper() /*===========================================================================* * fs_mountpoint * *===========================================================================*/ -PUBLIC int fs_mountpoint() +int fs_mountpoint() { /* This function looks up the mount point, it checks the condition whether * the partition can be mounted on the inode or not. @@ -153,7 +153,7 @@ PUBLIC int fs_mountpoint() /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount() +int fs_unmount() { /* Unmount a file system by device number. */ int count; diff --git a/servers/mfs/open.c b/servers/mfs/open.c index 89b4fbf01..a3144dc61 100644 --- a/servers/mfs/open.c +++ b/servers/mfs/open.c @@ -7,13 +7,13 @@ #include "super.h" #include -FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t +static struct inode *new_node(struct inode *ldirp, char *string, mode_t bits, zone_t z0); /*===========================================================================* * fs_create * *===========================================================================*/ -PUBLIC int fs_create() +int fs_create() { size_t len; int r; @@ -70,7 +70,7 @@ PUBLIC int fs_create() /*===========================================================================* * fs_mknod * *===========================================================================*/ -PUBLIC int fs_mknod() +int fs_mknod() { struct inode *ip, *ldirp; char lastc[MFS_NAME_MAX]; @@ -103,7 +103,7 @@ PUBLIC int fs_mknod() /*===========================================================================* * fs_mkdir * *===========================================================================*/ -PUBLIC int fs_mkdir() +int fs_mkdir() { int r1, r2; /* status codes */ ino_t dot, dotdot; /* inode numbers for . and .. */ @@ -169,7 +169,7 @@ PUBLIC int fs_mkdir() /*===========================================================================* * fs_slink * *===========================================================================*/ -PUBLIC int fs_slink() +int fs_slink() { phys_bytes len; struct inode *sip; /* inode containing symbolic link */ @@ -243,7 +243,7 @@ PUBLIC int fs_slink() /*===========================================================================* * new_node * *===========================================================================*/ -PRIVATE struct inode *new_node(struct inode *ldirp, +static struct inode *new_node(struct inode *ldirp, char *string, mode_t bits, zone_t z0) { /* New_node() is called by fs_open(), fs_mknod(), and fs_mkdir(). @@ -318,7 +318,7 @@ PRIVATE struct inode *new_node(struct inode *ldirp, /*===========================================================================* * fs_inhibread * *===========================================================================*/ -PUBLIC int fs_inhibread() +int fs_inhibread() { struct inode *rip; diff --git a/servers/mfs/path.c b/servers/mfs/path.c index 1ddfc4510..f3e03fd5d 100644 --- a/servers/mfs/path.c +++ b/servers/mfs/path.c @@ -22,19 +22,19 @@ #include -PUBLIC char dot1[2] = "."; /* used for search_dir to bypass the access */ -PUBLIC char dot2[3] = ".."; /* permissions for . and .. */ +char dot1[2] = "."; /* used for search_dir to bypass the access */ +char dot2[3] = ".."; /* permissions for . and .. */ -FORWARD char *get_name(char *name, char string[MFS_NAME_MAX+1]); -FORWARD int ltraverse(struct inode *rip, char *suffix); -FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct +static char *get_name(char *name, char string[MFS_NAME_MAX+1]); +static int ltraverse(struct inode *rip, char *suffix); +static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct inode **res_inop, size_t *offsetp, int *symlinkp); /*===========================================================================* * fs_lookup * *===========================================================================*/ -PUBLIC int fs_lookup() +int fs_lookup() { cp_grant_id_t grant; int r, r1, flags, symlinks; @@ -120,7 +120,7 @@ PUBLIC int fs_lookup() /*===========================================================================* * parse_path * *===========================================================================*/ -PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) +static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp) ino_t dir_ino; ino_t root_ino; int flags; @@ -275,7 +275,7 @@ int *symlinkp; /*===========================================================================* * ltraverse * *===========================================================================*/ -PRIVATE int ltraverse(rip, suffix) +static int ltraverse(rip, suffix) register struct inode *rip; /* symbolic link */ char *suffix; /* current remaining path. Has to point in the * user_path buffer @@ -349,7 +349,7 @@ char *suffix; /* current remaining path. Has to point in the /*===========================================================================* * advance * *===========================================================================*/ -PUBLIC struct inode *advance(dirp, string, chk_perm) +struct inode *advance(dirp, string, chk_perm) struct inode *dirp; /* inode for directory to be searched */ char string[MFS_NAME_MAX]; /* component name to look for */ int chk_perm; /* check permissions when string is looked up*/ @@ -417,7 +417,7 @@ int chk_perm; /* check permissions when string is looked up*/ /*===========================================================================* * get_name * *===========================================================================*/ -PRIVATE char *get_name(path_name, string) +static char *get_name(path_name, string) char *path_name; /* path name to parse */ char string[MFS_NAME_MAX+1]; /* component extracted from 'old_name' */ { @@ -463,7 +463,7 @@ char string[MFS_NAME_MAX+1]; /* component extracted from 'old_name' */ /*===========================================================================* * search_dir * *===========================================================================*/ -PUBLIC int search_dir(ldir_ptr, string, numb, flag, check_permissions) +int search_dir(ldir_ptr, string, numb, flag, check_permissions) register struct inode *ldir_ptr; /* ptr to inode for dir to search */ char string[MFS_NAME_MAX]; /* component to search for */ ino_t *numb; /* pointer to inode number */ diff --git a/servers/mfs/protect.c b/servers/mfs/protect.c index 2a62f89e3..961fa770e 100644 --- a/servers/mfs/protect.c +++ b/servers/mfs/protect.c @@ -3,13 +3,13 @@ #include "super.h" #include -FORWARD int in_group(gid_t grp); +static int in_group(gid_t grp); /*===========================================================================* * fs_chmod * *===========================================================================*/ -PUBLIC int fs_chmod() +int fs_chmod() { /* Perform the chmod(name, mode) system call. */ @@ -43,7 +43,7 @@ PUBLIC int fs_chmod() /*===========================================================================* * fs_chown * *===========================================================================*/ -PUBLIC int fs_chown() +int fs_chown() { register struct inode *rip; register int r; @@ -73,7 +73,7 @@ PUBLIC int fs_chown() /*===========================================================================* * forbidden * *===========================================================================*/ -PUBLIC int forbidden(register struct inode *rip, mode_t access_desired) +int forbidden(register struct inode *rip, mode_t access_desired) { /* Given a pointer to an inode, 'rip', and the access desired, determine * if the access is allowed, and if not why not. The routine looks up the @@ -125,7 +125,7 @@ PUBLIC int forbidden(register struct inode *rip, mode_t access_desired) /*===========================================================================* * in_group * *===========================================================================*/ -PRIVATE int in_group(gid_t grp) +static int in_group(gid_t grp) { int i; @@ -143,7 +143,7 @@ PRIVATE int in_group(gid_t grp) /*===========================================================================* * read_only * *===========================================================================*/ -PUBLIC int read_only(ip) +int read_only(ip) struct inode *ip; /* ptr to inode whose file sys is to be cked */ { /* Check to see if the file system on which the inode 'ip' resides is mounted diff --git a/servers/mfs/read.c b/servers/mfs/read.c index 25ef3c6bf..cbf70b804 100644 --- a/servers/mfs/read.c +++ b/servers/mfs/read.c @@ -11,18 +11,18 @@ #include -FORWARD struct buf *rahead(struct inode *rip, block_t baseblock, u64_t +static struct buf *rahead(struct inode *rip, block_t baseblock, u64_t position, unsigned bytes_ahead); -FORWARD int rw_chunk(struct inode *rip, u64_t position, unsigned off, +static int rw_chunk(struct inode *rip, u64_t position, unsigned off, size_t chunk, unsigned left, int rw_flag, cp_grant_id_t gid, unsigned buf_off, unsigned int block_size, int *completed); -PRIVATE char getdents_buf[GETDENTS_BUFSIZ]; +static char getdents_buf[GETDENTS_BUFSIZ]; /*===========================================================================* * fs_readwrite * *===========================================================================*/ -PUBLIC int fs_readwrite(void) +int fs_readwrite(void) { int r, rw_flag, block_spec; int regular; @@ -140,7 +140,7 @@ PUBLIC int fs_readwrite(void) /*===========================================================================* * fs_breadwrite * *===========================================================================*/ -PUBLIC int fs_breadwrite(void) +int fs_breadwrite(void) { int r, rw_flag, completed; cp_grant_id_t gid; @@ -209,7 +209,7 @@ PUBLIC int fs_breadwrite(void) /*===========================================================================* * rw_chunk * *===========================================================================*/ -PRIVATE int rw_chunk(rip, position, off, chunk, left, rw_flag, gid, +static int rw_chunk(rip, position, off, chunk, left, rw_flag, gid, buf_off, block_size, completed) register struct inode *rip; /* pointer to inode for file to be rd/wr */ u64_t position; /* position within file to read or write */ @@ -302,7 +302,7 @@ int *completed; /* number of bytes copied */ /*===========================================================================* * read_map * *===========================================================================*/ -PUBLIC block_t read_map(rip, position) +block_t read_map(rip, position) register struct inode *rip; /* ptr to inode to map from */ off_t position; /* position in file whose blk wanted */ { @@ -371,7 +371,7 @@ off_t position; /* position in file whose blk wanted */ /*===========================================================================* * rd_indir * *===========================================================================*/ -PUBLIC zone_t rd_indir(bp, index) +zone_t rd_indir(bp, index) struct buf *bp; /* pointer to indirect block */ int index; /* index into *bp */ { @@ -407,7 +407,7 @@ int index; /* index into *bp */ /*===========================================================================* * rahead * *===========================================================================*/ -PRIVATE struct buf *rahead(rip, baseblock, position, bytes_ahead) +static struct buf *rahead(rip, baseblock, position, bytes_ahead) register struct inode *rip; /* pointer to inode for file to be read */ block_t baseblock; /* block at current position */ u64_t position; /* position within file */ @@ -536,7 +536,7 @@ unsigned bytes_ahead; /* bytes beyond position for immediate use */ /*===========================================================================* * fs_getdents * *===========================================================================*/ -PUBLIC int fs_getdents(void) +int fs_getdents(void) { register struct inode *rip; int o, r, done; diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index 02314bcb0..6d3d2371a 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -11,7 +11,7 @@ /*===========================================================================* * estimate_blocks * *===========================================================================*/ -PRIVATE blkcnt_t estimate_blocks(struct inode *rip) +static blkcnt_t estimate_blocks(struct inode *rip) { /* Return the number of 512-byte blocks used by this file. This includes space * used by data zones and indirect blocks (actually also zones). Reading in all @@ -41,7 +41,7 @@ PRIVATE blkcnt_t estimate_blocks(struct inode *rip) /*===========================================================================* * stat_inode * *===========================================================================*/ -PRIVATE int stat_inode( +static int stat_inode( register struct inode *rip, /* pointer to inode to stat */ endpoint_t who_e, /* Caller endpoint */ cp_grant_id_t gid /* grant for the stat buf */ @@ -88,7 +88,7 @@ PRIVATE int stat_inode( /*===========================================================================* * fs_fstatfs * *===========================================================================*/ -PUBLIC int fs_fstatfs() +int fs_fstatfs() { struct statfs st; struct inode *rip; @@ -110,7 +110,7 @@ PUBLIC int fs_fstatfs() /*===========================================================================* * fs_statvfs * *===========================================================================*/ -PUBLIC int fs_statvfs() +int fs_statvfs() { struct statvfs st; struct super_block *sp; @@ -143,7 +143,7 @@ PUBLIC int fs_statvfs() /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat() +int fs_stat() { register int r; /* return value */ register struct inode *rip; /* target inode */ diff --git a/servers/mfs/stats.c b/servers/mfs/stats.c index 663581db5..605fed1a8 100644 --- a/servers/mfs/stats.c +++ b/servers/mfs/stats.c @@ -11,7 +11,7 @@ /*===========================================================================* * count_free_bits * *===========================================================================*/ -PUBLIC bit_t count_free_bits(sp, map) +bit_t count_free_bits(sp, map) struct super_block *sp; /* the filesystem to allocate from */ int map; /* IMAP (inode map) or ZMAP (zone map) */ { @@ -92,7 +92,7 @@ int map; /* IMAP (inode map) or ZMAP (zone map) */ /*===========================================================================* * blockstats * *===========================================================================*/ -PUBLIC void blockstats(u32_t *blocks, u32_t *free, u32_t *used) +void blockstats(u32_t *blocks, u32_t *free, u32_t *used) { struct super_block *sp; int scale; diff --git a/servers/mfs/super.c b/servers/mfs/super.c index 24aa854fd..0bd533af4 100644 --- a/servers/mfs/super.c +++ b/servers/mfs/super.c @@ -26,7 +26,7 @@ /*===========================================================================* * alloc_bit * *===========================================================================*/ -PUBLIC bit_t alloc_bit(sp, map, origin) +bit_t alloc_bit(sp, map, origin) struct super_block *sp; /* the filesystem to allocate from */ int map; /* IMAP (inode map) or ZMAP (zone map) */ bit_t origin; /* number of bit to start searching at */ @@ -104,7 +104,7 @@ bit_t origin; /* number of bit to start searching at */ /*===========================================================================* * free_bit * *===========================================================================*/ -PUBLIC void free_bit(sp, map, bit_returned) +void free_bit(sp, map, bit_returned) struct super_block *sp; /* the filesystem to operate on */ int map; /* IMAP (inode map) or ZMAP (zone map) */ bit_t bit_returned; /* number of bit to insert into the map */ @@ -150,7 +150,7 @@ bit_t bit_returned; /* number of bit to insert into the map */ /*===========================================================================* * get_super * *===========================================================================*/ -PUBLIC struct super_block *get_super( +struct super_block *get_super( dev_t dev /* device number whose super_block is sought */ ) { @@ -167,7 +167,7 @@ PUBLIC struct super_block *get_super( /*===========================================================================* * get_block_size * *===========================================================================*/ -PUBLIC unsigned int get_block_size(dev_t dev) +unsigned int get_block_size(dev_t dev) { if (dev == NO_DEV) panic("request for block size of NO_DEV"); @@ -180,7 +180,7 @@ PUBLIC unsigned int get_block_size(dev_t dev) /*===========================================================================* * rw_super * *===========================================================================*/ -PRIVATE int rw_super(struct super_block *sp, int writing) +static int rw_super(struct super_block *sp, int writing) { /* Read/write a superblock. */ int r; @@ -225,7 +225,7 @@ PRIVATE int rw_super(struct super_block *sp, int writing) /*===========================================================================* * read_super * *===========================================================================*/ -PUBLIC int read_super(struct super_block *sp) +int read_super(struct super_block *sp) { unsigned int magic; block_t offset; @@ -359,7 +359,7 @@ PUBLIC int read_super(struct super_block *sp) /*===========================================================================* * write_super * *===========================================================================*/ -PUBLIC int write_super(struct super_block *sp) +int write_super(struct super_block *sp) { if(sp->s_rd_only) panic("can't write superblock of readonly filesystem"); diff --git a/servers/mfs/table.c b/servers/mfs/table.c index aad45503b..42fee46ee 100644 --- a/servers/mfs/table.c +++ b/servers/mfs/table.c @@ -10,7 +10,7 @@ #include "buf.h" #include "super.h" -PUBLIC int (*fs_call_vec[])(void) = { +int (*fs_call_vec[])(void) = { no_sys, /* 0 not used */ no_sys, /* 1 */ /* Was: fs_getnode */ fs_putnode, /* 2 */ diff --git a/servers/mfs/time.c b/servers/mfs/time.c index 6f88e5ebb..48af75d03 100644 --- a/servers/mfs/time.c +++ b/servers/mfs/time.c @@ -6,7 +6,7 @@ /*===========================================================================* * fs_utime * *===========================================================================*/ -PUBLIC int fs_utime() +int fs_utime() { register struct inode *rip; register int r; diff --git a/servers/mfs/utility.c b/servers/mfs/utility.c index 33b2ddce8..9018fa620 100644 --- a/servers/mfs/utility.c +++ b/servers/mfs/utility.c @@ -7,7 +7,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* Somebody has used an illegal system call number */ printf("no_sys: invalid call %d\n", req_nr); @@ -18,7 +18,7 @@ PUBLIC int no_sys() /*===========================================================================* * conv2 * *===========================================================================*/ -PUBLIC unsigned conv2(norm, w) +unsigned conv2(norm, w) int norm; /* TRUE if no swap, FALSE for byte swap */ int w; /* promotion of 16-bit word to be swapped */ { @@ -31,7 +31,7 @@ int w; /* promotion of 16-bit word to be swapped */ /*===========================================================================* * conv4 * *===========================================================================*/ -PUBLIC long conv4(norm, x) +long conv4(norm, x) int norm; /* TRUE if no swap, FALSE for byte swap */ long x; /* 32-bit long to be byte swapped */ { @@ -50,7 +50,7 @@ long x; /* 32-bit long to be byte swapped */ /*===========================================================================* * clock_time * *===========================================================================*/ -PUBLIC time_t clock_time() +time_t clock_time() { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant @@ -71,7 +71,7 @@ PUBLIC time_t clock_time() /*===========================================================================* * mfs_min * *===========================================================================*/ -PUBLIC int min(unsigned int l, unsigned int r) +int min(unsigned int l, unsigned int r) { if(r >= l) return(l); @@ -82,7 +82,7 @@ PUBLIC int min(unsigned int l, unsigned int r) /*===========================================================================* * mfs_nul * *===========================================================================*/ -PUBLIC void mfs_nul_f(char *file, int line, char *str, unsigned int len, +void mfs_nul_f(char *file, int line, char *str, unsigned int len, unsigned int maxlen) { if(len < maxlen && str[len-1] != '\0') { @@ -98,7 +98,7 @@ unsigned int maxlen) /*===========================================================================* * sanity_check * *===========================================================================*/ -PUBLIC void sanitycheck(char *file, int line) +void sanitycheck(char *file, int line) { MYASSERT(SELF_E > 0); if(superblock.s_dev != NO_DEV) { diff --git a/servers/mfs/write.c b/servers/mfs/write.c index c885a16c2..0e8714a11 100644 --- a/servers/mfs/write.c +++ b/servers/mfs/write.c @@ -16,14 +16,14 @@ #include "super.h" -FORWARD void wr_indir(struct buf *bp, int index, zone_t zone); -FORWARD int empty_indir(struct buf *, struct super_block *); +static void wr_indir(struct buf *bp, int index, zone_t zone); +static int empty_indir(struct buf *, struct super_block *); /*===========================================================================* * write_map * *===========================================================================*/ -PUBLIC int write_map(rip, position, new_zone, op) +int write_map(rip, position, new_zone, op) struct inode *rip; /* pointer to inode to be changed */ off_t position; /* file address to be mapped */ zone_t new_zone; /* zone # to be inserted */ @@ -186,7 +186,7 @@ int op; /* special actions */ /*===========================================================================* * wr_indir * *===========================================================================*/ -PRIVATE void wr_indir(bp, index, zone) +static void wr_indir(bp, index, zone) struct buf *bp; /* pointer to indirect block */ int index; /* index into *bp */ zone_t zone; /* zone to write */ @@ -211,7 +211,7 @@ zone_t zone; /* zone to write */ /*===========================================================================* * empty_indir * *===========================================================================*/ -PRIVATE int empty_indir(bp, sb) +static int empty_indir(bp, sb) struct buf *bp; /* pointer to indirect block */ struct super_block *sb; /* superblock of device block resides on */ { @@ -230,7 +230,7 @@ struct super_block *sb; /* superblock of device block resides on */ /*===========================================================================* * clear_zone * *===========================================================================*/ -PUBLIC void clear_zone(rip, pos, flag) +void clear_zone(rip, pos, flag) register struct inode *rip; /* inode to clear */ off_t pos; /* points to block to clear */ int flag; /* 1 if called by new_block, 0 otherwise */ @@ -270,7 +270,7 @@ int flag; /* 1 if called by new_block, 0 otherwise */ /*===========================================================================* * new_block * *===========================================================================*/ -PUBLIC struct buf *new_block(rip, position) +struct buf *new_block(rip, position) register struct inode *rip; /* pointer to inode */ off_t position; /* file pointer */ { @@ -325,7 +325,7 @@ off_t position; /* file pointer */ /*===========================================================================* * zero_block * *===========================================================================*/ -PUBLIC void zero_block(bp) +void zero_block(bp) register struct buf *bp; /* pointer to buffer to zero */ { /* Zero a block. */ diff --git a/servers/pfs/buffer.c b/servers/pfs/buffer.c index 4d7c466e0..825ca1b52 100644 --- a/servers/pfs/buffer.c +++ b/servers/pfs/buffer.c @@ -5,12 +5,12 @@ #include #include -FORWARD struct buf *new_block(dev_t dev, ino_t inum); +static struct buf *new_block(dev_t dev, ino_t inum); /*===========================================================================* * buf_pool * *===========================================================================*/ -PUBLIC void buf_pool(void) +void buf_pool(void) { /* Initialize the buffer pool. */ @@ -23,7 +23,7 @@ PUBLIC void buf_pool(void) /*===========================================================================* * get_block * *===========================================================================*/ -PUBLIC struct buf *get_block(dev_t dev, ino_t inum) +struct buf *get_block(dev_t dev, ino_t inum) { struct buf *bp = front; @@ -43,7 +43,7 @@ PUBLIC struct buf *get_block(dev_t dev, ino_t inum) /*===========================================================================* * new_block * *===========================================================================*/ -PRIVATE struct buf *new_block(dev_t dev, ino_t inum) +static struct buf *new_block(dev_t dev, ino_t inum) { /* Allocate a new buffer and add it to the double linked buffer list */ struct buf *bp; @@ -77,7 +77,7 @@ PRIVATE struct buf *new_block(dev_t dev, ino_t inum) /*===========================================================================* * put_block * *===========================================================================*/ -PUBLIC void put_block(dev_t dev, ino_t inum) +void put_block(dev_t dev, ino_t inum) { struct buf *bp; diff --git a/servers/pfs/dev_uds.c b/servers/pfs/dev_uds.c index ed761b1c6..b57e2c657 100644 --- a/servers/pfs/dev_uds.c +++ b/servers/pfs/dev_uds.c @@ -32,12 +32,12 @@ #include "glo.h" #include "uds.h" -FORWARD int uds_perform_read(int minor, endpoint_t m_source, size_t +static int uds_perform_read(int minor, endpoint_t m_source, size_t size, int pretend); -FORWARD int uds_perform_write(int minor, endpoint_t m_source, size_t +static int uds_perform_write(int minor, endpoint_t m_source, size_t size, int pretend); -PUBLIC int uds_open(message *dev_m_in, message *dev_m_out) +int uds_open(message *dev_m_in, message *dev_m_out) { message fs_m_in, fs_m_out; struct ucred ucred; @@ -206,7 +206,7 @@ PUBLIC int uds_open(message *dev_m_in, message *dev_m_out) return minor; } -PUBLIC int uds_close(message *dev_m_in, message *dev_m_out) +int uds_close(message *dev_m_in, message *dev_m_out) { int minor; message fs_m_in, fs_m_out; @@ -280,7 +280,7 @@ PUBLIC int uds_close(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int uds_select(message *dev_m_in, message *dev_m_out) +int uds_select(message *dev_m_in, message *dev_m_out) { int i, bytes; int minor; @@ -349,7 +349,7 @@ PUBLIC int uds_select(message *dev_m_in, message *dev_m_out) return uds_fd_table[minor].sel_ops_out; } -PRIVATE int uds_perform_read(int minor, endpoint_t m_source, +static int uds_perform_read(int minor, endpoint_t m_source, size_t size, int pretend) { int rc; @@ -482,7 +482,7 @@ PRIVATE int uds_perform_read(int minor, endpoint_t m_source, return fs_m_out.RES_NBYTES; /* return number of bytes read */ } -PRIVATE int uds_perform_write(int minor, endpoint_t m_source, +static int uds_perform_write(int minor, endpoint_t m_source, size_t size, int pretend) { int rc, peer, i; @@ -648,7 +648,7 @@ PRIVATE int uds_perform_write(int minor, endpoint_t m_source, return fs_m_out.RES_NBYTES; /* return number of bytes written */ } -PUBLIC int uds_read(message *dev_m_in, message *dev_m_out) +int uds_read(message *dev_m_in, message *dev_m_out) { int bytes; int minor; @@ -698,7 +698,7 @@ PUBLIC int uds_read(message *dev_m_in, message *dev_m_out) return bytes; } -PUBLIC int uds_write(message *dev_m_in, message *dev_m_out) +int uds_write(message *dev_m_in, message *dev_m_out) { int bytes; int minor; @@ -748,7 +748,7 @@ PUBLIC int uds_write(message *dev_m_in, message *dev_m_out) return bytes; } -PUBLIC int uds_ioctl(message *dev_m_in, message *dev_m_out) +int uds_ioctl(message *dev_m_in, message *dev_m_out) { int rc, minor; @@ -960,7 +960,7 @@ PUBLIC int uds_ioctl(message *dev_m_in, message *dev_m_out) return rc; } -PUBLIC int uds_unsuspend(endpoint_t m_source, int minor) +int uds_unsuspend(endpoint_t m_source, int minor) { int r = OK, bytes; message m_out; @@ -1044,7 +1044,7 @@ PUBLIC int uds_unsuspend(endpoint_t m_source, int minor) return(r); } -PUBLIC int uds_cancel(message *dev_m_in, message *dev_m_out) +int uds_cancel(message *dev_m_in, message *dev_m_out) { int i, j; int minor; diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index f8993e679..333d56567 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -19,14 +19,14 @@ #include "inode.h" #include -FORWARD void addhash_inode(struct inode * const node); -FORWARD void unhash_inode(struct inode * const node); +static void addhash_inode(struct inode * const node); +static void unhash_inode(struct inode * const node); /*===========================================================================* * fs_putnode * *===========================================================================*/ -PUBLIC int fs_putnode(message *fs_m_in, message *fs_m_out) +int fs_putnode(message *fs_m_in, message *fs_m_out) { /* Find the inode specified by the request message and decrease its counter.*/ @@ -68,7 +68,7 @@ PUBLIC int fs_putnode(message *fs_m_in, message *fs_m_out) /*===========================================================================* * init_inode_cache * *===========================================================================*/ -PUBLIC void init_inode_cache() +void init_inode_cache() { struct inode *rip; struct inodelist *rlp; @@ -95,7 +95,7 @@ PUBLIC void init_inode_cache() /*===========================================================================* * addhash_inode * *===========================================================================*/ -PRIVATE void addhash_inode(struct inode * const node) +static void addhash_inode(struct inode * const node) { int hashi = (int) (node->i_num & INODE_HASH_MASK); @@ -107,7 +107,7 @@ PRIVATE void addhash_inode(struct inode * const node) /*===========================================================================* * unhash_inode * *===========================================================================*/ -PRIVATE void unhash_inode(struct inode * const node) +static void unhash_inode(struct inode * const node) { /* remove from hash table */ LIST_REMOVE(node, i_hash); @@ -117,7 +117,7 @@ PRIVATE void unhash_inode(struct inode * const node) /*===========================================================================* * get_inode * *===========================================================================*/ -PUBLIC struct inode *get_inode( +struct inode *get_inode( dev_t dev, /* device on which inode resides */ ino_t numb /* inode number */ ) @@ -173,7 +173,7 @@ PUBLIC struct inode *get_inode( /*===========================================================================* * find_inode * *===========================================================================*/ -PUBLIC struct inode *find_inode(numb) +struct inode *find_inode(numb) ino_t numb; /* inode number */ { /* Find the inode specified by the inode and device number. @@ -197,7 +197,7 @@ ino_t numb; /* inode number */ /*===========================================================================* * put_inode * *===========================================================================*/ -PUBLIC void put_inode(rip) +void put_inode(rip) struct inode *rip; /* pointer to inode to be released */ { /* The caller is no longer using this inode. If no one else is using it either @@ -238,7 +238,7 @@ struct inode *rip; /* pointer to inode to be released */ /*===========================================================================* * alloc_inode * *===========================================================================*/ -PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits) +struct inode *alloc_inode(dev_t dev, mode_t bits) { /* Allocate a free inode on 'dev', and return a pointer to it. */ @@ -286,7 +286,7 @@ PUBLIC struct inode *alloc_inode(dev_t dev, mode_t bits) /*===========================================================================* * wipe_inode * *===========================================================================*/ -PUBLIC void wipe_inode(rip) +void wipe_inode(rip) struct inode *rip; /* the inode to be erased */ { /* Erase some fields in the inode. This function is called from alloc_inode() @@ -302,7 +302,7 @@ struct inode *rip; /* the inode to be erased */ /*===========================================================================* * free_inode * *===========================================================================*/ -PUBLIC void free_inode(rip) +void free_inode(rip) struct inode *rip; { /* Return an inode to the pool of unallocated inodes. */ @@ -318,7 +318,7 @@ struct inode *rip; /*===========================================================================* * update_times * *===========================================================================*/ -PUBLIC void update_times(rip) +void update_times(rip) struct inode *rip; /* pointer to inode to be read/written */ { /* Various system calls are required by the standard to update atime, ctime, diff --git a/servers/pfs/link.c b/servers/pfs/link.c index 4ec064ef9..67dc2d8f5 100644 --- a/servers/pfs/link.c +++ b/servers/pfs/link.c @@ -6,7 +6,7 @@ /*===========================================================================* * fs_ftrunc * *===========================================================================*/ -PUBLIC int fs_ftrunc(message *fs_m_in, message *fs_m_out) +int fs_ftrunc(message *fs_m_in, message *fs_m_out) { struct inode *rip; off_t start, end; @@ -26,7 +26,7 @@ PUBLIC int fs_ftrunc(message *fs_m_in, message *fs_m_out) /*===========================================================================* * truncate_inode * *===========================================================================*/ -PUBLIC int truncate_inode(rip, newsize) +int truncate_inode(rip, newsize) register struct inode *rip; /* pointer to inode to be truncated */ off_t newsize; /* inode must become this size */ { diff --git a/servers/pfs/main.c b/servers/pfs/main.c index ee28419d8..7d8d71e0b 100644 --- a/servers/pfs/main.c +++ b/servers/pfs/main.c @@ -12,17 +12,17 @@ #include "inode.h" #include "uds.h" -FORWARD void get_work(message *m_in); +static void get_work(message *m_in); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -99,7 +99,7 @@ PUBLIC int main(int argc, char *argv[]) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -117,7 +117,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the pipe file server. */ int i; @@ -153,7 +153,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Only check for termination signal, ignore anything else. */ if (signo != SIGTERM) return; @@ -165,7 +165,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_in) +static void get_work(m_in) message *m_in; /* pointer to message */ { int r, srcok = 0, status; @@ -188,7 +188,7 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PUBLIC void reply(who, m_out) +void reply(who, m_out) endpoint_t who; message *m_out; /* report result */ { diff --git a/servers/pfs/misc.c b/servers/pfs/misc.c index 2f8e3010d..541bb4a92 100644 --- a/servers/pfs/misc.c +++ b/servers/pfs/misc.c @@ -4,7 +4,7 @@ /*===========================================================================* * fs_sync * *===========================================================================*/ -PUBLIC int fs_sync(message *fs_m_in, message *fs_m_out) +int fs_sync(message *fs_m_in, message *fs_m_out) { /* Perform the sync() system call. No-op on this FS. */ diff --git a/servers/pfs/mount.c b/servers/pfs/mount.c index 61fbac78e..3bb52d9d6 100644 --- a/servers/pfs/mount.c +++ b/servers/pfs/mount.c @@ -5,7 +5,7 @@ /*===========================================================================* * fs_unmount * *===========================================================================*/ -PUBLIC int fs_unmount(message *fs_m_in, message *fs_m_out) +int fs_unmount(message *fs_m_in, message *fs_m_out) { /* Unmount Pipe File Server. */ diff --git a/servers/pfs/open.c b/servers/pfs/open.c index a7e275757..72ab0b5df 100644 --- a/servers/pfs/open.c +++ b/servers/pfs/open.c @@ -8,7 +8,7 @@ /*===========================================================================* * fs_newnode * *===========================================================================*/ -PUBLIC int fs_newnode(message *fs_m_in, message *fs_m_out) +int fs_newnode(message *fs_m_in, message *fs_m_out) { register int r = OK; mode_t bits; diff --git a/servers/pfs/read.c b/servers/pfs/read.c index b4f06b846..3c12e291e 100644 --- a/servers/pfs/read.c +++ b/servers/pfs/read.c @@ -7,7 +7,7 @@ /*===========================================================================* * fs_readwrite * *===========================================================================*/ -PUBLIC int fs_readwrite(message *fs_m_in, message *fs_m_out) +int fs_readwrite(message *fs_m_in, message *fs_m_out) { int r, rw_flag; struct buf *bp; diff --git a/servers/pfs/stadir.c b/servers/pfs/stadir.c index 7a49caff5..e594c3f0d 100644 --- a/servers/pfs/stadir.c +++ b/servers/pfs/stadir.c @@ -7,7 +7,7 @@ /*===========================================================================* * stat_inode * *===========================================================================*/ -PRIVATE int stat_inode( +static int stat_inode( register struct inode *rip, /* pointer to inode to stat */ endpoint_t who_e, /* Caller endpoint */ cp_grant_id_t gid /* grant for the stat buf */ @@ -57,7 +57,7 @@ PRIVATE int stat_inode( /*===========================================================================* * fs_stat * *===========================================================================*/ -PUBLIC int fs_stat(message *fs_m_in, message *fs_m_out) +int fs_stat(message *fs_m_in, message *fs_m_out) { register int r; /* return value */ register struct inode *rip; /* target inode */ diff --git a/servers/pfs/super.c b/servers/pfs/super.c index 50f4e0ba5..958fa2a6b 100644 --- a/servers/pfs/super.c +++ b/servers/pfs/super.c @@ -17,7 +17,7 @@ /*===========================================================================* * alloc_bit * *===========================================================================*/ -PUBLIC bit_t alloc_bit(void) +bit_t alloc_bit(void) { /* Allocate a bit from a bit map and return its bit number. */ bitchunk_t *wptr, *wlim; @@ -55,7 +55,7 @@ PUBLIC bit_t alloc_bit(void) /*===========================================================================* * free_bit * *===========================================================================*/ -PUBLIC void free_bit(bit_returned) +void free_bit(bit_returned) bit_t bit_returned; /* number of bit to insert into the inode map*/ { bitchunk_t *k, mask; diff --git a/servers/pfs/table.c b/servers/pfs/table.c index 3512b8679..1eba29ec6 100644 --- a/servers/pfs/table.c +++ b/servers/pfs/table.c @@ -11,7 +11,7 @@ #include "uds.h" /* File System Handlers (pfs) */ -PUBLIC int (*fs_call_vec[])(message *fs_m_in, message *fs_m_out) = { +int (*fs_call_vec[])(message *fs_m_in, message *fs_m_out) = { no_sys, /* 0 not used */ no_sys, /* 1 */ @@ -49,7 +49,7 @@ PUBLIC int (*fs_call_vec[])(message *fs_m_in, message *fs_m_out) = { }; /* Device Handlers (/dev/uds) */ -PUBLIC int (*dev_call_vec[])(message *dev_m_in, message *dev_m_out) = { +int (*dev_call_vec[])(message *dev_m_in, message *dev_m_out) = { uds_cancel, /* 0 CANCEL */ no_sys, /* 1 */ diff --git a/servers/pfs/uds.c b/servers/pfs/uds.c index 18c70e103..42cc01563 100644 --- a/servers/pfs/uds.c +++ b/servers/pfs/uds.c @@ -44,7 +44,7 @@ uds_fd_t uds_fd_table[NR_FDS]; /* initialize the descriptor table */ -PUBLIC void uds_init(void) +void uds_init(void) { /* * Setting everything to NULL implicitly sets the @@ -54,7 +54,7 @@ PUBLIC void uds_init(void) } /* check the permissions of a socket file */ -PRIVATE int check_perms(int minor, struct sockaddr_un *addr) +static int check_perms(int minor, struct sockaddr_un *addr) { int rc; message vfs_m; @@ -88,7 +88,7 @@ PRIVATE int check_perms(int minor, struct sockaddr_un *addr) return vfs_m.m_type; /* return reply code OK, ELOOP, etc. */ } -PRIVATE filp_id_t verify_fd(endpoint_t ep, int fd) +static filp_id_t verify_fd(endpoint_t ep, int fd) { int rc; message vfs_m; @@ -119,7 +119,7 @@ PRIVATE filp_id_t verify_fd(endpoint_t ep, int fd) return vfs_m.ADDRESS; } -PRIVATE int set_filp(filp_id_t sfilp) +static int set_filp(filp_id_t sfilp) { int rc; message vfs_m; @@ -147,7 +147,7 @@ PRIVATE int set_filp(filp_id_t sfilp) return vfs_m.m_type; /* return reply code OK, ELOOP, etc. */ } -PRIVATE int copy_filp(endpoint_t to_ep, filp_id_t cfilp) +static int copy_filp(endpoint_t to_ep, filp_id_t cfilp) { int rc; message vfs_m; @@ -177,7 +177,7 @@ PRIVATE int copy_filp(endpoint_t to_ep, filp_id_t cfilp) return vfs_m.m_type; } -PRIVATE int put_filp(filp_id_t pfilp) +static int put_filp(filp_id_t pfilp) { int rc; message vfs_m; @@ -205,7 +205,7 @@ PRIVATE int put_filp(filp_id_t pfilp) return vfs_m.m_type; /* return reply code OK, ELOOP, etc. */ } -PRIVATE int cancel_fd(endpoint_t ep, int fd) +static int cancel_fd(endpoint_t ep, int fd) { int rc; message vfs_m; @@ -234,7 +234,7 @@ PRIVATE int cancel_fd(endpoint_t ep, int fd) return vfs_m.m_type; /* return reply code OK, ELOOP, etc. */ } -PUBLIC int perform_connection(message *dev_m_in, message *dev_m_out, +int perform_connection(message *dev_m_in, message *dev_m_out, struct sockaddr_un *addr, int minorx, int minory) { /* there are several places were a connection is established. */ @@ -271,7 +271,7 @@ PUBLIC int perform_connection(message *dev_m_in, message *dev_m_out, } -PUBLIC int do_accept(message *dev_m_in, message *dev_m_out) +int do_accept(message *dev_m_in, message *dev_m_out) { int minor; int minorparent; /* minor number of parent (server) */ @@ -397,7 +397,7 @@ PUBLIC int do_accept(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int do_connect(message *dev_m_in, message *dev_m_out) +int do_connect(message *dev_m_in, message *dev_m_out) { int minor; struct sockaddr_un addr; @@ -556,7 +556,7 @@ PUBLIC int do_connect(message *dev_m_in, message *dev_m_out) return SUSPEND; } -PUBLIC int do_listen(message *dev_m_in, message *dev_m_out) +int do_listen(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -636,7 +636,7 @@ PUBLIC int do_listen(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int do_socket(message *dev_m_in, message *dev_m_out) +int do_socket(message *dev_m_in, message *dev_m_out) { int rc; int minor; @@ -688,7 +688,7 @@ PUBLIC int do_socket(message *dev_m_in, message *dev_m_out) } } -PUBLIC int do_bind(message *dev_m_in, message *dev_m_out) +int do_bind(message *dev_m_in, message *dev_m_out) { int minor; struct sockaddr_un addr; @@ -756,7 +756,7 @@ PUBLIC int do_bind(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int do_getsockname(message *dev_m_in, message *dev_m_out) +int do_getsockname(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -782,7 +782,7 @@ PUBLIC int do_getsockname(message *dev_m_in, message *dev_m_out) return rc ? EIO : OK; } -PUBLIC int do_getpeername(message *dev_m_in, message *dev_m_out) +int do_getpeername(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -819,7 +819,7 @@ PUBLIC int do_getpeername(message *dev_m_in, message *dev_m_out) } } -PUBLIC int do_shutdown(message *dev_m_in, message *dev_m_out) +int do_shutdown(message *dev_m_in, message *dev_m_out) { int minor; int rc, how; @@ -882,7 +882,7 @@ PUBLIC int do_shutdown(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int do_socketpair_old(message *dev_m_in, message *dev_m_out) +int do_socketpair_old(message *dev_m_in, message *dev_m_out) { int rc; short minorin; @@ -929,7 +929,7 @@ PUBLIC int do_socketpair_old(message *dev_m_in, message *dev_m_out) return perform_connection(dev_m_in, dev_m_out, &addr, minorx, minory); } -PUBLIC int do_socketpair(message *dev_m_in, message *dev_m_out) +int do_socketpair(message *dev_m_in, message *dev_m_out) { int rc; dev_t minorin; @@ -976,7 +976,7 @@ PUBLIC int do_socketpair(message *dev_m_in, message *dev_m_out) return perform_connection(dev_m_in, dev_m_out, &addr, minorx, minory); } -PUBLIC int do_getsockopt_sotype(message *dev_m_in, message *dev_m_out) +int do_getsockopt_sotype(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -1004,7 +1004,7 @@ PUBLIC int do_getsockopt_sotype(message *dev_m_in, message *dev_m_out) return rc ? EIO : OK; } -PUBLIC int do_getsockopt_peercred(message *dev_m_in, message *dev_m_out) +int do_getsockopt_peercred(message *dev_m_in, message *dev_m_out) { int minor; int peer_minor; @@ -1045,7 +1045,7 @@ PUBLIC int do_getsockopt_peercred(message *dev_m_in, message *dev_m_out) return rc ? EIO : OK; } -PUBLIC int do_getsockopt_peercred_old(message *dev_m_in, message *dev_m_out) +int do_getsockopt_peercred_old(message *dev_m_in, message *dev_m_out) { int minor; int peer_minor; @@ -1204,7 +1204,7 @@ int do_setsockopt_rcvbuf(message *dev_m_in, message *dev_m_out) } -PUBLIC int do_sendto(message *dev_m_in, message *dev_m_out) +int do_sendto(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -1248,7 +1248,7 @@ PUBLIC int do_sendto(message *dev_m_in, message *dev_m_out) return OK; } -PUBLIC int do_recvfrom(message *dev_m_in, message *dev_m_out) +int do_recvfrom(message *dev_m_in, message *dev_m_out) { int minor; int rc; @@ -1327,7 +1327,7 @@ int msg_control_read(struct msg_control *msg_ctrl, struct ancillary *data, return OK; } -PRIVATE int send_fds(int minor, struct ancillary *data) +static int send_fds(int minor, struct ancillary *data) { int rc, i, j; @@ -1361,7 +1361,7 @@ PRIVATE int send_fds(int minor, struct ancillary *data) return OK; } -PUBLIC int clear_fds(int minor, struct ancillary *data) +int clear_fds(int minor, struct ancillary *data) { /* This function calls put_filp() for all of the FDs in data. * This is used when a Unix Domain Socket is closed and there @@ -1390,7 +1390,7 @@ PUBLIC int clear_fds(int minor, struct ancillary *data) return OK; } -PRIVATE int recv_fds(int minor, struct ancillary *data, +static int recv_fds(int minor, struct ancillary *data, struct msg_control *msg_ctrl) { int rc, i, j; @@ -1446,7 +1446,7 @@ PRIVATE int recv_fds(int minor, struct ancillary *data, return OK; } -PRIVATE int recv_cred(int minor, struct ancillary *data, +static int recv_cred(int minor, struct ancillary *data, struct msg_control *msg_ctrl) { struct msghdr msghdr; @@ -1474,7 +1474,7 @@ PRIVATE int recv_cred(int minor, struct ancillary *data, return OK; } -PUBLIC int do_sendmsg(message *dev_m_in, message *dev_m_out) +int do_sendmsg(message *dev_m_in, message *dev_m_out) { int minor, peer, rc, i; struct msg_control msg_ctrl; @@ -1548,7 +1548,7 @@ PUBLIC int do_sendmsg(message *dev_m_in, message *dev_m_out) return send_fds(minor, &uds_fd_table[peer].ancillary_data); } -PUBLIC int do_recvmsg(message *dev_m_in, message *dev_m_out) +int do_recvmsg(message *dev_m_in, message *dev_m_out) { int minor; int rc; diff --git a/servers/pfs/utility.c b/servers/pfs/utility.c index fac9ec625..8101990b7 100644 --- a/servers/pfs/utility.c +++ b/servers/pfs/utility.c @@ -4,7 +4,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys(message *pfs_m_in, message *pfs_m_out) +int no_sys(message *pfs_m_in, message *pfs_m_out) { /* Somebody has used an illegal system call number */ printf("no_sys: invalid call 0x%x to pfs\n", req_nr); @@ -15,7 +15,7 @@ PUBLIC int no_sys(message *pfs_m_in, message *pfs_m_out) /*===========================================================================* * clock_time * *===========================================================================*/ -PUBLIC time_t clock_time() +time_t clock_time() { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant diff --git a/servers/pm/alarm.c b/servers/pm/alarm.c index bd2bb9261..884a04b82 100644 --- a/servers/pm/alarm.c +++ b/servers/pm/alarm.c @@ -19,19 +19,19 @@ #define US 1000000 /* shortcut for microseconds per second */ -FORWARD clock_t ticks_from_timeval(struct timeval *tv); -FORWARD void timeval_from_ticks(struct timeval *tv, clock_t ticks); -FORWARD int is_sane_timeval(struct timeval *tv); -FORWARD void getset_vtimer(struct mproc *mp, int nwhich, struct +static clock_t ticks_from_timeval(struct timeval *tv); +static void timeval_from_ticks(struct timeval *tv, clock_t ticks); +static int is_sane_timeval(struct timeval *tv); +static void getset_vtimer(struct mproc *mp, int nwhich, struct itimerval *value, struct itimerval *ovalue); -FORWARD void get_realtimer(struct mproc *mp, struct itimerval *value); -FORWARD void set_realtimer(struct mproc *mp, struct itimerval *value); -FORWARD void cause_sigalrm(struct timer *tp); +static void get_realtimer(struct mproc *mp, struct itimerval *value); +static void set_realtimer(struct mproc *mp, struct itimerval *value); +static void cause_sigalrm(struct timer *tp); /*===========================================================================* * ticks_from_timeval * *===========================================================================*/ -PRIVATE clock_t ticks_from_timeval(tv) +static clock_t ticks_from_timeval(tv) struct timeval *tv; { clock_t ticks; @@ -69,7 +69,7 @@ struct timeval *tv; /*===========================================================================* * timeval_from_ticks * *===========================================================================*/ -PRIVATE void timeval_from_ticks(tv, ticks) +static void timeval_from_ticks(tv, ticks) struct timeval *tv; clock_t ticks; { @@ -80,7 +80,7 @@ clock_t ticks; /*===========================================================================* * is_sane_timeval * *===========================================================================*/ -PRIVATE int is_sane_timeval(tv) +static int is_sane_timeval(tv) struct timeval *tv; { /* This imposes a reasonable time value range for setitimer. */ @@ -91,7 +91,7 @@ struct timeval *tv; /*===========================================================================* * do_itimer * *===========================================================================*/ -PUBLIC int do_itimer() +int do_itimer() { struct itimerval ovalue, value; /* old and new interval timers */ int setval, getval; /* set and/or retrieve the values? */ @@ -157,7 +157,7 @@ PUBLIC int do_itimer() /*===========================================================================* * do_alarm * *===========================================================================*/ -PUBLIC int do_alarm() +int do_alarm() { struct itimerval value, ovalue; int remaining; /* previous time left in seconds */ @@ -181,7 +181,7 @@ PUBLIC int do_alarm() /*===========================================================================* * getset_vtimer * *===========================================================================*/ -PRIVATE void getset_vtimer(rmp, which, value, ovalue) +static void getset_vtimer(rmp, which, value, ovalue) struct mproc *rmp; int which; struct itimerval *value; @@ -246,7 +246,7 @@ struct itimerval *ovalue; /*===========================================================================* * check_vtimer * *===========================================================================*/ -PUBLIC void check_vtimer(proc_nr, sig) +void check_vtimer(proc_nr, sig) int proc_nr; int sig; { @@ -272,7 +272,7 @@ int sig; /*===========================================================================* * get_realtimer * *===========================================================================*/ -PRIVATE void get_realtimer(rmp, value) +static void get_realtimer(rmp, value) struct mproc *rmp; struct itimerval *value; { @@ -307,7 +307,7 @@ struct itimerval *value; /*===========================================================================* * set_realtimer * *===========================================================================*/ -PRIVATE void set_realtimer(rmp, value) +static void set_realtimer(rmp, value) struct mproc *rmp; struct itimerval *value; { @@ -329,7 +329,7 @@ struct itimerval *value; /*===========================================================================* * set_alarm * *===========================================================================*/ -PUBLIC void set_alarm(rmp, ticks) +void set_alarm(rmp, ticks) struct mproc *rmp; /* process that wants the alarm */ clock_t ticks; /* how many ticks delay before the signal */ { @@ -345,7 +345,7 @@ clock_t ticks; /* how many ticks delay before the signal */ /*===========================================================================* * cause_sigalrm * *===========================================================================*/ -PRIVATE void cause_sigalrm(tp) +static void cause_sigalrm(tp) struct timer *tp; { int proc_nr_n; diff --git a/servers/pm/break.c b/servers/pm/break.c index 71779cb96..9a1a04c35 100644 --- a/servers/pm/break.c +++ b/servers/pm/break.c @@ -9,7 +9,7 @@ /*===========================================================================* * do_brk * *===========================================================================*/ -PUBLIC int do_brk() +int do_brk() { int r; /* Entry point to brk(addr) system call. */ diff --git a/servers/pm/exec.c b/servers/pm/exec.c index 0942b9970..4768363ca 100644 --- a/servers/pm/exec.c +++ b/servers/pm/exec.c @@ -36,7 +36,7 @@ /*===========================================================================* * do_exec * *===========================================================================*/ -PUBLIC int do_exec() +int do_exec() { message m; @@ -58,7 +58,7 @@ PUBLIC int do_exec() /*===========================================================================* * do_exec_newmem * *===========================================================================*/ -PUBLIC int do_exec_newmem() +int do_exec_newmem() { int proc_e, proc_n, allow_setuid; char *ptr; @@ -131,7 +131,7 @@ PUBLIC int do_exec_newmem() /*===========================================================================* * do_execrestart * *===========================================================================*/ -PUBLIC int do_execrestart() +int do_execrestart() { int proc_e, proc_n, result; struct mproc *rmp; @@ -157,7 +157,7 @@ PUBLIC int do_execrestart() /*===========================================================================* * exec_restart * *===========================================================================*/ -PUBLIC void exec_restart(rmp, result, pc) +void exec_restart(rmp, result, pc) struct mproc *rmp; int result; vir_bytes pc; diff --git a/servers/pm/forkexit.c b/servers/pm/forkexit.c index 36cf3256b..5980ad77c 100644 --- a/servers/pm/forkexit.c +++ b/servers/pm/forkexit.c @@ -31,17 +31,17 @@ #define LAST_FEW 2 /* last few slots reserved for superuser */ -FORWARD void zombify(struct mproc *rmp); -FORWARD void check_parent(struct mproc *child, int try_cleanup); -FORWARD void tell_parent(struct mproc *child); -FORWARD void tell_tracer(struct mproc *child); -FORWARD void tracer_died(struct mproc *child); -FORWARD void cleanup(register struct mproc *rmp); +static void zombify(struct mproc *rmp); +static void check_parent(struct mproc *child, int try_cleanup); +static void tell_parent(struct mproc *child); +static void tell_tracer(struct mproc *child); +static void tracer_died(struct mproc *child); +static void cleanup(register struct mproc *rmp); /*===========================================================================* * do_fork * *===========================================================================*/ -PUBLIC int do_fork() +int do_fork() { /* The process pointed to by 'mp' has forked. Create a child process. */ register struct mproc *rmp; /* pointer to parent */ @@ -139,7 +139,7 @@ PUBLIC int do_fork() /*===========================================================================* * do_srv_fork * *===========================================================================*/ -PUBLIC int do_srv_fork() +int do_srv_fork() { /* The process pointed to by 'mp' has forked. Create a child process. */ register struct mproc *rmp; /* pointer to parent */ @@ -234,7 +234,7 @@ PUBLIC int do_srv_fork() /*===========================================================================* * do_exit * *===========================================================================*/ -PUBLIC int do_exit() +int do_exit() { /* Perform the exit(status) system call. The real work is done by exit_proc(), * which is also called when a process is killed by a signal. System processes @@ -255,7 +255,7 @@ PUBLIC int do_exit() /*===========================================================================* * exit_proc * *===========================================================================*/ -PUBLIC void exit_proc(rmp, exit_status, dump_core) +void exit_proc(rmp, exit_status, dump_core) register struct mproc *rmp; /* pointer to the process to be terminated */ int exit_status; /* the process' exit status (for parent) */ int dump_core; /* flag indicating whether to dump core */ @@ -385,7 +385,7 @@ int dump_core; /* flag indicating whether to dump core */ /*===========================================================================* * exit_restart * *===========================================================================*/ -PUBLIC void exit_restart(rmp, dump_core) +void exit_restart(rmp, dump_core) struct mproc *rmp; /* pointer to the process being terminated */ int dump_core; /* flag indicating whether to dump core */ { @@ -445,7 +445,7 @@ int dump_core; /* flag indicating whether to dump core */ /*===========================================================================* * do_waitpid * *===========================================================================*/ -PUBLIC int do_waitpid() +int do_waitpid() { /* A process wants to wait for a child to terminate. If a child is already * waiting, go clean it up and let this WAIT call terminate. Otherwise, @@ -535,7 +535,7 @@ PUBLIC int do_waitpid() /*===========================================================================* * wait_test * *===========================================================================*/ -PUBLIC int wait_test(rmp, child) +int wait_test(rmp, child) struct mproc *rmp; /* process that may be waiting */ struct mproc *child; /* process that may be waited for */ { @@ -557,7 +557,7 @@ struct mproc *child; /* process that may be waited for */ /*===========================================================================* * zombify * *===========================================================================*/ -PRIVATE void zombify(rmp) +static void zombify(rmp) struct mproc *rmp; { /* Zombify a process. First check if the exiting process is traced by a process @@ -595,7 +595,7 @@ struct mproc *rmp; /*===========================================================================* * check_parent * *===========================================================================*/ -PRIVATE void check_parent(child, try_cleanup) +static void check_parent(child, try_cleanup) struct mproc *child; /* tells which process is exiting */ int try_cleanup; /* clean up the child when done? */ { @@ -633,7 +633,7 @@ int try_cleanup; /* clean up the child when done? */ /*===========================================================================* * tell_parent * *===========================================================================*/ -PRIVATE void tell_parent(child) +static void tell_parent(child) register struct mproc *child; /* tells which process is exiting */ { int exitstatus, mp_parent; @@ -661,7 +661,7 @@ register struct mproc *child; /* tells which process is exiting */ /*===========================================================================* * tell_tracer * *===========================================================================*/ -PRIVATE void tell_tracer(child) +static void tell_tracer(child) struct mproc *child; /* tells which process is exiting */ { int exitstatus, mp_tracer; @@ -685,7 +685,7 @@ struct mproc *child; /* tells which process is exiting */ /*===========================================================================* * tracer_died * *===========================================================================*/ -PRIVATE void tracer_died(child) +static void tracer_died(child) struct mproc *child; /* process being traced */ { /* The process that was tracing the given child, has died for some reason. @@ -720,7 +720,7 @@ struct mproc *child; /* process being traced */ /*===========================================================================* * cleanup * *===========================================================================*/ -PRIVATE void cleanup(rmp) +static void cleanup(rmp) register struct mproc *rmp; /* tells which process is exiting */ { /* Release the process table entry and reinitialize some field. */ diff --git a/servers/pm/getset.c b/servers/pm/getset.c index 3a1f24763..5354339df 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_get * *===========================================================================*/ -PUBLIC int do_get() +int do_get() { /* Handle GETUID, GETGID, GETGROUPS, GETGROUPS_O, GETPID, GETPGRP, GETSID, ISSETUGID. @@ -118,7 +118,7 @@ PUBLIC int do_get() /*===========================================================================* * do_set * *===========================================================================*/ -PUBLIC int do_set() +int do_set() { /* Handle SETUID, SETEUID, SETGID, SETEGID, SETSID. These calls have in common * that, if successful, they will be forwarded to VFS as well. diff --git a/servers/pm/main.c b/servers/pm/main.c index 2bb123c52..221a63021 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -39,22 +39,22 @@ EXTERN unsigned long calls_stats[NCALLS]; #endif -FORWARD void sendreply(void); -FORWARD int get_nice_value(int queue); -FORWARD void handle_vfs_reply(void); +static void sendreply(void); +static int get_nice_value(int queue); +static void handle_vfs_reply(void); #define click_to_round_k(n) \ ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024)) /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD int sef_cb_signal_manager(endpoint_t target, int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static int sef_cb_signal_manager(endpoint_t target, int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main() +int main() { /* Main routine of the process manager. */ int result; @@ -156,7 +156,7 @@ PUBLIC int main() /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -174,7 +174,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the process manager. * Memory use info is collected from the boot monitor, the kernel, and @@ -307,7 +307,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_manager * *===========================================================================*/ -PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo) +static int sef_cb_signal_manager(endpoint_t target, int signo) { /* Process signal on behalf of the kernel. */ int r; @@ -321,7 +321,7 @@ PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo) /*===========================================================================* * setreply * *===========================================================================*/ -PUBLIC void setreply(proc_nr, result) +void setreply(proc_nr, result) int proc_nr; /* process to reply to */ int result; /* result of call (usually OK or error #) */ { @@ -341,7 +341,7 @@ int result; /* result of call (usually OK or error #) */ /*===========================================================================* * sendreply * *===========================================================================*/ -PRIVATE void sendreply() +static void sendreply() { int proc_nr; int s; @@ -371,7 +371,7 @@ PRIVATE void sendreply() /*===========================================================================* * get_nice_value * *===========================================================================*/ -PRIVATE int get_nice_value(queue) +static int get_nice_value(queue) int queue; /* store mem chunks here */ { /* Processes in the boot image have a priority assigned. The PM doesn't know @@ -388,7 +388,7 @@ int queue; /* store mem chunks here */ /*===========================================================================* * handle_vfs_reply * *===========================================================================*/ -PRIVATE void handle_vfs_reply() +static void handle_vfs_reply() { struct mproc *rmp; endpoint_t proc_e; diff --git a/servers/pm/mcontext.c b/servers/pm/mcontext.c index f89f6fce6..2ade3c67f 100644 --- a/servers/pm/mcontext.c +++ b/servers/pm/mcontext.c @@ -10,7 +10,7 @@ /*===========================================================================* * do_setmcontext * *===========================================================================*/ -PUBLIC int do_setmcontext() +int do_setmcontext() { return sys_setmcontext(who_e, (mcontext_t *) m_in.m1_p1); } @@ -19,7 +19,7 @@ PUBLIC int do_setmcontext() /*===========================================================================* * do_getmcontext * *===========================================================================*/ -PUBLIC int do_getmcontext() +int do_getmcontext() { return sys_getmcontext(who_e, (mcontext_t *) m_in.m1_p1); } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 531e9bc58..c6beef105 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -30,7 +30,7 @@ #include "param.h" #include "kernel/proc.h" -PUBLIC struct utsname uts_val = { +struct utsname uts_val = { "Minix", /* system name */ "noname", /* node/network name */ OS_RELEASE, /* O.S. release (e.g. 1.5) */ @@ -43,7 +43,7 @@ PUBLIC struct utsname uts_val = { #endif }; -PRIVATE char *uts_tbl[] = { +static char *uts_tbl[] = { uts_val.arch, NULL, /* No kernel architecture */ uts_val.machine, @@ -56,13 +56,13 @@ PRIVATE char *uts_tbl[] = { }; #if ENABLE_SYSCALL_STATS -PUBLIC unsigned long calls_stats[NCALLS]; +unsigned long calls_stats[NCALLS]; #endif /*===========================================================================* * do_sysuname * *===========================================================================*/ -PUBLIC int do_sysuname() +int do_sysuname() { /* Set or get uname strings. */ @@ -126,7 +126,7 @@ PUBLIC int do_sysuname() /*===========================================================================* * do_getsysinfo * *===========================================================================*/ -PUBLIC int do_getsysinfo() +int do_getsysinfo() { vir_bytes src_addr, dst_addr; size_t len; @@ -167,7 +167,7 @@ PUBLIC int do_getsysinfo() /*===========================================================================* * do_getprocnr * *===========================================================================*/ -PUBLIC int do_getprocnr() +int do_getprocnr() { register struct mproc *rmp; static char search_key[PROC_NAME_LEN+1]; @@ -232,7 +232,7 @@ PUBLIC int do_getprocnr() /*===========================================================================* * do_getepinfo * *===========================================================================*/ -PUBLIC int do_getepinfo() +int do_getepinfo() { register struct mproc *rmp; endpoint_t ep; @@ -254,7 +254,7 @@ PUBLIC int do_getepinfo() /*===========================================================================* * do_getepinfo_o * *===========================================================================*/ -PUBLIC int do_getepinfo_o() +int do_getepinfo_o() { register struct mproc *rmp; endpoint_t ep; @@ -284,7 +284,7 @@ PUBLIC int do_getepinfo_o() /*===========================================================================* * do_reboot * *===========================================================================*/ -PUBLIC int do_reboot() +int do_reboot() { message m; @@ -325,7 +325,7 @@ PUBLIC int do_reboot() /*===========================================================================* * do_getsetpriority * *===========================================================================*/ -PUBLIC int do_getsetpriority() +int do_getsetpriority() { int r, arg_which, arg_who, arg_pri; struct mproc *rmp; @@ -377,7 +377,7 @@ PUBLIC int do_getsetpriority() /*===========================================================================* * do_svrctl * *===========================================================================*/ -PUBLIC int do_svrctl() +int do_svrctl() { int s, req; vir_bytes ptr; @@ -485,7 +485,7 @@ PUBLIC int do_svrctl() *===========================================================================*/ extern char *_brksize; -PUBLIC int brk(brk_addr) +int brk(brk_addr) #ifdef __NBSD_LIBC void *brk_addr; #else diff --git a/servers/pm/profile.c b/servers/pm/profile.c index d2303ed8b..0f0bc04ce 100644 --- a/servers/pm/profile.c +++ b/servers/pm/profile.c @@ -19,13 +19,13 @@ #include "param.h" #if SPROFILE || CPROFILE -FORWARD int check_addrs(int info_size); +static int check_addrs(int info_size); #endif /*===========================================================================* * do_sprofile * *===========================================================================*/ -PUBLIC int do_sprofile(void) +int do_sprofile(void) { #if SPROFILE @@ -57,7 +57,7 @@ PUBLIC int do_sprofile(void) /*===========================================================================* * do_cprofile * *===========================================================================*/ -PUBLIC int do_cprofile(void) +int do_cprofile(void) { #if CPROFILE @@ -90,7 +90,7 @@ PUBLIC int do_cprofile(void) /*===========================================================================* * check_addrs * *===========================================================================*/ -PRIVATE int check_addrs(info_size) +static int check_addrs(info_size) int info_size; { int r; diff --git a/servers/pm/schedule.c b/servers/pm/schedule.c index e94c20eb2..a35c89fb1 100644 --- a/servers/pm/schedule.c +++ b/servers/pm/schedule.c @@ -17,7 +17,7 @@ /*===========================================================================* * init_scheduling * *===========================================================================*/ -PUBLIC void sched_init(void) +void sched_init(void) { struct mproc *trmp; endpoint_t parent_e; @@ -52,7 +52,7 @@ PUBLIC void sched_init(void) /*===========================================================================* * sched_start_user * *===========================================================================*/ -PUBLIC int sched_start_user(endpoint_t ep, struct mproc *rmp) +int sched_start_user(endpoint_t ep, struct mproc *rmp) { unsigned maxprio; endpoint_t inherit_from; @@ -86,7 +86,7 @@ PUBLIC int sched_start_user(endpoint_t ep, struct mproc *rmp) /*===========================================================================* * sched_nice * *===========================================================================*/ -PUBLIC int sched_nice(struct mproc *rmp, int nice) +int sched_nice(struct mproc *rmp, int nice) { int rv; message m; diff --git a/servers/pm/signal.c b/servers/pm/signal.c index 95a3cbf37..30eb4cab8 100644 --- a/servers/pm/signal.c +++ b/servers/pm/signal.c @@ -32,14 +32,14 @@ #include "mproc.h" #include "param.h" -FORWARD void unpause(struct mproc *rmp); -FORWARD int sig_send(struct mproc *rmp, int signo); -FORWARD void sig_proc_exit(struct mproc *rmp, int signo); +static void unpause(struct mproc *rmp); +static int sig_send(struct mproc *rmp, int signo); +static void sig_proc_exit(struct mproc *rmp, int signo); /*===========================================================================* * do_sigaction * *===========================================================================*/ -PUBLIC int do_sigaction() +int do_sigaction() { int r; struct sigaction svec; @@ -87,7 +87,7 @@ PUBLIC int do_sigaction() /*===========================================================================* * do_sigpending * *===========================================================================*/ -PUBLIC int do_sigpending() +int do_sigpending() { mp->mp_reply.reply_mask = (long) mp->mp_sigpending; return OK; @@ -96,7 +96,7 @@ PUBLIC int do_sigpending() /*===========================================================================* * do_sigprocmask * *===========================================================================*/ -PUBLIC int do_sigprocmask() +int do_sigprocmask() { /* Note that the library interface passes the actual mask in sigmask_set, * not a pointer to the mask, in order to save a copy. Similarly, @@ -151,7 +151,7 @@ PUBLIC int do_sigprocmask() /*===========================================================================* * do_sigsuspend * *===========================================================================*/ -PUBLIC int do_sigsuspend() +int do_sigsuspend() { mp->mp_sigmask2 = mp->mp_sigmask; /* save the old mask */ mp->mp_sigmask = (sigset_t) m_in.sig_set; @@ -165,7 +165,7 @@ PUBLIC int do_sigsuspend() /*===========================================================================* * do_sigreturn * *===========================================================================*/ -PUBLIC int do_sigreturn() +int do_sigreturn() { /* A user signal handler is done. Restore context and check for * pending unblocked signals. @@ -185,7 +185,7 @@ PUBLIC int do_sigreturn() /*===========================================================================* * do_kill * *===========================================================================*/ -PUBLIC int do_kill() +int do_kill() { /* Perform the kill(pid, signo) system call. */ @@ -195,7 +195,7 @@ PUBLIC int do_kill() /*===========================================================================* * do_srv_kill * *===========================================================================*/ -PUBLIC int do_srv_kill() +int do_srv_kill() { /* Perform the srv_kill(pid, signo) system call. */ @@ -213,7 +213,7 @@ PUBLIC int do_srv_kill() /*===========================================================================* * process_ksig * *===========================================================================*/ -PUBLIC int process_ksig(endpoint_t proc_nr_e, int signo) +int process_ksig(endpoint_t proc_nr_e, int signo) { register struct mproc *rmp; int proc_nr; @@ -293,7 +293,7 @@ PUBLIC int process_ksig(endpoint_t proc_nr_e, int signo) /*===========================================================================* * do_pause * *===========================================================================*/ -PUBLIC int do_pause() +int do_pause() { /* Perform the pause() system call. */ @@ -304,7 +304,7 @@ PUBLIC int do_pause() /*===========================================================================* * sig_proc * *===========================================================================*/ -PUBLIC void sig_proc(rmp, signo, trace, ksig) +void sig_proc(rmp, signo, trace, ksig) register struct mproc *rmp; /* pointer to the process to be signaled */ int signo; /* signal to send to process (1 to _NSIG-1) */ int trace; /* pass signal to tracer first? */ @@ -467,7 +467,7 @@ int ksig; /* non-zero means signal comes from kernel */ /*===========================================================================* * sig_proc_exit * *===========================================================================*/ -PRIVATE void sig_proc_exit(rmp, signo) +static void sig_proc_exit(rmp, signo) struct mproc *rmp; /* process that must exit */ int signo; /* signal that caused termination */ { @@ -488,7 +488,7 @@ int signo; /* signal that caused termination */ /*===========================================================================* * check_sig * *===========================================================================*/ -PUBLIC int check_sig(proc_id, signo, ksig) +int check_sig(proc_id, signo, ksig) pid_t proc_id; /* pid of proc to sig, or 0 or -1, or -pgrp */ int signo; /* signal to send to process (0 to _NSIG-1) */ int ksig; /* non-zero means signal comes from kernel */ @@ -566,7 +566,7 @@ int ksig; /* non-zero means signal comes from kernel */ /*===========================================================================* * check_pending * *===========================================================================*/ -PUBLIC void check_pending(rmp) +void check_pending(rmp) register struct mproc *rmp; { /* Check to see if any pending signals have been unblocked. Deliver as many @@ -597,7 +597,7 @@ register struct mproc *rmp; /*===========================================================================* * restart_sigs * *===========================================================================*/ -PUBLIC void restart_sigs(rmp) +void restart_sigs(rmp) struct mproc *rmp; { /* VFS has replied to a request from us; do signal-related work. @@ -634,7 +634,7 @@ struct mproc *rmp; /*===========================================================================* * unpause * *===========================================================================*/ -PRIVATE void unpause(rmp) +static void unpause(rmp) struct mproc *rmp; /* which process */ { /* A signal is to be sent to a process. If that process is hanging on a @@ -693,7 +693,7 @@ struct mproc *rmp; /* which process */ /*===========================================================================* * sig_send * *===========================================================================*/ -PRIVATE int sig_send(rmp, signo) +static int sig_send(rmp, signo) struct mproc *rmp; /* what process to spawn a signal handler in */ int signo; /* signal to send to process (1 to _NSIG-1) */ { @@ -771,7 +771,7 @@ int signo; /* signal to send to process (1 to _NSIG-1) */ /*===========================================================================* * vm_notify_sig_wrapper * *===========================================================================*/ -PUBLIC void vm_notify_sig_wrapper(endpoint_t ep) +void vm_notify_sig_wrapper(endpoint_t ep) { /* get IPC's endpoint, * the reason that we directly get the endpoint diff --git a/servers/pm/time.c b/servers/pm/time.c index 63a66289d..747a0bd65 100644 --- a/servers/pm/time.c +++ b/servers/pm/time.c @@ -16,7 +16,7 @@ /*===========================================================================* * do_time * *===========================================================================*/ -PUBLIC int do_time() +int do_time() { /* Perform the time(tp) system call. This returns the time in seconds since * 1.1.1970. MINIX is an astrophysically naive system that assumes the earth @@ -37,7 +37,7 @@ PUBLIC int do_time() /*===========================================================================* * do_stime * *===========================================================================*/ -PUBLIC int do_stime() +int do_stime() { /* Perform the stime(tp) system call. Retrieve the system's uptime (ticks * since boot) and pass the new time in seconds at system boot to the kernel. @@ -62,7 +62,7 @@ PUBLIC int do_stime() /*===========================================================================* * do_times * *===========================================================================*/ -PUBLIC int do_times() +int do_times() { /* Perform the times(buffer) system call. */ register struct mproc *rmp = mp; diff --git a/servers/pm/trace.c b/servers/pm/trace.c index ae695c1e6..5d19feedd 100644 --- a/servers/pm/trace.c +++ b/servers/pm/trace.c @@ -37,7 +37,7 @@ /*===========================================================================* * do_trace * *===========================================================================*/ -PUBLIC int do_trace() +int do_trace() { register struct mproc *child; struct ptrace_range pr; @@ -267,7 +267,7 @@ PUBLIC int do_trace() /*===========================================================================* * stop_proc * *===========================================================================*/ -PUBLIC void stop_proc(rmp, signo) +void stop_proc(rmp, signo) register struct mproc *rmp; int signo; { diff --git a/servers/pm/utility.c b/servers/pm/utility.c index 507fb2474..0ebe296e1 100644 --- a/servers/pm/utility.c +++ b/servers/pm/utility.c @@ -33,7 +33,7 @@ /*===========================================================================* * get_free_pid * *===========================================================================*/ -PUBLIC pid_t get_free_pid() +pid_t get_free_pid() { static pid_t next_pid = INIT_PID + 1; /* next pid to be assigned */ register struct mproc *rmp; /* check process table */ @@ -56,7 +56,7 @@ PUBLIC pid_t get_free_pid() /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* A system call number not implemented by PM has been requested. */ return(ENOSYS); @@ -65,7 +65,7 @@ PUBLIC int no_sys() /*===========================================================================* * find_param * *===========================================================================*/ -PUBLIC char *find_param(name) +char *find_param(name) const char *name; { register const char *namep; @@ -85,7 +85,7 @@ const char *name; /*===========================================================================* * find_proc * *===========================================================================*/ -PUBLIC struct mproc *find_proc(lpid) +struct mproc *find_proc(lpid) pid_t lpid; { register struct mproc *rmp; @@ -100,7 +100,7 @@ pid_t lpid; /*===========================================================================* * nice_to_priority * *===========================================================================*/ -PUBLIC int nice_to_priority(int nice, unsigned* new_q) +int nice_to_priority(int nice, unsigned* new_q) { if (nice < PRIO_MIN || nice > PRIO_MAX) return(EINVAL); @@ -117,7 +117,7 @@ PUBLIC int nice_to_priority(int nice, unsigned* new_q) /*===========================================================================* * pm_isokendpt * *===========================================================================*/ -PUBLIC int pm_isokendpt(int endpoint, int *proc) +int pm_isokendpt(int endpoint, int *proc) { *proc = _ENDPOINT_P(endpoint); if(*proc < -NR_TASKS || *proc >= NR_PROCS) @@ -132,7 +132,7 @@ PUBLIC int pm_isokendpt(int endpoint, int *proc) /*===========================================================================* * tell_vfs * *===========================================================================*/ -PUBLIC void tell_vfs(rmp, m_ptr) +void tell_vfs(rmp, m_ptr) struct mproc *rmp; message *m_ptr; { diff --git a/servers/procfs/buf.c b/servers/procfs/buf.c index 8f947db58..ee2ef7990 100644 --- a/servers/procfs/buf.c +++ b/servers/procfs/buf.c @@ -5,14 +5,14 @@ #define BUF_SIZE 4096 -PRIVATE char buf[BUF_SIZE + 1]; -PRIVATE size_t off, left, used; -PRIVATE off_t skip; +static char buf[BUF_SIZE + 1]; +static size_t off, left, used; +static off_t skip; /*===========================================================================* * buf_init * *===========================================================================*/ -PUBLIC void buf_init(off_t start, size_t len) +void buf_init(off_t start, size_t len) { /* Initialize the buffer for fresh use. The first 'start' bytes of the * produced output are to be skipped. After that, up to a total of @@ -28,7 +28,7 @@ PUBLIC void buf_init(off_t start, size_t len) /*===========================================================================* * buf_printf * *===========================================================================*/ -PUBLIC void buf_printf(char *fmt, ...) +void buf_printf(char *fmt, ...) { /* Add formatted text to the end of the buffer. */ @@ -84,7 +84,7 @@ PUBLIC void buf_printf(char *fmt, ...) /*===========================================================================* * buf_append * *===========================================================================*/ -PUBLIC void buf_append(char *data, size_t len) +void buf_append(char *data, size_t len) { /* Add arbitrary data to the end of the buffer. */ @@ -116,7 +116,7 @@ PUBLIC void buf_append(char *data, size_t len) /*===========================================================================* * buf_get * *===========================================================================*/ -PUBLIC size_t buf_get(char **ptr) +size_t buf_get(char **ptr) { /* Return the buffer's starting address and the length of the used * part, not counting the trailing null character for the latter. diff --git a/servers/procfs/cpuinfo.c b/servers/procfs/cpuinfo.c index cd2f8381b..ca47a8196 100644 --- a/servers/procfs/cpuinfo.c +++ b/servers/procfs/cpuinfo.c @@ -5,7 +5,7 @@ #define CONFIG_MAX_CPUS 1 #endif -PRIVATE const char * x86_flag[] = { +static const char * x86_flag[] = { "fpu", "vme", "de", @@ -72,7 +72,7 @@ PRIVATE const char * x86_flag[] = { "", }; -PRIVATE void print_cpu_flags(u32_t * flags) +static void print_cpu_flags(u32_t * flags) { int i, j; @@ -86,7 +86,7 @@ PRIVATE void print_cpu_flags(u32_t * flags) buf_printf("\n"); } -PRIVATE void print_cpu(struct cpu_info * cpu_info, unsigned id) +static void print_cpu(struct cpu_info * cpu_info, unsigned id) { buf_printf("%-16s: %d\n", "processor", id); @@ -113,7 +113,7 @@ PRIVATE void print_cpu(struct cpu_info * cpu_info, unsigned id) buf_printf("\n"); } -PUBLIC void root_cpuinfo(void) +void root_cpuinfo(void) { struct cpu_info cpu_info[CONFIG_MAX_CPUS]; struct machine machine; diff --git a/servers/procfs/main.c b/servers/procfs/main.c index 5ea3f8026..6a99bdc89 100644 --- a/servers/procfs/main.c +++ b/servers/procfs/main.c @@ -3,10 +3,10 @@ #include "inc.h" #include "cpuinfo.h" -FORWARD void init_hook(void); +static void init_hook(void); /* The hook functions that will be called by VTreeFS. */ -PRIVATE struct fs_hooks hooks = { +static struct fs_hooks hooks = { init_hook, NULL, /* cleanup_hook */ lookup_hook, @@ -19,7 +19,7 @@ PRIVATE struct fs_hooks hooks = { /*===========================================================================* * construct_tree * *===========================================================================*/ -PRIVATE void construct_tree(struct inode *dir, struct file *files) +static void construct_tree(struct inode *dir, struct file *files) { /* Construct a tree of static files from a null-terminated array of * file structures, recursively creating directories which have their @@ -50,7 +50,7 @@ PRIVATE void construct_tree(struct inode *dir, struct file *files) /*===========================================================================* * init_hook * *===========================================================================*/ -PRIVATE void init_hook(void) +static void init_hook(void) { /* Initialization hook. Generate the static part of the tree. */ @@ -69,7 +69,7 @@ PRIVATE void init_hook(void) /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* ProcFS entry point. */ diff --git a/servers/procfs/pid.c b/servers/procfs/pid.c index 179232a6e..a07032994 100644 --- a/servers/procfs/pid.c +++ b/servers/procfs/pid.c @@ -6,18 +6,18 @@ #include #define S_FRAME_SIZE 4096 /* use malloc if larger than this */ -PRIVATE char s_frame[S_FRAME_SIZE]; /* static storage for process frame */ -PRIVATE char *frame; /* pointer to process frame buffer */ +static char s_frame[S_FRAME_SIZE]; /* static storage for process frame */ +static char *frame; /* pointer to process frame buffer */ -FORWARD void pid_psinfo(int slot); -FORWARD void pid_cmdline(int slot); -FORWARD void pid_environ(int slot); -FORWARD void pid_map(int slot); +static void pid_psinfo(int slot); +static void pid_cmdline(int slot); +static void pid_environ(int slot); +static void pid_map(int slot); /* The files that are dynamically created in each PID directory. The data field * contains each file's read function. Subdirectories are not yet supported. */ -PUBLIC struct file pid_files[] = { +struct file pid_files[] = { { "psinfo", REG_ALL_MODE, (data_t) pid_psinfo }, { "cmdline", REG_ALL_MODE, (data_t) pid_cmdline }, { "environ", REG_ALL_MODE, (data_t) pid_environ }, @@ -28,7 +28,7 @@ PUBLIC struct file pid_files[] = { /*===========================================================================* * is_zombie * *===========================================================================*/ -PRIVATE int is_zombie(int slot) +static int is_zombie(int slot) { /* Is the given slot a zombie process? */ @@ -40,7 +40,7 @@ PRIVATE int is_zombie(int slot) /*===========================================================================* * pid_psinfo * *===========================================================================*/ -PRIVATE void pid_psinfo(int i) +static void pid_psinfo(int i) { /* Print information used by ps(1) and top(1). */ @@ -182,7 +182,7 @@ PRIVATE void pid_psinfo(int i) /*===========================================================================* * put_frame * *===========================================================================*/ -PRIVATE void put_frame(void) +static void put_frame(void) { /* If we allocated memory dynamically during a call to get_frame(), * free it up here. @@ -195,7 +195,7 @@ PRIVATE void put_frame(void) /*===========================================================================* * get_frame * *===========================================================================*/ -PRIVATE int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep, +static int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep, size_t *nargsp) { /* Get the execution frame from the top of the given process's stack. @@ -256,7 +256,7 @@ PRIVATE int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep, /*===========================================================================* * pid_cmdline * *===========================================================================*/ -PRIVATE void pid_cmdline(int slot) +static void pid_cmdline(int slot) { /* Dump the process's command line as it is contained in the process * itself. Each argument is terminated with a null character. @@ -288,7 +288,7 @@ PRIVATE void pid_cmdline(int slot) /*===========================================================================* * pid_environ * *===========================================================================*/ -PRIVATE void pid_environ(int slot) +static void pid_environ(int slot) { /* Dump the process's initial environment as it is contained in the * process itself. Each entry is terminated with a null character. @@ -334,7 +334,7 @@ PRIVATE void pid_environ(int slot) /*===========================================================================* * dump_regions * *===========================================================================*/ -PRIVATE int dump_regions(int slot) +static int dump_regions(int slot) { /* Print the virtual memory regions of a process. */ @@ -380,7 +380,7 @@ PRIVATE int dump_regions(int slot) /*===========================================================================* * dump_segments * *===========================================================================*/ -PRIVATE void dump_segments(int slot) +static void dump_segments(int slot) { /* Print the memory segments of a process. */ @@ -400,7 +400,7 @@ PRIVATE void dump_segments(int slot) /*===========================================================================* * pid_map * *===========================================================================*/ -PRIVATE void pid_map(int slot) +static void pid_map(int slot) { /* Print a memory map of the process. Obtain the information from VM if * possible; otherwise fall back on segments from the kernel. diff --git a/servers/procfs/root.c b/servers/procfs/root.c index 4ceeae3d7..6b4f22793 100644 --- a/servers/procfs/root.c +++ b/servers/procfs/root.c @@ -5,13 +5,13 @@ #include #include "cpuinfo.h" -FORWARD void root_hz(void); -FORWARD void root_uptime(void); -FORWARD void root_loadavg(void); -FORWARD void root_kinfo(void); -FORWARD void root_meminfo(void); -FORWARD void root_pci(void); -FORWARD void root_dmap(void); +static void root_hz(void); +static void root_uptime(void); +static void root_loadavg(void); +static void root_kinfo(void); +static void root_meminfo(void); +static void root_pci(void); +static void root_dmap(void); struct file root_files[] = { { "hz", REG_ALL_MODE, (data_t) root_hz }, @@ -28,7 +28,7 @@ struct file root_files[] = { /*===========================================================================* * root_hz * *===========================================================================*/ -PRIVATE void root_hz(void) +static void root_hz(void) { /* Print the system clock frequency. */ @@ -39,7 +39,7 @@ PRIVATE void root_hz(void) /*===========================================================================* * root_loadavg * *===========================================================================*/ -PRIVATE void root_loadavg(void) +static void root_loadavg(void) { /* Print load averages. */ @@ -61,7 +61,7 @@ PRIVATE void root_loadavg(void) /*===========================================================================* * root_uptime * *===========================================================================*/ -PRIVATE void root_uptime(void) +static void root_uptime(void) { /* Print the current uptime. */ @@ -78,7 +78,7 @@ PRIVATE void root_uptime(void) /*===========================================================================* * root_kinfo * *===========================================================================*/ -PRIVATE void root_kinfo(void) +static void root_kinfo(void) { /* Print general kernel information. */ @@ -93,7 +93,7 @@ PRIVATE void root_kinfo(void) /*===========================================================================* * root_meminfo * *===========================================================================*/ -PRIVATE void root_meminfo(void) +static void root_meminfo(void) { /* Print general memory information. */ @@ -109,7 +109,7 @@ PRIVATE void root_meminfo(void) /*===========================================================================* * root_pci * *===========================================================================*/ -PRIVATE void root_pci(void) +static void root_pci(void) { /* Print information about PCI devices present in the system. */ @@ -147,7 +147,7 @@ PRIVATE void root_pci(void) /*===========================================================================* * root_dmap * *===========================================================================*/ -PRIVATE void root_dmap(void) +static void root_dmap(void) { struct dmap dmap[NR_DEVICES]; int i; diff --git a/servers/procfs/tree.c b/servers/procfs/tree.c index eec10f337..cb265cb47 100644 --- a/servers/procfs/tree.c +++ b/servers/procfs/tree.c @@ -2,16 +2,16 @@ #include "inc.h" -PUBLIC struct proc proc[NR_PROCS + NR_TASKS]; -PUBLIC struct mproc mproc[NR_PROCS]; -PUBLIC struct fproc fproc[NR_PROCS]; +struct proc proc[NR_PROCS + NR_TASKS]; +struct mproc mproc[NR_PROCS]; +struct fproc fproc[NR_PROCS]; -PRIVATE int nr_pid_entries; +static int nr_pid_entries; /*===========================================================================* * slot_in_use * *===========================================================================*/ -PRIVATE int slot_in_use(int slot) +static int slot_in_use(int slot) { /* Return whether the given slot is in use by a process. */ @@ -24,7 +24,7 @@ PRIVATE int slot_in_use(int slot) /*===========================================================================* * check_owner * *===========================================================================*/ -PRIVATE int check_owner(struct inode *node, int slot) +static int check_owner(struct inode *node, int slot) { /* Check if the owner user and group ID of the inode are still in sync * the current effective user and group ID of the given process. @@ -42,7 +42,7 @@ PRIVATE int check_owner(struct inode *node, int slot) /*===========================================================================* * make_stat * *===========================================================================*/ -PRIVATE void make_stat(struct inode_stat *stat, int slot, int index) +static void make_stat(struct inode_stat *stat, int slot, int index) { /* Fill in an inode_stat structure for the given process slot and * per-pid file index (or NO_INDEX for the process subdirectory root). @@ -68,7 +68,7 @@ PRIVATE void make_stat(struct inode_stat *stat, int slot, int index) /*===========================================================================* * dir_is_pid * *===========================================================================*/ -PRIVATE int dir_is_pid(struct inode *node) +static int dir_is_pid(struct inode *node) { /* Return whether the given node is a PID directory. */ @@ -80,7 +80,7 @@ PRIVATE int dir_is_pid(struct inode *node) /*===========================================================================* * update_proc_table * *===========================================================================*/ -PRIVATE int update_proc_table(void) +static int update_proc_table(void) { /* Get the process table from the kernel. * Check the magic number in the table entries. @@ -103,7 +103,7 @@ PRIVATE int update_proc_table(void) /*===========================================================================* * update_mproc_table * *===========================================================================*/ -PRIVATE int update_mproc_table(void) +static int update_mproc_table(void) { /* Get the process table from PM. * Check the magic number in the table entries. @@ -127,7 +127,7 @@ PRIVATE int update_mproc_table(void) /*===========================================================================* * update_fproc_table * *===========================================================================*/ -PRIVATE int update_fproc_table(void) +static int update_fproc_table(void) { /* Get the process table from VFS. */ @@ -138,7 +138,7 @@ PRIVATE int update_fproc_table(void) /*===========================================================================* * update_tables * *===========================================================================*/ -PRIVATE int update_tables(void) +static int update_tables(void) { /* Get the process tables from the kernel, PM, and VFS. */ @@ -156,7 +156,7 @@ PRIVATE int update_tables(void) /*===========================================================================* * init_tree * *===========================================================================*/ -PUBLIC int init_tree(void) +int init_tree(void) { /* Initialize this module, before VTreeFS is started. As part of the * process, check if we're not compiled against a kernel different from @@ -181,7 +181,7 @@ PUBLIC int init_tree(void) /*===========================================================================* * out_of_inodes * *===========================================================================*/ -PRIVATE void out_of_inodes(void) +static void out_of_inodes(void) { /* Out of inodes - the NR_INODES value is set too low. We can not do * much, but we might be able to continue with degraded functionality, @@ -201,7 +201,7 @@ PRIVATE void out_of_inodes(void) /*===========================================================================* * construct_pid_dirs * *===========================================================================*/ -PRIVATE void construct_pid_dirs(void) +static void construct_pid_dirs(void) { /* Regenerate the set of PID directories in the root directory of the * file system. Add new directories and delete old directories as @@ -288,7 +288,7 @@ PRIVATE void construct_pid_dirs(void) /*===========================================================================* * make_one_pid_entry * *===========================================================================*/ -PRIVATE void make_one_pid_entry(struct inode *parent, char *name, int slot) +static void make_one_pid_entry(struct inode *parent, char *name, int slot) { /* Construct one file in a PID directory, if a file with the given name * should exist at all. @@ -321,7 +321,7 @@ PRIVATE void make_one_pid_entry(struct inode *parent, char *name, int slot) /*===========================================================================* * make_all_pid_entries * *===========================================================================*/ -PRIVATE void make_all_pid_entries(struct inode *parent, int slot) +static void make_all_pid_entries(struct inode *parent, int slot) { /* Construct all files in a PID directory. */ @@ -347,7 +347,7 @@ PRIVATE void make_all_pid_entries(struct inode *parent, int slot) /*===========================================================================* * construct_pid_entries * *===========================================================================*/ -PRIVATE void construct_pid_entries(struct inode *parent, char *name) +static void construct_pid_entries(struct inode *parent, char *name) { /* Construct one requested file entry, or all file entries, in a PID * directory. @@ -377,7 +377,7 @@ PRIVATE void construct_pid_entries(struct inode *parent, char *name) /*===========================================================================* * pid_read * *===========================================================================*/ -PRIVATE void pid_read(struct inode *node) +static void pid_read(struct inode *node) { /* Data is requested from one of the files in a PID directory. Call the * function that is responsible for generating the data for that file. @@ -402,7 +402,7 @@ PRIVATE void pid_read(struct inode *node) /*===========================================================================* * pid_link * *===========================================================================*/ -PRIVATE int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max)) +static int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max)) { /* The contents of a symbolic link in a PID directory are requested. * This function is a placeholder for future use. @@ -417,7 +417,7 @@ PRIVATE int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max)) /*===========================================================================* * lookup_hook * *===========================================================================*/ -PUBLIC int lookup_hook(struct inode *parent, char *name, +int lookup_hook(struct inode *parent, char *name, cbdata_t UNUSED(cbdata)) { /* Path name resolution hook, for a specific parent and name pair. @@ -464,7 +464,7 @@ PUBLIC int lookup_hook(struct inode *parent, char *name, /*===========================================================================* * getdents_hook * *===========================================================================*/ -PUBLIC int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata)) +int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata)) { /* Directory entry retrieval hook, for potentially all files in a * directory. Make sure that all files that are supposed to be @@ -485,7 +485,7 @@ PUBLIC int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata)) /*===========================================================================* * read_hook * *===========================================================================*/ -PUBLIC int read_hook(struct inode *node, off_t off, char **ptr, +int read_hook(struct inode *node, off_t off, char **ptr, size_t *len, cbdata_t cbdata) { /* Regular file read hook. Call the appropriate callback function to @@ -509,7 +509,7 @@ PUBLIC int read_hook(struct inode *node, off_t off, char **ptr, /*===========================================================================* * rdlink_hook * *===========================================================================*/ -PUBLIC int rdlink_hook(struct inode *node, char *ptr, size_t max, +int rdlink_hook(struct inode *node, char *ptr, size_t max, cbdata_t UNUSED(cbdata)) { /* Symbolic link resolution hook. Not used yet. diff --git a/servers/procfs/util.c b/servers/procfs/util.c index eda7aba27..eeaae9a95 100644 --- a/servers/procfs/util.c +++ b/servers/procfs/util.c @@ -5,7 +5,7 @@ /*===========================================================================* * procfs_getloadavg * *===========================================================================*/ -PUBLIC int procfs_getloadavg(struct load *loadavg, int nelem) +int procfs_getloadavg(struct load *loadavg, int nelem) { /* Retrieve system load average information. */ diff --git a/servers/rs/error.c b/servers/rs/error.c index 088dea463..24d1342df 100644 --- a/servers/rs/error.c +++ b/servers/rs/error.c @@ -12,24 +12,24 @@ struct errentry { }; /* Initialization errors. */ -PRIVATE struct errentry init_errlist[] = { +static struct errentry init_errlist[] = { { ENOSYS, "service does not support the requested initialization type" } }; -PRIVATE const int init_nerr = sizeof(init_errlist) / sizeof(init_errlist[0]); +static const int init_nerr = sizeof(init_errlist) / sizeof(init_errlist[0]); /* Live update errors. */ -PRIVATE struct errentry lu_errlist[] = { +static struct errentry lu_errlist[] = { { ENOSYS, "service does not support live update" }, { EINVAL, "service does not support the required state" }, { EBUSY, "service is not able to prepare for the update now" }, { EGENERIC, "generic error occurred while preparing for the update" } }; -PRIVATE const int lu_nerr = sizeof(lu_errlist) / sizeof(lu_errlist[0]); +static const int lu_nerr = sizeof(lu_errlist) / sizeof(lu_errlist[0]); /*===========================================================================* * rs_strerror * *===========================================================================*/ -PRIVATE char * rs_strerror(int errnum, struct errentry *errlist, const int nerr) +static char * rs_strerror(int errnum, struct errentry *errlist, const int nerr) { int i; @@ -44,7 +44,7 @@ PRIVATE char * rs_strerror(int errnum, struct errentry *errlist, const int nerr) /*===========================================================================* * init_strerror * *===========================================================================*/ -PUBLIC char * init_strerror(int errnum) +char * init_strerror(int errnum) { return rs_strerror(errnum, init_errlist, init_nerr); } @@ -52,7 +52,7 @@ PUBLIC char * init_strerror(int errnum) /*===========================================================================* * lu_strerror * *===========================================================================*/ -PUBLIC char * lu_strerror(int errnum) +char * lu_strerror(int errnum) { return rs_strerror(errnum, lu_errlist, lu_nerr); } diff --git a/servers/rs/main.c b/servers/rs/main.c index a2c9b392b..f7e0e910c 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -15,23 +15,23 @@ #include "kernel/proc.h" /* Declare some local functions. */ -FORWARD void boot_image_info_lookup( endpoint_t endpoint, struct +static void boot_image_info_lookup( endpoint_t endpoint, struct boot_image *image, struct boot_image **ip, struct boot_image_priv **pp, struct boot_image_sys **sp, struct boot_image_dev **dp); -FORWARD void catch_boot_init_ready(endpoint_t endpoint); -FORWARD void get_work(message *m_ptr, int *status_ptr); +static void catch_boot_init_ready(endpoint_t endpoint); +static void get_work(message *m_ptr, int *status_ptr); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); -FORWARD int sef_cb_signal_manager(endpoint_t target, int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); +static int sef_cb_signal_manager(endpoint_t target, int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* This is the main routine of this service. The main loop consists of * three major activities: getting new work, processing the work, and @@ -134,7 +134,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_response(do_init_ready); @@ -155,7 +155,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the reincarnation server. */ struct boot_image *ip; @@ -483,7 +483,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Check for known signals, ignore anything else. */ switch(signo) { @@ -499,7 +499,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * sef_cb_signal_manager * *===========================================================================*/ -PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo) +static int sef_cb_signal_manager(endpoint_t target, int signo) { /* Process system signal on behalf of the kernel. */ int target_p; @@ -558,7 +558,7 @@ PRIVATE int sef_cb_signal_manager(endpoint_t target, int signo) /*===========================================================================* * boot_image_info_lookup * *===========================================================================*/ -PRIVATE void boot_image_info_lookup(endpoint, image, ip, pp, sp, dp) +static void boot_image_info_lookup(endpoint, image, ip, pp, sp, dp) endpoint_t endpoint; struct boot_image *image; struct boot_image **ip; @@ -633,7 +633,7 @@ struct boot_image_dev **dp; /*===========================================================================* * catch_boot_init_ready * *===========================================================================*/ -PRIVATE void catch_boot_init_ready(endpoint) +static void catch_boot_init_ready(endpoint) endpoint_t endpoint; { /* Block and catch an init ready message from the given source. */ @@ -671,7 +671,7 @@ endpoint_t endpoint; /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_ptr, status_ptr) +static void get_work(m_ptr, status_ptr) message *m_ptr; /* pointer to message */ int *status_ptr; /* pointer to status */ { diff --git a/servers/rs/manager.c b/servers/rs/manager.c index b524a06de..ebf1c28fc 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -12,7 +12,7 @@ /*===========================================================================* * caller_is_root * *===========================================================================*/ -PRIVATE int caller_is_root(endpoint) +static int caller_is_root(endpoint) endpoint_t endpoint; /* caller endpoint */ { uid_t euid; @@ -30,7 +30,7 @@ endpoint_t endpoint; /* caller endpoint */ /*===========================================================================* * caller_can_control * *===========================================================================*/ -PRIVATE int caller_can_control(endpoint, target_rp) +static int caller_can_control(endpoint, target_rp) endpoint_t endpoint; struct rproc *target_rp; { @@ -72,7 +72,7 @@ struct rproc *target_rp; /*===========================================================================* * check_call_permission * *===========================================================================*/ -PUBLIC int check_call_permission(caller, call, rp) +int check_call_permission(caller, call, rp) endpoint_t caller; int call; struct rproc *rp; @@ -121,7 +121,7 @@ struct rproc *rp; /*===========================================================================* * copy_rs_start * *===========================================================================*/ -PUBLIC int copy_rs_start(src_e, src_rs_start, dst_rs_start) +int copy_rs_start(src_e, src_rs_start, dst_rs_start) endpoint_t src_e; char *src_rs_start; struct rs_start *dst_rs_start; @@ -137,7 +137,7 @@ struct rs_start *dst_rs_start; /*===========================================================================* * copy_label * *===========================================================================*/ -PUBLIC int copy_label(src_e, src_label, src_len, dst_label, dst_len) +int copy_label(src_e, src_label, src_len, dst_label, dst_len) endpoint_t src_e; char *src_label; size_t src_len; @@ -160,7 +160,7 @@ size_t dst_len; /*===========================================================================* * build_cmd_dep * *===========================================================================*/ -PUBLIC void build_cmd_dep(struct rproc *rp) +void build_cmd_dep(struct rproc *rp) { struct rprocpub *rpub; int arg_count; @@ -211,7 +211,7 @@ PUBLIC void build_cmd_dep(struct rproc *rp) /*===========================================================================* * srv_fork * *===========================================================================*/ -PUBLIC pid_t srv_fork(uid_t reuid, gid_t regid) +pid_t srv_fork(uid_t reuid, gid_t regid) { message m; @@ -223,7 +223,7 @@ PUBLIC pid_t srv_fork(uid_t reuid, gid_t regid) /*===========================================================================* * srv_kill * *===========================================================================*/ -PUBLIC int srv_kill(pid_t pid, int sig) +int srv_kill(pid_t pid, int sig) { message m; @@ -235,7 +235,7 @@ PUBLIC int srv_kill(pid_t pid, int sig) /*===========================================================================* * srv_update * *===========================================================================*/ -PUBLIC int srv_update(endpoint_t src_e, endpoint_t dst_e) +int srv_update(endpoint_t src_e, endpoint_t dst_e) { int r; @@ -257,7 +257,7 @@ PUBLIC int srv_update(endpoint_t src_e, endpoint_t dst_e) /*===========================================================================* * update_period * *===========================================================================*/ -PUBLIC void update_period(message *m_ptr) +void update_period(message *m_ptr) { clock_t now = m_ptr->NOTIFY_TIMESTAMP; short has_update_timed_out; @@ -294,7 +294,7 @@ PUBLIC void update_period(message *m_ptr) /*===========================================================================* * end_update * *===========================================================================*/ -PUBLIC void end_update(int result, int reply_flag) +void end_update(int result, int reply_flag) { /* End the update process. There are two possibilities: * 1) the update succeeded. In that case, cleanup the old version and mark the @@ -353,7 +353,7 @@ PUBLIC void end_update(int result, int reply_flag) /*===========================================================================* * kill_service_debug * *===========================================================================*/ -PUBLIC int kill_service_debug(file, line, rp, errstr, err) +int kill_service_debug(file, line, rp, errstr, err) char *file; int line; struct rproc *rp; @@ -373,7 +373,7 @@ int err; /*===========================================================================* * crash_service_debug * *===========================================================================*/ -PUBLIC int crash_service_debug(file, line, rp) +int crash_service_debug(file, line, rp) char *file; int line; struct rproc *rp; @@ -398,7 +398,7 @@ struct rproc *rp; /*===========================================================================* * cleanup_service_debug * *===========================================================================*/ -PUBLIC void cleanup_service_debug(file, line, rp) +void cleanup_service_debug(file, line, rp) char *file; int line; struct rproc *rp; @@ -433,7 +433,7 @@ struct rproc *rp; /*===========================================================================* * create_service * *===========================================================================*/ -PUBLIC int create_service(rp) +int create_service(rp) struct rproc *rp; { /* Create the given system service. */ @@ -576,7 +576,7 @@ struct rproc *rp; /*===========================================================================* * clone_service * *===========================================================================*/ -PUBLIC int clone_service(rp, instance_flag) +int clone_service(rp, instance_flag) struct rproc *rp; int instance_flag; { @@ -642,7 +642,7 @@ int instance_flag; /*===========================================================================* * publish_service * *===========================================================================*/ -PUBLIC int publish_service(rp) +int publish_service(rp) struct rproc *rp; /* pointer to service slot */ { /* Publish a service. */ @@ -717,7 +717,7 @@ struct rproc *rp; /* pointer to service slot */ /*===========================================================================* * unpublish_service * *===========================================================================*/ -PUBLIC int unpublish_service(rp) +int unpublish_service(rp) struct rproc *rp; /* pointer to service slot */ { /* Unpublish a service. */ @@ -774,7 +774,7 @@ struct rproc *rp; /* pointer to service slot */ /*===========================================================================* * run_service * *===========================================================================*/ -PUBLIC int run_service(rp, init_type) +int run_service(rp, init_type) struct rproc *rp; int init_type; { @@ -803,7 +803,7 @@ int init_type; /*===========================================================================* * start_service * *===========================================================================*/ -PUBLIC int start_service(rp) +int start_service(rp) struct rproc *rp; { /* Start a system service. */ @@ -842,7 +842,7 @@ struct rproc *rp; /*===========================================================================* * stop_service * *===========================================================================*/ -PUBLIC void stop_service(struct rproc *rp,int how) +void stop_service(struct rproc *rp,int how) { struct rprocpub *rpub; int signo; @@ -867,7 +867,7 @@ PUBLIC void stop_service(struct rproc *rp,int how) /*===========================================================================* * update_service * *===========================================================================*/ -PUBLIC int update_service(src_rpp, dst_rpp, swap_flag) +int update_service(src_rpp, dst_rpp, swap_flag) struct rproc **src_rpp; struct rproc **dst_rpp; int swap_flag; @@ -927,7 +927,7 @@ int swap_flag; /*===========================================================================* * activate_service * *===========================================================================*/ -PUBLIC void activate_service(struct rproc *rp, struct rproc *ex_rp) +void activate_service(struct rproc *rp, struct rproc *ex_rp) { /* Activate a service instance and deactivate another one if requested. */ @@ -947,7 +947,7 @@ PUBLIC void activate_service(struct rproc *rp, struct rproc *ex_rp) /*===========================================================================* * reincarnate_service * *===========================================================================*/ -PUBLIC void reincarnate_service(struct rproc *rp) +void reincarnate_service(struct rproc *rp) { /* Restart a service as if it were never started before. */ struct rprocpub *rpub; @@ -981,7 +981,7 @@ PUBLIC void reincarnate_service(struct rproc *rp) /*===========================================================================* * terminate_service * *===========================================================================*/ -PUBLIC void terminate_service(struct rproc *rp) +void terminate_service(struct rproc *rp) { /* Handle a termination event for a system service. */ struct rproc **rps; @@ -1074,7 +1074,7 @@ PUBLIC void terminate_service(struct rproc *rp) /*===========================================================================* * run_script * *===========================================================================*/ -PRIVATE int run_script(struct rproc *rp) +static int run_script(struct rproc *rp) { int r, endpoint; pid_t pid; @@ -1129,7 +1129,7 @@ PRIVATE int run_script(struct rproc *rp) /*===========================================================================* * restart_service * *===========================================================================*/ -PUBLIC void restart_service(struct rproc *rp) +void restart_service(struct rproc *rp) { /* Restart service via a recovery script or directly. */ struct rproc *replica_rp; @@ -1186,7 +1186,7 @@ PUBLIC void restart_service(struct rproc *rp) /*===========================================================================* * inherit_service_defaults * *===========================================================================*/ -PUBLIC void inherit_service_defaults(def_rp, rp) +void inherit_service_defaults(def_rp, rp) struct rproc *def_rp; struct rproc *rp; { @@ -1216,7 +1216,7 @@ struct rproc *rp; /*===========================================================================* * get_service_instances * *===========================================================================*/ -PUBLIC void get_service_instances(rp, rps, length) +void get_service_instances(rp, rps, length) struct rproc *rp; struct rproc ***rps; int *length; @@ -1239,7 +1239,7 @@ int *length; /*===========================================================================* * share_exec * *===========================================================================*/ -PUBLIC void share_exec(rp_dst, rp_src) +void share_exec(rp_dst, rp_src) struct rproc *rp_dst, *rp_src; { struct rprocpub *rpub_src; @@ -1260,7 +1260,7 @@ struct rproc *rp_dst, *rp_src; /*===========================================================================* * read_exec * *===========================================================================*/ -PUBLIC int read_exec(rp) +int read_exec(rp) struct rproc *rp; { int e, r, fd; @@ -1309,7 +1309,7 @@ struct rproc *rp; /*===========================================================================* * free_exec * *===========================================================================*/ -PUBLIC void free_exec(rp) +void free_exec(rp) struct rproc *rp; { /* Free an exec image. */ @@ -1345,7 +1345,7 @@ struct rproc *rp; /*===========================================================================* * edit_slot * *===========================================================================*/ -PUBLIC int edit_slot(rp, rs_start, source) +int edit_slot(rp, rs_start, source) struct rproc *rp; struct rs_start *rs_start; endpoint_t source; @@ -1559,7 +1559,7 @@ endpoint_t source; /*===========================================================================* * init_slot * *===========================================================================*/ -PUBLIC int init_slot(rp, rs_start, source) +int init_slot(rp, rs_start, source) struct rproc *rp; struct rs_start *rs_start; endpoint_t source; @@ -1641,7 +1641,7 @@ endpoint_t source; /*===========================================================================* * clone_slot * *===========================================================================*/ -PUBLIC int clone_slot(rp, clone_rpp) +int clone_slot(rp, clone_rpp) struct rproc *rp; struct rproc **clone_rpp; { @@ -1695,7 +1695,7 @@ struct rproc **clone_rpp; /*===========================================================================* * swap_slot_pointer * *===========================================================================*/ -PRIVATE void swap_slot_pointer(struct rproc **rpp, struct rproc *src_rp, +static void swap_slot_pointer(struct rproc **rpp, struct rproc *src_rp, struct rproc *dst_rp) { if(*rpp == src_rp) { @@ -1709,7 +1709,7 @@ PRIVATE void swap_slot_pointer(struct rproc **rpp, struct rproc *src_rp, /*===========================================================================* * swap_slot * *===========================================================================*/ -PUBLIC void swap_slot(src_rpp, dst_rpp) +void swap_slot(src_rpp, dst_rpp) struct rproc **src_rpp; struct rproc **dst_rpp; { @@ -1771,7 +1771,7 @@ struct rproc **dst_rpp; /*===========================================================================* * lookup_slot_by_label * *===========================================================================*/ -PUBLIC struct rproc* lookup_slot_by_label(char *label) +struct rproc* lookup_slot_by_label(char *label) { /* Lookup a service slot matching the given label. */ int slot_nr; @@ -1795,7 +1795,7 @@ PUBLIC struct rproc* lookup_slot_by_label(char *label) /*===========================================================================* * lookup_slot_by_pid * *===========================================================================*/ -PUBLIC struct rproc* lookup_slot_by_pid(pid_t pid) +struct rproc* lookup_slot_by_pid(pid_t pid) { /* Lookup a service slot matching the given pid. */ int slot_nr; @@ -1821,7 +1821,7 @@ PUBLIC struct rproc* lookup_slot_by_pid(pid_t pid) /*===========================================================================* * lookup_slot_by_dev_nr * *===========================================================================*/ -PUBLIC struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr) +struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr) { /* Lookup a service slot matching the given device number. */ int slot_nr; @@ -1849,7 +1849,7 @@ PUBLIC struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr) /*===========================================================================* * lookup_slot_by_flags * *===========================================================================*/ -PUBLIC struct rproc* lookup_slot_by_flags(int flags) +struct rproc* lookup_slot_by_flags(int flags) { /* Lookup a service slot matching the given flags. */ int slot_nr; @@ -1875,7 +1875,7 @@ PUBLIC struct rproc* lookup_slot_by_flags(int flags) /*===========================================================================* * alloc_slot * *===========================================================================*/ -PUBLIC int alloc_slot(rpp) +int alloc_slot(rpp) struct rproc **rpp; { /* Alloc a new system service slot. */ @@ -1896,7 +1896,7 @@ struct rproc **rpp; /*===========================================================================* * free_slot * *===========================================================================*/ -PUBLIC void free_slot(rp) +void free_slot(rp) struct rproc *rp; { /* Free a system service slot. */ @@ -1923,7 +1923,7 @@ struct rproc *rp; /*===========================================================================* * get_next_name * *===========================================================================*/ -PRIVATE char *get_next_name(ptr, name, caller_label) +static char *get_next_name(ptr, name, caller_label) char *ptr; char *name; char *caller_label; @@ -1965,7 +1965,7 @@ char *caller_label; /*===========================================================================* * add_forward_ipc * *===========================================================================*/ -PUBLIC void add_forward_ipc(rp, privp) +void add_forward_ipc(rp, privp) struct rproc *rp; struct priv *privp; { @@ -2038,7 +2038,7 @@ struct priv *privp; /*===========================================================================* * add_backward_ipc * *===========================================================================*/ -PUBLIC void add_backward_ipc(rp, privp) +void add_backward_ipc(rp, privp) struct rproc *rp; struct priv *privp; { @@ -2108,7 +2108,7 @@ struct priv *privp; /*===========================================================================* * init_privs * *===========================================================================*/ -PUBLIC void init_privs(rp, privp) +void init_privs(rp, privp) struct rproc *rp; struct priv *privp; { diff --git a/servers/rs/memory.c b/servers/rs/memory.c index 7d13bbe07..76bfc99dc 100644 --- a/servers/rs/memory.c +++ b/servers/rs/memory.c @@ -12,12 +12,12 @@ #undef minix_munmap #undef minix_munmap_text -PUBLIC int unmap_ok = 0; +int unmap_ok = 0; /*===========================================================================* * minix_munmap * *===========================================================================*/ -PUBLIC int minix_munmap(void *addrstart, vir_bytes len) +int minix_munmap(void *addrstart, vir_bytes len) { if(!unmap_ok) return ENOSYS; @@ -28,7 +28,7 @@ PUBLIC int minix_munmap(void *addrstart, vir_bytes len) /*===========================================================================* * minix_munmap_text * *===========================================================================*/ -PUBLIC int minix_munmap_text(void *addrstart, vir_bytes len) +int minix_munmap_text(void *addrstart, vir_bytes len) { if(!unmap_ok) return ENOSYS; diff --git a/servers/rs/request.c b/servers/rs/request.c index 6fd5d74cb..54628eac7 100755 --- a/servers/rs/request.c +++ b/servers/rs/request.c @@ -7,12 +7,12 @@ #include "kernel/proc.h" -FORWARD int check_request(struct rs_start *rs_start); +static int check_request(struct rs_start *rs_start); /*===========================================================================* * do_up * *===========================================================================*/ -PUBLIC int do_up(m_ptr) +int do_up(m_ptr) message *m_ptr; /* request message pointer */ { /* A request was made to start a new system service. */ @@ -86,7 +86,7 @@ message *m_ptr; /* request message pointer */ /*===========================================================================* * do_down * *===========================================================================*/ -PUBLIC int do_down(message *m_ptr) +int do_down(message *m_ptr) { register struct rproc *rp; register struct rprocpub *rpub; @@ -137,7 +137,7 @@ PUBLIC int do_down(message *m_ptr) /*===========================================================================* * do_restart * *===========================================================================*/ -PUBLIC int do_restart(message *m_ptr) +int do_restart(message *m_ptr) { struct rproc *rp; int s, r; @@ -185,7 +185,7 @@ PUBLIC int do_restart(message *m_ptr) /*===========================================================================* * do_clone * *===========================================================================*/ -PUBLIC int do_clone(message *m_ptr) +int do_clone(message *m_ptr) { struct rproc *rp; struct rprocpub *rpub; @@ -230,7 +230,7 @@ PUBLIC int do_clone(message *m_ptr) /*===========================================================================* * do_edit * *===========================================================================*/ -PUBLIC int do_edit(message *m_ptr) +int do_edit(message *m_ptr) { struct rproc *rp; struct rprocpub *rpub; @@ -321,7 +321,7 @@ PUBLIC int do_edit(message *m_ptr) /*===========================================================================* * do_refresh * *===========================================================================*/ -PUBLIC int do_refresh(message *m_ptr) +int do_refresh(message *m_ptr) { register struct rproc *rp; register struct rprocpub *rpub; @@ -359,7 +359,7 @@ PUBLIC int do_refresh(message *m_ptr) /*===========================================================================* * do_shutdown * *===========================================================================*/ -PUBLIC int do_shutdown(message *m_ptr) +int do_shutdown(message *m_ptr) { int slot_nr; struct rproc *rp; @@ -390,7 +390,7 @@ PUBLIC int do_shutdown(message *m_ptr) /*===========================================================================* * do_init_ready * *===========================================================================*/ -PUBLIC int do_init_ready(message *m_ptr) +int do_init_ready(message *m_ptr) { int who_p; message m; @@ -480,7 +480,7 @@ PUBLIC int do_init_ready(message *m_ptr) /*===========================================================================* * do_update * *===========================================================================*/ -PUBLIC int do_update(message *m_ptr) +int do_update(message *m_ptr) { struct rproc *rp; struct rproc *new_rp; @@ -651,7 +651,7 @@ PUBLIC int do_update(message *m_ptr) /*===========================================================================* * do_upd_ready * *===========================================================================*/ -PUBLIC int do_upd_ready(message *m_ptr) +int do_upd_ready(message *m_ptr) { struct rproc *rp, *old_rp, *new_rp; int who_p; @@ -728,7 +728,7 @@ PUBLIC int do_upd_ready(message *m_ptr) /*===========================================================================* * do_period * *===========================================================================*/ -PUBLIC void do_period(m_ptr) +void do_period(m_ptr) message *m_ptr; { register struct rproc *rp; @@ -826,7 +826,7 @@ message *m_ptr; /*===========================================================================* * do_sigchld * *===========================================================================*/ -PUBLIC void do_sigchld() +void do_sigchld() { /* PM informed us that there are dead children to cleanup. Go get them. */ pid_t pid; @@ -867,7 +867,7 @@ PUBLIC void do_sigchld() /*===========================================================================* * do_getsysinfo * *===========================================================================*/ -PUBLIC int do_getsysinfo(m_ptr) +int do_getsysinfo(m_ptr) message *m_ptr; { vir_bytes src_addr, dst_addr; @@ -903,7 +903,7 @@ message *m_ptr; /*===========================================================================* * do_lookup * *===========================================================================*/ -PUBLIC int do_lookup(m_ptr) +int do_lookup(m_ptr) message *m_ptr; { static char namebuf[100]; @@ -940,7 +940,7 @@ message *m_ptr; /*===========================================================================* * check_request * *===========================================================================*/ -PRIVATE int check_request(struct rs_start *rs_start) +static int check_request(struct rs_start *rs_start) { /* Verify scheduling parameters */ if (rs_start->rss_scheduler != KERNEL && diff --git a/servers/rs/table.c b/servers/rs/table.c index 35f1134f5..4bcb40dfb 100644 --- a/servers/rs/table.c +++ b/servers/rs/table.c @@ -12,7 +12,7 @@ * reflects the order boot system services are made runnable and initialized * at boot time. */ -PUBLIC struct boot_image_priv boot_image_priv_table[] = { +struct boot_image_priv boot_image_priv_table[] = { /*endpoint, label, flags, */ {RS_PROC_NR, "rs", RSYS_F }, {VM_PROC_NR, "vm", VM_F }, @@ -30,7 +30,7 @@ PUBLIC struct boot_image_priv boot_image_priv_table[] = { }; /* Definition of the boot image sys table. */ -PUBLIC struct boot_image_sys boot_image_sys_table[] = { +struct boot_image_sys boot_image_sys_table[] = { /*endpoint, flags */ { RS_PROC_NR, SRVR_SF }, { VM_PROC_NR, VM_SF }, @@ -43,7 +43,7 @@ PUBLIC struct boot_image_sys boot_image_sys_table[] = { }; /* Definition of the boot image dev table. */ -PUBLIC struct boot_image_dev boot_image_dev_table[] = { +struct boot_image_dev boot_image_dev_table[] = { /*endpoint, flags, dev_nr, dev_style, dev_style2 */ { TTY_PROC_NR, SRV_DF, TTY_MAJOR, STYLE_TTY, STYLE_CTTY }, { MEM_PROC_NR, SRV_DF, MEMORY_MAJOR, STYLE_DEV, STYLE_NDEV }, diff --git a/servers/rs/utility.c b/servers/rs/utility.c index eba9ae3ba..03b3d8ebc 100644 --- a/servers/rs/utility.c +++ b/servers/rs/utility.c @@ -13,7 +13,7 @@ /*===========================================================================* * init_service * *===========================================================================*/ -PUBLIC int init_service(rp, type) +int init_service(rp, type) struct rproc *rp; /* pointer to process slot */ int type; /* type of initialization */ { @@ -54,7 +54,7 @@ int type; /* type of initialization */ /*===========================================================================* * fill_send_mask * *===========================================================================*/ -PUBLIC void fill_send_mask(send_mask, set_bits) +void fill_send_mask(send_mask, set_bits) sys_map_t *send_mask; /* the send mask to fill in */ int set_bits; /* TRUE sets all bits, FALSE clears all bits */ { @@ -72,7 +72,7 @@ int set_bits; /* TRUE sets all bits, FALSE clears all bits */ /*===========================================================================* * fill_call_mask * *===========================================================================*/ -PUBLIC void fill_call_mask(calls, tot_nr_calls, call_mask, call_base, is_init) +void fill_call_mask(calls, tot_nr_calls, call_mask, call_base, is_init) int *calls; /* the unordered set of calls */ int tot_nr_calls; /* the total number of calls */ bitchunk_t *call_mask; /* the call mask to fill in */ @@ -114,7 +114,7 @@ int is_init; /* set when initializing a call mask */ /*===========================================================================* * srv_to_string * *===========================================================================*/ -PUBLIC char* srv_to_string(rp) +char* srv_to_string(rp) struct rproc *rp; /* pointer to process slot */ { struct rprocpub *rpub; @@ -152,7 +152,7 @@ struct rproc *rp; /* pointer to process slot */ /*===========================================================================* * reply * *===========================================================================*/ -PUBLIC void reply(who, rp, m_ptr) +void reply(who, rp, m_ptr) endpoint_t who; /* replyee */ struct rproc *rp; /* replyee slot (if any) */ message *m_ptr; /* reply message */ @@ -175,7 +175,7 @@ message *m_ptr; /* reply message */ /*===========================================================================* * late_reply * *===========================================================================*/ -PUBLIC void late_reply(rp, code) +void late_reply(rp, code) struct rproc *rp; /* pointer to process slot */ int code; /* status code */ { @@ -199,7 +199,7 @@ int code; /* status code */ /*===========================================================================* * rs_isokendpt * *===========================================================================*/ -PUBLIC int rs_isokendpt(endpoint_t endpoint, int *proc) +int rs_isokendpt(endpoint_t endpoint, int *proc) { *proc = _ENDPOINT_P(endpoint); if(*proc < -NR_TASKS || *proc >= NR_PROCS) @@ -211,7 +211,7 @@ PUBLIC int rs_isokendpt(endpoint_t endpoint, int *proc) /*===========================================================================* * sched_init_proc * *===========================================================================*/ -PUBLIC int sched_init_proc(struct rproc *rp) +int sched_init_proc(struct rproc *rp) { int s; int is_usr_proc; @@ -234,7 +234,7 @@ PUBLIC int sched_init_proc(struct rproc *rp) /*===========================================================================* * update_sig_mgrs * *===========================================================================*/ -PUBLIC int update_sig_mgrs(struct rproc *rp, endpoint_t sig_mgr, +int update_sig_mgrs(struct rproc *rp, endpoint_t sig_mgr, endpoint_t bak_sig_mgr) { int r; diff --git a/servers/sched/main.c b/servers/sched/main.c index df5253f6c..18f0dc246 100644 --- a/servers/sched/main.c +++ b/servers/sched/main.c @@ -10,15 +10,15 @@ #include "schedproc.h" /* Declare some local functions. */ -FORWARD void reply(endpoint_t whom, message *m_ptr); -FORWARD void sef_local_startup(void); +static void reply(endpoint_t whom, message *m_ptr); +static void sef_local_startup(void); -PUBLIC struct machine machine; /* machine info */ +struct machine machine; /* machine info */ /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* Main routine of the scheduler. */ message m_in; /* the incoming message itself is kept here. */ @@ -104,7 +104,7 @@ sendreply: /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply(endpoint_t who_e, message *m_ptr) +static void reply(endpoint_t who_e, message *m_ptr) { int s = send(who_e, m_ptr); /* send the message */ if (OK != s) @@ -114,7 +114,7 @@ PRIVATE void reply(endpoint_t who_e, message *m_ptr) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* No init callbacks for now. */ /* No live update support for now. */ diff --git a/servers/sched/schedule.c b/servers/sched/schedule.c index ea7a9a49c..65fd5523c 100644 --- a/servers/sched/schedule.c +++ b/servers/sched/schedule.c @@ -14,13 +14,13 @@ #include #include "kernel/proc.h" /* for queue constants */ -PRIVATE timer_t sched_timer; -PRIVATE unsigned balance_timeout; +static timer_t sched_timer; +static unsigned balance_timeout; #define BALANCE_TIMEOUT 5 /* how often to balance queues in seconds */ -FORWARD int schedule_process(struct schedproc * rmp, unsigned flags); -FORWARD void balance_queues(struct timer *tp); +static int schedule_process(struct schedproc * rmp, unsigned flags); +static void balance_queues(struct timer *tp); #define SCHEDULE_CHANGE_PRIO 0x1 #define SCHEDULE_CHANGE_QUANTUM 0x2 @@ -46,9 +46,9 @@ FORWARD void balance_queues(struct timer *tp); /* processes created by RS are sysytem processes */ #define is_system_proc(p) ((p)->parent == RS_PROC_NR) -PRIVATE unsigned cpu_proc[CONFIG_MAX_CPUS]; +static unsigned cpu_proc[CONFIG_MAX_CPUS]; -PRIVATE void pick_cpu(struct schedproc * proc) +static void pick_cpu(struct schedproc * proc) { #ifdef CONFIG_SMP unsigned cpu, c; @@ -87,7 +87,7 @@ PRIVATE void pick_cpu(struct schedproc * proc) * do_noquantum * *===========================================================================*/ -PUBLIC int do_noquantum(message *m_ptr) +int do_noquantum(message *m_ptr) { register struct schedproc *rmp; int rv, proc_nr_n; @@ -112,7 +112,7 @@ PUBLIC int do_noquantum(message *m_ptr) /*===========================================================================* * do_stop_scheduling * *===========================================================================*/ -PUBLIC int do_stop_scheduling(message *m_ptr) +int do_stop_scheduling(message *m_ptr) { register struct schedproc *rmp; int proc_nr_n; @@ -139,7 +139,7 @@ PUBLIC int do_stop_scheduling(message *m_ptr) /*===========================================================================* * do_start_scheduling * *===========================================================================*/ -PUBLIC int do_start_scheduling(message *m_ptr) +int do_start_scheduling(message *m_ptr) { register struct schedproc *rmp; int rv, proc_nr_n, parent_nr_n; @@ -253,7 +253,7 @@ PUBLIC int do_start_scheduling(message *m_ptr) /*===========================================================================* * do_nice * *===========================================================================*/ -PUBLIC int do_nice(message *m_ptr) +int do_nice(message *m_ptr) { struct schedproc *rmp; int rv; @@ -296,7 +296,7 @@ PUBLIC int do_nice(message *m_ptr) /*===========================================================================* * schedule_process * *===========================================================================*/ -PRIVATE int schedule_process(struct schedproc * rmp, unsigned flags) +static int schedule_process(struct schedproc * rmp, unsigned flags) { int err; int new_prio, new_quantum, new_cpu; @@ -332,7 +332,7 @@ PRIVATE int schedule_process(struct schedproc * rmp, unsigned flags) * start_scheduling * *===========================================================================*/ -PUBLIC void init_scheduling(void) +void init_scheduling(void) { balance_timeout = BALANCE_TIMEOUT * sys_hz(); init_timer(&sched_timer); @@ -348,7 +348,7 @@ PUBLIC void init_scheduling(void) * quantum. This function will find all proccesses that have been bumped down, * and pulls them back up. This default policy will soon be changed. */ -PRIVATE void balance_queues(struct timer *tp) +static void balance_queues(struct timer *tp) { struct schedproc *rmp; int proc_nr; diff --git a/servers/sched/utility.c b/servers/sched/utility.c index 6ffa6f8ec..3755ad1e1 100644 --- a/servers/sched/utility.c +++ b/servers/sched/utility.c @@ -16,7 +16,7 @@ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys(int who_e, int call_nr) +int no_sys(int who_e, int call_nr) { /* A system call number not implemented by PM has been requested. */ printf("SCHED: in no_sys, call nr %d from %d\n", call_nr, who_e); @@ -27,7 +27,7 @@ PUBLIC int no_sys(int who_e, int call_nr) /*===========================================================================* * sched_isokendpt * *===========================================================================*/ -PUBLIC int sched_isokendpt(int endpoint, int *proc) +int sched_isokendpt(int endpoint, int *proc) { *proc = _ENDPOINT_P(endpoint); if (*proc < 0) @@ -44,7 +44,7 @@ PUBLIC int sched_isokendpt(int endpoint, int *proc) /*===========================================================================* * sched_isemtyendpt * *===========================================================================*/ -PUBLIC int sched_isemtyendpt(int endpoint, int *proc) +int sched_isemtyendpt(int endpoint, int *proc) { *proc = _ENDPOINT_P(endpoint); if (*proc < 0) @@ -59,7 +59,7 @@ PUBLIC int sched_isemtyendpt(int endpoint, int *proc) /*===========================================================================* * accept_message * *===========================================================================*/ -PUBLIC int accept_message(message *m_ptr) +int accept_message(message *m_ptr) { /* accept all messages from PM and RS */ switch (m_ptr->m_source) { diff --git a/servers/vfs/comm.c b/servers/vfs/comm.c index 662a407d8..17aec50ba 100644 --- a/servers/vfs/comm.c +++ b/servers/vfs/comm.c @@ -5,13 +5,13 @@ #include #include -FORWARD int sendmsg(struct vmnt *vmp, struct fproc *rfp); -FORWARD int queuemsg(struct vmnt *vmp); +static int sendmsg(struct vmnt *vmp, struct fproc *rfp); +static int queuemsg(struct vmnt *vmp); /*===========================================================================* * sendmsg * *===========================================================================*/ -PRIVATE int sendmsg(vmp, rfp) +static int sendmsg(vmp, rfp) struct vmnt *vmp; struct fproc *rfp; { @@ -39,7 +39,7 @@ struct fproc *rfp; /*===========================================================================* * send_work * *===========================================================================*/ -PUBLIC void send_work(void) +void send_work(void) { /* Try to send out as many requests as possible */ struct vmnt *vmp; @@ -52,7 +52,7 @@ PUBLIC void send_work(void) /*===========================================================================* * fs_cancel * *===========================================================================*/ -PUBLIC void fs_cancel(struct vmnt *vmp) +void fs_cancel(struct vmnt *vmp) { /* Cancel all pending requests for this vmp */ struct worker_thread *worker; @@ -68,7 +68,7 @@ PUBLIC void fs_cancel(struct vmnt *vmp) /*===========================================================================* * fs_sendmore * *===========================================================================*/ -PUBLIC void fs_sendmore(struct vmnt *vmp) +void fs_sendmore(struct vmnt *vmp) { struct worker_thread *worker; @@ -91,7 +91,7 @@ PUBLIC void fs_sendmore(struct vmnt *vmp) /*===========================================================================* * fs_sendrec * *===========================================================================*/ -PUBLIC int fs_sendrec(endpoint_t fs_e, message *reqmp) +int fs_sendrec(endpoint_t fs_e, message *reqmp) { struct vmnt *vmp; int r; @@ -156,7 +156,7 @@ PUBLIC int fs_sendrec(endpoint_t fs_e, message *reqmp) /*===========================================================================* * queuemsg * *===========================================================================*/ -PRIVATE int queuemsg(struct vmnt *vmp) +static int queuemsg(struct vmnt *vmp) { /* Put request on queue for vmnt */ diff --git a/servers/vfs/coredump.c b/servers/vfs/coredump.c index 8e98ef929..2f2f771a6 100644 --- a/servers/vfs/coredump.c +++ b/servers/vfs/coredump.c @@ -10,27 +10,27 @@ /* Include ELF headers */ #include -FORWARD void fill_elf_header(Elf32_Ehdr *elf_header, int phnum); -FORWARD void fill_prog_header(Elf32_Phdr *prog_header, Elf32_Word +static void fill_elf_header(Elf32_Ehdr *elf_header, int phnum); +static void fill_prog_header(Elf32_Phdr *prog_header, Elf32_Word p_type, Elf32_Off p_offset, Elf32_Addr p_vaddr, Elf32_Word p_flags, Elf32_Word p_filesz, Elf32_Word p_memsz); -FORWARD int get_memory_regions(Elf32_Phdr phdrs[]); -FORWARD void fill_note_segment_and_entries_hdrs(Elf32_Phdr phdrs[], +static int get_memory_regions(Elf32_Phdr phdrs[]); +static void fill_note_segment_and_entries_hdrs(Elf32_Phdr phdrs[], Elf32_Nhdr nhdrs[]); -FORWARD void adjust_offsets(Elf32_Phdr phdrs[], int phnum); -FORWARD void dump_elf_header(struct filp *f, Elf32_Ehdr elf_header); -FORWARD void dump_notes(struct filp *f, Elf32_Nhdr nhdrs[], int csig, +static void adjust_offsets(Elf32_Phdr phdrs[], int phnum); +static void dump_elf_header(struct filp *f, Elf32_Ehdr elf_header); +static void dump_notes(struct filp *f, Elf32_Nhdr nhdrs[], int csig, char *proc_name); -FORWARD void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int +static void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum); -FORWARD void dump_segments(struct filp *f, Elf32_Phdr phdrs[], int +static void dump_segments(struct filp *f, Elf32_Phdr phdrs[], int phnum); -FORWARD void write_buf(struct filp *f, char *buf, size_t size); +static void write_buf(struct filp *f, char *buf, size_t size); /*===========================================================================* * write_elf_core_file * *===========================================================================*/ -PUBLIC void write_elf_core_file(struct filp *f, int csig, char *proc_name) +void write_elf_core_file(struct filp *f, int csig, char *proc_name) { /* First, fill in all the required headers, second, adjust the offsets, * third, dump everything into the core file @@ -76,7 +76,7 @@ PUBLIC void write_elf_core_file(struct filp *f, int csig, char *proc_name) /*===========================================================================* * fill_elf_header * *===========================================================================*/ -PRIVATE void fill_elf_header (Elf_Ehdr *elf_header, int phnum) +static void fill_elf_header (Elf_Ehdr *elf_header, int phnum) { memset((void *) elf_header, 0, sizeof(Elf_Ehdr)); @@ -100,7 +100,7 @@ PRIVATE void fill_elf_header (Elf_Ehdr *elf_header, int phnum) /*===========================================================================* * fill_prog_header * *===========================================================================*/ -PRIVATE void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type, +static void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type, Elf_Off p_offset, Elf_Addr p_vaddr, Elf_Word p_flags, Elf_Word p_filesz, Elf_Word p_memsz) { @@ -122,7 +122,7 @@ PRIVATE void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type, /*===========================================================================* * fill_note_segment_and_entries_hdrs * *===========================================================================*/ -PRIVATE void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[], +static void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[], Elf_Nhdr nhdrs[]) { int filesize; @@ -158,7 +158,7 @@ PRIVATE void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[], /*===========================================================================* * adjust_offset * *===========================================================================*/ -PRIVATE void adjust_offsets(Elf_Phdr phdrs[], int phnum) +static void adjust_offsets(Elf_Phdr phdrs[], int phnum) { int i; long offset = sizeof(Elf_Ehdr) + phnum * sizeof(Elf_Phdr); @@ -172,7 +172,7 @@ PRIVATE void adjust_offsets(Elf_Phdr phdrs[], int phnum) /*===========================================================================* * write_buf * *===========================================================================*/ -PRIVATE void write_buf(struct filp *f, char *buf, size_t size) +static void write_buf(struct filp *f, char *buf, size_t size) { read_write(WRITING, f, buf, size, VFS_PROC_NR); } @@ -180,7 +180,7 @@ PRIVATE void write_buf(struct filp *f, char *buf, size_t size) /*===========================================================================* * get_memory_regions * *===========================================================================*/ -PRIVATE int get_memory_regions(Elf_Phdr phdrs[]) +static int get_memory_regions(Elf_Phdr phdrs[]) { /* Print the virtual memory regions of a process. */ @@ -222,7 +222,7 @@ PRIVATE int get_memory_regions(Elf_Phdr phdrs[]) /*===========================================================================* * dump_notes * *===========================================================================*/ -PRIVATE void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig, +static void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig, char *proc_name) { char *note_name = ELF_NOTE_MINIX_ELFCORE_NAME "\0"; @@ -264,7 +264,7 @@ PRIVATE void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig, /*===========================================================================* * dump_elf_header * *===========================================================================*/ -PRIVATE void dump_elf_header(struct filp *f, Elf_Ehdr elf_header) +static void dump_elf_header(struct filp *f, Elf_Ehdr elf_header) { write_buf(f, (char *) &elf_header, sizeof(Elf_Ehdr)); } @@ -272,7 +272,7 @@ PRIVATE void dump_elf_header(struct filp *f, Elf_Ehdr elf_header) /*===========================================================================* * dump_program_headers * *===========================================================================*/ -PRIVATE void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum) +static void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum) { int i; @@ -283,7 +283,7 @@ PRIVATE void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum) /*===========================================================================* * dump_segments * *===========================================================================*/ -PRIVATE void dump_segments(struct filp *f, Elf_Phdr phdrs[], int phnum) +static void dump_segments(struct filp *f, Elf_Phdr phdrs[], int phnum) { int i; vir_bytes len; diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 21afc6a7e..4b6f7be2c 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -39,17 +39,17 @@ #include "vmnt.h" #include "param.h" -FORWARD void restart_reopen(int major); -FORWARD int safe_io_conversion(endpoint_t, cp_grant_id_t *, int *, +static void restart_reopen(int major); +static int safe_io_conversion(endpoint_t, cp_grant_id_t *, int *, endpoint_t *, void **, size_t, u32_t *); -PRIVATE int dummyproc; +static int dummyproc; /*===========================================================================* * dev_open * *===========================================================================*/ -PUBLIC int dev_open( +int dev_open( dev_t dev, /* device to open */ endpoint_t proc_e, /* process to open for */ int flags /* mode bits and flags */ @@ -73,7 +73,7 @@ PUBLIC int dev_open( /*===========================================================================* * dev_reopen * *===========================================================================*/ -PUBLIC int dev_reopen( +int dev_reopen( dev_t dev, /* device to open */ int filp_no, /* filp to reopen for */ int flags /* mode bits and flags */ @@ -102,7 +102,7 @@ PUBLIC int dev_reopen( /*===========================================================================* * dev_close * *===========================================================================*/ -PUBLIC int dev_close( +int dev_close( dev_t dev, /* device to close */ int filp_no ) @@ -122,7 +122,7 @@ PUBLIC int dev_close( /*===========================================================================* * dev_open * *===========================================================================*/ -PUBLIC int bdev_open(dev_t dev, int access) +int bdev_open(dev_t dev, int access) { /* Open a block device. */ int major; @@ -138,7 +138,7 @@ PUBLIC int bdev_open(dev_t dev, int access) /*===========================================================================* * bdev_close * *===========================================================================*/ -PUBLIC int bdev_close(dev_t dev) +int bdev_close(dev_t dev) { /* Close a block device. */ int major; @@ -154,7 +154,7 @@ PUBLIC int bdev_close(dev_t dev) /*===========================================================================* * bdev_ioctl * *===========================================================================*/ -PRIVATE int bdev_ioctl(dev_t dev, endpoint_t proc_e, int req, void *buf) +static int bdev_ioctl(dev_t dev, endpoint_t proc_e, int req, void *buf) { /* Perform an I/O control operation on a block device. */ struct dmap *dp; @@ -228,7 +228,7 @@ endpoint_t find_suspended_ep(endpoint_t driver, cp_grant_id_t g) /*===========================================================================* * dev_status * *===========================================================================*/ -PUBLIC void dev_status(message *m) +void dev_status(message *m) { /* A device sent us a notification it has something for us. Retrieve it. */ @@ -293,7 +293,7 @@ PUBLIC void dev_status(message *m) /*===========================================================================* * safe_io_conversion * *===========================================================================*/ -PRIVATE int safe_io_conversion(driver, gid, op, io_ept, buf, bytes, pos_lo) +static int safe_io_conversion(driver, gid, op, io_ept, buf, bytes, pos_lo) endpoint_t driver; cp_grant_id_t *gid; int *op; @@ -359,7 +359,7 @@ u32_t *pos_lo; return(0); } -PRIVATE int cancel_nblock(struct dmap * dp, +static int cancel_nblock(struct dmap * dp, int minor, int call, endpoint_t ioproc, @@ -388,7 +388,7 @@ PRIVATE int cancel_nblock(struct dmap * dp, /*===========================================================================* * dev_io * *===========================================================================*/ -PUBLIC int dev_io( +int dev_io( int op, /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */ dev_t dev, /* major-minor device number */ int proc_e, /* in whose address space is buf? */ @@ -516,7 +516,7 @@ PUBLIC int dev_io( /*===========================================================================* * gen_opcl * *===========================================================================*/ -PUBLIC int gen_opcl( +int gen_opcl( int op, /* operation, (B)DEV_OPEN or (B)DEV_CLOSE */ dev_t dev, /* device to open or close */ endpoint_t proc_e, /* process to open/close for */ @@ -568,7 +568,7 @@ PUBLIC int gen_opcl( /*===========================================================================* * tty_opcl * *===========================================================================*/ -PUBLIC int tty_opcl( +int tty_opcl( int op, /* operation, DEV_OPEN or DEV_CLOSE */ dev_t dev, /* device to open or close */ endpoint_t proc_e, /* process to open/close for */ @@ -610,7 +610,7 @@ PUBLIC int tty_opcl( /*===========================================================================* * ctty_opcl * *===========================================================================*/ -PUBLIC int ctty_opcl( +int ctty_opcl( int op, /* operation, DEV_OPEN or DEV_CLOSE */ dev_t UNUSED(dev), /* device to open or close */ endpoint_t UNUSED(proc_e), /* process to open/close for */ @@ -630,7 +630,7 @@ PUBLIC int ctty_opcl( /*===========================================================================* * pm_setsid * *===========================================================================*/ -PUBLIC void pm_setsid(proc_e) +void pm_setsid(proc_e) int proc_e; { /* Perform the VFS side of the SETSID call, i.e. get rid of the controlling @@ -650,7 +650,7 @@ int proc_e; /*===========================================================================* * do_ioctl * *===========================================================================*/ -PUBLIC int do_ioctl() +int do_ioctl() { /* Perform the ioctl(ls_fd, request, argx) system call (uses m2 fmt). */ @@ -689,7 +689,7 @@ PUBLIC int do_ioctl() /*===========================================================================* * gen_io * *===========================================================================*/ -PUBLIC int gen_io(driver_e, mess_ptr) +int gen_io(driver_e, mess_ptr) endpoint_t driver_e; /* which endpoint to call */ message *mess_ptr; /* pointer to message for task */ { @@ -739,7 +739,7 @@ message *mess_ptr; /* pointer to message for task */ /*===========================================================================* * asyn_io * *===========================================================================*/ -PUBLIC int asyn_io(task_nr, mess_ptr) +int asyn_io(task_nr, mess_ptr) int task_nr; /* which task to call */ message *mess_ptr; /* pointer to message for task */ { @@ -765,7 +765,7 @@ message *mess_ptr; /* pointer to message for task */ /*===========================================================================* * ctty_io * *===========================================================================*/ -PUBLIC int ctty_io( +int ctty_io( endpoint_t UNUSED(task_nr), /* not used - for compatibility with dmap_t */ message *mess_ptr /* pointer to message for task */ ) @@ -805,7 +805,7 @@ PUBLIC int ctty_io( /*===========================================================================* * no_dev * *===========================================================================*/ -PUBLIC int no_dev( +int no_dev( int UNUSED(op), /* operation, DEV_OPEN or DEV_CLOSE */ dev_t UNUSED(dev), /* device to open or close */ int UNUSED(proc), /* process to open/close for */ @@ -819,7 +819,7 @@ PUBLIC int no_dev( /*===========================================================================* * no_dev_io * *===========================================================================*/ -PUBLIC int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m)) +int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m)) { /* Called when doing i/o on a nonexistent device. */ printf("VFS: I/O on unmapped device number\n"); @@ -830,7 +830,7 @@ PUBLIC int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m)) /*===========================================================================* * clone_opcl * *===========================================================================*/ -PUBLIC int clone_opcl( +int clone_opcl( int op, /* operation, DEV_OPEN or DEV_CLOSE */ dev_t dev, /* device to open or close */ int proc_e, /* process to open/close for */ @@ -927,7 +927,7 @@ PUBLIC int clone_opcl( /*===========================================================================* * bdev_up * *===========================================================================*/ -PUBLIC void bdev_up(int maj) +void bdev_up(int maj) { /* A new block device driver has been mapped in. This may affect both mounted * file systems and open block-special files. @@ -987,7 +987,7 @@ PUBLIC void bdev_up(int maj) /*===========================================================================* * cdev_up * *===========================================================================*/ -PUBLIC void cdev_up(int maj) +void cdev_up(int maj) { /* A new character device driver has been mapped in. */ @@ -1032,7 +1032,7 @@ PUBLIC void cdev_up(int maj) /*===========================================================================* * open_reply * *===========================================================================*/ -PUBLIC void open_reply(void) +void open_reply(void) { struct fproc *rfp; endpoint_t proc_e; @@ -1048,7 +1048,7 @@ PUBLIC void open_reply(void) /*===========================================================================* * restart_reopen * *===========================================================================*/ -PRIVATE void restart_reopen(maj) +static void restart_reopen(maj) int maj; { int n, r, minor_dev, major_dev, fd_nr; @@ -1138,7 +1138,7 @@ int maj; /*===========================================================================* * reopen_reply * *===========================================================================*/ -PUBLIC void reopen_reply() +void reopen_reply() { endpoint_t driver_e; int filp_no, status, maj; diff --git a/servers/vfs/dmap.c b/servers/vfs/dmap.c index eb5d13b1b..763ae85ff 100644 --- a/servers/vfs/dmap.c +++ b/servers/vfs/dmap.c @@ -28,7 +28,7 @@ struct dmap dmap[NR_DEVICES]; /*===========================================================================* * do_mapdriver * *===========================================================================*/ -PUBLIC int do_mapdriver() +int do_mapdriver() { /* Create a device->driver mapping. RS will tell us which major is driven by * this driver, what type of device it is (regular, TTY, asynchronous, clone, @@ -76,7 +76,7 @@ PUBLIC int do_mapdriver() /*===========================================================================* * map_driver * *===========================================================================*/ -PUBLIC int map_driver(label, major, proc_nr_e, style, flags) +int map_driver(label, major, proc_nr_e, style, flags) const char *label; /* name of the driver */ int major; /* major number of the device */ endpoint_t proc_nr_e; /* process number of the driver */ @@ -162,7 +162,7 @@ int flags; /* device flags */ /*===========================================================================* * dmap_unmap_by_endpt * *===========================================================================*/ -PUBLIC void dmap_unmap_by_endpt(endpoint_t proc_e) +void dmap_unmap_by_endpt(endpoint_t proc_e) { /* Lookup driver in dmap table by endpoint and unmap it */ int major, r; @@ -181,7 +181,7 @@ PUBLIC void dmap_unmap_by_endpt(endpoint_t proc_e) /*===========================================================================* * map_service * *===========================================================================*/ -PUBLIC int map_service(struct rprocpub *rpub) +int map_service(struct rprocpub *rpub) { /* Map a new service by storing its device driver properties. */ int r; @@ -207,7 +207,7 @@ PUBLIC int map_service(struct rprocpub *rpub) /*===========================================================================* * init_dmap * *===========================================================================*/ -PUBLIC void init_dmap() +void init_dmap() { /* Initialize the table with empty device <-> driver mappings. */ int i; @@ -220,7 +220,7 @@ PUBLIC void init_dmap() /*===========================================================================* * dmap_driver_match * *===========================================================================*/ -PUBLIC int dmap_driver_match(endpoint_t proc, int major) +int dmap_driver_match(endpoint_t proc, int major) { if (major < 0 || major >= NR_DEVICES) return(0); if (dmap[major].dmap_driver != NONE && dmap[major].dmap_driver == proc) @@ -232,7 +232,7 @@ PUBLIC int dmap_driver_match(endpoint_t proc, int major) /*===========================================================================* * dmap_endpt_up * *===========================================================================*/ -PUBLIC void dmap_endpt_up(endpoint_t proc_e, int is_blk) +void dmap_endpt_up(endpoint_t proc_e, int is_blk) { /* A device driver with endpoint proc_e has been restarted. Go tell everyone * that might be blocking on it that this device is 'up'. @@ -252,7 +252,7 @@ PUBLIC void dmap_endpt_up(endpoint_t proc_e, int is_blk) /*===========================================================================* * get_dmap * *===========================================================================*/ -PUBLIC struct dmap *get_dmap(endpoint_t proc_e) +struct dmap *get_dmap(endpoint_t proc_e) { /* See if 'proc_e' endpoint belongs to a valid dmap entry. If so, return a * pointer */ diff --git a/servers/vfs/exec.c b/servers/vfs/exec.c index d1aa0043a..b3baa67e0 100644 --- a/servers/vfs/exec.c +++ b/servers/vfs/exec.c @@ -35,25 +35,25 @@ #include #include "exec.h" -FORWARD void lock_exec(void); -FORWARD void unlock_exec(void); -FORWARD int exec_newmem(int proc_e, vir_bytes text_addr, vir_bytes +static void lock_exec(void); +static void unlock_exec(void); +static int exec_newmem(int proc_e, vir_bytes text_addr, vir_bytes text_bytes, vir_bytes data_addr, vir_bytes data_bytes, vir_bytes tot_bytes, vir_bytes frame_len, int sep_id, int is_elf, dev_t st_dev, ino_t st_ino, time_t ctime, char *progname, int new_uid, int new_gid, vir_bytes *stack_topp, int *load_textp, int *setugidp); -FORWARD int is_script(const char *exec_hdr, size_t exec_len); -FORWARD int patch_stack(struct vnode *vp, char stack[ARG_MAX], vir_bytes +static int is_script(const char *exec_hdr, size_t exec_len); +static int patch_stack(struct vnode *vp, char stack[ARG_MAX], vir_bytes *stk_bytes, char path[PATH_MAX]); -FORWARD int insert_arg(char stack[ARG_MAX], vir_bytes *stk_bytes, char +static int insert_arg(char stack[ARG_MAX], vir_bytes *stk_bytes, char *arg, int replace); -FORWARD void patch_ptr(char stack[ARG_MAX], vir_bytes base); -FORWARD void clo_exec(struct fproc *rfp); -FORWARD int read_seg(struct vnode *vp, off_t off, int proc_e, int seg, +static void patch_ptr(char stack[ARG_MAX], vir_bytes base); +static void clo_exec(struct fproc *rfp); +static int read_seg(struct vnode *vp, off_t off, int proc_e, int seg, vir_bytes seg_addr, phys_bytes seg_bytes); -FORWARD int load_aout(struct exec_info *execi); -FORWARD int load_elf(struct exec_info *execi); -FORWARD int map_header(char **exec_hdr, const struct vnode *vp); +static int load_aout(struct exec_info *execi); +static int load_elf(struct exec_info *execi); +static int map_header(char **exec_hdr, const struct vnode *vp); #define PTRSIZE sizeof(char *) /* Size of pointers in argv[] and envp[]. */ @@ -62,18 +62,18 @@ struct exec_loaders { int (*load_object)(struct exec_info *); }; -PRIVATE const struct exec_loaders exec_loaders[] = { +static const struct exec_loaders exec_loaders[] = { { load_aout }, { load_elf }, { NULL } }; -PRIVATE char hdr[PAGE_SIZE]; /* Assume that header is not larger than a page */ +static char hdr[PAGE_SIZE]; /* Assume that header is not larger than a page */ /*===========================================================================* * lock_exec * *===========================================================================*/ -PRIVATE void lock_exec(void) +static void lock_exec(void) { message org_m_in; struct fproc *org_fp; @@ -98,7 +98,7 @@ PRIVATE void lock_exec(void) /*===========================================================================* * unlock_exec * *===========================================================================*/ -PRIVATE void unlock_exec(void) +static void unlock_exec(void) { if (mutex_unlock(&exec_lock) != 0) panic("Could not release lock on exec"); @@ -107,7 +107,7 @@ PRIVATE void unlock_exec(void) /*===========================================================================* * pm_exec * *===========================================================================*/ -PUBLIC int pm_exec(int proc_e, char *path, vir_bytes path_len, char *frame, +int pm_exec(int proc_e, char *path, vir_bytes path_len, char *frame, vir_bytes frame_len, vir_bytes *pc) { /* Perform the execve(name, argv, envp) call. The user library builds a @@ -261,7 +261,7 @@ pm_execfinal: /*===========================================================================* * load_aout * *===========================================================================*/ -PRIVATE int load_aout(struct exec_info *execi) +static int load_aout(struct exec_info *execi) { int r; struct vnode *vp; @@ -312,7 +312,7 @@ PRIVATE int load_aout(struct exec_info *execi) /*===========================================================================* * load_elf * *===========================================================================*/ -PRIVATE int load_elf(struct exec_info *execi) +static int load_elf(struct exec_info *execi) { int r; struct vnode *vp; @@ -367,7 +367,7 @@ PRIVATE int load_elf(struct exec_info *execi) /*===========================================================================* * exec_newmem * *===========================================================================*/ -PRIVATE int exec_newmem( +static int exec_newmem( int proc_e, vir_bytes text_addr, vir_bytes text_bytes, @@ -427,7 +427,7 @@ PRIVATE int exec_newmem( /*===========================================================================* * is_script * *===========================================================================*/ -PRIVATE int is_script(const char *exec_hdr, size_t exec_len) +static int is_script(const char *exec_hdr, size_t exec_len) { /* Is Interpreted script? */ assert(exec_hdr != NULL); @@ -438,7 +438,7 @@ PRIVATE int is_script(const char *exec_hdr, size_t exec_len) /*===========================================================================* * patch_stack * *===========================================================================*/ -PRIVATE int patch_stack(vp, stack, stk_bytes, path) +static int patch_stack(vp, stack, stk_bytes, path) struct vnode *vp; /* pointer for open script file */ char stack[ARG_MAX]; /* pointer to stack image within VFS */ vir_bytes *stk_bytes; /* size of initial stack */ @@ -512,7 +512,7 @@ char path[PATH_MAX]; /* path to script file */ /*===========================================================================* * insert_arg * *===========================================================================*/ -PRIVATE int insert_arg( +static int insert_arg( char stack[ARG_MAX], /* pointer to stack image within PM */ vir_bytes *stk_bytes, /* size of initial stack */ char *arg, /* argument to prepend/replace as new argv[0] */ @@ -570,7 +570,7 @@ int replace /*===========================================================================* * patch_ptr * *===========================================================================*/ -PRIVATE void patch_ptr( +static void patch_ptr( char stack[ARG_MAX], /* pointer to stack image within PM */ vir_bytes base /* virtual address of stack base inside user */ ) @@ -603,7 +603,7 @@ vir_bytes base /* virtual address of stack base inside user */ /*===========================================================================* * read_seg * *===========================================================================*/ -PRIVATE int read_seg( +static int read_seg( struct vnode *vp, /* inode descriptor to read from */ off_t off, /* offset in file */ int proc_e, /* process number (endpoint) */ @@ -680,7 +680,7 @@ phys_bytes seg_bytes /* how much is to be transferred? */ /*===========================================================================* * clo_exec * *===========================================================================*/ -PRIVATE void clo_exec(struct fproc *rfp) +static void clo_exec(struct fproc *rfp) { /* Files can be marked with the FD_CLOEXEC bit (in fp->fp_cloexec). */ @@ -695,7 +695,7 @@ PRIVATE void clo_exec(struct fproc *rfp) /*===========================================================================* * map_header * *===========================================================================*/ -PRIVATE int map_header(char **exec_hdr, const struct vnode *vp) +static int map_header(char **exec_hdr, const struct vnode *vp) { int r; u64_t new_pos; diff --git a/servers/vfs/filedes.c b/servers/vfs/filedes.c index df75976db..64a41629c 100644 --- a/servers/vfs/filedes.c +++ b/servers/vfs/filedes.c @@ -25,13 +25,13 @@ #include "vnode.h" -FORWARD filp_id_t verify_fd(endpoint_t ep, int fd); +static filp_id_t verify_fd(endpoint_t ep, int fd); #if LOCK_DEBUG /*===========================================================================* * check_filp_locks * *===========================================================================*/ -PUBLIC void check_filp_locks_by_me(void) +void check_filp_locks_by_me(void) { /* Check whether this thread still has filp locks held */ struct filp *f; @@ -53,7 +53,7 @@ PUBLIC void check_filp_locks_by_me(void) /*===========================================================================* * check_filp_locks * *===========================================================================*/ -PUBLIC void check_filp_locks(void) +void check_filp_locks(void) { struct filp *f; int r, count = 0; @@ -78,7 +78,7 @@ PUBLIC void check_filp_locks(void) /*===========================================================================* * init_filps * *===========================================================================*/ -PUBLIC void init_filps(void) +void init_filps(void) { /* Initialize filps */ struct filp *f; @@ -92,7 +92,7 @@ PUBLIC void init_filps(void) /*===========================================================================* * get_fd * *===========================================================================*/ -PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt) +int get_fd(int start, mode_t bits, int *k, struct filp **fpt) { /* Look for a free file descriptor and a free filp slot. Fill in the mode word * in the latter, but don't claim either one yet, since the open() or creat() @@ -143,7 +143,7 @@ PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt) /*===========================================================================* * get_filp * *===========================================================================*/ -PUBLIC struct filp *get_filp(fild, locktype) +struct filp *get_filp(fild, locktype) int fild; /* file descriptor */ tll_access_t locktype; { @@ -156,7 +156,7 @@ tll_access_t locktype; /*===========================================================================* * get_filp2 * *===========================================================================*/ -PUBLIC struct filp *get_filp2(rfp, fild, locktype) +struct filp *get_filp2(rfp, fild, locktype) register struct fproc *rfp; int fild; /* file descriptor */ tll_access_t locktype; @@ -178,7 +178,7 @@ tll_access_t locktype; /*===========================================================================* * find_filp * *===========================================================================*/ -PUBLIC struct filp *find_filp(struct vnode *vp, mode_t bits) +struct filp *find_filp(struct vnode *vp, mode_t bits) { /* Find a filp slot that refers to the vnode 'vp' in a way as described * by the mode bit 'bits'. Used for determining whether somebody is still @@ -202,7 +202,7 @@ PUBLIC struct filp *find_filp(struct vnode *vp, mode_t bits) /*===========================================================================* * invalidate_filp * *===========================================================================*/ -PUBLIC int invalidate_filp(struct filp *rfilp) +int invalidate_filp(struct filp *rfilp) { /* Invalidate filp. fp_filp_inuse is not cleared, so filp can't be reused until it is closed first. */ @@ -224,7 +224,7 @@ PUBLIC int invalidate_filp(struct filp *rfilp) /*===========================================================================* * invalidate_filp_by_endpt * *===========================================================================*/ -PUBLIC void invalidate_filp_by_endpt(endpoint_t proc_e) +void invalidate_filp_by_endpt(endpoint_t proc_e) { struct filp *f; @@ -239,7 +239,7 @@ PUBLIC void invalidate_filp_by_endpt(endpoint_t proc_e) /*===========================================================================* * lock_filp * *===========================================================================*/ -PUBLIC void lock_filp(filp, locktype) +void lock_filp(filp, locktype) struct filp *filp; tll_access_t locktype; { @@ -287,7 +287,7 @@ tll_access_t locktype; /*===========================================================================* * unlock_filp * *===========================================================================*/ -PUBLIC void unlock_filp(filp) +void unlock_filp(filp) struct filp *filp; { /* If this filp holds a soft lock on the vnode, we must be the owner */ @@ -312,7 +312,7 @@ struct filp *filp; /*===========================================================================* * unlock_filps * *===========================================================================*/ -PUBLIC void unlock_filps(filp1, filp2) +void unlock_filps(filp1, filp2) struct filp *filp1; struct filp *filp2; { @@ -344,7 +344,7 @@ struct filp *filp2; /*===========================================================================* * verify_fd * *===========================================================================*/ -PRIVATE filp_id_t verify_fd(ep, fd) +static filp_id_t verify_fd(ep, fd) endpoint_t ep; int fd; { @@ -366,7 +366,7 @@ int fd; /*===========================================================================* * do_verify_fd * *===========================================================================*/ -PUBLIC int do_verify_fd(void) +int do_verify_fd(void) { struct filp *rfilp; rfilp = (struct filp *) verify_fd(m_in.USER_ENDPT, m_in.COUNT); @@ -378,7 +378,7 @@ PUBLIC int do_verify_fd(void) /*===========================================================================* * set_filp * *===========================================================================*/ -PUBLIC int set_filp(sfilp) +int set_filp(sfilp) filp_id_t sfilp; { if (sfilp == NULL) return(EINVAL); @@ -393,7 +393,7 @@ filp_id_t sfilp; /*===========================================================================* * do_set_filp * *===========================================================================*/ -PUBLIC int do_set_filp(void) +int do_set_filp(void) { return set_filp((filp_id_t) m_in.ADDRESS); } @@ -401,7 +401,7 @@ PUBLIC int do_set_filp(void) /*===========================================================================* * copy_filp * *===========================================================================*/ -PUBLIC int copy_filp(to_ep, cfilp) +int copy_filp(to_ep, cfilp) endpoint_t to_ep; filp_id_t cfilp; { @@ -432,7 +432,7 @@ filp_id_t cfilp; /*===========================================================================* * do_copy_filp * *===========================================================================*/ -PUBLIC int do_copy_filp(void) +int do_copy_filp(void) { return copy_filp(m_in.USER_ENDPT, (filp_id_t) m_in.ADDRESS); } @@ -440,7 +440,7 @@ PUBLIC int do_copy_filp(void) /*===========================================================================* * put_filp * *===========================================================================*/ -PUBLIC int put_filp(pfilp) +int put_filp(pfilp) filp_id_t pfilp; { if (pfilp == NULL) { @@ -455,7 +455,7 @@ filp_id_t pfilp; /*===========================================================================* * do_put_filp * *===========================================================================*/ -PUBLIC int do_put_filp(void) +int do_put_filp(void) { return put_filp((filp_id_t) m_in.ADDRESS); } @@ -463,7 +463,7 @@ PUBLIC int do_put_filp(void) /*===========================================================================* * cancel_fd * *===========================================================================*/ -PUBLIC int cancel_fd(ep, fd) +int cancel_fd(ep, fd) endpoint_t ep; int fd; { @@ -498,7 +498,7 @@ int fd; /*===========================================================================* * do_cancel_fd * *===========================================================================*/ -PUBLIC int do_cancel_fd(void) +int do_cancel_fd(void) { return cancel_fd(m_in.USER_ENDPT, m_in.COUNT); } @@ -506,7 +506,7 @@ PUBLIC int do_cancel_fd(void) /*===========================================================================* * close_filp * *===========================================================================*/ -PUBLIC void close_filp(f) +void close_filp(f) struct filp *f; { /* Close a file. Will also unlock filp when done */ diff --git a/servers/vfs/fscall.c b/servers/vfs/fscall.c index 77db83aca..dd40089ec 100644 --- a/servers/vfs/fscall.c +++ b/servers/vfs/fscall.c @@ -19,7 +19,7 @@ #define MAX_DEPTH 1 /* global variables stack */ -PRIVATE struct { +static struct { struct fproc *g_fp; /* pointer to caller process */ message g_m_in; /* request message */ message g_m_out; /* reply message */ @@ -30,16 +30,16 @@ PRIVATE struct { char g_user_fullpath[PATH_MAX]; /* path to look up */ } globals[MAX_DEPTH]; -PRIVATE int depth = 0; /* current globals stack level */ +static int depth = 0; /* current globals stack level */ -FORWARD int push_globals(void); -FORWARD void pop_globals(void); -FORWARD void set_globals(message *m); +static int push_globals(void); +static void pop_globals(void); +static void set_globals(message *m); /*===========================================================================* * push_globals * *===========================================================================*/ -PRIVATE int push_globals() +static int push_globals() { /* Save the global variables of the current call onto the globals stack. */ @@ -60,7 +60,7 @@ PRIVATE int push_globals() /*===========================================================================* * pop_globals * *===========================================================================*/ -PRIVATE void pop_globals() +static void pop_globals() { /* Restore the global variables of a call from the globals stack. */ @@ -79,7 +79,7 @@ PRIVATE void pop_globals() /*===========================================================================* * set_globals * *===========================================================================*/ -PRIVATE void set_globals(m) +static void set_globals(m) message *m; /* request message */ { /* Initialize global variables based on a request message. @@ -97,7 +97,7 @@ message *m; /* request message */ /*===========================================================================* * nested_fs_call * *===========================================================================*/ -PUBLIC void nested_fs_call(m) +void nested_fs_call(m) message *m; /* request/reply message pointer */ { /* Handle a nested call from a file system server. diff --git a/servers/vfs/gcov.c b/servers/vfs/gcov.c index 4c2193b5a..5e8e5ac37 100644 --- a/servers/vfs/gcov.c +++ b/servers/vfs/gcov.c @@ -8,7 +8,7 @@ int gcov_flush(cp_grant_id_t grantid, size_t size ); /*===========================================================================* * do_gcov_flush * *===========================================================================*/ -PUBLIC int do_gcov_flush() +int do_gcov_flush() { /* A userland tool has requested the gcov data from another * process (possibly vfs itself). Grant the target process diff --git a/servers/vfs/link.c b/servers/vfs/link.c index 1c0b4af86..a110b7058 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -28,7 +28,7 @@ /*===========================================================================* * do_link * *===========================================================================*/ -PUBLIC int do_link() +int do_link() { /* Perform the link(name1, name2) system call. */ int r = OK; @@ -85,7 +85,7 @@ PUBLIC int do_link() /*===========================================================================* * do_unlink * *===========================================================================*/ -PUBLIC int do_unlink() +int do_unlink() { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -166,7 +166,7 @@ PUBLIC int do_unlink() /*===========================================================================* * do_rename * *===========================================================================*/ -PUBLIC int do_rename() +int do_rename() { /* Perform the rename(name1, name2) system call. */ int r = OK, r1; @@ -262,7 +262,7 @@ PUBLIC int do_rename() /*===========================================================================* * do_truncate * *===========================================================================*/ -PUBLIC int do_truncate() +int do_truncate() { /* truncate_vnode() does the actual work of do_truncate() and do_ftruncate(). * do_truncate() and do_ftruncate() have to get hold of the inode, either @@ -298,7 +298,7 @@ PUBLIC int do_truncate() /*===========================================================================* * do_ftruncate * *===========================================================================*/ -PUBLIC int do_ftruncate() +int do_ftruncate() { /* As with do_truncate(), truncate_vnode() does the actual work. */ struct filp *rfilp; @@ -322,7 +322,7 @@ PUBLIC int do_ftruncate() /*===========================================================================* * truncate_vnode * *===========================================================================*/ -PUBLIC int truncate_vnode(vp, newsize) +int truncate_vnode(vp, newsize) struct vnode *vp; off_t newsize; { @@ -341,7 +341,7 @@ off_t newsize; /*===========================================================================* * do_slink * *===========================================================================*/ -PUBLIC int do_slink() +int do_slink() { /* Perform the symlink(name1, name2) system call. */ int r; @@ -379,7 +379,7 @@ PUBLIC int do_slink() /*===========================================================================* * rdlink_direct * *===========================================================================*/ -PUBLIC int rdlink_direct(orig_path, link_path, rfp) +int rdlink_direct(orig_path, link_path, rfp) char *orig_path; char link_path[PATH_MAX]; /* should have length PATH_MAX */ struct fproc *rfp; @@ -419,7 +419,7 @@ struct fproc *rfp; /*===========================================================================* * do_rdlink * *===========================================================================*/ -PUBLIC int do_rdlink() +int do_rdlink() { /* Perform the readlink(name, buf, bufsize) system call. */ int r, copylen; diff --git a/servers/vfs/lock.c b/servers/vfs/lock.c index 36ab59351..f710055d1 100644 --- a/servers/vfs/lock.c +++ b/servers/vfs/lock.c @@ -20,7 +20,7 @@ /*===========================================================================* * lock_op * *===========================================================================*/ -PUBLIC int lock_op(f, req) +int lock_op(f, req) struct filp *f; int req; /* either F_SETLK or F_SETLKW */ { @@ -169,7 +169,7 @@ int req; /* either F_SETLK or F_SETLKW */ /*===========================================================================* * lock_revive * *===========================================================================*/ -PUBLIC void lock_revive() +void lock_revive() { /* Go find all the processes that are waiting for any kind of lock and * revive them all. The ones that are still blocked will block again when diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 4650b8ebe..65cda8217 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -40,33 +40,33 @@ EXTERN unsigned long calls_stats[NCALLS]; #endif /* Thread related prototypes */ -FORWARD void thread_cleanup_f(struct fproc *rfp, char *f, int l); +static void thread_cleanup_f(struct fproc *rfp, char *f, int l); #define thread_cleanup(x) thread_cleanup_f(x, __FILE__, __LINE__) -FORWARD void *do_async_dev_result(void *arg); -FORWARD void *do_control_msgs(void *arg); -FORWARD void *do_fs_reply(struct job *job); -FORWARD void *do_work(void *arg); -FORWARD void *do_pm(void *arg); -FORWARD void *do_init_root(void *arg); -FORWARD void handle_work(void *(*func)(void *arg)); - -FORWARD void get_work(void); -FORWARD void lock_pm(void); -FORWARD void unlock_pm(void); -FORWARD void service_pm(void); -FORWARD void service_pm_postponed(void); -FORWARD int unblock(struct fproc *rfp); +static void *do_async_dev_result(void *arg); +static void *do_control_msgs(void *arg); +static void *do_fs_reply(struct job *job); +static void *do_work(void *arg); +static void *do_pm(void *arg); +static void *do_init_root(void *arg); +static void handle_work(void *(*func)(void *arg)); + +static void get_work(void); +static void lock_pm(void); +static void unlock_pm(void); +static void service_pm(void); +static void service_pm_postponed(void); +static int unblock(struct fproc *rfp); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -PRIVATE mutex_t pm_lock; -PRIVATE endpoint_t receive_from; +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static mutex_t pm_lock; +static endpoint_t receive_from; /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { /* This is the main program of the file system. The main loop consists of * three major activities: getting new work, processing the work, and sending @@ -136,7 +136,7 @@ PUBLIC int main(void) /*===========================================================================* * handle_work * *===========================================================================*/ -PRIVATE void handle_work(void *(*func)(void *arg)) +static void handle_work(void *(*func)(void *arg)) { /* Handle asynchronous device replies and new system calls. If the originating * endpoint is an FS endpoint, take extra care not to get in deadlock. */ @@ -177,7 +177,7 @@ PRIVATE void handle_work(void *(*func)(void *arg)) /*===========================================================================* * do_async_dev_result * *===========================================================================*/ -PRIVATE void *do_async_dev_result(void *arg) +static void *do_async_dev_result(void *arg) { endpoint_t endpt; struct job my_job; @@ -227,7 +227,7 @@ PRIVATE void *do_async_dev_result(void *arg) /*===========================================================================* * do_control_msgs * *===========================================================================*/ -PRIVATE void *do_control_msgs(void *arg) +static void *do_control_msgs(void *arg) { struct job my_job; @@ -254,7 +254,7 @@ PRIVATE void *do_control_msgs(void *arg) /*===========================================================================* * do_fs_reply * *===========================================================================*/ -PRIVATE void *do_fs_reply(struct job *job) +static void *do_fs_reply(struct job *job) { struct vmnt *vmp; struct fproc *rfp; @@ -281,7 +281,7 @@ PRIVATE void *do_fs_reply(struct job *job) /*===========================================================================* * lock_pm * *===========================================================================*/ -PRIVATE void lock_pm(void) +static void lock_pm(void) { message org_m_in; struct fproc *org_fp; @@ -306,7 +306,7 @@ PRIVATE void lock_pm(void) /*===========================================================================* * unlock_pm * *===========================================================================*/ -PRIVATE void unlock_pm(void) +static void unlock_pm(void) { if (mutex_unlock(&pm_lock) != 0) panic("Could not release lock on pm"); @@ -315,7 +315,7 @@ PRIVATE void unlock_pm(void) /*===========================================================================* * do_pm * *===========================================================================*/ -PRIVATE void *do_pm(void *arg) +static void *do_pm(void *arg) { struct job my_job; struct fproc *rfp; @@ -335,7 +335,7 @@ PRIVATE void *do_pm(void *arg) /*===========================================================================* * do_pending_pipe * *===========================================================================*/ -PRIVATE void *do_pending_pipe(void *arg) +static void *do_pending_pipe(void *arg) { int r, op; struct job my_job; @@ -370,7 +370,7 @@ PRIVATE void *do_pending_pipe(void *arg) /*===========================================================================* * do_dummy * *===========================================================================*/ -PUBLIC void *do_dummy(void *arg) +void *do_dummy(void *arg) { struct job my_job; int r; @@ -391,7 +391,7 @@ PUBLIC void *do_dummy(void *arg) /*===========================================================================* * do_work * *===========================================================================*/ -PRIVATE void *do_work(void *arg) +static void *do_work(void *arg) { int error; struct job my_job; @@ -458,7 +458,7 @@ PRIVATE void *do_work(void *arg) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -473,7 +473,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) { /* Initialize the virtual file server. */ int s, i; @@ -585,7 +585,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) /*===========================================================================* * do_init_root * *===========================================================================*/ -PRIVATE void *do_init_root(void *arg) +static void *do_init_root(void *arg) { struct fproc *rfp; struct job my_job; @@ -619,7 +619,7 @@ PRIVATE void *do_init_root(void *arg) /*===========================================================================* * lock_proc * *===========================================================================*/ -PUBLIC void lock_proc(struct fproc *rfp, int force_lock) +void lock_proc(struct fproc *rfp, int force_lock) { int r; message org_m_in; @@ -649,7 +649,7 @@ PUBLIC void lock_proc(struct fproc *rfp, int force_lock) /*===========================================================================* * unlock_proc * *===========================================================================*/ -PUBLIC void unlock_proc(struct fproc *rfp) +void unlock_proc(struct fproc *rfp) { int r; @@ -660,7 +660,7 @@ PUBLIC void unlock_proc(struct fproc *rfp) /*===========================================================================* * thread_cleanup * *===========================================================================*/ -PRIVATE void thread_cleanup_f(struct fproc *rfp, char *f, int l) +static void thread_cleanup_f(struct fproc *rfp, char *f, int l) { /* Clean up worker thread. Skip parts if this thread is not associated * with a particular process (i.e., rfp is NULL) */ @@ -702,7 +702,7 @@ PRIVATE void thread_cleanup_f(struct fproc *rfp, char *f, int l) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work() +static void get_work() { /* Normally wait for new input. However, if 'reviving' is * nonzero, a suspended process must be awakened. @@ -770,7 +770,7 @@ PRIVATE void get_work() /*===========================================================================* * reply * *===========================================================================*/ -PUBLIC void reply(whom, result) +void reply(whom, result) int whom; /* process to reply to */ int result; /* result of the call (usually OK or error #) */ { @@ -787,7 +787,7 @@ int result; /* result of the call (usually OK or error #) */ /*===========================================================================* * service_pm_postponed * *===========================================================================*/ -PRIVATE void service_pm_postponed(void) +static void service_pm_postponed(void) { int r; vir_bytes pc; @@ -842,7 +842,7 @@ PRIVATE void service_pm_postponed(void) /*===========================================================================* * service_pm * *===========================================================================*/ -PRIVATE void service_pm() +static void service_pm() { int r, slot; @@ -956,7 +956,7 @@ PRIVATE void service_pm() /*===========================================================================* * unblock * *===========================================================================*/ -PRIVATE int unblock(rfp) +static int unblock(rfp) struct fproc *rfp; { int blocked_on; diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index a703d7257..6fd10e6da 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -44,22 +44,22 @@ #define CORE_MODE 0777 /* mode to use on core image files */ #if ENABLE_SYSCALL_STATS -PUBLIC unsigned long calls_stats[NCALLS]; +unsigned long calls_stats[NCALLS]; #endif -FORWARD void free_proc(struct fproc *freed, int flags); +static void free_proc(struct fproc *freed, int flags); /* -FORWARD int dumpcore(int proc_e, struct mem_map *seg_ptr); -FORWARD int write_bytes(struct inode *rip, off_t off, char *buf, size_t +static int dumpcore(int proc_e, struct mem_map *seg_ptr); +static int write_bytes(struct inode *rip, off_t off, char *buf, size_t bytes); -FORWARD int write_seg(struct inode *rip, off_t off, int proc_e, int seg, +static int write_seg(struct inode *rip, off_t off, int proc_e, int seg, off_t seg_off, phys_bytes seg_bytes); */ /*===========================================================================* * do_getsysinfo * *===========================================================================*/ -PUBLIC int do_getsysinfo() +int do_getsysinfo() { vir_bytes src_addr, dst_addr; size_t len; @@ -100,7 +100,7 @@ PUBLIC int do_getsysinfo() /*===========================================================================* * do_dup * *===========================================================================*/ -PUBLIC int do_dup() +int do_dup() { /* Perform the dup(fd) or dup2(fd,fd2) system call. These system calls are * obsolete. In fact, it is not even possible to invoke them using the @@ -150,7 +150,7 @@ PUBLIC int do_dup() /*===========================================================================* * do_fcntl * *===========================================================================*/ -PUBLIC int do_fcntl() +int do_fcntl() { /* Perform the fcntl(fd, request, ...) system call. */ @@ -284,7 +284,7 @@ PUBLIC int do_fcntl() /*===========================================================================* * do_sync * *===========================================================================*/ -PUBLIC int do_sync() +int do_sync() { struct vmnt *vmp; int r = OK; @@ -305,7 +305,7 @@ PUBLIC int do_sync() /*===========================================================================* * do_fsync * *===========================================================================*/ -PUBLIC int do_fsync() +int do_fsync() { /* Perform the fsync() system call. */ struct filp *rfilp; @@ -334,7 +334,7 @@ PUBLIC int do_fsync() /*===========================================================================* * pm_reboot * *===========================================================================*/ -PUBLIC void pm_reboot() +void pm_reboot() { /* Perform the VFS side of the reboot call. */ int i; @@ -364,7 +364,7 @@ PUBLIC void pm_reboot() /*===========================================================================* * pm_fork * *===========================================================================*/ -PUBLIC void pm_fork(pproc, cproc, cpid) +void pm_fork(pproc, cproc, cpid) int pproc; /* Parent process */ int cproc; /* Child process */ int cpid; /* Child process id */ @@ -431,7 +431,7 @@ int cpid; /* Child process id */ /*===========================================================================* * free_proc * *===========================================================================*/ -PRIVATE void free_proc(struct fproc *exiter, int flags) +static void free_proc(struct fproc *exiter, int flags) { int i; register struct fproc *rfp; @@ -509,7 +509,7 @@ PRIVATE void free_proc(struct fproc *exiter, int flags) /*===========================================================================* * pm_exit * *===========================================================================*/ -PUBLIC void pm_exit(proc) +void pm_exit(proc) int proc; { /* Perform the file system portion of the exit(status) system call. */ @@ -524,7 +524,7 @@ int proc; /*===========================================================================* * pm_setgid * *===========================================================================*/ -PUBLIC void pm_setgid(proc_e, egid, rgid) +void pm_setgid(proc_e, egid, rgid) int proc_e; int egid; int rgid; @@ -543,7 +543,7 @@ int rgid; /*===========================================================================* * pm_setgroups * *===========================================================================*/ -PUBLIC void pm_setgroups(proc_e, ngroups, groups) +void pm_setgroups(proc_e, ngroups, groups) int proc_e; int ngroups; gid_t *groups; @@ -566,7 +566,7 @@ gid_t *groups; /*===========================================================================* * pm_setuid * *===========================================================================*/ -PUBLIC void pm_setuid(proc_e, euid, ruid) +void pm_setuid(proc_e, euid, ruid) int proc_e; int euid; int ruid; @@ -584,7 +584,7 @@ int ruid; /*===========================================================================* * do_svrctl * *===========================================================================*/ -PUBLIC int do_svrctl() +int do_svrctl() { switch (m_in.svrctl_req) { /* No control request implemented yet. */ @@ -596,7 +596,7 @@ PUBLIC int do_svrctl() /*===========================================================================* * pm_dumpcore * *===========================================================================*/ -PUBLIC int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name) +int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name) { int slot, r, core_fd; struct filp *f; @@ -629,7 +629,7 @@ PUBLIC int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name) /*===========================================================================* * ds_event * *===========================================================================*/ -PUBLIC void ds_event(void) +void ds_event(void) { char key[DS_MAX_KEYLEN]; char *blkdrv_prefix = "drv.blk."; diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index add0380d4..2922a6f63 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -33,22 +33,22 @@ #include "param.h" /* Allow the root to be replaced before the first 'real' mount. */ -PRIVATE int have_root = 0; +static int have_root = 0; /* Bitmap of in-use "none" pseudo devices. */ -PRIVATE bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 }; +static bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 }; #define alloc_nonedev(dev) SET_BIT(nonedev, minor(dev) - 1) #define free_nonedev(dev) UNSET_BIT(nonedev, minor(dev) - 1) -FORWARD dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]); -FORWARD dev_t find_free_nonedev(void); -FORWARD void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e); +static dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]); +static dev_t find_free_nonedev(void); +static void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e); /*===========================================================================* * update_bspec * *===========================================================================*/ -PRIVATE void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e) +static void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e) { /* Update all block special files for a certain device, to use a new FS endpt * to route raw block I/O requests through. @@ -86,7 +86,7 @@ PRIVATE void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e) /*===========================================================================* * do_fsready * *===========================================================================*/ -PUBLIC int do_fsready() +int do_fsready() { /* deprecated */ return(SUSPEND); @@ -95,7 +95,7 @@ PUBLIC int do_fsready() /*===========================================================================* * do_mount * *===========================================================================*/ -PUBLIC int do_mount() +int do_mount() { /* Perform the mount(name, mfile, mount_flags) system call. */ endpoint_t fs_e; @@ -156,7 +156,7 @@ PUBLIC int do_mount() /*===========================================================================* * mount_fs * *===========================================================================*/ -PUBLIC int mount_fs( +int mount_fs( dev_t dev, char mountpoint[PATH_MAX], endpoint_t fs_e, @@ -378,7 +378,7 @@ char mount_label[LABEL_MAX] ) /*===========================================================================* * mount_pfs * *===========================================================================*/ -PUBLIC void mount_pfs(void) +void mount_pfs(void) { /* Mount the Pipe File Server. It's not really mounted onto the file system, but it's necessary it has a vmnt entry to make locking easier */ @@ -406,7 +406,7 @@ PUBLIC void mount_pfs(void) /*===========================================================================* * do_umount * *===========================================================================*/ -PUBLIC int do_umount(void) +int do_umount(void) { /* Perform the umount(name) system call. */ char label[LABEL_MAX]; @@ -438,7 +438,7 @@ PUBLIC int do_umount(void) /*===========================================================================* * unmount * *===========================================================================*/ -PUBLIC int unmount( +int unmount( dev_t dev, /* block-special device */ char *label /* buffer to retrieve label, or NULL */ ) @@ -517,7 +517,7 @@ PUBLIC int unmount( /*===========================================================================* * unmount_all * *===========================================================================*/ -PUBLIC void unmount_all(void) +void unmount_all(void) { /* Unmount all filesystems. File systems are mounted on other file systems, * so you have to pull off the loose bits repeatedly to get it all undone. @@ -543,7 +543,7 @@ PUBLIC void unmount_all(void) /*===========================================================================* * name_to_dev * *===========================================================================*/ -PRIVATE dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]) +static dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]) { /* Convert the block special file in 'user_fullpath' to a device number. * If the given path is not a block special file, but 'allow_mountpt' is set @@ -581,7 +581,7 @@ PRIVATE dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]) /*===========================================================================* * is_nonedev * *===========================================================================*/ -PUBLIC int is_nonedev(dev_t dev) +int is_nonedev(dev_t dev) { /* Return whether the given device is a "none" pseudo device. */ @@ -594,7 +594,7 @@ PUBLIC int is_nonedev(dev_t dev) /*===========================================================================* * find_free_nonedev * *===========================================================================*/ -PRIVATE dev_t find_free_nonedev(void) +static dev_t find_free_nonedev(void) { /* Find a free "none" pseudo device. Do not allocate it yet. */ diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 66973de1a..4ce4c29b5 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -32,17 +32,17 @@ #include "vmnt.h" #include "path.h" -PUBLIC char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0}; +char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0}; -FORWARD struct vnode *new_node(struct lookup *resolve, int oflags, +static struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits); -FORWARD int pipe_open(struct vnode *vp, mode_t bits, int oflags); +static int pipe_open(struct vnode *vp, mode_t bits, int oflags); /*===========================================================================* * do_creat * *===========================================================================*/ -PUBLIC int do_creat() +int do_creat() { /* Perform the creat(name, mode) system call. */ int r; @@ -58,7 +58,7 @@ PUBLIC int do_creat() /*===========================================================================* * do_open * *===========================================================================*/ -PUBLIC int do_open() +int do_open() { /* Perform the open(name, flags,...) system call. */ int create_mode = 0; /* is really mode_t but this gives problems */ @@ -82,7 +82,7 @@ PUBLIC int do_open() /*===========================================================================* * common_open * *===========================================================================*/ -PUBLIC int common_open(char path[PATH_MAX], int oflags, mode_t omode) +int common_open(char path[PATH_MAX], int oflags, mode_t omode) { /* Common code from do_creat and do_open. */ int b, r, exist = TRUE, major_dev; @@ -288,7 +288,7 @@ PUBLIC int common_open(char path[PATH_MAX], int oflags, mode_t omode) /*===========================================================================* * new_node * *===========================================================================*/ -PRIVATE struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits) +static struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits) { /* Try to create a new inode and return a pointer to it. If the inode already exists, return a pointer to it as well, but set err_code accordingly. @@ -466,7 +466,7 @@ PRIVATE struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits) /*===========================================================================* * pipe_open * *===========================================================================*/ -PRIVATE int pipe_open(struct vnode *vp, mode_t bits, int oflags) +static int pipe_open(struct vnode *vp, mode_t bits, int oflags) { /* This function is called from common_open. It checks if * there is at least one reader/writer pair for the pipe, if not @@ -499,7 +499,7 @@ PRIVATE int pipe_open(struct vnode *vp, mode_t bits, int oflags) /*===========================================================================* * do_mknod * *===========================================================================*/ -PUBLIC int do_mknod() +int do_mknod() { /* Perform the mknod(name, mode, addr) system call. */ register mode_t bits, mode_bits; @@ -543,7 +543,7 @@ PUBLIC int do_mknod() /*===========================================================================* * do_mkdir * *===========================================================================*/ -PUBLIC int do_mkdir() +int do_mkdir() { /* Perform the mkdir(name, mode) system call. */ mode_t bits; /* mode bits for the new inode */ @@ -579,7 +579,7 @@ PUBLIC int do_mkdir() /*===========================================================================* * do_lseek * *===========================================================================*/ -PUBLIC int do_lseek() +int do_lseek() { /* Perform the lseek(ls_fd, offset, whence) system call. */ register struct filp *rfilp; @@ -635,7 +635,7 @@ PUBLIC int do_lseek() /*===========================================================================* * do_llseek * *===========================================================================*/ -PUBLIC int do_llseek() +int do_llseek() { /* Perform the llseek(ls_fd, offset, whence) system call. */ register struct filp *rfilp; @@ -687,7 +687,7 @@ PUBLIC int do_llseek() /*===========================================================================* * do_close * *===========================================================================*/ -PUBLIC int do_close() +int do_close() { /* Perform the close(fd) system call. */ @@ -698,7 +698,7 @@ PUBLIC int do_close() /*===========================================================================* * close_fd * *===========================================================================*/ -PUBLIC int close_fd(rfp, fd_nr) +int close_fd(rfp, fd_nr) struct fproc *rfp; int fd_nr; { @@ -737,7 +737,7 @@ int fd_nr; /*===========================================================================* * close_reply * *===========================================================================*/ -PUBLIC void close_reply() +void close_reply() { /* No need to do anything */ } diff --git a/servers/vfs/path.c b/servers/vfs/path.c index e9fc0fda7..aaf1eb501 100644 --- a/servers/vfs/path.c +++ b/servers/vfs/path.c @@ -33,15 +33,15 @@ */ #define DO_POSIX_PATHNAME_RES 0 -FORWARD int lookup(struct vnode *dirp, struct lookup *resolve, +static int lookup(struct vnode *dirp, struct lookup *resolve, node_details_t *node, struct fproc *rfp); -FORWARD int check_perms(endpoint_t ep, cp_grant_id_t io_gr, size_t +static int check_perms(endpoint_t ep, cp_grant_id_t io_gr, size_t pathlen); /*===========================================================================* * advance * *===========================================================================*/ -PUBLIC struct vnode *advance(dirp, resolve, rfp) +struct vnode *advance(dirp, resolve, rfp) struct vnode *dirp; struct lookup *resolve; struct fproc *rfp; @@ -136,7 +136,7 @@ struct fproc *rfp; /*===========================================================================* * eat_path * *===========================================================================*/ -PUBLIC struct vnode *eat_path(resolve, rfp) +struct vnode *eat_path(resolve, rfp) struct lookup *resolve; struct fproc *rfp; { @@ -150,7 +150,7 @@ struct fproc *rfp; /*===========================================================================* * last_dir * *===========================================================================*/ -PUBLIC struct vnode *last_dir(resolve, rfp) +struct vnode *last_dir(resolve, rfp) struct lookup *resolve; struct fproc *rfp; { @@ -334,7 +334,7 @@ struct fproc *rfp; /*===========================================================================* * lookup * *===========================================================================*/ -PRIVATE int lookup(start_node, resolve, result_node, rfp) +static int lookup(start_node, resolve, result_node, rfp) struct vnode *start_node; struct lookup *resolve; node_details_t *result_node; @@ -517,7 +517,7 @@ struct fproc *rfp; /*===========================================================================* * lookup_init * *===========================================================================*/ -PUBLIC void lookup_init(resolve, path, flags, vmp, vp) +void lookup_init(resolve, path, flags, vmp, vp) struct lookup *resolve; char *path; int flags; @@ -540,7 +540,7 @@ struct vnode **vp; /*===========================================================================* * get_name * *===========================================================================*/ -PUBLIC int get_name(dirp, entry, ename) +int get_name(dirp, entry, ename) struct vnode *dirp; struct vnode *entry; char ename[NAME_MAX + 1]; @@ -589,7 +589,7 @@ char ename[NAME_MAX + 1]; /*===========================================================================* * canonical_path * *===========================================================================*/ -PUBLIC int canonical_path(orig_path, rfp) +int canonical_path(orig_path, rfp) char orig_path[PATH_MAX]; struct fproc *rfp; { @@ -733,7 +733,7 @@ struct fproc *rfp; /*===========================================================================* * check_perms * *===========================================================================*/ -PRIVATE int check_perms(ep, io_gr, pathlen) +static int check_perms(ep, io_gr, pathlen) endpoint_t ep; cp_grant_id_t io_gr; size_t pathlen; @@ -784,7 +784,7 @@ size_t pathlen; /*===========================================================================* * do_check_perms * *===========================================================================*/ -PUBLIC int do_check_perms(void) +int do_check_perms(void) { return check_perms(m_in.USER_ENDPT, (cp_grant_id_t) m_in.IO_GRANT, (size_t) m_in.COUNT); diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index b412cf463..8519747ae 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -38,7 +38,7 @@ /*===========================================================================* * do_pipe * *===========================================================================*/ -PUBLIC int do_pipe() +int do_pipe() { /* Perform the pipe(fil_des) system call. */ @@ -135,7 +135,7 @@ PUBLIC int do_pipe() /*===========================================================================* * map_vnode * *===========================================================================*/ -PUBLIC int map_vnode(vp, map_to_fs_e) +int map_vnode(vp, map_to_fs_e) struct vnode *vp; endpoint_t map_to_fs_e; { @@ -173,7 +173,7 @@ endpoint_t map_to_fs_e; /*===========================================================================* * pipe_check * *===========================================================================*/ -PUBLIC int pipe_check(vp, rw_flag, oflags, bytes, position, notouch) +int pipe_check(vp, rw_flag, oflags, bytes, position, notouch) register struct vnode *vp; /* the inode of the pipe */ int rw_flag; /* READING or WRITING */ int oflags; /* flags set by open or fcntl */ @@ -274,7 +274,7 @@ int notouch; /* check only */ /*===========================================================================* * suspend * *===========================================================================*/ -PUBLIC void suspend(int why) +void suspend(int why) { /* Take measures to suspend the processing of the present system call. * Store the parameters to be used upon resuming in the process table. @@ -306,7 +306,7 @@ PUBLIC void suspend(int why) /*===========================================================================* * wait_for * *===========================================================================*/ -PUBLIC void wait_for(endpoint_t who) +void wait_for(endpoint_t who) { if(who == NONE || who == ANY) panic("suspend on NONE or ANY"); @@ -318,7 +318,7 @@ PUBLIC void wait_for(endpoint_t who) /*===========================================================================* * pipe_suspend * *===========================================================================*/ -PUBLIC void pipe_suspend(filp, buf, size) +void pipe_suspend(filp, buf, size) struct filp *filp; char *buf; size_t size; @@ -341,7 +341,7 @@ size_t size; /*===========================================================================* * unsuspend_by_endpt * *===========================================================================*/ -PUBLIC void unsuspend_by_endpt(endpoint_t proc_e) +void unsuspend_by_endpt(endpoint_t proc_e) { /* Revive processes waiting for drivers (SUSPENDed) that have disappeared with * return code EAGAIN. @@ -364,7 +364,7 @@ PUBLIC void unsuspend_by_endpt(endpoint_t proc_e) /*===========================================================================* * release * *===========================================================================*/ -PUBLIC void release(vp, op, count) +void release(vp, op, count) register struct vnode *vp; /* inode of pipe */ int op; /* READ, WRITE, OPEN or CREAT */ int count; /* max number of processes to release */ @@ -434,7 +434,7 @@ int count; /* max number of processes to release */ /*===========================================================================* * revive * *===========================================================================*/ -PUBLIC void revive(proc_nr_e, returned) +void revive(proc_nr_e, returned) int proc_nr_e; /* process to revive */ int returned; /* if hanging on task, how many bytes read */ { @@ -514,7 +514,7 @@ int returned; /* if hanging on task, how many bytes read */ /*===========================================================================* * unpause * *===========================================================================*/ -PUBLIC void unpause(endpoint_t proc_e) +void unpause(endpoint_t proc_e) { /* A signal has been sent to a user who is paused on the file system. * Abort the system call with the EINTR error message. @@ -619,7 +619,7 @@ PUBLIC void unpause(endpoint_t proc_e) /*===========================================================================* * check_pipe * *===========================================================================*/ -PUBLIC int check_pipe(void) +int check_pipe(void) { /* Integrity check; verify that susp_count equals what the fproc table thinks * is suspended on a pipe */ diff --git a/servers/vfs/protect.c b/servers/vfs/protect.c index 04325c614..6bc9cff13 100644 --- a/servers/vfs/protect.c +++ b/servers/vfs/protect.c @@ -22,7 +22,7 @@ /*===========================================================================* * do_chmod * *===========================================================================*/ -PUBLIC int do_chmod() +int do_chmod() { /* Perform the chmod(name, mode) and fchmod(fd, mode) system calls. */ @@ -87,7 +87,7 @@ PUBLIC int do_chmod() /*===========================================================================* * do_chown * *===========================================================================*/ -PUBLIC int do_chown() +int do_chown() { /* Perform the chown(path, owner, group) and fchmod(fd, owner, group) system * calls. */ @@ -162,7 +162,7 @@ PUBLIC int do_chown() /*===========================================================================* * do_umask * *===========================================================================*/ -PUBLIC int do_umask() +int do_umask() { /* Perform the umask(co_mode) system call. */ register mode_t r; @@ -176,7 +176,7 @@ PUBLIC int do_umask() /*===========================================================================* * do_access * *===========================================================================*/ -PUBLIC int do_access() +int do_access() { /* Perform the access(name, mode) system call. */ int r; @@ -211,7 +211,7 @@ PUBLIC int do_access() /*===========================================================================* * forbidden * *===========================================================================*/ -PUBLIC int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired) +int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired) { /* Given a pointer to an vnode, 'vp', and the access desired, determine * if the access is allowed, and if not why not. The routine looks up the @@ -266,7 +266,7 @@ PUBLIC int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired) /*===========================================================================* * read_only * *===========================================================================*/ -PUBLIC int read_only(vp) +int read_only(vp) struct vnode *vp; /* ptr to inode whose file sys is to be cked */ { /* Check to see if the file system on which the inode 'ip' resides is mounted diff --git a/servers/vfs/read.c b/servers/vfs/read.c index 13df38ae0..43abe60d4 100644 --- a/servers/vfs/read.c +++ b/servers/vfs/read.c @@ -29,7 +29,7 @@ /*===========================================================================* * do_read * *===========================================================================*/ -PUBLIC int do_read() +int do_read() { return(do_read_write(READING)); } @@ -38,7 +38,7 @@ PUBLIC int do_read() /*===========================================================================* * lock_bsf * *===========================================================================*/ -PUBLIC void lock_bsf(void) +void lock_bsf(void) { message org_m_in; struct fproc *org_fp; @@ -62,7 +62,7 @@ PUBLIC void lock_bsf(void) /*===========================================================================* * unlock_bsf * *===========================================================================*/ -PUBLIC void unlock_bsf(void) +void unlock_bsf(void) { if (mutex_unlock(&bsf_lock) != 0) panic("failed to unlock block special file lock"); @@ -71,7 +71,7 @@ PUBLIC void unlock_bsf(void) /*===========================================================================* * do_read_write * *===========================================================================*/ -PUBLIC int do_read_write(rw_flag) +int do_read_write(rw_flag) int rw_flag; /* READING or WRITING */ { /* Perform read(fd, buffer, nbytes) or write(fd, buffer, nbytes) call. */ @@ -105,7 +105,7 @@ int rw_flag; /* READING or WRITING */ /*===========================================================================* * read_write * *===========================================================================*/ -PUBLIC int read_write(int rw_flag, struct filp *f, char *buf, size_t size, +int read_write(int rw_flag, struct filp *f, char *buf, size_t size, endpoint_t for_e) { register struct vnode *vp; @@ -209,7 +209,7 @@ PUBLIC int read_write(int rw_flag, struct filp *f, char *buf, size_t size, /*===========================================================================* * do_getdents * *===========================================================================*/ -PUBLIC int do_getdents() +int do_getdents() { /* Perform the getdents(fd, buf, size) system call. */ int r = OK; @@ -242,7 +242,7 @@ PUBLIC int do_getdents() /*===========================================================================* * rw_pipe * *===========================================================================*/ -PUBLIC int rw_pipe(rw_flag, usr_e, f, buf, req_size) +int rw_pipe(rw_flag, usr_e, f, buf, req_size) int rw_flag; /* READING or WRITING */ endpoint_t usr_e; struct filp *f; diff --git a/servers/vfs/request.c b/servers/vfs/request.c index be230da77..f3790def5 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -28,7 +28,7 @@ /*===========================================================================* * req_breadwrite * *===========================================================================*/ -PUBLIC int req_breadwrite( +int req_breadwrite( endpoint_t fs_e, endpoint_t user_e, dev_t dev, @@ -73,7 +73,7 @@ PUBLIC int req_breadwrite( /*===========================================================================* * req_chmod * *===========================================================================*/ -PUBLIC int req_chmod( +int req_chmod( int fs_e, ino_t inode_nr, mode_t rmode, @@ -101,7 +101,7 @@ PUBLIC int req_chmod( /*===========================================================================* * req_chown * *===========================================================================*/ -PUBLIC int req_chown( +int req_chown( endpoint_t fs_e, ino_t inode_nr, uid_t newuid, @@ -131,7 +131,7 @@ PUBLIC int req_chown( /*===========================================================================* * req_create * *===========================================================================*/ -PUBLIC int req_create( +int req_create( int fs_e, ino_t inode_nr, int omode, @@ -184,7 +184,7 @@ PUBLIC int req_create( /*===========================================================================* * req_flush * *===========================================================================*/ -PUBLIC int req_flush(endpoint_t fs_e, dev_t dev) +int req_flush(endpoint_t fs_e, dev_t dev) { message m; @@ -200,7 +200,7 @@ PUBLIC int req_flush(endpoint_t fs_e, dev_t dev) /*===========================================================================* * req_fstatfs * *===========================================================================*/ -PUBLIC int req_fstatfs(int fs_e, int proc_e, char *buf) +int req_fstatfs(int fs_e, int proc_e, char *buf) { int r; cp_grant_id_t grant_id; @@ -226,7 +226,7 @@ PUBLIC int req_fstatfs(int fs_e, int proc_e, char *buf) /*===========================================================================* * req_statvfs * *===========================================================================*/ -PUBLIC int req_statvfs(int fs_e, int proc_e, char *buf) +int req_statvfs(int fs_e, int proc_e, char *buf) { int r; cp_grant_id_t grant_id; @@ -252,7 +252,7 @@ PUBLIC int req_statvfs(int fs_e, int proc_e, char *buf) /*===========================================================================* * req_ftrunc * *===========================================================================*/ -PUBLIC int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end) +int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end) { message m; @@ -272,7 +272,7 @@ PUBLIC int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end) /*===========================================================================* * req_getdents * *===========================================================================*/ -PUBLIC int req_getdents( +int req_getdents( endpoint_t fs_e, ino_t inode_nr, u64_t pos, @@ -319,7 +319,7 @@ PUBLIC int req_getdents( /*===========================================================================* * req_inhibread * *===========================================================================*/ -PUBLIC int req_inhibread(endpoint_t fs_e, ino_t inode_nr) +int req_inhibread(endpoint_t fs_e, ino_t inode_nr) { message m; @@ -335,7 +335,7 @@ PUBLIC int req_inhibread(endpoint_t fs_e, ino_t inode_nr) /*===========================================================================* * req_link * *===========================================================================*/ -PUBLIC int req_link( +int req_link( endpoint_t fs_e, ino_t link_parent, char *lastc, @@ -369,7 +369,7 @@ PUBLIC int req_link( /*===========================================================================* * req_lookup * *===========================================================================*/ -PUBLIC int req_lookup( +int req_lookup( endpoint_t fs_e, ino_t dir_ino, ino_t root_ino, @@ -471,7 +471,7 @@ PUBLIC int req_lookup( /*===========================================================================* * req_mkdir * *===========================================================================*/ -PUBLIC int req_mkdir( +int req_mkdir( endpoint_t fs_e, ino_t inode_nr, char *lastc, @@ -510,7 +510,7 @@ PUBLIC int req_mkdir( /*===========================================================================* * req_mknod * *===========================================================================*/ -PUBLIC int req_mknod( +int req_mknod( endpoint_t fs_e, ino_t inode_nr, char *lastc, @@ -551,7 +551,7 @@ PUBLIC int req_mknod( /*===========================================================================* * req_mountpoint * *===========================================================================*/ -PUBLIC int req_mountpoint(endpoint_t fs_e, ino_t inode_nr) +int req_mountpoint(endpoint_t fs_e, ino_t inode_nr) { message m; @@ -567,7 +567,7 @@ PUBLIC int req_mountpoint(endpoint_t fs_e, ino_t inode_nr) /*===========================================================================* * req_newnode * *===========================================================================*/ -PUBLIC int req_newnode( +int req_newnode( endpoint_t fs_e, uid_t uid, gid_t gid, @@ -604,7 +604,7 @@ PUBLIC int req_newnode( /*===========================================================================* * req_newdriver * *===========================================================================*/ -PUBLIC int req_newdriver( +int req_newdriver( endpoint_t fs_e, dev_t dev, char *label @@ -639,7 +639,7 @@ PUBLIC int req_newdriver( /*===========================================================================* * req_putnode * *===========================================================================*/ -PUBLIC int req_putnode(fs_e, inode_nr, count) +int req_putnode(fs_e, inode_nr, count) int fs_e; ino_t inode_nr; int count; @@ -659,7 +659,7 @@ int count; /*===========================================================================* * req_rdlink * *===========================================================================*/ -PUBLIC int req_rdlink(fs_e, inode_nr, proc_e, buf, len, direct) +int req_rdlink(fs_e, inode_nr, proc_e, buf, len, direct) endpoint_t fs_e; ino_t inode_nr; endpoint_t proc_e; @@ -699,7 +699,7 @@ int direct; /* set to 1 to use direct grants instead of magic grants */ /*===========================================================================* * req_readsuper * *===========================================================================*/ -PUBLIC int req_readsuper( +int req_readsuper( endpoint_t fs_e, char *label, dev_t dev, @@ -750,7 +750,7 @@ PUBLIC int req_readsuper( /*===========================================================================* * req_readwrite * *===========================================================================*/ -PUBLIC int req_readwrite(fs_e, inode_nr, pos, rw_flag, user_e, +int req_readwrite(fs_e, inode_nr, pos, rw_flag, user_e, user_addr, num_of_bytes, new_posp, cum_iop) endpoint_t fs_e; ino_t inode_nr; @@ -799,7 +799,7 @@ unsigned int *cum_iop; /*===========================================================================* * req_rename * *===========================================================================*/ -PUBLIC int req_rename(fs_e, old_dir, old_name, new_dir, new_name) +int req_rename(fs_e, old_dir, old_name, new_dir, new_name) endpoint_t fs_e; ino_t old_dir; char *old_name; @@ -842,7 +842,7 @@ char *new_name; /*===========================================================================* * req_rmdir * *===========================================================================*/ -PUBLIC int req_rmdir(fs_e, inode_nr, lastc) +int req_rmdir(fs_e, inode_nr, lastc) endpoint_t fs_e; ino_t inode_nr; char *lastc; @@ -874,7 +874,7 @@ char *lastc; /*===========================================================================* * req_slink * *===========================================================================*/ -PUBLIC int req_slink( +int req_slink( endpoint_t fs_e, ino_t inode_nr, char *lastc, @@ -924,7 +924,7 @@ PUBLIC int req_slink( /*===========================================================================* * req_stat * *===========================================================================*/ -PUBLIC int req_stat(fs_e, inode_nr, proc_e, buf, pos, stat_version) +int req_stat(fs_e, inode_nr, proc_e, buf, pos, stat_version) int fs_e; ino_t inode_nr; int proc_e; @@ -1010,7 +1010,7 @@ int stat_version; /*===========================================================================* * req_sync * *===========================================================================*/ -PUBLIC int req_sync(fs_e) +int req_sync(fs_e) endpoint_t fs_e; { message m; @@ -1026,7 +1026,7 @@ endpoint_t fs_e; /*===========================================================================* * req_unlink * *===========================================================================*/ -PUBLIC int req_unlink(fs_e, inode_nr, lastc) +int req_unlink(fs_e, inode_nr, lastc) endpoint_t fs_e; ino_t inode_nr; char *lastc; @@ -1058,7 +1058,7 @@ char *lastc; /*===========================================================================* * req_unmount * *===========================================================================*/ -PUBLIC int req_unmount(fs_e) +int req_unmount(fs_e) endpoint_t fs_e; { message m; @@ -1074,7 +1074,7 @@ endpoint_t fs_e; /*===========================================================================* * req_utime * *===========================================================================*/ -PUBLIC int req_utime(fs_e, inode_nr, actime, modtime) +int req_utime(fs_e, inode_nr, actime, modtime) endpoint_t fs_e; ino_t inode_nr; time_t actime; diff --git a/servers/vfs/select.c b/servers/vfs/select.c index b517b83e9..e6bd6a1b3 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -24,7 +24,7 @@ #define FROM_PROC 0 #define TO_PROC 1 -PRIVATE struct selectentry { +static struct selectentry { struct fproc *requestor; /* slot is free iff this is NULL */ endpoint_t req_endpt; fd_set readfds, writefds, errorfds; @@ -39,30 +39,30 @@ PRIVATE struct selectentry { timer_t timer; /* if expiry > 0 */ } selecttab[MAXSELECTS]; -FORWARD int copy_fdsets(struct selectentry *se, int nfds, int +static int copy_fdsets(struct selectentry *se, int nfds, int direction); -FORWARD int do_select_request(struct selectentry *se, int fd, int *ops); -FORWARD void filp_status(struct filp *fp, int status); -FORWARD int is_deferred(struct selectentry *se); -FORWARD void restart_proc(struct selectentry *se); -FORWARD void ops2tab(int ops, int fd, struct selectentry *e); -FORWARD int is_regular_file(struct filp *f); -FORWARD int is_pipe(struct filp *f); -FORWARD int is_supported_major(struct filp *f); -FORWARD void select_lock_filp(struct filp *f, int ops); -FORWARD int select_request_async(struct filp *f, int *ops, int block); -FORWARD int select_request_file(struct filp *f, int *ops, int block); -FORWARD int select_request_major(struct filp *f, int *ops, int block); -FORWARD int select_request_pipe(struct filp *f, int *ops, int block); -FORWARD int select_request_sync(struct filp *f, int *ops, int block); -FORWARD void select_cancel_all(struct selectentry *e); -FORWARD void select_cancel_filp(struct filp *f); -FORWARD void select_return(struct selectentry *); -FORWARD void select_restart_filps(void); -FORWARD int tab2ops(int fd, struct selectentry *e); -FORWARD void wipe_select(struct selectentry *s); - -PRIVATE struct fdtype { +static int do_select_request(struct selectentry *se, int fd, int *ops); +static void filp_status(struct filp *fp, int status); +static int is_deferred(struct selectentry *se); +static void restart_proc(struct selectentry *se); +static void ops2tab(int ops, int fd, struct selectentry *e); +static int is_regular_file(struct filp *f); +static int is_pipe(struct filp *f); +static int is_supported_major(struct filp *f); +static void select_lock_filp(struct filp *f, int ops); +static int select_request_async(struct filp *f, int *ops, int block); +static int select_request_file(struct filp *f, int *ops, int block); +static int select_request_major(struct filp *f, int *ops, int block); +static int select_request_pipe(struct filp *f, int *ops, int block); +static int select_request_sync(struct filp *f, int *ops, int block); +static void select_cancel_all(struct selectentry *e); +static void select_cancel_filp(struct filp *f); +static void select_return(struct selectentry *); +static void select_restart_filps(void); +static int tab2ops(int fd, struct selectentry *e); +static void wipe_select(struct selectentry *s); + +static struct fdtype { int (*select_request)(struct filp *, int *ops, int block); int (*type_match)(struct filp *f); } fdtypes[] = { @@ -71,7 +71,7 @@ PRIVATE struct fdtype { { select_request_pipe, is_pipe }, }; #define SEL_FDS (sizeof(fdtypes) / sizeof(fdtypes[0])) -PRIVATE int select_majors[] = { /* List of majors that support selecting on */ +static int select_majors[] = { /* List of majors that support selecting on */ TTY_MAJOR, INET_MAJOR, UDS_MAJOR, @@ -82,7 +82,7 @@ PRIVATE int select_majors[] = { /* List of majors that support selecting on */ /*===========================================================================* * do_select * *===========================================================================*/ -PUBLIC int do_select(void) +int do_select(void) { /* Implement the select(nfds, readfds, writefds, errorfds, timeout) system * call. First we copy the arguments and verify their sanity. Then we check @@ -270,7 +270,7 @@ PUBLIC int do_select(void) /*===========================================================================* * is_deferred * *===========================================================================*/ -PRIVATE int is_deferred(struct selectentry *se) +static int is_deferred(struct selectentry *se) { /* Find out whether this select has pending initial replies */ @@ -289,7 +289,7 @@ PRIVATE int is_deferred(struct selectentry *se) /*===========================================================================* * is_regular_file * *===========================================================================*/ -PRIVATE int is_regular_file(struct filp *f) +static int is_regular_file(struct filp *f) { return(f && f->filp_vno && (f->filp_vno->v_mode & I_TYPE) == I_REGULAR); } @@ -297,7 +297,7 @@ PRIVATE int is_regular_file(struct filp *f) /*===========================================================================* * is_pipe * *===========================================================================*/ -PRIVATE int is_pipe(struct filp *f) +static int is_pipe(struct filp *f) { /* Recognize either anonymous pipe or named pipe (FIFO) */ return(f && f->filp_vno && (f->filp_vno->v_mode & I_TYPE) == I_NAMED_PIPE); @@ -306,7 +306,7 @@ PRIVATE int is_pipe(struct filp *f) /*===========================================================================* * is_supported_major * *===========================================================================*/ -PRIVATE int is_supported_major(struct filp *f) +static int is_supported_major(struct filp *f) { /* See if this filp is a handle on a device on which we support select() */ int m; @@ -324,7 +324,7 @@ PRIVATE int is_supported_major(struct filp *f) /*===========================================================================* * select_request_async * *===========================================================================*/ -PRIVATE int select_request_async(struct filp *f, int *ops, int block) +static int select_request_async(struct filp *f, int *ops, int block) { int r, rops, major; struct dmap *dp; @@ -385,7 +385,7 @@ PRIVATE int select_request_async(struct filp *f, int *ops, int block) /*===========================================================================* * select_request_file * *===========================================================================*/ -PRIVATE int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops), +static int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops), int UNUSED(block)) { /* Files are always ready, so output *ops is input *ops */ @@ -395,7 +395,7 @@ PRIVATE int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops), /*===========================================================================* * select_request_major * *===========================================================================*/ -PRIVATE int select_request_major(struct filp *f, int *ops, int block) +static int select_request_major(struct filp *f, int *ops, int block) { int major, r; @@ -414,7 +414,7 @@ PRIVATE int select_request_major(struct filp *f, int *ops, int block) /*===========================================================================* * select_request_sync * *===========================================================================*/ -PRIVATE int select_request_sync(struct filp *f, int *ops, int block) +static int select_request_sync(struct filp *f, int *ops, int block) { int rops; @@ -431,7 +431,7 @@ PRIVATE int select_request_sync(struct filp *f, int *ops, int block) /*===========================================================================* * select_request_pipe * *===========================================================================*/ -PRIVATE int select_request_pipe(struct filp *f, int *ops, int block) +static int select_request_pipe(struct filp *f, int *ops, int block) { int orig_ops, r = 0, err; @@ -479,7 +479,7 @@ PRIVATE int select_request_pipe(struct filp *f, int *ops, int block) /*===========================================================================* * tab2ops * *===========================================================================*/ -PRIVATE int tab2ops(int fd, struct selectentry *e) +static int tab2ops(int fd, struct selectentry *e) { int ops = 0; if (FD_ISSET(fd, &e->readfds)) ops |= SEL_RD; @@ -493,7 +493,7 @@ PRIVATE int tab2ops(int fd, struct selectentry *e) /*===========================================================================* * ops2tab * *===========================================================================*/ -PRIVATE void ops2tab(int ops, int fd, struct selectentry *e) +static void ops2tab(int ops, int fd, struct selectentry *e) { if ((ops & SEL_RD) && e->vir_readfds && FD_ISSET(fd, &e->readfds) && !FD_ISSET(fd, &e->ready_readfds)) { @@ -518,7 +518,7 @@ PRIVATE void ops2tab(int ops, int fd, struct selectentry *e) /*===========================================================================* * copy_fdsets * *===========================================================================*/ -PRIVATE int copy_fdsets(struct selectentry *se, int nfds, int direction) +static int copy_fdsets(struct selectentry *se, int nfds, int direction) { int r; size_t fd_setsize; @@ -573,7 +573,7 @@ PRIVATE int copy_fdsets(struct selectentry *se, int nfds, int direction) /*===========================================================================* * select_cancel_all * *===========================================================================*/ -PRIVATE void select_cancel_all(struct selectentry *se) +static void select_cancel_all(struct selectentry *se) { /* Cancel select. Decrease select usage and cancel timer */ @@ -597,7 +597,7 @@ PRIVATE void select_cancel_all(struct selectentry *se) /*===========================================================================* * select_cancel_filp * *===========================================================================*/ -PRIVATE void select_cancel_filp(struct filp *f) +static void select_cancel_filp(struct filp *f) { /* Reduce number of select users of this filp */ @@ -622,7 +622,7 @@ PRIVATE void select_cancel_filp(struct filp *f) /*===========================================================================* * select_return * *===========================================================================*/ -PRIVATE void select_return(struct selectentry *se) +static void select_return(struct selectentry *se) { int r, r1; @@ -645,7 +645,7 @@ PRIVATE void select_return(struct selectentry *se) /*===========================================================================* * select_callback * *===========================================================================*/ -PUBLIC void select_callback(struct filp *f, int status) +void select_callback(struct filp *f, int status) { filp_status(f, status); } @@ -653,7 +653,7 @@ PUBLIC void select_callback(struct filp *f, int status) /*===========================================================================* * init_select * *===========================================================================*/ -PUBLIC void init_select(void) +void init_select(void) { int s; @@ -665,7 +665,7 @@ PUBLIC void init_select(void) /*===========================================================================* * select_forget * *===========================================================================*/ -PUBLIC void select_forget(endpoint_t proc_e) +void select_forget(endpoint_t proc_e) { /* Something has happened (e.g. signal delivered that interrupts select()). * Totally forget about the select(). */ @@ -690,7 +690,7 @@ PUBLIC void select_forget(endpoint_t proc_e) /*===========================================================================* * select_timeout_check * *===========================================================================*/ -PUBLIC void select_timeout_check(timer_t *timer) +void select_timeout_check(timer_t *timer) { int s; struct selectentry *se; @@ -711,7 +711,7 @@ PUBLIC void select_timeout_check(timer_t *timer) /*===========================================================================* * select_unsuspend_by_endpt * *===========================================================================*/ -PUBLIC void select_unsuspend_by_endpt(endpoint_t proc_e) +void select_unsuspend_by_endpt(endpoint_t proc_e) { /* Revive blocked processes when a driver has disappeared */ @@ -750,7 +750,7 @@ PUBLIC void select_unsuspend_by_endpt(endpoint_t proc_e) /*===========================================================================* * select_reply1 * *===========================================================================*/ -PUBLIC void select_reply1(driver_e, minor, status) +void select_reply1(driver_e, minor, status) endpoint_t driver_e; int minor; int status; @@ -842,7 +842,7 @@ int status; /*===========================================================================* * select_reply2 * *===========================================================================*/ -PUBLIC void select_reply2(driver_e, minor, status) +void select_reply2(driver_e, minor, status) endpoint_t driver_e; int minor; int status; @@ -912,7 +912,7 @@ int status; /*===========================================================================* * select_restart_filps * *===========================================================================*/ -PRIVATE void select_restart_filps() +static void select_restart_filps() { int fd, slot; struct filp *f; @@ -954,7 +954,7 @@ PRIVATE void select_restart_filps() /*===========================================================================* * do_select_request * *===========================================================================*/ -PRIVATE int do_select_request(se, fd, ops) +static int do_select_request(se, fd, ops) struct selectentry *se; int fd; int *ops; @@ -981,7 +981,7 @@ int *ops; /*===========================================================================* * filp_status * *===========================================================================*/ -PRIVATE void filp_status(f, status) +static void filp_status(f, status) struct filp *f; int status; { @@ -1007,7 +1007,7 @@ int status; /*===========================================================================* * restart_proc * *===========================================================================*/ -PRIVATE void restart_proc(se) +static void restart_proc(se) struct selectentry *se; { /* Tell process about select results (if any) unless there are still results @@ -1020,7 +1020,7 @@ struct selectentry *se; /*===========================================================================* * wipe_select * *===========================================================================*/ -PRIVATE void wipe_select(struct selectentry *se) +static void wipe_select(struct selectentry *se) { se->nfds = 0; se->nreadyfds = 0; @@ -1039,7 +1039,7 @@ PRIVATE void wipe_select(struct selectentry *se) /*===========================================================================* * select_lock_filp * *===========================================================================*/ -PRIVATE void select_lock_filp(struct filp *f, int ops) +static void select_lock_filp(struct filp *f, int ops) { /* Lock a filp and vnode based on which operations are requested */ tll_access_t locktype;; diff --git a/servers/vfs/stadir.c b/servers/vfs/stadir.c index 48f483e9c..d0692624d 100644 --- a/servers/vfs/stadir.c +++ b/servers/vfs/stadir.c @@ -27,13 +27,13 @@ #include "vnode.h" #include "vmnt.h" -FORWARD int change(struct vnode **iip, char *name_ptr, int len); -FORWARD int change_into(struct vnode **iip, struct vnode *vp); +static int change(struct vnode **iip, char *name_ptr, int len); +static int change_into(struct vnode **iip, struct vnode *vp); /*===========================================================================* * do_fchdir * *===========================================================================*/ -PUBLIC int do_fchdir() +int do_fchdir() { /* Change directory on already-opened fd. */ struct filp *rfilp; @@ -49,7 +49,7 @@ PUBLIC int do_fchdir() /*===========================================================================* * do_chdir * *===========================================================================*/ -PUBLIC int do_chdir() +int do_chdir() { /* Perform the chdir(name) system call. */ @@ -59,7 +59,7 @@ PUBLIC int do_chdir() /*===========================================================================* * do_chroot * *===========================================================================*/ -PUBLIC int do_chroot() +int do_chroot() { /* Perform the chroot(name) system call. */ @@ -70,7 +70,7 @@ PUBLIC int do_chroot() /*===========================================================================* * change * *===========================================================================*/ -PRIVATE int change(iip, name_ptr, len) +static int change(iip, name_ptr, len) struct vnode **iip; /* pointer to the inode pointer for the dir */ char *name_ptr; /* pointer to the directory name to change to */ int len; /* length of the directory name string */ @@ -99,7 +99,7 @@ int len; /* length of the directory name string */ /*===========================================================================* * change_into * *===========================================================================*/ -PRIVATE int change_into(iip, vp) +static int change_into(iip, vp) struct vnode **iip; /* pointer to the inode pointer for the dir */ struct vnode *vp; /* this is what the inode has to become */ { @@ -124,7 +124,7 @@ struct vnode *vp; /* this is what the inode has to become */ /*===========================================================================* * do_stat * *===========================================================================*/ -PUBLIC int do_stat() +int do_stat() { /* Perform the stat(name, buf) system call. */ int r; @@ -156,7 +156,7 @@ PUBLIC int do_stat() /*===========================================================================* * do_fstat * *===========================================================================*/ -PUBLIC int do_fstat() +int do_fstat() { /* Perform the fstat(fd, buf) system call. */ register struct filp *rfilp; @@ -190,7 +190,7 @@ PUBLIC int do_fstat() /*===========================================================================* * do_fstatfs * *===========================================================================*/ -PUBLIC int do_fstatfs() +int do_fstatfs() { /* Perform the fstatfs(fd, buf) system call. */ struct filp *rfilp; @@ -209,7 +209,7 @@ PUBLIC int do_fstatfs() /*===========================================================================* * do_statvfs * *===========================================================================*/ -PUBLIC int do_statvfs() +int do_statvfs() { /* Perform the stat(name, buf) system call. */ int r; @@ -237,7 +237,7 @@ PUBLIC int do_statvfs() /*===========================================================================* * do_fstatvfs * *===========================================================================*/ -PUBLIC int do_fstatvfs() +int do_fstatvfs() { /* Perform the fstat(fd, buf) system call. */ register struct filp *rfilp; @@ -257,7 +257,7 @@ PUBLIC int do_fstatvfs() /*===========================================================================* * do_lstat * *===========================================================================*/ -PUBLIC int do_lstat() +int do_lstat() { /* Perform the lstat(name, buf) system call. */ struct vnode *vp; diff --git a/servers/vfs/table.c b/servers/vfs/table.c index e8952c442..cd4c3e7ba 100644 --- a/servers/vfs/table.c +++ b/servers/vfs/table.c @@ -14,7 +14,7 @@ #include "vnode.h" #include "vmnt.h" -PUBLIC int (*call_vec[])(void) = { +int (*call_vec[])(void) = { no_sys, /* 0 = unused */ no_sys, /* 1 = (exit) */ no_sys, /* 2 = (fork) */ @@ -133,7 +133,7 @@ PUBLIC int (*call_vec[])(void) = { /* This should not fail with "array size is negative": */ extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1]; -PUBLIC int (*pfs_call_vec[])(void) = { +int (*pfs_call_vec[])(void) = { no_sys, /* 0 */ do_check_perms, /* 1 */ diff --git a/servers/vfs/time.c b/servers/vfs/time.c index 29b84e320..ed8d2d47e 100644 --- a/servers/vfs/time.c +++ b/servers/vfs/time.c @@ -18,7 +18,7 @@ /*===========================================================================* * do_utime * *===========================================================================*/ -PUBLIC int do_utime() +int do_utime() { /* Perform the utime(name, timep) system call. */ register int len; diff --git a/servers/vfs/tll.c b/servers/vfs/tll.c index 2fba71027..ca69163ae 100644 --- a/servers/vfs/tll.c +++ b/servers/vfs/tll.c @@ -6,9 +6,9 @@ #include "threads.h" #include -FORWARD int tll_append(tll_t *tllp, tll_access_t locktype); +static int tll_append(tll_t *tllp, tll_access_t locktype); -PRIVATE int tll_append(tll_t *tllp, tll_access_t locktype) +static int tll_append(tll_t *tllp, tll_access_t locktype) { struct worker_thread *queue; @@ -70,7 +70,7 @@ PRIVATE int tll_append(tll_t *tllp, tll_access_t locktype) return(OK); } -PUBLIC void tll_downgrade(tll_t *tllp) +void tll_downgrade(tll_t *tllp) { /* Downgrade three-level-lock tll from write-only to read-serialized, or from * read-serialized to read-only. Caveat: as we can't know whether the next @@ -109,7 +109,7 @@ PUBLIC void tll_downgrade(tll_t *tllp) assert(tllp->t_owner == NULL); } -PUBLIC void tll_init(tll_t *tllp) +void tll_init(tll_t *tllp) { /* Initialize three-level-lock tll */ assert(tllp != NULL); @@ -122,18 +122,18 @@ PUBLIC void tll_init(tll_t *tllp) tllp->t_owner = NULL; } -PUBLIC int tll_islocked(tll_t *tllp) +int tll_islocked(tll_t *tllp) { return(tllp->t_current != TLL_NONE); } -PUBLIC int tll_locked_by_me(tll_t *tllp) +int tll_locked_by_me(tll_t *tllp) { assert(self != NULL); return(tllp->t_owner == self && !(tllp->t_status & TLL_PEND)); } -PUBLIC int tll_lock(tll_t *tllp, tll_access_t locktype) +int tll_lock(tll_t *tllp, tll_access_t locktype) { /* Try to lock three-level-lock tll with type locktype */ @@ -210,7 +210,7 @@ PUBLIC int tll_lock(tll_t *tllp, tll_access_t locktype) return(OK); } -PUBLIC int tll_haspendinglock(tll_t *tllp) +int tll_haspendinglock(tll_t *tllp) { /* Is someone trying to obtain a lock? */ assert(tllp != NULL); @@ -220,7 +220,7 @@ PUBLIC int tll_haspendinglock(tll_t *tllp) return(tllp->t_write != NULL || tllp->t_serial != NULL); } -PUBLIC int tll_unlock(tll_t *tllp) +int tll_unlock(tll_t *tllp) { /* Unlock a previously locked three-level-lock tll */ int signal_owner = 0; @@ -293,7 +293,7 @@ PUBLIC int tll_unlock(tll_t *tllp) return(OK); } -PUBLIC void tll_upgrade(tll_t *tllp) +void tll_upgrade(tll_t *tllp) { /* Upgrade three-level-lock tll from read-serialized to write-only */ diff --git a/servers/vfs/utility.c b/servers/vfs/utility.c index 71922d84a..fb8fd9f11 100644 --- a/servers/vfs/utility.c +++ b/servers/vfs/utility.c @@ -25,7 +25,7 @@ /*===========================================================================* * fetch_name * *===========================================================================*/ -PUBLIC int fetch_name(path, len, flag, dest) +int fetch_name(path, len, flag, dest) char *path; /* pointer to the path in user space */ int len; /* path length, including 0 byte */ int flag; /* M3 means path may be in message */ @@ -74,7 +74,7 @@ char *dest; /* pointer to where path is to be stored */ /*===========================================================================* * no_sys * *===========================================================================*/ -PUBLIC int no_sys() +int no_sys() { /* Somebody has used an illegal system call number */ return(ENOSYS); @@ -84,7 +84,7 @@ PUBLIC int no_sys() /*===========================================================================* * isokendpt_f * *===========================================================================*/ -PUBLIC int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int fatal) +int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int fatal) { int failed = 0; endpoint_t ke; @@ -120,7 +120,7 @@ PUBLIC int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int /*===========================================================================* * clock_time * *===========================================================================*/ -PUBLIC time_t clock_time() +time_t clock_time() { /* This routine returns the time in seconds since 1.1.1970. MINIX is an * astrophysically naive system that assumes the earth rotates at a constant @@ -141,7 +141,7 @@ PUBLIC time_t clock_time() /*===========================================================================* * in_group * *===========================================================================*/ -PUBLIC int in_group(struct fproc *rfp, gid_t grp) +int in_group(struct fproc *rfp, gid_t grp) { int i; diff --git a/servers/vfs/vmnt.c b/servers/vfs/vmnt.c index 21f215b75..294b2a3aa 100644 --- a/servers/vfs/vmnt.c +++ b/servers/vfs/vmnt.c @@ -8,8 +8,8 @@ #include #include "fproc.h" -FORWARD int is_vmnt_locked(struct vmnt *vmp); -FORWARD void clear_vmnt(struct vmnt *vmp); +static int is_vmnt_locked(struct vmnt *vmp); +static void clear_vmnt(struct vmnt *vmp); /* Is vmp pointer reasonable? */ #define SANEVMP(v) ((((v) >= &vmnt[0] && (v) < &vmnt[NR_MNTS]))) @@ -22,7 +22,7 @@ FORWARD void clear_vmnt(struct vmnt *vmp); /*===========================================================================* * check_vmnt_locks_by_me * *===========================================================================*/ -PUBLIC void check_vmnt_locks_by_me(struct fproc *rfp) +void check_vmnt_locks_by_me(struct fproc *rfp) { /* Check whether this thread still has locks held on vmnts */ struct vmnt *vmp; @@ -42,7 +42,7 @@ PUBLIC void check_vmnt_locks_by_me(struct fproc *rfp) /*===========================================================================* * check_vmnt_locks * *===========================================================================*/ -PUBLIC void check_vmnt_locks() +void check_vmnt_locks() { struct vmnt *vmp; int count = 0; @@ -62,7 +62,7 @@ PUBLIC void check_vmnt_locks() /*===========================================================================* * mark_vmnt_free * *===========================================================================*/ -PUBLIC void mark_vmnt_free(struct vmnt *vmp) +void mark_vmnt_free(struct vmnt *vmp) { ASSERTVMP(vmp); @@ -73,7 +73,7 @@ PUBLIC void mark_vmnt_free(struct vmnt *vmp) /*===========================================================================* * clear_vmnt * *===========================================================================*/ -PRIVATE void clear_vmnt(struct vmnt *vmp) +static void clear_vmnt(struct vmnt *vmp) { /* Reset vmp to initial parameters */ ASSERTVMP(vmp); @@ -92,7 +92,7 @@ PRIVATE void clear_vmnt(struct vmnt *vmp) /*===========================================================================* * get_free_vmnt * *===========================================================================*/ -PUBLIC struct vmnt *get_free_vmnt(void) +struct vmnt *get_free_vmnt(void) { struct vmnt *vmp; @@ -109,7 +109,7 @@ PUBLIC struct vmnt *get_free_vmnt(void) /*===========================================================================* * find_vmnt * *===========================================================================*/ -PUBLIC struct vmnt *find_vmnt(endpoint_t fs_e) +struct vmnt *find_vmnt(endpoint_t fs_e) { /* Find the vmnt belonging to an FS with endpoint 'fs_e' iff it's in use */ struct vmnt *vp; @@ -124,7 +124,7 @@ PUBLIC struct vmnt *find_vmnt(endpoint_t fs_e) /*===========================================================================* * init_vmnts * *===========================================================================*/ -PUBLIC void init_vmnts(void) +void init_vmnts(void) { /* Initialize vmnt table */ struct vmnt *vmp; @@ -138,7 +138,7 @@ PUBLIC void init_vmnts(void) /*===========================================================================* * is_vmnt_locked * *===========================================================================*/ -PRIVATE int is_vmnt_locked(struct vmnt *vmp) +static int is_vmnt_locked(struct vmnt *vmp) { ASSERTVMP(vmp); return(tll_islocked(&vmp->m_lock) || tll_haspendinglock(&vmp->m_lock)); @@ -147,7 +147,7 @@ PRIVATE int is_vmnt_locked(struct vmnt *vmp) /*===========================================================================* * lock_vmnt * *===========================================================================*/ -PUBLIC int lock_vmnt(struct vmnt *vmp, tll_access_t locktype) +int lock_vmnt(struct vmnt *vmp, tll_access_t locktype) { int r; tll_access_t initial_locktype; @@ -177,7 +177,7 @@ PUBLIC int lock_vmnt(struct vmnt *vmp, tll_access_t locktype) /*===========================================================================* * vmnt_unmap_by_endpoint * *===========================================================================*/ -PUBLIC void vmnt_unmap_by_endpt(endpoint_t proc_e) +void vmnt_unmap_by_endpt(endpoint_t proc_e) { struct vmnt *vmp; @@ -196,7 +196,7 @@ PUBLIC void vmnt_unmap_by_endpt(endpoint_t proc_e) /*===========================================================================* * unlock_vmnt * *===========================================================================*/ -PUBLIC void unlock_vmnt(struct vmnt *vmp) +void unlock_vmnt(struct vmnt *vmp) { ASSERTVMP(vmp); diff --git a/servers/vfs/vnode.c b/servers/vfs/vnode.c index ad854f732..d7d14e4ab 100644 --- a/servers/vfs/vnode.c +++ b/servers/vfs/vnode.c @@ -42,7 +42,7 @@ /*===========================================================================* * check_vnode_locks_by_me * *===========================================================================*/ -PUBLIC void check_vnode_locks_by_me(struct fproc *rfp) +void check_vnode_locks_by_me(struct fproc *rfp) { /* Check whether this thread still has locks held on vnodes */ struct vnode *vp; @@ -63,7 +63,7 @@ PUBLIC void check_vnode_locks_by_me(struct fproc *rfp) /*===========================================================================* * check_vnode_locks * *===========================================================================*/ -PUBLIC void check_vnode_locks() +void check_vnode_locks() { struct vnode *vp; int count = 0; @@ -82,7 +82,7 @@ PUBLIC void check_vnode_locks() /*===========================================================================* * get_free_vnode * *===========================================================================*/ -PUBLIC struct vnode *get_free_vnode() +struct vnode *get_free_vnode() { /* Find a free vnode slot in the vnode table (it's not actually allocated) */ struct vnode *vp; @@ -108,7 +108,7 @@ PUBLIC struct vnode *get_free_vnode() /*===========================================================================* * find_vnode * *===========================================================================*/ -PUBLIC struct vnode *find_vnode(int fs_e, int ino) +struct vnode *find_vnode(int fs_e, int ino) { /* Find a specified (FS endpoint and inode number) vnode in the * vnode table */ @@ -124,7 +124,7 @@ PUBLIC struct vnode *find_vnode(int fs_e, int ino) /*===========================================================================* * is_vnode_locked * *===========================================================================*/ -PUBLIC int is_vnode_locked(struct vnode *vp) +int is_vnode_locked(struct vnode *vp) { /* Find out whether a thread holds a lock on this vnode or is trying to obtain * a lock. */ @@ -136,7 +136,7 @@ PUBLIC int is_vnode_locked(struct vnode *vp) /*===========================================================================* * init_vnodes * *===========================================================================*/ -PUBLIC void init_vnodes(void) +void init_vnodes(void) { struct vnode *vp; @@ -154,7 +154,7 @@ PUBLIC void init_vnodes(void) /*===========================================================================* * lock_vnode * *===========================================================================*/ -PUBLIC int lock_vnode(struct vnode *vp, tll_access_t locktype) +int lock_vnode(struct vnode *vp, tll_access_t locktype) { int r; @@ -175,7 +175,7 @@ PUBLIC int lock_vnode(struct vnode *vp, tll_access_t locktype) /*===========================================================================* * unlock_vnode * *===========================================================================*/ -PUBLIC void unlock_vnode(struct vnode *vp) +void unlock_vnode(struct vnode *vp) { #if LOCK_DEBUG int i; @@ -216,7 +216,7 @@ PUBLIC void unlock_vnode(struct vnode *vp) /*===========================================================================* * dup_vnode * *===========================================================================*/ -PUBLIC void dup_vnode(struct vnode *vp) +void dup_vnode(struct vnode *vp) { /* dup_vnode() is called to increment the vnode and therefore the * referred inode's counter. @@ -229,7 +229,7 @@ PUBLIC void dup_vnode(struct vnode *vp) /*===========================================================================* * put_vnode * *===========================================================================*/ -PUBLIC void put_vnode(struct vnode *vp) +void put_vnode(struct vnode *vp) { /* Decrease vnode's usage counter and decrease inode's usage counter in the * corresponding FS process. Decreasing the fs_count each time we decrease the @@ -294,7 +294,7 @@ PUBLIC void put_vnode(struct vnode *vp) /*===========================================================================* * vnode_clean_refs * *===========================================================================*/ -PUBLIC void vnode_clean_refs(struct vnode *vp) +void vnode_clean_refs(struct vnode *vp) { /* Tell the underlying FS to drop all reference but one. */ @@ -313,7 +313,7 @@ PUBLIC void vnode_clean_refs(struct vnode *vp) /*===========================================================================* * check_vrefs * *===========================================================================*/ -PUBLIC int check_vrefs() +int check_vrefs() { int i, bad; int ispipe_flag, ispipe_mode; diff --git a/servers/vfs/worker.c b/servers/vfs/worker.c index aa6a045c7..d380608a7 100644 --- a/servers/vfs/worker.c +++ b/servers/vfs/worker.c @@ -5,15 +5,15 @@ #include "job.h" #include -FORWARD void append_job(struct job *job, void *(*func)(void *arg)); -FORWARD void get_work(struct worker_thread *worker); -FORWARD void *worker_main(void *arg); -FORWARD void worker_sleep(struct worker_thread *worker); -FORWARD void worker_wake(struct worker_thread *worker); -FORWARD int worker_waiting_for(struct worker_thread *worker, endpoint_t +static void append_job(struct job *job, void *(*func)(void *arg)); +static void get_work(struct worker_thread *worker); +static void *worker_main(void *arg); +static void worker_sleep(struct worker_thread *worker); +static void worker_wake(struct worker_thread *worker); +static int worker_waiting_for(struct worker_thread *worker, endpoint_t proc_e); -PRIVATE int init = 0; -PRIVATE mthread_attr_t tattr; +static int init = 0; +static mthread_attr_t tattr; #ifdef MKCOVERAGE # define TH_STACKSIZE (10 * 1024) @@ -27,7 +27,7 @@ PRIVATE mthread_attr_t tattr; /*===========================================================================* * worker_init * *===========================================================================*/ -PUBLIC void worker_init(struct worker_thread *wp) +void worker_init(struct worker_thread *wp) { /* Initialize worker thread */ if (!init) { @@ -58,7 +58,7 @@ PUBLIC void worker_init(struct worker_thread *wp) /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(struct worker_thread *worker) +static void get_work(struct worker_thread *worker) { /* Find new work to do. Work can be 'queued', 'pending', or absent. In the * latter case wait for new work to come in. */ @@ -96,7 +96,7 @@ PRIVATE void get_work(struct worker_thread *worker) /*===========================================================================* * worker_available * *===========================================================================*/ -PUBLIC int worker_available(void) +int worker_available(void) { int busy, i; @@ -112,7 +112,7 @@ PUBLIC int worker_available(void) /*===========================================================================* * worker_main * *===========================================================================*/ -PRIVATE void *worker_main(void *arg) +static void *worker_main(void *arg) { /* Worker thread main loop */ struct worker_thread *me; @@ -141,7 +141,7 @@ PRIVATE void *worker_main(void *arg) /*===========================================================================* * dl_worker_start * *===========================================================================*/ -PUBLIC void dl_worker_start(void *(*func)(void *arg)) +void dl_worker_start(void *(*func)(void *arg)) { /* Start the deadlock resolving worker. This worker is reserved to run in case * all other workers are busy and we have to have an additional worker to come @@ -159,7 +159,7 @@ PUBLIC void dl_worker_start(void *(*func)(void *arg)) /*===========================================================================* * sys_worker_start * *===========================================================================*/ -PUBLIC void sys_worker_start(void *(*func)(void *arg)) +void sys_worker_start(void *(*func)(void *arg)) { /* Carry out work for the system (i.e., kernel or PM). If this thread is idle * do it right away, else create new job and append it to the queue. */ @@ -177,7 +177,7 @@ PUBLIC void sys_worker_start(void *(*func)(void *arg)) /*===========================================================================* * append_job * *===========================================================================*/ -PRIVATE void append_job(struct job *job, void *(*func)(void *arg)) +static void append_job(struct job *job, void *(*func)(void *arg)) { /* Append a job */ @@ -201,7 +201,7 @@ PRIVATE void append_job(struct job *job, void *(*func)(void *arg)) /*===========================================================================* * worker_start * *===========================================================================*/ -PUBLIC void worker_start(void *(*func)(void *arg)) +void worker_start(void *(*func)(void *arg)) { /* Find an available worker or wait for one */ int i; @@ -250,7 +250,7 @@ PUBLIC void worker_start(void *(*func)(void *arg)) /*===========================================================================* * worker_sleep * *===========================================================================*/ -PRIVATE void worker_sleep(struct worker_thread *worker) +static void worker_sleep(struct worker_thread *worker) { ASSERTW(worker); assert(self == worker); @@ -266,7 +266,7 @@ PRIVATE void worker_sleep(struct worker_thread *worker) /*===========================================================================* * worker_wake * *===========================================================================*/ -PRIVATE void worker_wake(struct worker_thread *worker) +static void worker_wake(struct worker_thread *worker) { /* Signal a worker to wake up */ ASSERTW(worker); @@ -281,7 +281,7 @@ PRIVATE void worker_wake(struct worker_thread *worker) /*===========================================================================* * worker_wait * *===========================================================================*/ -PUBLIC void worker_wait(void) +void worker_wait(void) { struct worker_thread *worker; @@ -300,7 +300,7 @@ PUBLIC void worker_wait(void) /*===========================================================================* * worker_signal * *===========================================================================*/ -PUBLIC void worker_signal(struct worker_thread *worker) +void worker_signal(struct worker_thread *worker) { ASSERTW(worker); /* Make sure we have a valid thread */ worker_wake(worker); @@ -309,7 +309,7 @@ PUBLIC void worker_signal(struct worker_thread *worker) /*===========================================================================* * worker_stop * *===========================================================================*/ -PUBLIC void worker_stop(struct worker_thread *worker) +void worker_stop(struct worker_thread *worker) { ASSERTW(worker); /* Make sure we have a valid thread */ if (worker->w_job.j_fp) @@ -322,7 +322,7 @@ PUBLIC void worker_stop(struct worker_thread *worker) /*===========================================================================* * worker_stop_by_endpt * *===========================================================================*/ -PUBLIC void worker_stop_by_endpt(endpoint_t proc_e) +void worker_stop_by_endpt(endpoint_t proc_e) { struct worker_thread *worker; int i; @@ -342,7 +342,7 @@ PUBLIC void worker_stop_by_endpt(endpoint_t proc_e) /*===========================================================================* * worker_self * *===========================================================================*/ -PUBLIC struct worker_thread *worker_self(void) +struct worker_thread *worker_self(void) { struct worker_thread *worker; worker = worker_get(mthread_self()); @@ -353,7 +353,7 @@ PUBLIC struct worker_thread *worker_self(void) /*===========================================================================* * worker_get * *===========================================================================*/ -PUBLIC struct worker_thread *worker_get(thread_t worker_tid) +struct worker_thread *worker_get(thread_t worker_tid) { int i; struct worker_thread *worker; @@ -378,7 +378,7 @@ PUBLIC struct worker_thread *worker_get(thread_t worker_tid) /*===========================================================================* * worker_getjob * *===========================================================================*/ -PUBLIC struct job *worker_getjob(thread_t worker_tid) +struct job *worker_getjob(thread_t worker_tid) { struct worker_thread *worker; @@ -391,7 +391,7 @@ PUBLIC struct job *worker_getjob(thread_t worker_tid) /*===========================================================================* * worker_waiting_for * *===========================================================================*/ -PRIVATE int worker_waiting_for(struct worker_thread *worker, endpoint_t proc_e) +static int worker_waiting_for(struct worker_thread *worker, endpoint_t proc_e) { ASSERTW(worker); /* Make sure we have a valid thread */ diff --git a/servers/vfs/write.c b/servers/vfs/write.c index a3e9d636e..80975b150 100644 --- a/servers/vfs/write.c +++ b/servers/vfs/write.c @@ -12,7 +12,7 @@ /*===========================================================================* * do_write * *===========================================================================*/ -PUBLIC int do_write() +int do_write() { /* Perform the write(fd, buffer, nbytes) system call. */ return(do_read_write(WRITING)); diff --git a/servers/vm/alloc.c b/servers/vm/alloc.c index c8cfb27ad..37ceb5b92 100644 --- a/servers/vm/alloc.c +++ b/servers/vm/alloc.c @@ -47,7 +47,7 @@ addr_avl addravl; /* Used for sanity check. */ -PRIVATE phys_bytes mem_low, mem_high; +static phys_bytes mem_low, mem_high; struct hole { struct hole *h_next; /* pointer to next entry on the list */ @@ -60,24 +60,24 @@ struct hole { #define _NR_HOLES (_NR_PROCS*2) /* No. of memory holes maintained by VM */ -PRIVATE struct hole hole[_NR_HOLES]; +static struct hole hole[_NR_HOLES]; -PRIVATE struct hole *hole_head; /* pointer to first hole */ -PRIVATE struct hole *free_slots;/* ptr to list of unused table slots */ +static struct hole *hole_head; /* pointer to first hole */ +static struct hole *free_slots;/* ptr to list of unused table slots */ -FORWARD void del_slot(struct hole *prev_ptr, struct hole *hp); -FORWARD void merge(struct hole *hp); -FORWARD void free_pages(phys_bytes addr, int pages); -FORWARD phys_bytes alloc_pages(int pages, int flags, phys_bytes *ret); +static void del_slot(struct hole *prev_ptr, struct hole *hp); +static void merge(struct hole *hp); +static void free_pages(phys_bytes addr, int pages); +static phys_bytes alloc_pages(int pages, int flags, phys_bytes *ret); #if SANITYCHECKS -FORWARD void holes_sanity_f(char *fn, int line); +static void holes_sanity_f(char *fn, int line); #define CHECKHOLES holes_sanity_f(__FILE__, __LINE__) #define PAGESPERGB (1024*1024*1024/VM_PAGE_SIZE) /* 1GB of memory */ #define MAXPAGES (2*PAGESPERGB) #define CHUNKS BITMAP_CHUNKS(MAXPAGES) -PRIVATE bitchunk_t pagemap[CHUNKS]; +static bitchunk_t pagemap[CHUNKS]; #else #define CHECKHOLES @@ -88,7 +88,7 @@ PRIVATE bitchunk_t pagemap[CHUNKS]; /*===========================================================================* * holes_sanity_f * *===========================================================================*/ -PRIVATE void holes_sanity_f(file, line) +static void holes_sanity_f(file, line) char *file; int line; { @@ -158,7 +158,7 @@ int line; /*===========================================================================* * alloc_mem * *===========================================================================*/ -PUBLIC phys_clicks alloc_mem(phys_clicks clicks, u32_t memflags) +phys_clicks alloc_mem(phys_clicks clicks, u32_t memflags) { /* Allocate a block of memory from the free list using first fit. The block * consists of a sequence of contiguous bytes, whose length in clicks is @@ -202,7 +202,7 @@ CHECKHOLES; /*===========================================================================* * free_mem * *===========================================================================*/ -PUBLIC void free_mem(phys_clicks base, phys_clicks clicks) +void free_mem(phys_clicks base, phys_clicks clicks) { /* Return a block of free memory to the hole list. The parameters tell where * the block starts in physical memory and how big it is. The block is added @@ -255,7 +255,7 @@ CHECKHOLES; /*===========================================================================* * del_slot * *===========================================================================*/ -PRIVATE void del_slot(prev_ptr, hp) +static void del_slot(prev_ptr, hp) /* pointer to hole entry just ahead of 'hp' */ register struct hole *prev_ptr; /* pointer to hole entry to be removed */ @@ -279,7 +279,7 @@ register struct hole *hp; /*===========================================================================* * merge * *===========================================================================*/ -PRIVATE void merge(hp) +static void merge(hp) register struct hole *hp; /* ptr to hole to merge with its successors */ { /* Check for contiguous holes and merge any found. Contiguous holes can occur @@ -313,7 +313,7 @@ register struct hole *hp; /* ptr to hole to merge with its successors */ /*===========================================================================* * mem_init * *===========================================================================*/ -PUBLIC void mem_init(chunks) +void mem_init(chunks) struct memory *chunks; /* list of free memory chunks */ { /* Initialize hole lists. There are two lists: 'hole_head' points to a linked @@ -358,7 +358,7 @@ struct memory *chunks; /* list of free memory chunks */ } #if SANITYCHECKS -PRIVATE void sanitycheck(void) +static void sanitycheck(void) { pagerange_t *p, *prevp = NULL; addr_iter iter; @@ -375,7 +375,7 @@ PRIVATE void sanitycheck(void) } #endif -PUBLIC void memstats(int *nodes, int *pages, int *largest) +void memstats(int *nodes, int *pages, int *largest) { pagerange_t *p; addr_iter iter; @@ -399,7 +399,7 @@ PUBLIC void memstats(int *nodes, int *pages, int *largest) /*===========================================================================* * alloc_pages * *===========================================================================*/ -PRIVATE PUBLIC phys_bytes alloc_pages(int pages, int memflags, phys_bytes *len) +static phys_bytes alloc_pages(int pages, int memflags, phys_bytes *len) { addr_iter iter; pagerange_t *pr; @@ -525,7 +525,7 @@ PRIVATE PUBLIC phys_bytes alloc_pages(int pages, int memflags, phys_bytes *len) /*===========================================================================* * free_pages * *===========================================================================*/ -PRIVATE void free_pages(phys_bytes pageno, int npages) +static void free_pages(phys_bytes pageno, int npages) { pagerange_t *pr, *p; addr_iter iter; @@ -602,7 +602,7 @@ PRIVATE void free_pages(phys_bytes pageno, int npages) #define NR_DMA 16 -PRIVATE struct dmatab +static struct dmatab { int dt_flags; endpoint_t dt_proc; @@ -619,7 +619,7 @@ PRIVATE struct dmatab /*===========================================================================* * do_adddma * *===========================================================================*/ -PUBLIC int do_adddma(message *msg) +int do_adddma(message *msg) { endpoint_t target_proc_e; int i, proc_n; @@ -671,7 +671,7 @@ PUBLIC int do_adddma(message *msg) /*===========================================================================* * do_deldma * *===========================================================================*/ -PUBLIC int do_deldma(message *msg) +int do_deldma(message *msg) { endpoint_t target_proc_e; int i, j; @@ -729,7 +729,7 @@ PUBLIC int do_deldma(message *msg) /*===========================================================================* * do_getdma * *===========================================================================*/ -PUBLIC int do_getdma(message *msg) +int do_getdma(message *msg) { int i; @@ -760,7 +760,7 @@ PUBLIC int do_getdma(message *msg) /*===========================================================================* * release_dma * *===========================================================================*/ -PUBLIC void release_dma(struct vmproc *vmp) +void release_dma(struct vmproc *vmp) { #if 0 int i, found_one; diff --git a/servers/vm/arch/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c index 9d665e8c4..73f930ae6 100644 --- a/servers/vm/arch/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -38,16 +38,16 @@ /* Free PDE slots we tell kernel about */ #define FREE_PDES 2 -PRIVATE int first_free_pde = -1; +static int first_free_pde = -1; /* PDE used to map in kernel, kernel physical address. */ -PRIVATE int id_map_high_pde = -1, pagedir_pde = -1; -PRIVATE u32_t global_bit = 0, pagedir_pde_val; +static int id_map_high_pde = -1, pagedir_pde = -1; +static u32_t global_bit = 0, pagedir_pde_val; -PRIVATE int proc_pde = 0; +static int proc_pde = 0; /* 4MB page size available in hardware? */ -PRIVATE int bigpage_ok = 0; +static int bigpage_ok = 0; /* Our process table entry. */ struct vmproc *vmprocess = &vmproc[VM_PROC_NR]; @@ -58,13 +58,13 @@ struct vmproc *vmprocess = &vmproc[VM_PROC_NR]; */ #define SPAREPAGES 25 int missing_spares = SPAREPAGES; -PRIVATE struct { +static struct { void *page; phys_bytes phys; } sparepages[SPAREPAGES]; #define MAX_KERNMAPPINGS 10 -PRIVATE struct { +static struct { phys_bytes phys_addr; /* Physical addr. */ phys_bytes len; /* Length in bytes. */ vir_bytes lin_addr; /* Offset in page table. */ @@ -95,13 +95,13 @@ u32_t *page_directories = NULL; #define STATIC_SPAREPAGES 10 -PRIVATE char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES + I386_PAGE_SIZE]; +static char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES + I386_PAGE_SIZE]; #if SANITYCHECKS /*===========================================================================* * pt_sanitycheck * *===========================================================================*/ -PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line) +void pt_sanitycheck(pt_t *pt, char *file, int line) { /* Basic pt sanity check. */ int i; @@ -143,7 +143,7 @@ PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line) /*===========================================================================* * findhole * *===========================================================================*/ -PRIVATE u32_t findhole(pt_t *pt, u32_t vmin, u32_t vmax) +static u32_t findhole(pt_t *pt, u32_t vmin, u32_t vmax) { /* Find a space in the virtual address space of pageteble 'pt', * between page-aligned BYTE offsets vmin and vmax, to fit @@ -202,7 +202,7 @@ PRIVATE u32_t findhole(pt_t *pt, u32_t vmin, u32_t vmax) /*===========================================================================* * vm_freepages * *===========================================================================*/ -PRIVATE void vm_freepages(vir_bytes vir, vir_bytes phys, int pages, int reason) +static void vm_freepages(vir_bytes vir, vir_bytes phys, int pages, int reason) { assert(reason >= 0 && reason < VMP_CATEGORIES); if(vir >= vmprocess->vm_stacktop) { @@ -230,7 +230,7 @@ PRIVATE void vm_freepages(vir_bytes vir, vir_bytes phys, int pages, int reason) /*===========================================================================* * vm_getsparepage * *===========================================================================*/ -PRIVATE void *vm_getsparepage(phys_bytes *phys) +static void *vm_getsparepage(phys_bytes *phys) { int s; assert(missing_spares >= 0 && missing_spares <= SPAREPAGES); @@ -251,7 +251,7 @@ PRIVATE void *vm_getsparepage(phys_bytes *phys) /*===========================================================================* * vm_checkspares * *===========================================================================*/ -PRIVATE void *vm_checkspares(void) +static void *vm_checkspares(void) { int s, n = 0; static int total = 0, worst = 0; @@ -277,7 +277,7 @@ PRIVATE void *vm_checkspares(void) /*===========================================================================* * vm_allocpage * *===========================================================================*/ -PUBLIC void *vm_allocpage(phys_bytes *phys, int reason) +void *vm_allocpage(phys_bytes *phys, int reason) { /* Allocate a page for use by VM itself. */ phys_bytes newpage; @@ -352,7 +352,7 @@ PUBLIC void *vm_allocpage(phys_bytes *phys, int reason) /*===========================================================================* * vm_pagelock * *===========================================================================*/ -PUBLIC void vm_pagelock(void *vir, int lockflag) +void vm_pagelock(void *vir, int lockflag) { /* Mark a page allocated by vm_allocpage() unwritable, i.e. only for VM. */ vir_bytes m; @@ -384,7 +384,7 @@ PUBLIC void vm_pagelock(void *vir, int lockflag) /*===========================================================================* * vm_addrok * *===========================================================================*/ -PUBLIC int vm_addrok(void *vir, int writeflag) +int vm_addrok(void *vir, int writeflag) { /* Mark a page allocated by vm_allocpage() unwritable, i.e. only for VM. */ pt_t *pt = &vmprocess->vm_pt; @@ -429,7 +429,7 @@ PUBLIC int vm_addrok(void *vir, int writeflag) /*===========================================================================* * pt_ptalloc * *===========================================================================*/ -PRIVATE int pt_ptalloc(pt_t *pt, int pde, u32_t flags) +static int pt_ptalloc(pt_t *pt, int pde, u32_t flags) { /* Allocate a page table and write its address into the page directory. */ int i; @@ -465,7 +465,7 @@ PRIVATE int pt_ptalloc(pt_t *pt, int pde, u32_t flags) /*===========================================================================* * pt_ptalloc_in_range * *===========================================================================*/ -PUBLIC int pt_ptalloc_in_range(pt_t *pt, vir_bytes start, vir_bytes end, +int pt_ptalloc_in_range(pt_t *pt, vir_bytes start, vir_bytes end, u32_t flags, int verify) { /* Allocate all the page tables in the range specified. */ @@ -504,7 +504,7 @@ PUBLIC int pt_ptalloc_in_range(pt_t *pt, vir_bytes start, vir_bytes end, return OK; } -PRIVATE char *ptestr(u32_t pte) +static char *ptestr(u32_t pte) { #define FLAG(constant, name) { \ if(pte & (constant)) { strcat(str, name); strcat(str, " "); } \ @@ -533,7 +533,7 @@ PRIVATE char *ptestr(u32_t pte) /*===========================================================================* * pt_map_in_range * *===========================================================================*/ -PUBLIC int pt_map_in_range(struct vmproc *src_vmp, struct vmproc *dst_vmp, +int pt_map_in_range(struct vmproc *src_vmp, struct vmproc *dst_vmp, vir_bytes start, vir_bytes end) { /* Transfer all the mappings from the pt of the source process to the pt of @@ -585,7 +585,7 @@ PUBLIC int pt_map_in_range(struct vmproc *src_vmp, struct vmproc *dst_vmp, /*===========================================================================* * pt_ptmap * *===========================================================================*/ -PUBLIC int pt_ptmap(struct vmproc *src_vmp, struct vmproc *dst_vmp) +int pt_ptmap(struct vmproc *src_vmp, struct vmproc *dst_vmp) { /* Transfer mappings to page dir and page tables from source process and * destination process. Make sure all the mappings are above the stack, not @@ -642,7 +642,7 @@ PUBLIC int pt_ptmap(struct vmproc *src_vmp, struct vmproc *dst_vmp) return OK; } -PUBLIC void pt_clearmapcache(void) +void pt_clearmapcache(void) { int f; /* Make sure kernel will invalidate tlb when using current @@ -657,7 +657,7 @@ PUBLIC void pt_clearmapcache(void) /*===========================================================================* * pt_writemap * *===========================================================================*/ -PUBLIC int pt_writemap(struct vmproc * vmp, +int pt_writemap(struct vmproc * vmp, pt_t *pt, vir_bytes v, phys_bytes physaddr, @@ -796,7 +796,7 @@ resume_exit: /*===========================================================================* * pt_checkrange * *===========================================================================*/ -PUBLIC int pt_checkrange(pt_t *pt, vir_bytes v, size_t bytes, +int pt_checkrange(pt_t *pt, vir_bytes v, size_t bytes, int write) { int p, pages; @@ -839,7 +839,7 @@ PUBLIC int pt_checkrange(pt_t *pt, vir_bytes v, size_t bytes, /*===========================================================================* * pt_new * *===========================================================================*/ -PUBLIC int pt_new(pt_t *pt) +int pt_new(pt_t *pt) { /* Allocate a pagetable root. On i386, allocate a page-aligned page directory * and set them to 0 (indicating no page tables are allocated). Lookup @@ -877,7 +877,7 @@ PUBLIC int pt_new(pt_t *pt) /*===========================================================================* * pt_init * *===========================================================================*/ -PUBLIC void pt_init(phys_bytes usedlimit) +void pt_init(phys_bytes usedlimit) { /* By default, the kernel gives us a data segment with pre-allocated * memory that then can't grow. We want to be able to allocate memory @@ -1091,7 +1091,7 @@ PUBLIC void pt_init(phys_bytes usedlimit) /*===========================================================================* * pt_init_mem * *===========================================================================*/ -PUBLIC void pt_init_mem() +void pt_init_mem() { /* Architecture-specific memory initialization. Make sure all the pages * shared with the kernel and VM's page tables are mapped above the stack, @@ -1173,7 +1173,7 @@ PUBLIC void pt_init_mem() /*===========================================================================* * pt_bind * *===========================================================================*/ -PUBLIC int pt_bind(pt_t *pt, struct vmproc *who) +int pt_bind(pt_t *pt, struct vmproc *who) { int slot; u32_t phys; @@ -1217,7 +1217,7 @@ PUBLIC int pt_bind(pt_t *pt, struct vmproc *who) /*===========================================================================* * pt_free * *===========================================================================*/ -PUBLIC void pt_free(pt_t *pt) +void pt_free(pt_t *pt) { /* Free memory associated with this pagetable. */ int i; @@ -1233,7 +1233,7 @@ PUBLIC void pt_free(pt_t *pt) /*===========================================================================* * pt_mapkernel * *===========================================================================*/ -PUBLIC int pt_mapkernel(pt_t *pt) +int pt_mapkernel(pt_t *pt) { int i; @@ -1275,7 +1275,7 @@ PUBLIC int pt_mapkernel(pt_t *pt) /*===========================================================================* * pt_cycle * *===========================================================================*/ -PUBLIC void pt_cycle(void) +void pt_cycle(void) { vm_checkspares(); } diff --git a/servers/vm/arch/i386/vm.c b/servers/vm/arch/i386/vm.c index 107a75f51..1d206f660 100644 --- a/servers/vm/arch/i386/vm.c +++ b/servers/vm/arch/i386/vm.c @@ -30,7 +30,7 @@ /*===========================================================================* * arch_map2vir * *===========================================================================*/ -PUBLIC vir_bytes arch_map2vir(struct vmproc *vmp, vir_bytes addr) +vir_bytes arch_map2vir(struct vmproc *vmp, vir_bytes addr) { vir_bytes textstart = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys); vir_bytes datastart = CLICK2ABS(vmp->vm_arch.vm_seg[D].mem_phys); @@ -46,7 +46,7 @@ PUBLIC vir_bytes arch_map2vir(struct vmproc *vmp, vir_bytes addr) /*===========================================================================* * arch_map2str * *===========================================================================*/ -PUBLIC char *arch_map2str(struct vmproc *vmp, vir_bytes addr) +char *arch_map2str(struct vmproc *vmp, vir_bytes addr) { static char bufstr[100]; vir_bytes textstart = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys); @@ -70,7 +70,7 @@ PUBLIC char *arch_map2str(struct vmproc *vmp, vir_bytes addr) /*===========================================================================* * arch_map2info * *===========================================================================*/ -PUBLIC vir_bytes arch_map2info(struct vmproc *vmp, vir_bytes addr, int *seg, +vir_bytes arch_map2info(struct vmproc *vmp, vir_bytes addr, int *seg, int *prot) { vir_bytes textstart = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys); @@ -104,7 +104,7 @@ PUBLIC vir_bytes arch_map2info(struct vmproc *vmp, vir_bytes addr, int *seg, /*===========================================================================* * arch_addrok * *===========================================================================*/ -PUBLIC vir_bytes arch_addrok(struct vmproc *vmp, vir_bytes addr) +vir_bytes arch_addrok(struct vmproc *vmp, vir_bytes addr) { vir_bytes textstart = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys); vir_bytes textend = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys + @@ -123,7 +123,7 @@ PUBLIC vir_bytes arch_addrok(struct vmproc *vmp, vir_bytes addr) /*===========================================================================* * arch_vir2map * *===========================================================================*/ -PUBLIC vir_bytes arch_vir2map(struct vmproc *vmp, vir_bytes addr) +vir_bytes arch_vir2map(struct vmproc *vmp, vir_bytes addr) { vir_bytes datasegbase = CLICK2ABS(vmp->vm_arch.vm_seg[D].mem_phys - vmp->vm_arch.vm_seg[D].mem_vir); @@ -134,7 +134,7 @@ PUBLIC vir_bytes arch_vir2map(struct vmproc *vmp, vir_bytes addr) /*===========================================================================* * arch_vir2map_text * *===========================================================================*/ -PUBLIC vir_bytes arch_vir2map_text(struct vmproc *vmp, vir_bytes addr) +vir_bytes arch_vir2map_text(struct vmproc *vmp, vir_bytes addr) { vir_bytes textsegbase = CLICK2ABS(vmp->vm_arch.vm_seg[T].mem_phys - vmp->vm_arch.vm_seg[T].mem_vir); diff --git a/servers/vm/break.c b/servers/vm/break.c index 4f00c9e28..6882bc1ac 100644 --- a/servers/vm/break.c +++ b/servers/vm/break.c @@ -44,7 +44,7 @@ /*===========================================================================* * do_brk * *===========================================================================*/ -PUBLIC int do_brk(message *msg) +int do_brk(message *msg) { /* Perform the brk(addr) system call. * The parameter, 'addr' is the new virtual address in D space. @@ -62,7 +62,7 @@ PUBLIC int do_brk(message *msg) /*===========================================================================* * adjust * *===========================================================================*/ -PUBLIC int adjust(rmp, data_clicks, sp) +int adjust(rmp, data_clicks, sp) struct vmproc *rmp; /* whose memory is being adjusted? */ vir_clicks data_clicks; /* how big is data segment to become? */ vir_bytes sp; /* new value of sp */ @@ -163,7 +163,7 @@ vir_bytes sp; /* new value of sp */ /*===========================================================================* * real_brk * *===========================================================================*/ -PUBLIC int real_brk(vmp, v) +int real_brk(vmp, v) struct vmproc *vmp; vir_bytes v; { diff --git a/servers/vm/exec.c b/servers/vm/exec.c index 9b958103b..3cb186b81 100644 --- a/servers/vm/exec.c +++ b/servers/vm/exec.c @@ -31,14 +31,14 @@ #include "memory.h" -FORWARD int new_mem(struct vmproc *vmp, vir_bytes text_addr, vir_bytes +static int new_mem(struct vmproc *vmp, vir_bytes text_addr, vir_bytes text_bytes, vir_bytes data_addr, vir_bytes data_bytes, vir_bytes stk_bytes, phys_bytes tot_bytes, vir_bytes *stack_top, int is_elf); /*===========================================================================* * exec_newmem * *===========================================================================*/ -PUBLIC int do_exec_newmem(message *msg) +int do_exec_newmem(message *msg) { int r, proc_e, proc_n; vir_bytes stack_top; @@ -129,7 +129,7 @@ SANITYCHECK(SCL_DETAIL); /*===========================================================================* * new_mem * *===========================================================================*/ -PRIVATE int new_mem( +static int new_mem( struct vmproc *rmp, /* process to get a new memory map */ vir_bytes text_addr, /* text segement load address */ vir_bytes text_bytes, /* text segment size in bytes */ @@ -256,7 +256,7 @@ SANITYCHECK(SCL_DETAIL); /*===========================================================================* * find_kernel_top * *===========================================================================*/ -PUBLIC phys_bytes find_kernel_top(void) +phys_bytes find_kernel_top(void) { /* Find out where the kernel is, so we know where to start mapping * user processes. @@ -276,7 +276,7 @@ PUBLIC phys_bytes find_kernel_top(void) /*===========================================================================* * proc_new * *===========================================================================*/ -PUBLIC int proc_new(struct vmproc *vmp, +int proc_new(struct vmproc *vmp, phys_bytes vstart, /* where to start the process in page table */ phys_bytes text_addr, /* address at which to load code */ phys_bytes text_bytes, /* how much code, in bytes but page aligned */ diff --git a/servers/vm/exit.c b/servers/vm/exit.c index 45bc25f39..04e37ceb2 100644 --- a/servers/vm/exit.c +++ b/servers/vm/exit.c @@ -24,7 +24,7 @@ #include "util.h" #include "sanitycheck.h" -PUBLIC void free_proc(struct vmproc *vmp) +void free_proc(struct vmproc *vmp) { map_free_proc(vmp); if(vmp->vm_flags & VMF_HASPT) { @@ -38,7 +38,7 @@ PUBLIC void free_proc(struct vmproc *vmp) #endif } -PUBLIC void clear_proc(struct vmproc *vmp) +void clear_proc(struct vmproc *vmp) { region_init(&vmp->vm_regions_avl); vmp->vm_region_top = 0; @@ -54,7 +54,7 @@ PUBLIC void clear_proc(struct vmproc *vmp) /*===========================================================================* * do_exit * *===========================================================================*/ -PUBLIC int do_exit(message *msg) +int do_exit(message *msg) { int proc; struct vmproc *vmp; @@ -97,7 +97,7 @@ SANITYCHECK(SCL_FUNCTIONS); /*===========================================================================* * do_willexit * *===========================================================================*/ -PUBLIC int do_willexit(message *msg) +int do_willexit(message *msg) { int proc; struct vmproc *vmp; diff --git a/servers/vm/fork.c b/servers/vm/fork.c index 69cfb9f88..9a2033406 100644 --- a/servers/vm/fork.c +++ b/servers/vm/fork.c @@ -32,7 +32,7 @@ /*===========================================================================* * do_fork * *===========================================================================*/ -PUBLIC int do_fork(message *msg) +int do_fork(message *msg) { int r, proc, childproc, fullvm; struct vmproc *vmp, *vmc; diff --git a/servers/vm/main.c b/servers/vm/main.c index 198cf7574..a0e0bd511 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -58,18 +58,18 @@ struct { (c) < VM_RQ_BASE + ELEMENTS(vm_calls)) ? \ ((c) - VM_RQ_BASE) : -1) -FORWARD int map_service(struct rprocpub *rpub); -FORWARD int vm_acl_ok(endpoint_t caller, int call); +static int map_service(struct rprocpub *rpub); +static int vm_acl_ok(endpoint_t caller, int call); /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); -FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info); -FORWARD void sef_cb_signal_handler(int signo); +static void sef_local_startup(void); +static int sef_cb_init_fresh(int type, sef_init_info_t *info); +static void sef_cb_signal_handler(int signo); /*===========================================================================* * main * *===========================================================================*/ -PUBLIC int main(void) +int main(void) { message msg; int result, who_e, rcv_sts; @@ -148,7 +148,7 @@ PUBLIC int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Register init callbacks. */ sef_setcb_init_fresh(sef_cb_init_fresh); @@ -166,7 +166,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +static int sef_cb_init_fresh(int type, sef_init_info_t *info) { /* Initialize the vm server. */ int s, i; @@ -396,7 +396,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) /*===========================================================================* * sef_cb_signal_handler * *===========================================================================*/ -PRIVATE void sef_cb_signal_handler(int signo) +static void sef_cb_signal_handler(int signo) { /* Check for known kernel signals, ignore anything else. */ switch(signo) { @@ -420,7 +420,7 @@ PRIVATE void sef_cb_signal_handler(int signo) /*===========================================================================* * map_service * *===========================================================================*/ -PRIVATE int map_service(rpub) +static int map_service(rpub) struct rprocpub *rpub; { /* Map a new service by initializing its call mask. */ @@ -440,7 +440,7 @@ struct rprocpub *rpub; /*===========================================================================* * vm_acl_ok * *===========================================================================*/ -PRIVATE int vm_acl_ok(endpoint_t caller, int call) +static int vm_acl_ok(endpoint_t caller, int call) { int n, r; diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index a61fee08a..dc9cc7c88 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -35,7 +35,7 @@ /*===========================================================================* * do_mmap * *===========================================================================*/ -PUBLIC int do_mmap(message *m) +int do_mmap(message *m) { int r, n; struct vmproc *vmp; @@ -113,7 +113,7 @@ PUBLIC int do_mmap(message *m) /*===========================================================================* * map_perm_check * *===========================================================================*/ -PUBLIC int map_perm_check(endpoint_t caller, endpoint_t target, +int map_perm_check(endpoint_t caller, endpoint_t target, phys_bytes physaddr, phys_bytes len) { int r; @@ -141,7 +141,7 @@ PUBLIC int map_perm_check(endpoint_t caller, endpoint_t target, /*===========================================================================* * do_map_phys * *===========================================================================*/ -PUBLIC int do_map_phys(message *m) +int do_map_phys(message *m) { int r, n; struct vmproc *vmp; @@ -199,7 +199,7 @@ PUBLIC int do_map_phys(message *m) /*===========================================================================* * do_unmap_phys * *===========================================================================*/ -PUBLIC int do_unmap_phys(message *m) +int do_unmap_phys(message *m) { int r, n; struct vmproc *vmp; @@ -234,7 +234,7 @@ PUBLIC int do_unmap_phys(message *m) /*===========================================================================* * do_remap * *===========================================================================*/ -PUBLIC int do_remap(message *m) +int do_remap(message *m) { int dn, sn; vir_bytes da, sa, startv; @@ -303,7 +303,7 @@ PUBLIC int do_remap(message *m) /*===========================================================================* * do_shared_unmap * *===========================================================================*/ -PUBLIC int do_shared_unmap(message *m) +int do_shared_unmap(message *m) { int r, n; struct vmproc *vmp; @@ -346,7 +346,7 @@ PUBLIC int do_shared_unmap(message *m) /*===========================================================================* * do_get_phys * *===========================================================================*/ -PUBLIC int do_get_phys(message *m) +int do_get_phys(message *m) { int r, n; struct vmproc *vmp; @@ -372,7 +372,7 @@ PUBLIC int do_get_phys(message *m) /*===========================================================================* * do_get_refcount * *===========================================================================*/ -PUBLIC int do_get_refcount(message *m) +int do_get_refcount(message *m) { int r, n; struct vmproc *vmp; @@ -398,7 +398,7 @@ PUBLIC int do_get_refcount(message *m) /*===========================================================================* * do_munmap * *===========================================================================*/ -PUBLIC int do_munmap(message *m) +int do_munmap(message *m) { int r, n; struct vmproc *vmp; @@ -447,7 +447,7 @@ int unmap_ok = 0; /*===========================================================================* * munmap_lin (used for overrides for VM) * *===========================================================================*/ -PRIVATE int munmap_lin(vir_bytes addr, size_t len) +static int munmap_lin(vir_bytes addr, size_t len) { if(addr % VM_PAGE_SIZE) { printf("munmap_lin: offset not page aligned\n"); @@ -471,7 +471,7 @@ PRIVATE int munmap_lin(vir_bytes addr, size_t len) /*===========================================================================* * munmap (override for VM) * *===========================================================================*/ -PUBLIC int minix_munmap(void *addr, size_t len) +int minix_munmap(void *addr, size_t len) { vir_bytes laddr; if(!unmap_ok) @@ -483,7 +483,7 @@ PUBLIC int minix_munmap(void *addr, size_t len) /*===========================================================================* * munmap_text (override for VM) * *===========================================================================*/ -PUBLIC int minix_munmap_text(void *addr, size_t len) +int minix_munmap_text(void *addr, size_t len) { vir_bytes laddr; if(!unmap_ok) diff --git a/servers/vm/pagefaults.c b/servers/vm/pagefaults.c index 6b6575c63..ed0aeae62 100644 --- a/servers/vm/pagefaults.c +++ b/servers/vm/pagefaults.c @@ -51,7 +51,7 @@ char *pf_errstr(u32_t err) /*===========================================================================* * do_pagefaults * *===========================================================================*/ -PUBLIC void do_pagefaults(message *m) +void do_pagefaults(message *m) { endpoint_t ep = m->m_source; u32_t addr = m->VPF_ADDR; @@ -118,7 +118,7 @@ PUBLIC void do_pagefaults(message *m) /*===========================================================================* * do_memory * *===========================================================================*/ -PUBLIC void do_memory(void) +void do_memory(void) { endpoint_t who, who_s, requestor; vir_bytes mem, mem_s; diff --git a/servers/vm/queryexit.c b/servers/vm/queryexit.c index 3ef55e18d..b70efc837 100644 --- a/servers/vm/queryexit.c +++ b/servers/vm/queryexit.c @@ -36,7 +36,7 @@ static struct query_exit_struct array[NR_PROCS]; /*===========================================================================* * do_query_exit * *===========================================================================*/ -PUBLIC int do_query_exit(message *m) +int do_query_exit(message *m) { int i, nr; endpoint_t ep = NONE; @@ -65,7 +65,7 @@ PUBLIC int do_query_exit(message *m) /*===========================================================================* * do_notify_sig * *===========================================================================*/ -PUBLIC int do_notify_sig(message *m) +int do_notify_sig(message *m) { int i, avails = 0; endpoint_t ep = m->VM_NOTIFY_SIG_ENDPOINT; @@ -118,7 +118,7 @@ out: /*===========================================================================* * do_watch_exit * *===========================================================================*/ -PUBLIC int do_watch_exit(message *m) +int do_watch_exit(message *m) { endpoint_t e = m->VM_WE_EP; struct vmproc *vmp; @@ -133,7 +133,7 @@ PUBLIC int do_watch_exit(message *m) /*===========================================================================* * init_query_exit * *===========================================================================*/ -PUBLIC void init_query_exit(void) +void init_query_exit(void) { int i; diff --git a/servers/vm/region.c b/servers/vm/region.c index 983fea36f..2a3cabeba 100644 --- a/servers/vm/region.c +++ b/servers/vm/region.c @@ -32,7 +32,7 @@ #include "memlist.h" /* LRU list. */ -PRIVATE yielded_t *lru_youngest = NULL, *lru_oldest = NULL; +static yielded_t *lru_youngest = NULL, *lru_oldest = NULL; /* Should a physblock be mapped writable? */ #define WRITABLE(r, pb) \ @@ -40,32 +40,32 @@ PRIVATE yielded_t *lru_youngest = NULL, *lru_oldest = NULL; (((r)->flags & (VR_DIRECT | VR_SHARED)) || \ (pb)->refcount == 1)) -FORWARD int map_new_physblock(struct vmproc *vmp, struct vir_region +static int map_new_physblock(struct vmproc *vmp, struct vir_region *region, vir_bytes offset, vir_bytes length, phys_bytes what, u32_t allocflags, int written); -FORWARD int map_ph_writept(struct vmproc *vmp, struct vir_region *vr, +static int map_ph_writept(struct vmproc *vmp, struct vir_region *vr, struct phys_region *pr); -FORWARD phys_bytes freeyieldednode(yielded_t *node, int freemem); +static phys_bytes freeyieldednode(yielded_t *node, int freemem); -FORWARD struct vir_region *map_copy_region(struct vmproc *vmp, struct +static struct vir_region *map_copy_region(struct vmproc *vmp, struct vir_region *vr); -FORWARD struct phys_region *map_clone_ph_block(struct vmproc *vmp, +static struct phys_region *map_clone_ph_block(struct vmproc *vmp, struct vir_region *region, struct phys_region *ph, physr_iter *iter); #if SANITYCHECKS -FORWARD void lrucheck(void); +static void lrucheck(void); #endif /* hash table of yielded blocks */ #define YIELD_HASHSIZE 65536 -PRIVATE yielded_avl vm_yielded_blocks[YIELD_HASHSIZE]; +static yielded_avl vm_yielded_blocks[YIELD_HASHSIZE]; -PRIVATE int avl_inited = 0; +static int avl_inited = 0; -PUBLIC void map_region_init(void) +void map_region_init(void) { int h; assert(!avl_inited); @@ -74,7 +74,7 @@ PUBLIC void map_region_init(void) avl_inited = 1; } -PRIVATE yielded_avl *get_yielded_avl(block_id_t id) +static yielded_avl *get_yielded_avl(block_id_t id) { u32_t h; @@ -89,7 +89,7 @@ PRIVATE yielded_avl *get_yielded_avl(block_id_t id) return &vm_yielded_blocks[h]; } -PRIVATE char *map_name(struct vir_region *vr) +static char *map_name(struct vir_region *vr) { static char name[100]; char *typename, *tag; @@ -128,7 +128,7 @@ PRIVATE char *map_name(struct vir_region *vr) return name; } -PUBLIC void map_printregion(struct vmproc *vmp, struct vir_region *vr) +void map_printregion(struct vmproc *vmp, struct vir_region *vr) { physr_iter iter; struct phys_region *ph; @@ -149,7 +149,7 @@ PUBLIC void map_printregion(struct vmproc *vmp, struct vir_region *vr) /*===========================================================================* * map_printmap * *===========================================================================*/ -PUBLIC void map_printmap(vmp) +void map_printmap(vmp) struct vmproc *vmp; { struct vir_region *vr; @@ -164,7 +164,7 @@ struct vmproc *vmp; } } -PRIVATE struct vir_region *getnextvr(struct vir_region *vr) +static struct vir_region *getnextvr(struct vir_region *vr) { struct vir_region *nextvr; region_iter v_iter; @@ -187,7 +187,7 @@ PRIVATE struct vir_region *getnextvr(struct vir_region *vr) /*===========================================================================* * map_sanitycheck_pt * *===========================================================================*/ -PRIVATE int map_sanitycheck_pt(struct vmproc *vmp, +static int map_sanitycheck_pt(struct vmproc *vmp, struct vir_region *vr, struct phys_region *pr) { struct phys_block *pb = pr->ph; @@ -217,7 +217,7 @@ PRIVATE int map_sanitycheck_pt(struct vmproc *vmp, /*===========================================================================* * map_sanitycheck * *===========================================================================*/ -PUBLIC void map_sanitycheck(char *file, int line) +void map_sanitycheck(char *file, int line) { struct vmproc *vmp; @@ -305,7 +305,7 @@ PUBLIC void map_sanitycheck(char *file, int line) #define LRUCHECK lrucheck() -PRIVATE void lrucheck(void) +static void lrucheck(void) { yielded_t *list; @@ -365,7 +365,7 @@ void blockstats(void) /*=========================================================================* * map_ph_writept * *=========================================================================*/ -PRIVATE int map_ph_writept(struct vmproc *vmp, struct vir_region *vr, +static int map_ph_writept(struct vmproc *vmp, struct vir_region *vr, struct phys_region *pr) { int rw; @@ -403,7 +403,7 @@ PRIVATE int map_ph_writept(struct vmproc *vmp, struct vir_region *vr, /*===========================================================================* * region_find_slot_range * *===========================================================================*/ -PRIVATE vir_bytes region_find_slot_range(struct vmproc *vmp, +static vir_bytes region_find_slot_range(struct vmproc *vmp, vir_bytes minv, vir_bytes maxv, vir_bytes length) { struct vir_region *firstregion; @@ -490,7 +490,7 @@ PRIVATE vir_bytes region_find_slot_range(struct vmproc *vmp, /*===========================================================================* * region_find_slot * *===========================================================================*/ -PRIVATE vir_bytes region_find_slot(struct vmproc *vmp, +static vir_bytes region_find_slot(struct vmproc *vmp, vir_bytes minv, vir_bytes maxv, vir_bytes length) { vir_bytes v, hint = vmp->vm_region_top; @@ -512,7 +512,7 @@ PRIVATE vir_bytes region_find_slot(struct vmproc *vmp, /*===========================================================================* * map_page_region * *===========================================================================*/ -PUBLIC struct vir_region *map_page_region(vmp, minv, maxv, length, +struct vir_region *map_page_region(vmp, minv, maxv, length, what, flags, mapflags) struct vmproc *vmp; vir_bytes minv; @@ -604,7 +604,7 @@ USE(newregion, /*===========================================================================* * pb_unreferenced * *===========================================================================*/ -PUBLIC void pb_unreferenced(struct vir_region *region, struct phys_region *pr) +void pb_unreferenced(struct vir_region *region, struct phys_region *pr) { struct phys_block *pb; @@ -644,7 +644,7 @@ PUBLIC void pb_unreferenced(struct vir_region *region, struct phys_region *pr) } } -PRIVATE struct phys_region *reset_physr_iter(struct vir_region *region, +static struct phys_region *reset_physr_iter(struct vir_region *region, physr_iter *iter, vir_bytes offset) { struct phys_region *ph; @@ -660,7 +660,7 @@ PRIVATE struct phys_region *reset_physr_iter(struct vir_region *region, /*===========================================================================* * map_subfree * *===========================================================================*/ -PRIVATE int map_subfree(struct vmproc *vmp, +static int map_subfree(struct vmproc *vmp, struct vir_region *region, vir_bytes len) { struct phys_region *pr; @@ -730,7 +730,7 @@ PRIVATE int map_subfree(struct vmproc *vmp, /*===========================================================================* * map_free * *===========================================================================*/ -PRIVATE int map_free(struct vmproc *vmp, struct vir_region *region) +static int map_free(struct vmproc *vmp, struct vir_region *region) { int r; @@ -749,7 +749,7 @@ PRIVATE int map_free(struct vmproc *vmp, struct vir_region *region) /*===========================================================================* * yielded_block_cmp * *===========================================================================*/ -PUBLIC int yielded_block_cmp(struct block_id *id1, struct block_id *id2) +int yielded_block_cmp(struct block_id *id1, struct block_id *id2) { if(id1->owner < id2->owner) return -1; @@ -762,7 +762,7 @@ PUBLIC int yielded_block_cmp(struct block_id *id1, struct block_id *id2) /*===========================================================================* * free_yielded_proc * *===========================================================================*/ -PRIVATE vir_bytes free_yielded_proc(struct vmproc *vmp) +static vir_bytes free_yielded_proc(struct vmproc *vmp) { vir_bytes total = 0; int h; @@ -796,7 +796,7 @@ PRIVATE vir_bytes free_yielded_proc(struct vmproc *vmp) } -PRIVATE phys_bytes freeyieldednode(yielded_t *node, int freemem) +static phys_bytes freeyieldednode(yielded_t *node, int freemem) { yielded_t *older, *younger, *removed; vir_bytes len; @@ -859,7 +859,7 @@ PRIVATE phys_bytes freeyieldednode(yielded_t *node, int freemem) /*========================================================================* * free_yielded * *========================================================================*/ -PUBLIC vir_bytes free_yielded(vir_bytes max_bytes) +vir_bytes free_yielded(vir_bytes max_bytes) { /* PRIVATE yielded_t *lru_youngest = NULL, *lru_oldest = NULL; */ @@ -878,7 +878,7 @@ PUBLIC vir_bytes free_yielded(vir_bytes max_bytes) /*========================================================================* * map_free_proc * *========================================================================*/ -PUBLIC int map_free_proc(vmp) +int map_free_proc(vmp) struct vmproc *vmp; { struct vir_region *r; @@ -909,7 +909,7 @@ struct vmproc *vmp; /*===========================================================================* * map_lookup * *===========================================================================*/ -PUBLIC struct vir_region *map_lookup(vmp, offset) +struct vir_region *map_lookup(vmp, offset) struct vmproc *vmp; vir_bytes offset; { @@ -932,7 +932,7 @@ vir_bytes offset; return NULL; } -PRIVATE u32_t vrallocflags(u32_t flags) +static u32_t vrallocflags(u32_t flags) { u32_t allocflags = 0; @@ -951,7 +951,7 @@ PRIVATE u32_t vrallocflags(u32_t flags) /*===========================================================================* * map_new_physblock * *===========================================================================*/ -PRIVATE int map_new_physblock(vmp, region, start_offset, length, +static int map_new_physblock(vmp, region, start_offset, length, what_mem, allocflags, written) struct vmproc *vmp; struct vir_region *region; @@ -1075,7 +1075,7 @@ int written; /*===========================================================================* * map_clone_ph_block * *===========================================================================*/ -PRIVATE struct phys_region *map_clone_ph_block(vmp, region, ph, iter) +static struct phys_region *map_clone_ph_block(vmp, region, ph, iter) struct vmproc *vmp; struct vir_region *region; struct phys_region *ph; @@ -1166,7 +1166,7 @@ physr_iter *iter; /*===========================================================================* * map_pf * *===========================================================================*/ -PUBLIC int map_pf(vmp, region, offset, write) +int map_pf(vmp, region, offset, write) struct vmproc *vmp; struct vir_region *region; vir_bytes offset; @@ -1236,7 +1236,7 @@ int write; /*===========================================================================* * map_pin_memory * *===========================================================================*/ -PUBLIC int map_pin_memory(struct vmproc *vmp) +int map_pin_memory(struct vmproc *vmp) { struct vir_region *vr; int r; @@ -1257,7 +1257,7 @@ PUBLIC int map_pin_memory(struct vmproc *vmp) /*===========================================================================* * map_handle_memory * *===========================================================================*/ -PUBLIC int map_handle_memory(vmp, region, offset, length, write) +int map_handle_memory(vmp, region, offset, length, write) struct vmproc *vmp; struct vir_region *region; vir_bytes offset, length; @@ -1397,7 +1397,7 @@ static int count_phys_regions(struct vir_region *vr) /*===========================================================================* * map_copy_region * *===========================================================================*/ -PRIVATE struct vir_region *map_copy_region(struct vmproc *vmp, struct vir_region *vr) +static struct vir_region *map_copy_region(struct vmproc *vmp, struct vir_region *vr) { /* map_copy_region creates a complete copy of the vir_region * data structure, linking in the same phys_blocks directly, @@ -1463,7 +1463,7 @@ PRIVATE struct vir_region *map_copy_region(struct vmproc *vmp, struct vir_region /*===========================================================================* * copy_abs2region * *===========================================================================*/ -PUBLIC int copy_abs2region(phys_bytes abs, struct vir_region *destregion, +int copy_abs2region(phys_bytes abs, struct vir_region *destregion, phys_bytes offset, phys_bytes len) { @@ -1509,7 +1509,7 @@ PUBLIC int copy_abs2region(phys_bytes abs, struct vir_region *destregion, /*=========================================================================* * map_writept * *=========================================================================*/ -PUBLIC int map_writept(struct vmproc *vmp) +int map_writept(struct vmproc *vmp) { struct vir_region *vr; struct phys_region *ph; @@ -1545,7 +1545,7 @@ PUBLIC int map_writept(struct vmproc *vmp) /*========================================================================* * map_proc_copy * *========================================================================*/ -PUBLIC int map_proc_copy(dst, src) +int map_proc_copy(dst, src) struct vmproc *dst; struct vmproc *src; { @@ -1558,7 +1558,7 @@ struct vmproc *src; /*========================================================================* * map_proc_copy_from * *========================================================================*/ -PUBLIC int map_proc_copy_from(dst, src, start_src_vr) +int map_proc_copy_from(dst, src, start_src_vr) struct vmproc *dst; struct vmproc *src; struct vir_region *start_src_vr; @@ -1640,7 +1640,7 @@ struct vir_region *start_src_vr; /*========================================================================* * map_proc_kernel * *========================================================================*/ -PUBLIC struct vir_region *map_proc_kernel(struct vmproc *vmp) +struct vir_region *map_proc_kernel(struct vmproc *vmp) { struct vir_region *vr; @@ -1668,7 +1668,7 @@ PUBLIC struct vir_region *map_proc_kernel(struct vmproc *vmp) /*========================================================================* * map_region_extend * *========================================================================*/ -PUBLIC int map_region_extend(struct vmproc *vmp, struct vir_region *vr, +int map_region_extend(struct vmproc *vmp, struct vir_region *vr, vir_bytes delta) { vir_bytes end; @@ -1700,7 +1700,7 @@ PUBLIC int map_region_extend(struct vmproc *vmp, struct vir_region *vr, /*========================================================================* * map_region_shrink * *========================================================================*/ -PUBLIC int map_region_shrink(struct vir_region *vr, vir_bytes delta) +int map_region_shrink(struct vir_region *vr, vir_bytes delta) { assert(vr); assert(vr->flags & VR_ANON); @@ -1713,7 +1713,7 @@ PUBLIC int map_region_shrink(struct vir_region *vr, vir_bytes delta) return OK; } -PUBLIC struct vir_region *map_region_lookup_tag(vmp, tag) +struct vir_region *map_region_lookup_tag(vmp, tag) struct vmproc *vmp; u32_t tag; { @@ -1730,12 +1730,12 @@ u32_t tag; return NULL; } -PUBLIC void map_region_set_tag(struct vir_region *vr, u32_t tag) +void map_region_set_tag(struct vir_region *vr, u32_t tag) { USE(vr, vr->tag = tag;); } -PUBLIC u32_t map_region_get_tag(struct vir_region *vr) +u32_t map_region_get_tag(struct vir_region *vr) { return vr->tag; } @@ -1743,7 +1743,7 @@ PUBLIC u32_t map_region_get_tag(struct vir_region *vr) /*========================================================================* * map_unmap_region * *========================================================================*/ -PUBLIC int map_unmap_region(struct vmproc *vmp, struct vir_region *r, +int map_unmap_region(struct vmproc *vmp, struct vir_region *r, vir_bytes len) { /* Shrink the region by 'len' bytes, from the start. Unreference @@ -1808,7 +1808,7 @@ PUBLIC int map_unmap_region(struct vmproc *vmp, struct vir_region *r, /*========================================================================* * map_remap * *========================================================================*/ -PUBLIC int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size, +int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size, struct vir_region *region, vir_bytes *r, int readonly) { struct vir_region *vr; @@ -1878,7 +1878,7 @@ PUBLIC int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size, /*========================================================================* * map_get_phys * *========================================================================*/ -PUBLIC int map_get_phys(struct vmproc *vmp, vir_bytes addr, phys_bytes *r) +int map_get_phys(struct vmproc *vmp, vir_bytes addr, phys_bytes *r) { struct vir_region *vr; struct phys_region *ph; @@ -1905,7 +1905,7 @@ PUBLIC int map_get_phys(struct vmproc *vmp, vir_bytes addr, phys_bytes *r) /*========================================================================* * map_get_ref * *========================================================================*/ -PUBLIC int map_get_ref(struct vmproc *vmp, vir_bytes addr, u8_t *cnt) +int map_get_ref(struct vmproc *vmp, vir_bytes addr, u8_t *cnt) { struct vir_region *vr; struct phys_region *ph; @@ -1932,7 +1932,7 @@ PUBLIC int map_get_ref(struct vmproc *vmp, vir_bytes addr, u8_t *cnt) /*========================================================================* * get_stats_info * *========================================================================*/ -PUBLIC void get_stats_info(struct vm_stats_info *vsi) +void get_stats_info(struct vm_stats_info *vsi) { yielded_t *yb; @@ -1945,7 +1945,7 @@ PUBLIC void get_stats_info(struct vm_stats_info *vsi) /*========================================================================* * get_usage_info * *========================================================================*/ -PUBLIC void get_usage_info(struct vmproc *vmp, struct vm_usage_info *vui) +void get_usage_info(struct vmproc *vmp, struct vm_usage_info *vui) { struct vir_region *vr; physr_iter iter; @@ -1982,7 +1982,7 @@ PUBLIC void get_usage_info(struct vmproc *vmp, struct vm_usage_info *vui) /*===========================================================================* * get_region_info * *===========================================================================*/ -PUBLIC int get_region_info(struct vmproc *vmp, struct vm_region_info *vri, +int get_region_info(struct vmproc *vmp, struct vm_region_info *vri, int max, vir_bytes *nextp) { struct vir_region *vr; @@ -2029,7 +2029,7 @@ PUBLIC int get_region_info(struct vmproc *vmp, struct vm_region_info *vri, /*========================================================================* * regionprintstats * *========================================================================*/ -PUBLIC void printregionstats(struct vmproc *vmp) +void printregionstats(struct vmproc *vmp) { struct vir_region *vr; struct phys_region *pr; @@ -2058,7 +2058,7 @@ PUBLIC void printregionstats(struct vmproc *vmp) /*===========================================================================* * do_map_memory * *===========================================================================*/ -PRIVATE int do_map_memory(struct vmproc *vms, struct vmproc *vmd, +static int do_map_memory(struct vmproc *vms, struct vmproc *vmd, struct vir_region *vrs, struct vir_region *vrd, vir_bytes offset_s, vir_bytes offset_d, vir_bytes length, int flag) @@ -2149,7 +2149,7 @@ PRIVATE int do_map_memory(struct vmproc *vms, struct vmproc *vmd, /*===========================================================================* * unmap_memory * *===========================================================================*/ -PUBLIC int unmap_memory(endpoint_t sour, endpoint_t dest, +int unmap_memory(endpoint_t sour, endpoint_t dest, vir_bytes virt_s, vir_bytes virt_d, vir_bytes length, int flag) { struct vmproc *vmd; @@ -2196,7 +2196,7 @@ PUBLIC int unmap_memory(endpoint_t sour, endpoint_t dest, /*===========================================================================* * split_phys * *===========================================================================*/ -PRIVATE int split_phys(struct phys_region *pr, vir_bytes point) +static int split_phys(struct phys_region *pr, vir_bytes point) { struct phys_region *newpr, *q, *prev = NULL; struct phys_block *newpb; @@ -2244,7 +2244,7 @@ PRIVATE int split_phys(struct phys_region *pr, vir_bytes point) /*===========================================================================* * clean_phys_regions * *===========================================================================*/ -PRIVATE void clean_phys_regions(struct vir_region *region, +static void clean_phys_regions(struct vir_region *region, vir_bytes offset, vir_bytes length) { /* Consider @offset as the start address and @offset+length as the end address. @@ -2279,7 +2279,7 @@ PRIVATE void clean_phys_regions(struct vir_region *region, /*===========================================================================* * rm_phys_regions * *===========================================================================*/ -PRIVATE void rm_phys_regions(struct vir_region *region, +static void rm_phys_regions(struct vir_region *region, vir_bytes begin, vir_bytes length) { /* Remove all phys regions between @begin and @begin+length. @@ -2303,7 +2303,7 @@ PRIVATE void rm_phys_regions(struct vir_region *region, /*===========================================================================* * map_memory * *===========================================================================*/ -PUBLIC int map_memory(endpoint_t sour, endpoint_t dest, +int map_memory(endpoint_t sour, endpoint_t dest, vir_bytes virt_s, vir_bytes virt_d, vir_bytes length, int flag) { /* This is the entry point. This function will be called by handle_memory() when @@ -2380,7 +2380,7 @@ map_lookup_phys(struct vmproc *vmp, u32_t tag) /*===========================================================================* * get_clean_phys_region * *===========================================================================*/ -PRIVATE struct phys_region * +static struct phys_region * get_clean_phys_region(struct vmproc *vmp, vir_bytes vaddr, vir_bytes length, struct vir_region **ret_region) { @@ -2441,7 +2441,7 @@ get_clean_phys_region(struct vmproc *vmp, vir_bytes vaddr, vir_bytes length, return ph; } -PRIVATE int getblock(struct vmproc *vmp, u64_t id, +static int getblock(struct vmproc *vmp, u64_t id, vir_bytes vaddr, vir_bytes len) { yielded_t *yb; @@ -2491,7 +2491,7 @@ PRIVATE int getblock(struct vmproc *vmp, u64_t id, return OK; } -PRIVATE int yieldblock(struct vmproc *vmp, u64_t id, +static int yieldblock(struct vmproc *vmp, u64_t id, vir_bytes vaddr, vir_bytes len, yielded_t **retyb) { yielded_t *newyb; @@ -2580,7 +2580,7 @@ PRIVATE int yieldblock(struct vmproc *vmp, u64_t id, /*===========================================================================* * do_forgetblocks * *===========================================================================*/ -PUBLIC int do_forgetblocks(message *m) +int do_forgetblocks(message *m) { int n; struct vmproc *vmp; @@ -2605,7 +2605,7 @@ PUBLIC int do_forgetblocks(message *m) /*===========================================================================* * do_forgetblock * *===========================================================================*/ -PUBLIC int do_forgetblock(message *m) +int do_forgetblock(message *m) { int n; struct vmproc *vmp; @@ -2641,7 +2641,7 @@ PUBLIC int do_forgetblock(message *m) /*===========================================================================* * do_yieldblockgetblock * *===========================================================================*/ -PUBLIC int do_yieldblockgetblock(message *m) +int do_yieldblockgetblock(message *m) { u64_t yieldid, getid; int n; diff --git a/servers/vm/rs.c b/servers/vm/rs.c index 2704169c3..6a126483a 100644 --- a/servers/vm/rs.c +++ b/servers/vm/rs.c @@ -31,7 +31,7 @@ /*===========================================================================* * do_rs_set_priv * *===========================================================================*/ -PUBLIC int do_rs_set_priv(message *m) +int do_rs_set_priv(message *m) { int r, n, nr; struct vmproc *vmp; @@ -59,7 +59,7 @@ PUBLIC int do_rs_set_priv(message *m) /*===========================================================================* * do_rs_update * *===========================================================================*/ -PUBLIC int do_rs_update(message *m_ptr) +int do_rs_update(message *m_ptr) { endpoint_t src_e, dst_e, reply_e; int src_p, dst_p; @@ -115,7 +115,7 @@ PUBLIC int do_rs_update(message *m_ptr) /*===========================================================================* * rs_memctl_make_vm_instance * *===========================================================================*/ -PRIVATE int rs_memctl_make_vm_instance(struct vmproc *new_vm_vmp) +static int rs_memctl_make_vm_instance(struct vmproc *new_vm_vmp) { int r; u32_t flags; @@ -164,7 +164,7 @@ PRIVATE int rs_memctl_make_vm_instance(struct vmproc *new_vm_vmp) /*===========================================================================* * do_rs_memctl * *===========================================================================*/ -PUBLIC int do_rs_memctl(message *m_ptr) +int do_rs_memctl(message *m_ptr) { endpoint_t ep; int req, r, proc_nr; diff --git a/servers/vm/signal.c b/servers/vm/signal.c index 980ebdb72..37c076869 100644 --- a/servers/vm/signal.c +++ b/servers/vm/signal.c @@ -30,7 +30,7 @@ /*===========================================================================* * do_push_sig * *===========================================================================*/ -PUBLIC int do_push_sig(message *msg) +int do_push_sig(message *msg) { int r, n; endpoint_t ep; diff --git a/servers/vm/slaballoc.c b/servers/vm/slaballoc.c index bd63f7748..fecb86ee2 100644 --- a/servers/vm/slaballoc.c +++ b/servers/vm/slaballoc.c @@ -77,7 +77,7 @@ #define MAXSIZE (SLABSIZES-1+MINSIZE) #define USEELEMENTS (1+(VM_PAGE_SIZE/MINSIZE/8)) -PRIVATE int pages = 0; +static int pages = 0; typedef u8_t element_t; #define BITS_FULL (~(element_t)0) @@ -123,14 +123,14 @@ struct sdh { #define LIST_FULL 3 #define LIST_NUMBER 4 -PRIVATE struct slabheader { +static struct slabheader { struct slabdata { struct sdh sdh; u8_t data[DATABYTES]; } *list_head[LIST_NUMBER]; } slabs[SLABSIZES]; -FORWARD int objstats(void *, int, struct slabheader **, struct slabdata +static int objstats(void *, int, struct slabheader **, struct slabdata **, int *); #define GETSLAB(b, s) { \ @@ -218,7 +218,7 @@ struct slabdata *newslabdata(int list) /*===========================================================================* * checklist * *===========================================================================*/ -PRIVATE int checklist(char *file, int line, +static int checklist(char *file, int line, struct slabheader *s, int l, int bytes) { struct slabdata *n = s->list_head[l]; @@ -254,7 +254,7 @@ PRIVATE int checklist(char *file, int line, /*===========================================================================* * void slab_sanitycheck * *===========================================================================*/ -PUBLIC void slab_sanitycheck(char *file, int line) +void slab_sanitycheck(char *file, int line) { int s; for(s = 0; s < SLABSIZES; s++) { @@ -268,7 +268,7 @@ PUBLIC void slab_sanitycheck(char *file, int line) /*===========================================================================* * int slabsane * *===========================================================================*/ -PUBLIC int slabsane_f(char *file, int line, void *mem, int bytes) +int slabsane_f(char *file, int line, void *mem, int bytes) { struct slabheader *s; struct slabdata *f; @@ -285,7 +285,7 @@ static int nojunkwarning = 0; /*===========================================================================* * void *slaballoc * *===========================================================================*/ -PUBLIC void *slaballoc(int bytes) +void *slaballoc(int bytes) { int i; int count = 0; @@ -387,7 +387,7 @@ PUBLIC void *slaballoc(int bytes) /*===========================================================================* * int objstats * *===========================================================================*/ -PRIVATE int objstats(void *mem, int bytes, +static int objstats(void *mem, int bytes, struct slabheader **sp, struct slabdata **fp, int *ip) { #if SANITYCHECKS @@ -448,7 +448,7 @@ PRIVATE int objstats(void *mem, int bytes, /*===========================================================================* * void *slabfree * *===========================================================================*/ -PUBLIC void slabfree(void *mem, int bytes) +void slabfree(void *mem, int bytes) { int i; struct slabheader *s; @@ -515,7 +515,7 @@ PUBLIC void slabfree(void *mem, int bytes) /*===========================================================================* * void *slablock * *===========================================================================*/ -PUBLIC void slablock(void *mem, int bytes) +void slablock(void *mem, int bytes) { int i; struct slabheader *s; @@ -532,7 +532,7 @@ PUBLIC void slablock(void *mem, int bytes) /*===========================================================================* * void *slabunlock * *===========================================================================*/ -PUBLIC void slabunlock(void *mem, int bytes) +void slabunlock(void *mem, int bytes) { int i; struct slabheader *s; @@ -550,7 +550,7 @@ PUBLIC void slabunlock(void *mem, int bytes) /*===========================================================================* * void slabstats * *===========================================================================*/ -PUBLIC void slabstats(void) +void slabstats(void) { int s, total = 0, totalbytes = 0; static int n; diff --git a/servers/vm/utility.c b/servers/vm/utility.c index 4dbaddb78..691d1807d 100644 --- a/servers/vm/utility.c +++ b/servers/vm/utility.c @@ -41,7 +41,7 @@ /*===========================================================================* * get_mem_map * *===========================================================================*/ -PUBLIC int get_mem_map(proc_nr, mem_map) +int get_mem_map(proc_nr, mem_map) int proc_nr; /* process to get map of */ struct mem_map *mem_map; /* put memory map here */ { @@ -58,7 +58,7 @@ struct mem_map *mem_map; /* put memory map here */ /*===========================================================================* * get_mem_chunks * *===========================================================================*/ -PUBLIC void get_mem_chunks(mem_chunks) +void get_mem_chunks(mem_chunks) struct memory *mem_chunks; /* store mem chunks here */ { /* Initialize the free memory list from the 'memory' boot variable. Translate @@ -92,7 +92,7 @@ struct memory *mem_chunks; /* store mem chunks here */ /*===========================================================================* * reserve_proc_mem * *===========================================================================*/ -PUBLIC void reserve_proc_mem(mem_chunks, map_ptr) +void reserve_proc_mem(mem_chunks, map_ptr) struct memory *mem_chunks; /* store mem chunks here */ struct mem_map *map_ptr; /* memory to remove */ { @@ -139,7 +139,7 @@ struct mem_map *map_ptr; /* memory to remove */ /*===========================================================================* * vm_isokendpt * *===========================================================================*/ -PUBLIC int vm_isokendpt(endpoint_t endpoint, int *proc) +int vm_isokendpt(endpoint_t endpoint, int *proc) { *proc = _ENDPOINT_P(endpoint); if(*proc < 0 || *proc >= NR_PROCS) @@ -157,7 +157,7 @@ struct proc mytmpproc; /*===========================================================================* * get_stack_ptr * *===========================================================================*/ -PUBLIC int get_stack_ptr(proc_nr_e, sp) +int get_stack_ptr(proc_nr_e, sp) int proc_nr_e; /* process to get sp of */ vir_bytes *sp; /* put stack pointer here */ { @@ -172,7 +172,7 @@ vir_bytes *sp; /* put stack pointer here */ /*===========================================================================* * do_info * *===========================================================================*/ -PUBLIC int do_info(message *m) +int do_info(message *m) { struct vm_stats_info vsi; struct vm_usage_info vui; @@ -256,7 +256,7 @@ PUBLIC int do_info(message *m) /*===========================================================================* * swap_proc_slot * *===========================================================================*/ -PUBLIC int swap_proc_slot(struct vmproc *src_vmp, struct vmproc *dst_vmp) +int swap_proc_slot(struct vmproc *src_vmp, struct vmproc *dst_vmp) { struct vmproc orig_src_vmproc, orig_dst_vmproc; @@ -292,7 +292,7 @@ PUBLIC int swap_proc_slot(struct vmproc *src_vmp, struct vmproc *dst_vmp) /*===========================================================================* * swap_proc_dyn_data * *===========================================================================*/ -PUBLIC int swap_proc_dyn_data(struct vmproc *src_vmp, struct vmproc *dst_vmp) +int swap_proc_dyn_data(struct vmproc *src_vmp, struct vmproc *dst_vmp) { int is_vm; int r; diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index 2983fbcbf..525061782 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -26,33 +26,33 @@ typedef struct { ssize_t value; } result_t; -PRIVATE char driver_label[32] = ""; /* driver DS label */ -PRIVATE dev_t driver_minor = -1; /* driver's partition minor to use */ -PRIVATE endpoint_t driver_endpt; /* driver endpoint */ - -PRIVATE int may_write = FALSE; /* may we write to the device? */ -PRIVATE int sector_size = 512; /* size of a single disk sector */ -PRIVATE int min_read = 512; /* minimum total size of read req */ -PRIVATE int element_size = 512; /* minimum I/O vector element size */ -PRIVATE int max_size = 131072; /* maximum total size of any req */ +static char driver_label[32] = ""; /* driver DS label */ +static dev_t driver_minor = -1; /* driver's partition minor to use */ +static endpoint_t driver_endpt; /* driver endpoint */ + +static int may_write = FALSE; /* may we write to the device? */ +static int sector_size = 512; /* size of a single disk sector */ +static int min_read = 512; /* minimum total size of read req */ +static int element_size = 512; /* minimum I/O vector element size */ +static int max_size = 131072; /* maximum total size of any req */ /* Note that we do not test exceeding the max_size limit, so it is safe to set * it to a value lower than the driver supports. */ -PRIVATE struct partition part; /* base and size of target partition */ +static struct partition part; /* base and size of target partition */ #define NR_OPENED 10 /* maximum number of opened devices */ -PRIVATE dev_t opened[NR_OPENED]; /* list of currently opened devices */ -PRIVATE int nr_opened = 0; /* current number of opened devices */ +static dev_t opened[NR_OPENED]; /* list of currently opened devices */ +static int nr_opened = 0; /* current number of opened devices */ -PRIVATE int total_tests = 0; /* total number of tests performed */ -PRIVATE int failed_tests = 0; /* number of tests that failed */ -PRIVATE int failed_groups = 0; /* nr of groups that had failures */ -PRIVATE int group_failure; /* has this group had a failure yet? */ -PRIVATE int driver_deaths = 0; /* number of restarts that we saw */ +static int total_tests = 0; /* total number of tests performed */ +static int failed_tests = 0; /* number of tests that failed */ +static int failed_groups = 0; /* nr of groups that had failures */ +static int group_failure; /* has this group had a failure yet? */ +static int driver_deaths = 0; /* number of restarts that we saw */ /* Options supported by this driver. */ -PRIVATE struct optset optset_table[] = { +static struct optset optset_table[] = { { "label", OPT_STRING, driver_label, sizeof(driver_label) }, { "minor", OPT_INT, &driver_minor, 10 }, { "rw", OPT_BOOL, &may_write, TRUE }, @@ -64,7 +64,7 @@ PRIVATE struct optset optset_table[] = { { NULL, 0, NULL, 0 } }; -PRIVATE int set_result(result_t *res, int type, ssize_t value) +static int set_result(result_t *res, int type, ssize_t value) { /* Set the result to the given result type and with the given optional * extra value. Return the type. @@ -75,7 +75,7 @@ PRIVATE int set_result(result_t *res, int type, ssize_t value) return type; } -PRIVATE void accept_result(result_t *res, int type, ssize_t value) +static void accept_result(result_t *res, int type, ssize_t value) { /* If the result is of the given type and value, reset it to a success * result. This allows for a logical OR on error codes. @@ -85,7 +85,7 @@ PRIVATE void accept_result(result_t *res, int type, ssize_t value) set_result(res, RESULT_OK, 0); } -PRIVATE void got_result(result_t *res, char *desc) +static void got_result(result_t *res, char *desc) { /* Process the result of a test. Keep statistics. */ @@ -142,7 +142,7 @@ PRIVATE void got_result(result_t *res, char *desc) } } -PRIVATE void test_group(char *name, int exec) +static void test_group(char *name, int exec) { /* Start a new group of tests. */ @@ -152,7 +152,7 @@ PRIVATE void test_group(char *name, int exec) group_failure = FALSE; } -PRIVATE void reopen_device(dev_t minor) +static void reopen_device(dev_t minor) { /* Reopen a device after we were notified that the driver has died. * Explicitly ignore any errors here; this is a feeble attempt to get @@ -169,7 +169,7 @@ PRIVATE void reopen_device(dev_t minor) (void) sendrec(driver_endpt, &m); } -PRIVATE int sendrec_driver(message *m_ptr, ssize_t exp, result_t *res) +static int sendrec_driver(message *m_ptr, ssize_t exp, result_t *res) { /* Make a call to the driver, and perform basic checks on the return * message. Fill in the result structure, wiping out what was in there @@ -226,7 +226,7 @@ PRIVATE int sendrec_driver(message *m_ptr, ssize_t exp, result_t *res) return set_result(res, RESULT_OK, 0); } -PRIVATE int raw_xfer(dev_t minor, u64_t pos, iovec_s_t *iovec, int nr_req, +static int raw_xfer(dev_t minor, u64_t pos, iovec_s_t *iovec, int nr_req, int write, ssize_t exp, result_t *res) { /* Perform a transfer with a safecopy iovec already supplied. @@ -268,7 +268,7 @@ PRIVATE int raw_xfer(dev_t minor, u64_t pos, iovec_s_t *iovec, int nr_req, return set_result(res, RESULT_TRUNC, exp - m.BDEV_STATUS); } -PRIVATE int vir_xfer(dev_t minor, u64_t pos, iovec_t *iovec, int nr_req, +static int vir_xfer(dev_t minor, u64_t pos, iovec_t *iovec, int nr_req, int write, ssize_t exp, result_t *res) { /* Perform a transfer, creating and revoking grants for the I/O vector. @@ -299,7 +299,7 @@ PRIVATE int vir_xfer(dev_t minor, u64_t pos, iovec_t *iovec, int nr_req, return r; } -PRIVATE int simple_xfer(dev_t minor, u64_t pos, u8_t *buf, size_t size, +static int simple_xfer(dev_t minor, u64_t pos, u8_t *buf, size_t size, int write, ssize_t exp, result_t *res) { /* Perform a transfer involving a single buffer. @@ -312,7 +312,7 @@ PRIVATE int simple_xfer(dev_t minor, u64_t pos, u8_t *buf, size_t size, return vir_xfer(minor, pos, &iov, 1, write, exp, res); } -PRIVATE void alloc_buf_and_grant(u8_t **ptr, cp_grant_id_t *grant, +static void alloc_buf_and_grant(u8_t **ptr, cp_grant_id_t *grant, size_t size, int perms) { /* Allocate a buffer suitable for DMA (i.e. contiguous) and create a @@ -328,7 +328,7 @@ PRIVATE void alloc_buf_and_grant(u8_t **ptr, cp_grant_id_t *grant, panic("unable to allocate grant"); } -PRIVATE void free_buf_and_grant(u8_t *ptr, cp_grant_id_t grant, size_t size) +static void free_buf_and_grant(u8_t *ptr, cp_grant_id_t grant, size_t size) { /* Revoke a grant and free a buffer. */ @@ -338,7 +338,7 @@ PRIVATE void free_buf_and_grant(u8_t *ptr, cp_grant_id_t grant, size_t size) free_contig(ptr, size); } -PRIVATE void bad_read1(void) +static void bad_read1(void) { /* Test various illegal read transfer requests, part 1. */ @@ -445,7 +445,7 @@ PRIVATE void bad_read1(void) cpf_revoke(grant); } -PRIVATE u32_t get_sum(u8_t *ptr, size_t size) +static u32_t get_sum(u8_t *ptr, size_t size) { /* Compute a checksum over the given buffer. */ @@ -457,7 +457,7 @@ PRIVATE u32_t get_sum(u8_t *ptr, size_t size) return sum; } -PRIVATE u32_t fill_rand(u8_t *ptr, size_t size) +static u32_t fill_rand(u8_t *ptr, size_t size) { /* Fill the given buffer with random data. Return a checksum over the * resulting data. @@ -470,7 +470,7 @@ PRIVATE u32_t fill_rand(u8_t *ptr, size_t size) return get_sum(ptr, size); } -PRIVATE void test_sum(u8_t *ptr, size_t size, u32_t sum, int should_match, +static void test_sum(u8_t *ptr, size_t size, u32_t sum, int should_match, result_t *res) { /* If the test succeeded so far, check whether the given buffer does @@ -490,7 +490,7 @@ PRIVATE void test_sum(u8_t *ptr, size_t size, u32_t sum, int should_match, } } -PRIVATE void bad_read2(void) +static void bad_read2(void) { /* Test various illegal read transfer requests, part 2. * @@ -733,7 +733,7 @@ PRIVATE void bad_read2(void) #define SECTOR_UNALIGN 2 /* word-aligned and sector-unaligned */ -PRIVATE void bad_write(void) +static void bad_write(void) { /* Test various illegal write transfer requests, if writing is allowed. * If handled correctly, these requests will not actually write data. @@ -827,7 +827,7 @@ PRIVATE void bad_write(void) free_buf_and_grant(buf_ptr, buf_grant, buf_size); } -PRIVATE void vector_and_large_sub(size_t small_size) +static void vector_and_large_sub(size_t small_size) { /* Check whether large vectored requests, and large single requests, * succeed. @@ -957,7 +957,7 @@ PRIVATE void vector_and_large_sub(size_t small_size) free_contig(buf_ptr, buf_size); } -PRIVATE void vector_and_large(void) +static void vector_and_large(void) { /* Check whether large vectored requests, and large single requests, * succeed. These are request patterns commonly used by MFS and the @@ -987,7 +987,7 @@ PRIVATE void vector_and_large(void) } } -PRIVATE void open_device(dev_t minor) +static void open_device(dev_t minor) { /* Open a partition or subpartition. Remember that it has been opened, * so that we can reopen it later in the event of a driver crash. @@ -1013,7 +1013,7 @@ PRIVATE void open_device(dev_t minor) "opening a subpartition"); } -PRIVATE void close_device(dev_t minor) +static void close_device(dev_t minor) { /* Close a partition or subpartition. Remove it from the list of opened * devices. @@ -1041,7 +1041,7 @@ PRIVATE void close_device(dev_t minor) "closing a subpartition"); } -PRIVATE int vir_ioctl(dev_t minor, int req, void *ptr, ssize_t exp, +static int vir_ioctl(dev_t minor, int req, void *ptr, ssize_t exp, result_t *res) { /* Perform an I/O control request, using a local buffer. @@ -1077,7 +1077,7 @@ PRIVATE int vir_ioctl(dev_t minor, int req, void *ptr, ssize_t exp, return r; } -PRIVATE void misc_ioctl(void) +static void misc_ioctl(void) { /* Test some ioctls. */ @@ -1137,7 +1137,7 @@ PRIVATE void misc_ioctl(void) got_result(&res, "decreased open count after closing"); } -PRIVATE void read_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) +static void read_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) { /* Test reads up to, across, and beyond partition limits. */ @@ -1250,7 +1250,7 @@ PRIVATE void read_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) free_contig(buf_ptr, buf_size); } -PRIVATE void write_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) +static void write_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) { /* Test writes up to, across, and beyond partition limits. Use the * first given subpartition to test, and the second to make sure there @@ -1392,7 +1392,7 @@ PRIVATE void write_limits(dev_t sub0_minor, dev_t sub1_minor, size_t sub_size) free_contig(buf_ptr, buf_size); } -PRIVATE void vir_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) +static void vir_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) { /* Create virtual, temporary subpartitions through the DIOCSETP ioctl, * and perform tests on the resulting subpartitions. @@ -1459,7 +1459,7 @@ PRIVATE void vir_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) close_device(sub0_minor); } -PRIVATE void real_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) +static void real_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) { /* Create our own subpartitions by writing a partition table, and * perform tests on the resulting real subpartitions. @@ -1598,7 +1598,7 @@ PRIVATE void real_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) free_contig(buf_ptr, buf_size); } -PRIVATE void part_limits(void) +static void part_limits(void) { /* Test reads and writes up to, across, and beyond partition limits. * As a side effect, test reading and writing partition sizes and @@ -1635,7 +1635,7 @@ PRIVATE void part_limits(void) } -PRIVATE void unaligned_size_io(u64_t base_pos, u8_t *buf_ptr, size_t buf_size, +static void unaligned_size_io(u64_t base_pos, u8_t *buf_ptr, size_t buf_size, u8_t *sec_ptr[2], int sectors, int pattern, u32_t ssum[5]) { /* Perform a single small-element I/O read, write, readback test. @@ -1804,7 +1804,7 @@ PRIVATE void unaligned_size_io(u64_t base_pos, u8_t *buf_ptr, size_t buf_size, got_result(&res, "readback verification"); } -PRIVATE void unaligned_size(void) +static void unaligned_size(void) { /* Test sector-unaligned sizes in I/O vector elements. The total size * of the request, however, has to add up to the sector size. @@ -1905,7 +1905,7 @@ PRIVATE void unaligned_size(void) free_contig(buf_ptr, buf_size); } -PRIVATE void unaligned_pos1(void) +static void unaligned_pos1(void) { /* Test sector-unaligned positions and total sizes for requests. This * is a read-only test as no driver currently supports sector-unaligned @@ -2058,7 +2058,7 @@ PRIVATE void unaligned_pos1(void) free_contig(buf_ptr, buf_size); } -PRIVATE void unaligned_pos2(void) +static void unaligned_pos2(void) { /* Test sector-unaligned positions and total sizes for requests, second * part. This one tests the use of multiple I/O vector elements, and @@ -2202,7 +2202,7 @@ PRIVATE void unaligned_pos2(void) free_contig(buf_ptr, buf_size); } -PRIVATE void sweep_area(u64_t base_pos) +static void sweep_area(u64_t base_pos) { /* Go over an eight-sector area from left (low address) to right (high * address), reading and optionally writing in three-sector chunks, and @@ -2294,7 +2294,7 @@ PRIVATE void sweep_area(u64_t base_pos) free_contig(buf_ptr, buf_size); } -PRIVATE void sweep_and_check(u64_t pos, int check_integ) +static void sweep_and_check(u64_t pos, int check_integ) { /* Perform an area sweep at the given position. If asked for, get an * integrity checksum over the beginning of the disk (first writing @@ -2350,7 +2350,7 @@ PRIVATE void sweep_and_check(u64_t pos, int check_integ) } } -PRIVATE void basic_sweep(void) +static void basic_sweep(void) { /* Perform a basic area sweep. */ @@ -2360,7 +2360,7 @@ PRIVATE void basic_sweep(void) sweep_area(cvu64(sector_size)); } -PRIVATE void high_disk_pos(void) +static void high_disk_pos(void) { /* Test 64-bit absolute disk positions. This means that after adding * partition base to the given position, the driver will be dealing @@ -2397,7 +2397,7 @@ PRIVATE void high_disk_pos(void) sweep_and_check(base_pos, !cmp64u(part.base, 0)); } -PRIVATE void high_part_pos(void) +static void high_part_pos(void) { /* Test 64-bit partition-relative disk positions. In other words, use * within the current partition a position that exceeds a 32-bit value. @@ -2430,7 +2430,7 @@ PRIVATE void high_part_pos(void) sweep_and_check(base_pos, TRUE); } -PRIVATE void high_lba_pos1(void) +static void high_lba_pos1(void) { /* Test 48-bit LBA positions, as opposed to *24-bit*. Drivers that only * support 48-bit LBA ATA transfers, will treat the lower and upper 24 @@ -2467,7 +2467,7 @@ PRIVATE void high_lba_pos1(void) sweep_and_check(base_pos, !cmp64u(part.base, 0)); } -PRIVATE void high_lba_pos2(void) +static void high_lba_pos2(void) { /* Test 48-bit LBA positions, as opposed to *28-bit*. That means sector * numbers in excess of 28-bit values; the old ATA upper limit. The @@ -2501,7 +2501,7 @@ PRIVATE void high_lba_pos2(void) sweep_and_check(base_pos, !cmp64u(part.base, 0)); } -PRIVATE void high_pos(void) +static void high_pos(void) { /* Check whether the driver deals well with 64-bit positions and * 48-bit LBA addresses. We test three cases: disk byte position beyond @@ -2528,7 +2528,7 @@ PRIVATE void high_pos(void) high_lba_pos2(); } -PRIVATE void open_primary(void) +static void open_primary(void) { /* Open the primary device. This call has its own test group. */ @@ -2538,7 +2538,7 @@ PRIVATE void open_primary(void) open_device(driver_minor); } -PRIVATE void close_primary(void) +static void close_primary(void) { /* Close the primary device. This call has its own test group. */ @@ -2550,7 +2550,7 @@ PRIVATE void close_primary(void) assert(nr_opened == 0); } -PRIVATE void do_tests(void) +static void do_tests(void) { /* Perform all the tests. */ @@ -2584,7 +2584,7 @@ PRIVATE void do_tests(void) close_primary(); } -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize. */ @@ -2611,7 +2611,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) return OK; } -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { /* Initialize the SEF framework. */ @@ -2621,7 +2621,7 @@ PRIVATE void sef_local_startup(void) sef_startup(); } -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { /* Driver task. */ diff --git a/test/ds/dstest.c b/test/ds/dstest.c index 7d87979af..044123468 100644 --- a/test/ds/dstest.c +++ b/test/ds/dstest.c @@ -202,7 +202,7 @@ void test_map(void) } /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -226,7 +226,7 @@ int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/ds/subs.c b/test/ds/subs.c index 2c28ccd07..7013016a3 100644 --- a/test/ds/subs.c +++ b/test/ds/subs.c @@ -3,7 +3,7 @@ char *key_u32 = "test_u32"; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -85,7 +85,7 @@ int main(void) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/kernel/sys_vumap/vumaprelay.c b/test/kernel/sys_vumap/vumaprelay.c index 759affb60..a69cf9c92 100644 --- a/test/kernel/sys_vumap/vumaprelay.c +++ b/test/kernel/sys_vumap/vumaprelay.c @@ -4,7 +4,7 @@ #include "com.h" -PRIVATE int do_request(message *m) +static int do_request(message *m) { struct vumap_vir vvec[MAPVEC_NR + 3]; struct vumap_phys pvec[MAPVEC_NR + 3]; @@ -36,18 +36,18 @@ PRIVATE int do_request(message *m) return r; } -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { return OK; } -PRIVATE void sef_cb_signal_handler(int sig) +static void sef_cb_signal_handler(int sig) { if (sig == SIGTERM) exit(0); } -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { sef_setcb_init_fresh(sef_cb_init_fresh); sef_setcb_signal_handler(sef_cb_signal_handler); @@ -55,7 +55,7 @@ PRIVATE void sef_local_startup(void) sef_startup(); } -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { message m; int r; diff --git a/test/kernel/sys_vumap/vumaptest.c b/test/kernel/sys_vumap/vumaptest.c index d4cc1c1f6..034aa3471 100644 --- a/test/kernel/sys_vumap/vumaptest.c +++ b/test/kernel/sys_vumap/vumaptest.c @@ -15,28 +15,28 @@ struct buf { #define BUF_PREALLOC 0x1 /* if set, immediately allocate the page */ #define BUF_ADJACENT 0x2 /* virtually contiguous with the last buffer */ -PRIVATE unsigned int count = 0, failures = 0; +static unsigned int count = 0, failures = 0; -PRIVATE int success; -PRIVATE char *fail_file; -PRIVATE int fail_line; +static int success; +static char *fail_file; +static int fail_line; -PRIVATE int relay; -PRIVATE endpoint_t endpt; +static int relay; +static endpoint_t endpt; -PRIVATE int verbose; +static int verbose; -PRIVATE enum { +static enum { GE_NONE, /* no exception */ GE_REVOKED, /* revoked grant */ GE_INVALID /* invalid grant */ } grant_exception = GE_NONE; -PRIVATE int grant_access = 0; +static int grant_access = 0; #define expect(r) expect_f((r), __FILE__, __LINE__) -PRIVATE void alloc_buf(struct buf *buf, phys_bytes next) +static void alloc_buf(struct buf *buf, phys_bytes next) { void *tmp = NULL; vir_bytes addr; @@ -108,7 +108,7 @@ PRIVATE void alloc_buf(struct buf *buf, phys_bytes next) panic("unable to allocate noncontiguous range"); } -PRIVATE void alloc_bufs(struct buf *buf, int count) +static void alloc_bufs(struct buf *buf, int count) { static vir_bytes base = 0x80000000L; phys_bytes next; @@ -141,7 +141,7 @@ PRIVATE void alloc_bufs(struct buf *buf, int count) #endif } -PRIVATE void free_bufs(struct buf *buf, int count) +static void free_bufs(struct buf *buf, int count) { int i, j, r; @@ -156,7 +156,7 @@ PRIVATE void free_bufs(struct buf *buf, int count) } } -PRIVATE int is_allocated(vir_bytes addr, size_t bytes, phys_bytes *phys) +static int is_allocated(vir_bytes addr, size_t bytes, phys_bytes *phys) { int r; @@ -170,19 +170,19 @@ PRIVATE int is_allocated(vir_bytes addr, size_t bytes, phys_bytes *phys) return r == OK; } -PRIVATE int is_buf_allocated(struct buf *buf) +static int is_buf_allocated(struct buf *buf) { return is_allocated(buf->addr, buf->pages * PAGE_SIZE, &buf->phys); } -PRIVATE void test_group(char *name) +static void test_group(char *name) { if (verbose) printf("Test group: %s (%s)\n", name, relay ? "relay" : "local"); } -PRIVATE void expect_f(int res, char *file, int line) +static void expect_f(int res, char *file, int line) { if (!res && success) { success = FALSE; @@ -191,7 +191,7 @@ PRIVATE void expect_f(int res, char *file, int line) } } -PRIVATE void got_result(char *desc) +static void got_result(char *desc) { count++; @@ -206,7 +206,7 @@ PRIVATE void got_result(char *desc) } } -PRIVATE int relay_vumap(struct vumap_vir *vvec, int vcount, size_t offset, +static int relay_vumap(struct vumap_vir *vvec, int vcount, size_t offset, int access, struct vumap_phys *pvec, int *pcount) { struct vumap_vir gvvec[MAPVEC_NR + 3]; @@ -266,7 +266,7 @@ PRIVATE int relay_vumap(struct vumap_vir *vvec, int vcount, size_t offset, return (r != OK) ? r : m.m_type; } -PRIVATE int do_vumap(endpoint_t endpt, struct vumap_vir *vvec, int vcount, +static int do_vumap(endpoint_t endpt, struct vumap_vir *vvec, int vcount, size_t offset, int access, struct vumap_phys *pvec, int *pcount) { struct vumap_phys pv_backup[MAPVEC_NR + 3]; @@ -308,7 +308,7 @@ PRIVATE int do_vumap(endpoint_t endpt, struct vumap_vir *vvec, int vcount, return r; } -PRIVATE void test_basics(void) +static void test_basics(void) { struct vumap_vir vvec[2]; struct vumap_phys pvec[4]; @@ -499,7 +499,7 @@ PRIVATE void test_basics(void) free_bufs(buf, 4); } -PRIVATE void test_endpt(void) +static void test_endpt(void) { struct vumap_vir vvec[1]; struct vumap_phys pvec[1]; @@ -538,7 +538,7 @@ PRIVATE void test_endpt(void) free_bufs(buf, 1); } -PRIVATE void test_vector1(void) +static void test_vector1(void) { struct vumap_vir vvec[2]; struct vumap_phys pvec[3]; @@ -599,7 +599,7 @@ PRIVATE void test_vector1(void) free_bufs(buf, 2); } -PRIVATE void test_vector2(void) +static void test_vector2(void) { struct vumap_vir vvec[2], *vvecp; struct vumap_phys pvec[3], *pvecp; @@ -710,7 +710,7 @@ PRIVATE void test_vector2(void) free_bufs(buf, 2); } -PRIVATE void test_grant(void) +static void test_grant(void) { struct vumap_vir vvec[2]; struct vumap_phys pvec[3]; @@ -805,7 +805,7 @@ PRIVATE void test_grant(void) free_bufs(buf, 2); } -PRIVATE void test_offset(void) +static void test_offset(void) { struct vumap_vir vvec[2]; struct vumap_phys pvec[3]; @@ -943,7 +943,7 @@ PRIVATE void test_offset(void) free_bufs(buf, 4); } -PRIVATE void test_access(void) +static void test_access(void) { struct vumap_vir vvec[3]; struct vumap_phys pvec[4], *pvecp; @@ -1130,7 +1130,7 @@ PRIVATE void test_access(void) */ } -PRIVATE void phys_limit(struct vumap_vir *vvec, int vcount, +static void phys_limit(struct vumap_vir *vvec, int vcount, struct vumap_phys *pvec, int pcount, struct buf *buf, char *desc) { int i, r; @@ -1147,7 +1147,7 @@ PRIVATE void phys_limit(struct vumap_vir *vvec, int vcount, got_result(desc); } -PRIVATE void test_limits(void) +static void test_limits(void) { struct vumap_vir vvec[MAPVEC_NR + 3]; struct vumap_phys pvec[MAPVEC_NR + 3]; @@ -1345,7 +1345,7 @@ PRIVATE void test_limits(void) free_bufs(buf, nr_bufs); } -PRIVATE void do_tests(int use_relay) +static void do_tests(int use_relay) { relay = use_relay; @@ -1366,7 +1366,7 @@ PRIVATE void do_tests(int use_relay) test_limits(); } -PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) +static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { int r; @@ -1392,14 +1392,14 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) return (failures) ? EINVAL : OK; } -PRIVATE void sef_local_startup(void) +static void sef_local_startup(void) { sef_setcb_init_fresh(sef_cb_init_fresh); sef_startup(); } -PUBLIC int main(int argc, char **argv) +int main(int argc, char **argv) { env_setargs(argc, argv); diff --git a/test/safecopy/grantor.c b/test/safecopy/grantor.c index a8e2fe5bb..d4a3f338a 100644 --- a/test/safecopy/grantor.c +++ b/test/safecopy/grantor.c @@ -3,7 +3,7 @@ char buf_buf[BUF_SIZE + CLICK_SIZE]; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -51,7 +51,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/safecopy/requestor.c b/test/safecopy/requestor.c index 726642a97..7f4750847 100644 --- a/test/safecopy/requestor.c +++ b/test/safecopy/requestor.c @@ -36,7 +36,7 @@ int test(size_t size) } /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -88,7 +88,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/safemap/grantor.c b/test/safemap/grantor.c index 2e58bb73d..e36fda12c 100644 --- a/test/safemap/grantor.c +++ b/test/safemap/grantor.c @@ -5,7 +5,7 @@ char buf_buf[BUF_SIZE + CLICK_SIZE]; int fid_send, fid_get; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -121,7 +121,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/safemap/requestor.c b/test/safemap/requestor.c index f72adcea1..a82300ed2 100644 --- a/test/safemap/requestor.c +++ b/test/safemap/requestor.c @@ -8,7 +8,7 @@ char *buf; int fid_send, fid_get; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -145,7 +145,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/safeperf/grantor.c b/test/safeperf/grantor.c index 4b57c7cc9..5f0e68caf 100644 --- a/test/safeperf/grantor.c +++ b/test/safeperf/grantor.c @@ -5,7 +5,7 @@ char buf_buf[BUF_SIZE + CLICK_SIZE]; int fid_send, fid_get; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * main * @@ -54,7 +54,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/safeperf/requestor.c b/test/safeperf/requestor.c index 999ff4018..8b193ee5d 100644 --- a/test/safeperf/requestor.c +++ b/test/safeperf/requestor.c @@ -8,7 +8,7 @@ char *buf; int fid_send, fid_get; /* SEF functions and variables. */ -FORWARD void sef_local_startup(void); +static void sef_local_startup(void); /*===========================================================================* * read_write_buff * @@ -158,7 +158,7 @@ int main(int argc, char **argv) /*===========================================================================* * sef_local_startup * *===========================================================================*/ -PRIVATE void sef_local_startup() +static void sef_local_startup() { /* Let SEF perform startup. */ sef_startup(); diff --git a/test/test59.c b/test/test59.c index 77e490b15..6850fe69e 100644 --- a/test/test59.c +++ b/test/test59.c @@ -17,21 +17,21 @@ #define MAX_ERROR 5 #include "common.c" -PUBLIC int errct; -PRIVATE int count, condition_met; -PRIVATE int th_a, th_b, th_c, th_d, th_e, th_f, th_g, th_h; -PRIVATE int mutex_a_step, mutex_b_step, mutex_c_step; -PRIVATE mutex_t mu[3]; -PRIVATE cond_t condition; -PRIVATE mutex_t *count_mutex, *condition_mutex; -PRIVATE once_t once; -PRIVATE key_t key[MTHREAD_KEYS_MAX+1]; -PRIVATE int values[4]; -PRIVATE int first; -PRIVATE event_t event; -PRIVATE int event_a_step, event_b_step; -PRIVATE rwlock_t rwlock; -PRIVATE int rwlock_a_step, rwlock_b_step; +int errct; +static int count, condition_met; +static int th_a, th_b, th_c, th_d, th_e, th_f, th_g, th_h; +static int mutex_a_step, mutex_b_step, mutex_c_step; +static mutex_t mu[3]; +static cond_t condition; +static mutex_t *count_mutex, *condition_mutex; +static once_t once; +static key_t key[MTHREAD_KEYS_MAX+1]; +static int values[4]; +static int first; +static event_t event; +static int event_a_step, event_b_step; +static rwlock_t rwlock; +static int rwlock_a_step, rwlock_b_step; #define VERIFY_RWLOCK(a, b, esub, eno) \ GEN_VERIFY(rwlock_a_step, a, rwlock_b_step, b, esub, eno) @@ -61,27 +61,27 @@ PRIVATE int rwlock_a_step, rwlock_b_step; #define MEG 1024*1024 #define MAGIC ((signed) 0xb4a3f1c2) -FORWARD void destr_a(void *arg); -FORWARD void destr_b(void *arg); -FORWARD void *thread_a(void *arg); -FORWARD void *thread_b(void *arg); -FORWARD void *thread_c(void *arg); -FORWARD void *thread_d(void *arg); -FORWARD void thread_e(void); -FORWARD void *thread_f(void *arg); -FORWARD void *thread_g(void *arg); -FORWARD void *thread_h(void *arg); -FORWARD void test_scheduling(void); -FORWARD void test_mutex(void); -FORWARD void test_condition(void); -FORWARD void test_attributes(void); -FORWARD void test_keys(void); -FORWARD void err(int subtest, int error); +static void destr_a(void *arg); +static void destr_b(void *arg); +static void *thread_a(void *arg); +static void *thread_b(void *arg); +static void *thread_c(void *arg); +static void *thread_d(void *arg); +static void thread_e(void); +static void *thread_f(void *arg); +static void *thread_g(void *arg); +static void *thread_h(void *arg); +static void test_scheduling(void); +static void test_mutex(void); +static void test_condition(void); +static void test_attributes(void); +static void test_keys(void); +static void err(int subtest, int error); /*===========================================================================* * thread_a * *===========================================================================*/ -PRIVATE void *thread_a(void *arg) { +static void *thread_a(void *arg) { th_a++; return(NULL); } @@ -90,7 +90,7 @@ PRIVATE void *thread_a(void *arg) { /*===========================================================================* * thread_b * *===========================================================================*/ -PRIVATE void *thread_b(void *arg) { +static void *thread_b(void *arg) { th_b++; if (mthread_once(&once, thread_e) != 0) err(10, 1); return(NULL); @@ -100,7 +100,7 @@ PRIVATE void *thread_b(void *arg) { /*===========================================================================* * thread_c * *===========================================================================*/ -PRIVATE void *thread_c(void *arg) { +static void *thread_c(void *arg) { th_c++; return(NULL); } @@ -109,7 +109,7 @@ PRIVATE void *thread_c(void *arg) { /*===========================================================================* * thread_d * *===========================================================================*/ -PRIVATE void *thread_d(void *arg) { +static void *thread_d(void *arg) { th_d++; mthread_exit(NULL); /* Thread wants to stop running */ return(NULL); @@ -119,7 +119,7 @@ PRIVATE void *thread_d(void *arg) { /*===========================================================================* * thread_e * *===========================================================================*/ -PRIVATE void thread_e(void) { +static void thread_e(void) { th_e++; } @@ -127,7 +127,7 @@ PRIVATE void thread_e(void) { /*===========================================================================* * thread_f * *===========================================================================*/ -PRIVATE void *thread_f(void *arg) { +static void *thread_f(void *arg) { if (mthread_mutex_lock(condition_mutex) != 0) err(12, 1); th_f++; if (mthread_cond_signal(&condition) != 0) err(12, 2); @@ -139,7 +139,7 @@ PRIVATE void *thread_f(void *arg) { /*===========================================================================* * thread_g * *===========================================================================*/ -PRIVATE void *thread_g(void *arg) { +static void *thread_g(void *arg) { char bigarray[MTHREAD_STACK_MIN + 1]; if (mthread_mutex_lock(condition_mutex) != 0) err(13, 1); memset(bigarray, '\0', MTHREAD_STACK_MIN + 1); /* Actually allocate it */ @@ -153,7 +153,7 @@ PRIVATE void *thread_g(void *arg) { /*===========================================================================* * thread_h * *===========================================================================*/ -PRIVATE void *thread_h(void *arg) { +static void *thread_h(void *arg) { char bigarray[2 * MEG]; int reply; if (mthread_mutex_lock(condition_mutex) != 0) err(14, 1); @@ -170,7 +170,7 @@ PRIVATE void *thread_h(void *arg) { /*===========================================================================* * err * *===========================================================================*/ -PRIVATE void err(int sub, int error) { +static void err(int sub, int error) { /* As we're running with multiple threads, they might all clobber the * subtest variable. This wrapper prevents that from happening. */ @@ -182,7 +182,7 @@ PRIVATE void err(int sub, int error) { /*===========================================================================* * test_scheduling * *===========================================================================*/ -PRIVATE void test_scheduling(void) +static void test_scheduling(void) { unsigned int i; thread_t t[7]; @@ -247,7 +247,7 @@ PRIVATE void test_scheduling(void) /*===========================================================================* * mutex_a * *===========================================================================*/ -PRIVATE void *mutex_a(void *arg) +static void *mutex_a(void *arg) { mutex_t *mu = (mutex_t *) arg; @@ -303,7 +303,7 @@ PRIVATE void *mutex_a(void *arg) /*===========================================================================* * mutex_b * *===========================================================================*/ -PRIVATE void *mutex_b(void *arg) +static void *mutex_b(void *arg) { mutex_t *mu = (mutex_t *) arg; @@ -339,7 +339,7 @@ PRIVATE void *mutex_b(void *arg) /*===========================================================================* * mutex_c * *===========================================================================*/ -PRIVATE void *mutex_c(void *arg) +static void *mutex_c(void *arg) { mutex_t *mu = (mutex_t *) arg; @@ -367,7 +367,7 @@ PRIVATE void *mutex_c(void *arg) /*===========================================================================* * test_mutex * *===========================================================================*/ -PRIVATE void test_mutex(void) +static void test_mutex(void) { unsigned int i; thread_t t[3]; @@ -413,7 +413,7 @@ PRIVATE void test_mutex(void) /*===========================================================================* * cond_a * *===========================================================================*/ -PRIVATE void *cond_a(void *arg) +static void *cond_a(void *arg) { cond_t c; int did_count = 0; @@ -462,7 +462,7 @@ PRIVATE void *cond_a(void *arg) /*===========================================================================* * cond_b * *===========================================================================*/ -PRIVATE void *cond_b(void *arg) +static void *cond_b(void *arg) { int did_count = 0; while(1) { @@ -489,7 +489,7 @@ PRIVATE void *cond_b(void *arg) /*===========================================================================* * cond_broadcast * *===========================================================================*/ -PRIVATE void *cond_broadcast(void *arg) +static void *cond_broadcast(void *arg) { if (mthread_mutex_lock(condition_mutex) != 0) err(9, 1); @@ -507,7 +507,7 @@ PRIVATE void *cond_broadcast(void *arg) /*===========================================================================* * test_condition * *===========================================================================*/ -PRIVATE void test_condition(void) +static void test_condition(void) { #define NTHREADS 10 int i; @@ -595,7 +595,7 @@ PRIVATE void test_condition(void) /*===========================================================================* * test_attributes * *===========================================================================*/ -PRIVATE void test_attributes(void) +static void test_attributes(void) { attr_t tattr; thread_t tid; @@ -765,7 +765,7 @@ PRIVATE void test_attributes(void) /*===========================================================================* * destr_a * *===========================================================================*/ -PRIVATE void destr_a(void *value) +static void destr_a(void *value) { int num; @@ -782,7 +782,7 @@ PRIVATE void destr_a(void *value) /*===========================================================================* * destr_b * *===========================================================================*/ -PRIVATE void destr_b(void *value) +static void destr_b(void *value) { /* This destructor must never trigger. */ err(16, 1); @@ -791,7 +791,7 @@ PRIVATE void destr_b(void *value) /*===========================================================================* * key_a * *===========================================================================*/ -PRIVATE void *key_a(void *arg) +static void *key_a(void *arg) { int i; @@ -823,7 +823,7 @@ PRIVATE void *key_a(void *arg) /*===========================================================================* * key_b * *===========================================================================*/ -PRIVATE void *key_b(void *arg) +static void *key_b(void *arg) { int i; @@ -849,7 +849,7 @@ PRIVATE void *key_b(void *arg) /*===========================================================================* * key_c * *===========================================================================*/ -PRIVATE void *key_c(void *arg) +static void *key_c(void *arg) { /* The only thing that this thread should do, is set a value. */ if (mthread_setspecific(key[0], (void *) mthread_self()) != 0) err(19, 1); @@ -864,7 +864,7 @@ PRIVATE void *key_c(void *arg) /*===========================================================================* * test_keys * *===========================================================================*/ -PRIVATE void test_keys(void) +static void test_keys(void) { thread_t t[24]; int i, j; @@ -939,7 +939,7 @@ PRIVATE void test_keys(void) /*===========================================================================* * event_a * *===========================================================================*/ -PRIVATE void *event_a(void *arg) +static void *event_a(void *arg) { VERIFY_EVENT(0, 0, 21, 1); @@ -963,7 +963,7 @@ PRIVATE void *event_a(void *arg) /*===========================================================================* * event_b * *===========================================================================*/ -PRIVATE void *event_b(void *arg) +static void *event_b(void *arg) { VERIFY_EVENT(0, 0, 22, 1); @@ -983,7 +983,7 @@ PRIVATE void *event_b(void *arg) /*===========================================================================* * test_event * *===========================================================================*/ -PRIVATE void test_event(void) +static void test_event(void) { thread_t t[2]; int i; @@ -1022,7 +1022,7 @@ PRIVATE void test_event(void) /*===========================================================================* * rwlock_a * *===========================================================================*/ -PRIVATE void *rwlock_a(void *arg) +static void *rwlock_a(void *arg) { /* acquire read lock */ VERIFY_RWLOCK(0, 0, 24, 1); @@ -1052,7 +1052,7 @@ PRIVATE void *rwlock_a(void *arg) /*===========================================================================* * rwlock_b * *===========================================================================*/ -PRIVATE void *rwlock_b(void *arg) +static void *rwlock_b(void *arg) { /* Step 1: acquire the read lock */ VERIFY_RWLOCK(1, 0, 25, 1); @@ -1078,7 +1078,7 @@ PRIVATE void *rwlock_b(void *arg) /*===========================================================================* * test_rwlock * *===========================================================================*/ -PRIVATE void test_rwlock(void) +static void test_rwlock(void) { thread_t t[2]; int i;