mkproto mount mt netconf newroot nice acknm nohup \
nonamed od paste patch pax \
ping postinstall poweroff pr prep printf printroot \
- profile progressbar proto pr_routes ps pwd pwdauth \
+ profile progressbar pr_routes ps pwd pwdauth \
ramdisk rarpd rawspeed rcp rdate readall readclock \
reboot remsync rev rget rlogin \
rotate rsh rshd sed service setup shar acksize \
struct exec header; /* header of a.out file */
int stbl_elems; /* #elements in symbol table */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(int nm_sort, (const void *tmp_stbl1, const void *tmp_stbl2));
-_PROTOTYPE(void nm, (char *file));
-_PROTOTYPE(int read_header, (int fd));
-_PROTOTYPE(void nm_print, (char *file, struct nlist *stbl));
+int main(int argc, char **argv);
+int nm_sort(const void *tmp_stbl1, const void *tmp_stbl2);
+void nm(char *file);
+int read_header(int fd);
+void nm_print(char *file, struct nlist *stbl);
int main(argc, argv)
int argc;
int heading; /* set when heading printed */
int error;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void size, (char *name));
+int main(int argc, char **argv);
+void size(char *name);
int main(argc, argv)
int argc;
#define NODAY (-2)
char CRONPID[] = "/usr/run/cron.pid";
-_PROTOTYPE(int main, (int argc, char **argv, char **envp));
-_PROTOTYPE(int getltim, (char *t));
-_PROTOTYPE(int getlday, (char *m, char *d));
-_PROTOTYPE(int digitstring, (char *s));
+int main(int argc, char **argv, char **envp);
+int getltim(char *t);
+int getlday(char *m, char *d);
+int digitstring(char *s);
int main(argc, argv, envp)
int argc;
extern int errno;
extern char **environ;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void maketarget, (char *dir2));
-_PROTOTYPE(int make_dir, (char *dir));
-_PROTOTYPE(int stat_all, (char *dir1, int n));
-_PROTOTYPE(void sort_dir, (int m));
-_PROTOTYPE(void process, (int m, char *dir1, char *dir2));
-_PROTOTYPE(void swap, (struct sorted *sp1, struct sorted *sp2));
-_PROTOTYPE(int copy, (char *dir1, struct sorted *sp, char *cbuf2));
-_PROTOTYPE(int zcopy, (char *src, char *targ));
-_PROTOTYPE(void copydir, (char *dir1, char *dir2, char *namep));
-_PROTOTYPE(void newdisk, (char *dir));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void error, (int type, char *s1, char *s2, char *s3));
+int main(int argc, char **argv);
+void maketarget(char *dir2);
+int make_dir(char *dir);
+int stat_all(char *dir1, int n);
+void sort_dir(int m);
+void process(int m, char *dir1, char *dir2);
+void swap(struct sorted *sp1, struct sorted *sp2);
+int copy(char *dir1, struct sorted *sp, char *cbuf2);
+int zcopy(char *src, char *targ);
+void copydir(char *dir1, char *dir2, char *namep);
+void newdisk(char *dir);
+void usage(void);
+void error(int type, char *s1, char *s2, char *s3);
int main(argc, argv)
int argc;
#define EXTERN extern
#include "mfs/super.h"
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void get_super, (void));
-_PROTOTYPE(void rw_inode, (struct stat * stat_ptr, int rw_mode));
-_PROTOTYPE(void get_inode, (struct stat * stat_ptr));
-_PROTOTYPE(void put_inode, (struct stat * stat_ptr));
-_PROTOTYPE(long rd_cmdline, (int argc, char *argv[]));
-_PROTOTYPE(void modify, (int nr_blocks));
-_PROTOTYPE(void save_blk, (block_t blk_num));
-_PROTOTYPE(void reset_blks, (void));
-_PROTOTYPE(void show_blks, (void));
-_PROTOTYPE(int blk_is_used, (block_t blk_num));
-_PROTOTYPE(int blk_ok, (block_t num));
-_PROTOTYPE(void set_bit, (zone_t num));
-_PROTOTYPE(long rd_num, (void));
-_PROTOTYPE(int ok, (char *str));
-_PROTOTYPE(void done, (int nr));
+int main(int argc, char **argv);
+void get_super(void);
+void rw_inode(struct stat * stat_ptr, int rw_mode);
+void get_inode(struct stat * stat_ptr);
+void put_inode(struct stat * stat_ptr);
+long rd_cmdline(int argc, char *argv[]);
+void modify(int nr_blocks);
+void save_blk(block_t blk_num);
+void reset_blks(void);
+void show_blks(void);
+int blk_is_used(block_t blk_num);
+int blk_ok(block_t num);
+void set_bit(zone_t num);
+long rd_num(void);
+int ok(char *str);
+void done(int nr);
/* Super block table.
*
#include <string.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
char *glyphs[] = {
" @@@ @@ @@ @ @ @@@@@ @@ @@@ ",
#define EOS '\0'
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void doyear, (int year));
-_PROTOTYPE(void domonth, (int year, int month));
-_PROTOTYPE(void output, (int nmonths));
-_PROTOTYPE(void calendar, (int year, int month, int indx));
-_PROTOTYPE(void usage, (char *s));
-_PROTOTYPE(int date, (int year, int month, int week, int wday));
-_PROTOTYPE(void setmonth, (int year, int month));
-_PROTOTYPE(int getdate, (int week, int wday));
-_PROTOTYPE(static int Jan1, (int year));
+int main(int argc, char **argv);
+void doyear(int year);
+void domonth(int year, int month);
+void output(int nmonths);
+void calendar(int year, int month, int indx);
+void usage(char *s);
+int date(int year, int month, int week, int wday);
+void setmonth(int year, int month);
+int getdate(int week, int wday);
+static int Jan1(int year);
int main(argc, argv)
int argc;
+++ /dev/null
-/* The <minix/ansi.h> header attempts to decide whether the compiler has enough
- * conformance to Standard C for Minix to take advantage of. If so, the
- * symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined
- * here, but it may be defined by applications that want to bend the rules.
- * The magic number in the definition is to inhibit unnecessary bending
- * of the rules. (For consistency with the new '#ifdef _ANSI" tests in
- * the headers, _ANSI should really be defined as nothing, but that would
- * break many library routines that use "#if _ANSI".)
-
- * If _ANSI ends up being defined, a macro
- *
- * _PROTOTYPE(function, params)
- *
- * is defined. This macro expands in different ways, generating either
- * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
- * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
- * in such a way that they are portable over both ANSI and K&R compilers.
- * The appropriate macros are defined here.
- */
-
-#ifndef _MINIX_ANSI_H
-#define _MINIX_ANSI_H
-
-#if __STDC__ == 1
-#define _ANSI 31459 /* compiler claims full ANSI conformance */
-#endif
-
-#ifdef __GNUC__
-#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
-#endif
-
-#ifdef _ANSI
-
-/* Keep everything for ANSI prototypes. */
-#define _PROTOTYPE(function, params) function params
-
-#define _VOIDSTAR void *
-#define _VOID void
-#define _CONST const
-#define _VOLATILE volatile
-#define _SIZET size_t
-
-#else
-
-/* Throw away the parameters for K&R prototypes. */
-#define _PROTOTYPE(function, params) function()
-
-#define _VOIDSTAR void *
-#define _VOID void
-#define _CONST
-#define _VOLATILE
-#define _SIZET int
-
-#endif /* _ANSI */
-
-#endif /* _MINIX_ANSI_H */
#include <sys/types.h>
-#include "ansi.h"
+#include <minix/ansi.h>
#define MAXLL 2048 /* ridiculous maximum line length */
unsigned char Ulb[MAXLL]; /* underline buffer */
int Ulx = 0; /* underline buffer index */
-_PROTOTYPE(void Putchar,(int ch));
+void Putchar(int ch);
main(argc, argv)
int argc;
#include "cawf.h"
#include <ctype.h>
-_PROTOTYPE(static unsigned char *Convstr,(char *s, int *len));
-_PROTOTYPE(static int Convfont,(char *nm, char *s, char **fn,
- unsigned char **fi));
+static unsigned char *Convstr(char *s, int *len);
+static int Convfont(char *nm, char *s, char **fn, unsigned char **fi);
#ifndef UNIX
#define strcasecmp strcmpi
* Prototypes for request processing functions.
*/
-_PROTOTYPE(static void nr_UL,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_Ub,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_Uc,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_Uf,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_Ur,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_ad,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_bp,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_br,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_ce,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_di,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_ds,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_fi,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_fl,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_ft,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_it,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_na,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_nf,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_ns,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_rm,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_rn,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_rr,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_rs,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_tm,(unsigned char *line, int brk));
-_PROTOTYPE(static void nr_tr,(unsigned char *line, int brk));
-
-_PROTOTYPE(static void nr_nil,(unsigned char *line, int brk));
+static void nr_UL(unsigned char *line, int brk);
+static void nr_Ub(unsigned char *line, int brk);
+static void nr_Uc(unsigned char *line, int brk);
+static void nr_Uf(unsigned char *line, int brk);
+static void nr_Ur(unsigned char *line, int brk);
+static void nr_ad(unsigned char *line, int brk);
+static void nr_bp(unsigned char *line, int brk);
+static void nr_br(unsigned char *line, int brk);
+static void nr_ce(unsigned char *line, int brk);
+static void nr_di(unsigned char *line, int brk);
+static void nr_ds(unsigned char *line, int brk);
+static void nr_fi(unsigned char *line, int brk);
+static void nr_fl(unsigned char *line, int brk);
+static void nr_ft(unsigned char *line, int brk);
+static void nr_it(unsigned char *line, int brk);
+static void nr_na(unsigned char *line, int brk);
+static void nr_nf(unsigned char *line, int brk);
+static void nr_ns(unsigned char *line, int brk);
+static void nr_rm(unsigned char *line, int brk);
+static void nr_rn(unsigned char *line, int brk);
+static void nr_rr(unsigned char *line, int brk);
+static void nr_rs(unsigned char *line, int brk);
+static void nr_tm(unsigned char *line, int brk);
+static void nr_tr(unsigned char *line, int brk);
+
+static void nr_nil(unsigned char *line, int brk);
/*
* 4. This notice may not be removed or altered.
*/
-#include "ansi.h"
+#include <minix/ansi.h>
#ifdef UNIX
# ifdef USG
#include <malloc.h>
# endif /* UNIX */
#else /* not STDLIB */
-_PROTOTYPE(char *getenv,(char *name));
+char *getenv(char *name);
# ifdef UNIX
# ifdef MALLOCH
#include <malloc.h>
# else /* not MALLOCH */
-_PROTOTYPE(char *malloc,(unsigned size));
+char *malloc(unsigned size);
# endif /* MALLOCH */
# else /* not UNIX */
#include <malloc.h>
# endif /* UNIX */
#endif /* STDLIB */
-_PROTOTYPE(unsigned char *Asmcode,(unsigned char **s, unsigned char *c));
-_PROTOTYPE(int Asmname,(unsigned char *s, unsigned char *c));
-_PROTOTYPE(void Charput,(int c));
-_PROTOTYPE(int Delmacro,(int mx));
-_PROTOTYPE(int Defdev,());
-_PROTOTYPE(void Delstr,(int sx));
-_PROTOTYPE(void Error,(int t, int l, char *s1, char *s2));
-_PROTOTYPE(void Error3,(int len, char *word, char *sarg, int narg, char *msg));
-_PROTOTYPE(void Expand,(unsigned char *line));
-_PROTOTYPE(void Delnum,(int nx));
-_PROTOTYPE(unsigned char *Field,(int n, unsigned char *p, int c));
-_PROTOTYPE(void Endword,());
-_PROTOTYPE(int Findchar,(unsigned char *nm, int l, unsigned char *s, int e));
-_PROTOTYPE(int Findhy,(unsigned char *s, int l, int e));
-_PROTOTYPE(int Findmacro,(unsigned char *p, int e));
-_PROTOTYPE(int Findnum,(unsigned char *n, int v, int e));
-_PROTOTYPE(int Findparms,(unsigned char *n));
-_PROTOTYPE(int Findscale,(int n, double v, int e));
-_PROTOTYPE(unsigned char *Findstr,(unsigned char *nm, unsigned char *s, int e));
-_PROTOTYPE(int LenprtHF,(unsigned char *s, int p, int t));
-_PROTOTYPE(int main,(int argc, char *argv[]));
-_PROTOTYPE(void Macro,(unsigned char *inp));
-_PROTOTYPE(void Nreq,(unsigned char *line, int brk));
-_PROTOTYPE(void Free,(unsigned char **p));
-_PROTOTYPE(unsigned char *Newstr,(unsigned char *s));
-_PROTOTYPE(void Pass2,(unsigned char *line));
-_PROTOTYPE(void Pass3,(int len, unsigned char *word, unsigned char *sarg, int narg));
-_PROTOTYPE(void regerror,(char *s));
-_PROTOTYPE(unsigned char *reg,(int paren, int *flagp));
-_PROTOTYPE(unsigned char *regatom,(int *flagp));
-_PROTOTYPE(unsigned char *regbranch,(int *flagp));
-_PROTOTYPE(regexp *regcomp,(char *exp));
-_PROTOTYPE(void regdump,(regexp *r));
-_PROTOTYPE(int regexec,(regexp *prog, unsigned char *string));
-_PROTOTYPE(void Stringput,(unsigned char *s));
-_PROTOTYPE(int Str2word,(unsigned char *s, int len));
+unsigned char *Asmcode(unsigned char **s, unsigned char *c);
+int Asmname(unsigned char *s, unsigned char *c);
+void Charput(int c);
+int Delmacro(int mx);
+int Defdev();
+void Delstr(int sx);
+void Error(int t, int l, char *s1, char *s2);
+void Error3(int len, char *word, char *sarg, int narg, char *msg);
+void Expand(unsigned char *line);
+void Delnum(int nx);
+unsigned char *Field(int n, unsigned char *p, int c);
+void Endword();
+int Findchar(unsigned char *nm, int l, unsigned char *s, int e);
+int Findhy(unsigned char *s, int l, int e);
+int Findmacro(unsigned char *p, int e);
+int Findnum(unsigned char *n, int v, int e);
+int Findparms(unsigned char *n);
+int Findscale(int n, double v, int e);
+unsigned char *Findstr(unsigned char *nm, unsigned char *s, int e);
+int LenprtHF(unsigned char *s, int p, int t);
+int main(int argc, char *argv[]);
+void Macro(unsigned char *inp);
+void Nreq(unsigned char *line, int brk);
+void Free(unsigned char **p);
+unsigned char *Newstr(unsigned char *s);
+void Pass2(unsigned char *line);
+void Pass3(int len, unsigned char *word, unsigned char *sarg, int narg);
+void regerror(char *s);
+unsigned char *reg(int paren, int *flagp);
+unsigned char *regatom(int *flagp);
+unsigned char *regbranch(int *flagp);
+regexp *regcomp(char *exp);
+void regdump(regexp *r);
+int regexec(regexp *prog, unsigned char *string);
+void Stringput(unsigned char *s);
+int Str2word(unsigned char *s, int len);
/*
* Forward declarations for regcomp()'s friends.
*/
-_PROTOTYPE(STATIC unsigned char *reg, (int paren, int *flagp ));
-_PROTOTYPE(STATIC unsigned char *regbranch, (int *flagp ));
-_PROTOTYPE(STATIC unsigned char *regpiece, (int *flagp ));
-_PROTOTYPE(STATIC unsigned char *regatom, (int *flagp ));
-_PROTOTYPE(STATIC unsigned char *regnode, (int op ));
-_PROTOTYPE(STATIC void regc, (int b ));
-_PROTOTYPE(STATIC void reginsert, (int op, unsigned char *opnd ));
-_PROTOTYPE(STATIC void regtail, (unsigned char *p, unsigned char *val ));
-_PROTOTYPE(STATIC void regoptail, (unsigned char *p, unsigned char *val ));
-_PROTOTYPE(STATIC int regtry, (regexp *prog, unsigned char *string ));
-_PROTOTYPE(STATIC int regmatch, (unsigned char *prog ));
-_PROTOTYPE(STATIC int regrepeat, (unsigned char *p ));
-_PROTOTYPE(STATIC unsigned char *regnext, (unsigned char *p ));
-_PROTOTYPE(STATIC unsigned char *regprop, (unsigned char *op ));
+STATIC unsigned char *reg(int paren, int *flagp );
+STATIC unsigned char *regbranch(int *flagp );
+STATIC unsigned char *regpiece(int *flagp );
+STATIC unsigned char *regatom(int *flagp );
+STATIC unsigned char *regnode(int op );
+STATIC void regc(int b );
+STATIC void reginsert(int op, unsigned char *opnd );
+STATIC void regtail(unsigned char *p, unsigned char *val );
+STATIC void regoptail(unsigned char *p, unsigned char *val );
+STATIC int regtry(regexp *prog, unsigned char *string );
+STATIC int regmatch(unsigned char *prog );
+STATIC int regrepeat(unsigned char *p );
+STATIC unsigned char *regnext(unsigned char *p );
+STATIC unsigned char *regprop(unsigned char *op );
#ifdef STRCSPN
-_PROTOTYPE(STATIC int strcspn, (unsigned char *s1, unsigned char *s2 ));
+STATIC int strcspn(unsigned char *s1, unsigned char *s2 );
#endif
/*
#include "cawf.h"
#include <ctype.h>
-_PROTOTYPE(static void Setroman,());
+static void Setroman();
/*
struct stat st;
char path[PATH_MAX + 1];
-_PROTOTYPE(int do_change, (char *name));
-_PROTOTYPE(void usage, (void));
+int do_change(char *name);
+void usage(void);
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */
mode_t parsemode(const char *symbolic, mode_t oldmode)
uid_t nuid;
gid_t ngid;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void do_chown, (char *file));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void do_chown(char *file);
+void usage(void);
/* Main module. If chown(1) is invoked as chgrp(1), the behaviour is nearly
* identical, except that the default when a single name is given as an
char original[] = "/tmp/cioXXXXXX"; /* previous revision */
char diffout[] = "/tmp/cidXXXXXX"; /* diffs */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void rundiff, (void));
-_PROTOTYPE(void logmsg, (FILE *fp));
-_PROTOTYPE(void fname, (char *src, char *dst));
-_PROTOTYPE(void svcname, (char *src, char *dst));
-_PROTOTYPE(int lockcheck, (FILE *fp, int rev));
-_PROTOTYPE(void onintr, (int dummy));
-_PROTOTYPE(void clean, (void));
-_PROTOTYPE(char *whoami, (void));
+int main(int argc, char **argv);
+void rundiff(void);
+void logmsg(FILE *fp);
+void fname(char *src, char *dst);
+void svcname(char *src, char *dst);
+int lockcheck(FILE *fp, int rev);
+void onintr(int dummy);
+void clean(void);
+char *whoami(void);
int main(argc, argv)
int argc;
0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void crc, (int fd, char *name));
-_PROTOTYPE(unsigned long strncrc, (unsigned char *b, int n, unsigned long s));
+int main(int argc, char **argv);
+void crc(int fd, char *name);
+unsigned long strncrc(unsigned char *b, int n, unsigned long s);
static int aux;
#include <string.h>
#include <errno.h>
-_PROTOTYPE(void fatal, (char *label));
-_PROTOTYPE(int cmp, (int fd1, int fd2));
-_PROTOTYPE(void Usage, (void));
-_PROTOTYPE(int main, (int argc, char **argv));
+void fatal(char *label);
+int cmp(int fd1, int fd2);
+void Usage(void);
+int main(int argc, char **argv);
#define BLOCK 4096
char difftemp[PATHLEN]; /* extract() fix/patch input */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void fname, (char *src, char *dst));
-_PROTOTYPE(void svcname, (char *src, char *dst));
-_PROTOTYPE(void extract, (char *script, char *out, int rev));
-_PROTOTYPE(char *basename, (char *name));
-_PROTOTYPE(char *whoami, (void));
-_PROTOTYPE(int getyn, (void));
+int main(int argc, char **argv);
+void fname(char *src, char *dst);
+void svcname(char *src, char *dst);
+void extract(char *script, char *out, int rev);
+char *basename(char *name);
+char *whoami(void);
+int getyn(void);
int main(argc, argv)
int argc;
static char *umsg = "Usage: comm [-[123]] file1 file2\n";
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void error, (char *s, char *f));
-_PROTOTYPE(void eopen, (char *fn, struct file *file));
-_PROTOTYPE(int getbuf, (struct file *file));
-_PROTOTYPE(int readline, (int fno));
-_PROTOTYPE(void comm, (void));
-_PROTOTYPE(void putcol, (int col, char *buf));
-_PROTOTYPE(void cpycol, (int col));
+int main(int argc, char **argv);
+void usage(void);
+void error(char *s, char *f);
+void eopen(char *fn, struct file *file);
+int getbuf(struct file *file);
+int readline(int fno);
+void comm(void);
+void putcol(int col, char *buf);
+void cpycol(int col);
int main(argc, argv)
int argc;
code_int free_ent = 0; /* first unused entry */
int exit_stat = 0;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Usage, (void));
-_PROTOTYPE(void compress, (void));
-_PROTOTYPE(void onintr, (int dummy));
-_PROTOTYPE(void oops, (int dummy));
-_PROTOTYPE(void output, (code_int code));
-_PROTOTYPE(int foreground, (void));
-_PROTOTYPE(void decompress, (void));
-_PROTOTYPE(code_int getcode, (void));
-_PROTOTYPE(void writeerr, (void));
-_PROTOTYPE(void copystat, (char *ifname, char *ofname));
-_PROTOTYPE(int foreground, (void));
-_PROTOTYPE(void cl_block , (void));
-_PROTOTYPE(void cl_hash, (count_int hsize));
-_PROTOTYPE(void prratio, (FILE *stream, long int num, long int den));
-_PROTOTYPE(void version, (void));
+int main(int argc, char **argv);
+void Usage(void);
+void compress(void);
+void onintr(int dummy);
+void oops(int dummy);
+void output(code_int code);
+int foreground(void);
+void decompress(void);
+code_int getcode(void);
+void writeerr(void);
+void copystat(char *ifname, char *ofname);
+int foreground(void);
+void cl_block(void);
+void cl_hash(count_int hsize);
+void prratio(FILE *stream, long int num, long int den);
+void version(void);
void Usage() {
#ifdef DEBUG
char *pch, *errorp;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(BOOLEAN is, (char *pc));
-_PROTOTYPE(int num, (void));
-_PROTOTYPE(void puto, (void));
-_PROTOTYPE(void statistics, (void));
-_PROTOTYPE(int ulcase, (int c));
-_PROTOTYPE(void cnull, (int c));
-_PROTOTYPE(void null, (int c));
-_PROTOTYPE(void extra, (void));
-_PROTOTYPE(void over, (int dummy));
+int main(int argc, char **argv);
+BOOLEAN is(char *pc);
+int num(void);
+void puto(void);
+void statistics(void);
+int ulcase(int c);
+void cnull(int c);
+void null(int c);
+void extra(void);
+void over(int dummy);
BOOLEAN is(pc)
char *pc;
int clearflg; /* if set, allow CLEAR */
int inmod; /* mod 8 for getbits() */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void ffork, (void));
-_PROTOTYPE(void die, (char *s));
-_PROTOTYPE(void myputc, (unsigned c));
-_PROTOTYPE(unsigned mygetc, (void));
-_PROTOTYPE(void getbits, (void));
-_PROTOTYPE(void getpipe, (void));
-_PROTOTYPE(void putpipe, (unsigned u, int flag));
+int main(int argc, char **argv);
+void ffork(void);
+void die(char *s);
+void myputc(unsigned c);
+unsigned mygetc(void);
+void getbits(void);
+void getpipe(void);
+void putpipe(unsigned u, int flag);
int main(argc, argv)
int argc;
#include <sys/times.h>
#endif
-#ifndef _PROTOTYPE
-#define _PROTOTYPE(fun, args) fun args
-#endif
-
-_PROTOTYPE(int main, (void));
-_PROTOTYPE(void prep_timer, (void));
-_PROTOTYPE(void timeout, (int sig));
-_PROTOTYPE(void Proc0, (void));
-_PROTOTYPE(void Proc1, (RecordPtr PtrParIn));
-_PROTOTYPE(void Proc2, (OneToFifty *IntParIO));
-_PROTOTYPE(void Proc3, (RecordPtr *PtrParOut));
-_PROTOTYPE(void Proc4, (void));
-_PROTOTYPE(void Proc5, (void));
-_PROTOTYPE(void Proc6, (Enumeration EnumParIn, Enumeration *EnumParOut));
-_PROTOTYPE(void Proc7, (OneToFifty IntParI1, OneToFifty IntParI2,
- OneToFifty *IntParOut));
-_PROTOTYPE(void Proc8, (Array1Dim Array1Par, Array2Dim Array2Par,
- OneToFifty IntParI1, OneToFifty IntParI2));
-/*_PROTOTYPE(Enumeration Func1,(CapitalLetter CharPar1, CapitalLetter CharPar2));*/
-_PROTOTYPE(boolean Func2, (String30 StrParI1, String30 StrParI2));
-_PROTOTYPE(boolean Func3, (Enumeration EnumParIn));
-
-_PROTOTYPE(Enumeration Func1, (int CharPar1, int CharPar2));
+int main(void);
+void prep_timer(void);
+void timeout(int sig);
+void Proc0(void);
+void Proc1(RecordPtr PtrParIn);
+void Proc2(OneToFifty *IntParIO);
+void Proc3(RecordPtr *PtrParOut);
+void Proc4(void);
+void Proc5(void);
+void Proc6(Enumeration EnumParIn, Enumeration *EnumParOut);
+void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty
+ *IntParOut);
+void Proc8(Array1Dim Array1Par, Array2Dim Array2Par, OneToFifty
+ IntParI1, OneToFifty IntParI2);
+boolean Func2(String30 StrParI1, String30 StrParI2);
+boolean Func3(Enumeration EnumParIn);
+
+Enumeration Func1(int CharPar1, int CharPar2);
int main()
/* Prototypes. */
-_PROTOTYPE(void usage, (char *prog_name) );
-_PROTOTYPE(unsigned c2u2, (unsigned char *ucarray) );
-_PROTOTYPE(unsigned long c4u4, (unsigned char *ucarray) );
-_PROTOTYPE(void determine, (void));
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(DIRECTORY *directory, (DIRECTORY *dir, int entries, BOOL function, char *pathname) );
-_PROTOTYPE(void extract, (DIRECTORY *entry) );
-_PROTOTYPE(void make_file, (DIRECTORY *dir_ptr, int entries, char *name) );
-_PROTOTYPE(void fill_date, (DIRECTORY *entry) );
-_PROTOTYPE(char *make_name, (DIRECTORY *dir_ptr, int dir_fl) );
-_PROTOTYPE(int fill, (char *buffer, size_t size) );
-_PROTOTYPE(void xmodes, (int mode) );
-_PROTOTYPE(void show, (DIRECTORY *dir_ptr, char *name) );
-_PROTOTYPE(void free_blocks, (void));
-_PROTOTYPE(DIRECTORY *read_cluster, (unsigned int cluster) );
-_PROTOTYPE(unsigned short free_cluster, (BOOL leave_fl) );
-_PROTOTYPE(void link_fat, (unsigned int cl_1, unsigned int cl_2) );
-_PROTOTYPE(unsigned short next_cluster, (unsigned int cl_no) );
-_PROTOTYPE(char *slash, (char *str) );
-_PROTOTYPE(void add_path, (char *file, BOOL slash_fl) );
-_PROTOTYPE(void disk_io, (BOOL op, unsigned long seek, void *address, unsigned bytes) );
-_PROTOTYPE(void flush_fat, (void));
-_PROTOTYPE(void read_fat, (unsigned int cl_no));
-_PROTOTYPE(BOOL free_range, (unsigned short *first, unsigned short *last));
-_PROTOTYPE(long lmin, (long a, long b));
+void usage(char *prog_name);
+unsigned c2u2(unsigned char *ucarray);
+unsigned long c4u4(unsigned char *ucarray);
+void determine(void);
+int main(int argc, char *argv []);
+DIRECTORY *directory(DIRECTORY *dir, int entries, BOOL function, char
+ *pathname);
+void extract(DIRECTORY *entry);
+void make_file(DIRECTORY *dir_ptr, int entries, char *name);
+void fill_date(DIRECTORY *entry);
+char *make_name(DIRECTORY *dir_ptr, int dir_fl);
+int fill(char *buffer, size_t size);
+void xmodes(int mode);
+void show(DIRECTORY *dir_ptr, char *name);
+void free_blocks(void);
+DIRECTORY *read_cluster(unsigned int cluster);
+unsigned short free_cluster(BOOL leave_fl);
+void link_fat(unsigned int cl_1, unsigned int cl_2);
+unsigned short next_cluster(unsigned int cl_no);
+char *slash(char *str);
+void add_path(char *file, BOOL slash_fl);
+void disk_io(BOOL op, unsigned long seek, void *address, unsigned
+ bytes);
+void flush_fat(void);
+void read_fat(unsigned int cl_no);
+BOOL free_range(unsigned short *first, unsigned short *last);
+long lmin(long a, long b);
void usage(prog_name)
int column = 0; /* Current column, retained between files */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Expand, (FILE *f, int tab_index, int tabs []));
+int main(int argc, char **argv);
+void Expand(FILE *f, int tab_index, int tabs []);
int main(argc, argv)
int argc;
#include <stdlib.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(long first, (long k));
+int main(int argc, char **argv);
+long first(long k);
int main(argc, argv)
int argc;
int readonly;
int override= 0;
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void getgeom, (void));
-_PROTOTYPE(int getboot, (char *buffer));
-_PROTOTYPE(int putboot, (char *buffer));
-_PROTOTYPE(void load_from_file, (void));
-_PROTOTYPE(void save_to_file, (void));
-_PROTOTYPE(int dpl_partitions, (int rawflag));
-_PROTOTYPE(int chk_table, (void));
-_PROTOTYPE(int sec_to_hst, (long logsec, unsigned char *hd, unsigned char *sec,
- unsigned char *cyl));
-_PROTOTYPE(int mark_partition, (struct part_entry *pe));
-_PROTOTYPE(void change_partition, (struct part_entry *entry));
-_PROTOTYPE(int get_a_char, (void));
-_PROTOTYPE(int print_menu, (void));
-_PROTOTYPE(void adj_base, (struct part_entry *pe));
-_PROTOTYPE(void adj_size, (struct part_entry *pe));
-_PROTOTYPE(struct part_entry *ask_partition, (void));
-_PROTOTYPE(void footnotes, (void));
-_PROTOTYPE(int get_an_int, (char *prompt, int *intptr));
-_PROTOTYPE(void list_part_types, (void));
-_PROTOTYPE(void mark_npartition, (struct part_entry *pe));
-_PROTOTYPE(int mygets, (char *buf, int length));
-_PROTOTYPE(char *systype, (int type));
-_PROTOTYPE(void toggle_active, (struct part_entry *pe));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char *argv []);
+void getgeom(void);
+int getboot(char *buffer);
+int putboot(char *buffer);
+void load_from_file(void);
+void save_to_file(void);
+int dpl_partitions(int rawflag);
+int chk_table(void);
+int sec_to_hst(long logsec, unsigned char *hd, unsigned char *sec,
+ unsigned char *cyl);
+int mark_partition(struct part_entry *pe);
+void change_partition(struct part_entry *entry);
+int get_a_char(void);
+int print_menu(void);
+void adj_base(struct part_entry *pe);
+void adj_size(struct part_entry *pe);
+struct part_entry *ask_partition(void);
+void footnotes(void);
+int get_an_int(char *prompt, int *intptr);
+void list_part_types(void);
+void mark_npartition(struct part_entry *pe);
+int mygets(char *buf, int length);
+char *systype(int type);
+void toggle_active(struct part_entry *pe);
+void usage(void);
/* One featureful master bootstrap. */
char bootstrap[] = {
int tabsize = sizeof(table) / sizeof(struct info);
int L_flag;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void file, (char *name));
-_PROTOTYPE(void do_strip, (int type));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void file(char *name);
+void do_strip(int type);
+void usage(void);
int main(argc, argv)
int argc;
/* getline() already declared in stdio.h */
#define getline fix_getline
#endif
-_PROTOTYPE(char *getline, (FILE *fp, char *b));
-_PROTOTYPE(char *range, (char *s, int *p1, int *p2));
-_PROTOTYPE(int getcommand, (FILE *fp, int *o1, int *o2, char *pcmd, int *n1, int *n2));
-_PROTOTYPE(void fatal, (const char *s, ...));
-_PROTOTYPE(int strwcmp, (char *s1, char *s2));
-_PROTOTYPE(int whitespace, (int ch));
+char *getline(FILE *fp, char *b);
+char *range(char *s, int *p1, int *p2);
+int getcommand(FILE *fp, int *o1, int *o2, char *pcmd, int *n1, int
+ *n2);
+void fatal(const char *s, ...);
+int strwcmp(char *s1, char *s2);
+int whitespace(int ch);
char *
getline(FILE *fp, char *b)
int column = 0; /* Current column, retained between files */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Fold, (FILE *f, int width));
+int main(int argc, char **argv);
+void Fold(FILE *f, int width);
int main(argc, argv)
int argc;
static char *Copyright = "\0Copyright (c) 1990 Bert Reuling";
static unsigned long seed;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(unsigned long magic, (unsigned long range));
+int main(int argc, char **argv);
+unsigned long magic(unsigned long range);
int main(argc, argv)
int argc;
unsigned part_offset; /* sector offset for this partition */
char answer[] = "Answer questions with y or n. Then hit RETURN";
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void initvars, (void));
-_PROTOTYPE(void fatal, (char *s));
-_PROTOTYPE(int eoln, (int c));
-_PROTOTYPE(int yes, (char *question));
-_PROTOTYPE(int atoo, (char *s));
-_PROTOTYPE(int input, (char *buf, int size));
-_PROTOTYPE(char *alloc, (unsigned nelem, unsigned elsize));
-_PROTOTYPE(void printname, (char *s));
-_PROTOTYPE(void printrec, (struct stack *sp));
-_PROTOTYPE(void printpath, (int mode, int nlcr));
-_PROTOTYPE(void devopen, (void));
-_PROTOTYPE(void devclose, (void));
-_PROTOTYPE(void devio, (block_nr bno, int dir));
-_PROTOTYPE(void devread, (long block, long offset, char *buf, int size));
-_PROTOTYPE(void devwrite, (long block, long offset, char *buf, int size));
-_PROTOTYPE(void pr, (char *fmt, int cnt, char *s, char *p));
-_PROTOTYPE(void lpr, (char *fmt, long cnt, char *s, char *p));
-_PROTOTYPE(bit_nr getnumber, (char *s));
-_PROTOTYPE(char **getlist, (char ***argv, char *type));
-_PROTOTYPE(void lsuper, (void));
+int main(int argc, char **argv);
+void initvars(void);
+void fatal(char *s);
+int eoln(int c);
+int yes(char *question);
+int atoo(char *s);
+int input(char *buf, int size);
+char *alloc(unsigned nelem, unsigned elsize);
+void printname(char *s);
+void printrec(struct stack *sp);
+void printpath(int mode, int nlcr);
+void devopen(void);
+void devclose(void);
+void devio(block_nr bno, int dir);
+void devread(long block, long offset, char *buf, int size);
+void devwrite(long block, long offset, char *buf, int size);
+void pr(char *fmt, int cnt, char *s, char *p);
+void lpr(char *fmt, long cnt, char *s, char *p);
+bit_nr getnumber(char *s);
+char **getlist(char ***argv, char *type);
+void lsuper(void);
#define SUPER_GET 0
#define SUPER_PUT 1
-_PROTOTYPE(void rw_super, (int mode));
-_PROTOTYPE(void chksuper, (void));
-_PROTOTYPE(void lsi, (char **clist));
-_PROTOTYPE(bitchunk_t *allocbitmap, (int nblk));
-_PROTOTYPE(void loadbitmap, (bitchunk_t *bitmap, block_nr bno, int nblk));
-_PROTOTYPE(void dumpbitmap, (bitchunk_t *bitmap, block_nr bno, int nblk));
-_PROTOTYPE(void fillbitmap, (bitchunk_t *bitmap, bit_nr lwb, bit_nr upb, char **list));
-_PROTOTYPE(void freebitmap, (bitchunk_t *p));
-_PROTOTYPE(void getbitmaps, (void));
-_PROTOTYPE(void putbitmaps, (void));
-_PROTOTYPE(void chkword, (unsigned w1, unsigned w2, bit_nr bit, char *type, int *n, int *report, bit_t));
-_PROTOTYPE(void chkmap, (bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr blkno, int nblk, char *type));
-_PROTOTYPE(void chkilist, (void));
-_PROTOTYPE(void getcount, (void));
-_PROTOTYPE(void counterror, (ino_t ino));
-_PROTOTYPE(void chkcount, (void));
-_PROTOTYPE(void freecount, (void));
-_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay));
-_PROTOTYPE(void list, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int Remove, (dir_struct *dp));
-_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n));
-_PROTOTYPE(int chkdots, (ino_t ino, off_t pos, dir_struct *dp, ino_t exp));
-_PROTOTYPE(int chkname, (ino_t ino, dir_struct *dp));
-_PROTOTYPE(int chkentry, (ino_t ino, off_t pos, dir_struct *dp));
-_PROTOTYPE(int chkdirzone, (ino_t ino, d_inode *ip, off_t pos, zone_nr zno));
-_PROTOTYPE(int chksymlinkzone, (ino_t ino, d_inode *ip, off_t pos,
- zone_nr zno));
-_PROTOTYPE(void errzone, (char *mess, zone_nr zno, int level, off_t pos));
-_PROTOTYPE(int markzone, (zone_nr zno, int level, off_t pos));
-_PROTOTYPE(int chkindzone, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level));
-_PROTOTYPE(off_t jump, (int level));
-_PROTOTYPE(int zonechk, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level));
-_PROTOTYPE(int chkzones, (ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int len, int level));
-_PROTOTYPE(int chkfile, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int chkdirectory, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int chklink, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int chkspecial, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int chkmode, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int chkinode, (ino_t ino, d_inode *ip));
-_PROTOTYPE(int descendtree, (dir_struct *dp));
-_PROTOTYPE(void chktree, (void));
-_PROTOTYPE(void printtotal, (void));
-_PROTOTYPE(void chkdev, (char *f, char **clist, char **ilist, char **zlist));
+void rw_super(int mode);
+void chksuper(void);
+void lsi(char **clist);
+bitchunk_t *allocbitmap(int nblk);
+void loadbitmap(bitchunk_t *bitmap, block_nr bno, int nblk);
+void dumpbitmap(bitchunk_t *bitmap, block_nr bno, int nblk);
+void fillbitmap(bitchunk_t *bitmap, bit_nr lwb, bit_nr upb, char
+ **list);
+void freebitmap(bitchunk_t *p);
+void getbitmaps(void);
+void putbitmaps(void);
+void chkword(unsigned w1, unsigned w2, bit_nr bit, char *type, int *n,
+ int *report, bit_t);
+void chkmap(bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr
+ blkno, int nblk, char *type);
+void chkilist(void);
+void getcount(void);
+void counterror(ino_t ino);
+void chkcount(void);
+void freecount(void);
+void printperm(mode_t mode, int shift, int special, int overlay);
+void list(ino_t ino, d_inode *ip);
+int Remove(dir_struct *dp);
+void make_printable_name(char *dst, char *src, int n);
+int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp);
+int chkname(ino_t ino, dir_struct *dp);
+int chkentry(ino_t ino, off_t pos, dir_struct *dp);
+int chkdirzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno);
+int chksymlinkzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno);
+void errzone(char *mess, zone_nr zno, int level, off_t pos);
+int markzone(zone_nr zno, int level, off_t pos);
+int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int
+ level);
+off_t jump(int level);
+int zonechk(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level);
+int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int
+ len, int level);
+int chkfile(ino_t ino, d_inode *ip);
+int chkdirectory(ino_t ino, d_inode *ip);
+int chklink(ino_t ino, d_inode *ip);
+int chkspecial(ino_t ino, d_inode *ip);
+int chkmode(ino_t ino, d_inode *ip);
+int chkinode(ino_t ino, d_inode *ip);
+int descendtree(dir_struct *dp);
+void chktree(void);
+void printtotal(void);
+void chkdev(char *f, char **clist, char **ilist, char **zlist);
/* Initialize the variables used by this program. */
void initvars()
#include "file.h"
#include "net.h"
-_PROTOTYPE(static char *dir, (char *path, int full));
-_PROTOTYPE(static int asciisize, (int fd, off_t *filesize));
-_PROTOTYPE(static off_t asciisetsize, (int fd, off_t filesize));
-_PROTOTYPE(static int cloneit, (char *file, int mode));
+static char *dir(char *path, int full);
+static int asciisize(int fd, off_t *filesize);
+static off_t asciisetsize(int fd, off_t filesize);
+static int cloneit(char *file, int mode);
#if (__WORD_SIZE == 4)
static char buffer[8192];
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/
-_PROTOTYPE(int recvfile, (int fd, int fdin));
-_PROTOTYPE(int sendfile, (int fd, int fdout));
-_PROTOTYPE(int DOascii, (void));
-_PROTOTYPE(int DObinary, (void));
-_PROTOTYPE(int DOblock, (void));
-_PROTOTYPE(int DOstream, (void));
-_PROTOTYPE(int DOpwd, (void));
-_PROTOTYPE(int DOcd, (void));
-_PROTOTYPE(int DOmkdir, (void));
-_PROTOTYPE(int DOrmdir, (void));
-_PROTOTYPE(int DOdelete, (void));
-_PROTOTYPE(int DOmdtm, (void));
-_PROTOTYPE(int DOsize, (void));
-_PROTOTYPE(int DOstat, (void));
-_PROTOTYPE(int DOlist, (void));
-_PROTOTYPE(int DOnlst, (void));
-_PROTOTYPE(int DOretr, (void));
-_PROTOTYPE(int DOrretr, (void));
-_PROTOTYPE(int DOMretr, (void));
-_PROTOTYPE(int DOappe, (void));
-_PROTOTYPE(int DOstor, (void));
-_PROTOTYPE(int DOrstor, (void));
-_PROTOTYPE(int DOstou, (void));
-_PROTOTYPE(int DOMstor, (void));
-_PROTOTYPE(int DOclone, (void));
+int recvfile(int fd, int fdin);
+int sendfile(int fd, int fdout);
+int DOascii(void);
+int DObinary(void);
+int DOblock(void);
+int DOstream(void);
+int DOpwd(void);
+int DOcd(void);
+int DOmkdir(void);
+int DOrmdir(void);
+int DOdelete(void);
+int DOmdtm(void);
+int DOsize(void);
+int DOstat(void);
+int DOlist(void);
+int DOnlst(void);
+int DOretr(void);
+int DOrretr(void);
+int DOMretr(void);
+int DOappe(void);
+int DOstor(void);
+int DOrstor(void);
+int DOstou(void);
+int DOMstor(void);
+int DOclone(void);
#define getline ftp_getline
#endif
-_PROTOTYPE(static void makeargs, (char *buff));
-_PROTOTYPE(int DOver, (void));
-_PROTOTYPE(int DOhelp, (void));
-_PROTOTYPE(static int getline, (char *line, int len));
-_PROTOTYPE(int main, (int argc, char *argv[]));
+static void makeargs(char *buff);
+int DOver(void);
+int DOhelp(void);
+static int getline(char *line, int len);
+int main(int argc, char *argv[]);
static void makeargs(buff)
struct commands {
char *name;
- _PROTOTYPE(int (*func), (void));
+ int(*func) (void);
};
static struct commands commands[] = {
#define MODE_B_EOF 64
-_PROTOTYPE(int readline, (char *prompt, char *buff, int len));
-_PROTOTYPE(int DOgetreply, (void));
-_PROTOTYPE(int DOcmdcheck, (void));
-_PROTOTYPE(int DOcommand, (char *ftpcommand, char *ftparg));
+int readline(char *prompt, char *buff, int len);
+int DOgetreply(void);
+int DOcmdcheck(void);
+int DOcommand(char *ftpcommand, char *ftparg);
static char line2[512];
-_PROTOTYPE(static void dodir, (char *path, int full));
+static void dodir(char *path, int full);
int DOlpwd()
{
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/
-_PROTOTYPE(int DOlpwd, (void));
-_PROTOTYPE(int DOlcd, (void));
-_PROTOTYPE(int DOlmkdir, (void));
-_PROTOTYPE(int DOlrmdir, (void));
-_PROTOTYPE(int DOllist, (void));
-_PROTOTYPE(int DOlnlst, (void));
-_PROTOTYPE(int DOlshell, (void));
+int DOlpwd(void);
+int DOlcd(void);
+int DOlmkdir(void);
+int DOlrmdir(void);
+int DOllist(void);
+int DOlnlst(void);
+int DOlshell(void);
#include "xfer.h"
#include "net.h"
-_PROTOTYPE(void donothing, (int sig));
+void donothing(int sig);
int ftpcomm_fd;
static ipaddr_t myip;
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/
-_PROTOTYPE(int NETinit, (void));
-_PROTOTYPE(int DOopen, (void));
-_PROTOTYPE(int DOclose, (void));
-_PROTOTYPE(int DOquit, (void));
-_PROTOTYPE(int DOdata, (char *datacom, char *file, int direction, int fd));
+int NETinit(void);
+int DOopen(void);
+int DOclose(void);
+int DOquit(void);
+int DOdata(char *datacom, char *file, int direction, int fd);
extern int ftpcomm_fd;
#include "ftp.h"
#include "other.h"
-_PROTOTYPE(static int docmdargs, (char *cmd, int fa));
+static int docmdargs(char *cmd, int fa);
void FTPinit()
{
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/
-_PROTOTYPE(void FTPinit, (void));
-_PROTOTYPE(int DOpass, (void));
-_PROTOTYPE(int DOuser, (void));
-_PROTOTYPE(int DOnoop, (void));
-_PROTOTYPE(int DOpassive, (void));
-_PROTOTYPE(int DOsyst, (void));
-_PROTOTYPE(int DOremotehelp, (void));
-_PROTOTYPE(int DOquote, (void));
-_PROTOTYPE(int DOsite, (void));
+void FTPinit(void);
+int DOpass(void);
+int DOuser(void);
+int DOnoop(void);
+int DOpassive(void);
+int DOsyst(void);
+int DOremotehelp(void);
+int DOquote(void);
+int DOsite(void);
#include "ftp.h"
#include "xfer.h"
-_PROTOTYPE(static int asciisend, (int fd, int fdout));
-_PROTOTYPE(static int binarysend, (int fd, int fdout));
-_PROTOTYPE(static int asciirecv, (int fd, int fdin));
-_PROTOTYPE(static int binaryrecv, (int fd, int fdin));
+static int asciisend(int fd, int fdout);
+static int binarysend(int fd, int fdout);
+static int asciirecv(int fd, int fdin);
+static int binaryrecv(int fd, int fdin);
#if (__WORD_SIZE == 4)
static char buffer[8192];
*
*/
-_PROTOTYPE(int recvfile, (int fd, int fdin));
-_PROTOTYPE(int sendfile, (int fd, int fdout));
+int recvfile(int fd, int fdin);
+int sendfile(int fd, int fdout);
#define DEFAULT 10
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void do_file, (int n, FILE *f));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void do_file(int n, FILE *f);
+void usage(void);
int main(argc, argv)
int argc;
extern char *optarg;
/* Prototypes. */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(char fgetarg, (FILE *stream, char *cbuf));
-_PROTOTYPE(int find, (char *symd));
-_PROTOTYPE(void defit, (char *sym, int redef, int typed));
-_PROTOTYPE(void stop, (void));
-_PROTOTYPE(void gotoeoln, (void));
-_PROTOTYPE(void prteoln, (void));
-_PROTOTYPE(void printtable, (void));
-_PROTOTYPE(char getendif, (void));
-_PROTOTYPE(void gettable, (void));
-_PROTOTYPE(void parse, (void));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+char fgetarg(FILE *stream, char *cbuf);
+int find(char *symd);
+void defit(char *sym, int redef, int typed);
+void stop(void);
+void gotoeoln(void);
+void prteoln(void);
+void printtable(void);
+char getendif(void);
+void gettable(void);
+void parse(void);
+void usage(void);
#ifdef __STDC__
char fgetarg ( FILE *stream , char *cbuf )
#define IS_DIR(PTR) (PTR->flags[-High_Sierra] & 2 ? 1 : 0)
-_PROTOTYPE (int main, (int argc, char **argv));
-_PROTOTYPE (int iso_cmp, (char *name, struct dir_entry *dir_ptr, int dir_flag));
-_PROTOTYPE (void list_dir, (struct dir_entry *dir_ptr));
-_PROTOTYPE (void list_file, (struct dir_entry *dir_ptr));
-_PROTOTYPE (struct dir_entry *look_up, (char *name));
-_PROTOTYPE (void recurse_dir, (char *path, struct dir_entry *dir_ptr));
-_PROTOTYPE (void read_device, (long offset, int nr_of_bytes, char *buffer));
-_PROTOTYPE (int valid_fs, (void) );
-_PROTOTYPE (void usage, (void) );
-_PROTOTYPE (void print_date, (char *date));
-_PROTOTYPE (void print_dir_date, (char *date));
-_PROTOTYPE (void iso_info, (struct iso9660_descriptor *vol_desc));
-_PROTOTYPE (void hs_info, (struct high_sierra_descriptor *vol_desc));
-_PROTOTYPE (int iso_711, (char *c));
-_PROTOTYPE (int iso_712, (char *c));
-_PROTOTYPE (int iso_721, (char *c));
-_PROTOTYPE (int iso_722, (char *c));
-_PROTOTYPE (int iso_723, (char *c));
-_PROTOTYPE (long iso_731, (char *c));
-_PROTOTYPE (long iso_732, (char *c));
-_PROTOTYPE (long iso_733, (char *c));
+int main(int argc, char **argv);
+int iso_cmp(char *name, struct dir_entry *dir_ptr, int dir_flag);
+void list_dir(struct dir_entry *dir_ptr);
+void list_file(struct dir_entry *dir_ptr);
+struct dir_entry *look_up(char *name);
+void recurse_dir(char *path, struct dir_entry *dir_ptr);
+void read_device(long offset, int nr_of_bytes, char *buffer);
+int valid_fs(void);
+void usage(void);
+void print_date(char *date);
+void print_dir_date(char *date);
+void iso_info(struct iso9660_descriptor *vol_desc);
+void hs_info(struct high_sierra_descriptor *vol_desc);
+int iso_711(char *c);
+int iso_712(char *c);
+int iso_721(char *c);
+int iso_722(char *c);
+int iso_723(char *c);
+long iso_731(char *c);
+long iso_732(char *c);
+long iso_733(char *c);
char Buffer[BLOCK_SIZE]; /* buffer to hold read data */
#define MAXFLD 200 /* maximum # of fields to accept */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void error, (char *s, char *t));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void match, (void));
-_PROTOTYPE(void f1_only, (void));
-_PROTOTYPE(void f2_only, (void));
-_PROTOTYPE(void output, (int flag));
-_PROTOTYPE(void outfld, (int file));
-_PROTOTYPE(void outputf, (int flag));
-_PROTOTYPE(int compare, (void));
-_PROTOTYPE(int get1, (void));
-_PROTOTYPE(int get2, (int back));
-_PROTOTYPE(int getrec, (int file));
-_PROTOTYPE(int split, (int file));
-_PROTOTYPE(int atoi, (char *str));
-_PROTOTYPE(int exit, (int val));
-_PROTOTYPE(FILE * efopen, (char *file, char *mode));
-_PROTOTYPE(void (*outfun), (int file)); /* output func: output() or outputf()*/
+int main(int argc, char **argv);
+void error(char *s, char *t);
+void usage(void);
+void match(void);
+void f1_only(void);
+void f2_only(void);
+void output(int flag);
+void outfld(int file);
+void outputf(int flag);
+int compare(void);
+int get1(void);
+int get2(int back);
+int getrec(int file);
+int split(int file);
+int atoi(char *str);
+int exit(int val);
+FILE * efopen(char *file, char *mode);
+void(*outfun) (int file);
#define F1 1
#define F2 2
#include <string.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void usage(void);
/* Table of signal names. */
struct signames {
logout *first_link = NULL; /* List of logout times */
int interrupt = FALSE; /* If sigint or sigquit occurs */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Sigint, (int sig));
-_PROTOTYPE(void Sigquit, (int sig));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void Process, (struct utmp *wtmp));
-_PROTOTYPE(int Print_Record, (struct utmp *wtmp));
-_PROTOTYPE(void Print_Duration, (long from, long to));
-_PROTOTYPE(void Print_Uptime, (void));
-_PROTOTYPE(void Record_Logout_Time, (struct utmp *wtmp));
+int main(int argc, char **argv);
+void Sigint(int sig);
+void Sigquit(int sig);
+void usage(void);
+void Process(struct utmp *wtmp);
+int Print_Record(struct utmp *wtmp);
+void Print_Duration(long from, long to);
+void Print_Uptime(void);
+void Record_Logout_Time(struct utmp *wtmp);
/* Sigint() and Sigquit() Flag occurrence of an interrupt. */
void Sigint(sig)
char **env;
extern char **environ;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void wtmp, (char *user, int uid));
-_PROTOTYPE(void show_file, (char *nam));
-_PROTOTYPE(void Time_out, (int dummy));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void add2env, (char **env, char *entry, int replace));
+int main(int argc, char **argv);
+void wtmp(char *user, int uid);
+void show_file(char *nam);
+void Time_out(int dummy);
+void usage(void);
+void add2env(char **env, char *entry, int replace);
void wtmp(user, uid)
char *user; /* user name */
extern int optind;
extern char *optarg;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(int deliver, (int count, char *vec []));
-_PROTOTYPE(FILE *makerewindable, (void));
-_PROTOTYPE(int copy, (FILE *fromfp, FILE *tofp));
-_PROTOTYPE(void readbox, (void));
-_PROTOTYPE(void printall, (void));
-_PROTOTYPE(void interact, (void));
-_PROTOTYPE(void onint, (int dummy));
-_PROTOTYPE(void savelet, (struct letter *let, char *savefile));
-_PROTOTYPE(void updatebox, (void));
-_PROTOTYPE(void printlet, (struct letter *let, FILE *tofp));
-_PROTOTYPE(void doshell, (char *command));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(char *basename, (char *name));
-_PROTOTYPE(char *whoami, (void));
-_PROTOTYPE(void dohelp, (void));
-_PROTOTYPE(int filesize, (char *name));
+int main(int argc, char **argv);
+int deliver(int count, char *vec []);
+FILE *makerewindable(void);
+int copy(FILE *fromfp, FILE *tofp);
+void readbox(void);
+void printall(void);
+void interact(void);
+void onint(int dummy);
+void savelet(struct letter *let, char *savefile);
+void updatebox(void);
+void printlet(struct letter *let, FILE *tofp);
+void doshell(char *command);
+void usage(void);
+char *basename(char *name);
+char *whoami(void);
+void dohelp(void);
+int filesize(char *name);
int main(argc, argv)
int argc;
#define SIZE_KINFO sizeof(struct proc)
#define SIZE_HEADER SIZE_MP_SEG
-FORWARD _PROTOTYPE( int kernel_info , (int fd ));
-FORWARD _PROTOTYPE( void setmap , (struct file *fp ));
-FORWARD _PROTOTYPE( void read_info , (struct file *fp ));
-FORWARD _PROTOTYPE( void ill_addr , (long d , int segment ));
-FORWARD _PROTOTYPE( long map_addr , (long d , int segment ));
-FORWARD _PROTOTYPE( unsigned long c_status, (void));
-FORWARD _PROTOTYPE( long getn, (long d, int s) );
+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);
/*
* set and display mapping for core file
#include <minix/callnr.h>
#include "proto.h"
-FORWARD _PROTOTYPE( void get_message, (message *m, unsigned bx) );
-FORWARD _PROTOTYPE( void get_data, (char *s, unsigned bx, int cnt) );
+FORWARD void get_message(message *m, unsigned bx);
+FORWARD void get_data(char *s, unsigned bx, int cnt);
PRIVATE message sent;
PRIVATE message recv;
PRIVATE struct symtab_s symtab;
-FORWARD _PROTOTYPE( void gnu_sort , (struct newnlist *array ,
- struct newnlist *top ));
-FORWARD _PROTOTYPE( int gnu_symeq , (char *t , struct newnlist *sp ));
-FORWARD _PROTOTYPE( int gnu_symprefix , (char *t , struct newnlist *sp ));
-FORWARD _PROTOTYPE( struct newnlist *gnu_sname, (char *name, int is_text,
- int allflag) );
-FORWARD _PROTOTYPE( struct newnlist *gnu_sval, (off_t value, int where) );
-FORWARD _PROTOTYPE( void gnu_sym, (struct newnlist *sp, off_t off) );
+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
+ allflag);
+FORWARD struct newnlist *gnu_sval(off_t value, int where);
+FORWARD void gnu_sym(struct newnlist *sp, off_t off);
PUBLIC void gnu_init( filename )
PRIVATE FILE *logfile;
PRIVATE int lineno;
-_PROTOTYPE( int _doprnt, (const char *format, va_list ap, FILE *stream ));
+int _doprnt(const char *format, va_list ap, FILE *stream );
PUBLIC char *get_cmd(cbuf, csize)
char *cbuf;
char cmd[1];
} *b_head, *curpnt;
-_PROTOTYPE( int main , (int argc, char *argv[]));
-
-FORWARD _PROTOTYPE( void cleanup , (void));
-FORWARD _PROTOTYPE( void freepnt , (struct b_pnt *pnt ));
-FORWARD _PROTOTYPE( void findbpnt , (int verbose ));
-FORWARD _PROTOTYPE( int exebpnt , (int restart ));
-FORWARD _PROTOTYPE( void catch , (int sig ));
-FORWARD _PROTOTYPE( int run , (char *name , char *argstr , int tflg ));
-FORWARD _PROTOTYPE( int dowait , (void));
-FORWARD _PROTOTYPE( void backtrace , (int all ));
-FORWARD _PROTOTYPE( void modify , (long addr , int cnt , int verbose , int size ));
-FORWARD _PROTOTYPE( void display , (long addr , int req ));
-FORWARD _PROTOTYPE( void fill , (long addr , int req ));
-FORWARD _PROTOTYPE( void dorun , (char *cmd ));
-FORWARD _PROTOTYPE( void not_for_core , (void));
-FORWARD _PROTOTYPE( void command , (void));
+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()
PRIVATE int bits32;
PRIVATE struct address_s uptr;
-FORWARD _PROTOTYPE( u8_t get8, (void) );
-FORWARD _PROTOTYPE( u16_t get16, (void) );
-FORWARD _PROTOTYPE( u32_t get32, (void) );
-FORWARD _PROTOTYPE( u8_t peek_byte, (off_t addr) );
-FORWARD _PROTOTYPE( u16_t peek_word, (off_t addr) );
-FORWARD _PROTOTYPE( int puti, (void) );
-FORWARD _PROTOTYPE( int outsegaddr, (struct address_s *addr) );
-FORWARD _PROTOTYPE( int outssegaddr, (struct address_s *addr) );
-FORWARD _PROTOTYPE( int show1instruction , (void));
+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);
/************************* UNASM ******************************/
typedef int su16_t;
typedef int su8_pt;
-FORWARD _PROTOTYPE( su8_pt get8s , (void));
-FORWARD _PROTOTYPE( void getmodregrm , (void));
-FORWARD _PROTOTYPE( void i_00_to_3f , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_40_to_5f , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_60_to_6f , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_70_to_7f , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_80 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_88 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_90 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_98 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_a0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_a8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_b0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_b8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_c0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_c8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_d0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_d8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_e0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_e8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_f0 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void i_f8 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void outad , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void outad1 , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void outalorx , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void outax , (void));
-FORWARD _PROTOTYPE( void outbptr , (void));
-FORWARD _PROTOTYPE( void outbwptr , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void outea , (opcode_pt wordflags ));
-FORWARD _PROTOTYPE( void outf1 , (void));
-FORWARD _PROTOTYPE( void out32offset , (void));
-FORWARD _PROTOTYPE( void outfishy , (void));
-FORWARD _PROTOTYPE( void outgetaddr , (void));
-FORWARD _PROTOTYPE( void outimmed , (opcode_pt signwordflag ));
-FORWARD _PROTOTYPE( void outpc , (off_t pc ));
-FORWARD _PROTOTYPE( void outsegpc , (void));
-FORWARD _PROTOTYPE( void oututstr , (char *s ));
-FORWARD _PROTOTYPE( void outword , (void));
-FORWARD _PROTOTYPE( void outwptr , (void));
-FORWARD _PROTOTYPE( void outwsize , (void));
-FORWARD _PROTOTYPE( void pagef , (void));
-FORWARD _PROTOTYPE( void shift , (opcode_pt opc ));
-FORWARD _PROTOTYPE( void checkmemory , (void));
-FORWARD _PROTOTYPE( void CL , (void));
-FORWARD _PROTOTYPE( void Eb , (void));
-FORWARD _PROTOTYPE( void Ev , (void));
-FORWARD _PROTOTYPE( void EvGv , (void));
-FORWARD _PROTOTYPE( void EvIb , (void));
-FORWARD _PROTOTYPE( void Ew , (void));
-FORWARD _PROTOTYPE( void EwRw , (void));
-FORWARD _PROTOTYPE( void Gv , (void));
-FORWARD _PROTOTYPE( void Gv1 , (void));
-FORWARD _PROTOTYPE( void GvEv , (void));
-FORWARD _PROTOTYPE( void GvEw , (void));
-FORWARD _PROTOTYPE( void GvM , (void));
-FORWARD _PROTOTYPE( void GvMa , (void));
-FORWARD _PROTOTYPE( void GvMp , (void));
-FORWARD _PROTOTYPE( void Ib , (void));
-FORWARD _PROTOTYPE( void Iw , (void));
-FORWARD _PROTOTYPE( void Iv , (void));
-FORWARD _PROTOTYPE( void Jb , (void));
-FORWARD _PROTOTYPE( void Jv , (void));
-FORWARD _PROTOTYPE( void Ms , (void));
-
-_PROTOTYPE( typedef void (*pfv_t),(opcode_pt opc ));
+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);
+
+typedef void(*pfv_t) (opcode_pt opc );
PRIVATE pfv_t optable[] =
{
#include <string.h>
#include "proto.h"
-FORWARD _PROTOTYPE(long value , (char *s , char **s_p , int *seg_p ));
-FORWARD _PROTOTYPE(long lookup , (char *s , char **s_p , int *seg_p ));
+FORWARD long value(char *s , char **s_p , int *seg_p );
+FORWARD long lookup(char *s , char **s_p , int *seg_p );
#define idchar(c) (isalpha(c) || isdigit(c) || (c) == '_')
#include <sys/ptrace.h>
#include "proto.h"
-FORWARD _PROTOTYPE( void pr_ascii , (long val , int size ));
+FORWARD void pr_ascii(long val , int size );
/* Print ascii */
PRIVATE void pr_ascii(val, size)
/* core.c */
-_PROTOTYPE( void prtmap, (void) );
-_PROTOTYPE( unsigned long core_init, (char *filename) );
-_PROTOTYPE( unsigned long file_init, (char *filename) );
-_PROTOTYPE( long read_core, (int req, long addr, long data) );
+void prtmap(void);
+unsigned long core_init(char *filename);
+unsigned long file_init(char *filename);
+long read_core(int req, long addr, long data);
/* mdb.c */
-_PROTOTYPE( void mdb_error, (char *s) );
-_PROTOTYPE( long breakpt , (long addr , char *cmd ));
-_PROTOTYPE( void tstart , (int req , int verbose , int val , int cnt ));
+void mdb_error(char *s);
+long breakpt(long addr , char *cmd );
+void tstart(int req , int verbose , int val , int cnt );
/* io.c */
-_PROTOTYPE( char *get_cmd , (char *cbuf, int csize) );
-_PROTOTYPE( void openin , (char *s ));
-_PROTOTYPE( void logging, (int c, char *name) );
-_PROTOTYPE( void do_error, (char *message) );
-_PROTOTYPE( int Printf, (const char *format, ...));
-_PROTOTYPE( void outbyte, (int byte) );
-_PROTOTYPE( void outcomma, (void) );
-_PROTOTYPE( void outh8, (unsigned num) );
-_PROTOTYPE( void outh16, (unsigned num) );
-_PROTOTYPE( void outh32, (unsigned num) );
-_PROTOTYPE( void outh4, (unsigned num) );
-_PROTOTYPE( void outspace, (void) );
-_PROTOTYPE( void outstr, (char *s) );
-_PROTOTYPE( void outtab, (void) );
-_PROTOTYPE( void outustr, (char *s) );
-_PROTOTYPE( void closestring, (void) );
-_PROTOTYPE( int mytolower, (int ch) );
-_PROTOTYPE( void openstring, (char *string) );
-_PROTOTYPE( int stringpos, (void) );
-_PROTOTYPE( int stringtab, (void) );
+char *get_cmd(char *cbuf, int csize);
+void openin(char *s );
+void logging(int c, char *name);
+void do_error(char *message);
+int Printf(const char *format, ...);
+void outbyte(int byte);
+void outcomma(void);
+void outh8(unsigned num);
+void outh16(unsigned num);
+void outh32(unsigned num);
+void outh4(unsigned num);
+void outspace(void);
+void outstr(char *s);
+void outtab(void);
+void outustr(char *s);
+void closestring(void);
+int mytolower(int ch);
+void openstring(char *string);
+int stringpos(void);
+int stringtab(void);
/* mdbdis86.c */
-_PROTOTYPE( long dasm, (long addr, int count, int symflg) );
+long dasm(long addr, int count, int symflg);
/* mdbexp.c */
-_PROTOTYPE( char *getexp, (char *buf, long *exp_p, int *seg_p) );
-_PROTOTYPE( char *skip, (char *s) );
+char *getexp(char *buf, long *exp_p, int *seg_p);
+char *skip(char *s);
/* kernel.c */
-_PROTOTYPE( long get_reg, (int pid, long k) );
-_PROTOTYPE( void set_reg, (int pid, long k, long value) );
-_PROTOTYPE( long reg_addr, (char *s) );
-_PROTOTYPE( int disp_regs, (void) );
-_PROTOTYPE( int outsegreg, (off_t num) );
-_PROTOTYPE( void update , (void));
-_PROTOTYPE( void disp_maps , (void));
+long get_reg(int pid, long k);
+void set_reg(int pid, long k, long value);
+long reg_addr(char *s);
+int disp_regs(void);
+int outsegreg(off_t num);
+void update(void);
+void disp_maps(void);
/* misc.c */
-_PROTOTYPE( void dump_stack, (long count) );
-_PROTOTYPE( off_t file_size, (int fd) );
-_PROTOTYPE( void help_on, (int h) );
-_PROTOTYPE( void version_info, (void) );
-_PROTOTYPE( void help_page, (void) );
+void dump_stack(long count);
+off_t file_size(int fd);
+void help_on(int h);
+void version_info(void);
+void help_page(void);
#if EXTRA_SYMBOLS
/* gnu_sym.c */
-_PROTOTYPE( void gnu_init, (char *filename) );
-_PROTOTYPE( long gnu_symbolvalue, (char *name, int is_text ) );
-_PROTOTYPE( void gnu_symbolic, (off_t value, int separator) );
-_PROTOTYPE( void gnu_listsym, (int tchar) );
-_PROTOTYPE( int gnu_text_symbol, (off_t value) );
-_PROTOTYPE( int gnu_finds_pc, (off_t pc) );
-_PROTOTYPE( int gnu_finds_data, (off_t off, int data_seg) );
+void gnu_init(char *filename);
+long gnu_symbolvalue(char *name, int is_text );
+void gnu_symbolic(off_t value, int separator);
+void gnu_listsym(int tchar);
+int gnu_text_symbol(off_t value);
+int gnu_finds_pc(off_t pc);
+int gnu_finds_data(off_t off, int data_seg);
#endif /* EXTRA_SYMBOLS */
/* sym.c */
-_PROTOTYPE( void syminit, (char *filename) );
-_PROTOTYPE( long symbolvalue, (char *name, int is_text ) );
-_PROTOTYPE( void printhex, (off_t v) );
-_PROTOTYPE( void symbolic, (off_t value, int separator) );
-_PROTOTYPE( void listsym, (char *cmd) );
-_PROTOTYPE( int text_symbol, (off_t value) );
-_PROTOTYPE( int finds_pc, (off_t pc) );
-_PROTOTYPE( int finds_data, (off_t off, int data_seg) );
+void syminit(char *filename);
+long symbolvalue(char *name, int is_text );
+void printhex(off_t v);
+void symbolic(off_t value, int separator);
+void listsym(char *cmd);
+int text_symbol(off_t value);
+int finds_pc(off_t pc);
+int finds_data(off_t off, int data_seg);
/* trace.c */
-_PROTOTYPE( long mdbtrace, (int req, int pid, long addr, long data) );
-_PROTOTYPE( u32_t peek_dword, (off_t addr));
+long mdbtrace(int req, int pid, long addr, long data);
+u32_t peek_dword(off_t addr);
#if SYSCALLS_SUPPORT
/* syscalls.c */
-_PROTOTYPE( void start_syscall, (long addr) );
-_PROTOTYPE( void do_syscall, (long addr) );
+void start_syscall(long addr);
+void do_syscall(long addr);
/* decode.c */
-_PROTOTYPE( void decode_message, (unsigned addr) );
-_PROTOTYPE( void decode_result, (void) );
+void decode_message(unsigned addr);
+void decode_result(void);
/* ioctl.c */
-_PROTOTYPE( void decode_ioctl, (int sr, message *m) );
+void decode_ioctl(int sr, message *m);
#endif /* SYSCALLS_SUPPORT */
PRIVATE struct symtab_s symtab;
PRIVATE int type_of_exec;
-FORWARD _PROTOTYPE( int check_exec, (struct exec *hdr) );
-FORWARD _PROTOTYPE( void sortsyms , (struct nlist *array , struct nlist *top ));
-FORWARD _PROTOTYPE( int symeq , (char *t , struct nlist *sp ));
-FORWARD _PROTOTYPE( int symprefix , (char *t , struct nlist *sp ));
-FORWARD _PROTOTYPE( struct nlist *findsname, (char *name, int is_text, int allflag) );
-FORWARD _PROTOTYPE( void outsym, (struct nlist *sp, off_t off) );
-FORWARD _PROTOTYPE( struct nlist *findsval, (off_t value, int where) );
+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 )
char *filename;
#include <stdlib.h>
#include <unistd.h>
-_PROTOTYPE( int main, (int argc, char *argv []) );
+int main(int argc, char *argv []);
int main(argc, argv)
int argc;
/* mined1.c */
-_PROTOTYPE(void FS, (void));
-_PROTOTYPE(void VI, (void));
-_PROTOTYPE(int WT, (void));
-_PROTOTYPE(void XWT, (void));
-_PROTOTYPE(void SH, (void));
-_PROTOTYPE(LINE *proceed, (LINE *line, int count ));
-_PROTOTYPE(int bottom_line, (FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl ));
-_PROTOTYPE(int count_chars, (LINE *line ));
-_PROTOTYPE(void move, (int new_x, char *new_address, int new_y ));
-_PROTOTYPE(int find_x, (LINE *line, char *address ));
-_PROTOTYPE(char *find_address, (LINE *line, int x_coord, int *old_x ));
-_PROTOTYPE(int length_of, (char *string ));
-_PROTOTYPE(void copy_string, (char *to, char *from ));
-_PROTOTYPE(void reset, (LINE *head_line, int screen_y ));
-_PROTOTYPE(void set_cursor, (int nx, int ny ));
-_PROTOTYPE(void open_device, (void));
-_PROTOTYPE(int getchar, (void));
-_PROTOTYPE(void display, (int x_coord, int y_coord, LINE *line, int count ));
-_PROTOTYPE(int write_char, (int fd, int c ));
-_PROTOTYPE(int writeline, (int fd, char *text ));
-_PROTOTYPE(void put_line, (LINE *line, int offset, FLAG clear_line ));
-_PROTOTYPE(int flush_buffer, (int fd ));
-_PROTOTYPE(void bad_write, (int fd ));
-_PROTOTYPE(void catch, (int sig ));
-_PROTOTYPE(void abort_mined, (void));
-_PROTOTYPE(void raw_mode, (FLAG state ));
-_PROTOTYPE(void panic, (char *message ));
-_PROTOTYPE(char *alloc, (int bytes ));
-_PROTOTYPE(void free_space, (char *p ));
+void FS(void);
+void VI(void);
+int WT(void);
+void XWT(void);
+void SH(void);
+LINE *proceed(LINE *line, int count );
+int bottom_line(FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl
+ );
+int count_chars(LINE *line );
+void move(int new_x, char *new_address, int new_y );
+int find_x(LINE *line, char *address );
+char *find_address(LINE *line, int x_coord, int *old_x );
+int length_of(char *string );
+void copy_string(char *to, char *from );
+void reset(LINE *head_line, int screen_y );
+void set_cursor(int nx, int ny );
+void open_device(void);
+int getchar(void);
+void display(int x_coord, int y_coord, LINE *line, int count );
+int write_char(int fd, int c );
+int writeline(int fd, char *text );
+void put_line(LINE *line, int offset, FLAG clear_line );
+int flush_buffer(int fd );
+void bad_write(int fd );
+void catch(int sig );
+void abort_mined(void);
+void raw_mode(FLAG state );
+void panic(char *message );
+char *alloc(int bytes );
+void free_space(char *p );
/*
#ifdef UNIX
-_PROTOTYPE(void (*key_map [128]), (void));
+void(*key_map [128]) (void);
#else
-_PROTOTYPE(void (*key_map [256]), (void));
+void(*key_map [256]) (void);
#endif
*/
-_PROTOTYPE(void initialize, (void));
-_PROTOTYPE(char *basename, (char *path ));
-_PROTOTYPE(void load_file, (char *file ));
-_PROTOTYPE(int get_line, (int fd, char *buffer ));
-_PROTOTYPE(LINE *install_line, (char *buffer, int length ));
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void RD, (void));
-_PROTOTYPE(void I, (void));
-_PROTOTYPE(void XT, (void));
-_PROTOTYPE(void ESC, (void));
-_PROTOTYPE(int ask_save, (void));
-_PROTOTYPE(int line_number, (void));
-_PROTOTYPE(void file_status, (char *message, long count, char *file, int lines,
- FLAG writefl, FLAG changed ));
+void initialize(void);
+char *basename(char *path );
+void load_file(char *file );
+int get_line(int fd, char *buffer );
+LINE *install_line(char *buffer, int length );
+int main(int argc, char *argv []);
+void RD(void);
+void I(void);
+void XT(void);
+void ESC(void);
+int ask_save(void);
+int line_number(void);
+void file_status(char *message, long count, char *file, int lines, FLAG
+ writefl, FLAG changed );
#if __STDC__
void build_string(char *buf, char *fmt, ...);
#else
void build_string();
#endif
-_PROTOTYPE(char *num_out, (long number ));
-_PROTOTYPE(int get_number, (char *message, int *result ));
-_PROTOTYPE(int input, (char *inbuf, FLAG clearfl ));
-_PROTOTYPE(int get_file, (char *message, char *file ));
-_PROTOTYPE(int _getchar, (void));
-_PROTOTYPE(void _flush, (void));
-_PROTOTYPE(void _putchar, (int c ));
-_PROTOTYPE(void get_term, (void));
+char *num_out(long number );
+int get_number(char *message, int *result );
+int input(char *inbuf, FLAG clearfl );
+int get_file(char *message, char *file );
+int _getchar(void);
+void _flush(void);
+void _putchar(int c );
+void get_term(void);
/* mined2.c */
-_PROTOTYPE(void UP, (void));
-_PROTOTYPE(void DN, (void));
-_PROTOTYPE(void LF, (void));
-_PROTOTYPE(void RT, (void));
-_PROTOTYPE(void HIGH, (void));
-_PROTOTYPE(void LOW, (void));
-_PROTOTYPE(void BL, (void));
-_PROTOTYPE(void EL, (void));
-_PROTOTYPE(void GOTO, (void));
-_PROTOTYPE(void PD, (void));
-_PROTOTYPE(void PU, (void));
-_PROTOTYPE(void HO, (void));
-_PROTOTYPE(void EF, (void));
-_PROTOTYPE(void SU, (void));
-_PROTOTYPE(void SD, (void));
-_PROTOTYPE(int forward_scroll, (void));
-_PROTOTYPE(int reverse_scroll, (void));
-_PROTOTYPE(void MP, (void));
-_PROTOTYPE(void move_previous_word, (FLAG remove ));
-_PROTOTYPE(void MN, (void));
-_PROTOTYPE(void move_next_word, (FLAG remove ));
-_PROTOTYPE(void DCC, (void));
-_PROTOTYPE(void DPC, (void));
-_PROTOTYPE(void DLN, (void));
-_PROTOTYPE(void DNW, (void));
-_PROTOTYPE(void DPW, (void));
-_PROTOTYPE(void S, (int character ));
-_PROTOTYPE(void CTL, (void));
-_PROTOTYPE(void LIB, (void));
-_PROTOTYPE(LINE *line_insert, (LINE *line, char *string, int len ));
-_PROTOTYPE(int insert, (LINE *line, char *location, char *string ));
-_PROTOTYPE(LINE *line_delete, (LINE *line ));
-_PROTOTYPE(void delete, (LINE *start_line, char *start_textp, LINE *end_line, char *end_textp ));
-_PROTOTYPE(void PT, (void));
-_PROTOTYPE(void IF, (void));
-_PROTOTYPE(void file_insert, (int fd, FLAG old_pos ));
-_PROTOTYPE(void WB, (void));
-_PROTOTYPE(void MA, (void));
-_PROTOTYPE(void YA, (void));
-_PROTOTYPE(void DT, (void));
-_PROTOTYPE(void set_up, (FLAG remove ));
-_PROTOTYPE(FLAG checkmark, (void));
-_PROTOTYPE(int legal, (void));
-_PROTOTYPE(void yank, (LINE *start_line, char *start_textp, LINE *end_line, char *end_textp, FLAG remove ));
-_PROTOTYPE(int scratch_file, (FLAG mode ));
-_PROTOTYPE(void SF, (void));
-_PROTOTYPE(void SR, (void));
-_PROTOTYPE(REGEX *get_expression, (char *message ));
-_PROTOTYPE(void GR, (void));
-_PROTOTYPE(void LR, (void));
-_PROTOTYPE(void change, (char *message, FLAG file ));
-_PROTOTYPE(char *substitute, (LINE *line, REGEX *program, char *replacement ));
-_PROTOTYPE(void search, (char *message, FLAG method ));
-_PROTOTYPE(int find_y, (LINE *match_line ));
-_PROTOTYPE(void finished, (REGEX *program, int *last_exp ));
-_PROTOTYPE(void compile, (char *pattern, REGEX *program ));
-_PROTOTYPE(LINE *match, (REGEX *program, char *string, FLAG method ));
-_PROTOTYPE(int line_check, (REGEX *program, char *string, FLAG method ));
-_PROTOTYPE(int check_string, (REGEX *program, char *string, int *expression ));
-_PROTOTYPE(int star, (REGEX *program, char *end_position, char *string, int *expression ));
-_PROTOTYPE(int in_list, (int *list, int c, int list_length, int opcode ));
-_PROTOTYPE(void dummy_line, (void));
+void UP(void);
+void DN(void);
+void LF(void);
+void RT(void);
+void HIGH(void);
+void LOW(void);
+void BL(void);
+void EL(void);
+void GOTO(void);
+void PD(void);
+void PU(void);
+void HO(void);
+void EF(void);
+void SU(void);
+void SD(void);
+int forward_scroll(void);
+int reverse_scroll(void);
+void MP(void);
+void move_previous_word(FLAG remove );
+void MN(void);
+void move_next_word(FLAG remove );
+void DCC(void);
+void DPC(void);
+void DLN(void);
+void DNW(void);
+void DPW(void);
+void S(int character );
+void CTL(void);
+void LIB(void);
+LINE *line_insert(LINE *line, char *string, int len );
+int insert(LINE *line, char *location, char *string );
+LINE *line_delete(LINE *line );
+void delete(LINE *start_line, char *start_textp, LINE *end_line, char
+ *end_textp );
+void PT(void);
+void IF(void);
+void file_insert(int fd, FLAG old_pos );
+void WB(void);
+void MA(void);
+void YA(void);
+void DT(void);
+void set_up(FLAG remove );
+FLAG checkmark(void);
+int legal(void);
+void yank(LINE *start_line, char *start_textp, LINE *end_line, char
+ *end_textp, FLAG remove );
+int scratch_file(FLAG mode );
+void SF(void);
+void SR(void);
+REGEX *get_expression(char *message );
+void GR(void);
+void LR(void);
+void change(char *message, FLAG file );
+char *substitute(LINE *line, REGEX *program, char *replacement );
+void search(char *message, FLAG method );
+int find_y(LINE *match_line );
+void finished(REGEX *program, int *last_exp );
+void compile(char *pattern, REGEX *program );
+LINE *match(REGEX *program, char *string, FLAG method );
+int line_check(REGEX *program, char *string, FLAG method );
+int check_string(REGEX *program, char *string, int *expression );
+int star(REGEX *program, char *end_position, char *string, int
+ *expression );
+int in_list(int *list, int c, int list_length, int opcode );
+void dummy_line(void);
#define getline _mkfs_getline
#endif
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(block_t sizeup, (char *device));
-_PROTOTYPE(void super, (zone_t zones, Ino_t inodes));
-_PROTOTYPE(void rootdir, (Ino_t inode));
-_PROTOTYPE(void eat_dir, (Ino_t parent));
-_PROTOTYPE(void eat_file, (Ino_t inode, int f));
-_PROTOTYPE(void enter_dir, (Ino_t parent, char *name, Ino_t child));
-_PROTOTYPE(void incr_size, (Ino_t n, long count));
-_PROTOTYPE(PRIVATE ino_t alloc_inode, (int mode, int usrid, int grpid));
-_PROTOTYPE(PRIVATE zone_t alloc_zone, (void));
-_PROTOTYPE(void add_zone, (Ino_t n, zone_t z, long bytes, long cur_time));
-_PROTOTYPE(void add_z_1, (Ino_t n, zone_t z, long bytes, long cur_time));
-_PROTOTYPE(void add_z_2, (Ino_t n, zone_t z, long bytes, long cur_time));
-_PROTOTYPE(void incr_link, (Ino_t n));
-_PROTOTYPE(void insert_bit, (block_t block, int bit));
-_PROTOTYPE(int mode_con, (char *p));
-_PROTOTYPE(void getline, (char line[LINE_LEN], char *parse[MAX_TOKENS]));
-_PROTOTYPE(void check_mtab, (char *devname));
-_PROTOTYPE(long file_time, (int f));
-_PROTOTYPE(void pexit, (char *s));
-_PROTOTYPE(void copy, (char *from, char *to, int count));
-_PROTOTYPE(void print_fs, (void));
-_PROTOTYPE(int read_and_set, (block_t n));
-_PROTOTYPE(void special, (char *string));
-_PROTOTYPE(void get_block, (block_t n, char *buf));
-_PROTOTYPE(void get_super_block, (char *buf));
-_PROTOTYPE(void put_block, (block_t n, char *buf));
-_PROTOTYPE(void cache_init, (void));
-_PROTOTYPE(void flush, (void));
-_PROTOTYPE(void mx_read, (int blocknr, char *buf));
-_PROTOTYPE(void mx_write, (int blocknr, char *buf));
-_PROTOTYPE(void dexit, (char *s, int sectnum, int err));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(char *alloc_block, (void));
+int main(int argc, char **argv);
+block_t sizeup(char *device);
+void super(zone_t zones, Ino_t inodes);
+void rootdir(Ino_t inode);
+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);
+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);
+void incr_link(Ino_t n);
+void insert_bit(block_t block, int bit);
+int mode_con(char *p);
+void getline(char line[LINE_LEN], char *parse[MAX_TOKENS]);
+void check_mtab(char *devname);
+long file_time(int f);
+void pexit(char *s);
+void copy(char *from, char *to, int count);
+void print_fs(void);
+int read_and_set(block_t n);
+void special(char *string);
+void get_block(block_t n, char *buf);
+void get_super_block(char *buf);
+void put_block(block_t n, char *buf);
+void cache_init(void);
+void flush(void);
+void mx_read(int blocknr, char *buf);
+void mx_write(int blocknr, char *buf);
+void dexit(char *s, int sectnum, int err);
+void usage(void);
+char *alloc_block(void);
/*================================================================
* mkfs - make filesystem
#include <sys/stat.h>
#endif
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void badcomm, (void));
-_PROTOTYPE(void badfifo, (void));
-_PROTOTYPE(void badchar, (void));
-_PROTOTYPE(void badblock, (void));
+int main(int argc, char *argv []);
+void badcomm(void);
+void badfifo(void);
+void badchar(void);
+void badblock(void);
int main(argc, argv)
int argc;
extern int optind;
extern char *optarg;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void descend, (char *dirname));
-_PROTOTYPE(void display_attrib, (char *name, struct stat *st));
-_PROTOTYPE(void usage, (char *binname));
-_PROTOTYPE(void open_outfile, (void));
+int main(int argc, char **argv);
+void descend(char *dirname);
+void display_attrib(char *name, struct stat *st);
+void usage(char *binname);
+void open_outfile(void);
int main(argc, argv)
int argc;
#define MINIX_FS_TYPE "mfs"
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void list, (void));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void list(void);
+void usage(void);
int main(argc, argv)
int argc;
int next;
int bytespresent;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(long offset, (int argc, char *argv [], int k));
-_PROTOTYPE(void dumpfile, (void));
-_PROTOTYPE(void wdump, (short *words, int k, int radix));
-_PROTOTYPE(void bdump, (char bytes [16 ], int k, int c));
-_PROTOTYPE(void byte, (int val, int c));
-_PROTOTYPE(int getwords, (short **words));
-_PROTOTYPE(int same, (short *w1, int *w2));
-_PROTOTYPE(void outword, (int val, int radix));
-_PROTOTYPE(void outnum, (int num, int radix));
-_PROTOTYPE(void addrout, (long l));
-_PROTOTYPE(char hexit, (int k));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+long offset(int argc, char *argv [], int k);
+void dumpfile(void);
+void wdump(short *words, int k, int radix);
+void bdump(char bytes [16 ], int k, int c);
+void byte(int val, int c);
+int getwords(short **words);
+int same(short *w1, int *w2);
+void outword(int val, int radix);
+void outnum(int num, int radix);
+void addrout(long l);
+char hexit(int k);
+void usage(void);
int main(argc, argv)
int argc;
char *delims; /* the pointer to the delimiters */
int number_of_delims = 1; /* number of delimiters to use */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void docol, (int nfiles, char **fnamptr));
-_PROTOTYPE(void doserial, (int nfiles, char **fnamptr));
-_PROTOTYPE(void delimbuild, (char *strptr));
-_PROTOTYPE(void prerr, (int etype, char *estring));
+int main(int argc, char **argv);
+void docol(int nfiles, char **fnamptr);
+void doserial(int nfiles, char **fnamptr);
+void delimbuild(char *strptr);
+void prerr(int etype, char *estring);
int main(argc, argv)
int argc;
#include <sys/ioctl.h>
#include <minix/sound.h>
-_PROTOTYPE( int main, (int argc, char **argv));
-_PROTOTYPE( void usage, (void));
+int main(int argc, char **argv);
+void usage(void);
/******* Wave format definitions *********/
char output[1024];
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(static char *myalloc, (size_t size));
-_PROTOTYPE(char skip_page, (int lines, int width, FILE * filep));
-_PROTOTYPE(void format, (FILE * filep));
-_PROTOTYPE(void print_page, (int pagenr, int maxcol));
-_PROTOTYPE(void print, (FILE * filep));
-_PROTOTYPE(void out_header, (int page));
-_PROTOTYPE(void print_time, (time_t t));
+int main(int argc, char **argv);
+static char *myalloc(size_t size);
+char skip_page(int lines, int width, FILE * filep);
+void format(FILE * filep);
+void print_page(int pagenr, int maxcol);
+void print(FILE * filep);
+void out_header(int page);
+void print_time(time_t t);
int main(argc, argv)
int argc;
int lfread; /* set when last char read was lf */
int lfwritten = 1; /* set when last char written was lf */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void skipline, (void));
-_PROTOTYPE(int backslash, (void));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void skipline(void);
+int backslash(void);
+void usage(void);
int main(argc, argv)
int argc;
#define ROOT "/"
int rflag;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void done, (char *name, int status));
+int main(int argc, char **argv);
+void done(char *name, int status);
int main(argc, argv)
int argc;
static struct sproc * proc_hash[HASH_MOD];
-_PROTOTYPE(int handle_args, (int argc, char *argv[]));
-_PROTOTYPE(int start, (void));
-_PROTOTYPE(int stop, (void));
-_PROTOTYPE(int get, (void));
-_PROTOTYPE(int reset, (void));
-_PROTOTYPE(int create_named_pipe, (void));
-_PROTOTYPE(int alloc_mem, (void));
-_PROTOTYPE(int init_outfile, (void));
-_PROTOTYPE(int write_outfile, (void));
-_PROTOTYPE(int detach, (void));
+int handle_args(int argc, char *argv[]);
+int start(void);
+int stop(void);
+int get(void);
+int reset(void);
+int create_named_pipe(void);
+int alloc_mem(void);
+int init_outfile(void);
+int write_outfile(void);
+int detach(void);
int main(int argc, char *argv[])
{
#include <unistd.h>
#include <string.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
void
prettyprogress(long b, long maxb, time_t starttime)
+++ /dev/null
-PROG= proto
-MAN=
-
-.include <bsd.prog.mk>
+++ /dev/null
-/* proto - Generate ANSI C prototypes. Author: Eric R. Smith */
-
-/* Program to extract function declarations from C source code
- * Written by Eric R. Smith and placed in the public domain
- * Thanks are due to Jwahar R. Bammi for fixing several bugs
- * And providing the Unix makefiles.
- */
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#define ISCSYM(x) ((x) > 0 && (isalnum(x) || (x) == '_' ))
-#define ABORTED ( (Word *) -1 )
-#define MAXPARAM 20 /* max. number of parameters to a function */
-
-typedef struct word {
- struct word *next;
- char string[1];
-} Word;
-
-int inquote = 0; /* in a quote? */
-int newline_seen = 1; /* are we at the start of a line */
-long linenum = 1L; /* line number in current file */
-long endline = 0L; /* the last line before the { of a f'n */
-long symline = 0L; /* Line that symbol was on, set by getsym() */
-int dostatic = 0; /* do static functions? */
-int donum = 0; /* print line numbers? */
-int dohead = 1; /* do file headers? */
-int docond = 1; /* conditionalize for non-ANSI compilers? */
-int dodiff = 0; /* Output a diff file to prototype original */
-int doold = 0; /* do old style: P() */
-int glastc = ' '; /* last char. seen by getsym() */
-Word *endlist; /* Parentheses after the parameters */
-char *progname; /* name of program (for error messages) */
-
-
-_PROTOTYPE(Word * word_alloc, (char *s));
-_PROTOTYPE(void word_free, (Word * w));
-_PROTOTYPE(int List_len, (Word * w));
-_PROTOTYPE(Word * word_append, (Word * w1, Word * w2));
-_PROTOTYPE(int foundin, (Word * w1, Word * w2));
-_PROTOTYPE(void addword, (Word * w, char *s));
-_PROTOTYPE(void printlist, (Word * p));
-_PROTOTYPE(Word * typelist, (Word * p));
-_PROTOTYPE(void typefixhack, (Word * w));
-_PROTOTYPE(int ngetc, (FILE * f));
-_PROTOTYPE(int fnextch, (FILE * f));
-_PROTOTYPE(int nextch, (FILE * f));
-_PROTOTYPE(int getsym, (char *buf, FILE * f));
-_PROTOTYPE(int skipit, (char *buf, FILE * f));
-_PROTOTYPE(Word * getparamlist, (FILE * f));
-_PROTOTYPE(void emit, (Word * wlist, Word * plist, long startline));
-_PROTOTYPE(void getdecl, (FILE * f));
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Usage, (void));
-
-/* Routines for manipulating lists of words. */
-
-Word *word_alloc(s)
-char *s;
-{
- Word *w;
-
- w = (Word *) malloc(sizeof(Word) + strlen(s) + 1);
- if (w == NULL) {
- fprintf(stderr, "%s: out of memory\n", progname);
- exit(1);
- }
- (void) strcpy(w->string, s);
- w->next = NULL;
- return w;
-}
-
-void word_free(w)
-Word *w;
-{
- Word *oldw;
- while (w) {
- oldw = w;
- w = w->next;
- free((char *) oldw);
- }
-}
-
-/* Return the length of a list; empty words are not counted */
-int List_len(w)
-Word *w;
-{
- int count = 0;
-
- while (w) {
- if (*w->string) count++;
- w = w->next;
- }
- return count;
-}
-
-/* Append two lists, and return the result */
-Word *word_append(w1, w2)
-Word *w1, *w2;
-{
- Word *r, *w;
-
- r = w = word_alloc("");
-
- while (w1) {
- w->next = word_alloc(w1->string);
- w = w->next;
- w1 = w1->next;
- }
- while (w2) {
- w->next = word_alloc(w2->string);
- w = w->next;
- w2 = w2->next;
- }
-
- return r;
-}
-
-/* See if the last entry in w2 is in w1 */
-int foundin(w1, w2)
-Word *w1, *w2;
-{
- while (w2->next) w2 = w2->next;
-
- while (w1) {
- if (!strcmp(w1->string, w2->string)) return 1;
- w1 = w1->next;
- }
- return 0;
-}
-
-/* Add the string s to the given list of words */
-void addword(w, s)
-Word *w;
-char *s;
-{
- while (w->next) w = w->next;
- w->next = word_alloc(s);
-}
-
-/* Printlist: print out a list */
-void printlist(p)
-Word *p;
-{
- Word *w;
- int i = 0;
-
- for (w = p; w; w = w->next) {
- printf("%s", w->string);
- if (ISCSYM(w->string[0]) && i > 0
- && w->next && w->next->string[0] != ',') printf(" ");
- i++;
- }
-}
-
-/* Given a list representing a type and a variable name, extract just
- * the base type, e.g. "struct word *x" would yield "struct word".
- * Similarly, "unsigned char x[]" would yield "unsigned char".
- */
-Word *typelist(p)
-Word *p;
-{
- Word *w, *r, *last;
-
- last = r = w = word_alloc("");
- while (p && p->next) {
- if (p->string[0] == '[') {
- word_free(w);
- last->next = NULL;
- break;
- }
- if (p->string[0] && !ISCSYM(p->string[0])) break;
- w->next = word_alloc(p->string);
- last = w;
- w = w->next;
- p = p->next;
- }
- return r;
-}
-
-/* Typefixhack: promote formal parameters of type "char", "unsigned char",
- * "short", or "unsigned short" to "int".
- */
-void typefixhack(w)
-Word *w;
-{
- Word *oldw = 0;
-
- while (w) {
- if (*w->string) {
- if ((!strcmp(w->string, "char") ||
- !strcmp(w->string, "short"))
- && (List_len(w->next) < 2)) {
- if (oldw && !strcmp(oldw->string, "unsigned")) {
- oldw->next = w->next;
- free((char *) w);
- w = oldw;
- }
- (void) strcpy(w->string, "int");
- }
- }
- w = w->next;
- }
-}
-
-/* Read a character: if it's a newline, increment the line count */
-int ngetc(f)
-FILE *f;
-{
- int c;
-
- c = getc(f);
- if (c == '\n') linenum++;
-
- return c;
-}
-
-/* Read the next character from the file. If the character is '\' then
- * read and skip the next character. Any comment sequence is converted
- * to a blank.
- */
-int fnextch(f)
-FILE *f;
-{
- int c, lastc, incomment;
-
- c = ngetc(f);
- while (c == '\\') {
- c = ngetc(f); /* skip a character */
- c = ngetc(f);
- }
- if (c == '/' && !inquote) {
- c = ngetc(f);
- if (c == '*') {
- incomment = 1;
- c = ' ';
- while (incomment) {
- lastc = c;
- c = ngetc(f);
- if (lastc == '*' && c == '/')
- incomment = 0;
- else if (c < 0)
- return c;
- }
- return fnextch(f);
- } else {
- if (c == '\n') linenum--;
- (void) ungetc(c, f);
- return '/';
- }
- }
- return c;
-}
-
-
-/* Get the next "interesting" character. Comments are skipped, and strings
- * are converted to "0". Also, if a line starts with "#" it is skipped.
- */
-int nextch(f)
-FILE *f;
-{
- int c;
-
- c = fnextch(f);
- if (newline_seen && c == '#') {
- do {
- c = fnextch(f);
- } while (c >= 0 && c != '\n');
- if (c < 0) return c;
- }
- newline_seen = (c == '\n');
-
- if (c == '\'' || c == '\"') {
- inquote = c;
- while ((c = fnextch(f)) >= 0) {
- if (c == inquote) {
- inquote = 0;
- return '0';
- }
- }
- }
- return c;
-}
-
-/* Get the next symbol from the file, skipping blanks.
- * Return 0 if OK, -1 for EOF.
- * Also collapses everything between { and }
- */
-int getsym(buf, f)
-char *buf;
-FILE *f;
-{
- register int c;
- int inbrack = 0;
-
- c = glastc;
- while ((c > 0) && isspace(c)) c = nextch(f);
- if (c < 0) return -1;
- if (c == '{') {
- inbrack = 1;
- endline = linenum;
- while (inbrack) {
- c = nextch(f);
- if (c < 0) {
- glastc = c;
- return c;
- }
- if (c == '{')
- inbrack++;
- else if (c == '}')
- inbrack--;
- }
- (void) strcpy(buf, "{}");
- glastc = nextch(f);
- return 0;
- }
- if (!ISCSYM(c)) {
- *buf++ = c;
- glastc = nextch(f);
- if (c == '(' && glastc == '*') { /* Look for a 'f'n pointer */
- *buf++ = glastc;
- glastc = nextch(f);
- }
- *buf = 0;
- return 0;
- }
- symline = linenum;
- while (ISCSYM(c)) {
- *buf++ = c;
- c = nextch(f);
- }
- *buf = 0;
- glastc = c;
- return 0;
-}
-
-
-/* Skipit: skip until a ";" or the end of a function declaration is seen */
-int skipit(buf, f)
-char *buf;
-FILE *f;
-{
- int i;
-
- do {
- i = getsym(buf, f);
- if (i < 0) return i;
- } while (*buf != ';' && *buf != '{');
-
- return 0;
-}
-
-/* Get a parameter list; when this is called the next symbol in line
- * should be the first thing in the list.
- */
-Word *getparamlist(f)
-FILE *f;
-{
- static Word *pname[MAXPARAM]; /* parameter names */
- Word *tlist, /* type name */
- *plist; /* temporary */
- int np = 0; /* number of parameters */
- int typed[MAXPARAM]; /* parameter has been given a type */
- int tlistdone; /* finished finding the type name */
- int sawsomething;
- int i;
- int inparen = 0;
- char buf[80];
-
- for (i = 0; i < MAXPARAM; i++) typed[i] = 0;
-
- plist = word_alloc("");
- endlist = word_alloc("");
-
- /* First, get the stuff inside brackets (if anything) */
-
- sawsomething = 0; /* gets set nonzero when we see an arg */
- for (;;) {
- if (getsym(buf, f) < 0) return(NULL);
- if (*buf == ')' && (--inparen < 0)) {
- if (sawsomething) { /* if we've seen an arg */
- pname[np] = plist;
- plist = word_alloc("");
- np++;
- }
- break;
- }
- if (*buf == ';') { /* something weird */
- return ABORTED;
- }
- sawsomething = 1; /* there's something in the arg. list */
- if (*buf == ',' && inparen == 0) {
- pname[np] = plist;
- plist = word_alloc("");
- np++;
- } else {
- addword(plist, buf);
- if (*buf == '(') inparen++;
- }
- }
-
- /* Next, get the declarations after the function header */
- inparen = 0;
- tlist = word_alloc("");
- plist = word_alloc("");
- tlistdone = 0;
- sawsomething = 0;
- for (;;) {
- if (getsym(buf, f) < 0) return(NULL);
-
- /* Handle parentheses, which should indicate func pointer rtn values */
- if (*buf == '(') {
- addword(endlist, buf);
- addword(endlist, " void ");
- inparen++;
- } else if (*buf == ')') {
- if (symline == linenum) {
- addword(endlist, buf);
- addword(endlist, buf);
- }
- inparen--;
- } else if (*buf == ',' && !inparen) {
- /* Handle a list like "int x,y,z" */
- if (!sawsomething) return(NULL);
- for (i = 0; i < np; i++) {
- if (!typed[i] && foundin(plist, pname[i])) {
- typed[i] = 1;
- word_free(pname[i]);
- pname[i] = word_append(tlist, plist);
- /* Promote types */
- typefixhack(pname[i]);
- break;
- }
- }
- if (!tlistdone) {
- tlist = typelist(plist);
- tlistdone = 1;
- }
- word_free(plist);
- plist = word_alloc("");
- } else if (*buf == ';') {
- /* Handle the end of a list */
- if (!sawsomething) return ABORTED;
- for (i = 0; i < np; i++) {
- if (!typed[i] && foundin(plist, pname[i])) {
- typed[i] = 1;
- word_free(pname[i]);
- pname[i] = word_append(tlist, plist);
- typefixhack(pname[i]);
- break;
- }
- }
- tlistdone = 0;
- word_free(tlist);
- word_free(plist);
- tlist = word_alloc("");
- plist = word_alloc("");
- } else if (!strcmp(buf, "{}"))
- break; /* Handle the beginning of the function */
- /* Otherwise, throw word into list (except for "register") */
- else if (strcmp(buf, "register")) {
- sawsomething = 1;
- addword(plist, buf);
- if (*buf == '(') inparen++;
- if (*buf == ')') inparen--;
- }
- }
-
- /* Now take the info we have and build a prototype list */
-
- /* Empty parameter list means "void" */
- if (np == 0) return word_alloc("void");
-
- plist = tlist = word_alloc("");
- for (i = 0; i < np; i++) {
-
- /* If no type provided, make it an "int" */
- if (!(pname[i]->next) ||
- (!(pname[i]->next->next)&&strcmp(pname[i]->next->string,"void"))) {
- addword(tlist, "int");
- }
- while (tlist->next) tlist = tlist->next;
- tlist->next = pname[i];
- if (i < np - 1) addword(tlist, ", ");
- }
- return plist;
-}
-
-/* Emit a function declaration. The attributes and name of the function
- * are in wlist; the parameters are in plist.
- */
-void emit(wlist, plist, startline)
-Word *wlist, *plist;
-long startline;
-{
- Word *w;
- int count = 0;
-
- if (doold == 0) printf("_PROTOTYPE( ");
- if (dodiff) {
- printf("%lda%ld,%ld\n", startline - 1, startline, startline +2);
- printf("> #ifdef __STDC__\n> ");
- }
- if (donum) printf("/*%8ld */ ", startline);
- for (w = wlist; w; w = w->next) {
- if (w->string[0]) count++;
- }
- if (count < 2) printf("int ");
- printlist(wlist);
- if (docond) {
- if (doold)
- printf(" P((");
- else
- printf(", (");
- } else {
- printf("(");
- }
-
- printlist(plist);
- printlist(endlist);
-
- if (docond) {
- if (doold)
- printf("))");
- else
- printf(") )");
- } else {
- printf(")");
- }
-
- if (!dodiff)
- printf(";\n");
- else
- printf("\n");
-
- if (dodiff) {
- printf("> #else\n");
- printf("%lda%ld\n", endline - 1, endline);
- printf("> #endif\n");
- }
-}
-
-/* Get all the function declarations */
-void getdecl(f)
-FILE *f;
-{
- Word *plist, *wlist = NULL;
- char buf[80];
- int sawsomething;
- long startline = 0L; /* line where declaration started */
- int oktoprint;
-
-again: /* SHAME SHAME */
- word_free(wlist);
- wlist = word_alloc("");
- sawsomething = 0;
- oktoprint = 1;
-
- for (;;) {
- if (getsym(buf, f) < 0) return;
-
- /* Guess when a declaration is not an external function definition */
- if (!strcmp(buf, ",") || !strcmp(buf, "{}") ||
- !strcmp(buf, "=") || !strcmp(buf, "typedef") ||
- !strcmp(buf, "extern")) {
- (void) skipit(buf, f);
- goto again;
- }
- if (!dostatic && !strcmp(buf, "static")) oktoprint = 0;
-
- /* For the benefit of compilers that allow "inline" declarations */
- if (!strcmp(buf, "inline") && !sawsomething) continue;
- if (!strcmp(buf, ";")) goto again;
-
- /* A left parenthesis *might* indicate a function definition */
- if (!strcmp(buf, "(")) {
- if (!sawsomething || !(plist = getparamlist(f))) {
- (void) skipit(buf, f);
- goto again;
- }
- if (plist == ABORTED) goto again;
-
- /* It seems to have been what we wanted */
- if (oktoprint) emit(wlist, plist, startline);
- word_free(plist);
- goto again;
- }
- addword(wlist, buf);
- if (!sawsomething) startline = symline;
- sawsomething = 1;
- }
-}
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- FILE *f, *g;
- char *t;
- char newname[40];
-
- progname = argv[0];
- argv++;
- argc--;
- g = stdout;
-
- while (*argv && **argv == '-') {
- t = *argv++;
- --argc;
- t++;
- while (*t) {
- if (*t == 's')
- dostatic = 1;
- else if (*t == 'n')
- donum = 1;
- else if (*t == 'p')
- docond = 0;
- else if (*t == 'P')
- doold =1;
- else if (*t == 'd') {
- dodiff = 1;
- doold = 1;
- docond = 0;
- donum = 0;
- dostatic = 1;
- } else
- Usage();
- t++;
- }
- }
-
- if (docond && doold) {
- printf("#ifdef __STDC__\n");
- printf("# define P(args)\targs\n");
- printf("#else\n");
- printf("# define P(args)\t()\n");
- printf("#endif\n\n");
- }
- if (argc == 0)
- getdecl(stdin);
- else
- while (argc > 0 && *argv) {
- if (!(f = fopen(*argv, "r"))) {
- perror(*argv);
- exit(EXIT_FAILURE);
- }
-#if 0
- if (dodiff) {
- (void) sprintf(newname, "%sdif", *argv);
- (void) fclose(g);
- if (!(g = fopen(newname, "w"))) {
- perror(newname);
- exit(EXIT_FAILURE);
- }
- }
-#endif
- if (doold && dohead && !dodiff) printf("\n/* %s */\n", *argv);
- linenum = 1;
- newline_seen = 1;
- glastc = ' ';
- getdecl(f);
- argc--;
- argv++;
- (void) fclose(f);
- }
- if (docond && doold) printf("\n#undef P\n"); /* clean up namespace */
- (void) fclose(g);
- return(EXIT_SUCCESS);
-}
-
-
-void Usage()
-{
- fputs("Usage: ", stderr);
- fputs(progname, stderr);
- fputs(" [-d][-n][-p][-s] [files ...]\n", stderr);
- fputs(" -P: use P() style instead of _PROTOTYPE\n", stderr);
- fputs(" -d: produce a diff file to prototype original source\n", stderr);
- fputs(" -n: put line numbers of declarations as comments\n", stderr);
- fputs(" -p: don't make header files readable by K&R compilers\n", stderr);
- fputs(" -s: include declarations for static functions\n", stderr);
- exit(EXIT_FAILURE);
-}
char *ps_args; /* concatenated argument string */
};
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void plist, (void));
-_PROTOTYPE(int addrread, (int fd, phys_clicks base, vir_bytes addr,
- char *buf, int nbytes ));
-_PROTOTYPE(void usage, (const char *pname ));
-_PROTOTYPE(void err, (const char *s ));
-_PROTOTYPE(int gettynames, (void));
+int main(int argc, char *argv []);
+void plist(void);
+int addrread(int fd, phys_clicks base, vir_bytes addr, char *buf, int
+ nbytes );
+void usage(const char *pname );
+void err(const char *s );
+int gettynames(void);
/*
#define SUCCESS 0 /* exit code in case of success */
#define FAILURE 1 /* or failure */
-_PROTOTYPE(int main, (void));
+int main(void);
static char dir[PATH_MAX + 1];
static char *errmsg = "pwd: cannot search some directory on the path\n";
char a[CHUNK * BLOCK_SIZE]; /* read buffer */
long rotten[STORE]; /* list of bad blocks */
-_PROTOTYPE(int main, (int argc, char **argv));
-static _PROTOTYPE(void output, (long blocks_read));
+int main(int argc, char **argv);
+static void output(long blocks_read);
/* print pretty progress meter with remaining no. of blocks and ETA on
* stderr
#include <sys/ioctl.h>
#include <minix/sound.h>
-_PROTOTYPE (int main, (int argc, char **argv));
-_PROTOTYPE (void usage, (void));
-_PROTOTYPE ( void write_wave_header, (void));
-_PROTOTYPE ( void terminate, (int s));
+int main(int argc, char **argv);
+void usage(void);
+void write_wave_header(void);
+void terminate(int s);
/******* Wave format definitions *********/
char *default_core = "core";
int stack[STACK_BYTES / sizeof (int)];
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void read_segmap, (int fd, struct mproc *mp, long *seg_size));
-_PROTOTYPE(void read_registers, (int fd, struct proc *p));
-_PROTOTYPE(void dump_stack, (int fd, struct mproc *mp, long *seg_size));
-_PROTOTYPE(void error, (char *s1, char *s2));
+int main(int argc, char **argv);
+void read_segmap(int fd, struct mproc *mp, long *seg_size);
+void read_registers(int fd, struct proc *p);
+void dump_stack(int fd, struct mproc *mp, long *seg_size);
+void error(char *s1, char *s2);
int main(argc, argv)
int argc;
/* shar - make a shell archive Author: Michiel Husijes */
-#include <stdlib.h> /* for the nonstd :-( _PROTOTYPE */
+#include <stdlib.h>
#include <stdio.h>
-static _PROTOTYPE( void error, (char *progname, char *operation,
- char *filename) );
-_PROTOTYPE( int main, (int argc, char **argv) );
+static void error(char *progname, char *operation, char *filename);
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
#include <unistd.h>
#include <minix/minlib.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
char USAGE[] = "Usage: sort [-funbirdcmt'x'] [+beg_pos [-end_pos]] [-o outfile] [file] ..";
/* Forward declarations */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void get_opts, (char *ptr, FIELD * field));
-_PROTOTYPE(void new_field, (FIELD * field, int *offset, BOOL beg_fl));
-_PROTOTYPE(void adjust_options, (FIELD * field));
-_PROTOTYPE(void error, (BOOL quit, char *message, char *arg));
-_PROTOTYPE(void open_outfile, (void));
-_PROTOTYPE(void get_file, (int fd, off_t size));
-_PROTOTYPE(int last_line, (void));
-_PROTOTYPE(void print_table, (int fd));
-_PROTOTYPE(char *file_name, (int nr));
-_PROTOTYPE(void mread, (int fd, char *address, int bytes));
-_PROTOTYPE(void mwrite, (int fd, char *address, int bytes));
-_PROTOTYPE(void sort, (void));
-_PROTOTYPE(void sort_table, (int nel));
-_PROTOTYPE(void incr, (int si, int ei));
-_PROTOTYPE(int cmp_fields, (char *el1, char *el2));
-_PROTOTYPE(void build_field, (char *dest, FIELD * field, char *src));
-_PROTOTYPE(char *skip_fields, (char *str, int nf));
-_PROTOTYPE(int compare, (char *el1, char *el2));
-_PROTOTYPE(int cmp, (unsigned char *el1, unsigned char *el2, FIELD * field));
-_PROTOTYPE(int digits, (char *str1, char *str2, BOOL check_sign));
-_PROTOTYPE(void files_merge, (int file_cnt));
-_PROTOTYPE(void merge, (int start_file, int limit_file));
-_PROTOTYPE(void put_line, (char *line));
-_PROTOTYPE(MERGE * print, (MERGE * merg, int file_cnt));
-_PROTOTYPE(int read_line, (MERGE * merg));
-_PROTOTYPE(MERGE * skip_lines, (MERGE * smallest, int file_cnt));
-_PROTOTYPE(void uniq_lines, (MERGE * merg));
-_PROTOTYPE(void check_file, (int fd, char *file));
-_PROTOTYPE(int length, (char *line));
-_PROTOTYPE(void copy, (char *dest, char *src));
-_PROTOTYPE(char *msbrk, (int size));
-_PROTOTYPE(void mbrk, (char *address));
-_PROTOTYPE(void catch, (int dummy));
+int main(int argc, char **argv);
+void get_opts(char *ptr, FIELD * field);
+void new_field(FIELD * field, int *offset, BOOL beg_fl);
+void adjust_options(FIELD * field);
+void error(BOOL quit, char *message, char *arg);
+void open_outfile(void);
+void get_file(int fd, off_t size);
+int last_line(void);
+void print_table(int fd);
+char *file_name(int nr);
+void mread(int fd, char *address, int bytes);
+void mwrite(int fd, char *address, int bytes);
+void sort(void);
+void sort_table(int nel);
+void incr(int si, int ei);
+int cmp_fields(char *el1, char *el2);
+void build_field(char *dest, FIELD * field, char *src);
+char *skip_fields(char *str, int nf);
+int compare(char *el1, char *el2);
+int cmp(unsigned char *el1, unsigned char *el2, FIELD * field);
+int digits(char *str1, char *str2, BOOL check_sign);
+void files_merge(int file_cnt);
+void merge(int start_file, int limit_file);
+void put_line(char *line);
+MERGE * print(MERGE * merg, int file_cnt);
+int read_line(MERGE * merg);
+MERGE * skip_lines(MERGE * smallest, int file_cnt);
+void uniq_lines(MERGE * merg);
+void check_file(int fd, char *file);
+int length(char *line);
+void copy(char *dest, char *src);
+char *msbrk(int size);
+void mbrk(char *address);
+void catch(int dummy);
/* Table of all chars. 0 means no special meaning. */
char table[256] = {
char out_file[100];
char *suffix;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void split, (void));
-_PROTOTYPE(int newfile, (void));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void quit, (void));
+int main(int argc, char **argv);
+void split(void);
+int newfile(void);
+void usage(void);
+void quit(void);
int main(argc, argv)
int argc;
#endif
#include <minix/minlib.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
char *defargv[] = {"-", 0};
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void error, (char *s, char *f));
-_PROTOTYPE(void sum, (int fd, char *fname));
-_PROTOTYPE(void putd, (int number, int fw, int zeros));
+int main(int argc, char **argv);
+void error(char *s, char *f);
+void sum(int fd, char *fname);
+void putd(int number, int fw, int zeros);
int main(argc, argv)
int argc;
#include <sys/types.h>
#include <unistd.h>
-_PROTOTYPE(int main, (void));
+int main(void);
int main()
{
#define TRUE 1
/* Internal functions - prototyped under Minix */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(int tail, (int count, int bytes, int read_until_killed));
-_PROTOTYPE(int keep_reading, (void));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+int tail(int count, int bytes, int read_until_killed);
+int keep_reading(void);
+void usage(void);
int main(argc, argv)
int argc;
int fd[MAXFD];
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
int opt_d = 0; /* debugging output flag */
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(void wtmp, (int type, int linenr, char *line, pid_t pid,
- char *host));
+void usage(void);
+int main(int argc, char *argv[]);
+void wtmp(int type, int linenr, char *line, pid_t pid, char *host);
void usage()
{
#define IN_IAC2 3
#define IN_SB 4
-_PROTOTYPE(static void dowill, (int c));
-_PROTOTYPE(static void dowont, (int c));
-_PROTOTYPE(static void dodo, (int c));
-_PROTOTYPE(static void dodont, (int c));
-_PROTOTYPE(static void respond, (int ack, int option));
-_PROTOTYPE(static void respond_really, (int ack, int option));
+static void dowill(int c);
+static void dowont(int c);
+static void dodo(int c);
+static void dodont(int c);
+static void respond(int ack, int option);
+static void respond_really(int ack, int option);
#define LASTTELOPT TELOPT_SGA
extern int opt_d; /* debugging flag */
-_PROTOTYPE(int get_pty, (int *, char **));
-_PROTOTYPE(void term_init, (void));
-_PROTOTYPE(void term_inout, (int pty_fd));
-_PROTOTYPE(void tel_init, (void));
-_PROTOTYPE(void telopt, (int fdout, int what, int option));
-_PROTOTYPE(int tel_in, (int fdout, int telout, char *buffer, int len));
-_PROTOTYPE(int tel_out, (int fdout, char *buf, int size));
+int get_pty(int *, char **);
+void term_init(void);
+void term_inout(int pty_fd);
+void tel_init(void);
+void telopt(int fdout, int what, int option);
+int tel_in(int fdout, int telout, char *buffer, int len);
+int tel_out(int fdout, char *buf, int size);
#include "telnet.h"
#include "telnetd.h"
-_PROTOTYPE(void sig_done, (int sig));
+void sig_done(int sig);
static char buff[4096];
static char PATH_UTMP[] = "/etc/utmp";
static char PATH_WTMP[] = "/usr/adm/wtmp";
-_PROTOTYPE(void wtmp, (int type, int linenr, char *line, pid_t pid,
- char *host));
-_PROTOTYPE(void report, (char *label));
+void wtmp(int type, int linenr, char *line, pid_t pid, char *host);
+void report(char *label);
void wtmp(type, linenr, line, pid, host)
int type; /* type of entry */
#define NIL ((char *) NULL) /* tell(fd, ..., NIL) */
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(int isdialstr, (char *arg));
-_PROTOTYPE(void tell, (int fd, ...));
-_PROTOTYPE(void reader, (int on));
-_PROTOTYPE(void shell, (char *cmd));
-_PROTOTYPE(void lock_device, (char *device));
-_PROTOTYPE(void fatal, (char *label));
-_PROTOTYPE(void setnum, (char *s, int n));
-_PROTOTYPE(void set_uart, (int argc, char *argv[], struct termios *tcp));
-_PROTOTYPE(void set_raw, (struct termios *tcp));
-_PROTOTYPE(void quit, (int code));
+int main(int argc, char *argv[]);
+int isdialstr(char *arg);
+void tell(int fd, ...);
+void reader(int on);
+void shell(char *cmd);
+void lock_device(char *device);
+void fatal(char *label);
+void setnum(char *s, int n);
+void set_uart(int argc, char *argv[], struct termios *tcp);
+void set_raw(struct termios *tcp);
+void quit(int code);
int main(argc, argv)
int argc;
pid_t pid;
char *shell, *sh0;
- _PROTOTYPE(void (*isav), (int));
- _PROTOTYPE(void (*qsav), (int));
- _PROTOTYPE(void (*tsav), (int));
+ void(*isav) (int);
+ void(*qsav) (int);
+ void(*tsav) (int);
if (cmd == NULL) {
tell(1, "\nExit the shell to return to term, ",
/* */
/****************************************************************/
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Print, (char *comment, char *name));
-_PROTOTYPE(void Error, (char *message, char *arg));
+int main(int argc, char **argv);
+void Print(char *comment, char *name);
+void Error(char *message, char *arg);
int main(argc, argv)
int argc;
int digit_seen;
char a[] = " . \0";
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void print_time, (clock_t t));
-_PROTOTYPE(void twin, (int n, char *p));
-_PROTOTYPE(void execute, (void));
+int main(int argc, char **argv);
+void print_time(clock_t t);
+void twin(int n, char *p);
+void execute(void);
int main(argc, argv)
int argc;
vertex *v; /* vertex to which this edge goes */
} edge;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void *xmalloc, (size_t siz));
-_PROTOTYPE(edge *new_edge, (vertex *v));
-_PROTOTYPE(char *copyupto, (char *name, char *buf, int stop));
-_PROTOTYPE(int child_of, (vertex *parent, vertex *child));
-_PROTOTYPE(vertex *add_v, (char *s));
-_PROTOTYPE(void readin, (void));
-_PROTOTYPE(void pushname, (char *s));
-_PROTOTYPE(char *popname, (void));
-_PROTOTYPE(void topo, (void));
-_PROTOTYPE(void print_cycle, (vertex *parent, vertex *child));
-_PROTOTYPE(void dfs, (vertex *v));
-_PROTOTYPE(void check_cycles, (void));
+int main(int argc, char **argv);
+void *xmalloc(size_t siz);
+edge *new_edge(vertex *v);
+char *copyupto(char *name, char *buf, int stop);
+int child_of(vertex *parent, vertex *child);
+vertex *add_v(char *s);
+void readin(void);
+void pushname(char *s);
+char *popname(void);
+void topo(void);
+void print_cycle(vertex *parent, vertex *child);
+void dfs(vertex *v);
+void check_cycles(void);
/*
** xmalloc -- standard do or die malloc front end.
#include <unistd.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(argc, argv)
int argc;
#include <sys/mount.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(int find_mtab_entry, (char *name));
-_PROTOTYPE(void update_mtab, (void));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+int find_mtab_entry(char *name);
+void update_mtab(void);
+void usage(void);
static char device[PATH_MAX+1], mountpoint[PATH_MAX+1], vs[10], rw[10];
#define U_MACHINE ((unsigned) 0x10)
#define ARCH ((unsigned) 0x20)
-_PROTOTYPE(int main, (int argc, char **argv ));
-_PROTOTYPE(void print, (int fd, ... ));
-_PROTOTYPE(void usage, (void ));
+int main(int argc, char **argv );
+void print(int fd, ... );
+void usage(void );
#ifdef __STDC__
void print(int fd, ...)
int leading_blank = 1; /* Only unexpand leading blanks, */
/* Overruled by -a option */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void Unexpand, (FILE *f, int all));
+int main(int argc, char **argv);
+void Unexpand(FILE *f, int all);
int main(argc, argv)
int argc;
#include <signal.h>
#include <unistd.h>
-_PROTOTYPE(int main, (void));
+int main(void);
int main()
{
int debug = 0, nochk = 0, onedone = 0;
int chtbl[NCHARS], cdlen[NORMLEN + 3];
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(char *getnword, (char *str, int n));
-_PROTOTYPE(void gettable, (void));
-_PROTOTYPE(void decode, (void));
-_PROTOTYPE(void getfile, (char *buf));
-_PROTOTYPE(void format, (char *fp, ...));
-_PROTOTYPE(void doprnt, (char *fp, char *ap));
-_PROTOTYPE(void puti, (unsigned int i, unsigned int r));
-_PROTOTYPE(void outc, (int c));
+int main(int argc, char **argv);
+char *getnword(char *str, int n);
+void gettable(void);
+void decode(void);
+void getfile(char *buf);
+void format(char *fp, ...);
+void doprnt(char *fp, char *ap);
+void puti(unsigned int i, unsigned int r);
+void outc(int c);
int main(argc, argv) int argc; char *argv[];
{
int split = 0;
int fileln = 32000;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void maketable, (void));
-_PROTOTYPE(void makename, (void));
-_PROTOTYPE(void encode, (void));
-_PROTOTYPE(void outdec, (char *p));
-_PROTOTYPE(int fr, (char *buf, int cnt));
+int main(int argc, char **argv);
+void maketable(void);
+void makename(void);
+void encode(void);
+void outdec(char *p);
+int fr(char *buf, int cnt);
int main(argc, argv)
int argc;
char *str_vol_size;
int rflag = 0, wflag = 0, oneflag = 0, variable = 0;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(long str2size, (char *name, char *str, long min, long max,
- int assume_kb));
-_PROTOTYPE(void tape_inquire, (char *name, int fd));
-_PROTOTYPE(void allocate_buffer, (void));
-_PROTOTYPE(void diskio, (int fd1, int fd2, char *file1, char *file2));
+int main(int argc, char **argv);
+void usage(void);
+long str2size(char *name, char *str, long min, long max, int assume_kb);
+void tape_inquire(char *name, int fd);
+void allocate_buffer(void);
+void diskio(int fd1, int fd2, char *file1, char *file2);
int main(argc, argv)
int argc;
long wtotal; /* Total count of words */
long ctotal; /* Total count of characters */
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void count, (FILE *f));
-_PROTOTYPE(void usage, (void));
+int main(int argc, char **argv);
+void count(FILE *f);
+void usage(void);
int main(argc, argv)
int argc;
#include <unistd.h>
#include <stdio.h>
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
int main(ac, av)
int ac;
extern int optind;
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(char *finduser, (void));
-_PROTOTYPE(void settty, (char *utty));
-_PROTOTYPE(void sayhello, (void));
-_PROTOTYPE(void escape, (char *cmd));
-_PROTOTYPE(void writetty, (void));
-_PROTOTYPE(void usage, (void));
-_PROTOTYPE(void intr, (int dummy));
+int main(int argc, char **argv);
+char *finduser(void);
+void settty(char *utty);
+void sayhello(void);
+void escape(char *cmd);
+void writetty(void);
+void usage(void);
+void intr(int dummy);
char *finduser()
{
#include "zmodem.h"
-_PROTOTYPE(static unsigned getspeed , (int code ));
+static unsigned getspeed(int code );
#if HOWMANY > 255
Howmany must be 255 or less
#define ERROR (-1)
-_PROTOTYPE(long getfree , (void));
-_PROTOTYPE(void alrm , (int sig ));
-_PROTOTYPE(int main , (int argc , char *argv []));
-_PROTOTYPE(int usage , (void));
-_PROTOTYPE(int wcreceive , (int argc , char **argp ));
-_PROTOTYPE(int wcrxpn , (char *rpn ));
-_PROTOTYPE(int wcrx , (void));
-_PROTOTYPE(int wcgetsec , (char *rxbuf , int maxtime ));
-_PROTOTYPE(int readline , (int timeout ));
-_PROTOTYPE(void purgeline , (void));
-_PROTOTYPE(int procheader , (char *name ));
-_PROTOTYPE(int make_dirs , (char *pathname ));
-_PROTOTYPE(int makedir , (char *dpath , int dmode ));
-_PROTOTYPE(int putsec , (char *buf , int n ));
-_PROTOTYPE(void sendline , (int c ));
-_PROTOTYPE(void flushmo , (void));
-_PROTOTYPE(void uncaps , (char *s ));
-_PROTOTYPE(int IsAnyLower , (char *s ));
-_PROTOTYPE(char *substr , (char *s , char *t ));
+long getfree(void);
+void alrm(int sig );
+int main(int argc , char *argv []);
+int usage(void);
+int wcreceive(int argc , char **argp );
+int wcrxpn(char *rpn );
+int wcrx(void);
+int wcgetsec(char *rxbuf , int maxtime );
+int readline(int timeout );
+void purgeline(void);
+int procheader(char *name );
+int make_dirs(char *pathname );
+int makedir(char *dpath , int dmode );
+int putsec(char *buf , int n );
+void sendline(int c );
+void flushmo(void);
+void uncaps(char *s );
+int IsAnyLower(char *s );
+char *substr(char *s , char *t );
void zperr();
-_PROTOTYPE(void canit , (void));
-_PROTOTYPE(void report , (int sct ));
-_PROTOTYPE(void chkinvok , (char *s ));
-_PROTOTYPE(void checkpath , (char *name ));
-_PROTOTYPE(int tryz , (void));
-_PROTOTYPE(int rzfiles , (void));
-_PROTOTYPE(int rzfile , (void));
-_PROTOTYPE(void zmputs , (char *s ));
-_PROTOTYPE(int closeit , (void));
-_PROTOTYPE(void ackbibi , (void));
-_PROTOTYPE(void bttyout , (int c ));
-_PROTOTYPE(int sys2 , (char *s ));
-_PROTOTYPE(void exec2 , (char *s ));
+void canit(void);
+void report(int sct );
+void chkinvok(char *s );
+void checkpath(char *name );
+int tryz(void);
+int rzfiles(void);
+int rzfile(void);
+void zmputs(char *s );
+int closeit(void);
+void ackbibi(void);
+void bttyout(int c );
+int sys2(char *s );
+void exec2(char *s );
/*
* Max value for HOWMANY is 255.
jmp_buf tohere; /* For the interrupt on RX timeout */
jmp_buf intrjmp; /* For the interrupt on RX CAN */
-_PROTOTYPE(void onintr , (int sig ));
-_PROTOTYPE(int main , (int argc , char *argv []));
-_PROTOTYPE(int wcsend , (int argc , char *argp []));
-_PROTOTYPE(int wcs , (char *oname ));
-_PROTOTYPE(int wctxpn , (char *name ));
-_PROTOTYPE(int getnak , (void));
-_PROTOTYPE(int wctx , (long flen ));
-_PROTOTYPE(int wcputsec , (char *buf , int sectnum , int cseclen ));
-_PROTOTYPE(int filbuf , (char *buf , int count ));
-_PROTOTYPE(int zfilbuf , (void));
-_PROTOTYPE(int fooseek , (FILE *fptr , long pos , int whence ));
-_PROTOTYPE(void alrm , (int sig ));
-_PROTOTYPE(int readline , (int timeout ));
-_PROTOTYPE(void flushmo , (void));
-_PROTOTYPE(void purgeline , (void));
-_PROTOTYPE(void canit , (void));
+void onintr(int sig );
+int main(int argc , char *argv []);
+int wcsend(int argc , char *argp []);
+int wcs(char *oname );
+int wctxpn(char *name );
+int getnak(void);
+int wctx(long flen );
+int wcputsec(char *buf , int sectnum , int cseclen );
+int filbuf(char *buf , int count );
+int zfilbuf(void);
+int fooseek(FILE *fptr , long pos , int whence );
+void alrm(int sig );
+int readline(int timeout );
+void flushmo(void);
+void purgeline(void);
+void canit(void);
void zperr();
-_PROTOTYPE(char *substr , (char *s , char *t ));
-_PROTOTYPE(int usage , (void));
-_PROTOTYPE(int getzrxinit , (void));
-_PROTOTYPE(int sendzsinit , (void));
-_PROTOTYPE(int zsendfile , (char *buf , int blen ));
-_PROTOTYPE(int zsendfdata , (void));
-_PROTOTYPE(int getinsync , (int flag ));
-_PROTOTYPE(void saybibi , (void));
-_PROTOTYPE(void bttyout , (int c ));
-_PROTOTYPE(int zsendcmd , (char *buf , int blen ));
-_PROTOTYPE(void chkinvok , (char *s ));
-_PROTOTYPE(void countem , (int argc , char **argv ));
-_PROTOTYPE(void chartest , (int m ));
+char *substr(char *s , char *t );
+int usage(void);
+int getzrxinit(void);
+int sendzsinit(void);
+int zsendfile(char *buf , int blen );
+int zsendfdata(void);
+int getinsync(int flag );
+void saybibi(void);
+void bttyout(int c );
+int zsendcmd(char *buf , int blen );
+void chkinvok(char *s );
+void countem(int argc , char **argv );
+void chartest(int m );
/* called by signal interrupt or terminate to clean things up */
void bibi(n)
/* crctab.c */
-_PROTOTYPE(long UPDC32 , (int b , long c ));
+long UPDC32(int b , long c );
/* rbsb.c */
-_PROTOTYPE(void from_cu , (void));
-_PROTOTYPE(void cucheck , (void));
-_PROTOTYPE(int rdchk , (int f ));
-_PROTOTYPE(int rdchk , (int f ));
-_PROTOTYPE(int mode , (int n ));
-_PROTOTYPE(void sendbrk , (void));
+void from_cu(void);
+void cucheck(void);
+int rdchk(int f );
+int rdchk(int f );
+int mode(int n );
+void sendbrk(void);
/* zm.c */
-_PROTOTYPE(void zsbhdr , (int type , char *hdr ));
-_PROTOTYPE(void zsbh32 , (char *hdr , int type ));
-_PROTOTYPE(void zshhdr , (int type , char *hdr ));
-_PROTOTYPE(void zsdata , (char *buf , int length , int frameend ));
-_PROTOTYPE(void zsda32 , (char *buf , int length , int frameend ));
-_PROTOTYPE(int zrdata , (char *buf , int length ));
-_PROTOTYPE(int zrdat32 , (char *buf , int length ));
-_PROTOTYPE(int zgethdr , (char *hdr , int eflag ));
-_PROTOTYPE(int zrbhdr , (char *hdr ));
-_PROTOTYPE(int zrbhdr32 , (char *hdr ));
-_PROTOTYPE(int zrhhdr , (char *hdr ));
-_PROTOTYPE(void zputhex , (int c ));
-_PROTOTYPE(void zsendline , (int c ));
-_PROTOTYPE(int zgethex , (void));
-_PROTOTYPE(int zgeth1 , (void));
-_PROTOTYPE(int zdlread , (void));
-_PROTOTYPE(int noxrd7 , (void));
-_PROTOTYPE(void stohdr , (long pos ));
-_PROTOTYPE(long rclhdr , (char *hdr ));
+void zsbhdr(int type , char *hdr );
+void zsbh32(char *hdr , int type );
+void zshhdr(int type , char *hdr );
+void zsdata(char *buf , int length , int frameend );
+void zsda32(char *buf , int length , int frameend );
+int zrdata(char *buf , int length );
+int zrdat32(char *buf , int length );
+int zgethdr(char *hdr , int eflag );
+int zrbhdr(char *hdr );
+int zrbhdr32(char *hdr );
+int zrhhdr(char *hdr );
+void zputhex(int c );
+void zsendline(int c );
+int zgethex(void);
+int zgeth1(void);
+int zdlread(void);
+int noxrd7(void);
+void stohdr(long pos );
+long rclhdr(char *hdr );
/* rz.c sz.c */
void vfile();
-_PROTOTYPE(void bibi , (int n ));
+void bibi(int n );
/* End of ZMODEM.H */
#include <minix/ansi.h>
#endif
-_PROTOTYPE( int mount, (char *_spec, char *_name, int _mountflags,
- char *type, char *args) );
-_PROTOTYPE( int umount, (const char *_name) );
-_PROTOTYPE( int umount2, (const char *_name, int flags) );
+int mount(char *_spec, char *_name, int _mountflags, char *type, char
+ *args);
+int umount(const char *_name);
+int umount2(const char *_name, int flags);
#endif /* _MOUNT_H */
size_t vallen; /* Size of return data buffer. */
};
-_PROTOTYPE( int svrctl, (int _request, void *_data) );
+int svrctl(int _request, void *_data);
#endif /* _SYS__SVRCTL_H */
#include <minix/ansi.h>
#endif
-_PROTOTYPE( int tcsendbreak, (int _fildes, int _duration) );
-_PROTOTYPE( int tcdrain, (int _filedes) );
-_PROTOTYPE( int tcflush, (int _filedes, int _queue_selector) );
-_PROTOTYPE( int tcflow, (int _filedes, int _action) );
-_PROTOTYPE( speed_t cfgetispeed, (const struct termios *_termios_p) );
-_PROTOTYPE( speed_t cfgetospeed, (const struct termios *_termios_p) );
-_PROTOTYPE( int cfsetispeed, (struct termios *_termios_p, speed_t _speed) );
-_PROTOTYPE( int cfsetospeed, (struct termios *_termios_p, speed_t _speed) );
-_PROTOTYPE( int tcgetattr, (int _filedes, struct termios *_termios_p) );
-_PROTOTYPE( int tcsetattr, \
- (int _filedes, int _opt_actions, const struct termios *_termios_p) );
+int tcsendbreak(int _fildes, int _duration);
+int tcdrain(int _filedes);
+int tcflush(int _filedes, int _queue_selector);
+int tcflow(int _filedes, int _action);
+speed_t cfgetispeed(const struct termios *_termios_p);
+speed_t cfgetospeed(const struct termios *_termios_p);
+int cfsetispeed(struct termios *_termios_p, speed_t _speed);
+int cfsetospeed(struct termios *_termios_p, speed_t _speed);
+int tcgetattr(int _filedes, struct termios *_termios_p);
+int tcsetattr(int _filedes, int _opt_actions, const struct termios
+ *_termios_p);
#ifndef cfgetispeed
#define cfgetispeed(termios_p) ((termios_p)->c_ispeed)
#include <minix/ipc.h>
-_PROTOTYPE(void do_map_bridge, (message *m));
-_PROTOTYPE(void do_get_irq, (message *m));
+void do_map_bridge(message *m);
+void do_get_irq(message *m);
-_PROTOTYPE(void pci_scan_devices, (void));
+void pci_scan_devices(void);
#endif /* __ACPI_PCI_H__ */
static void report_exceptions(void);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
int main(void)
{
{ 0, 0, 0, 0, 0 } /* end of list */
};
-FORWARD _PROTOTYPE( void init_params, (void) );
-FORWARD _PROTOTYPE( void init_drive, (struct wini *w, int base_cmd,
- int base_ctl, int base_dma, int irq, int ack, int hook,
- int drive) );
-FORWARD _PROTOTYPE( void init_params_pci, (int) );
-FORWARD _PROTOTYPE( int w_do_open, (dev_t minor, int access) );
-FORWARD _PROTOTYPE( struct device *w_prepare, (dev_t dev) );
-FORWARD _PROTOTYPE( struct device *w_part, (dev_t minor) );
-FORWARD _PROTOTYPE( int w_identify, (void) );
-FORWARD _PROTOTYPE( char *w_name, (void) );
-FORWARD _PROTOTYPE( int w_specify, (void) );
-FORWARD _PROTOTYPE( int w_io_test, (void) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int com_out, (struct command *cmd) );
-FORWARD _PROTOTYPE( int com_out_ext, (struct command *cmd) );
-FORWARD _PROTOTYPE( int setup_dma, (unsigned *sizep, endpoint_t proc_nr,
- iovec_t *iov, size_t addr_offset, int do_write) );
-FORWARD _PROTOTYPE( void w_need_reset, (void) );
-FORWARD _PROTOTYPE( void ack_irqs, (unsigned int) );
-FORWARD _PROTOTYPE( int w_do_close, (dev_t minor) );
-FORWARD _PROTOTYPE( int w_ioctl, (dev_t minor, unsigned int request,
- endpoint_t endpt, cp_grant_id_t grant) );
-FORWARD _PROTOTYPE( void w_hw_int, (unsigned int irqs) );
-FORWARD _PROTOTYPE( int com_simple, (struct command *cmd) );
-FORWARD _PROTOTYPE( void w_timeout, (void) );
-FORWARD _PROTOTYPE( int w_reset, (void) );
-FORWARD _PROTOTYPE( void w_intr_wait, (void) );
-FORWARD _PROTOTYPE( int at_intr_wait, (void) );
-FORWARD _PROTOTYPE( int w_waitfor, (int mask, int value) );
-FORWARD _PROTOTYPE( int w_waitfor_dma, (int mask, int value) );
-FORWARD _PROTOTYPE( void w_geometry, (dev_t minor,
- struct partition *entry) );
+FORWARD void init_params(void);
+FORWARD 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,
+ 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,
+ 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,
+ 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);
#if ENABLE_ATAPI
-FORWARD _PROTOTYPE( int atapi_sendpacket, (u8_t *packet, unsigned cnt,
- int do_dma) );
-FORWARD _PROTOTYPE( int atapi_intr_wait, (int dma, size_t max) );
-FORWARD _PROTOTYPE( int atapi_open, (void) );
-FORWARD _PROTOTYPE( void atapi_close, (void) );
-FORWARD _PROTOTYPE( int atapi_transfer, (int do_write, u64_t position,
- endpoint_t endpt, iovec_t *iov, unsigned int nr_req) );
+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
+ endpt, iovec_t *iov, unsigned int nr_req);
#endif
#define sys_voutb(out, n) at_voutb((out), (n))
-FORWARD _PROTOTYPE( int at_voutb, (pvb_pair_t *, int n));
+FORWARD int at_voutb(pvb_pair_t *, int n);
#define sys_vinb(in, n) at_vinb((in), (n))
-FORWARD _PROTOTYPE( int at_vinb, (pvb_pair_t *, int n));
+FORWARD int at_vinb(pvb_pair_t *, int n);
#undef sys_outb
#undef sys_inb
#undef sys_outl
-FORWARD _PROTOTYPE( int at_out, (int line, u32_t port, u32_t value,
- char *typename, int type));
-FORWARD _PROTOTYPE( int at_in, (int line, u32_t port, u32_t *value,
- char *typename, int type));
+FORWARD 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,
+ int type);
#define sys_outb(p, v) at_out(__LINE__, (p), (v), "outb", _DIO_BYTE)
#define sys_inb(p, v) at_in(__LINE__, (p), (v), "inb", _DIO_BYTE)
};
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
+FORWARD void sef_local_startup(void);
+FORWARD 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);
/*===========================================================================*
* at_winchester_task *
#define MUTE 0x80
-FORWARD _PROTOTYPE( int ak4531_write, (u8_t address, u8_t data) );
-FORWARD _PROTOTYPE( int ak4531_finished, (void) );
-FORWARD _PROTOTYPE( int set_volume, (struct volume_level *level,
- int cmd_left, int cmd_right, int max_level) );
+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
+ cmd_right, int max_level);
PRIVATE u16_t base_address;
PRIVATE u16_t status_register;
#include <minix/drivers.h>
#include <minix/sound.h>
-_PROTOTYPE( int ak4531_init, (u16_t base, u16_t status_reg, u16_t bit,
- u16_t poll) );
-_PROTOTYPE( int ak4531_get_set_volume, (struct volume_level *level, int flag) );
+int ak4531_init(u16_t base, u16_t status_reg, u16_t bit, u16_t poll);
+int ak4531_get_set_volume(struct volume_level *level, int flag);
#endif
/* prototypes of private functions */
-FORWARD _PROTOTYPE( int detect_hw, (void) );
-FORWARD _PROTOTYPE( int disable_int, (int sub_dev) );
-FORWARD _PROTOTYPE( int set_stereo, (u32_t stereo, int sub_dev) );
-FORWARD _PROTOTYPE( int set_bits, (u32_t nr_of_bits, int sub_dev) );
-FORWARD _PROTOTYPE( int set_sample_rate, (u32_t rate, int sub_dev) );
-FORWARD _PROTOTYPE( int set_sign, (u32_t val, int sub_dev) );
-FORWARD _PROTOTYPE( int get_max_frag_size,
- (u32_t * val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int set_frag_size, (u32_t fragment_size, int sub_dev) );
-FORWARD _PROTOTYPE( int set_int_cnt, (int sub_dev) );
-FORWARD _PROTOTYPE( int free_buf, (u32_t *val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int get_samples_in_buf,
- (u32_t *val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int get_set_volume, (struct volume_level *level, int *len,
- int sub_dev, int flag) );
-FORWARD _PROTOTYPE( int reset, (int sub_dev) );
+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
+ sub_dev, int flag);
+FORWARD int reset(int sub_dev);
DEV_STRUCT dev;
#ifndef PCI_HELPER
#define PCI_HELPER
-_PROTOTYPE( unsigned pci_inb, (u16_t port) );
-_PROTOTYPE( unsigned pci_inw, (u16_t port) );
-_PROTOTYPE( unsigned pci_inl, (u16_t port) );
+unsigned pci_inb(u16_t port);
+unsigned pci_inw(u16_t port);
+unsigned pci_inl(u16_t port);
-_PROTOTYPE( void pci_outb, (u16_t port, u8_t value) );
-_PROTOTYPE( void pci_outw, (u16_t port, u16_t value) );
-_PROTOTYPE( void pci_outl, (u16_t port, u32_t value) );
+void pci_outb(u16_t port, u8_t value);
+void pci_outw(u16_t port, u16_t value);
+void pci_outl(u16_t port, u32_t value);
#endif
/* AC97 Mixer and Mode control function prototypes */
-FORWARD _PROTOTYPE( int AC97_write,
- (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) );
-FORWARD _PROTOTYPE( int AC97_write_unsynced,
- (const DEV_STRUCT * pCC, u16_t wAddr, u16_t wData) );
-FORWARD _PROTOTYPE( int AC97_read_unsynced,
- (const DEV_STRUCT * pCC, u16_t wAddr, u16_t *data) );
-FORWARD _PROTOTYPE( void set_nice_volume, (void) );
-FORWARD _PROTOTYPE( int AC97_get_volume, (struct volume_level *level) );
-FORWARD _PROTOTYPE( int AC97_set_volume, (const struct volume_level *level) );
+FORWARD 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,
+ u16_t wData);
+FORWARD 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);
#include "es1371.h"
#include "wait.h"
-_PROTOTYPE( int SRCInit, (DEV_STRUCT * DSP) );
-_PROTOTYPE( int SRCRegRead, (DEV_STRUCT * DSP, u16_t reg, u16_t *data) );
-_PROTOTYPE( int SRCRegWrite, (DEV_STRUCT * DSP, u16_t reg, u16_t val) );
-_PROTOTYPE( void SRCSetRate, (DEV_STRUCT * DSP, char src_base, u16_t rate) );
+int SRCInit(DEV_STRUCT * DSP);
+int SRCRegRead(DEV_STRUCT * DSP, u16_t reg, u16_t *data);
+int SRCRegWrite(DEV_STRUCT * DSP, u16_t reg, u16_t val);
+void SRCSetRate(DEV_STRUCT * DSP, char src_base, u16_t rate);
/* register/base and control equates for the SRC RAM */
/* prototypes of private functions */
-FORWARD _PROTOTYPE( int detect_hw, (void) );
-FORWARD _PROTOTYPE( int disable_int, (int sub_dev) );
-FORWARD _PROTOTYPE( int set_stereo, (u32_t stereo, int sub_dev) );
-FORWARD _PROTOTYPE( int set_bits, (u32_t nr_of_bits, int sub_dev) );
-FORWARD _PROTOTYPE( int set_sample_rate, (u32_t rate, int sub_dev) );
-FORWARD _PROTOTYPE( int set_sign, (u32_t val, int sub_dev) );
-FORWARD _PROTOTYPE( int get_max_frag_size,
- (u32_t * val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int set_frag_size, (u32_t fragment_size, int sub_dev) );
-FORWARD _PROTOTYPE( int set_int_cnt, (int sub_dev) );
-FORWARD _PROTOTYPE( int free_buf, (u32_t *val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int get_samples_in_buf,
- (u32_t *val, int *len, int sub_dev) );
-FORWARD _PROTOTYPE( int get_set_volume, (struct volume_level *level, int *len,
- int sub_dev, int flag) );
-FORWARD _PROTOTYPE( int reset, (int sub_dev) );
+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
+ sub_dev, int flag);
+FORWARD int reset(int sub_dev);
DEV_STRUCT dev;
#ifndef PCI_HELPER
#define PCI_HELPER
-_PROTOTYPE( unsigned pci_inb, (u16_t port) );
-_PROTOTYPE( unsigned pci_inw, (u16_t port) );
-_PROTOTYPE( unsigned pci_inl, (u16_t port) );
+unsigned pci_inb(u16_t port);
+unsigned pci_inw(u16_t port);
+unsigned pci_inl(u16_t port);
-_PROTOTYPE( void pci_outb, (u16_t port, u8_t value) );
-_PROTOTYPE( void pci_outw, (u16_t port, u16_t value) );
-_PROTOTYPE( void pci_outl, (u16_t port, u32_t value) );
+void pci_outb(u16_t port, u8_t value);
+void pci_outw(u16_t port, u16_t value);
+void pci_outl(u16_t port, u32_t value);
#endif
-FORWARD _PROTOTYPE( int src_reg_read, (const DEV_STRUCT * DSP,
- u16_t reg, u16_t *data) );
-FORWARD _PROTOTYPE( int src_reg_write, (const DEV_STRUCT * DSP,
- u16_t reg, u16_t val) );
+FORWARD 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);
int src_init ( DEV_STRUCT * DSP ) {
#include "wait.h"
#include "pci_helper.h"
-_PROTOTYPE( int src_init, (DEV_STRUCT * DSP) );
-_PROTOTYPE( void src_set_rate, (const DEV_STRUCT * DSP, char src_base, u16_t rate) );
+int src_init(DEV_STRUCT * DSP);
+void src_set_rate(const DEV_STRUCT * DSP, char src_base, u16_t rate);
#define SRC_SYNTH_BASE 0x70
#define SRC_DAC_BASE 0x74
-FORWARD _PROTOTYPE( int get_set_volume, (struct volume_level *level, int flag));
-FORWARD _PROTOTYPE( int get_set_input, (struct inout_ctrl *input, int flag, int channel));
-FORWARD _PROTOTYPE( int get_set_output, (struct inout_ctrl *output, int flag));
+FORWARD int get_set_volume(struct volume_level *level, int flag);
+FORWARD int get_set_input(struct inout_ctrl *input, int flag, int
+ channel);
+FORWARD int get_set_output(struct inout_ctrl *output, int flag);
#ifndef SB16_MIXER_H
#define SB16_MIXER_H
-_PROTOTYPE( int mixer_init, (void));
-_PROTOTYPE( int mixer_ioctl, (int request, void *val, int *len));
+int mixer_init(void);
+int mixer_ioctl(int request, void *val, int *len);
-_PROTOTYPE( int mixer_set, (int reg, int data));
-_PROTOTYPE( int mixer_get, (int reg));
+int mixer_set(int reg, int data);
+int mixer_get(int reg);
#endif
#include "mixer.h"
-FORWARD _PROTOTYPE( void dsp_dma_setup, (phys_bytes address, int count, int sub_dev) );
-
-FORWARD _PROTOTYPE( int dsp_ioctl, (int request, void *val, int *len));
-FORWARD _PROTOTYPE( int dsp_set_size, (unsigned int size) );
-FORWARD _PROTOTYPE( int dsp_set_speed, (unsigned int speed) );
-FORWARD _PROTOTYPE( int dsp_set_stereo, (unsigned int stereo) );
-FORWARD _PROTOTYPE( int dsp_set_bits, (unsigned int bits) );
-FORWARD _PROTOTYPE( int dsp_set_sign, (unsigned int sign) );
-FORWARD _PROTOTYPE( int dsp_get_max_frag_size, (u32_t *val, int *len) );
+FORWARD 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);
PRIVATE unsigned int DspStereo = DEFAULT_STEREO;
#define dma_bytes_left(phys) \
((unsigned) (sizeof(int) == 2 ? 0 : 0x10000) - (unsigned) ((phys) & 0xFFFF))
-_PROTOTYPE( int dsp_command, (int value) );
-_PROTOTYPE( int sb16_inb, (int port) );
-_PROTOTYPE( void sb16_outb, (int port, int value) );
+int dsp_command(int value);
+int sb16_inb(int port);
+void sb16_outb(int port, int value);
#endif /* SB16_H */
PRIVATE int remap_first = 0; /* Remap drives for CD HD emulation */
#define BIOSBUF 16384
-_PROTOTYPE(int main, (void) );
-FORWARD _PROTOTYPE( struct device *w_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( struct device *w_part, (dev_t minor) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int w_do_open, (dev_t minor, int access) );
-FORWARD _PROTOTYPE( int w_do_close, (dev_t minor) );
-FORWARD _PROTOTYPE( void w_init, (void) );
-FORWARD _PROTOTYPE( void w_geometry, (dev_t minor, struct partition *entry));
-FORWARD _PROTOTYPE( int w_ioctl, (dev_t minor, unsigned int request,
- endpoint_t endpt, cp_grant_id_t grant) );
+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,
+ 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,
+ cp_grant_id_t grant);
/* Entry points to this driver. */
PRIVATE struct blockdriver w_dtab = {
};
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* bios_winchester_task *
#include "dec21140A.h"
-_PROTOTYPE( PRIVATE u32_t io_inl, (u16_t) );
-_PROTOTYPE( PRIVATE void io_outl, (u16_t, u32_t) );
-_PROTOTYPE( PRIVATE void do_conf, (const message *) );
-_PROTOTYPE( PRIVATE void do_get_stat_s, (message *) );
-_PROTOTYPE( PRIVATE void do_interrupt, (const dpeth_t *) );
-_PROTOTYPE( PRIVATE void do_reply, (dpeth_t *) );
-_PROTOTYPE( PRIVATE void do_vread_s, (const message *, int) );
-_PROTOTYPE( PRIVATE void do_watchdog, (void *) );
-
-_PROTOTYPE( PRIVATE void de_update_conf, (dpeth_t *) );
-_PROTOTYPE( PRIVATE int de_probe, (dpeth_t *, int skip) );
-_PROTOTYPE( PRIVATE void de_conf_addr, (dpeth_t *) );
-_PROTOTYPE( PRIVATE void de_first_init, (dpeth_t *) );
-_PROTOTYPE( PRIVATE void de_reset, (const dpeth_t *) );
-_PROTOTYPE( PRIVATE void de_hw_conf, (const dpeth_t *) );
-_PROTOTYPE( PRIVATE void de_start, (const dpeth_t *) );
-_PROTOTYPE( PRIVATE void de_setup_frame, (const dpeth_t *) );
-_PROTOTYPE( PRIVATE u16_t de_read_rom, (const dpeth_t *, u8_t, u8_t) );
-_PROTOTYPE( PRIVATE int de_calc_iov_size, (iovec_dat_s_t *) );
-_PROTOTYPE( PRIVATE void de_next_iov, (iovec_dat_s_t *) );
-_PROTOTYPE( PRIVATE void do_vwrite_s, (const message *, int) );
-_PROTOTYPE( PRIVATE void de_get_userdata_s, (int, cp_grant_id_t,
- vir_bytes, int, void *) );
+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
+ *);
/* Error messages */
static char str_CopyErrMsg[] = "unable to read/write user data";
PRIVATE int de_instance;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
#define MILLIS_TO_TICKS(m) (((m)*system_hz/1000)+1)
-_PROTOTYPE(static void el2_init, (dpeth_t *dep));
-_PROTOTYPE(static void el2_stop, (dpeth_t *dep));
-_PROTOTYPE( static void milli_delay, (unsigned long millis) );
+static void el2_init(dpeth_t *dep);
+static void el2_stop(dpeth_t *dep);
+static void milli_delay(unsigned long millis);
/*===========================================================================*
* el2_init *
#define CR_EXTRA CR_STA
#if ENABLE_PCI
-_PROTOTYPE( static void pci_conf, (void) );
+static void pci_conf(void);
#endif
-_PROTOTYPE( static void do_vwrite_s, (message *mp, int from_int) );
-_PROTOTYPE( static void do_vread_s, (message *mp) );
-_PROTOTYPE( static void do_init, (message *mp) );
-_PROTOTYPE( static void do_int, (dpeth_t *dep) );
-_PROTOTYPE( static void do_getstat_s, (message *mp) );
-_PROTOTYPE( static void dp_stop, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_init, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_confaddr, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_reinit, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_reset, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_check_ints, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_recv, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_send, (dpeth_t *dep) );
-_PROTOTYPE( static void dp_getblock, (dpeth_t *dep, int page,
- size_t offset, size_t size, void *dst) );
-_PROTOTYPE( static void dp_pio8_getblock, (dpeth_t *dep, int page,
- size_t offset, size_t size, void *dst) );
-_PROTOTYPE( static void dp_pio16_getblock, (dpeth_t *dep, int page,
- size_t offset, size_t size, void *dst) );
-_PROTOTYPE( static int dp_pkt2user_s, (dpeth_t *dep, int page,
- vir_bytes length) );
-_PROTOTYPE( static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp,
- vir_bytes offset, int nic_addr, vir_bytes count) );
-_PROTOTYPE( static void dp_pio8_user2nic_s, (dpeth_t *dep,
- iovec_dat_s_t *iovp, vir_bytes offset,
- int nic_addr, vir_bytes count) );
-_PROTOTYPE( static void dp_pio16_user2nic_s, (dpeth_t *dep,
- iovec_dat_s_t *iovp, vir_bytes offset,
- int nic_addr, vir_bytes count) );
-_PROTOTYPE( static void dp_nic2user_s, (dpeth_t *dep, int nic_addr,
- iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
-_PROTOTYPE( static void dp_pio8_nic2user_s, (dpeth_t *dep, int nic_addr,
- iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
-_PROTOTYPE( static void dp_pio16_nic2user_s, (dpeth_t *dep, int nic_addr,
- iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
-_PROTOTYPE( static void dp_next_iovec_s, (iovec_dat_s_t *iovp) );
-_PROTOTYPE( static void conf_hw, (dpeth_t *dep) );
-_PROTOTYPE( static void update_conf, (dpeth_t *dep, dp_conf_t *dcp) );
-_PROTOTYPE( static void map_hw_buffer, (dpeth_t *dep) );
-_PROTOTYPE( static int calc_iovec_size_s, (iovec_dat_s_t *iovp) );
-_PROTOTYPE( static void reply, (dpeth_t *dep) );
-_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
-_PROTOTYPE( static void get_userdata_s, (int user_proc,
- cp_grant_id_t grant, vir_bytes offset, vir_bytes count,
- void *loc_addr) );
-_PROTOTYPE( static void put_userdata_s, (int user_proc,
- cp_grant_id_t grant, size_t count, void *loc_addr) );
-_PROTOTYPE( static void insb, (port_t port, void *buf, size_t size) );
-_PROTOTYPE( static void insw, (port_t port, void *buf, size_t size) );
-_PROTOTYPE( static void do_vir_insb, (port_t port, int proc,
- vir_bytes buf, size_t size) );
-_PROTOTYPE( static void do_vir_insw, (port_t port, int proc,
- vir_bytes buf, size_t size) );
+static void do_vwrite_s(message *mp, int from_int);
+static void do_vread_s(message *mp);
+static void do_init(message *mp);
+static void do_int(dpeth_t *dep);
+static void do_getstat_s(message *mp);
+static void dp_stop(dpeth_t *dep);
+static void dp_init(dpeth_t *dep);
+static void dp_confaddr(dpeth_t *dep);
+static void dp_reinit(dpeth_t *dep);
+static void dp_reset(dpeth_t *dep);
+static void dp_check_ints(dpeth_t *dep);
+static void dp_recv(dpeth_t *dep);
+static void dp_send(dpeth_t *dep);
+static void dp_getblock(dpeth_t *dep, int page, size_t offset, size_t
+ size, void *dst);
+static void dp_pio8_getblock(dpeth_t *dep, int page, size_t offset,
+ size_t size, void *dst);
+static void dp_pio16_getblock(dpeth_t *dep, int page, size_t offset,
+ size_t size, void *dst);
+static int dp_pkt2user_s(dpeth_t *dep, int page, vir_bytes length);
+static void dp_user2nic_s(dpeth_t *dep, iovec_dat_s_t *iovp, vir_bytes
+ offset, int nic_addr, vir_bytes count);
+static void dp_pio8_user2nic_s(dpeth_t *dep, iovec_dat_s_t *iovp,
+ vir_bytes offset, int nic_addr, vir_bytes count);
+static void dp_pio16_user2nic_s(dpeth_t *dep, iovec_dat_s_t *iovp,
+ vir_bytes offset, int nic_addr, vir_bytes count);
+static void dp_nic2user_s(dpeth_t *dep, int nic_addr, iovec_dat_s_t
+ *iovp, vir_bytes offset, vir_bytes count);
+static void dp_pio8_nic2user_s(dpeth_t *dep, int nic_addr, iovec_dat_s_t
+ *iovp, vir_bytes offset, vir_bytes count);
+static void dp_pio16_nic2user_s(dpeth_t *dep, int nic_addr,
+ iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count);
+static void dp_next_iovec_s(iovec_dat_s_t *iovp);
+static void conf_hw(dpeth_t *dep);
+static void update_conf(dpeth_t *dep, dp_conf_t *dcp);
+static void map_hw_buffer(dpeth_t *dep);
+static int calc_iovec_size_s(iovec_dat_s_t *iovp);
+static void reply(dpeth_t *dep);
+static void mess_reply(message *req, message *reply);
+static void get_userdata_s(int user_proc, cp_grant_id_t grant, vir_bytes
+ offset, vir_bytes count, void *loc_addr);
+static void put_userdata_s(int user_proc, cp_grant_id_t grant, size_t
+ count, void *loc_addr);
+static void insb(port_t port, void *buf, size_t size);
+static void insw(port_t port, void *buf, size_t size);
+static void do_vir_insb(port_t port, int proc, vir_bytes buf, size_t
+ size);
+static void do_vir_insw(port_t port, int proc, vir_bytes buf, size_t
+ size);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
PRIVATE void handle_hw_intr(void)
{
struct dpeth;
struct iovec_dat;
struct iovec_dat_s;
-_PROTOTYPE( typedef void (*dp_initf_t), (struct dpeth *dep) );
-_PROTOTYPE( typedef void (*dp_stopf_t), (struct dpeth *dep) );
-_PROTOTYPE( typedef void (*dp_user2nicf_t), (struct dpeth *dep,
- struct iovec_dat *iovp, vir_bytes offset,
- int nic_addr, vir_bytes count) );
-_PROTOTYPE( typedef void (*dp_user2nicf_s_t), (struct dpeth *dep,
- struct iovec_dat_s *iovp, vir_bytes offset,
- int nic_addr, vir_bytes count) );
-_PROTOTYPE( typedef void (*dp_nic2userf_t), (struct dpeth *dep,
- int nic_addr, struct iovec_dat *iovp,
- vir_bytes offset, vir_bytes count) );
-_PROTOTYPE( typedef void (*dp_nic2userf_s_t), (struct dpeth *dep,
- int nic_addr, struct iovec_dat_s *iovp,
- vir_bytes offset, vir_bytes count) );
+typedef void(*dp_initf_t) (struct dpeth *dep);
+typedef void(*dp_stopf_t) (struct dpeth *dep);
+typedef void(*dp_user2nicf_t) (struct dpeth *dep, struct iovec_dat
+ *iovp, vir_bytes offset, int nic_addr, vir_bytes count);
+typedef void(*dp_user2nicf_s_t) (struct dpeth *dep, struct iovec_dat_s
+ *iovp, vir_bytes offset, int nic_addr, vir_bytes count);
+typedef void(*dp_nic2userf_t) (struct dpeth *dep, int nic_addr, struct
+ iovec_dat *iovp, vir_bytes offset, vir_bytes count);
+typedef void(*dp_nic2userf_s_t) (struct dpeth *dep, int nic_addr, struct
+ iovec_dat_s *iovp, vir_bytes offset, vir_bytes count);
#if 0
-_PROTOTYPE( typedef void (*dp_getheaderf_t), (struct dpeth *dep,
- int page, struct dp_rcvhdr *h, u16_t *eth_type) );
+typedef void(*dp_getheaderf_t) (struct dpeth *dep, int page, struct
+ dp_rcvhdr *h, u16_t *eth_type);
#endif
-_PROTOTYPE( typedef void (*dp_getblock_t), (struct dpeth *dep,
- int page, size_t offset, size_t size, void *dst) );
+typedef void(*dp_getblock_t) (struct dpeth *dep, int page, size_t
+ offset, size_t size, void *dst);
/* iovectors are handled IOVEC_NR entries at a time. */
#define IOVEC_NR 16
struct dpeth;
/* 3c503.c */
-_PROTOTYPE( int el2_probe, (struct dpeth* dep) );
+int el2_probe(struct dpeth* dep);
/* dp8390.c */
-_PROTOTYPE( u8_t inb, (port_t port) );
-_PROTOTYPE( u16_t inw, (port_t port) );
-_PROTOTYPE( void outb, (port_t port, u8_t v) );
-_PROTOTYPE( void outw, (port_t port, u16_t v) );
+u8_t inb(port_t port);
+u16_t inw(port_t port);
+void outb(port_t port, u8_t v);
+void outw(port_t port, u16_t v);
/* ne2000.c */
-_PROTOTYPE( int ne_probe, (struct dpeth *dep) );
-_PROTOTYPE( void ne_init, (struct dpeth *dep) );
+int ne_probe(struct dpeth *dep);
+void ne_init(struct dpeth *dep);
/* rtl8029.c */
-_PROTOTYPE( int rtl_probe, (struct dpeth *dep, int skip) );
+int rtl_probe(struct dpeth *dep, int skip);
/* wdeth.c */
-_PROTOTYPE( int wdeth_probe, (struct dpeth* dep) );
+int wdeth_probe(struct dpeth* dep);
#define MILLIS_TO_TICKS(m) (((m)*system_hz/1000)+1)
-_PROTOTYPE( typedef int (*testf_t), (dpeth_t *dep, int pos, u8_t *pat) );
+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 };
-_PROTOTYPE( static int test_8, (dpeth_t *dep, int pos, u8_t *pat) );
-_PROTOTYPE( static int test_16, (dpeth_t *dep, int pos, u8_t *pat) );
-_PROTOTYPE( static void ne_stop, (dpeth_t *dep) );
-_PROTOTYPE( static void milli_delay, (unsigned long millis) );
+static int test_8(dpeth_t *dep, int pos, u8_t *pat);
+static int test_16(dpeth_t *dep, int pos, u8_t *pat);
+static void ne_stop(dpeth_t *dep);
+static void milli_delay(unsigned long millis);
/*===========================================================================*
* ne_probe *
#if ENABLE_PCI
-_PROTOTYPE( static void rtl_init, (struct dpeth *dep) );
+static void rtl_init(struct dpeth *dep);
#if 0
-_PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) );
-_PROTOTYPE( static void ee_wen, (dpeth_t *dep) );
-_PROTOTYPE( static void set_ee_word, (dpeth_t *dep, int a, u16_t w) );
-_PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
+static u16_t get_ee_word(dpeth_t *dep, int a);
+static void ee_wen(dpeth_t *dep);
+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)
static int we_int_table[8]= { 9, 3, 5, 7, 10, 11, 15, 4 };
static int we_790int_table[8]= { 0, 9, 3, 5, 7, 10, 11, 15 };
-_PROTOTYPE( static void we_init, (dpeth_t *dep) );
-_PROTOTYPE( static void we_stop, (dpeth_t *dep) );
-_PROTOTYPE( static int we_aliasing, (dpeth_t *dep) );
-_PROTOTYPE( static int we_interface_chip, (dpeth_t *dep) );
-_PROTOTYPE( static int we_16bitboard, (dpeth_t *dep) );
-_PROTOTYPE( static int we_16bitslot, (dpeth_t *dep) );
-_PROTOTYPE( static int we_ultra, (dpeth_t *dep) );
+static void we_init(dpeth_t *dep);
+static void we_stop(dpeth_t *dep);
+static int we_aliasing(dpeth_t *dep);
+static int we_interface_chip(dpeth_t *dep);
+static int we_16bitboard(dpeth_t *dep);
+static int we_16bitslot(dpeth_t *dep);
+static int we_ultra(dpeth_t *dep);
/*===========================================================================*
* wdeth_probe *
}
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*
** Name: int dpeth_task(void)
static const int we_int_table[8] = {9, 3, 5, 7, 10, 11, 15, 4};
static const int we_790int_table[8] = {0, 9, 3, 5, 7, 10, 11, 15};
-_PROTOTYPE(static void we_init, (dpeth_t * dep));
-_PROTOTYPE(static void we_stop, (dpeth_t * dep));
-_PROTOTYPE(static int we_aliasing, (dpeth_t * dep));
-_PROTOTYPE(static int we_interface_chip, (dpeth_t * dep));
-_PROTOTYPE(static int we_16bitboard, (dpeth_t * dep));
-_PROTOTYPE(static int we_16bitslot, (dpeth_t * dep));
-_PROTOTYPE(static int we_ultra, (dpeth_t * dep));
+static void we_init(dpeth_t * dep);
+static void we_stop(dpeth_t * dep);
+static int we_aliasing(dpeth_t * dep);
+static int we_interface_chip(dpeth_t * dep);
+static int we_16bitboard(dpeth_t * dep);
+static int we_16bitslot(dpeth_t * dep);
+static int we_ultra(dpeth_t * dep);
/*===========================================================================*
* wdeth_probe *
PRIVATE int e1000_instance;
PRIVATE e1000_t e1000_state;
-_PROTOTYPE( PRIVATE void e1000_init, (message *mp) );
-_PROTOTYPE( PRIVATE void e1000_init_pci, (void) );
-_PROTOTYPE( PRIVATE int e1000_probe, (e1000_t *e, int skip) );
-_PROTOTYPE( PRIVATE int e1000_init_hw, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_init_addr, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_init_buf, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_reset_hw, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_writev_s, (message *mp, int from_int) );
-_PROTOTYPE( PRIVATE void e1000_readv_s, (message *mp, int from_int) );
-_PROTOTYPE( PRIVATE void e1000_getstat_s, (message *mp) );
-_PROTOTYPE( PRIVATE void e1000_interrupt, (message *mp) );
-_PROTOTYPE( PRIVATE int e1000_link_changed, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void e1000_stop, (e1000_t *e) );
-_PROTOTYPE( PRIVATE uint32_t e1000_reg_read, (e1000_t *e, uint32_t reg) );
-_PROTOTYPE( PRIVATE void e1000_reg_write, (e1000_t *e, uint32_t reg,
- uint32_t value) );
-_PROTOTYPE( PRIVATE void e1000_reg_set, (e1000_t *e, uint32_t reg,
- uint32_t value) );
-_PROTOTYPE( PRIVATE void e1000_reg_unset, (e1000_t *e, uint32_t reg,
- uint32_t value) );
-_PROTOTYPE( PRIVATE u16_t eeprom_eerd, (void *e, int reg) );
-_PROTOTYPE( PRIVATE u16_t eeprom_ich, (void *e, int reg) );
-_PROTOTYPE( PRIVATE int eeprom_ich_init, (e1000_t *e) );
-_PROTOTYPE( PRIVATE int eeprom_ich_cycle, (const e1000_t *e, u32_t timeout) );
-_PROTOTYPE( PRIVATE void reply, (e1000_t *e) );
-_PROTOTYPE( PRIVATE void mess_reply, (message *req, message *reply) );
+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);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
static char *buf_array, *buffer; /* contiguous buffer */
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* carry *
*/
PRIVATE timer_t f_tmr_timeout; /* timer for various timeouts */
PRIVATE u32_t system_hz; /* system clock frequency */
-FORWARD _PROTOTYPE( void f_expire_tmrs, (clock_t stamp) );
-FORWARD _PROTOTYPE( void stop_motor, (timer_t *tp) );
-FORWARD _PROTOTYPE( void f_timeout, (timer_t *tp) );
-
-FORWARD _PROTOTYPE( struct device *f_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( struct device *f_part, (dev_t minor) );
-FORWARD _PROTOTYPE( void f_cleanup, (void) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int dma_setup, (int do_write) );
-FORWARD _PROTOTYPE( void start_motor, (void) );
-FORWARD _PROTOTYPE( int seek, (void) );
-FORWARD _PROTOTYPE( int fdc_transfer, (int do_write) );
-FORWARD _PROTOTYPE( int fdc_results, (void) );
-FORWARD _PROTOTYPE( int fdc_command, (const u8_t *cmd, int len) );
-FORWARD _PROTOTYPE( void fdc_out, (int val) );
-FORWARD _PROTOTYPE( int recalibrate, (void) );
-FORWARD _PROTOTYPE( void f_reset, (void) );
-FORWARD _PROTOTYPE( int f_intr_wait, (void) );
-FORWARD _PROTOTYPE( int read_id, (void) );
-FORWARD _PROTOTYPE( int f_do_open, (dev_t minor, int access) );
-FORWARD _PROTOTYPE( int f_do_close, (dev_t minor) );
-FORWARD _PROTOTYPE( int test_read, (int density) );
-FORWARD _PROTOTYPE( void f_geometry, (dev_t minor,
- struct partition *entry) );
+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,
+ 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);
/* Entry points to this driver. */
PRIVATE struct blockdriver f_dtab = {
static phys_bytes floppy_buf_phys;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
+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);
+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;
/*===========================================================================*
#define fxp_outb(port, offset, value) (do_outb((port) + (offset), (value)))
#define fxp_outl(port, offset, value) (do_outl((port) + (offset), (value)))
-_PROTOTYPE( static void fxp_init, (message *mp) );
-_PROTOTYPE( static void fxp_pci_conf, (void) );
-_PROTOTYPE( static int fxp_probe, (fxp_t *fp, int skip) );
-_PROTOTYPE( static void fxp_conf_hw, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_init_hw, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_init_buf, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_reset_hw, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_confaddr, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_rec_mode, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_writev_s, (const message *mp, int from_int) );
-_PROTOTYPE( static void fxp_readv_s, (message *mp, int from_int) );
-_PROTOTYPE( static void fxp_do_conf, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_cu_ptr_cmd, (fxp_t *fp, int cmd,
- phys_bytes bus_addr, int check_idle) );
-_PROTOTYPE( static void fxp_ru_ptr_cmd, (fxp_t *fp, int cmd,
- phys_bytes bus_addr, int check_idle) );
-_PROTOTYPE( static void fxp_restart_ru, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_getstat_s, (message *mp) );
-_PROTOTYPE( static void fxp_handler, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_check_ints, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_watchdog_f, (timer_t *tp) );
-_PROTOTYPE( static int fxp_link_changed, (fxp_t *fp) );
-_PROTOTYPE( static void fxp_report_link, (fxp_t *fp) );
-_PROTOTYPE( static void reply, (fxp_t *fp) );
-_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
-_PROTOTYPE( static u16_t eeprom_read, (fxp_t *fp, int reg) );
-_PROTOTYPE( static void eeprom_addrsize, (fxp_t *fp) );
-_PROTOTYPE( static u16_t mii_read, (fxp_t *fp, int reg) );
-_PROTOTYPE( static u8_t do_inb, (port_t port) );
-_PROTOTYPE( static u32_t do_inl, (port_t port) );
-_PROTOTYPE( static void do_outb, (port_t port, u8_t v) );
-_PROTOTYPE( static void do_outl, (port_t port, u32_t v) );
-_PROTOTYPE( static void tell_dev, (vir_bytes start, size_t size,
- int pci_bus, int pci_dev, int pci_func) );
+static void fxp_init(message *mp);
+static void fxp_pci_conf(void);
+static int fxp_probe(fxp_t *fp, int skip);
+static void fxp_conf_hw(fxp_t *fp);
+static void fxp_init_hw(fxp_t *fp);
+static void fxp_init_buf(fxp_t *fp);
+static void fxp_reset_hw(fxp_t *fp);
+static void fxp_confaddr(fxp_t *fp);
+static void fxp_rec_mode(fxp_t *fp);
+static void fxp_writev_s(const message *mp, int from_int);
+static void fxp_readv_s(message *mp, int from_int);
+static void fxp_do_conf(fxp_t *fp);
+static void fxp_cu_ptr_cmd(fxp_t *fp, int cmd, phys_bytes bus_addr, int
+ check_idle);
+static void fxp_ru_ptr_cmd(fxp_t *fp, int cmd, phys_bytes bus_addr, int
+ check_idle);
+static void fxp_restart_ru(fxp_t *fp);
+static void fxp_getstat_s(message *mp);
+static void fxp_handler(fxp_t *fp);
+static void fxp_check_ints(fxp_t *fp);
+static void fxp_watchdog_f(timer_t *tp);
+static int fxp_link_changed(fxp_t *fp);
+static void fxp_report_link(fxp_t *fp);
+static void reply(fxp_t *fp);
+static void mess_reply(message *req, message *reply);
+static u16_t eeprom_read(fxp_t *fp, int reg);
+static void eeprom_addrsize(fxp_t *fp);
+static u16_t mii_read(fxp_t *fp, int reg);
+static u8_t do_inb(port_t port);
+static u32_t do_inl(port_t port);
+static void do_outb(port_t port, u8_t v);
+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)
{
}
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
#define MII_ESTAT_RES 0x0FFF /* Reserved */
/* 0x10 ... 0x1F */ /* Vendor Specific */
-_PROTOTYPE( void mii_print_stat_speed, (u16_t stat, u16_t extstat) );
-_PROTOTYPE( void mii_print_techab, (u16_t techab) );
+void mii_print_stat_speed(u16_t stat, u16_t extstat);
+void mii_print_techab(u16_t techab);
#endif
/*
/*
* Function prototypes for the hello driver.
*/
-FORWARD _PROTOTYPE( int hello_open, (message *m) );
-FORWARD _PROTOTYPE( int hello_close, (message *m) );
-FORWARD _PROTOTYPE( struct device * hello_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( 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) );
+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,
+ iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
+ flags);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( int sef_cb_lu_state_save, (int) );
-FORWARD _PROTOTYPE( int lu_state_restore, (void) );
+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);
/* Entry points to the hello driver. */
PRIVATE struct chardriver hello_tab =
};
/* General */
-_PROTOTYPE( static void do_init, (message *mp) );
-_PROTOTYPE( static void ec_init, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_confaddr, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_reinit, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_check_ints, (ether_card_t *ec) );
-_PROTOTYPE( static void conf_hw, (ether_card_t *ec) );
-_PROTOTYPE( static void update_conf, (ether_card_t *ec, ec_conf_t *ecp) );
-_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
-_PROTOTYPE( static void do_int, (ether_card_t *ec) );
-_PROTOTYPE( static void reply, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_reset, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_send, (ether_card_t *ec) );
-_PROTOTYPE( static void ec_recv, (ether_card_t *ec) );
-_PROTOTYPE( static void do_vwrite_s, (message *mp, int from_int) );
-_PROTOTYPE( static void do_vread_s, (const message *mp) );
-_PROTOTYPE( static void ec_user2nic,
- (ether_card_t *dep, iovec_dat_t *iovp,
- vir_bytes offset, int nic_addr,
- vir_bytes count) );
-_PROTOTYPE( static void ec_nic2user,
- (ether_card_t *ec, int nic_addr,
- iovec_dat_t *iovp, vir_bytes offset,
- vir_bytes count) );
-_PROTOTYPE( static int calc_iovec_size, (iovec_dat_t *iovp) );
-_PROTOTYPE( static void ec_next_iovec, (iovec_dat_t *iovp) );
-_PROTOTYPE( static void do_getstat_s, (message *mp) );
-_PROTOTYPE( static void lance_stop, (ether_card_t *ec) );
-
-_PROTOTYPE( static void lance_dump, (void) );
-_PROTOTYPE( static void getAddressing, (int devind, ether_card_t *ec) );
+static void do_init(message *mp);
+static void ec_init(ether_card_t *ec);
+static void ec_confaddr(ether_card_t *ec);
+static void ec_reinit(ether_card_t *ec);
+static void ec_check_ints(ether_card_t *ec);
+static void conf_hw(ether_card_t *ec);
+static void update_conf(ether_card_t *ec, ec_conf_t *ecp);
+static void mess_reply(message *req, message *reply);
+static void do_int(ether_card_t *ec);
+static void reply(ether_card_t *ec);
+static void ec_reset(ether_card_t *ec);
+static void ec_send(ether_card_t *ec);
+static void ec_recv(ether_card_t *ec);
+static void do_vwrite_s(message *mp, int from_int);
+static void do_vread_s(const message *mp);
+static void ec_user2nic(ether_card_t *dep, iovec_dat_t *iovp, vir_bytes
+ offset, int nic_addr, vir_bytes count);
+static void ec_nic2user(ether_card_t *ec, int nic_addr, iovec_dat_t
+ *iovp, vir_bytes offset, vir_bytes count);
+static int calc_iovec_size(iovec_dat_t *iovp);
+static void ec_next_iovec(iovec_dat_t *iovp);
+static void do_getstat_s(message *mp);
+static void lance_stop(ether_card_t *ec);
+
+static void lance_dump(void);
+static void getAddressing(int devind, ether_card_t *ec);
/* probe+init LANCE cards */
-_PROTOTYPE( static int lance_probe, (ether_card_t *ec, int skip) );
-_PROTOTYPE( static void lance_init_card, (ether_card_t *ec) );
+static int lance_probe(ether_card_t *ec, int skip);
+static void lance_init_card(ether_card_t *ec);
/* Accesses Lance Control and Status Registers */
-_PROTOTYPE( static u8_t in_byte, (port_t port) );
-_PROTOTYPE( static u16_t in_word, (port_t port) );
-_PROTOTYPE( static void out_word, (port_t port, u16_t value) );
-_PROTOTYPE( static u16_t read_csr, (port_t ioaddr, u16_t csrno) );
-_PROTOTYPE( static void write_csr, (port_t ioaddr, u16_t csrno, u16_t value));
+static u8_t in_byte(port_t port);
+static u16_t in_word(port_t port);
+static void out_word(port_t port, u16_t value);
+static u16_t read_csr(port_t ioaddr, u16_t csrno);
+static void write_csr(port_t ioaddr, u16_t csrno, u16_t value);
/* --- LANCE --- */
/* General */
phys_bytes lance_buf_phys;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
PRIVATE struct device log_geom[NR_DEVS]; /* base and size of devices */
PRIVATE int log_device = -1; /* current device */
-FORWARD _PROTOTYPE( struct device *log_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int log_do_open, (message *m_ptr) );
-FORWARD _PROTOTYPE( int log_cancel, (message *m_ptr) );
-FORWARD _PROTOTYPE( int log_select, (message *m_ptr) );
-FORWARD _PROTOTYPE( int log_other, (message *m_ptr) );
-FORWARD _PROTOTYPE( int subread, (struct logdevice *log, int count,
- endpoint_t endpt, cp_grant_id_t grant, size_t) );
+FORWARD struct device *log_prepare(dev_t device);
+FORWARD 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,
+ cp_grant_id_t grant, size_t);
/* Entry points to this driver. */
PRIVATE struct chardriver log_dtab = {
};
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+FORWARD void sef_local_startup(void);
+FORWARD 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);
/*===========================================================================*
* main *
};
/* Function prototypes. */
-_PROTOTYPE( void do_new_kmess, (void) );
-_PROTOTYPE( void log_append, (char *buf, int len) );
+void do_new_kmess(void);
+void log_append(char *buf, int len);
PRIVATE int openct[NR_DEVS];
-FORWARD _PROTOTYPE( struct device *m_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int m_do_open, (message *m_ptr) );
-FORWARD _PROTOTYPE( int m_do_close, (message *m_ptr) );
-
-FORWARD _PROTOTYPE( struct device *m_block_part, (dev_t minor) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int m_block_open, (dev_t minor, int access) );
-FORWARD _PROTOTYPE( int m_block_close, (dev_t minor) );
-FORWARD _PROTOTYPE( int m_block_ioctl, (dev_t minor,
- unsigned int request, endpoint_t endpt, cp_grant_id_t grant) );
+FORWARD struct device *m_prepare(dev_t device);
+FORWARD 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);
+
+FORWARD struct device *m_block_part(dev_t minor);
+FORWARD 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
+ endpt, cp_grant_id_t grant);
/* Entry points to the CHARACTER part of this driver. */
PRIVATE struct chardriver m_cdtab = {
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
#define HERMES_RECLEN_TO_BYTES(n) ( ((n)-1) * 2 )
/* Function prototypes */
-_PROTOTYPE (u16_t hermes_read_reg, (const hermes_t * hw, u16_t off));
-_PROTOTYPE (void hermes_write_reg, (const hermes_t * hw, u16_t off,
- u16_t val));
-_PROTOTYPE (void hermes_struct_init, (hermes_t * hw, u32_t address,
- int io_space, int reg_spacing));
-_PROTOTYPE (int hermes_init, (hermes_t * hw));
-_PROTOTYPE (int hermes_docmd_wait, (hermes_t * hw, u16_t cmd,
- u16_t parm0, hermes_response_t * resp));
-_PROTOTYPE (int hermes_allocate, (hermes_t * hw, u16_t size, u16_t * fid));
-_PROTOTYPE (int hermes_bap_pread, (hermes_t * hw, int bap, void *buf,
- unsigned len, u16_t id, u16_t offset));
-_PROTOTYPE (int hermes_bap_pwrite, (hermes_t * hw, int bap,
- const void *buf, unsigned len, u16_t id,
- u16_t offset));
-_PROTOTYPE (void hermes_read_words, (hermes_t * hw, int off, void *buf,
- unsigned count));
-_PROTOTYPE (int hermes_read_ltv, (hermes_t * hw, int bap, u16_t rid,
- unsigned buflen, u16_t * length,
- void *buf));
-_PROTOTYPE (int hermes_write_ltv, (hermes_t * hw, int bap, u16_t rid,
- u16_t length, const void *value));
-_PROTOTYPE (int hermes_set_irqmask, (hermes_t * hw, u16_t events));
-_PROTOTYPE (u16_t hermes_get_irqmask, (hermes_t * hw));
-_PROTOTYPE (int hermes_read_wordrec, (hermes_t * hw, int bap, u16_t rid,
- u16_t * word));
-_PROTOTYPE (int hermes_write_wordrec, (hermes_t * hw, int bap, u16_t rid,
- u16_t word));
-_PROTOTYPE (int hermes_cor_reset, (hermes_t *hw));
+u16_t hermes_read_reg(const hermes_t * hw, u16_t off);
+void hermes_write_reg(const hermes_t * hw, u16_t off, u16_t val);
+void hermes_struct_init(hermes_t * hw, u32_t address, int io_space, int
+ reg_spacing);
+int hermes_init(hermes_t * hw);
+int hermes_docmd_wait(hermes_t * hw, u16_t cmd, u16_t parm0,
+ hermes_response_t * resp);
+int hermes_allocate(hermes_t * hw, u16_t size, u16_t * fid);
+int hermes_bap_pread(hermes_t * hw, int bap, void *buf, unsigned len,
+ u16_t id, u16_t offset);
+int hermes_bap_pwrite(hermes_t * hw, int bap, const void *buf, unsigned
+ len, u16_t id, u16_t offset);
+void hermes_read_words(hermes_t * hw, int off, void *buf, unsigned
+ count);
+int hermes_read_ltv(hermes_t * hw, int bap, u16_t rid, unsigned buflen,
+ u16_t * length, void *buf);
+int hermes_write_ltv(hermes_t * hw, int bap, u16_t rid, u16_t length,
+ const void *value);
+int hermes_set_irqmask(hermes_t * hw, u16_t events);
+u16_t hermes_get_irqmask(hermes_t * hw);
+int hermes_read_wordrec(hermes_t * hw, int bap, u16_t rid, u16_t *
+ word);
+int hermes_write_wordrec(hermes_t * hw, int bap, u16_t rid, u16_t word);
+int hermes_cor_reset(hermes_t *hw);
#endif /* _HERMES_H */
#define BITRATE_TABLE_SIZE (sizeof(bitrate_table) / sizeof(bitrate_table[0]))
-_PROTOTYPE (static void or_writev_s, (message * mp, int from_int));
-_PROTOTYPE (static void or_readv_s, (message * mp, int from_int));
-_PROTOTYPE (static void reply, (t_or * orp));
-_PROTOTYPE (static int or_probe, (t_or *, int skip));
-_PROTOTYPE (static void or_ev_info, (t_or *));
-_PROTOTYPE (static void or_init, (message *));
-_PROTOTYPE (static void or_pci_conf, (void));
-_PROTOTYPE (static void or_init_struct, (t_or *));
-_PROTOTYPE (static void map_hw_buffer, (t_or *));
-_PROTOTYPE (static void or_init_hw, (t_or *));
-_PROTOTYPE (static void or_check_ints, (t_or *));
-_PROTOTYPE (static void or_writerids, (hermes_t *, t_or *));
-_PROTOTYPE (static void or_readrids, (hermes_t *, t_or *));
-_PROTOTYPE (static void or_rec_mode, (t_or *));
-_PROTOTYPE (static void mess_reply, (message *, message *));
-_PROTOTYPE (static u32_t or_get_bar, (int devind, t_or * orp));
-_PROTOTYPE (static void or_getstat_s, (message * mp));
-_PROTOTYPE (static void print_linkstatus, (t_or * orp, u16_t status));
-_PROTOTYPE (static int or_get_recvd_packet, (t_or *orp, u16_t rxfid,
- u8_t *databuf));
-_PROTOTYPE (static void or_reset, (void));
-_PROTOTYPE (static void or_watchdog_f, (timer_t *tp) );
-_PROTOTYPE (static void setup_wepkey, (t_or *orp, char *wepkey0) );
-_PROTOTYPE (static void do_hard_int, (void));
-_PROTOTYPE (static void check_int_events, (void));
-_PROTOTYPE (static void or_handler, (t_or *orp));
-_PROTOTYPE (static void or_dump, (message *m));
+static void or_writev_s(message * mp, int from_int);
+static void or_readv_s(message * mp, int from_int);
+static void reply(t_or * orp);
+static int or_probe(t_or *, int skip);
+static void or_ev_info(t_or *);
+static void or_init(message *);
+static void or_pci_conf(void);
+static void or_init_struct(t_or *);
+static void map_hw_buffer(t_or *);
+static void or_init_hw(t_or *);
+static void or_check_ints(t_or *);
+static void or_writerids(hermes_t *, t_or *);
+static void or_readrids(hermes_t *, t_or *);
+static void or_rec_mode(t_or *);
+static void mess_reply(message *, message *);
+static u32_t or_get_bar(int devind, t_or * orp);
+static void or_getstat_s(message * mp);
+static void print_linkstatus(t_or * orp, u16_t status);
+static int or_get_recvd_packet(t_or *orp, u16_t rxfid, u8_t *databuf);
+static void or_reset(void);
+static void or_watchdog_f(timer_t *tp);
+static void setup_wepkey(t_or *orp, char *wepkey0);
+static void do_hard_int(void);
+static void check_int_events(void);
+static void or_handler(t_or *orp);
+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 u32_t system_hz;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*****************************************************************************
* main *
PUBLIC struct pci_acl pci_acl[NR_DRIVERS];
-FORWARD _PROTOTYPE( void do_init, (message *mp) );
-FORWARD _PROTOTYPE( void do_first_dev, (message *mp) );
-FORWARD _PROTOTYPE( void do_next_dev, (message *mp) );
-FORWARD _PROTOTYPE( void do_find_dev, (message *mp) );
-FORWARD _PROTOTYPE( void do_ids, (message *mp) );
-FORWARD _PROTOTYPE( void do_dev_name_s, (message *mp) );
-FORWARD _PROTOTYPE( void do_slot_name_s, (message *mp) );
-FORWARD _PROTOTYPE( void do_set_acl, (message *mp) );
-FORWARD _PROTOTYPE( void do_del_acl, (message *mp) );
-FORWARD _PROTOTYPE( void do_reserve, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_r8, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_r16, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_r32, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_w8, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_w16, (message *mp) );
-FORWARD _PROTOTYPE( void do_attr_w32, (message *mp) );
-FORWARD _PROTOTYPE( void do_get_bar, (message *mp) );
-FORWARD _PROTOTYPE( void do_rescan_bus, (message *mp) );
-FORWARD _PROTOTYPE( void reply, (message *mp, int result) );
-FORWARD _PROTOTYPE( struct rs_pci *find_acl, (int endpoint) );
+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);
extern int debug;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
int main(void)
{
PRIVATE int nr_pcidev= 0;
-FORWARD _PROTOTYPE( void pci_intel_init, (void) );
-FORWARD _PROTOTYPE( void probe_bus, (int busind) );
-FORWARD _PROTOTYPE( int is_duplicate, (u8_t busnr, u8_t dev, u8_t func) );
-FORWARD _PROTOTYPE( void record_irq, (int devind) );
-FORWARD _PROTOTYPE( void record_bars_normal, (int devind) );
-FORWARD _PROTOTYPE( void record_bars_bridge, (int devind) );
-FORWARD _PROTOTYPE( void record_bars_cardbus, (int devind) );
-FORWARD _PROTOTYPE( void record_bars, (int devind, int last_reg) );
-FORWARD _PROTOTYPE( int record_bar, (int devind, int bar_nr, int last) );
-FORWARD _PROTOTYPE( void complete_bridges, (void) );
-FORWARD _PROTOTYPE( void complete_bars, (void) );
-FORWARD _PROTOTYPE( void update_bridge4dev_io, (int devind,
- u32_t io_base, u32_t io_size) );
-FORWARD _PROTOTYPE( int get_freebus, (void) );
-FORWARD _PROTOTYPE( int do_isabridge, (int busind) );
-FORWARD _PROTOTYPE( void do_pcibridge, (int busind) );
-FORWARD _PROTOTYPE( int get_busind, (int busnr) );
-FORWARD _PROTOTYPE( int do_piix, (int devind) );
-FORWARD _PROTOTYPE( int do_amd_isabr, (int devind) );
-FORWARD _PROTOTYPE( int do_sis_isabr, (int devind) );
-FORWARD _PROTOTYPE( int do_via_isabr, (int devind) );
+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
+ 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);
#if 0
-FORWARD _PROTOTYPE( void report_vga, (int devind) );
+FORWARD void report_vga(int devind);
#endif
-FORWARD _PROTOTYPE( char *pci_vid_name, (u16_t vid) );
-FORWARD _PROTOTYPE( char *pci_baseclass_name, (u8_t baseclass) );
-FORWARD _PROTOTYPE( char *pci_subclass_name, (u8_t baseclass,
- u8_t subclass, u8_t infclass) );
-FORWARD _PROTOTYPE( void ntostr, (unsigned n, char **str, char *end) );
-
-FORWARD _PROTOTYPE( u8_t pci_attr_r8_u, (int devind, int port) );
-FORWARD _PROTOTYPE( u32_t pci_attr_r32_u, (int devind, int port) );
-
-FORWARD _PROTOTYPE( u16_t pci_attr_rsts, (int devind) );
-FORWARD _PROTOTYPE( void pci_attr_wsts, (int devind, u16_t value) );
-FORWARD _PROTOTYPE( u16_t pcibr_std_rsts, (int busind) );
-FORWARD _PROTOTYPE( void pcibr_std_wsts, (int busind, u16_t value) );
-FORWARD _PROTOTYPE( u16_t pcibr_cb_rsts, (int busind) );
-FORWARD _PROTOTYPE( void pcibr_cb_wsts, (int busind, u16_t value) );
-FORWARD _PROTOTYPE( u16_t pcibr_via_rsts, (int busind) );
-FORWARD _PROTOTYPE( void pcibr_via_wsts, (int busind, u16_t value) );
-FORWARD _PROTOTYPE( u8_t pcii_rreg8, (int busind, int devind, int port) );
-FORWARD _PROTOTYPE( u16_t pcii_rreg16, (int busind, int devind,
- int port) );
-FORWARD _PROTOTYPE( u32_t pcii_rreg32, (int busind, int devind,
- int port) );
-FORWARD _PROTOTYPE( void pcii_wreg8, (int busind, int devind, int port,
- u8_t value) );
-FORWARD _PROTOTYPE( void pcii_wreg16, (int busind, int devind, int port,
- u16_t value) );
-FORWARD _PROTOTYPE( void pcii_wreg32, (int busind, int devind, int port,
- u32_t value) );
-FORWARD _PROTOTYPE( u16_t pcii_rsts, (int busind) );
-FORWARD _PROTOTYPE( void pcii_wsts, (int busind, u16_t value) );
-FORWARD _PROTOTYPE( void print_capabilities, (int devind) );
-FORWARD _PROTOTYPE( int visible, (struct rs_pci *aclp, int devind) );
-FORWARD _PROTOTYPE( void print_hyper_cap, (int devind, u8_t capptr) );
+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
+ 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;
#include <minix/rs.h>
/* tempory functions: to be replaced later (see pci_intel.h) */
-_PROTOTYPE( unsigned pci_inb, (u16_t port) );
-_PROTOTYPE( unsigned pci_inw, (u16_t port) );
-_PROTOTYPE( unsigned pci_inl, (u16_t port) );
+unsigned pci_inb(u16_t port);
+unsigned pci_inw(u16_t port);
+unsigned pci_inl(u16_t port);
-_PROTOTYPE( void pci_outb, (u16_t port, u8_t value) );
-_PROTOTYPE( void pci_outw, (u16_t port, u16_t value) );
-_PROTOTYPE( void pci_outl, (u16_t port, u32_t value) );
+void pci_outb(u16_t port, u8_t value);
+void pci_outw(u16_t port, u16_t value);
+void pci_outl(u16_t port, u32_t value);
struct pci_vendor
{
extern struct pci_pcibridge pci_pcibridge[];
/* Function prototypes. */
-_PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-_PROTOTYPE( int map_service, (struct rprocpub *rpub) );
-_PROTOTYPE( int pci_reserve_a, (int devind, endpoint_t proc,
- struct rs_pci *aclp) );
-_PROTOTYPE( void pci_release, (endpoint_t proc) );
-_PROTOTYPE( int pci_first_dev_a, (struct rs_pci *aclp, int *devindp,
- u16_t *vidp, u16_t *didp) );
-_PROTOTYPE( int pci_next_dev_a, (struct rs_pci *aclp, int *devindp,
- u16_t *vidp, u16_t *didp) );
-
-_PROTOTYPE( int pci_attr_r8_s, (int devind, int port, u8_t *vp) );
-_PROTOTYPE( int pci_attr_r32_s, (int devind, int port, u32_t *vp) );
-_PROTOTYPE( int pci_get_bar_s, (int devind, int port, u32_t *base,
- u32_t *size, int *ioflag) );
-_PROTOTYPE( int pci_slot_name_s, (int devind, char **cpp) );
-_PROTOTYPE( int pci_ids_s, (int devind, u16_t *vidp, u16_t *didp) );
+int sef_cb_init_fresh(int type, sef_init_info_t *info);
+int map_service(struct rprocpub *rpub);
+int pci_reserve_a(int devind, endpoint_t proc, struct rs_pci *aclp);
+void pci_release(endpoint_t proc);
+int pci_first_dev_a(struct rs_pci *aclp, int *devindp, u16_t *vidp,
+ u16_t *didp);
+int pci_next_dev_a(struct rs_pci *aclp, int *devindp, u16_t *vidp, u16_t
+ *didp);
+
+int pci_attr_r8_s(int devind, int port, u8_t *vp);
+int pci_attr_r32_s(int devind, int port, u32_t *vp);
+int pci_get_bar_s(int devind, int port, u32_t *base, u32_t *size, int
+ *ioflag);
+int pci_slot_name_s(int devind, char **cpp);
+int pci_ids_s(int devind, u16_t *vidp, u16_t *didp);
/*
* $PchId: pci.h,v 1.4 2001/12/06 20:21:22 philip Exp $
PUBLIC int writing; /* nonzero while write is in progress */
PRIVATE int irq_hook_id; /* id of irq hook at kernel */
-FORWARD _PROTOTYPE( void do_cancel, (message *m_ptr) );
-FORWARD _PROTOTYPE( void output_done, (void) );
-FORWARD _PROTOTYPE( void do_write, (message *m_ptr) );
-FORWARD _PROTOTYPE( void do_status, (message *m_ptr) );
-FORWARD _PROTOTYPE( void prepare_output, (void) );
-FORWARD _PROTOTYPE( int do_probe, (void) );
-FORWARD _PROTOTYPE( void do_initialize, (void) );
-FORWARD _PROTOTYPE( void reply, (int code,int replyee,int proc,int status));
-FORWARD _PROTOTYPE( void do_printer_output, (void) );
+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);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
+FORWARD void sef_local_startup(void);
+FORWARD 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;
/*===========================================================================*
extern int errno; /* error number for PM calls */
-FORWARD _PROTOTYPE( struct device *r_prepare, (dev_t device) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int r_do_open, (message *m_ptr) );
-FORWARD _PROTOTYPE( void r_random, (message *m_ptr) );
-FORWARD _PROTOTYPE( void r_updatebin, (int source,
- struct k_randomness_bin *rb) );
+FORWARD struct device *r_prepare(dev_t device);
+FORWARD 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);
/* Entry points to this driver. */
PRIVATE struct chardriver r_dtab = {
PRIVATE char random_buf[RANDOM_BUF_SIZE];
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
PRIVATE u32_t count_lo, count_hi;
PRIVATE u32_t reseed_count;
-FORWARD _PROTOTYPE( void add_sample, (int source, unsigned long sample) );
-FORWARD _PROTOTYPE( void data_block, (rd_keyinstance *keyp,
- void *data) );
-FORWARD _PROTOTYPE( void reseed, (void) );
+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()
{
#define RANDOM_SOURCES_INTERNAL 1
#define TOTAL_SOURCES (RANDOM_SOURCES+RANDOM_SOURCES_INTERNAL)
-_PROTOTYPE( void random_init, (void) );
-_PROTOTYPE( int random_isseeded, (void) );
-_PROTOTYPE( void random_update, (int source, rand_t *buf, int count) );
-_PROTOTYPE( void random_getbytes, (void *buf, size_t size) );
-_PROTOTYPE( void random_putbytes, (void *buf, size_t size) );
+void random_init(void);
+int random_isseeded(void);
+void random_update(int source, rand_t *buf, int count);
+void random_getbytes(void *buf, size_t size);
+void random_putbytes(void *buf, size_t size);
void usage(void);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
int main(int argc, char **argv)
{
#define rl_outw(port, offset, value) (my_outw((port) + (offset), (value)))
#define rl_outl(port, offset, value) (my_outl((port) + (offset), (value)))
-_PROTOTYPE( static void rl_init, (message *mp) );
-_PROTOTYPE( static void rl_pci_conf, (void) );
-_PROTOTYPE( static int rl_probe, (re_t *rep, int skip) );
-_PROTOTYPE( static void rl_conf_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_init_buf, (re_t *rep) );
-_PROTOTYPE( static void rl_init_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_reset_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_confaddr, (re_t *rep) );
-_PROTOTYPE( static void rl_rec_mode, (re_t *rep) );
-_PROTOTYPE( static void rl_readv_s, (const message *mp, int from_int) );
-_PROTOTYPE( static void rl_writev_s, (const message *mp, int from_int) );
-_PROTOTYPE( static void rl_check_ints, (re_t *rep) );
-_PROTOTYPE( static void rl_report_link, (re_t *rep) );
-_PROTOTYPE( static void mii_print_techab, (u16_t techab) );
-_PROTOTYPE( static void mii_print_stat_speed, (u16_t stat,
- u16_t extstat) );
-_PROTOTYPE( static void rl_clear_rx, (re_t *rep) );
-_PROTOTYPE( static void rl_do_reset, (re_t *rep) );
-_PROTOTYPE( static void rl_getstat_s, (message *mp) );
-_PROTOTYPE( static void reply, (re_t *rep) );
-_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
-_PROTOTYPE( static void check_int_events, (void) );
-_PROTOTYPE( static void do_hard_int, (void) );
-_PROTOTYPE( static void rtl8139_dump, (message *m) );
+static void rl_init(message *mp);
+static void rl_pci_conf(void);
+static int rl_probe(re_t *rep, int skip);
+static void rl_conf_hw(re_t *rep);
+static void rl_init_buf(re_t *rep);
+static void rl_init_hw(re_t *rep);
+static void rl_reset_hw(re_t *rep);
+static void rl_confaddr(re_t *rep);
+static void rl_rec_mode(re_t *rep);
+static void rl_readv_s(const message *mp, int from_int);
+static void rl_writev_s(const message *mp, int from_int);
+static void rl_check_ints(re_t *rep);
+static void rl_report_link(re_t *rep);
+static void mii_print_techab(u16_t techab);
+static void mii_print_stat_speed(u16_t stat, u16_t extstat);
+static void rl_clear_rx(re_t *rep);
+static void rl_do_reset(re_t *rep);
+static void rl_getstat_s(message *mp);
+static void reply(re_t *rep);
+static void mess_reply(message *req, message *reply);
+static void check_int_events(void);
+static void do_hard_int(void);
+static void rtl8139_dump(message *m);
#if 0
-_PROTOTYPE( static void dump_phy, (re_t *rep) );
+static void dump_phy(re_t *rep);
#endif
-_PROTOTYPE( static int rl_handler, (re_t *rep) );
-_PROTOTYPE( static void rl_watchdog_f, (timer_t *tp) );
-_PROTOTYPE( static void tell_dev, (vir_bytes start, size_t size,
- int pci_bus, int pci_dev, int pci_func) );
+static int rl_handler(re_t *rep);
+static void rl_watchdog_f(timer_t *tp);
+static void tell_dev(vir_bytes start, size_t size, int pci_bus, int
+ pci_dev, int pci_func);
/* 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 u32_t system_hz;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
+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);
+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);
/*===========================================================================*
* main *
#if 0
-_PROTOTYPE( static void rtl_init, (struct dpeth *dep) );
-_PROTOTYPE( static u16_t get_ee_word, (dpeth_t *dep, int a) );
-_PROTOTYPE( static void ee_wen, (dpeth_t *dep) );
-_PROTOTYPE( static void set_ee_word, (dpeth_t *dep, int a, u16_t w) );
-_PROTOTYPE( static void ee_wds, (dpeth_t *dep) );
+static void rtl_init(struct dpeth *dep);
+static u16_t get_ee_word(dpeth_t *dep, int a);
+static void ee_wen(dpeth_t *dep);
+static void set_ee_word(dpeth_t *dep, int a, u16_t w);
+static void ee_wds(dpeth_t *dep);
static void rtl_init(dep)
dpeth_t *dep;
#define rl_outw(port, offset, value) (my_outw((port) + (offset), (value)))
#define rl_outl(port, offset, value) (my_outl((port) + (offset), (value)))
-_PROTOTYPE( static void rl_init, (message *mp) );
-_PROTOTYPE( static void rl_pci_conf, (void) );
-_PROTOTYPE( static int rl_probe, (re_t *rep, int skip) );
-_PROTOTYPE( static void rl_conf_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_init_buf, (re_t *rep) );
-_PROTOTYPE( static void rl_init_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_reset_hw, (re_t *rep) );
-_PROTOTYPE( static void rl_confaddr, (re_t *rep) );
-_PROTOTYPE( static void rl_rec_mode, (re_t *rep) );
-_PROTOTYPE( static void rl_readv_s, (const message *mp, int from_int) );
-_PROTOTYPE( static void rl_writev_s, (const message *mp, int from_int) );
-_PROTOTYPE( static void rl_check_ints, (re_t *rep) );
-_PROTOTYPE( static void rl_report_link, (re_t *rep) );
-_PROTOTYPE( static void rl_do_reset, (re_t *rep) );
-_PROTOTYPE( static void rl_getstat_s, (message *mp) );
-_PROTOTYPE( static void reply, (re_t *rep) );
-_PROTOTYPE( static void mess_reply, (message *req, message *reply) );
-_PROTOTYPE( static void check_int_events, (void) );
-_PROTOTYPE( static void do_hard_int, (void) );
-_PROTOTYPE( static void dump_phy, (const re_t *rep) );
-_PROTOTYPE( static void rl_handler, (re_t *rep) );
-_PROTOTYPE( static void rl_watchdog_f, (timer_t *tp) );
+static void rl_init(message *mp);
+static void rl_pci_conf(void);
+static int rl_probe(re_t *rep, int skip);
+static void rl_conf_hw(re_t *rep);
+static void rl_init_buf(re_t *rep);
+static void rl_init_hw(re_t *rep);
+static void rl_reset_hw(re_t *rep);
+static void rl_confaddr(re_t *rep);
+static void rl_rec_mode(re_t *rep);
+static void rl_readv_s(const message *mp, int from_int);
+static void rl_writev_s(const message *mp, int from_int);
+static void rl_check_ints(re_t *rep);
+static void rl_report_link(re_t *rep);
+static void rl_do_reset(re_t *rep);
+static void rl_getstat_s(message *mp);
+static void reply(re_t *rep);
+static void mess_reply(message *req, message *reply);
+static void check_int_events(void);
+static void do_hard_int(void);
+static void dump_phy(const re_t *rep);
+static void rl_handler(re_t *rep);
+static void rl_watchdog_f(timer_t *tp);
/*
* The message used in the main loop is made global, so that rl_watchdog_f()
u32_t system_hz;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
PRIVATE int instance;
PRIVATE int debug;
-FORWARD _PROTOTYPE( int hw_probe, (int skip) );
-FORWARD _PROTOTYPE( void hw_init, (struct port *pp, int devind) );
-FORWARD _PROTOTYPE( void do_int, (struct port *pp) );
+FORWARD int hw_probe(int skip);
+FORWARD void hw_init(struct port *pp, int devind);
+FORWARD void do_int(struct port *pp);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
/*===========================================================================*
* main *
unsigned char value;
};
-FORWARD _PROTOTYPE( int cons_write, (struct tty *tp, int try) );
-FORWARD _PROTOTYPE( void cons_echo, (tty_t *tp, int c) );
-FORWARD _PROTOTYPE( void out_char, (console_t *cons, int c) );
-FORWARD _PROTOTYPE( void cons_putk, (int c) );
-FORWARD _PROTOTYPE( void beep, (void) );
-FORWARD _PROTOTYPE( void do_escape, (console_t *cons, int c) );
-FORWARD _PROTOTYPE( void flush, (console_t *cons) );
-FORWARD _PROTOTYPE( void parse_escape, (console_t *cons, int c) );
-FORWARD _PROTOTYPE( void scroll_screen, (console_t *cons, int dir) );
-FORWARD _PROTOTYPE( void set_6845, (int reg, unsigned val) );
-FORWARD _PROTOTYPE( void stop_beep, (timer_t *tmrp) );
-FORWARD _PROTOTYPE( void cons_org0, (void) );
-FORWARD _PROTOTYPE( void disable_console, (void) );
-FORWARD _PROTOTYPE( void reenable_console, (void) );
-FORWARD _PROTOTYPE( int ga_program, (struct sequence *seq) );
-FORWARD _PROTOTYPE( int cons_ioctl, (tty_t *tp, int) );
-FORWARD _PROTOTYPE( void mem_vid_copy, (vir_bytes src, int dst, int count) );
-FORWARD _PROTOTYPE( void vid_vid_copy, (int src, int dst, int count) );
+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);
#if 0
-FORWARD _PROTOTYPE( void get_6845, (int reg, unsigned *val) );
+FORWARD void get_6845(int reg, unsigned *val);
#endif
/*===========================================================================*
PRIVATE long debug_fkeys = 1;
PRIVATE timer_t tmr_kbd_wd;
-FORWARD _PROTOTYPE( void handle_req, (struct kbd *kbdp, message *m) );
-FORWARD _PROTOTYPE( int handle_status, (struct kbd *kbdp, message *m) );
-FORWARD _PROTOTYPE( void kbc_cmd0, (int cmd) );
-FORWARD _PROTOTYPE( void kbc_cmd1, (int cmd, int data) );
-FORWARD _PROTOTYPE( int kbc_read, (void) );
-FORWARD _PROTOTYPE( void kbd_send, (void) );
-FORWARD _PROTOTYPE( int kb_ack, (void) );
-FORWARD _PROTOTYPE( int kb_wait, (void) );
-FORWARD _PROTOTYPE( int func_key, (int scode) );
-FORWARD _PROTOTYPE( int scan_keyboard, (unsigned char *bp, int *isauxp) );
-FORWARD _PROTOTYPE( unsigned make_break, (int scode) );
-FORWARD _PROTOTYPE( void set_leds, (void) );
-FORWARD _PROTOTYPE( void show_key_mappings, (void) );
-FORWARD _PROTOTYPE( int kb_read, (struct tty *tp, int try) );
-FORWARD _PROTOTYPE( unsigned map_key, (int scode) );
-FORWARD _PROTOTYPE( void kbd_watchdog, (timer_t *tmrp) );
+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);
int micro_delay(u32_t usecs)
{
PRIVATE pty_t pty_table[NR_PTYS]; /* PTY bookkeeping */
-FORWARD _PROTOTYPE( int pty_write, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( void pty_echo, (tty_t *tp, int c) );
-FORWARD _PROTOTYPE( void pty_start, (pty_t *pp) );
-FORWARD _PROTOTYPE( void pty_finish, (pty_t *pp) );
-FORWARD _PROTOTYPE( int pty_read, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int pty_close, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int pty_icancel, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int pty_ocancel, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int pty_select, (tty_t *tp, message *m) );
+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);
/*===========================================================================*
* do_pty *
};
#endif
-FORWARD _PROTOTYPE( void in_int, (rs232_t *rs) );
-FORWARD _PROTOTYPE( void line_int, (rs232_t *rs) );
-FORWARD _PROTOTYPE( void modem_int, (rs232_t *rs) );
-FORWARD _PROTOTYPE( int rs_write, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( void rs_echo, (tty_t *tp, int c) );
-FORWARD _PROTOTYPE( int rs_ioctl, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( void rs_config, (rs232_t *rs) );
-FORWARD _PROTOTYPE( int rs_read, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int rs_icancel, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int rs_ocancel, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( void rs_ostart, (rs232_t *rs) );
-FORWARD _PROTOTYPE( int rs_break, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( int rs_close, (tty_t *tp, int try) );
-FORWARD _PROTOTYPE( void out_int, (rs232_t *rs) );
-FORWARD _PROTOTYPE( void rs232_handler, (rs232_t *rs) );
+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);
/* XXX */
PRIVATE void lock(void) {}
struct kmessages kmess;
-FORWARD _PROTOTYPE( void tty_timed_out, (timer_t *tp) );
-FORWARD _PROTOTYPE( void settimer, (tty_t *tty_ptr, int enable) );
-FORWARD _PROTOTYPE( void do_cancel, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_ioctl, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_open, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_close, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_read, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_write, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_select, (tty_t *tp, message *m_ptr) );
-FORWARD _PROTOTYPE( void do_status, (message *m_ptr) );
-FORWARD _PROTOTYPE( void in_transfer, (tty_t *tp) );
-FORWARD _PROTOTYPE( int tty_echo, (tty_t *tp, int ch) );
-FORWARD _PROTOTYPE( void rawecho, (tty_t *tp, int ch) );
-FORWARD _PROTOTYPE( int back_over, (tty_t *tp) );
-FORWARD _PROTOTYPE( void reprint, (tty_t *tp) );
-FORWARD _PROTOTYPE( void dev_ioctl, (tty_t *tp) );
-FORWARD _PROTOTYPE( void setattr, (tty_t *tp) );
-FORWARD _PROTOTYPE( void tty_icancel, (tty_t *tp) );
-FORWARD _PROTOTYPE( void tty_init, (void) );
+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);
/* Default attributes. */
PRIVATE struct termios termios_defaults = {
PUBLIC u32_t system_hz;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* tty_task *
#define O_NONBLOCK 04000
struct tty;
-typedef _PROTOTYPE( int (*devfun_t), (struct tty *tp, int try_only) );
-typedef _PROTOTYPE( void (*devfunarg_t), (struct tty *tp, int c) );
+typedef int(*devfun_t) (struct tty *tp, int try_only);
+typedef void(*devfunarg_t) (struct tty *tp, int c);
typedef struct tty {
int tty_events; /* set when TTY should inspect this line */
/* Function prototypes for TTY driver. */
/* tty.c */
-_PROTOTYPE( void handle_events, (struct tty *tp) );
-_PROTOTYPE( void sigchar, (struct tty *tp, int sig, int mayflush) );
-_PROTOTYPE( void tty_task, (void) );
-_PROTOTYPE( int in_process, (struct tty *tp, char *buf, int count,
- int scode) );
-_PROTOTYPE( void out_process, (struct tty *tp, char *bstart, char *bpos,
- char *bend, int *icount, int *ocount) );
-_PROTOTYPE( void tty_wakeup, (clock_t now) );
+void handle_events(struct tty *tp);
+void sigchar(struct tty *tp, int sig, int mayflush);
+void tty_task(void);
+int in_process(struct tty *tp, char *buf, int count, int scode);
+void out_process(struct tty *tp, char *bstart, char *bpos, char *bend,
+ int *icount, int *ocount);
+void tty_wakeup(clock_t now);
#define tty_reply(c, r, p, s) tty_reply_f(__FILE__, __LINE__, (c), (r), (p), (s))
-_PROTOTYPE( void tty_reply_f, (char *f, int l, int code, int replyee, int proc_nr,
- int status) );
-_PROTOTYPE( int select_try, (struct tty *tp, int ops) );
-_PROTOTYPE( int select_retry, (struct tty *tp) );
+void tty_reply_f(char *f, int l, int code, int replyee, int proc_nr, int
+ status);
+int select_try(struct tty *tp, int ops);
+int select_retry(struct tty *tp);
/* rs232.c */
-_PROTOTYPE( void rs_init, (struct tty *tp) );
-_PROTOTYPE( void rs_interrupt, (message *m) );
+void rs_init(struct tty *tp);
+void rs_interrupt(message *m);
#if (CHIP == INTEL)
/* console.c */
-_PROTOTYPE( void kputc, (int c) );
-_PROTOTYPE( void cons_stop, (void) );
-_PROTOTYPE( void do_new_kmess, (void) );
-_PROTOTYPE( void scr_init, (struct tty *tp) );
-_PROTOTYPE( void toggle_scroll, (void) );
-_PROTOTYPE( int con_loadfont, (message *m) );
-_PROTOTYPE( void select_console, (int cons_line) );
-_PROTOTYPE( void beep_x, ( unsigned freq, clock_t dur) );
-_PROTOTYPE( void do_video, (message *m) );
+void kputc(int c);
+void cons_stop(void);
+void do_new_kmess(void);
+void scr_init(struct tty *tp);
+void toggle_scroll(void);
+int con_loadfont(message *m);
+void select_console(int cons_line);
+void beep_x( unsigned freq, clock_t dur);
+void do_video(message *m);
/* keyboard.c */
-_PROTOTYPE( void kb_init, (struct tty *tp) );
-_PROTOTYPE( void kb_init_once, (void) );
-_PROTOTYPE( int kbd_loadmap, (message *m) );
-_PROTOTYPE( void do_fkey_ctl, (message *m) );
-_PROTOTYPE( void kbd_interrupt, (message *m) );
-_PROTOTYPE( void do_kbd, (message *m) );
-_PROTOTYPE( void do_kb_inject, (message *m) );
-_PROTOTYPE( void do_kbdaux, (message *m) );
-_PROTOTYPE( int kbd_status, (message *m_ptr) );
+void kb_init(struct tty *tp);
+void kb_init_once(void);
+int kbd_loadmap(message *m);
+void do_fkey_ctl(message *m);
+void kbd_interrupt(message *m);
+void do_kbd(message *m);
+void do_kb_inject(message *m);
+void do_kbdaux(message *m);
+int kbd_status(message *m_ptr);
/* pty.c */
-_PROTOTYPE( void do_pty, (struct tty *tp, message *m_ptr) );
-_PROTOTYPE( void pty_init, (struct tty *tp) );
-_PROTOTYPE( void select_retry_pty, (struct tty *tp) );
-_PROTOTYPE( int pty_status, (message *m_ptr) );
+void do_pty(struct tty *tp, message *m_ptr);
+void pty_init(struct tty *tp);
+void select_retry_pty(struct tty *tp);
+int pty_status(message *m_ptr);
#endif /* (CHIP == INTEL) */
typedef struct ddekit_condvar ddekit_condvar_t;
/* Initialize conditional variable. */
-_PROTOTYPE( ddekit_condvar_t * ddekit_condvar_init, (void));
+ddekit_condvar_t * ddekit_condvar_init(void);
/* Uninitialize conditional variable. */
-_PROTOTYPE( void ddekit_condvar_deinit, (ddekit_condvar_t *cvp));
+void ddekit_condvar_deinit(ddekit_condvar_t *cvp);
/* Wait on a conditional variable. */
-_PROTOTYPE( void ddekit_condvar_waiti, (ddekit_condvar_t *cvp,
- ddekit_lock_t *mp));
+void ddekit_condvar_waiti(ddekit_condvar_t *cvp, ddekit_lock_t *mp);
/* Wait on a conditional variable at most until a timeout expires. (UNIMPL) */
-_PROTOTYPE( int ddekit_condvar_wait_timed, (ddekit_condvar_t *cvp,
- ddekit_lock_t *mp, int timo));
+int ddekit_condvar_wait_timed(ddekit_condvar_t *cvp, ddekit_lock_t *mp,
+ int timo);
/* Send signal to the next one waiting for condvar. */
-_PROTOTYPE( void ddekit_condvar_signal, (ddekit_condvar_t *cvp));
+void ddekit_condvar_signal(ddekit_condvar_t *cvp);
/* Send signal to all threads waiting for condvar. */
-_PROTOTYPE( void ddekit_condvar_broadcast, (ddekit_condvar_t *cvp));
+void ddekit_condvar_broadcast(ddekit_condvar_t *cvp);
#endif
#ifndef _DDEKIT_DDEKIT_H
#define _DDEKIT_DDEKIT_H
#include <minix/ansi.h>
-_PROTOTYPE( void ddekit_init, (void) );
+void ddekit_init(void);
#endif
__ddekit_add_initcall(&dis); }
/* Runs all registered initcalls. */
-_PROTOTYPE (void ddekit_do_initcalls, (void));
+void ddekit_do_initcalls(void);
#endif
#include <ddekit/thread.h>
/** Attach to an interrupt */
-_PROTOTYPE( ddekit_thread_t *ddekit_interrupt_attach,
- ( int irq, int shared, void(*thread_init)(void *),
- void(*handler)(void *), void *priv) );
+ddekit_thread_t *ddekit_interrupt_attach( int irq, int shared,
+ void(*thread_init)(void *), void(*handler)(void *), void *priv);
/* Detach from a previously attached interrupt. */
-_PROTOTYPE( void ddekit_interrupt_detach, (int irq));
+void ddekit_interrupt_detach(int irq);
/* Block interrupt. */
-_PROTOTYPE( void ddekit_interrupt_disable, (int irq));
+void ddekit_interrupt_disable(int irq);
/* Enable interrupt */
-_PROTOTYPE( void ddekit_interrupt_enable, (int irq));
+void ddekit_interrupt_enable(int irq);
#endif
#define ddekit_lock_init ddekit_lock_init_unlocked
/* Initialize a DDEKit unlocked lock. */
-_PROTOTYPE( void ddekit_lock_init_unlocked, (ddekit_lock_t *mtx));
+void ddekit_lock_init_unlocked(ddekit_lock_t *mtx);
/* Initialize a DDEKit locked lock. */
-_PROTOTYPE( void ddekit_lock_init_locked, (ddekit_lock_t *mtx));
+void ddekit_lock_init_locked(ddekit_lock_t *mtx);
/* Uninitialize a DDEKit lock. */
-_PROTOTYPE( void ddekit_lock_deinit, (ddekit_lock_t *mtx));
+void ddekit_lock_deinit(ddekit_lock_t *mtx);
/* Acquire a lock. */
-_PROTOTYPE( void ddekit_lock_lock, (ddekit_lock_t *mtx));
+void ddekit_lock_lock(ddekit_lock_t *mtx);
/* Acquire a lock, non-blocking. */
-_PROTOTYPE( int ddekit_lock_try_lock, (ddekit_lock_t *mtx));
+int ddekit_lock_try_lock(ddekit_lock_t *mtx);
/* Unlock function. */
-_PROTOTYPE( void ddekit_lock_unlock, (ddekit_lock_t *mtx));
+void ddekit_lock_unlock(ddekit_lock_t *mtx);
/* Get lock owner. */
-_PROTOTYPE( int ddekit_lock_owner, (ddekit_lock_t *mtx));
+int ddekit_lock_owner(ddekit_lock_t *mtx);
#endif
struct ddekit_slab;
/* Store user pointer in slab cache */
-_PROTOTYPE( void ddekit_slab_set_data, (struct ddekit_slab * slab,
- void *data));
+void ddekit_slab_set_data(struct ddekit_slab * slab, void *data);
/* Read user pointer from slab cache */
-_PROTOTYPE( void *ddekit_slab_get_data,(struct ddekit_slab * slab));
+void *ddekit_slab_get_data(struct ddekit_slab * slab);
/* Allocate slab in slab cache */
-_PROTOTYPE( void *ddekit_slab_alloc, (struct ddekit_slab * slab));
+void *ddekit_slab_alloc(struct ddekit_slab * slab);
/* Allocate slab in slab cache */
-_PROTOTYPE( void ddekit_slab_free, (struct ddekit_slab * slab, void *objp));
+void ddekit_slab_free(struct ddekit_slab * slab, void *objp);
/*
* Setup page cache for all slabs
* will be freed at the memory server. This page cache caches pages from all
* slabs.
*/
-_PROTOTYPE( void ddekit_slab_setup_page_cache, (unsigned pages));
+void ddekit_slab_setup_page_cache(unsigned pages);
/*
* Destroy slab cache
*
* slab: pointer to slab cache structure
*/
-_PROTOTYPE( void ddekit_slab_destroy, (struct ddekit_slab * slab));
+void ddekit_slab_destroy(struct ddekit_slab * slab);
/**
* Initialize slab cache
*
* \return pointer to new slab cache or 0 on error
*/
-_PROTOTYPE( struct ddekit_slab * ddekit_slab_init,(unsigned size, int contiguous));
+struct ddekit_slab * ddekit_slab_init(unsigned size, int contiguous);
/**********************
* Allocated blocks have valid virt->phys mappings and are physically
* contiguous.
*/
-_PROTOTYPE( void *ddekit_large_malloc, (int size));
+void *ddekit_large_malloc(int size);
/**
* Free large memory block
*
* \param p pointer to memory block
*/
-_PROTOTYPE( void ddekit_large_free, (void *p));
+void ddekit_large_free(void *p);
/** FIXME
* contig_malloc() is the lowest-level allocator interface one could implement.
* we should consider to provide vmalloc() too. */
-_PROTOTYPE( void *ddekit_contig_malloc,
- (unsigned long size, unsigned long low,
- unsigned long high, unsigned long alignment,
- unsigned long boundary));
+void *ddekit_contig_malloc(unsigned long size, unsigned long low,
+ unsigned long high, unsigned long alignment, unsigned long boundary);
/*****************************
* The blocks allocated via this allocator CANNOT be used for DMA or other
* device operations, i.e., there exists no virt->phys mapping.
*/
-_PROTOTYPE( void *ddekit_simple_malloc, (unsigned size));
+void *ddekit_simple_malloc(unsigned size);
/**
* Free memory block via simple allocator
*
* \param p pointer to memory block
*/
-_PROTOTYPE( void ddekit_simple_free, (void *p));
+void ddekit_simple_free(void *p);
#endif
struct ddekit_minix_msg_q;
-_PROTOTYPE( void ddekit_minix_queue_msg, (message *m));
+void ddekit_minix_queue_msg(message *m);
-_PROTOTYPE( void ddekit_minix_rcv,
- (struct ddekit_minix_msg_q * mq, message *m));
+void ddekit_minix_rcv(struct ddekit_minix_msg_q * mq, message *m);
-_PROTOTYPE( struct ddekit_minix_msg_q *ddekit_minix_create_msg_q,
- (unsigned from, unsigned to));
+struct ddekit_minix_msg_q *ddekit_minix_create_msg_q(unsigned from,
+ unsigned to);
-_PROTOTYPE( void ddekit_minix_destroy_msg_q,
- (struct ddekit_minix_msg_q *mq));
+void ddekit_minix_destroy_msg_q(struct ddekit_minix_msg_q *mq);
#endif /* DDEKIT_SRC_MSG_QUEUE_H */
/** Panic - print error message and enter the kernel debugger.
* \ingroup DDEKit_util
*/
-_PROTOTYPE (void ddekit_panic, (char *fmt, ...));
+void ddekit_panic(char *fmt, ...);
/** Print a debug message.
* \ingroup DDEKit_util
*/
-_PROTOTYPE (void ddekit_debug, (char *fmt, ...));
+void ddekit_debug(char *fmt, ...);
#endif
unsigned long flags;
} ddekit_pci_res_t;
-_PROTOTYPE( void ddekit_pci_init, (void));
+void ddekit_pci_init(void);
-_PROTOTYPE( int ddekit_pci_get_device,(int nr, int *bus,
- int *slot, int *func));
+int ddekit_pci_get_device(int nr, int *bus, int *slot, int *func);
-_PROTOTYPE( int ddekit_pci_read, (int bus, int slot, int func,
- int pos, int len, ddekit_uint32_t *val));
-_PROTOTYPE( int ddekit_pci_write, (int bus, int slot, int func,
- int pos, int len, ddekit_uint32_t val));
+int ddekit_pci_read(int bus, int slot, int func, int pos, int len,
+ ddekit_uint32_t *val);
+int ddekit_pci_write(int bus, int slot, int func, int pos, int len,
+ ddekit_uint32_t val);
/** Read byte from PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( 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);
/** Read word from PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( int ddekit_pci_readw, (int bus, int slot,
- int func, int pos, ddekit_uint16_t *val));
+int ddekit_pci_readw(int bus, int slot, int func, int pos,
+ ddekit_uint16_t *val);
/** Read dword from PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( int ddekit_pci_readl, (int bus, int slot,
- int func, int pos, ddekit_uint32_t *val));
+int ddekit_pci_readl(int bus, int slot, int func, int pos,
+ ddekit_uint32_t *val);
/** Write byte to PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( int ddekit_pci_writeb, (int bus, int slot,
- int func, int pos, ddekit_uint8_t val));
+int ddekit_pci_writeb(int bus, int slot, int func, int pos,
+ ddekit_uint8_t val);
/** Write word to PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( int ddekit_pci_writew, (int bus, int slot,
- int func, int pos, ddekit_uint16_t val));
+int ddekit_pci_writew(int bus, int slot, int func, int pos,
+ ddekit_uint16_t val);
/** Write word to PCI config space.
*
*
* \return 0 success
*/
-_PROTOTYPE( int ddekit_pci_writel, (int bus, int slot,
- int func, int pos, ddekit_uint32_t val));
+int ddekit_pci_writel(int bus, int slot, int func, int pos,
+ ddekit_uint32_t val);
/** Find a PCI device.
*
* \return device a valid PCI device
* \return NULL if no device found
*/
-_PROTOTYPE( struct ddekit_pci_dev * ddekit_pci_find_device,
- (int *bus, int *slot, int *func, struct ddekit_pci_dev *start));
+struct ddekit_pci_dev * ddekit_pci_find_device(int *bus, int *slot, int
+ *func, struct ddekit_pci_dev *start);
/** Enable PCI device
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( int ddekit_pci_enable_device, (struct ddekit_pci_dev *dev));
+int ddekit_pci_enable_device(struct ddekit_pci_dev *dev);
/** Disable PCI device
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( int ddekit_pci_disable_device, (struct ddekit_pci_dev *dev));
+int ddekit_pci_disable_device(struct ddekit_pci_dev *dev);
/** Enable bus-mastering for device.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( void ddekit_pci_set_master, (struct ddekit_pci_dev *dev));
+void ddekit_pci_set_master(struct ddekit_pci_dev *dev);
/** Get device vendor ID.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned short ddekit_pci_get_vendor,
- (struct ddekit_pci_dev *dev));
+unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev);
/** Get device ID.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned short ddekit_pci_get_device_id,
- (struct ddekit_pci_dev *dev));
+unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev);
/** Get device subvendor ID.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned short ddekit_pci_get_sub_vendor,
- (struct ddekit_pci_dev *dev));
+unsigned short ddekit_pci_get_sub_vendor(struct ddekit_pci_dev *dev);
/** Get subdevice ID.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned short ddekit_pci_get_sub_device,
- (struct ddekit_pci_dev *dev));
+unsigned short ddekit_pci_get_sub_device(struct ddekit_pci_dev *dev);
/** Get device class ID.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned ddekit_pci_get_dev_class,
- (struct ddekit_pci_dev *dev));
+unsigned ddekit_pci_get_dev_class(struct ddekit_pci_dev *dev);
/** Get device's IRQ number.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( unsigned long ddekit_pci_get_irq,
- (struct ddekit_pci_dev *dev));
+unsigned long ddekit_pci_get_irq(struct ddekit_pci_dev *dev);
/** Get device name.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( char *ddekit_pci_get_name, (struct ddekit_pci_dev *dev));
+char *ddekit_pci_get_name(struct ddekit_pci_dev *dev);
/** Get device's slot name.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( char *ddekit_pci_get_slot_name, (struct ddekit_pci_dev *dev));
+char *ddekit_pci_get_slot_name(struct ddekit_pci_dev *dev);
/** Get one of the device's resources.
* \ingroup DDEKit_pci
*/
-_PROTOTYPE( ddekit_pci_res_t *ddekit_pci_get_resource,
- (struct ddekit_pci_dev *dev, unsigned int idx));
+ddekit_pci_res_t *ddekit_pci_get_resource(struct ddekit_pci_dev *dev,
+ unsigned int idx);
-_PROTOTYPE( int ddekit_pci_irq_enable, (int bus, int slot,
- int func, int pin, int *irq));
+int ddekit_pci_irq_enable(int bus, int slot, int func, int pin, int
+ *irq);
#endif
* \param pages number of pages in region
* \param type pgtab type for region
*/
-_PROTOTYPE( 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);
/**
* with the underlying mechanism and therefore can use this function that takes care
* of translating a size to an amount of pages.
*/
-_PROTOTYPE( 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);
/**
* \param virt virtual start address for region
* \param type pgtab type for region
*/
-_PROTOTYPE( void ddekit_pgtab_clear_region,
- (void *virt, int type));
+void ddekit_pgtab_clear_region(void *virt, int type);
/**
* Get physical address for virtual address
*
* \return physical address
*/
-_PROTOTYPE( ddekit_addr_t ddekit_pgtab_get_physaddr, (const void *virt));
+ddekit_addr_t ddekit_pgtab_get_physaddr(const void *virt);
/**
* Get virtual address for physical address
*
* \return virtual address
*/
-_PROTOTYPE( ddekit_addr_t ddekit_pgtab_get_virtaddr,
- (const ddekit_addr_t physical));
+ddekit_addr_t ddekit_pgtab_get_virtaddr(const ddekit_addr_t physical);
/**
* Get type of VM region.
* \return VM region type
*/
-_PROTOTYPE( int ddekit_pgtab_get_type, (const void *virt));
+int ddekit_pgtab_get_type(const void *virt);
/**
* Get size of VM region.
*
* \return VM region size (in bytes)
*/
-_PROTOTYPE( int ddekit_pgtab_get_size, (const void *virt));
+int ddekit_pgtab_get_size(const void *virt);
#endif
/** Print message.
* \ingroup DDEKit_util
*/
-_PROTOTYPE( int ddekit_print,(const char *));
+int ddekit_print(const char *);
/** Print message with format.
* \ingroup DDEKit_util
*/
-_PROTOTYPE( int ddekit_printf,(const char *fmt, ...));
+int ddekit_printf(const char *fmt, ...);
/** Print message with format list.
* \ingroup DDEKit_util
*/
-_PROTOTYPE( int ddekit_vprintf, (const char *fmt, va_list va));
+int ddekit_vprintf(const char *fmt, va_list va);
/** Log function and message.
* \ingroup DDEKit_util
* request/release an isa DMA-channel
*/
-_PROTOTYPE( int ddekit_request_dma, (int nr));
-_PROTOTYPE( int ddekit_release_dma, (int nr));
+int ddekit_request_dma(int nr);
+int ddekit_release_dma(int nr);
/*
* request/release an io-port range starting at addr start, lenght of count
*/
-_PROTOTYPE( int ddekit_request_io, (ddekit_addr_t start, ddekit_addr_t count));
-_PROTOTYPE( int ddekit_release_io, (ddekit_addr_t start, ddekit_addr_t count));
+int ddekit_request_io(ddekit_addr_t start, ddekit_addr_t count);
+int ddekit_release_io(ddekit_addr_t start, ddekit_addr_t count);
/*
* request an IO-Memory mapping from address start to vaddr of the length count
*/
-_PROTOTYPE( int ddekit_request_mem,
- (ddekit_addr_t start, ddekit_addr_t count, ddekit_addr_t *vaddr));
-_PROTOTYPE( int ddekit_release_mem, (ddekit_addr_t start, ddekit_addr_t count));
+int ddekit_request_mem(ddekit_addr_t start, ddekit_addr_t count,
+ ddekit_addr_t *vaddr);
+int ddekit_release_mem(ddekit_addr_t start, ddekit_addr_t count);
/**
* Read I/O port (byte)
*
* \return value read from port
*/
-_PROTOTYPE( unsigned char dde_kit_inb, (ddekit_addr_t port));
+unsigned char dde_kit_inb(ddekit_addr_t port);
/**
* Read I/O port (2-byte)
*
* \return value read from port
*/
-_PROTOTYPE( unsigned short dde_kit_inw, (ddekit_addr_t port));
+unsigned short dde_kit_inw(ddekit_addr_t port);
/**
* Read I/O port (4-byte)
*
* \return value read from port
*/
-_PROTOTYPE( unsigned long dde_kit_inl, (ddekit_addr_t port));
+unsigned long dde_kit_inl(ddekit_addr_t port);
/**
* Write I/O port (byte)
* \param port port to write
* \param val value to write
*/
-_PROTOTYPE( void dde_kit_outb, (ddekit_addr_t port, unsigned char val));
+void dde_kit_outb(ddekit_addr_t port, unsigned char val);
/**
* Write I/O port (2-byte)
* \param port port to write
* \param val value to write
*/
-_PROTOTYPE( void dde_kit_outw, (ddekit_addr_t port, unsigned short val));
+void dde_kit_outw(ddekit_addr_t port, unsigned short val);
/**
* Write I/O port (4-byte)
* \param port port to write
* \param val value to write
*/
-_PROTOTYPE( void dde_kit_outl, (ddekit_addr_t port, unsigned long val));
+void dde_kit_outl(ddekit_addr_t port, unsigned long val);
#endif
*
* \param value initial semaphore counter
*/
-_PROTOTYPE( ddekit_sem_t *ddekit_sem_init, (int value));
+ddekit_sem_t *ddekit_sem_init(int value);
/** Uninitialize semaphore.
*
* \ingroup DDEKit_synchronization
*/
-_PROTOTYPE( void ddekit_sem_deinit, (ddekit_sem_t *sem));
+void ddekit_sem_deinit(ddekit_sem_t *sem);
/** Semaphore down method. */
-_PROTOTYPE( void ddekit_sem_down, (ddekit_sem_t *sem));
+void ddekit_sem_down(ddekit_sem_t *sem);
/** Semaphore down method, non-blocking.
*
* \return 0 success
* \return !=0 would block
*/
-_PROTOTYPE( int ddekit_sem_down_try, (ddekit_sem_t *sem));
+int ddekit_sem_down_try(ddekit_sem_t *sem);
/** Semaphore down with timeout.
*
* \return 0 success
* \return !=0 would block
*/
-_PROTOTYPE( int ddekit_sem_down_timed, (ddekit_sem_t *sem, int timo));
+int ddekit_sem_down_timed(ddekit_sem_t *sem, int timo);
/** Semaphore up method.
*
* \ingroup DDEKit_synchronization
*/
-_PROTOTYPE( void ddekit_sem_up, (ddekit_sem_t *sem));
+void ddekit_sem_up(ddekit_sem_t *sem);
#endif
* \param arg optional argument to thread function, set to NULL if not needed
* \param name internal thread name
*/
-_PROTOTYPE( ddekit_thread_t *ddekit_thread_create,
- (void (*fun)(void *), void *arg, const char *name));
+ddekit_thread_t *ddekit_thread_create(void (*fun)(void *), void *arg,
+ const char *name);
/** Reference to own DDEKit thread id.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( ddekit_thread_t *ddekit_thread_myself, (void));
+ddekit_thread_t *ddekit_thread_myself(void);
/** Initialize thread with given name.
*
* \ref ddekit_thread_create. This enables such threads to be handled as if they
* were DDEKit threads.
*/
-_PROTOTYPE( ddekit_thread_t *ddekit_thread_setup_myself, (const char *name));
+ddekit_thread_t *ddekit_thread_setup_myself(const char *name);
/** Get TLS data for a specific thread.
*
*
* \return Pointer to TLS data of this thread.
*/
-_PROTOTYPE( void *ddekit_thread_get_data, (ddekit_thread_t *thread));
+void *ddekit_thread_get_data(ddekit_thread_t *thread);
/** Get TLS data for current thread.
*
*
* \return Pointer to TLS data of current thread.
*/
-_PROTOTYPE( void *ddekit_thread_get_my_data, (void));
+void *ddekit_thread_get_my_data(void);
/** Set TLS data for specific thread.
*
* \param thread DDEKit thread
* \param data pointer to thread data
*/
-_PROTOTYPE( void ddekit_thread_set_data, (ddekit_thread_t *thread,
- void *data));
+void ddekit_thread_set_data(ddekit_thread_t *thread, void *data);
/** Set TLS data for current thread.
*
*
* \param data pointer to thread data
*/
-_PROTOTYPE( void ddekit_thread_set_my_data, (void *data));
+void ddekit_thread_set_my_data(void *data);
/** Sleep for some miliseconds.
*
*
* \param msecs time to sleep in ms.
*/
-_PROTOTYPE( void ddekit_thread_msleep, (unsigned long msecs));
+void ddekit_thread_msleep(unsigned long msecs);
/** Sleep for some microseconds.
*
*
* \param usecs time to sleep in µs.
*/
-_PROTOTYPE( void ddekit_thread_usleep, (unsigned long usecs));
+void ddekit_thread_usleep(unsigned long usecs);
/** Sleep for some nanoseconds.
*
*
* \param usecs time to sleep in ns.
*/
-_PROTOTYPE( void ddekit_thread_nsleep, (unsigned long nsecs));
+void ddekit_thread_nsleep(unsigned long nsecs);
/** Sleep until a lock becomes unlocked.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_thread_sleep, (ddekit_lock_t *lock));
+void ddekit_thread_sleep(ddekit_lock_t *lock);
/** Wakeup a waiting thread.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_thread_wakeup, (ddekit_thread_t *thread));
+void ddekit_thread_wakeup(ddekit_thread_t *thread);
/** Terminate a thread
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_thread_exit, (void) __attribute__((noreturn)));
+void ddekit_thread_exit(void) __attribute__((noreturn));
/** Terminate a thread
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_thread_terminate, (ddekit_thread_t *thread));
+void ddekit_thread_terminate(ddekit_thread_t *thread);
/** Get the name, a thread registered with DDEKit.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( const char *ddekit_thread_get_name, (ddekit_thread_t *thread));
+const char *ddekit_thread_get_name(ddekit_thread_t *thread);
/** Get unique ID of a DDEKit thread.
*
* However, applications might want to get some kind of ID related
* to a ddekit_thread, for instance to use it as a Linux-like PID.
*/
-_PROTOTYPE( int ddekit_thread_get_id, (ddekit_thread_t *thread));
+int ddekit_thread_get_id(ddekit_thread_t *thread);
/** Hint that this thread is done and may be scheduled somehow.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_thread_schedule, (void));
+void ddekit_thread_schedule(void);
/** Hint that this thread is done and may be scheduled somehow.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_yield, (void));
+void ddekit_yield(void);
/** Initialize DDEKit thread subsystem.
*
* \ingroup DDEKit_threads
*/
-_PROTOTYPE( void ddekit_init_threads, (void));
+void ddekit_init_threads(void);
#endif
* \return >=0 valid timer ID
* \return < 0 error
*/
-_PROTOTYPE( int ddekit_add_timer,
- (void (*fn)(void *), void *args, unsigned long timeout));
+int ddekit_add_timer(void (*fn)(void *), void *args, unsigned long
+ timeout);
/** Delete timer with the corresponding timer id.
*
* \ingroup DDEKit_timer
*/
-_PROTOTYPE( int ddekit_del_timer, (int timer));
+int ddekit_del_timer(int timer);
/** Check whether a timer is pending
*
*
* Linux needs this.
*/
-_PROTOTYPE( int ddekit_timer_pending, (int timer));
+int ddekit_timer_pending(int timer);
/** Initialization function, startup timer thread
*
* \ingroup DDEKit_timer
*/
-_PROTOTYPE( void ddekit_init_timers, (void));
+void ddekit_init_timers(void);
/** Get the timer thread.
*/
-_PROTOTYPE( ddekit_thread_t *ddekit_get_timer_thread, (void));
+ddekit_thread_t *ddekit_get_timer_thread(void);
#endif
void *ddekit_priv;
};
-_PROTOTYPE( int ddekit_usb_dev_set_data,
- (struct ddekit_usb_dev *dev, void *data));
-_PROTOTYPE( void *ddekit_usb_dev_get_data, (struct ddekit_usb_dev *dev));
-_PROTOTYPE( void ddekit_usb_get_device_id, (struct ddekit_usb_dev *dev,
- struct ddekit_usb_device_id *id));
-_PROTOTYPE( int ddekit_usb_submit_urb, (struct ddekit_usb_urb *d_urb));
-_PROTOTYPE( int ddekit_usb_cancle_urb, (struct ddekit_usb_urb *d_urb));
+int ddekit_usb_dev_set_data(struct ddekit_usb_dev *dev, void *data);
+void *ddekit_usb_dev_get_data(struct ddekit_usb_dev *dev);
+void ddekit_usb_get_device_id(struct ddekit_usb_dev *dev, struct
+ ddekit_usb_device_id *id);
+int ddekit_usb_submit_urb(struct ddekit_usb_urb *d_urb);
+int ddekit_usb_cancle_urb(struct ddekit_usb_urb *d_urb);
/*
* This one is only implemented for the client side. For the server side is
* has to be implemented in the DDELinux/FBSD part.
*/
-_PROTOTYPE( int ddekit_usb_init, (struct ddekit_usb_driver *drv,
- ddekit_usb_malloc_fn *_m,
- ddekit_usb_free_fn *_f));
+int ddekit_usb_init(struct ddekit_usb_driver *drv, ddekit_usb_malloc_fn
+ *_m, ddekit_usb_free_fn *_f);
#endif
#ifdef __NBSD_LIBC
#include <minix/ansi.h>
#endif
-_PROTOTYPE( int env_parse, (char *env, char *fmt, int field,
- long *param, long min, long max) );
-_PROTOTYPE( void env_panic, (char *env) );
-_PROTOTYPE( int env_prefix, (char *env, char *prefix) );
-_PROTOTYPE( int env_memory_parse, (struct memory *chunks, int nchunks) );
+int env_parse(char *env, char *fmt, int field, long *param, long min,
+ long max);
+void env_panic(char *env);
+int env_prefix(char *env, char *prefix);
+int env_memory_parse(struct memory *chunks, int nchunks);
#include <minix/ipc.h>
-_PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
- char *const _envp[], int _nargs, int _nenvps) );
-_PROTOTYPE( int _syscall, (endpoint_t _who, int _syscallnr, message *_msgptr) );
-_PROTOTYPE( void _loadname, (const char *_name, message *_msgptr) );
-_PROTOTYPE( int _len, (const char *_s) );
-_PROTOTYPE( void _begsig, (int _dummy) );
+int __execve(const char *_path, char *const _argv[], char *const
+ _envp[], int _nargs, int _nenvps);
+int _syscall(endpoint_t _who, int _syscallnr, message *_msgptr);
+void _loadname(const char *_name, message *_msgptr);
+int _len(const char *_s);
+void _begsig(int _dummy);
#endif /* _LIB_H */
* of the rules. (For consistency with the new '#ifdef _ANSI" tests in
* the headers, _ANSI should really be defined as nothing, but that would
* break many library routines that use "#if _ANSI".)
-
- * If _ANSI ends up being defined, a macro
- *
- * _PROTOTYPE(function, params)
- *
- * is defined. This macro expands in different ways, generating either
- * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
- * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
- * in such a way that they are portable over both ANSI and K&R compilers.
- * The appropriate macros are defined here.
*/
#ifndef _MINIX_ANSI_H
#ifdef _ANSI
-/* Keep everything for ANSI prototypes. */
-#define _PROTOTYPE(function, params) function params
#define _ARGS(params) params
#define _CONST const
#else
-/* Throw away the parameters for K&R prototypes. */
-#define _PROTOTYPE(function, params) function()
#define _ARGS(params) ()
#define _CONST
#include <sys/ioc_sound.h>
-_PROTOTYPE( int drv_init, (void) );
-_PROTOTYPE( int drv_init_hw, (void) );
-_PROTOTYPE( int drv_reset, (void) );
-_PROTOTYPE( int drv_start, (int sub_dev, int DmaMode) );
-_PROTOTYPE( int drv_stop, (int sub_dev) );
-_PROTOTYPE( int drv_set_dma, (u32_t dma, u32_t length, int chan) );
-_PROTOTYPE( int drv_reenable_int, (int chan) );
-_PROTOTYPE( int drv_int_sum, (void) );
-_PROTOTYPE( int drv_int, (int sub_dev) );
-_PROTOTYPE( int drv_pause, (int chan) );
-_PROTOTYPE( int drv_resume, (int chan) );
-_PROTOTYPE( int drv_io_ctl, (int request, void * val, int * len, int sub_dev) );
-_PROTOTYPE( int drv_get_irq, (char *irq) );
-_PROTOTYPE( int drv_get_frag_size, (u32_t *frag_size, int sub_dev) );
+int drv_init(void);
+int drv_init_hw(void);
+int drv_reset(void);
+int drv_start(int sub_dev, int DmaMode);
+int drv_stop(int sub_dev);
+int drv_set_dma(u32_t dma, u32_t length, int chan);
+int drv_reenable_int(int chan);
+int drv_int_sum(void);
+int drv_int(int sub_dev);
+int drv_pause(int chan);
+int drv_resume(int chan);
+int drv_io_ctl(int request, void * val, int * len, int sub_dev);
+int drv_get_irq(char *irq);
+int drv_get_frag_size(u32_t *frag_size, int sub_dev);
/* Entry points into the device dependent code of block drivers. */
struct blockdriver {
blockdriver_type_t bdr_type;
- _PROTOTYPE( int (*bdr_open), (dev_t minor, int access) );
- _PROTOTYPE( int (*bdr_close), (dev_t minor) );
- _PROTOTYPE( ssize_t (*bdr_transfer), (dev_t minor, int do_write, u64_t pos,
- endpoint_t endpt, iovec_t *iov, unsigned count, int flags) );
- _PROTOTYPE( int (*bdr_ioctl), (dev_t minor, unsigned int request,
- endpoint_t endpt, cp_grant_id_t grant) );
- _PROTOTYPE( void (*bdr_cleanup), (void) );
- _PROTOTYPE( struct device *(*bdr_part), (dev_t minor) );
- _PROTOTYPE( void (*bdr_geometry), (dev_t minor, struct partition *part) );
- _PROTOTYPE( void (*bdr_intr), (unsigned int irqs) );
- _PROTOTYPE( void (*bdr_alarm), (clock_t stamp) );
- _PROTOTYPE( int (*bdr_other), (message *m_ptr) );
- _PROTOTYPE( int (*bdr_device), (dev_t minor, device_id_t *id) );
+ int(*bdr_open) (dev_t minor, int access);
+ int(*bdr_close) (dev_t minor);
+ ssize_t(*bdr_transfer) (dev_t minor, int do_write, u64_t pos,
+ endpoint_t endpt, iovec_t *iov, unsigned count, int flags);
+ int(*bdr_ioctl) (dev_t minor, unsigned int request, endpoint_t endpt,
+ cp_grant_id_t grant);
+ void(*bdr_cleanup) (void);
+ struct device *(*bdr_part)(dev_t minor);
+ void(*bdr_geometry) (dev_t minor, struct partition *part);
+ void(*bdr_intr) (unsigned int irqs);
+ void(*bdr_alarm) (clock_t stamp);
+ int(*bdr_other) (message *m_ptr);
+ int(*bdr_device) (dev_t minor, device_id_t *id);
};
/* Functions defined by libblockdriver. These can be used for both
* singlethreaded and multithreaded drivers.
*/
-_PROTOTYPE( void blockdriver_announce, (int type) );
+void blockdriver_announce(int type);
#ifndef _BLOCKDRIVER_MT_API
/* Additional functions for the singlethreaded version. These allow the driver
* To avoid accidents, these functions are not exposed when minix/driver_mt.h
* has been included previously.
*/
-_PROTOTYPE( int blockdriver_receive_mq, (message *m_ptr, int *status_ptr) );
-_PROTOTYPE( void blockdriver_process, (struct blockdriver *dp, message *m_ptr,
- int ipc_status) );
-_PROTOTYPE( void blockdriver_terminate, (void) );
-_PROTOTYPE( void blockdriver_task, (struct blockdriver *bdp) );
-_PROTOTYPE( int blockdriver_mq_queue, (message *m_ptr, int status) );
+int blockdriver_receive_mq(message *m_ptr, int *status_ptr);
+void blockdriver_process(struct blockdriver *dp, message *m_ptr, int
+ ipc_status);
+void blockdriver_terminate(void);
+void blockdriver_task(struct blockdriver *bdp);
+int blockdriver_mq_queue(message *m_ptr, int status);
#endif /* !_BLOCKDRIVER_MT_API */
/* Parameters for the disk drive. */
#define BLOCKDRIVER_MT_API 1 /* do not expose the singlethreaded API */
#include <minix/blockdriver.h>
-_PROTOTYPE( void blockdriver_mt_task, (struct blockdriver *driver_tab) );
-_PROTOTYPE( void blockdriver_mt_sleep, (void) );
-_PROTOTYPE( void blockdriver_mt_wakeup, (thread_id_t id) );
-_PROTOTYPE( void blockdriver_mt_terminate, (void) );
-_PROTOTYPE( void blockdriver_mt_set_workers, (device_id_t id, int workers) );
-_PROTOTYPE( thread_id_t blockdriver_mt_get_tid, (void) );
+void blockdriver_mt_task(struct blockdriver *driver_tab);
+void blockdriver_mt_sleep(void);
+void blockdriver_mt_wakeup(thread_id_t id);
+void blockdriver_mt_terminate(void);
+void blockdriver_mt_set_workers(device_id_t id, int workers);
+thread_id_t blockdriver_mt_get_tid(void);
#endif /* _MINIX_BLOCKDRIVER_MT_H */
/* Entry points into the device dependent code of character drivers. */
struct chardriver {
- _PROTOTYPE( int (*cdr_open), (message *m_ptr) );
- _PROTOTYPE( int (*cdr_close), (message *m_ptr) );
- _PROTOTYPE( int (*cdr_ioctl), (message *m_ptr) );
- _PROTOTYPE( struct device *(*cdr_prepare), (dev_t device) );
- _PROTOTYPE( int (*cdr_transfer), (endpoint_t endpt, int opcode,
- u64_t position, iovec_t *iov, unsigned int nr_req,
- endpoint_t user_endpt, unsigned int flags) );
- _PROTOTYPE( void (*cdr_cleanup), (void) );
- _PROTOTYPE( void (*cdr_alarm), (message *m_ptr) );
- _PROTOTYPE( int (*cdr_cancel), (message *m_ptr) );
- _PROTOTYPE( int (*cdr_select), (message *m_ptr) );
- _PROTOTYPE( int (*cdr_other), (message *m_ptr) );
+ int(*cdr_open) (message *m_ptr);
+ int(*cdr_close) (message *m_ptr);
+ int(*cdr_ioctl) (message *m_ptr);
+ struct device *(*cdr_prepare)(dev_t device);
+ int(*cdr_transfer) (endpoint_t endpt, int opcode, u64_t position,
+ iovec_t *iov, unsigned int nr_req, endpoint_t user_endpt, unsigned int
+ flags);
+ void(*cdr_cleanup) (void);
+ void(*cdr_alarm) (message *m_ptr);
+ int(*cdr_cancel) (message *m_ptr);
+ int(*cdr_select) (message *m_ptr);
+ int(*cdr_other) (message *m_ptr);
};
#define CHARDRIVER_SYNC 0 /* use the synchronous protocol */
#define IS_CDEV_MINOR_RQ(type) (IS_DEV_RQ(type) && (type) != DEV_STATUS)
/* Functions defined by libchardriver. */
-_PROTOTYPE( void chardriver_announce, (void) );
-_PROTOTYPE( void chardriver_process, (struct chardriver *cdp, int driver_type,
- message *m_ptr, int ipc_status) );
-_PROTOTYPE( void chardriver_terminate, (void) );
-_PROTOTYPE( void chardriver_task, (struct chardriver *cdp, int driver_type) );
+void chardriver_announce(void);
+void chardriver_process(struct chardriver *cdp, int driver_type, message
+ *m_ptr, int ipc_status);
+void chardriver_terminate(void);
+void chardriver_task(struct chardriver *cdp, int driver_type);
-_PROTOTYPE( int do_nop, (message *m_ptr) );
-_PROTOTYPE( void nop_cleanup, (void) );
-_PROTOTYPE( void nop_alarm, (message *m_ptr) );
-_PROTOTYPE( int nop_cancel, (message *m_ptr) );
-_PROTOTYPE( int nop_select, (message *m_ptr) );
-_PROTOTYPE( int nop_ioctl, (message *m_ptr) );
+int do_nop(message *m_ptr);
+void nop_cleanup(void);
+void nop_alarm(message *m_ptr);
+int nop_cancel(message *m_ptr);
+int nop_select(message *m_ptr);
+int nop_ioctl(message *m_ptr);
#endif /* _MINIX_CHARDRIVER_H */
#define _CPUF_I386_HTT 13 /* Supports HTT */
#define _CPUF_I386_HTT_MAX_NUM 14 /* Maximal num of threads */
-_PROTOTYPE(int _cpufeature, (int featureno));
+int _cpufeature(int featureno);
#endif
#ifndef _MINIX_CRTSO_H
#define _MINIX_CRTSO_H
-_PROTOTYPE( void _minix_unmapzero, (void));
+void _minix_unmapzero(void);
#endif
typedef int (*devman_usb_bind_cb_t)(struct devman_usb_bind_cb_data *data, endpoint_t ep);
-_PROTOTYPE( int devman_add_device, (struct devman_dev *dev));
-_PROTOTYPE( int devman_del_device, (struct devman_dev *dev));
-_PROTOTYPE( int devman_init, (void));
-_PROTOTYPE( struct devman_usb_dev* devman_usb_device_new, (int dev_id));
-_PROTOTYPE( int devman_usb_device_add, (struct devman_usb_dev *dev));
-_PROTOTYPE( int devman_usb_device_remove, (struct devman_usb_dev *dev));
-_PROTOTYPE( void devman_usb_device_delete, (struct devman_usb_dev *udev));
-_PROTOTYPE( int devman_handle_msg, (message *m));
-_PROTOTYPE( void devman_usb_init, (devman_usb_bind_cb_t bind_cb,
- devman_usb_bind_cb_t unbind_cb) );
+int devman_add_device(struct devman_dev *dev);
+int devman_del_device(struct devman_dev *dev);
+int devman_init(void);
+struct devman_usb_dev* devman_usb_device_new(int dev_id);
+int devman_usb_device_add(struct devman_usb_dev *dev);
+int devman_usb_device_remove(struct devman_usb_dev *dev);
+void devman_usb_device_delete(struct devman_usb_dev *udev);
+int devman_handle_msg(message *m);
+void devman_usb_init(devman_usb_bind_cb_t bind_cb, devman_usb_bind_cb_t
+ unbind_cb);
#endif
#include <machine/partition.h>
-_PROTOTYPE( void partition, (struct blockdriver *bdr, int device, int style,
- int atapi) );
+void partition(struct blockdriver *bdr, int device, int style, int
+ atapi);
#define DEV_PER_DRIVE (1 + NR_PARTITIONS)
#define MINOR_t0 64
/* ds.c */
/* U32 */
-_PROTOTYPE( int ds_publish_u32, (const char *name, u32_t val, int flags));
-_PROTOTYPE( int ds_retrieve_u32, (const char *name, u32_t *val));
-_PROTOTYPE( int ds_delete_u32, (const char *ds_name));
+int ds_publish_u32(const char *name, u32_t val, int flags);
+int ds_retrieve_u32(const char *name, u32_t *val);
+int ds_delete_u32(const char *ds_name);
/* STRING */
-_PROTOTYPE( int ds_publish_str, (const char *name, char *val, int flags));
-_PROTOTYPE( int ds_retrieve_str, (const char *name, char *val, size_t len));
-_PROTOTYPE( int ds_delete_str, (const char *ds_name));
+int ds_publish_str(const char *name, char *val, int flags);
+int ds_retrieve_str(const char *name, char *val, size_t len);
+int ds_delete_str(const char *ds_name);
/* MEM */
-_PROTOTYPE( int ds_publish_mem, (const char *ds_name, void *vaddr,
- size_t length, int flags));
-_PROTOTYPE( int ds_retrieve_mem, (const char *ds_name, char *vaddr,
- size_t *length));
-_PROTOTYPE( int ds_delete_mem, (const char *ds_name));
+int ds_publish_mem(const char *ds_name, void *vaddr, size_t length, int
+ flags);
+int ds_retrieve_mem(const char *ds_name, char *vaddr, size_t *length);
+int ds_delete_mem(const char *ds_name);
/* MAP */
-_PROTOTYPE( int ds_publish_map, (const char *ds_name, void *vaddr,
- size_t length, int flags));
-_PROTOTYPE( int ds_snapshot_map, (const char *ds_name, int *nr_snapshot));
-_PROTOTYPE( int ds_retrieve_map, (const char *ds_name, char *vaddr,
- size_t *length, int nr_snapshot, int flags));
-_PROTOTYPE( int ds_delete_map, (const char *ds_name));
+int ds_publish_map(const char *ds_name, void *vaddr, size_t length, int
+ flags);
+int ds_snapshot_map(const char *ds_name, int *nr_snapshot);
+int ds_retrieve_map(const char *ds_name, char *vaddr, size_t *length,
+ int nr_snapshot, int flags);
+int ds_delete_map(const char *ds_name);
/* LABEL */
-_PROTOTYPE( int ds_publish_label, (const char *ds_name, endpoint_t endpoint,
- int flags));
-_PROTOTYPE( int ds_retrieve_label_name, (char *ds_name, endpoint_t endpoint));
-_PROTOTYPE( int ds_retrieve_label_endpt, (const char *ds_name,
- endpoint_t *endpoint));
-_PROTOTYPE( int ds_delete_label, (const char *ds_name));
+int ds_publish_label(const char *ds_name, endpoint_t endpoint, int
+ flags);
+int ds_retrieve_label_name(char *ds_name, endpoint_t endpoint);
+int ds_retrieve_label_endpt(const char *ds_name, endpoint_t *endpoint);
+int ds_delete_label(const char *ds_name);
/* Subscribe and check. */
-_PROTOTYPE( int ds_subscribe, (const char *regex, int flags));
-_PROTOTYPE( int ds_check, (char *ds_name, int *type, endpoint_t *owner_e));
+int ds_subscribe(const char *regex, int flags);
+int ds_check(char *ds_name, int *type, endpoint_t *owner_e);
#endif /* _MINIX_DS_H */
/* V1 and V2 file system disk to/from memory support functions. */
-_PROTOTYPE( int bitmapsize, (bit_t _nr_bits, int block_size) );
-_PROTOTYPE( unsigned conv2, (int _norm, int _w) );
-_PROTOTYPE( long conv4, (int _norm, long _x) );
-_PROTOTYPE( void conv_inode, (struct inode *_rip, d1_inode *_dip,
- d2_inode *_dip2, int _rw_flag, int _magic) );
-_PROTOTYPE( void old_icopy, (struct inode *_rip, d1_inode *_dip,
- int _direction, int _norm));
-_PROTOTYPE( void new_icopy, (struct inode *_rip, d2_inode *_dip,
- int _direction, int _norm));
+int bitmapsize(bit_t _nr_bits, int block_size);
+unsigned conv2(int _norm, int _w);
+long conv4(int _norm, long _x);
+void conv_inode(struct inode *_rip, d1_inode *_dip, d2_inode *_dip2, int
+ _rw_flag, int _magic);
+void old_icopy(struct inode *_rip, d1_inode *_dip, int _direction, int
+ _norm);
+void new_icopy(struct inode *_rip, d2_inode *_dip, int _direction, int
+ _norm);
HGFS_ATTR_MTIME | HGFS_ATTR_CTIME | HGFS_ATTR_MODE | \
HGFS_ATTR_ATIME_SET | HGFS_ATTR_MTIME_SET)
-_PROTOTYPE( int hgfs_init, (void) );
-_PROTOTYPE( void hgfs_cleanup, (void) );
+int hgfs_init(void);
+void hgfs_cleanup(void);
-_PROTOTYPE( int hgfs_enabled, (void) );
+int hgfs_enabled(void);
-_PROTOTYPE( int hgfs_open, (char *path, int flags, int mode,
- hgfs_file_t *handle) );
-_PROTOTYPE( int hgfs_read, (hgfs_file_t handle, char *buf, size_t size,
- u64_t offset) );
-_PROTOTYPE( int hgfs_write, (hgfs_file_t handle, const char *buf,
- size_t len, u64_t offset, int append) );
-_PROTOTYPE( int hgfs_close, (hgfs_file_t handle) );
+int hgfs_open(char *path, int flags, int mode, hgfs_file_t *handle);
+int hgfs_read(hgfs_file_t handle, char *buf, size_t size, u64_t offset);
+int hgfs_write(hgfs_file_t handle, const char *buf, size_t len, u64_t
+ offset, int append);
+int hgfs_close(hgfs_file_t handle);
-_PROTOTYPE( size_t hgfs_readbuf, (char **ptr) );
-_PROTOTYPE( size_t hgfs_writebuf, (char **ptr) );
+size_t hgfs_readbuf(char **ptr);
+size_t hgfs_writebuf(char **ptr);
-_PROTOTYPE( int hgfs_opendir, (char *path, hgfs_dir_t *handle) );
-_PROTOTYPE( int hgfs_readdir, (hgfs_dir_t handle, unsigned int index,
- char *buf, size_t size, struct hgfs_attr *attr) );
-_PROTOTYPE( int hgfs_closedir, (hgfs_dir_t handle) );
+int hgfs_opendir(char *path, hgfs_dir_t *handle);
+int hgfs_readdir(hgfs_dir_t handle, unsigned int index, char *buf,
+ size_t size, struct hgfs_attr *attr);
+int hgfs_closedir(hgfs_dir_t handle);
-_PROTOTYPE( int hgfs_getattr, (char *path, struct hgfs_attr *attr) );
-_PROTOTYPE( int hgfs_setattr, (char *path, struct hgfs_attr *attr) );
+int hgfs_getattr(char *path, struct hgfs_attr *attr);
+int hgfs_setattr(char *path, struct hgfs_attr *attr);
-_PROTOTYPE( int hgfs_mkdir, (char *path, int mode) );
-_PROTOTYPE( int hgfs_unlink, (char *path) );
-_PROTOTYPE( int hgfs_rmdir, (char *path) );
-_PROTOTYPE( int hgfs_rename, (char *opath, char *npath) );
+int hgfs_mkdir(char *path, int mode);
+int hgfs_unlink(char *path);
+int hgfs_rmdir(char *path);
+int hgfs_rename(char *opath, char *npath);
-_PROTOTYPE( int hgfs_queryvol, (char *path, u64_t *free, u64_t *total) );
+int hgfs_queryvol(char *path, u64_t *free, u64_t *total);
#endif /* _HGFS_H */
#define sendnb _sendnb
#define senda _senda
-_PROTOTYPE( int echo, (message *m_ptr) );
-_PROTOTYPE( int notify, (endpoint_t dest) );
-_PROTOTYPE( int sendrec, (endpoint_t src_dest, message *m_ptr) );
-_PROTOTYPE( int receive, (endpoint_t src, message *m_ptr, int *status_ptr));
-_PROTOTYPE( int send, (endpoint_t dest, message *m_ptr) );
-_PROTOTYPE( int sendnb, (endpoint_t dest, message *m_ptr) );
-_PROTOTYPE( int senda, (asynmsg_t *table, size_t count) );
-
-_PROTOTYPE( int _do_kernel_call, (message *m_ptr) );
+int echo(message *m_ptr);
+int notify(endpoint_t dest);
+int sendrec(endpoint_t src_dest, message *m_ptr);
+int receive(endpoint_t src, message *m_ptr, int *status_ptr);
+int send(endpoint_t dest, message *m_ptr);
+int sendnb(endpoint_t dest, message *m_ptr);
+int senda(asynmsg_t *table, size_t count);
+
+int _do_kernel_call(message *m_ptr);
#endif /* _IPC_H */
#endif
/* Miscellaneous BSD. */
-_PROTOTYPE(char *itoa, (int _n));
+char *itoa(int _n);
#ifndef __NBSD_LIBC
-_PROTOTYPE(char *getpass, (const char *_prompt));
+char *getpass(const char *_prompt);
#ifdef __ACK__
-_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
+void swab(char *_from, char *_to, int _count);
#endif
#endif /* !_NBSD_LIBC */
/* Miscellaneous MINIX. */
-_PROTOTYPE(void std_err, (const char *_s));
-_PROTOTYPE(void prints, (const char *_s, ...));
-_PROTOTYPE(int fsversion, (char *_dev, char *_prog));
-_PROTOTYPE(int getprocessor, (void));
-_PROTOTYPE(void _cpuid, (u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
-_PROTOTYPE(int load_mtab, (char *_prog_name));
-_PROTOTYPE(int rewrite_mtab, (char *_prog_name));
-_PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
-_PROTOTYPE(int put_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));
+void std_err(const char *_s);
+void prints(const char *_s, ...);
+int fsversion(char *_dev, char *_prog);
+int getprocessor(void);
+void _cpuid(u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx);
+int load_mtab(char *_prog_name);
+int rewrite_mtab(char *_prog_name);
+int get_mtab_entry(char *_s1, char *_s2, char *_s3, char *_s4);
+int put_mtab_entry(char *_s1, char *_s2, char *_s3, char *_s4);
/* read_tsc() and friends */
-_PROTOTYPE(void read_tsc, (u32_t *hi, u32_t *lo));
-_PROTOTYPE(void read_tsc_64, (u64_t *t));
+void read_tsc(u32_t *hi, u32_t *lo);
+void read_tsc_64(u64_t *t);
/* return values for fsversion */
#define FSVERSION_MFS1 0x00001
#define MTHREAD_KEYS_MAX 128
/* allocate.c */
-_PROTOTYPE( int mthread_create, (mthread_thread_t *thread,
- mthread_attr_t *tattr,
- void *(*proc)(void *), void *arg) );
-_PROTOTYPE( int mthread_detach, (mthread_thread_t thread) );
-_PROTOTYPE( int mthread_equal, (mthread_thread_t l, mthread_thread_t r) );
-_PROTOTYPE( void mthread_exit, (void *value) );
-_PROTOTYPE( int mthread_join, (mthread_thread_t thread, void **value) );
-_PROTOTYPE( int mthread_once, (mthread_once_t *once,
- void (*proc)(void)) );
-_PROTOTYPE( mthread_thread_t mthread_self, (void) );
+int mthread_create(mthread_thread_t *thread, mthread_attr_t *tattr, void
+ *(*proc)(void *), void *arg);
+int mthread_detach(mthread_thread_t thread);
+int mthread_equal(mthread_thread_t l, mthread_thread_t r);
+void mthread_exit(void *value);
+int mthread_join(mthread_thread_t thread, void **value);
+int mthread_once(mthread_once_t *once, void (*proc)(void));
+mthread_thread_t mthread_self(void);
/* attribute.c */
-_PROTOTYPE( int mthread_attr_destroy, (mthread_attr_t *tattr) );
-_PROTOTYPE( int mthread_attr_getdetachstate, (mthread_attr_t *tattr,
- int *detachstate) );
-_PROTOTYPE( int mthread_attr_getstack, (mthread_attr_t *tattr,
- void **stackaddr,
- size_t *stacksize) );
-_PROTOTYPE( int mthread_attr_getstacksize, (mthread_attr_t *tattr,
- size_t *stacksize) );
-_PROTOTYPE( int mthread_attr_init, (mthread_attr_t *tattr) );
-_PROTOTYPE( int mthread_attr_setdetachstate, (mthread_attr_t *tattr,
- int detachstate) );
-_PROTOTYPE( int mthread_attr_setstack, (mthread_attr_t *tattr,
- void *stackaddr,
- size_t stacksize) );
-_PROTOTYPE( int mthread_attr_setstacksize, (mthread_attr_t *tattr,
- size_t stacksize) );
+int mthread_attr_destroy(mthread_attr_t *tattr);
+int mthread_attr_getdetachstate(mthread_attr_t *tattr, int
+ *detachstate);
+int mthread_attr_getstack(mthread_attr_t *tattr, void **stackaddr,
+ size_t *stacksize);
+int mthread_attr_getstacksize(mthread_attr_t *tattr, size_t *stacksize);
+int mthread_attr_init(mthread_attr_t *tattr);
+int mthread_attr_setdetachstate(mthread_attr_t *tattr, int detachstate);
+int mthread_attr_setstack(mthread_attr_t *tattr, void *stackaddr, size_t
+ stacksize);
+int mthread_attr_setstacksize(mthread_attr_t *tattr, size_t stacksize);
/* condition.c */
-_PROTOTYPE( int mthread_cond_broadcast, (mthread_cond_t *cond) );
-_PROTOTYPE( int mthread_cond_destroy, (mthread_cond_t *cond) );
-_PROTOTYPE( int mthread_cond_init, (mthread_cond_t *cond,
- mthread_condattr_t *cattr) );
-_PROTOTYPE( int mthread_cond_signal, (mthread_cond_t *cond) );
-_PROTOTYPE( int mthread_cond_wait, (mthread_cond_t *cond,
- mthread_mutex_t *mutex) );
+int mthread_cond_broadcast(mthread_cond_t *cond);
+int mthread_cond_destroy(mthread_cond_t *cond);
+int mthread_cond_init(mthread_cond_t *cond, mthread_condattr_t *cattr);
+int mthread_cond_signal(mthread_cond_t *cond);
+int mthread_cond_wait(mthread_cond_t *cond, mthread_mutex_t *mutex);
/* key.c */
-_PROTOTYPE( int mthread_key_create, (mthread_key_t *key,
- void (*destructor)(void *)) );
-_PROTOTYPE( int mthread_key_delete, (mthread_key_t key) );
-_PROTOTYPE( void *mthread_getspecific, (mthread_key_t key) );
-_PROTOTYPE( int mthread_setspecific, (mthread_key_t key, void *value) );
+int mthread_key_create(mthread_key_t *key, void (*destructor)(void *));
+int mthread_key_delete(mthread_key_t key);
+void *mthread_getspecific(mthread_key_t key);
+int mthread_setspecific(mthread_key_t key, void *value);
/* misc.c */
-_PROTOTYPE( void mthread_stats, (void) );
-_PROTOTYPE( void mthread_verify_f, (char *f, int l) );
+void mthread_stats(void);
+void mthread_verify_f(char *f, int l);
#define mthread_verify() mthread_verify_f(__FILE__, __LINE__)
/* mutex.c */
-_PROTOTYPE( int mthread_mutex_destroy, (mthread_mutex_t *mutex) );
-_PROTOTYPE( int mthread_mutex_init, (mthread_mutex_t *mutex,
- mthread_mutexattr_t *mattr) );
-_PROTOTYPE( int mthread_mutex_lock, (mthread_mutex_t *mutex) );
-_PROTOTYPE( int mthread_mutex_trylock, (mthread_mutex_t *mutex) );
-_PROTOTYPE( int mthread_mutex_unlock, (mthread_mutex_t *mutex) );
+int mthread_mutex_destroy(mthread_mutex_t *mutex);
+int mthread_mutex_init(mthread_mutex_t *mutex, mthread_mutexattr_t
+ *mattr);
+int mthread_mutex_lock(mthread_mutex_t *mutex);
+int mthread_mutex_trylock(mthread_mutex_t *mutex);
+int mthread_mutex_unlock(mthread_mutex_t *mutex);
/* event.c */
-_PROTOTYPE( int mthread_event_destroy, (mthread_event_t *event) );
-_PROTOTYPE( int mthread_event_init, (mthread_event_t *event) );
-_PROTOTYPE( int mthread_event_wait, (mthread_event_t *event) );
-_PROTOTYPE( int mthread_event_fire, (mthread_event_t *event) );
-_PROTOTYPE( int mthread_event_fire_all, (mthread_event_t *event));
+int mthread_event_destroy(mthread_event_t *event);
+int mthread_event_init(mthread_event_t *event);
+int mthread_event_wait(mthread_event_t *event);
+int mthread_event_fire(mthread_event_t *event);
+int mthread_event_fire_all(mthread_event_t *event);
/* rwlock.c */
-_PROTOTYPE( int mthread_rwlock_destroy, (mthread_rwlock_t *rwlock) );
-_PROTOTYPE( int mthread_rwlock_init, (mthread_rwlock_t *rwlock) );
-_PROTOTYPE( int mthread_rwlock_rdlock, (mthread_rwlock_t *rwlock) );
-_PROTOTYPE( int mthread_rwlock_wrlock, (mthread_rwlock_t *rwlock) );
-_PROTOTYPE( int mthread_rwlock_unlock, (mthread_rwlock_t *rwlock) );
+int mthread_rwlock_destroy(mthread_rwlock_t *rwlock);
+int mthread_rwlock_init(mthread_rwlock_t *rwlock);
+int mthread_rwlock_rdlock(mthread_rwlock_t *rwlock);
+int mthread_rwlock_wrlock(mthread_rwlock_t *rwlock);
+int mthread_rwlock_unlock(mthread_rwlock_t *rwlock);
/* schedule.c */
-_PROTOTYPE( void mthread_init, (void) );
-_PROTOTYPE( int mthread_yield, (void) );
-_PROTOTYPE( void mthread_yield_all, (void) );
+void mthread_init(void);
+int mthread_yield(void);
+void mthread_yield_all(void);
#endif
#include <minix/ipc.h>
/* Functions defined by netdriver.c: */
-_PROTOTYPE( void netdriver_announce, (void) );
-_PROTOTYPE( int netdriver_receive, (endpoint_t src, message *m_ptr,
- int *status_ptr) );
+void netdriver_announce(void);
+int netdriver_receive(endpoint_t src, message *m_ptr, int *status_ptr);
#endif /* _MINIX_NETDRIVER_H */
int os_val;
};
-_PROTOTYPE( void optset_parse, (struct optset *table, char *string) );
+void optset_parse(struct optset *table, char *string);
#endif /* _MINIX_OPTSET_H */
#define CPROF_ACCOUNCE_KERNEL 10000 /* kernel announces not directly */
/* Prototype for function called by procentry to get size of table. */
-_PROTOTYPE(int profile_get_tbl_size, (void) );
+int profile_get_tbl_size(void);
/* Prototype for function called by procentry to get announce number. */
-_PROTOTYPE(int profile_get_announce, (void) );
+int profile_get_announce(void);
/* Prototype for function called by procentry to announce control struct
* and table locations to the kernel. */
-_PROTOTYPE(void profile_register, (void *ctl_ptr, void *tbl_ptr) );
+void profile_register(void *ctl_ptr, void *tbl_ptr);
/* Info struct to be copied from kernel to user program. */
struct cprof_info_s {
u64_t cycles; /* execution time of path, in cycles */
} cprof_tbl_inst;
-_PROTOTYPE( int sprofile, (int action, int size, int freq, int type,
- void *ctl_ptr, void *mem_ptr) );
+int sprofile(int action, int size, int freq, int type, void *ctl_ptr,
+ void *mem_ptr);
-_PROTOTYPE( int cprofile, (int action, int size, void *ctl_ptr,
- void *mem_ptr) );
+int cprofile(int action, int size, void *ctl_ptr, void *mem_ptr);
#endif /* PROFILE_H */
int devman_id;
};
-_PROTOTYPE( int minix_rs_lookup, (const char *name, endpoint_t *value));
+int minix_rs_lookup(const char *name, endpoint_t *value);
#endif
#define CPF_VALID 0x001000 /* Grant slot contains valid grant. */
/* Prototypes for functions in libsys. */
-_PROTOTYPE( cp_grant_id_t cpf_grant_direct, (endpoint_t, vir_bytes, size_t, int));
-_PROTOTYPE( cp_grant_id_t cpf_grant_indirect, (endpoint_t, endpoint_t, cp_grant_id_t));
-_PROTOTYPE( cp_grant_id_t cpf_grant_magic, (endpoint_t, endpoint_t, vir_bytes, size_t, int));
-_PROTOTYPE( int cpf_revoke, (cp_grant_id_t grant_id));
-_PROTOTYPE( int cpf_lookup, (cp_grant_id_t g, endpoint_t *ep, endpoint_t *ep2));
+cp_grant_id_t cpf_grant_direct(endpoint_t, vir_bytes, size_t, int);
+cp_grant_id_t cpf_grant_indirect(endpoint_t, endpoint_t, cp_grant_id_t);
+cp_grant_id_t cpf_grant_magic(endpoint_t, endpoint_t, vir_bytes, size_t,
+ int);
+int cpf_revoke(cp_grant_id_t grant_id);
+int cpf_lookup(cp_grant_id_t g, endpoint_t *ep, endpoint_t *ep2);
-_PROTOTYPE( int cpf_getgrants, (cp_grant_id_t *grant_ids, int n));
-_PROTOTYPE( int cpf_setgrant_direct, (cp_grant_id_t g, endpoint_t who,
- vir_bytes addr, size_t size, int access));
-_PROTOTYPE( int cpf_setgrant_indirect, (cp_grant_id_t g, endpoint_t who_to,
- endpoint_t who_from, cp_grant_id_t his_g));
-_PROTOTYPE( int cpf_setgrant_magic, (cp_grant_id_t g, endpoint_t who_to,
- endpoint_t who_from, vir_bytes addr, size_t bytes, int access));
-_PROTOTYPE( int cpf_setgrant_disable, (cp_grant_id_t grant_id));
-_PROTOTYPE( void cpf_reload, (void));
+int cpf_getgrants(cp_grant_id_t *grant_ids, int n);
+int cpf_setgrant_direct(cp_grant_id_t g, endpoint_t who, vir_bytes addr,
+ size_t size, int access);
+int cpf_setgrant_indirect(cp_grant_id_t g, endpoint_t who_to, endpoint_t
+ who_from, cp_grant_id_t his_g);
+int cpf_setgrant_magic(cp_grant_id_t g, endpoint_t who_to, endpoint_t
+ who_from, vir_bytes addr, size_t bytes, int access);
+int cpf_setgrant_disable(cp_grant_id_t grant_id);
+void cpf_reload(void);
/* Set a process' grant table location and size (in-kernel only). */
#define _K_SET_GRANT_TABLE(rp, ptr, entries) \
#include <minix/ipc.h>
-_PROTOTYPE(int sched_stop, (endpoint_t scheduler_e, endpoint_t schedulee_e));
-_PROTOTYPE(int sched_start, (endpoint_t scheduler_e, endpoint_t schedulee_e,
- endpoint_t parent_e, int maxprio, int quantum, int cpu,
- endpoint_t *newscheduler_e));
-_PROTOTYPE(int sched_inherit, (endpoint_t scheduler_e,
- endpoint_t schedulee_e, endpoint_t parent_e, unsigned maxprio,
- endpoint_t *newscheduler_e));
+int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e);
+int sched_start(endpoint_t scheduler_e, endpoint_t schedulee_e,
+ endpoint_t parent_e, int maxprio, int quantum, int cpu, endpoint_t
+ *newscheduler_e);
+int sched_inherit(endpoint_t scheduler_e, endpoint_t schedulee_e,
+ endpoint_t parent_e, unsigned maxprio, endpoint_t *newscheduler_e);
#endif /* _MINIX_SCHED_H */
#include <minix/ipc.h>
/* SEF entry points for system processes. */
-_PROTOTYPE( void sef_startup, (void) );
-_PROTOTYPE( int sef_receive_status, (endpoint_t src, message *m_ptr,
- int *status_ptr) );
-_PROTOTYPE( void sef_exit, (int status) );
+void sef_startup(void);
+int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr);
+void sef_exit(int status);
#define sef_receive(src, m_ptr) sef_receive_status(src, m_ptr, NULL)
/* SEF Debug. */
typedef int(*sef_cb_init_response_t)(message *m_ptr);
/* Callback registration helpers. */
-_PROTOTYPE( void sef_setcb_init_fresh, (sef_cb_init_t cb));
-_PROTOTYPE( void sef_setcb_init_lu, (sef_cb_init_t cb));
-_PROTOTYPE( void sef_setcb_init_restart, (sef_cb_init_t cb));
-_PROTOTYPE( void sef_setcb_init_response, (sef_cb_init_response_t cb) );
+void sef_setcb_init_fresh(sef_cb_init_t cb);
+void sef_setcb_init_lu(sef_cb_init_t cb);
+void sef_setcb_init_restart(sef_cb_init_t cb);
+void sef_setcb_init_response(sef_cb_init_response_t cb);
/* Predefined callback implementations. */
-_PROTOTYPE( int sef_cb_init_null, (int type, sef_init_info_t *info) );
-_PROTOTYPE( int sef_cb_init_response_null, (message *m_ptr) );
+int sef_cb_init_null(int type, sef_init_info_t *info);
+int sef_cb_init_response_null(message *m_ptr);
-_PROTOTYPE( int sef_cb_init_fail, (int type, sef_init_info_t *info) );
-_PROTOTYPE( int sef_cb_init_reset, (int type, sef_init_info_t *info) );
-_PROTOTYPE( int sef_cb_init_crash, (int type, sef_init_info_t *info) );
-_PROTOTYPE( int sef_cb_init_response_rs_reply, (message *m_ptr) );
+int sef_cb_init_fail(int type, sef_init_info_t *info);
+int sef_cb_init_reset(int type, sef_init_info_t *info);
+int sef_cb_init_crash(int type, sef_init_info_t *info);
+int sef_cb_init_response_rs_reply(message *m_ptr);
/* Macros for predefined callback implementations. */
#define SEF_CB_INIT_FRESH_NULL sef_cb_init_null
typedef void(*sef_cb_ping_reply_t)(endpoint_t source);
/* Callback registration helpers. */
-_PROTOTYPE( void sef_setcb_ping_reply, (sef_cb_ping_reply_t cb));
+void sef_setcb_ping_reply(sef_cb_ping_reply_t cb);
/* Predefined callback implementations. */
-_PROTOTYPE( void sef_cb_ping_reply_null, (endpoint_t source) );
+void sef_cb_ping_reply_null(endpoint_t source);
-_PROTOTYPE( void sef_cb_ping_reply_pong, (endpoint_t source) );
+void sef_cb_ping_reply_pong(endpoint_t source);
/* Macros for predefined callback implementations. */
#define SEF_CB_PING_REPLY_NULL sef_cb_ping_reply_null
typedef int(*sef_cb_lu_response_t)(message *m_ptr);
/* Callback registration helpers. */
-_PROTOTYPE( void sef_setcb_lu_prepare, (sef_cb_lu_prepare_t cb) );
-_PROTOTYPE( void sef_setcb_lu_state_isvalid, (sef_cb_lu_state_isvalid_t cb) );
-_PROTOTYPE( void sef_setcb_lu_state_changed, (sef_cb_lu_state_changed_t cb) );
-_PROTOTYPE( void sef_setcb_lu_state_dump, (sef_cb_lu_state_dump_t cb) );
-_PROTOTYPE( void sef_setcb_lu_state_save, (sef_cb_lu_state_save_t cb) );
-_PROTOTYPE( void sef_setcb_lu_response, (sef_cb_lu_response_t cb) );
+void sef_setcb_lu_prepare(sef_cb_lu_prepare_t cb);
+void sef_setcb_lu_state_isvalid(sef_cb_lu_state_isvalid_t cb);
+void sef_setcb_lu_state_changed(sef_cb_lu_state_changed_t cb);
+void sef_setcb_lu_state_dump(sef_cb_lu_state_dump_t cb);
+void sef_setcb_lu_state_save(sef_cb_lu_state_save_t cb);
+void sef_setcb_lu_response(sef_cb_lu_response_t cb);
/* Predefined callback implementations. */
-_PROTOTYPE( int sef_cb_lu_prepare_null, (int state) );
-_PROTOTYPE( int sef_cb_lu_state_isvalid_null, (int state) );
-_PROTOTYPE( void sef_cb_lu_state_changed_null, (int old_state, int state) );
-_PROTOTYPE( void sef_cb_lu_state_dump_null, (int state) );
-_PROTOTYPE( int sef_cb_lu_state_save_null, (int state) );
-_PROTOTYPE( int sef_cb_lu_response_null, (message *m_ptr) );
-
-_PROTOTYPE( int sef_cb_lu_prepare_always_ready, (int state) );
-_PROTOTYPE( int sef_cb_lu_prepare_never_ready, (int state) );
-_PROTOTYPE( int sef_cb_lu_prepare_crash, (int state) );
-_PROTOTYPE( int sef_cb_lu_state_isvalid_standard, (int state) );
-_PROTOTYPE( int sef_cb_lu_state_isvalid_workfree, (int state) );
-_PROTOTYPE( int sef_cb_lu_response_rs_reply, (message *m_ptr) );
+int sef_cb_lu_prepare_null(int state);
+int sef_cb_lu_state_isvalid_null(int state);
+void sef_cb_lu_state_changed_null(int old_state, int state);
+void sef_cb_lu_state_dump_null(int state);
+int sef_cb_lu_state_save_null(int state);
+int sef_cb_lu_response_null(message *m_ptr);
+
+int sef_cb_lu_prepare_always_ready(int state);
+int sef_cb_lu_prepare_never_ready(int state);
+int sef_cb_lu_prepare_crash(int state);
+int sef_cb_lu_state_isvalid_standard(int state);
+int sef_cb_lu_state_isvalid_workfree(int state);
+int sef_cb_lu_response_rs_reply(message *m_ptr);
/* Macros for predefined callback implementations. */
#define SEF_CB_LU_PREPARE_NULL sef_cb_lu_prepare_null
typedef int(*sef_cb_gcov_t)(message *msg);
/* Callback registration helpers. */
-_PROTOTYPE( void sef_setcb_signal_handler, (sef_cb_signal_handler_t cb));
-_PROTOTYPE( void sef_setcb_signal_manager, (sef_cb_signal_manager_t cb));
-_PROTOTYPE( void sef_setcb_gcov, (sef_cb_gcov_t cb));
+void sef_setcb_signal_handler(sef_cb_signal_handler_t cb);
+void sef_setcb_signal_manager(sef_cb_signal_manager_t cb);
+void sef_setcb_gcov(sef_cb_gcov_t cb);
/* Predefined callback implementations. */
-_PROTOTYPE( void sef_cb_signal_handler_null, (int signo) );
-_PROTOTYPE( int sef_cb_signal_manager_null, (endpoint_t target, int signo) );
+void sef_cb_signal_handler_null(int signo);
+int sef_cb_signal_manager_null(endpoint_t target, int signo);
-_PROTOTYPE( void sef_cb_signal_handler_term, (int signo) );
-_PROTOTYPE( void sef_cb_signal_handler_posix_default, (int signo) );
+void sef_cb_signal_handler_term(int signo);
+void sef_cb_signal_handler_posix_default(int signo);
/* Macros for predefined callback implementations. */
#define SEF_CB_SIGNAL_HANDLER_NULL sef_cb_signal_handler_null
} spin_t;
/* Functions. */
-_PROTOTYPE( void spin_init, (spin_t *s, u32_t usecs) );
-_PROTOTYPE( int spin_check, (spin_t *s) );
+void spin_init(spin_t *s, u32_t usecs);
+int spin_check(spin_t *s);
/* Macros. */
#include <minix/endpoint.h>
#include <minix/type.h>
-_PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where,
- size_t size) );
+int getsysinfo(endpoint_t who, int what, void *where, size_t size);
/* What system info to retrieve with sysgetinfo(). */
#define SI_PROC_TAB 2 /* copy of entire process table */
/*==========================================================================*
* Minix system library. *
*==========================================================================*/
-_PROTOTYPE( int _taskcall, (endpoint_t who, int syscallnr, message *msgptr));
-_PROTOTYPE( int _kernel_call, (int syscallnr, message *msgptr));
-
-_PROTOTYPE( int sys_abort, (int how, ...));
-_PROTOTYPE( int sys_enable_iop, (endpoint_t proc_ep));
-_PROTOTYPE( int sys_exec, (endpoint_t proc_ep, char *ptr,
- char *aout, vir_bytes initpc));
-_PROTOTYPE( int sys_fork, (endpoint_t parent, endpoint_t child, endpoint_t *,
- struct mem_map *ptr, u32_t vm, vir_bytes *));
-_PROTOTYPE( int sys_newmap, (endpoint_t proc_ep, struct mem_map *ptr));
-_PROTOTYPE( int sys_clear, (endpoint_t proc_ep));
-_PROTOTYPE( int sys_exit, (void));
-_PROTOTYPE( int sys_trace, (int req, endpoint_t proc_ep, long addr, long *data_p));
-
-_PROTOTYPE( int sys_schedule, (endpoint_t proc_ep, int priority,
- int quantum, int cpu));
-_PROTOTYPE( int sys_schedctl, (unsigned flags, endpoint_t proc_ep,
- int priority, int quantum, int cpu));
+int _taskcall(endpoint_t who, int syscallnr, message *msgptr);
+int _kernel_call(int syscallnr, message *msgptr);
+
+int sys_abort(int how, ...);
+int sys_enable_iop(endpoint_t proc_ep);
+int sys_exec(endpoint_t proc_ep, char *ptr, char *aout, vir_bytes
+ initpc);
+int sys_fork(endpoint_t parent, endpoint_t child, endpoint_t *, struct
+ mem_map *ptr, u32_t vm, vir_bytes *);
+int sys_newmap(endpoint_t proc_ep, struct mem_map *ptr);
+int sys_clear(endpoint_t proc_ep);
+int sys_exit(void);
+int sys_trace(int req, endpoint_t proc_ep, long addr, long *data_p);
+
+int sys_schedule(endpoint_t proc_ep, int priority, int quantum, int
+ cpu);
+int sys_schedctl(unsigned flags, endpoint_t proc_ep, int priority, int
+ quantum, int cpu);
/* Shorthands for sys_runctl() system call. */
#define sys_stop(proc_ep) sys_runctl(proc_ep, RC_STOP, 0)
#define sys_delay_stop(proc_ep) sys_runctl(proc_ep, RC_STOP, RC_DELAY)
#define sys_resume(proc_ep) sys_runctl(proc_ep, RC_RESUME, 0)
-_PROTOTYPE( int sys_runctl, (endpoint_t proc_ep, int action, int flags));
-
-_PROTOTYPE( int sys_update, (endpoint_t src_ep, endpoint_t dst_ep));
-_PROTOTYPE( int sys_statectl, (int request));
-_PROTOTYPE( int sys_privctl, (endpoint_t proc_ep, int req, void *p));
-_PROTOTYPE( int sys_privquery_mem, (endpoint_t proc_ep,
- phys_bytes physstart, phys_bytes physlen));
-_PROTOTYPE( int sys_setgrant, (cp_grant_t *grants, int ngrants));
-
-_PROTOTYPE( int sys_int86, (struct reg86u *reg86p));
-_PROTOTYPE( int sys_vm_setbuf, (phys_bytes base, phys_bytes size,
- phys_bytes high));
-_PROTOTYPE( int sys_vm_map, (endpoint_t proc_ep, int do_map,
- phys_bytes base, phys_bytes size, phys_bytes offset));
-_PROTOTYPE( int sys_vmctl, (endpoint_t who, int param, u32_t value));
-_PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
-_PROTOTYPE( 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 *) );
-_PROTOTYPE( int sys_vmctl_enable_paging, (void * data));
-
-_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
-_PROTOTYPE( int sys_stime, (time_t boottime));
-_PROTOTYPE( int sys_sysctl, (int ctl, char *arg1, int arg2));
-_PROTOTYPE( int sys_sysctl_stacktrace, (endpoint_t who));
-_PROTOTYPE( int sys_vmctl_get_mapping, (int index, phys_bytes *addr,
- phys_bytes *len, int *flags));
-_PROTOTYPE( int sys_vmctl_reply_mapping, (int index, vir_bytes addr));
-_PROTOTYPE( int sys_vmctl_set_addrspace, (endpoint_t who,
- phys_bytes ptroot, void *ptroot_v));
+int sys_runctl(endpoint_t proc_ep, int action, int flags);
+
+int sys_update(endpoint_t src_ep, endpoint_t dst_ep);
+int sys_statectl(int request);
+int sys_privctl(endpoint_t proc_ep, int req, void *p);
+int sys_privquery_mem(endpoint_t proc_ep, phys_bytes physstart,
+ phys_bytes physlen);
+int sys_setgrant(cp_grant_t *grants, int ngrants);
+
+int sys_int86(struct reg86u *reg86p);
+int sys_vm_setbuf(phys_bytes base, phys_bytes size, phys_bytes high);
+int sys_vm_map(endpoint_t proc_ep, int do_map, phys_bytes base,
+ phys_bytes size, phys_bytes offset);
+int sys_vmctl(endpoint_t who, int param, u32_t value);
+int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3);
+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 *);
+int sys_vmctl_enable_paging(void * data);
+
+int sys_readbios(phys_bytes address, void *buf, size_t size);
+int sys_stime(time_t boottime);
+int sys_sysctl(int ctl, char *arg1, int arg2);
+int sys_sysctl_stacktrace(endpoint_t who);
+int sys_vmctl_get_mapping(int index, phys_bytes *addr, phys_bytes *len,
+ int *flags);
+int sys_vmctl_reply_mapping(int index, vir_bytes addr);
+int sys_vmctl_set_addrspace(endpoint_t who, phys_bytes ptroot, void
+ *ptroot_v);
/* Shorthands for sys_sdevio() system call. */
sys_sdevio(DIO_SAFE_INPUT_WORD, port, ept, (void*)grant, count, offset)
#define sys_safe_outsw(port, ept, grant, offset, count) \
sys_sdevio(DIO_SAFE_OUTPUT_WORD, port, ept, (void*)grant, count, offset)
-_PROTOTYPE( int sys_sdevio, (int req, long port, endpoint_t proc_ep,
- void *buffer, int count, vir_bytes offset));
-_PROTOTYPE(void *alloc_contig, (size_t len, int flags, phys_bytes *phys));
-_PROTOTYPE(int free_contig, (void *addr, size_t len));
+int sys_sdevio(int req, long port, endpoint_t proc_ep, void *buffer, int
+ count, vir_bytes offset);
+void *alloc_contig(size_t len, int flags, phys_bytes *phys);
+int free_contig(void *addr, size_t len);
#define AC_ALIGN4K 0x01
#define AC_LOWER16M 0x02
/* Clock functionality: get system times, (un)schedule an alarm call, or
* retrieve/set a process-virtual timer.
*/
-_PROTOTYPE( int sys_times, (endpoint_t proc_ep, clock_t *user_time,
- clock_t *sys_time, clock_t *uptime, time_t *boottime));
-_PROTOTYPE(int sys_setalarm, (clock_t exp_time, int abs_time));
-_PROTOTYPE( int sys_vtimer, (endpoint_t proc_nr, int which, clock_t *newval,
- clock_t *oldval));
+int sys_times(endpoint_t proc_ep, clock_t *user_time, clock_t *sys_time,
+ clock_t *uptime, time_t *boottime);
+int sys_setalarm(clock_t exp_time, int abs_time);
+int sys_vtimer(endpoint_t proc_nr, int which, clock_t *newval, clock_t
+ *oldval);
/* Shorthands for sys_irqctl() system call. */
#define sys_irqdisable(hook_id) \
sys_irqctl(IRQ_SETPOLICY, irq_vec, policy, hook_id)
#define sys_irqrmpolicy(hook_id) \
sys_irqctl(IRQ_RMPOLICY, 0, 0, hook_id)
-_PROTOTYPE ( int sys_irqctl, (int request, int irq_vec, int policy,
- int *irq_hook_id) );
+int sys_irqctl(int request, int irq_vec, int policy, int *irq_hook_id);
/* Shorthands for sys_vircopy() and sys_physcopy() system calls. */
#define sys_biosin(bios_vir, dst_vir, bytes) \
sys_vircopy(src_proc, T, src_vir, dst_proc, T, dst_vir, bytes)
#define sys_stackcopy(src_proc, src_vir, dst_proc, dst_vir, bytes) \
sys_vircopy(src_proc, S, src_vir, dst_proc, S, dst_vir, bytes)
-_PROTOTYPE(int sys_vircopy, (endpoint_t src_proc, int src_s, vir_bytes src_v,
- endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
+int sys_vircopy(endpoint_t src_proc, int src_s, vir_bytes src_v,
+ endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes);
#define sys_abscopy(src_phys, dst_phys, bytes) \
sys_physcopy(NONE, PHYS_SEG, src_phys, NONE, PHYS_SEG, dst_phys, bytes)
-_PROTOTYPE(int sys_physcopy, (endpoint_t src_proc, int src_seg, vir_bytes src_vir,
- endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
+int sys_physcopy(endpoint_t src_proc, int src_seg, vir_bytes src_vir,
+ endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes);
/* Grant-based copy functions. */
-_PROTOTYPE(int sys_safecopyfrom, (endpoint_t source, cp_grant_id_t grant,
- vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
-_PROTOTYPE(int sys_safecopyto, (endpoint_t dest, cp_grant_id_t grant,
- vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
-_PROTOTYPE(int sys_vsafecopy, (struct vscp_vec *copyvec, int elements));
+int sys_safecopyfrom(endpoint_t source, cp_grant_id_t grant, vir_bytes
+ grant_offset, vir_bytes my_address, size_t bytes, int my_seg);
+int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes
+ grant_offset, vir_bytes my_address, size_t bytes, int my_seg);
+int sys_vsafecopy(struct vscp_vec *copyvec, int elements);
-_PROTOTYPE(int sys_memset, (unsigned long pattern,
- phys_bytes base, phys_bytes bytes));
+int sys_memset(unsigned long pattern, phys_bytes base, phys_bytes
+ bytes);
/* Grant-based map functions. */
-_PROTOTYPE(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));
-_PROTOTYPE(int sys_saferevmap_gid, (cp_grant_id_t grant));
-_PROTOTYPE(int sys_saferevmap_addr, (vir_bytes addr));
-_PROTOTYPE(int sys_safeunmap, (int my_seg, vir_bytes my_address));
-
-_PROTOTYPE(int sys_umap, (endpoint_t proc_ep, int seg, vir_bytes vir_addr,
- vir_bytes bytes, phys_bytes *phys_addr));
-_PROTOTYPE(int sys_umap_data_fb, (endpoint_t proc_ep, vir_bytes vir_addr,
- vir_bytes bytes, phys_bytes *phys_addr));
-_PROTOTYPE(int sys_umap_remote, (endpoint_t proc_ep, endpoint_t grantee,
- int seg, vir_bytes vir_addr, vir_bytes bytes, phys_bytes *phys_addr));
-_PROTOTYPE(int sys_vumap, (endpoint_t endpt, struct vumap_vir *vvec,
+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);
+int sys_saferevmap_gid(cp_grant_id_t grant);
+int sys_saferevmap_addr(vir_bytes addr);
+int sys_safeunmap(int my_seg, vir_bytes my_address);
+
+int sys_vumap(endpoint_t endpt, struct vumap_vir *vvec,
int vcount, size_t offset, int access, struct vumap_phys *pvec,
- int *pcount));
+ int *pcount);
+int sys_umap(endpoint_t proc_ep, int seg, vir_bytes vir_addr, vir_bytes
+ bytes, phys_bytes *phys_addr);
+int sys_umap_data_fb(endpoint_t proc_ep, vir_bytes vir_addr, vir_bytes
+ bytes, phys_bytes *phys_addr);
+int sys_umap_remote(endpoint_t proc_ep, endpoint_t grantee, int seg,
+ vir_bytes vir_addr, vir_bytes bytes, phys_bytes *phys_addr);
/* Shorthands for sys_getinfo() system call. */
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
#define sys_getpriv(dst, nr) sys_getinfo(GET_PRIV, dst, 0,0, nr)
#define sys_getidletsc(dst) sys_getinfo(GET_IDLETSC, dst, 0,0,0)
#define sys_getregs(dst,nr) sys_getinfo(GET_REGS, dst, 0,0, nr)
-_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
- void *val_ptr2, int val_len2) );
-_PROTOTYPE(int sys_whoami, (endpoint_t *ep, char *name, int namelen,
- int *priv_flags));
+int sys_getinfo(int request, void *val_ptr, int val_len, void *val_ptr2,
+ int val_len2);
+int sys_whoami(endpoint_t *ep, char *name, int namelen, int
+ *priv_flags);
/* Signal control. */
-_PROTOTYPE(int sys_kill, (endpoint_t proc_ep, int sig) );
-_PROTOTYPE(int sys_sigsend, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
-_PROTOTYPE(int sys_sigreturn, (endpoint_t proc_ep, struct sigmsg *sig_ctxt) );
-_PROTOTYPE(int sys_getksig, (endpoint_t *proc_ep, sigset_t *k_sig_map) );
-_PROTOTYPE(int sys_endksig, (endpoint_t proc_ep) );
+int sys_kill(endpoint_t proc_ep, int sig);
+int sys_sigsend(endpoint_t proc_ep, struct sigmsg *sig_ctxt);
+int sys_sigreturn(endpoint_t proc_ep, struct sigmsg *sig_ctxt);
+int sys_getksig(endpoint_t *proc_ep, sigset_t *k_sig_map);
+int sys_endksig(endpoint_t proc_ep);
/* NOTE: two different approaches were used to distinguish the device I/O
* types 'byte', 'word', 'long': the latter uses #define and results in a
* smaller implementation, but looses the static type checking.
*/
-_PROTOTYPE(int sys_voutb, (pvb_pair_t *pvb_pairs, int nr_ports) );
-_PROTOTYPE(int sys_voutw, (pvw_pair_t *pvw_pairs, int nr_ports) );
-_PROTOTYPE(int sys_voutl, (pvl_pair_t *pvl_pairs, int nr_ports) );
-_PROTOTYPE(int sys_vinb, (pvb_pair_t *pvb_pairs, int nr_ports) );
-_PROTOTYPE(int sys_vinw, (pvw_pair_t *pvw_pairs, int nr_ports) );
-_PROTOTYPE(int sys_vinl, (pvl_pair_t *pvl_pairs, int nr_ports) );
+int sys_voutb(pvb_pair_t *pvb_pairs, int nr_ports);
+int sys_voutw(pvw_pair_t *pvw_pairs, int nr_ports);
+int sys_voutl(pvl_pair_t *pvl_pairs, int nr_ports);
+int sys_vinb(pvb_pair_t *pvb_pairs, int nr_ports);
+int sys_vinw(pvw_pair_t *pvw_pairs, int nr_ports);
+int sys_vinl(pvl_pair_t *pvl_pairs, int nr_ports);
/* Shorthands for sys_out() system call. */
#define sys_outb(p,v) sys_out((p), (u32_t) (v), _DIO_BYTE)
#define sys_outw(p,v) sys_out((p), (u32_t) (v), _DIO_WORD)
#define sys_outl(p,v) sys_out((p), (u32_t) (v), _DIO_LONG)
-_PROTOTYPE(int sys_out, (int port, u32_t value, int type) );
+int sys_out(int port, u32_t value, int type);
/* Shorthands for sys_in() system call. */
#define sys_inb(p,v) sys_in((p), (v), _DIO_BYTE)
#define sys_inw(p,v) sys_in((p), (v), _DIO_WORD)
#define sys_inl(p,v) sys_in((p), (v), _DIO_LONG)
-_PROTOTYPE(int sys_in, (int port, u32_t *value, int type) );
+int sys_in(int port, u32_t *value, int type);
/* pci.c */
-_PROTOTYPE( void pci_init, (void) );
-_PROTOTYPE( int pci_first_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
-_PROTOTYPE( int pci_next_dev, (int *devindp, u16_t *vidp, u16_t *didp) );
-_PROTOTYPE( int pci_find_dev, (u8_t bus, u8_t dev, u8_t func,
- int *devindp) );
-_PROTOTYPE( void pci_reserve, (int devind) );
-_PROTOTYPE( int pci_reserve_ok, (int devind) );
-_PROTOTYPE( void pci_ids, (int devind, u16_t *vidp, u16_t *didp) );
-_PROTOTYPE( void pci_rescan_bus, (u8_t busnr) );
-_PROTOTYPE( u8_t pci_attr_r8, (int devind, int port) );
-_PROTOTYPE( u16_t pci_attr_r16, (int devind, int port) );
-_PROTOTYPE( u32_t pci_attr_r32, (int devind, int port) );
-_PROTOTYPE( void pci_attr_w8, (int devind, int port, u8_t value) );
-_PROTOTYPE( void pci_attr_w16, (int devind, int port, u16_t value) );
-_PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) );
-_PROTOTYPE( char *pci_dev_name, (u16_t vid, u16_t did) );
-_PROTOTYPE( char *pci_slot_name, (int devind) );
-_PROTOTYPE( int pci_set_acl, (struct rs_pci *rs_pci) );
-_PROTOTYPE( int pci_del_acl, (endpoint_t proc_ep) );
-_PROTOTYPE( int pci_get_bar, (int devind, int port, u32_t *base,
- u32_t *size, int *ioflag) );
+void pci_init(void);
+int pci_first_dev(int *devindp, u16_t *vidp, u16_t *didp);
+int pci_next_dev(int *devindp, u16_t *vidp, u16_t *didp);
+int pci_find_dev(u8_t bus, u8_t dev, u8_t func, int *devindp);
+void pci_reserve(int devind);
+int pci_reserve_ok(int devind);
+void pci_ids(int devind, u16_t *vidp, u16_t *didp);
+void pci_rescan_bus(u8_t busnr);
+u8_t pci_attr_r8(int devind, int port);
+u16_t pci_attr_r16(int devind, int port);
+u32_t pci_attr_r32(int devind, int port);
+void pci_attr_w8(int devind, int port, u8_t value);
+void pci_attr_w16(int devind, int port, u16_t value);
+void pci_attr_w32(int devind, int port, u32_t value);
+char *pci_dev_name(u16_t vid, u16_t did);
+char *pci_slot_name(int devind);
+int pci_set_acl(struct rs_pci *rs_pci);
+int pci_del_acl(endpoint_t proc_ep);
+int pci_get_bar(int devind, int port, u32_t *base, u32_t *size, int
+ *ioflag);
/* Profiling. */
-_PROTOTYPE( int sys_sprof, (int action, int size, int freq, int type,
- endpoint_t endpt, void *ctl_ptr, void *mem_ptr) );
-_PROTOTYPE( int sys_cprof, (int action, int size, endpoint_t endpt,
- void *ctl_ptr, void *mem_ptr) );
-_PROTOTYPE( int sys_profbuf, (void *ctl_ptr, void *mem_ptr) );
+int sys_sprof(int action, int size, int freq, int type, endpoint_t
+ endpt, void *ctl_ptr, void *mem_ptr);
+int sys_cprof(int action, int size, endpoint_t endpt, void *ctl_ptr,
+ void *mem_ptr);
+int sys_profbuf(void *ctl_ptr, void *mem_ptr);
/* machine context */
-_PROTOTYPE( int sys_getmcontext, (endpoint_t proc, mcontext_t *mcp) );
-_PROTOTYPE( int sys_setmcontext, (endpoint_t proc, mcontext_t *mcp) );
+int sys_getmcontext(endpoint_t proc, mcontext_t *mcp);
+int sys_setmcontext(endpoint_t proc, mcontext_t *mcp);
/* input */
-_PROTOTYPE( int tty_input_inject, (int type, int code, int val) );
+int tty_input_inject(int type, int code, int val);
#endif /* _SYSLIB_H */
extern int env_argc;
extern char **env_argv;
-_PROTOTYPE( void env_setargs, (int argc, char *argv[]) );
-_PROTOTYPE( int env_get_param, (char *key, char *value, int max_size) );
-_PROTOTYPE( int env_prefix, (char *env, char *prefix) );
-_PROTOTYPE( void env_panic, (char *key) );
-_PROTOTYPE( int env_parse, (char *env, char *fmt, int field, long *param,
- long min, long max) );
+void env_setargs(int argc, char *argv[]);
+int env_get_param(char *key, char *value, int max_size);
+int env_prefix(char *env, char *prefix);
+void env_panic(char *key);
+int env_parse(char *env, char *fmt, int field, long *param, long min,
+ long max);
#define fkey_map(fkeys, sfkeys) fkey_ctl(FKEY_MAP, (fkeys), (sfkeys))
#define fkey_unmap(fkeys, sfkeys) fkey_ctl(FKEY_UNMAP, (fkeys), (sfkeys))
#define fkey_events(fkeys, sfkeys) fkey_ctl(FKEY_EVENTS, (fkeys), (sfkeys))
-_PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys) );
-
-_PROTOTYPE( int printf, (const char *fmt, ...));
-_PROTOTYPE( void kputc, (int c));
-_PROTOTYPE( __dead void panic, (const char *fmt, ...));
-_PROTOTYPE( int getuptime, (clock_t *ticks));
-_PROTOTYPE( int getuptime2, (clock_t *ticks, time_t *boottime));
-_PROTOTYPE( int tickdelay, (clock_t ticks));
-_PROTOTYPE( int tsc_calibrate, (void));
-_PROTOTYPE( u32_t sys_hz, (void));
-_PROTOTYPE( double getidle, (void));
-_PROTOTYPE( void util_stacktrace, (void));
-_PROTOTYPE( void util_nstrcat, (char *str, unsigned long n) );
-_PROTOTYPE( void util_stacktrace_strcat, (char *));
-_PROTOTYPE( int micro_delay, (u32_t micros));
-_PROTOTYPE( u32_t tsc_64_to_micros, (u64_t tsc));
-_PROTOTYPE( u32_t tsc_to_micros, (u32_t low, u32_t high));
-_PROTOTYPE( u32_t tsc_get_khz, (void));
-_PROTOTYPE( u32_t micros_to_ticks, (u32_t micros));
-_PROTOTYPE( void ser_putc, (char c));
-_PROTOTYPE( void get_randomness, (struct k_randomness *, int));
-_PROTOTYPE( u32_t sqrt_approx, (u32_t));
+int fkey_ctl(int req, int *fkeys, int *sfkeys);
+
+int printf(const char *fmt, ...);
+void kputc(int c);
+__dead void panic(const char *fmt, ...);
+int getuptime(clock_t *ticks);
+int getuptime2(clock_t *ticks, time_t *boottime);
+int tickdelay(clock_t ticks);
+int tsc_calibrate(void);
+u32_t sys_hz(void);
+double getidle(void);
+void util_stacktrace(void);
+void util_nstrcat(char *str, unsigned long n);
+void util_stacktrace_strcat(char *);
+int micro_delay(u32_t micros);
+u32_t tsc_64_to_micros(u64_t tsc);
+u32_t tsc_to_micros(u32_t low, u32_t high);
+u32_t tsc_get_khz(void);
+u32_t micros_to_ticks(u32_t micros);
+void ser_putc(char c);
+void get_randomness(struct k_randomness *, int);
+u32_t sqrt_approx(u32_t);
#define asynsend(ep, msg) asynsend3(ep, msg, 0)
-_PROTOTYPE( int asynsend3, (endpoint_t ep, message *msg, int flags));
-_PROTOTYPE( int asyn_geterror, (endpoint_t *dst, message *msg, int *err));
+int asynsend3(endpoint_t ep, message *msg, int flags);
+int asyn_geterror(endpoint_t *dst, message *msg, int *err);
#define ASSERT(c) if(!(c)) { panic("%s:%d: assert %s failed", __FILE__, __LINE__, #c); }
#include <timers.h>
-_PROTOTYPE( void init_timer, (timer_t *tp));
-_PROTOTYPE( void set_timer, (timer_t *tp, int ticks, tmr_func_t watchdog,
- int arg));
-_PROTOTYPE( void cancel_timer, (timer_t *tp));
-_PROTOTYPE( void expire_timers, (clock_t now));
+void init_timer(timer_t *tp);
+void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg);
+void cancel_timer(timer_t *tp);
+void expire_timers(clock_t now);
#endif /* _MINIX_TIMERS_H */
#include <minix/types.h>
#include <minix/endpoint.h>
-_PROTOTYPE( int vm_exit, (endpoint_t ep));
-_PROTOTYPE( int vm_fork, (endpoint_t ep, int slotno, endpoint_t *child_ep));
-_PROTOTYPE( int vm_brk, (endpoint_t ep, char *newaddr));
-_PROTOTYPE( int vm_exec_newmem, (endpoint_t ep, struct exec_newmem *args,
- int args_bytes, char **ret_stack_top, int *ret_flags));
-_PROTOTYPE( int vm_push_sig, (endpoint_t ep, vir_bytes *old_sp));
-_PROTOTYPE( int vm_willexit, (endpoint_t ep));
-_PROTOTYPE( int vm_adddma, (endpoint_t proc_e, phys_bytes start,
- phys_bytes size));
-_PROTOTYPE( int vm_deldma, (endpoint_t proc_e, phys_bytes start,
- phys_bytes size));
-_PROTOTYPE( int vm_getdma, (endpoint_t *procp, phys_bytes *basep,
- phys_bytes *sizep));
-_PROTOTYPE( void *vm_map_phys, (endpoint_t who, void *physaddr, size_t len));
-_PROTOTYPE( int vm_unmap_phys, (endpoint_t who, void *vaddr, size_t len));
+int vm_exit(endpoint_t ep);
+int vm_fork(endpoint_t ep, int slotno, endpoint_t *child_ep);
+int vm_brk(endpoint_t ep, char *newaddr);
+int vm_exec_newmem(endpoint_t ep, struct exec_newmem *args, int
+ args_bytes, char **ret_stack_top, int *ret_flags);
+int vm_push_sig(endpoint_t ep, vir_bytes *old_sp);
+int vm_willexit(endpoint_t ep);
+int vm_adddma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
+int vm_deldma(endpoint_t proc_e, phys_bytes start, phys_bytes size);
+int vm_getdma(endpoint_t *procp, phys_bytes *basep, phys_bytes *sizep);
+void *vm_map_phys(endpoint_t who, void *physaddr, size_t len);
+int vm_unmap_phys(endpoint_t who, void *vaddr, size_t len);
-_PROTOTYPE( int vm_notify_sig, (endpoint_t ep, endpoint_t ipc_ep));
-_PROTOTYPE( int vm_set_priv, (int procnr, void *buf));
-_PROTOTYPE( int vm_update, (endpoint_t src_e, endpoint_t dst_e));
-_PROTOTYPE( int vm_memctl, (endpoint_t ep, int req));
-_PROTOTYPE( int vm_query_exit, (endpoint_t *endpt));
-_PROTOTYPE( int vm_watch_exit, (endpoint_t ep));
-_PROTOTYPE( int vm_forgetblock, (u64_t id));
-_PROTOTYPE( void vm_forgetblocks, (void));
-_PROTOTYPE( int vm_yield_block_get_block, (u64_t yieldid, u64_t getid,
- void *mem, vir_bytes len));
+int vm_notify_sig(endpoint_t ep, endpoint_t ipc_ep);
+int vm_set_priv(int procnr, void *buf);
+int vm_update(endpoint_t src_e, endpoint_t dst_e);
+int vm_memctl(endpoint_t ep, int req);
+int vm_query_exit(endpoint_t *endpt);
+int vm_watch_exit(endpoint_t ep);
+int vm_forgetblock(u64_t id);
+void vm_forgetblocks(void);
+int vm_yield_block_get_block(u64_t yieldid, u64_t getid, void *mem,
+ vir_bytes len);
/* Invalid ID with special meaning for the vm_yield_block_get_block
* interface.
#define MAX_VRI_COUNT 64 /* max. number of regions provided at once */
-_PROTOTYPE( int vm_info_stats, (struct vm_stats_info *vfi) );
-_PROTOTYPE( int vm_info_usage, (endpoint_t who,
- struct vm_usage_info *vui) );
-_PROTOTYPE( int vm_info_region, (endpoint_t who,
- struct vm_region_info *vri, int count, vir_bytes *next) );
+int vm_info_stats(struct vm_stats_info *vfi);
+int vm_info_usage(endpoint_t who, struct vm_usage_info *vui);
+int vm_info_region(endpoint_t who, struct vm_region_info *vri, int
+ count, vir_bytes *next);
#endif /* _MINIX_VM_H */
/* Generates prototypes and inline functions */
-#define SPLAY_PROTOTYPE(name, type, field, cmp) \
-void name##_SPLAY(struct name *, struct type *); \
void name##_SPLAY_MINMAX(struct name *, int); \
struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
} while (/*CONSTCOND*/ 0)
/* Generates prototypes and inline functions */
-#define RB_PROTOTYPE(name, type, field, cmp) \
- RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
-#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
- RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
-#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
-attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
attr struct type *name##_RB_INSERT(struct name *, struct type *); \
* can be used to operate on the lists of timers. Adding a timer to a list
* automatically takes care of removing it.
*/
-_PROTOTYPE( clock_t tmrs_clrtimer, (timer_t **tmrs, timer_t *tp, clock_t *new_head) );
-_PROTOTYPE( void tmrs_exptimers, (timer_t **tmrs, clock_t now, clock_t *new_head) );
-_PROTOTYPE( clock_t tmrs_settimer, (timer_t **tmrs, timer_t *tp,
- clock_t exp_time, tmr_func_t watchdog, clock_t *new_head) );
+clock_t tmrs_clrtimer(timer_t **tmrs, timer_t *tp, clock_t *new_head);
+void tmrs_exptimers(timer_t **tmrs, clock_t now, clock_t *new_head);
+clock_t tmrs_settimer(timer_t **tmrs, timer_t *tp, clock_t exp_time,
+ tmr_func_t watchdog, clock_t *new_head);
#define PRINT_STATS(cum_spenttime, cum_instances) { \
if(ex64hi(cum_spenttime)) { util_stacktrace(); printf(" ( ??? %lu %lu)\n", \
u32_t global_int;
};
-_PROTOTYPE(void acpi_init, (void));
+void acpi_init(void);
/*
* Returns a pointer to the io acpi structure in the MADT table in ACPI. The
* pointer is valid only until paging is turned off. No memory is allocated in
* this function thus no memory needs to be freed
*/
-_PROTOTYPE(struct acpi_madt_ioapic * acpi_get_ioapic_next, (void));
+struct acpi_madt_ioapic * acpi_get_ioapic_next(void);
/* same as above for local APICs */
-_PROTOTYPE(struct acpi_madt_lapic * acpi_get_lapic_next, (void));
+struct acpi_madt_lapic * acpi_get_lapic_next(void);
#endif /* __ACPI_H__ */
*((u32_t *)(ioa_base + IOAPIC_IOWIN)) = val;
}
-_PROTOTYPE(void lapic_microsec_sleep, (unsigned count));
-_PROTOTYPE(void apic_idt_init, (const int reset));
+void lapic_microsec_sleep(unsigned count);
+void apic_idt_init(const int reset);
PRIVATE void ioapic_enable_pin(vir_bytes ioapic_addr, int pin)
{
EXTERN u32_t lapic_addr_vaddr; /* we remember the virtual address here until we
switch to paging */
-_PROTOTYPE (int lapic_enable, (unsigned cpu));
-_PROTOTYPE (void ioapic_unmask_irq, (unsigned irq));
-_PROTOTYPE (void ioapic_mask_irq, (unsigned irq));
-_PROTOTYPE (void ioapic_reset_pic, (void));
+int lapic_enable(unsigned cpu);
+void ioapic_unmask_irq(unsigned irq);
+void ioapic_mask_irq(unsigned irq);
+void ioapic_reset_pic(void);
EXTERN int ioapic_enabled;
EXTERN unsigned nioapics;
-_PROTOTYPE (void lapic_microsec_sleep, (unsigned count));
-_PROTOTYPE (void ioapic_disable_irqs, (u32_t irqs));
-_PROTOTYPE (void ioapic_enable_irqs, (u32_t irqs));
+void lapic_microsec_sleep(unsigned count);
+void ioapic_disable_irqs(u32_t irqs);
+void ioapic_enable_irqs(u32_t irqs);
-_PROTOTYPE (int lapic_enable, (unsigned cpu));
-_PROTOTYPE (void lapic_disable, (void));
+int lapic_enable(unsigned cpu);
+void lapic_disable(void);
-_PROTOTYPE (void ioapic_disable_all, (void));
-_PROTOTYPE (int ioapic_enable_all, (void));
+void ioapic_disable_all(void);
+int ioapic_enable_all(void);
-_PROTOTYPE(int detect_ioapics, (void));
-_PROTOTYPE(void apic_idt_init, (int reset));
+int detect_ioapics(void);
+void apic_idt_init(int reset);
#ifdef CONFIG_SMP
-_PROTOTYPE(int apic_send_startup_ipi, (unsigned cpu, phys_bytes trampoline));
-_PROTOTYPE(int apic_send_init_ipi, (unsigned cpu, phys_bytes trampoline));
-_PROTOTYPE(unsigned int apicid, (void));
-_PROTOTYPE(void ioapic_set_id, (u32_t addr, unsigned int id));
+int apic_send_startup_ipi(unsigned cpu, phys_bytes trampoline);
+int apic_send_init_ipi(unsigned cpu, phys_bytes trampoline);
+unsigned int apicid(void);
+void ioapic_set_id(u32_t addr, unsigned int id);
#else
-_PROTOTYPE(int apic_single_cpu_init, (void));
+int apic_single_cpu_init(void);
#endif
-_PROTOTYPE(void lapic_set_timer_periodic, (const unsigned freq));
-_PROTOTYPE(void lapic_set_timer_one_shot, (const u32_t value));
-_PROTOTYPE(void lapic_stop_timer, (void));
-_PROTOTYPE(void lapic_restart_timer, (void));
+void lapic_set_timer_periodic(const unsigned freq);
+void lapic_set_timer_one_shot(const u32_t value);
+void lapic_stop_timer(void);
+void lapic_restart_timer(void);
-_PROTOTYPE(void ioapic_set_irq, (unsigned irq));
-_PROTOTYPE(void ioapic_unset_irq, (unsigned irq));
+void ioapic_set_irq(unsigned irq);
+void ioapic_unset_irq(unsigned irq);
/* signal the end of interrupt handler to apic */
#define apic_eoi() do { *((volatile u32_t *) lapic_eoi_addr) = 0; } while(0)
-_PROTOTYPE(void ioapic_eoi, (int irq));
+void ioapic_eoi(int irq);
-_PROTOTYPE(void dump_apic_irq_state, (void));
+void dump_apic_irq_state(void);
-_PROTOTYPE(void apic_send_ipi, (unsigned vector, unsigned cpu, int type));
+void apic_send_ipi(unsigned vector, unsigned cpu, int type);
-_PROTOTYPE(void apic_ipi_sched_intr, (void));
-_PROTOTYPE(void apic_ipi_halt_intr, (void));
+void apic_ipi_sched_intr(void);
+void apic_ipi_halt_intr(void);
#define APIC_IPI_DEST 0
#define APIC_IPI_SELF 1
#ifndef __ASSEMBLY__
#include "kernel/kernel.h"
-_PROTOTYPE( void apic_hwint0, (void) );
-_PROTOTYPE( void apic_hwint1, (void) );
-_PROTOTYPE( void apic_hwint2, (void) );
-_PROTOTYPE( void apic_hwint3, (void) );
-_PROTOTYPE( void apic_hwint4, (void) );
-_PROTOTYPE( void apic_hwint5, (void) );
-_PROTOTYPE( void apic_hwint6, (void) );
-_PROTOTYPE( void apic_hwint7, (void) );
-_PROTOTYPE( void apic_hwint8, (void) );
-_PROTOTYPE( void apic_hwint9, (void) );
-_PROTOTYPE( void apic_hwint10, (void) );
-_PROTOTYPE( void apic_hwint11, (void) );
-_PROTOTYPE( void apic_hwint12, (void) );
-_PROTOTYPE( void apic_hwint13, (void) );
-_PROTOTYPE( void apic_hwint14, (void) );
-_PROTOTYPE( void apic_hwint15, (void) );
-_PROTOTYPE( void apic_hwint16, (void) );
-_PROTOTYPE( void apic_hwint17, (void) );
-_PROTOTYPE( void apic_hwint18, (void) );
-_PROTOTYPE( void apic_hwint19, (void) );
-_PROTOTYPE( void apic_hwint20, (void) );
-_PROTOTYPE( void apic_hwint21, (void) );
-_PROTOTYPE( void apic_hwint22, (void) );
-_PROTOTYPE( void apic_hwint23, (void) );
-_PROTOTYPE( void apic_hwint24, (void) );
-_PROTOTYPE( void apic_hwint25, (void) );
-_PROTOTYPE( void apic_hwint26, (void) );
-_PROTOTYPE( void apic_hwint27, (void) );
-_PROTOTYPE( void apic_hwint28, (void) );
-_PROTOTYPE( void apic_hwint29, (void) );
-_PROTOTYPE( void apic_hwint30, (void) );
-_PROTOTYPE( void apic_hwint31, (void) );
-_PROTOTYPE( void apic_hwint32, (void) );
-_PROTOTYPE( void apic_hwint33, (void) );
-_PROTOTYPE( void apic_hwint34, (void) );
-_PROTOTYPE( void apic_hwint35, (void) );
-_PROTOTYPE( void apic_hwint36, (void) );
-_PROTOTYPE( void apic_hwint37, (void) );
-_PROTOTYPE( void apic_hwint38, (void) );
-_PROTOTYPE( void apic_hwint39, (void) );
-_PROTOTYPE( void apic_hwint40, (void) );
-_PROTOTYPE( void apic_hwint41, (void) );
-_PROTOTYPE( void apic_hwint42, (void) );
-_PROTOTYPE( void apic_hwint43, (void) );
-_PROTOTYPE( void apic_hwint44, (void) );
-_PROTOTYPE( void apic_hwint45, (void) );
-_PROTOTYPE( void apic_hwint46, (void) );
-_PROTOTYPE( void apic_hwint47, (void) );
-_PROTOTYPE( void apic_hwint48, (void) );
-_PROTOTYPE( void apic_hwint49, (void) );
-_PROTOTYPE( void apic_hwint50, (void) );
-_PROTOTYPE( void apic_hwint51, (void) );
-_PROTOTYPE( void apic_hwint52, (void) );
-_PROTOTYPE( void apic_hwint53, (void) );
-_PROTOTYPE( void apic_hwint54, (void) );
-_PROTOTYPE( void apic_hwint55, (void) );
-_PROTOTYPE( void apic_hwint56, (void) );
-_PROTOTYPE( void apic_hwint57, (void) );
-_PROTOTYPE( void apic_hwint58, (void) );
-_PROTOTYPE( void apic_hwint59, (void) );
-_PROTOTYPE( void apic_hwint60, (void) );
-_PROTOTYPE( void apic_hwint61, (void) );
-_PROTOTYPE( void apic_hwint62, (void) );
-_PROTOTYPE( void apic_hwint63, (void) );
+void apic_hwint0(void);
+void apic_hwint1(void);
+void apic_hwint2(void);
+void apic_hwint3(void);
+void apic_hwint4(void);
+void apic_hwint5(void);
+void apic_hwint6(void);
+void apic_hwint7(void);
+void apic_hwint8(void);
+void apic_hwint9(void);
+void apic_hwint10(void);
+void apic_hwint11(void);
+void apic_hwint12(void);
+void apic_hwint13(void);
+void apic_hwint14(void);
+void apic_hwint15(void);
+void apic_hwint16(void);
+void apic_hwint17(void);
+void apic_hwint18(void);
+void apic_hwint19(void);
+void apic_hwint20(void);
+void apic_hwint21(void);
+void apic_hwint22(void);
+void apic_hwint23(void);
+void apic_hwint24(void);
+void apic_hwint25(void);
+void apic_hwint26(void);
+void apic_hwint27(void);
+void apic_hwint28(void);
+void apic_hwint29(void);
+void apic_hwint30(void);
+void apic_hwint31(void);
+void apic_hwint32(void);
+void apic_hwint33(void);
+void apic_hwint34(void);
+void apic_hwint35(void);
+void apic_hwint36(void);
+void apic_hwint37(void);
+void apic_hwint38(void);
+void apic_hwint39(void);
+void apic_hwint40(void);
+void apic_hwint41(void);
+void apic_hwint42(void);
+void apic_hwint43(void);
+void apic_hwint44(void);
+void apic_hwint45(void);
+void apic_hwint46(void);
+void apic_hwint47(void);
+void apic_hwint48(void);
+void apic_hwint49(void);
+void apic_hwint50(void);
+void apic_hwint51(void);
+void apic_hwint52(void);
+void apic_hwint53(void);
+void apic_hwint54(void);
+void apic_hwint55(void);
+void apic_hwint56(void);
+void apic_hwint57(void);
+void apic_hwint58(void);
+void apic_hwint59(void);
+void apic_hwint60(void);
+void apic_hwint61(void);
+void apic_hwint62(void);
+void apic_hwint63(void);
/* The local APIC timer tick handlers */
-_PROTOTYPE(void lapic_timer_int_handler, (void));
-_PROTOTYPE(void apic_spurios_intr, (void));
-_PROTOTYPE(void apic_error_intr, (void));
+void lapic_timer_int_handler(void);
+void apic_spurios_intr(void);
+void apic_error_intr(void);
#endif
#include "glo.h"
-_PROTOTYPE(void trampoline, (void));
+void trampoline(void);
/*
* arguments for trampoline. We need to pass the logical cpu id, gdt and idt.
SPINLOCK_DEFINE(smp_cpu_lock)
SPINLOCK_DEFINE(dispq_lock)
-FORWARD _PROTOTYPE(void smp_reinit_vars, (void));
+FORWARD void smp_reinit_vars(void);
/*
* copies the 16-bit AP trampoline code to the first 1M of memory
PUBLIC void * k_stacks;
-FORWARD _PROTOTYPE( void ser_debug, (int c));
+FORWARD void ser_debug(int c);
#ifdef CONFIG_SMP
-FORWARD _PROTOTYPE( void ser_dump_proc_cpu, (void));
+FORWARD void ser_dump_proc_cpu(void);
#endif
#if !CONFIG_OXPCIE
-FORWARD _PROTOTYPE( void ser_init, (void));
+FORWARD void ser_init(void);
#endif
PUBLIC __dead void arch_monitor(void)
#include "../apic_asm.h"
-_PROTOTYPE(int init_8253A_timer, (unsigned freq));
-_PROTOTYPE(void stop_8253A_timer, (void));
+int init_8253A_timer(unsigned freq);
+void stop_8253A_timer(void);
#endif /* __CLOCK_X86_H__ */
#ifndef __ASSEMBLY__
/* Hardware interrupt handlers. */
-_PROTOTYPE( void hwint00, (void) );
-_PROTOTYPE( void hwint01, (void) );
-_PROTOTYPE( void hwint02, (void) );
-_PROTOTYPE( void hwint03, (void) );
-_PROTOTYPE( void hwint04, (void) );
-_PROTOTYPE( void hwint05, (void) );
-_PROTOTYPE( void hwint06, (void) );
-_PROTOTYPE( void hwint07, (void) );
-_PROTOTYPE( void hwint08, (void) );
-_PROTOTYPE( void hwint09, (void) );
-_PROTOTYPE( void hwint10, (void) );
-_PROTOTYPE( void hwint11, (void) );
-_PROTOTYPE( void hwint12, (void) );
-_PROTOTYPE( void hwint13, (void) );
-_PROTOTYPE( void hwint14, (void) );
-_PROTOTYPE( void hwint15, (void) );
+void hwint00(void);
+void hwint01(void);
+void hwint02(void);
+void hwint03(void);
+void hwint04(void);
+void hwint05(void);
+void hwint06(void);
+void hwint07(void);
+void hwint08(void);
+void hwint09(void);
+void hwint10(void);
+void hwint11(void);
+void hwint12(void);
+void hwint13(void);
+void hwint14(void);
+void hwint15(void);
/* Exception handlers (real or protected mode), in numerical order. */
-void _PROTOTYPE( int00, (void) ), _PROTOTYPE( divide_error, (void) );
-void _PROTOTYPE( int01, (void) ), _PROTOTYPE( single_step_exception, (void) );
-void _PROTOTYPE( int02, (void) ), _PROTOTYPE( nmi, (void) );
-void _PROTOTYPE( int03, (void) ), _PROTOTYPE( breakpoint_exception, (void) );
-void _PROTOTYPE( int04, (void) ), _PROTOTYPE( overflow, (void) );
-void _PROTOTYPE( int05, (void) ), _PROTOTYPE( bounds_check, (void) );
-void _PROTOTYPE( int06, (void) ), _PROTOTYPE( inval_opcode, (void) );
-void _PROTOTYPE( int07, (void) ), _PROTOTYPE( copr_not_available, (void) );
-void _PROTOTYPE( double_fault, (void) );
-void _PROTOTYPE( copr_seg_overrun, (void) );
-void _PROTOTYPE( inval_tss, (void) );
-void _PROTOTYPE( segment_not_present, (void) );
-void _PROTOTYPE( stack_exception, (void) );
-void _PROTOTYPE( general_protection, (void) );
-void _PROTOTYPE( page_fault, (void) );
-void _PROTOTYPE( copr_error, (void) );
-void _PROTOTYPE( alignment_check, (void) );
-void _PROTOTYPE( machine_check, (void) );
-void _PROTOTYPE( simd_exception, (void) );
+void int00(void), divide_error (void);
+void int01(void), single_step_exception (void);
+void int02(void), nmi (void);
+void int03(void), breakpoint_exception (void);
+void int04(void), overflow (void);
+void int05(void), bounds_check (void);
+void int06(void), inval_opcode (void);
+void int07(void), copr_not_available (void);
+void double_fault(void);
+void copr_seg_overrun(void);
+void inval_tss(void);
+void segment_not_present(void);
+void stack_exception(void);
+void general_protection(void);
+void page_fault(void);
+void copr_error(void);
+void alignment_check(void);
+void machine_check(void);
+void simd_exception(void);
/* Software interrupt handlers, in numerical order. */
-_PROTOTYPE( void trp, (void) );
-_PROTOTYPE( void ipc_entry, (void) );
-_PROTOTYPE( void kernel_call_entry, (void) );
-_PROTOTYPE( void level0_call, (void) );
+void trp(void);
+void ipc_entry(void);
+void kernel_call_entry(void);
+void level0_call(void);
/* memory.c */
-_PROTOTYPE( void segmentation2paging, (struct proc * current));
-_PROTOTYPE( void i386_freepde, (int pde));
-_PROTOTYPE( void getcr3val, (void));
+void segmentation2paging(struct proc * current);
+void i386_freepde(int pde);
+void getcr3val(void);
/* exception.c */
reg_t ss; /* undefined if trap is nested */
};
-_PROTOTYPE( void exception, (struct exception_frame * frame));
+void exception(struct exception_frame * frame);
/* klib386.s */
-_PROTOTYPE( __dead void monitor, (void) );
-_PROTOTYPE( __dead void reset, (void) );
-_PROTOTYPE( __dead void x86_triplefault, (void) );
-_PROTOTYPE( void int86, (void) );
-_PROTOTYPE( reg_t read_cr0, (void) );
-_PROTOTYPE( reg_t read_cr2, (void) );
-_PROTOTYPE( void write_cr0, (unsigned long value) );
-_PROTOTYPE( unsigned long read_cr4, (void) );
-_PROTOTYPE( void write_cr4, (unsigned long value) );
-_PROTOTYPE( void write_cr3, (unsigned long value) );
-_PROTOTYPE( unsigned long read_cpu_flags, (void) );
-_PROTOTYPE( void phys_insb, (u16_t port, phys_bytes buf, size_t count) );
-_PROTOTYPE( void phys_insw, (u16_t port, phys_bytes buf, size_t count) );
-_PROTOTYPE( void phys_outsb, (u16_t port, phys_bytes buf, size_t count) );
-_PROTOTYPE( void phys_outsw, (u16_t port, phys_bytes buf, size_t count) );
-_PROTOTYPE( u32_t read_cr3, (void) );
-_PROTOTYPE( void reload_cr3, (void) );
-_PROTOTYPE( void i386_invlpg, (phys_bytes linaddr) );
-_PROTOTYPE( void phys_memset, (phys_bytes ph, u32_t c, phys_bytes bytes));
-_PROTOTYPE( void reload_ds, (void) );
-_PROTOTYPE( void ia32_msr_read, (u32_t reg, u32_t * hi, u32_t * lo) );
-_PROTOTYPE( void ia32_msr_write, (u32_t reg, u32_t hi, u32_t lo) );
-_PROTOTYPE( void fninit, (void));
-_PROTOTYPE( void clts, (void));
-_PROTOTYPE( void fxsave, (void *));
-_PROTOTYPE( void fnsave, (void *));
-_PROTOTYPE( int fxrstor, (void *));
-_PROTOTYPE( int __fxrstor_end, (void *));
-_PROTOTYPE( int frstor, (void *));
-_PROTOTYPE( int __frstor_end, (void *));
-_PROTOTYPE( int __frstor_failure, (void *));
-_PROTOTYPE( unsigned short fnstsw, (void));
-_PROTOTYPE( void fnstcw, (unsigned short* cw));
-
-_PROTOTYPE( void switch_k_stack, (void * esp, void (* continuation)(void)));
-
-_PROTOTYPE(void __switch_address_space, (struct proc * p,
- struct proc ** __ptproc));
+__dead void monitor(void);
+__dead void reset(void);
+__dead void x86_triplefault(void);
+void int86(void);
+reg_t read_cr0(void);
+reg_t read_cr2(void);
+void write_cr0(unsigned long value);
+unsigned long read_cr4(void);
+void write_cr4(unsigned long value);
+void write_cr3(unsigned long value);
+unsigned long read_cpu_flags(void);
+void phys_insb(u16_t port, phys_bytes buf, size_t count);
+void phys_insw(u16_t port, phys_bytes buf, size_t count);
+void phys_outsb(u16_t port, phys_bytes buf, size_t count);
+void phys_outsw(u16_t port, phys_bytes buf, size_t count);
+u32_t read_cr3(void);
+void reload_cr3(void);
+void i386_invlpg(phys_bytes linaddr);
+void phys_memset(phys_bytes ph, u32_t c, phys_bytes bytes);
+void reload_ds(void);
+void ia32_msr_read(u32_t reg, u32_t * hi, u32_t * lo);
+void ia32_msr_write(u32_t reg, u32_t hi, u32_t lo);
+void fninit(void);
+void clts(void);
+void fxsave(void *);
+void fnsave(void *);
+int fxrstor(void *);
+int __fxrstor_end(void *);
+int frstor(void *);
+int __frstor_end(void *);
+int __frstor_failure(void *);
+unsigned short fnstsw(void);
+void fnstcw(unsigned short* cw);
+
+void switch_k_stack(void * esp, void (* continuation)(void));
+
+void __switch_address_space(struct proc * p, struct proc ** __ptproc);
#define switch_address_space(proc) \
__switch_address_space(proc, get_cpulocal_var_ptr(ptproc))
-_PROTOTYPE(void refresh_tlb, (void));
+void refresh_tlb(void);
/* multiboot.c */
-_PROTOTYPE( void multiboot_init, (void) );
+void multiboot_init(void);
/* protect.c */
struct tss_s {
/* u8_t iomap[0]; */
};
-_PROTOTYPE( void prot_init, (void) );
-_PROTOTYPE( void idt_init, (void) );
-_PROTOTYPE( void init_dataseg, (struct segdesc_s *segdp, phys_bytes base,
- vir_bytes size, int privilege) );
-_PROTOTYPE( void enable_iop, (struct proc *pp) );
-_PROTOTYPE( int prot_set_kern_seg_limit, (vir_bytes limit) );
-_PROTOTYPE( void printseg, (char *banner, int iscs, struct proc *pr, u32_t selector) );
-_PROTOTYPE( u32_t read_cs, (void));
-_PROTOTYPE( u32_t read_ds, (void));
-_PROTOTYPE( u32_t read_ss, (void));
+void prot_init(void);
+void idt_init(void);
+void init_dataseg(struct segdesc_s *segdp, phys_bytes base, vir_bytes
+ size, int privilege);
+void enable_iop(struct proc *pp);
+int prot_set_kern_seg_limit(vir_bytes limit);
+void printseg(char *banner, int iscs, struct proc *pr, u32_t selector);
+u32_t read_cs(void);
+u32_t read_ds(void);
+u32_t read_ss(void);
/* prototype of an interrupt vector table entry */
struct gate_table_s {
- _PROTOTYPE( void (*gate), (void) );
+ void(*gate) (void);
unsigned char vec_nr;
unsigned char privilege;
};
extern struct gate_table_s gate_table_pic[];
/* copies an array of vectors to the IDT. The last vector must be zero filled */
-_PROTOTYPE(void idt_copy_vectors, (struct gate_table_s * first));
-_PROTOTYPE(void idt_reload,(void));
+void idt_copy_vectors(struct gate_table_s * first);
+void idt_reload(void);
EXTERN void * k_boot_stktop;
EXTERN void * k_stacks_start;
#define get_k_stack_top(cpu) ((void *)(((char*)(k_stacks)) \
+ 2 * ((cpu) + 1) * K_STACK_SIZE))
-_PROTOTYPE( void, mfence(void));
+void mfence(void);
#define barrier() do { mfence(); } while(0)
#ifndef __GNUC__
/* call a function to read the stack fram pointer (%ebp) */
-_PROTOTYPE(reg_t read_ebp, (void));
+reg_t read_ebp(void);
#define get_stack_frame(__X) ((reg_t)read_ebp())
#else
/* read %ebp directly */
/*
* sets up TSS for a cpu and assigns kernel stack and cpu id
*/
-_PROTOTYPE(void tss_init, (unsigned cpu, void * kernel_stack));
-
-_PROTOTYPE( void int_gate, (unsigned vec_nr, vir_bytes offset,
- unsigned dpl_type) );
-
-_PROTOTYPE(void __copy_msg_from_user_end, (void));
-_PROTOTYPE(void __copy_msg_to_user_end, (void));
-_PROTOTYPE(void __user_copy_msg_pointer_failure, (void));
-
-_PROTOTYPE(int platform_tbl_checksum_ok, (void *ptr, unsigned int length));
-_PROTOTYPE(int platform_tbl_ptr, (phys_bytes start,
- phys_bytes end,
- unsigned increment,
- void * buff,
- unsigned size,
- phys_bytes * phys_addr,
- int ((* cmp_f)(void *))));
+void tss_init(unsigned cpu, void * kernel_stack);
+
+void int_gate(unsigned vec_nr, vir_bytes offset, unsigned dpl_type);
+
+void __copy_msg_from_user_end(void);
+void __copy_msg_to_user_end(void);
+void __user_copy_msg_pointer_failure(void);
+
+int platform_tbl_checksum_ok(void *ptr, unsigned int length);
+int platform_tbl_ptr(phys_bytes start, phys_bytes end, unsigned
+ increment, void * buff, unsigned size, phys_bytes * phys_addr, int ((*
+ cmp_f)(void *)));
/* breakpoints.c */
#define BREAKPOINT_COUNT 4
reg_t eflags;
};
-_PROTOTYPE(int i386_watchdog_start, (void));
+int i386_watchdog_start(void);
#define nmi_in_kernel(f) ((f)->cs == CS_SELECTOR)
#define __HW_INTR_X86_H__
#include "kernel/kernel.h"
-_PROTOTYPE(void irq_8259_unmask,(int irq));
-_PROTOTYPE(void irq_8259_mask,(int irq));
-_PROTOTYPE(void irq_8259_eoi, (int irq));
-_PROTOTYPE(void irq_handle,(int irq));
-_PROTOTYPE(void i8259_disable,(void));
-_PROTOTYPE(void eoi_8259_master,(void));
-_PROTOTYPE(void eoi_8259_slave,(void));
+void irq_8259_unmask(int irq);
+void irq_8259_mask(int irq);
+void irq_8259_eoi(int irq);
+void irq_handle(int irq);
+void i8259_disable(void);
+void eoi_8259_master(void);
+void eoi_8259_slave(void);
/*
* we don't use IO APIC if not configured for SMP as we cannot read any info
#include "kernel/kernel.h"
-_PROTOTYPE(void mb_cls, (void));
-_PROTOTYPE(void mb_print, (char*));
-_PROTOTYPE(void mb_print_char, (char));
-_PROTOTYPE(int mb_read_char, (unsigned char*));
+void mb_cls(void);
+void mb_print(char*);
+void mb_print_char(char);
+int mb_read_char(unsigned char*);
#endif
#define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0)
-FORWARD _PROTOTYPE( u32_t phys_get32, (phys_bytes v) );
-FORWARD _PROTOTYPE( void vm_enable_paging, (void) );
+FORWARD u32_t phys_get32(phys_bytes v);
+FORWARD void vm_enable_paging(void);
PUBLIC void segmentation2paging(struct proc * current)
-_PROTOTYPE( void oxpcie_set_vaddr, (unsigned char *vaddr));
-_PROTOTYPE( void oxpcie_putc, (char c));
-_PROTOTYPE( int oxpcie_in, (void));
+void oxpcie_set_vaddr(unsigned char *vaddr);
+void oxpcie_putc(char c);
+int oxpcie_in(void);
#include "serial.h"
PRIVATE struct gatedesc_s idt[IDT_SIZE]; /* zero-init so none present */
PUBLIC struct tss_s tss[CONFIG_MAX_CPUS]; /* zero init */
-FORWARD _PROTOTYPE( void sdesc, (struct segdesc_s *segdp, phys_bytes base,
- vir_bytes size) );
+FORWARD void sdesc(struct segdesc_s *segdp, phys_bytes base, vir_bytes
+ size);
/*===========================================================================*
* enable_iop *
/* Function prototype for PRIVATE functions.
*/
-FORWARD _PROTOTYPE( void load_update, (void));
+FORWARD void load_update(void);
/* The CLOCK's timers queue. The functions in <timers.h> operate on this.
* Each system process possesses a single synchronous alarm timer. If other
#include "kernel.h"
#include "arch_clock.h"
-_PROTOTYPE(int boot_cpu_init_timer, (unsigned freq));
-_PROTOTYPE(int app_cpu_init_timer, (unsigned freq));
+int boot_cpu_init_timer(unsigned freq);
+int app_cpu_init_timer(unsigned freq);
-_PROTOTYPE(int timer_int_handler, (void));
+int timer_int_handler(void);
-_PROTOTYPE(int init_local_timer, (unsigned freq));
+int init_local_timer(unsigned freq);
/* sto p the local timer ticking */
-_PROTOTYPE(void stop_local_timer, (void));
+void stop_local_timer(void);
/* let the time tick again with the original settings after it was stopped */
-_PROTOTYPE(void restart_local_timer, (void));
-_PROTOTYPE(int register_local_timer_handler, (irq_handler_t handler));
+void restart_local_timer(void);
+int register_local_timer_handler(irq_handler_t handler);
-_PROTOTYPE( u64_t ms_2_cpu_time, (unsigned ms));
-_PROTOTYPE( unsigned cpu_time_2_ms, (u64_t cpu_time));
+u64_t ms_2_cpu_time(unsigned ms);
+unsigned cpu_time_2_ms(u64_t cpu_time);
#endif /* __CLOCK_H__ */
char *** _penviron;
/* Prototype declarations for PRIVATE functions. */
-FORWARD _PROTOTYPE( void announce, (void));
+FORWARD void announce(void);
PUBLIC void bsp_finish_booting(void)
{
#include "arch_proto.h"
/* Scheduling and message passing functions */
-FORWARD _PROTOTYPE( void idle, (void));
+FORWARD void idle(void);
/**
* Made public for use in clock.c (for user-space scheduling)
-FORWARD _PROTOTYPE( int mini_send, (struct proc *caller_ptr, endpoint_t dst_e,
- message *m_ptr, int flags));
+FORWARD int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message
+ *m_ptr, int flags);
*/
-FORWARD _PROTOTYPE( int mini_receive, (struct proc *caller_ptr, endpoint_t src,
- message *m_ptr, int flags));
-FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr,
- asynmsg_t *table, size_t size));
-FORWARD _PROTOTYPE( int deadlock, (int function,
- register struct proc *caller, endpoint_t src_dst_e));
-FORWARD _PROTOTYPE( int try_async, (struct proc *caller_ptr) );
-FORWARD _PROTOTYPE( int try_one, (struct proc *src_ptr, struct proc *dst_ptr));
-FORWARD _PROTOTYPE( struct proc * pick_proc, (void));
-FORWARD _PROTOTYPE( void enqueue_head, (struct proc *rp));
+FORWARD 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
+ size);
+FORWARD 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);
/* all idles share the same idle_priv structure */
PRIVATE struct priv idle_priv;
EXTERN struct proc proc[NR_TASKS + NR_PROCS]; /* process table */
-_PROTOTYPE( int mini_send, (struct proc *caller_ptr, endpoint_t dst_e,
- message *m_ptr, int flags));
+int mini_send(struct proc *caller_ptr, endpoint_t dst_e, message *m_ptr,
+ int flags);
#endif /* __ASSEMBLY__ */
char sprof_sample_buffer[SAMPLE_BUFFER_SIZE];
/* Function prototype for the profiling clock handler. */
-FORWARD _PROTOTYPE( int profile_clock_handler, (irq_hook_t *hook) );
+FORWARD int profile_clock_handler(irq_hook_t *hook);
/* A hook for the profiling clock interrupt handler. */
PRIVATE irq_hook_t profile_clock_hook;
EXTERN vir_bytes sprof_data_addr_vir; /* user address to write data */
EXTERN endpoint_t sprof_ep; /* user process */
-_PROTOTYPE(void nmi_sprofile_handler, (struct nmi_frame * frame));
+void nmi_sprofile_handler(struct nmi_frame * frame);
#endif /* SPROFILE */
struct timer;
/* clock.c */
-_PROTOTYPE( clock_t get_uptime, (void) );
-_PROTOTYPE( void set_timer, (struct timer *tp, clock_t t, tmr_func_t f) );
-_PROTOTYPE( void reset_timer, (struct timer *tp) );
-_PROTOTYPE( void ser_dump_proc, (void) );
+clock_t get_uptime(void);
+void set_timer(struct timer *tp, clock_t t, tmr_func_t f);
+void reset_timer(struct timer *tp);
+void ser_dump_proc(void);
-_PROTOTYPE( void cycles_accounting_init, (void) );
+void cycles_accounting_init(void);
/*
* This functions start and stop accounting for process, kernel or idle cycles.
* It inherently have to account for some kernel cycles for process too,
* possible before returning to userspace. These function is architecture
* dependent
*/
-_PROTOTYPE( void context_stop, (struct proc * p) );
+void context_stop(struct proc * p);
/* this is a wrapper to make calling it from assembly easier */
-_PROTOTYPE( void context_stop_idle, (void) );
-_PROTOTYPE( int restore_fpu, (struct proc *) );
-_PROTOTYPE( void save_fpu, (struct proc *) );
-_PROTOTYPE( void save_local_fpu, (struct proc *, int retain) );
-_PROTOTYPE( void fpu_sigcontext, (struct proc *, struct sigframe *fr, struct sigcontext *sc) );
+void context_stop_idle(void);
+int restore_fpu(struct proc *);
+void save_fpu(struct proc *);
+void save_local_fpu(struct proc *, int retain);
+void fpu_sigcontext(struct proc *, struct sigframe *fr, struct
+ sigcontext *sc);
/* main.c */
-_PROTOTYPE( int main, (void) );
-_PROTOTYPE( void prepare_shutdown, (int how) );
-_PROTOTYPE( __dead void minix_shutdown, (struct timer *tp) );
-_PROTOTYPE( void bsp_finish_booting, (void) );
+int main(void);
+void prepare_shutdown(int how);
+__dead void minix_shutdown(struct timer *tp);
+void bsp_finish_booting(void);
/* proc.c */
-_PROTOTYPE( int do_ipc, (reg_t r1, reg_t r2, reg_t r3) );
-_PROTOTYPE( void proc_init, (void) );
-_PROTOTYPE( int cancel_async, (struct proc *src, struct proc *dst) );
-_PROTOTYPE( int has_pending_notify, (struct proc * caller, int src_p) );
-_PROTOTYPE( int has_pending_asend, (struct proc * caller, int src_p) );
-_PROTOTYPE( void unset_notify_pending, (struct proc * caller, int src_p));
-_PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) );
-_PROTOTYPE( void enqueue, (struct proc *rp) );
-_PROTOTYPE( void dequeue, (struct proc *rp) );
-_PROTOTYPE( void switch_to_user, (void) );
-_PROTOTYPE( struct proc * arch_finish_switch_to_user, (void) );
-_PROTOTYPE( struct proc *endpoint_lookup, (endpoint_t ep) );
+int do_ipc(reg_t r1, reg_t r2, reg_t r3);
+void proc_init(void);
+int cancel_async(struct proc *src, struct proc *dst);
+int has_pending_notify(struct proc * caller, int src_p);
+int has_pending_asend(struct proc * caller, int src_p);
+void unset_notify_pending(struct proc * caller, int src_p);
+int mini_notify(const struct proc *src, endpoint_t dst);
+void enqueue(struct proc *rp);
+void dequeue(struct proc *rp);
+void switch_to_user(void);
+struct proc * arch_finish_switch_to_user(void);
+struct proc *endpoint_lookup(endpoint_t ep);
#if DEBUG_ENABLE_IPC_WARNINGS
-_PROTOTYPE( int isokendpt_f, (const char *file, int line, endpoint_t e, int *p, int f));
+int isokendpt_f(const char *file, int line, endpoint_t e, int *p, int
+ f);
#define isokendpt_d(e, p, f) isokendpt_f(__FILE__, __LINE__, (e), (p), (f))
#else
-_PROTOTYPE( int isokendpt_f, (endpoint_t e, int *p, int f) );
+int isokendpt_f(endpoint_t e, int *p, int f);
#define isokendpt_d(e, p, f) isokendpt_f((e), (p), (f))
#endif
-_PROTOTYPE( void proc_no_time, (struct proc *p));
-_PROTOTYPE( void reset_proc_accounting, (struct proc *p));
-_PROTOTYPE( void flag_account, (struct proc *p, int flag));
-_PROTOTYPE( int try_deliver_senda, (struct proc *caller_ptr,
- asynmsg_t *table,
- size_t size) );
+void proc_no_time(struct proc *p);
+void reset_proc_accounting(struct proc *p);
+void flag_account(struct proc *p, int flag);
+int try_deliver_senda(struct proc *caller_ptr, asynmsg_t *table, size_t
+ size);
/* start.c */
-_PROTOTYPE( void cstart, (u16_t cs, u16_t ds, u16_t mds,
- u16_t parmoff, u16_t parmsize) );
-_PROTOTYPE( char *env_get, (const char *key));
+void cstart(u16_t cs, u16_t ds, u16_t mds, u16_t parmoff, u16_t
+ parmsize);
+char *env_get(const char *key);
/* system.c */
-_PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) );
-_PROTOTYPE( void set_sendto_bit, (const struct proc *rc, int id) );
-_PROTOTYPE( void unset_sendto_bit, (const struct proc *rc, int id) );
-_PROTOTYPE( void fill_sendto_mask, (const struct proc *rc,
- sys_map_t *map) );
-_PROTOTYPE( void send_sig, (endpoint_t proc_nr, int sig_nr) );
-_PROTOTYPE( void cause_sig, (proc_nr_t proc_nr, int sig_nr) );
-_PROTOTYPE( void sig_delay_done, (struct proc *rp) );
-_PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) );
-_PROTOTYPE( void system_init, (void) );
+int get_priv(register struct proc *rc, int proc_type);
+void set_sendto_bit(const struct proc *rc, int id);
+void unset_sendto_bit(const struct proc *rc, int id);
+void fill_sendto_mask(const struct proc *rc, sys_map_t *map);
+void send_sig(endpoint_t proc_nr, int sig_nr);
+void cause_sig(proc_nr_t proc_nr, int sig_nr);
+void sig_delay_done(struct proc *rp);
+void kernel_call(message *m_user, struct proc * caller);
+void system_init(void);
#define numap_local(proc_nr, vir_addr, bytes) \
umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
-_PROTOTYPE( void clear_endpoint, (struct proc *rc) );
-_PROTOTYPE( void clear_ipc_refs, (struct proc *rc, int caller_ret) );
-_PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes));
-_PROTOTYPE( void kernel_call_resume, (struct proc *p));
-_PROTOTYPE( int sched_proc, (struct proc *rp,
- int priority, int quantum, int cpu));
+void clear_endpoint(struct proc *rc);
+void clear_ipc_refs(struct proc *rc, int caller_ret);
+phys_bytes umap_bios(vir_bytes vir_addr, vir_bytes bytes);
+void kernel_call_resume(struct proc *p);
+int sched_proc(struct proc *rp, int priority, int quantum, int cpu);
/* system/do_newmap.c */
-_PROTOTYPE( 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);
/* system/do_vtimer.c */
-_PROTOTYPE( void vtimer_check, (struct proc *rp) );
+void vtimer_check(struct proc *rp);
/* interrupt.c */
-_PROTOTYPE( void put_irq_handler, (irq_hook_t *hook, int irq,
- irq_handler_t handler) );
-_PROTOTYPE( void rm_irq_handler, (const irq_hook_t *hook) );
-_PROTOTYPE( void enable_irq, (const irq_hook_t *hook) );
-_PROTOTYPE( int disable_irq, (const irq_hook_t *hook) );
+void put_irq_handler(irq_hook_t *hook, int irq, irq_handler_t handler);
+void rm_irq_handler(const irq_hook_t *hook);
+void enable_irq(const irq_hook_t *hook);
+int disable_irq(const irq_hook_t *hook);
-_PROTOTYPE(void interrupts_enable, (void));
-_PROTOTYPE(void interrupts_disable, (void));
+void interrupts_enable(void);
+void interrupts_disable(void);
/* debug.c */
-_PROTOTYPE( int runqueues_ok, (void) );
+int runqueues_ok(void);
#ifndef CONFIG_SMP
#define runqueues_ok_local runqueues_ok
#else
#define runqueues_ok_local() runqueues_ok_cpu(cpuid)
-_PROTOTYPE( int runqueues_ok_cpu, (unsigned cpu));
+int runqueues_ok_cpu(unsigned cpu);
#endif
-_PROTOTYPE( char *rtsflagstr, (u32_t flags) );
-_PROTOTYPE( char *miscflagstr, (u32_t flags) );
-_PROTOTYPE( char *schedulerstr, (struct proc *scheduler) );
+char *rtsflagstr(u32_t flags);
+char *miscflagstr(u32_t flags);
+char *schedulerstr(struct proc *scheduler);
/* prints process information */
-_PROTOTYPE( void print_proc, (struct proc *pp));
+void print_proc(struct proc *pp);
/* prints the given process and recursively all processes it depends on */
-_PROTOTYPE( void print_proc_recursive, (struct proc *pp));
+void print_proc_recursive(struct proc *pp);
#if DEBUG_IPC_HOOK
-_PROTOTYPE( void hook_ipc_msgrecv, (message *msg, struct proc *src,
- struct proc *dst) );
-_PROTOTYPE( void hook_ipc_msgsend, (message *msg, struct proc *src,
- struct proc *dst) );
-_PROTOTYPE( void hook_ipc_msgkcall, (message *msg, struct proc *proc) );
-_PROTOTYPE( void hook_ipc_msgkresult, (message *msg, struct proc *proc) );
-_PROTOTYPE( void hook_ipc_clear, (struct proc *proc) );
+void hook_ipc_msgrecv(message *msg, struct proc *src, struct proc *dst);
+void hook_ipc_msgsend(message *msg, struct proc *src, struct proc *dst);
+void hook_ipc_msgkcall(message *msg, struct proc *proc);
+void hook_ipc_msgkresult(message *msg, struct proc *proc);
+void hook_ipc_clear(struct proc *proc);
#endif
/* system/do_safemap.c */
-_PROTOTYPE( int map_invoke_vm, (struct proc * caller, int req_type,
- endpoint_t end_d, int seg_d, vir_bytes off_d,
- endpoint_t end_s, int seg_s, vir_bytes off_s,
- size_t size, int flag));
+int map_invoke_vm(struct proc * caller, int req_type, endpoint_t end_d,
+ int seg_d, vir_bytes off_d, endpoint_t end_s, int seg_s, vir_bytes
+ off_s, size_t size, int flag);
/* system/do_safecopy.c */
-_PROTOTYPE( int verify_grant, (endpoint_t, endpoint_t,
- cp_grant_id_t, vir_bytes, int,
- vir_bytes, vir_bytes *, endpoint_t *));
+int verify_grant(endpoint_t, endpoint_t, cp_grant_id_t, vir_bytes, int,
+ vir_bytes, vir_bytes *, endpoint_t *);
/* system/do_sysctl.c */
-_PROTOTYPE( int do_sysctl, (struct proc * caller, message *m));
+int do_sysctl(struct proc * caller, message *m);
#if SPROFILE
/* profile.c */
-_PROTOTYPE( void init_profile_clock, (u32_t) );
-_PROTOTYPE( void stop_profile_clock, (void) );
+void init_profile_clock(u32_t);
+void stop_profile_clock(void);
#endif
/* functions defined in architecture-dependent files. */
-_PROTOTYPE( void prot_init, (void) );
-_PROTOTYPE( phys_bytes phys_copy, (phys_bytes source, phys_bytes dest,
- phys_bytes count) );
-_PROTOTYPE( void phys_copy_fault, (void));
-_PROTOTYPE( void phys_copy_fault_in_kernel, (void));
+void prot_init(void);
+phys_bytes phys_copy(phys_bytes source, phys_bytes dest, phys_bytes
+ count);
+void phys_copy_fault(void);
+void phys_copy_fault_in_kernel(void);
#define virtual_copy(src, dst, bytes) \
virtual_copy_f(NULL, src, dst, bytes, 0)
#define virtual_copy_vmcheck(caller, src, dst, bytes) \
virtual_copy_f(caller, src, dst, bytes, 1)
-_PROTOTYPE( int virtual_copy_f, (struct proc * caller,
- struct vir_addr *src, struct vir_addr *dst,
- vir_bytes bytes, int vmcheck) );
-_PROTOTYPE( int data_copy, (endpoint_t from, vir_bytes from_addr,
- endpoint_t to, vir_bytes to_addr, size_t bytes));
-_PROTOTYPE( int data_copy_vmcheck, (struct proc *,
- endpoint_t from, vir_bytes from_addr,
- endpoint_t to, vir_bytes to_addr, size_t bytes));
-_PROTOTYPE( void alloc_segments, (struct proc *rp) );
-_PROTOTYPE( void vm_stop, (void) );
-_PROTOTYPE( phys_bytes umap_local, (register struct proc *rp, int seg,
- vir_bytes vir_addr, vir_bytes bytes));
-_PROTOTYPE( phys_bytes umap_virtual, (struct proc* rp,
- int seg, vir_bytes vir_addr, vir_bytes bytes) );
-_PROTOTYPE( phys_bytes seg2phys, (u16_t) );
-_PROTOTYPE( int vm_phys_memset, (phys_bytes source, u8_t pattern,
- phys_bytes count) );
-_PROTOTYPE( int intr_init, (int, int) );
-_PROTOTYPE( void halt_cpu, (void) );
-_PROTOTYPE( void arch_init, (void) );
-_PROTOTYPE( void cpu_identify, (void) );
+int virtual_copy_f(struct proc * caller, struct vir_addr *src, struct
+ vir_addr *dst, vir_bytes bytes, int vmcheck);
+int data_copy(endpoint_t from, vir_bytes from_addr, endpoint_t to,
+ vir_bytes to_addr, size_t bytes);
+int data_copy_vmcheck(struct proc *, endpoint_t from, vir_bytes
+ from_addr, endpoint_t to, vir_bytes to_addr, size_t bytes);
+void alloc_segments(struct proc *rp);
+void vm_stop(void);
+phys_bytes umap_local(register struct proc *rp, int seg, vir_bytes
+ vir_addr, vir_bytes bytes);
+phys_bytes umap_virtual(struct proc* rp, int seg, vir_bytes vir_addr,
+ vir_bytes bytes);
+phys_bytes seg2phys(u16_t);
+int vm_phys_memset(phys_bytes source, u8_t pattern, phys_bytes count);
+int intr_init(int, int);
+void halt_cpu(void);
+void arch_init(void);
+void cpu_identify(void);
/* arch dependent FPU initialization per CPU */
-_PROTOTYPE( void fpu_init, (void) );
+void fpu_init(void);
/* returns true if pfu is present and initialized */
-_PROTOTYPE( int is_fpu, (void) );
-_PROTOTYPE( void ser_putc, (char) );
-_PROTOTYPE( __dead void arch_shutdown, (int) );
-_PROTOTYPE( __dead void arch_monitor, (void) );
-_PROTOTYPE( void restore_user_context, (struct proc * p) );
-_PROTOTYPE( void read_tsc, (u32_t *high, u32_t *low) );
-_PROTOTYPE( int arch_init_profile_clock, (u32_t freq) );
-_PROTOTYPE( void arch_stop_profile_clock, (void) );
-_PROTOTYPE( void arch_ack_profile_clock, (void) );
-_PROTOTYPE( void do_ser_debug, (void) );
-_PROTOTYPE( int arch_get_params, (char *parm, int max));
-_PROTOTYPE( int arch_set_params, (char *parm, int max));
-_PROTOTYPE( void arch_pre_exec, (struct proc *pr, u32_t, u32_t));
-_PROTOTYPE( int arch_umap, (const struct proc *pr, vir_bytes, vir_bytes,
- int, phys_bytes *));
-_PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p));
-_PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
-_PROTOTYPE( int vm_lookup, (const struct proc *proc, vir_bytes virtual, phys_bytes *result, u32_t *ptent));
-_PROTOTYPE( size_t vm_lookup_range, (const struct proc *proc,
- vir_bytes vir_addr, phys_bytes *phys_addr, size_t bytes) );
-_PROTOTYPE( int vm_check_range, (struct proc *caller,
- struct proc *target, vir_bytes vir_addr, size_t bytes) );
-_PROTOTYPE( void delivermsg, (struct proc *target));
-_PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
-_PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,
- phys_bytes *len, int *flags));
-_PROTOTYPE( int arch_phys_map_reply, (int index, vir_bytes addr));
-_PROTOTYPE( int arch_enable_paging, (struct proc * caller, const message * m_ptr));
-
-_PROTOTYPE( int copy_msg_from_user, (struct proc * p, message * user_mbuf,
- message * dst));
-_PROTOTYPE( int copy_msg_to_user, (struct proc * p, message * src,
- message * user_mbuf));
-_PROTOTYPE(void switch_address_space, (struct proc * p));
-_PROTOTYPE(void release_address_space, (struct proc *pr));
-
-_PROTOTYPE(void enable_fpu_exception, (void));
-_PROTOTYPE(void disable_fpu_exception, (void));
-_PROTOTYPE(void release_fpu, (struct proc * p));
-_PROTOTYPE(void arch_pause,(void));
-_PROTOTYPE(short cpu_load, (void));
-_PROTOTYPE(void busy_delay_ms, (int ms));
+int is_fpu(void);
+void ser_putc(char);
+__dead void arch_shutdown(int);
+__dead void arch_monitor(void);
+void restore_user_context(struct proc * p);
+void read_tsc(u32_t *high, u32_t *low);
+int arch_init_profile_clock(u32_t freq);
+void arch_stop_profile_clock(void);
+void arch_ack_profile_clock(void);
+void do_ser_debug(void);
+int arch_get_params(char *parm, int max);
+int arch_set_params(char *parm, int max);
+void arch_pre_exec(struct proc *pr, u32_t, u32_t);
+int arch_umap(const struct proc *pr, vir_bytes, vir_bytes, int,
+ phys_bytes *);
+int arch_do_vmctl(message *m_ptr, struct proc *p);
+int vm_contiguous(const struct proc *targetproc, vir_bytes vir_buf,
+ size_t count);
+void proc_stacktrace(struct proc *proc);
+int vm_lookup(const struct proc *proc, vir_bytes virtual, phys_bytes
+ *result, u32_t *ptent);
+size_t vm_lookup_range(const struct proc *proc,
+ vir_bytes vir_addr, phys_bytes *phys_addr, size_t bytes);
+void delivermsg(struct proc *target);
+void arch_do_syscall(struct proc *proc);
+int arch_phys_map(int index, phys_bytes *addr, phys_bytes *len, int
+ *flags);
+int arch_phys_map_reply(int index, vir_bytes addr);
+int arch_enable_paging(struct proc * caller, const message * m_ptr);
+int vm_check_range(struct proc *caller,
+ struct proc *target, vir_bytes vir_addr, size_t bytes);
+
+int copy_msg_from_user(struct proc * p, message * user_mbuf, message *
+ dst);
+int copy_msg_to_user(struct proc * p, message * src, message *
+ user_mbuf);
+void switch_address_space(struct proc * p);
+void release_address_space(struct proc *pr);
+
+void enable_fpu_exception(void);
+void disable_fpu_exception(void);
+void release_fpu(struct proc * p);
+void arch_pause(void);
+short cpu_load(void);
+void busy_delay_ms(int ms);
/* utility.c */
-_PROTOTYPE( void cpu_print_freq, (unsigned cpu));
+void cpu_print_freq(unsigned cpu);
#endif /* __kernel__ */
#endif /* PROTO_H */
arch_send_smp_schedule_ipi(cpu);
}
-_PROTOTYPE(void smp_sched_handler, (void));
+void smp_sched_handler(void);
/*
* tell another cpu about a task to do and return only after the cpu acks that
* suboptimal, the system must be able to run on the bootstrap processor as if
* it was the only processor in the system
*/
-_PROTOTYPE(void smp_init, (void));
+void smp_init(void);
#define CPU_IS_BSP 1
#define CPU_IS_READY 2
*/
SPINLOCK_DECLARE(boot_lock)
-_PROTOTYPE(void wait_for_APs_to_finish_booting, (void));
-_PROTOTYPE(void ap_boot_finished, (unsigned cpu));
-_PROTOTYPE(void smp_shutdown_aps, (void ));
+void wait_for_APs_to_finish_booting(void);
+void ap_boot_finished(unsigned cpu);
+void smp_shutdown_aps(void );
/* IPI handlers */
-_PROTOTYPE(void smp_ipi_halt_handler, (void));
-_PROTOTYPE(void smp_ipi_sched_handler, (void));
+void smp_ipi_halt_handler(void);
+void smp_ipi_sched_handler(void);
-_PROTOTYPE(void smp_schedule, (unsigned cpu));
+void smp_schedule(unsigned cpu);
/* stop a processes on a different cpu */
-_PROTOTYPE(void smp_schedule_stop_proc, (struct proc * p));
+void smp_schedule_stop_proc(struct proc * p);
/* stop a process on a different cpu because its adress space is being changed */
-_PROTOTYPE(void smp_schedule_vminhibit, (struct proc * p));
+void smp_schedule_vminhibit(struct proc * p);
/* stop the process and for saving its full context */
-_PROTOTYPE(void smp_schedule_stop_proc_save_ctx, (struct proc * p));
+void smp_schedule_stop_proc_save_ctx(struct proc * p);
/* migrate the full context of a process to the destination CPU */
-_PROTOTYPE(void smp_schedule_migrate_proc,
- (struct proc * p, unsigned dest_cpu));
+void smp_schedule_migrate_proc(struct proc * p, unsigned dest_cpu);
-_PROTOTYPE(void arch_send_smp_schedule_ipi, (unsigned cpu));
-_PROTOTYPE(void arch_smp_halt_cpu, (void));
+void arch_send_smp_schedule_ipi(unsigned cpu);
+void arch_smp_halt_cpu(void);
/* deal with x-cpu scheduling event */
-_PROTOTYPE(void smp_sched_handler, (void));
+void smp_sched_handler(void);
#endif /* __ASSEMBLY__ */
#include "proto.h"
#include "proc.h"
-_PROTOTYPE( int do_exec, (struct proc * caller, message *m_ptr) );
+int do_exec(struct proc * caller, message *m_ptr);
#if ! USE_EXEC
#define do_exec NULL
#endif
-_PROTOTYPE( int do_fork, (struct proc * caller, message *m_ptr) );
+int do_fork(struct proc * caller, message *m_ptr);
#if ! USE_FORK
#define do_fork NULL
#endif
-_PROTOTYPE( int do_newmap, (struct proc * caller, message *m_ptr) );
+int do_newmap(struct proc * caller, message *m_ptr);
#if ! USE_NEWMAP
#define do_newmap NULL
#endif
-_PROTOTYPE( int do_clear, (struct proc * caller, message *m_ptr) );
+int do_clear(struct proc * caller, message *m_ptr);
#if ! USE_CLEAR
#define do_clear NULL
#endif
-_PROTOTYPE( int do_trace, (struct proc * caller, message *m_ptr) );
+int do_trace(struct proc * caller, message *m_ptr);
#if ! USE_TRACE
#define do_trace NULL
#endif
-_PROTOTYPE( int do_runctl, (struct proc * caller, message *m_ptr) );
+int do_runctl(struct proc * caller, message *m_ptr);
#if ! USE_RUNCTL
#define do_runctl NULL
#endif
-_PROTOTYPE( int do_update, (struct proc * caller, message *m_ptr) );
+int do_update(struct proc * caller, message *m_ptr);
#if ! USE_UPDATE
#define do_update NULL
#endif
-_PROTOTYPE( int do_exit, (struct proc * caller, message *m_ptr) );
+int do_exit(struct proc * caller, message *m_ptr);
#if ! USE_EXIT
#define do_exit NULL
#endif
-_PROTOTYPE( int do_copy, (struct proc * caller, message *m_ptr) );
+int do_copy(struct proc * caller, message *m_ptr);
#define do_vircopy do_copy
#if ! (USE_VIRCOPY || USE_PHYSCOPY)
#define do_copy NULL
#endif
-_PROTOTYPE( int do_umap, (struct proc * caller, message *m_ptr) );
+int do_umap(struct proc * caller, message *m_ptr);
#if ! USE_UMAP
#define do_umap NULL
#endif
-_PROTOTYPE( int do_umap_remote, (struct proc * caller, message *m_ptr) );
+int do_umap_remote(struct proc * caller, message *m_ptr);
#if ! USE_UMAP_REMOTE
#define do_umap_remote NULL
#endif
-_PROTOTYPE( int do_vumap, (struct proc * caller, message *m_ptr) );
+int do_vumap(struct proc * caller, message *m_ptr);
#if ! USE_VUMAP
#define do_vumap NULL
#endif
-_PROTOTYPE( int do_memset, (struct proc * caller, message *m_ptr) );
+int do_memset(struct proc * caller, message *m_ptr);
#if ! USE_MEMSET
#define do_memset NULL
#endif
-_PROTOTYPE( int do_abort, (struct proc * caller, message *m_ptr) );
+int do_abort(struct proc * caller, message *m_ptr);
#if ! USE_ABORT
#define do_abort NULL
#endif
-_PROTOTYPE( int do_getinfo, (struct proc * caller, message *m_ptr) );
+int do_getinfo(struct proc * caller, message *m_ptr);
#if ! USE_GETINFO
#define do_getinfo NULL
#endif
-_PROTOTYPE( int do_privctl, (struct proc * caller, message *m_ptr) );
+int do_privctl(struct proc * caller, message *m_ptr);
#if ! USE_PRIVCTL
#define do_privctl NULL
#endif
-_PROTOTYPE( int do_irqctl, (struct proc * caller, message *m_ptr) );
+int do_irqctl(struct proc * caller, message *m_ptr);
#if ! USE_IRQCTL
#define do_irqctl NULL
#endif
-_PROTOTYPE( int do_devio, (struct proc * caller, message *m_ptr) );
+int do_devio(struct proc * caller, message *m_ptr);
#if ! USE_DEVIO
#define do_devio NULL
#endif
-_PROTOTYPE( int do_vdevio, (struct proc * caller, message *m_ptr) );
+int do_vdevio(struct proc * caller, message *m_ptr);
#if ! USE_VDEVIO
#define do_vdevio NULL
#endif
-_PROTOTYPE( int do_int86, (struct proc * caller, message *m_ptr) );
+int do_int86(struct proc * caller, message *m_ptr);
-_PROTOTYPE( int do_sdevio, (struct proc * caller, message *m_ptr) );
+int do_sdevio(struct proc * caller, message *m_ptr);
#if ! USE_SDEVIO
#define do_sdevio NULL
#endif
-_PROTOTYPE( int do_kill, (struct proc * caller, message *m_ptr) );
+int do_kill(struct proc * caller, message *m_ptr);
#if ! USE_KILL
#define do_kill NULL
#endif
-_PROTOTYPE( int do_getksig, (struct proc * caller, message *m_ptr) );
+int do_getksig(struct proc * caller, message *m_ptr);
#if ! USE_GETKSIG
#define do_getksig NULL
#endif
-_PROTOTYPE( int do_endksig, (struct proc * caller, message *m_ptr) );
+int do_endksig(struct proc * caller, message *m_ptr);
#if ! USE_ENDKSIG
#define do_endksig NULL
#endif
-_PROTOTYPE( int do_sigsend, (struct proc * caller, message *m_ptr) );
+int do_sigsend(struct proc * caller, message *m_ptr);
#if ! USE_SIGSEND
#define do_sigsend NULL
#endif
-_PROTOTYPE( int do_sigreturn, (struct proc * caller, message *m_ptr) );
+int do_sigreturn(struct proc * caller, message *m_ptr);
#if ! USE_SIGRETURN
#define do_sigreturn NULL
#endif
-_PROTOTYPE( int do_times, (struct proc * caller, message *m_ptr) );
+int do_times(struct proc * caller, message *m_ptr);
#if ! USE_TIMES
#define do_times NULL
#endif
-_PROTOTYPE( int do_setalarm, (struct proc * caller, message *m_ptr) );
+int do_setalarm(struct proc * caller, message *m_ptr);
#if ! USE_SETALARM
#define do_setalarm NULL
#endif
-_PROTOTYPE( int do_stime, (struct proc * caller, message *m_ptr) );
+int do_stime(struct proc * caller, message *m_ptr);
-_PROTOTYPE( int do_vtimer, (struct proc * caller, message *m_ptr) );
+int do_vtimer(struct proc * caller, message *m_ptr);
#if ! USE_VTIMER
#define do_vtimer NULL
#endif
-_PROTOTYPE( int do_safecopy_to, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_safecopy_from, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_vsafecopy, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_iopenable, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_vmctl, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_setgrant, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_readbios, (struct proc * caller, message *m_ptr) );
+int do_safecopy_to(struct proc * caller, message *m_ptr);
+int do_safecopy_from(struct proc * caller, message *m_ptr);
+int do_vsafecopy(struct proc * caller, message *m_ptr);
+int do_iopenable(struct proc * caller, message *m_ptr);
+int do_vmctl(struct proc * caller, message *m_ptr);
+int do_setgrant(struct proc * caller, message *m_ptr);
+int do_readbios(struct proc * caller, message *m_ptr);
-_PROTOTYPE( int do_safemap, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_saferevmap, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_safeunmap, (struct proc * caller, message *m_ptr) );
+int do_safemap(struct proc * caller, message *m_ptr);
+int do_saferevmap(struct proc * caller, message *m_ptr);
+int do_safeunmap(struct proc * caller, message *m_ptr);
-_PROTOTYPE( int do_sprofile, (struct proc * caller, message *m_ptr) );
+int do_sprofile(struct proc * caller, message *m_ptr);
#if ! SPROFILE
#define do_sprofile NULL
#endif
-_PROTOTYPE( int do_cprofile, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_profbuf, (struct proc * caller, message *m_ptr) );
+int do_cprofile(struct proc * caller, message *m_ptr);
+int do_profbuf(struct proc * caller, message *m_ptr);
#if ! CPROFILE
#define do_cprofile NULL
#define do_profbuf NULL
#endif
-_PROTOTYPE( int do_getmcontext, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_setmcontext, (struct proc * caller, message *m_ptr) );
+int do_getmcontext(struct proc * caller, message *m_ptr);
+int do_setmcontext(struct proc * caller, message *m_ptr);
#if ! USE_MCONTEXT
#define do_getmcontext NULL
#define do_setmcontext NULL
#endif
-_PROTOTYPE( int do_schedule, (struct proc * caller, message *m_ptr) );
-_PROTOTYPE( int do_schedctl, (struct proc * caller, message *m_ptr) );
+int do_schedule(struct proc * caller, message *m_ptr);
+int do_schedctl(struct proc * caller, message *m_ptr);
-_PROTOTYPE( int do_statectl, (struct proc * caller, message *m_ptr) );
+int do_statectl(struct proc * caller, message *m_ptr);
#if ! USE_STATECTL
#define do_statectl NULL
#endif
#if USE_IRQCTL
-FORWARD _PROTOTYPE(int generic_handler, (irq_hook_t *hook));
+FORWARD int generic_handler(irq_hook_t *hook);
/*===========================================================================*
* do_irqctl *
#define PRIV_DEBUG 0
-FORWARD _PROTOTYPE(int update_priv, (struct proc *rp, struct priv *priv));
+FORWARD int update_priv(struct proc *rp, struct priv *priv);
/*===========================================================================*
* do_privctl *
#define MEM_TOP 0xFFFFFFFFUL
-FORWARD _PROTOTYPE(int safecopy, (struct proc *, endpoint_t, endpoint_t,
- cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int));
+FORWARD int safecopy(struct proc *, endpoint_t, endpoint_t,
+ cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int);
#define HASGRANTTABLE(gr) \
(priv(gr) && priv(gr)->s_grant_table)
#if USE_SETALARM
-FORWARD _PROTOTYPE( void cause_alarm, (timer_t *tp) );
+FORWARD void cause_alarm(timer_t *tp);
/*===========================================================================*
* do_setalarm *
(RTS_ISSET(p, RTS_NO_PRIV) || RTS_ISSET(p, RTS_SIG_PENDING) \
|| (RTS_ISSET(p, RTS_RECEIVING) && !RTS_ISSET(p, RTS_SENDING)))
-FORWARD _PROTOTYPE(void adjust_proc_slot, (struct proc *rp,
- struct proc *from_rp));
-FORWARD _PROTOTYPE(void adjust_priv_slot, (struct priv *privp,
- struct priv *from_privp));
-FORWARD _PROTOTYPE(void swap_fpu_state, (struct proc *a_rp,
- struct proc *b_orig_rp, struct proc *b_copy_rp));
-FORWARD _PROTOTYPE(void swap_proc_slot_pointer, (struct proc **rpp,
- struct proc *src_rp, struct proc *dst_rp));
+FORWARD void adjust_proc_slot(struct proc *rp, struct proc *from_rp);
+FORWARD 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,
+ struct proc *b_copy_rp);
+FORWARD void swap_proc_slot_pointer(struct proc **rpp, struct proc
+ *src_rp, struct proc *dst_rp);
/*===========================================================================*
* do_update *
#include <minix/ds.h>
-FORWARD _PROTOTYPE( int msg_open, (int minor_dev_nr) );
-FORWARD _PROTOTYPE( int msg_close, (int minor_dev_nr) );
-FORWARD _PROTOTYPE( int msg_ioctl, (const message *m_ptr) );
-FORWARD _PROTOTYPE( void msg_write, (const message *m_ptr) );
-FORWARD _PROTOTYPE( void msg_read, (message *m_ptr) );
-FORWARD _PROTOTYPE( void msg_hardware, (void) );
-FORWARD _PROTOTYPE( void msg_status, (message *m_ptr) );
-FORWARD _PROTOTYPE( int init_driver, (void) );
-FORWARD _PROTOTYPE( int open_sub_dev, (int sub_dev_nr, int operation) );
-FORWARD _PROTOTYPE( int close_sub_dev, (int sub_dev_nr) );
-FORWARD _PROTOTYPE( void handle_int_write,(int sub_dev_nr) );
-FORWARD _PROTOTYPE( void handle_int_read,(int sub_dev_nr) );
-FORWARD _PROTOTYPE( void data_to_user, (sub_dev_t *sub_dev_ptr) );
-FORWARD _PROTOTYPE( void data_from_user, (sub_dev_t *sub_dev_ptr) );
-FORWARD _PROTOTYPE( int init_buffers, (sub_dev_t *sub_dev_ptr) );
-FORWARD _PROTOTYPE( int get_started, (sub_dev_t *sub_dev_ptr) );
-FORWARD _PROTOTYPE( void reply,(int code, int replyee, int process,int status));
-FORWARD _PROTOTYPE( int io_ctl_length, (int io_request) );
-FORWARD _PROTOTYPE( special_file_t* get_special_file, (int minor_dev_nr) );
-FORWARD _PROTOTYPE( void tell_dev, (vir_bytes buf, size_t size, int pci_bus,
- int pci_dev, int pci_func) );
+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
+ 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 device_available = 0;/*todo*/
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
-EXTERN _PROTOTYPE( int sef_cb_lu_prepare, (int state) );
-EXTERN _PROTOTYPE( int sef_cb_lu_state_isvalid, (int state) );
-EXTERN _PROTOTYPE( void sef_cb_lu_state_dump, (int state) );
+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);
+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;
PUBLIC int main(void)
#ifndef _BLOCKDRIVER_DRIVER_H
#define _BLOCKDRIVER_DRIVER_H
-_PROTOTYPE( void blockdriver_handle_notify, (struct blockdriver *bdp,
- message *m_ptr) );
-_PROTOTYPE( int blockdriver_handle_request, (struct blockdriver *bdp,
- message *m_ptr, thread_id_t thread) );
-_PROTOTYPE( void blockdriver_reply, (message *m_ptr, int ipc_status,
- int reply) );
+void blockdriver_handle_notify(struct blockdriver *bdp, message *m_ptr);
+int blockdriver_handle_request(struct blockdriver *bdp, message *m_ptr,
+ thread_id_t thread);
+void blockdriver_reply(message *m_ptr, int ipc_status, int reply);
#endif /* _BLOCKDRIVER_DRIVER_H */
/* Extended partition? */
#define ext_part(s) ((s) == 0x05 || (s) == 0x0F)
-FORWARD _PROTOTYPE( void parse_part_table, (struct blockdriver *bdp,
- int device, int style, int atapi, u8_t *tmp_buf) );
-FORWARD _PROTOTYPE( void extpartition, (struct blockdriver *bdp, int extdev,
- unsigned long extbase, u8_t *tmp_buf) );
-FORWARD _PROTOTYPE( int get_part_table, (struct blockdriver *bdp, int device,
- unsigned long offset, struct part_entry *table, u8_t *tmp_buf) );
-FORWARD _PROTOTYPE( void sort, (struct part_entry *table) );
+FORWARD 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
+ long extbase, u8_t *tmp_buf);
+FORWARD 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);
/*============================================================================*
* partition *
#ifndef _BLOCKDRIVER_MQ_H
#define _BLOCKDRIVER_MQ_H
-_PROTOTYPE( void mq_init, (void) );
-_PROTOTYPE( int mq_enqueue, (device_id_t device_id, const message *mess,
- int ipc_status) );
-_PROTOTYPE( int mq_dequeue, (device_id_t device_id, message *mess,
- int *ipc_status) );
+void mq_init(void);
+int mq_enqueue(device_id_t device_id, const message *mess, int
+ ipc_status);
+int mq_dequeue(device_id_t device_id, message *mess, int *ipc_status);
#endif /* _BLOCKDRIVER_MQ_H */
#ifndef _BLOCKDRIVER_TRACE_H
#define _BLOCKDRIVER_TRACE_H
-_PROTOTYPE( int trace_ctl, (dev_t minor, unsigned int request,
- endpoint_t endpt, cp_grant_id_t grant));
+int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt,
+ cp_grant_id_t grant);
-_PROTOTYPE( void trace_start, (thread_id_t thread_id, message *m_ptr));
-_PROTOTYPE( void trace_setsize, (thread_id_t thread_id, size_t size));
-_PROTOTYPE( void trace_finish, (thread_id_t thread_id, int r));
+void trace_start(thread_id_t thread_id, message *m_ptr);
+void trace_setsize(thread_id_t thread_id, size_t size);
+void trace_finish(thread_id_t thread_id, int r);
#endif /* _BLOCKDRIVER_TRACE_H */
#include <stdint.h>
#include <stdio.h>
-_PROTOTYPE( void ctx_start, (void (*)(void), int, ...) );
+void ctx_start(void (*)(void), int, ...);
/*===========================================================================*
* setuctx *
#include <minix/ansi.h>
#endif
-_PROTOTYPE( int nlist, (char *_file, struct nlist *_nl) );
+int nlist(char *_file, struct nlist *_nl);
#endif /* _AOUT_H */
static char *iptr = mtab_in; /* pointer to next line to feed out. */
static char *optr = mtab_out; /* pointer to place where next line goes */
-_PROTOTYPE(int load_mtab, (char *prog_name ));
-_PROTOTYPE(int rewrite_mtab, (char *prog_name ));
-_PROTOTYPE(int get_mtab_entry, (char *special, char *mounted_on,
- char *version, char *rw_flag));
-_PROTOTYPE(int put_mtab_entry, (char *special, char *mounted_on,
- char *version, char *rw_flag));
-PRIVATE _PROTOTYPE(void err, (char *prog_name, char *str ));
+int load_mtab(char *prog_name );
+int rewrite_mtab(char *prog_name );
+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 );
int load_mtab(prog_name)
static ddekit_thread_t *dispatch_th = 0;
-FORWARD _PROTOTYPE(void dispatcher_thread, (void * unused));
-FORWARD _PROTOTYPE(void ddekit_dispatcher_thread_init, (void));
+FORWARD void dispatcher_thread(void * unused);
+FORWARD void ddekit_dispatcher_thread_init(void);
/****************************************************************************/
/* dispatcher_thread */
*****************************************************************************/
-FORWARD _PROTOTYPE( void ddekit_irq_lock, (void));
-FORWARD _PROTOTYPE( void ddekit_irq_unlock, (void));
-FORWARD _PROTOTYPE( struct ddekit_irq_s* find_by_irq, (int irq));
-FORWARD _PROTOTYPE( void ddekit_irq_remove, (struct ddekit_irq_s *irq_s));
-FORWARD _PROTOTYPE( void ddekit_irq_thread, (void *data));
+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);
/******************************************************************************
* ddekit_irq_lock *
#ifndef DDEKIT_IRQ_MINIX_H
#define DDEKIT_IRQ_MINIX_H 1
-_PROTOTYPE( void ddekit_init_irqs, (void) );
-_PROTOTYPE( void _ddekit_interrupt_trigger, (int irq_hook) );
+void ddekit_init_irqs(void);
+void _ddekit_interrupt_trigger(int irq_hook);
#endif
struct ddekit_slab_slab empty;
};
-FORWARD _PROTOTYPE( void ddekit_slab_lock, (struct ddekit_slab * sc) );
-FORWARD _PROTOTYPE( void ddekit_slab_unlock, (struct ddekit_slab * sc) );
-FORWARD _PROTOTYPE( struct ddekit_slab_slab * ddekit_slab_find_slab,
- (struct ddekit_slab * sc, void * obj));
-FORWARD _PROTOTYPE(void ddekit_slab_slab_insert,
- (struct ddekit_slab_slab *list,
- struct ddekit_slab_slab *s));
-FORWARD _PROTOTYPE( void ddekit_slab_slab_remove, (struct ddekit_slab_slab *s));
-FORWARD _PROTOTYPE( void ddekit_slab_grow, (struct ddekit_slab * sc));
-FORWARD _PROTOTYPE( void *ddekit_slab_getobj, (struct ddekit_slab_slab *s));
-FORWARD _PROTOTYPE( void ddekit_slab_free_slab,
- (struct ddekit_slab_slab * sl, int cont));
+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
+ ddekit_slab * sc, void * obj);
+FORWARD 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
+ cont);
/******************************************************************************
* ddekit_simple_malloc *
};
PRIVATE struct ddekit_minix_msg_q * _list = NULL;
-FORWARD _PROTOTYPE(void _ddekit_minix_queue_msg,
- (struct ddekit_minix_msg_q *mq, message *m));
+FORWARD void _ddekit_minix_queue_msg(struct ddekit_minix_msg_q *mq,
+ message *m);
/*****************************************************************************
* ddekit_minix_create_msg_q *
struct ddekit_pci_dev pci_devs[PCI_MAX_DEVS];
-FORWARD _PROTOTYPE( struct ddekit_pci_dev * ddekit_get_dev_helper,
- (int bus, int slot, int func));
+FORWARD struct ddekit_pci_dev * ddekit_get_dev_helper(int bus, int slot,
+ int func);
/****************************************************************************/
/* ddekit_pci_init_only_one */
#include "debug.h"
-FORWARD _PROTOTYPE( void lock_pgtab, (void));
-FORWARD _PROTOTYPE( void unlock_pgtab, (void));
-FORWARD _PROTOTYPE( struct dde_pgtab_region * allocate_region, (void));
-FORWARD _PROTOTYPE( void free_region, (struct dde_pgtab_region *r));
-FORWARD _PROTOTYPE( void add_region, (struct dde_pgtab_region *r));
-FORWARD _PROTOTYPE( void rm_region, (struct dde_pgtab_region *r));
-FORWARD _PROTOTYPE( struct dde_pgtab_region * find_region_virt, (ddekit_addr_t va));
-FORWARD _PROTOTYPE( struct dde_pgtab_region * find_region_phys, (ddekit_addr_t pa));
+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);
struct dde_pgtab_region {
ddekit_addr_t vm_start;
/* Handle to the running thread, set in _dde_kit_thread_schedule() */
PRIVATE ddekit_thread_t *current = NULL;
-FORWARD _PROTOTYPE( void _ddekit_thread_start, (ddekit_thread_t *th));
-FORWARD _PROTOTYPE( void _ddekit_thread_sleep, (unsigned long until));
+FORWARD void _ddekit_thread_start(ddekit_thread_t *th);
+FORWARD void _ddekit_thread_sleep(unsigned long until);
/*****************************************************************************
* _ddekit_thread_start *
PRIVATE ddekit_thread_t *th;
PRIVATE ddekit_lock_t lock;
-FORWARD _PROTOTYPE( void lock_timer, (void));
-FORWARD _PROTOTYPE( void unlock_timer, (void));
-FORWARD _PROTOTYPE( clock_t get_current_clock, (void));
-FORWARD _PROTOTYPE( void remove_timer, (int id));
-FORWARD _PROTOTYPE( int insert_timer, (struct ddekit_timer_s *t));
-FORWARD _PROTOTYPE( struct ddekit_timer_s * get_next, ( myclock_t exp ));
-FORWARD _PROTOTYPE( void ddekit_timer_thread, (void *data));
+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);
/****************************************************************************
* Private funtions *
PRIVATE struct ddekit_usb_driver *d_usb_driver;
-FORWARD _PROTOTYPE( void _ddekit_usb_completion, (struct usb_urb *mx));
-FORWARD _PROTOTYPE( void _ddekit_usb_connect,
- ( unsigned int dev_id, unsigned int interfaces));
-FORWARD _PROTOTYPE(void _ddekit_usb_disconnect, (unsigned dev_id));
+FORWARD void _ddekit_usb_completion(struct usb_urb *mx);
+FORWARD void _ddekit_usb_connect( unsigned int dev_id, unsigned int
+ interfaces);
+FORWARD void _ddekit_usb_disconnect(unsigned dev_id);
struct usb_driver mx_usb_driver = {
.urb_completion = _ddekit_usb_completion,
unsigned int interfaces;
};
-FORWARD _PROTOTYPE( struct minix_usb_driver *find_driver,(endpoint_t ep));
-FORWARD _PROTOTYPE( struct minix_usb_driver *find_unused_driver, (void));
-FORWARD _PROTOTYPE( int add_to_pending_urbs,
- (struct minix_usb_driver *drv, struct ddekit_usb_urb *urb));
-FORWARD _PROTOTYPE( int remove_from_pending_urbs,
- (struct minix_usb_driver *drv, struct ddekit_usb_urb *urb));
-FORWARD _PROTOTYPE( struct ddekit_usb_urb * find_pending_urb,
- (struct minix_usb_driver *drv, unsigned urb_id));
-FORWARD _PROTOTYPE( void register_driver, (message *msg));
-FORWARD _PROTOTYPE( struct ddekit_usb_urb *ddekit_usb_urb_from_mx_urb,
- (struct usb_urb *mx_urb));
-FORWARD _PROTOTYPE( void submit_urb, (message *msg));
-FORWARD _PROTOTYPE( void cancle_urb, (message *msg));
-FORWARD _PROTOTYPE( void completion_callback, (void *priv));
-
-FORWARD _PROTOTYPE( void prepare_devman_usbdev,
- (struct ddekit_usb_dev * dev, int dev_id,
- unsigned int interfaces, struct devman_usb_dev *dudev));
-FORWARD _PROTOTYPE( void device_disconnect_callback, (struct ddekit_usb_dev * dev));
-FORWARD _PROTOTYPE( int add_acl,
- (int dev_id, unsigned interfaces, endpoint_t ep) );
-FORWARD _PROTOTYPE( int del_acl,
- (int dev_id, unsigned interaces, endpoint_t ep) );
-FORWARD _PROTOTYPE( int handle_msg, (message *msg));
-FORWARD _PROTOTYPE( void _ddekit_usb_thread, ());
-FORWARD _PROTOTYPE( void device_connect_callback,
- (struct ddekit_usb_dev * dev, unsigned int interfaces));
-
-_PROTOTYPE( char *_ddekit_usb_get_manufacturer, (struct ddekit_usb_dev *ddev));
-_PROTOTYPE( char *_ddekit_usb_get_product, (struct ddekit_usb_dev *ddev));
-_PROTOTYPE( char *_ddekit_usb_get_serial, (struct ddekit_usb_dev *ddev));
-_PROTOTYPE( usb_device_descriptor_t *_ddekit_usb_get_device_desc,
- (struct ddekit_usb_dev *ddev));
-_PROTOTYPE( usb_interface_descriptor_t *_ddekit_usb_get_interface_desc,
- (struct ddekit_usb_dev *ddev, int inum));
+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
+ ddekit_usb_urb *urb);
+FORWARD 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
+ *drv, unsigned urb_id);
+FORWARD void register_driver(message *msg);
+FORWARD 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);
+
+FORWARD 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,
+ unsigned int interfaces);
+
+char *_ddekit_usb_get_manufacturer(struct ddekit_usb_dev *ddev);
+char *_ddekit_usb_get_product(struct ddekit_usb_dev *ddev);
+char *_ddekit_usb_get_serial(struct ddekit_usb_dev *ddev);
+usb_device_descriptor_t *_ddekit_usb_get_device_desc(struct
+ ddekit_usb_dev *ddev);
+usb_interface_descriptor_t *_ddekit_usb_get_interface_desc(struct
+ ddekit_usb_dev *ddev, int inum);
PRIVATE ddekit_usb_malloc_fn my_malloc;
PRIVATE endpoint_t devman_ep;
-FORWARD _PROTOTYPE( int save_string,
- (char *buffer, char *src, size_t *offset));
+FORWARD int save_string(char *buffer, char *src, size_t *offset);
PRIVATE TAILQ_HEAD(devlist_head, devman_dev) dev_list;
/* attr.c */
#define attr_get PREFIX(attr_get)
-_PROTOTYPE( void attr_get, (struct hgfs_attr *attr) );
+void attr_get(struct hgfs_attr *attr);
/* backdoor.s */
#define backdoor PREFIX(backdoor)
#define backdoor_in PREFIX(backdoor_in)
#define backdoor_out PREFIX(backdoor_out)
-_PROTOTYPE( u32_t backdoor, (u32_t ptr[6]) );
-_PROTOTYPE( u32_t backdoor_in, (u32_t ptr[6]) );
-_PROTOTYPE( u32_t backdoor_out, (u32_t ptr[6]) );
+u32_t backdoor(u32_t ptr[6]);
+u32_t backdoor_in(u32_t ptr[6]);
+u32_t backdoor_out(u32_t ptr[6]);
/* channel.c */
#define channel_open PREFIX(channel_open)
#define channel_close PREFIX(channel_close)
#define channel_send PREFIX(channel_send)
#define channel_recv PREFIX(channel_recv)
-_PROTOTYPE( int channel_open, (struct channel *ch, u32_t type) );
-_PROTOTYPE( void channel_close, (struct channel *ch) );
-_PROTOTYPE( int channel_send, (struct channel *ch, char *buf, int len) );
-_PROTOTYPE( int channel_recv, (struct channel *ch, char *buf, int max) );
+int channel_open(struct channel *ch, u32_t type);
+void channel_close(struct channel *ch);
+int channel_send(struct channel *ch, char *buf, int len);
+int channel_recv(struct channel *ch, char *buf, int max);
/* error.c */
#define error_convert PREFIX(error_convert)
-_PROTOTYPE( int error_convert, (int err) );
+int error_convert(int err);
/* path.c */
#define path_put PREFIX(path_put)
#define path_get PREFIX(path_get)
-_PROTOTYPE( void path_put, (char *path) );
-_PROTOTYPE( int path_get, (char *path, int max) );
+void path_put(char *path);
+int path_get(char *path, int max);
/* rpc.c */
#define rpc_open PREFIX(rpc_open)
#define rpc_query PREFIX(rpc_query)
#define rpc_test PREFIX(rpc_test)
#define rpc_close PREFIX(rpc_close)
-_PROTOTYPE( int rpc_open, (void) );
-_PROTOTYPE( int rpc_query, (void) );
-_PROTOTYPE( int rpc_test, (void) );
-_PROTOTYPE( void rpc_close, (void) );
+int rpc_open(void);
+int rpc_query(void);
+int rpc_test(void);
+void rpc_close(void);
/* time.c */
#define time_init PREFIX(time_init)
#define time_put PREFIX(time_put)
#define time_get PREFIX(time_get)
-_PROTOTYPE( void time_init, (void) );
-_PROTOTYPE( void time_put, (time_t *timep) );
-_PROTOTYPE( void time_get, (time_t *timep) );
+void time_init(void);
+void time_put(time_t *timep);
+void time_get(time_t *timep);
PRIVATE int next;
PRIVATE char qbuf[8];
-_PROTOTYPE( char *itoa, (int n));
+char *itoa(int n);
char *itoa(n)
int n;
#if defined(_MINIX) || defined(__minix) || defined(__ACK__)
/* Prototypes */
-_PROTOTYPE( off_t r_super, (void));
-_PROTOTYPE( void r_stat, (Ino_t _inum, struct stat *_stp ));
-_PROTOTYPE( ino_t r_readdir, (char *_name ));
-_PROTOTYPE( off_t r_vir2abs, (off_t _virblk ));
-_PROTOTYPE( ino_t r_lookup, (Ino_t _cwd, char *_path ));
+off_t r_super(void);
+void r_stat(Ino_t _inum, struct stat *_stp );
+ino_t r_readdir(char *_name );
+off_t r_vir2abs(off_t _virblk );
+ino_t r_lookup(Ino_t _cwd, char *_path );
#endif
#ifdef _MONHEAD
-_PROTOTYPE( void readerr, (off_t _sec, int _err ));
-_PROTOTYPE( int numprefix, (char *_s, char **_ps ));
-_PROTOTYPE( int numeric, (char *_s ));
-_PROTOTYPE( dev_t name2dev, (char *_name ));
-_PROTOTYPE( int delay, (char *_msec ));
-_PROTOTYPE( char *unix_err, (int _err ));
-_PROTOTYPE( void init_cache, (void));
-_PROTOTYPE( void invalidate_cache, (void));
-_PROTOTYPE( char *b_value, (char *_name ));
-_PROTOTYPE( void raw_copy, (int _doff, int _dseg, int _soff, int _sseg,
- int _count));
-_PROTOTYPE( void raw_clear, (int _off, int _seg, int _count));
-_PROTOTYPE( void bootstrap, (int _device, int _partoff, int _partseg));
-
-_PROTOTYPE( long a2l, (char *_a ));
-_PROTOTYPE( char *ul2a, (u32_t _n ));
-_PROTOTYPE( char *u2a, (int _n1 ));
+void readerr(off_t _sec, int _err );
+int numprefix(char *_s, char **_ps );
+int numeric(char *_s );
+dev_t name2dev(char *_name );
+int delay(char *_msec );
+char *unix_err(int _err );
+void init_cache(void);
+void invalidate_cache(void);
+char *b_value(char *_name );
+void raw_copy(int _doff, int _dseg, int _soff, int _sseg, int _count);
+void raw_clear(int _off, int _seg, int _count);
+void bootstrap(int _device, int _partoff, int _partseg);
+
+long a2l(char *_a );
+char *ul2a(u32_t _n );
+char *u2a(int _n1 );
/* Functions defined in monhead.s and usable by other files. */
-_PROTOTYPE( void reset_video, (int color));
-_PROTOTYPE( int dev_geometry, (void));
-_PROTOTYPE( u16_t get_ext_memsize, (void));
-_PROTOTYPE( u16_t get_low_memsize, (void));
-_PROTOTYPE( u16_t get_processor, (void));
-_PROTOTYPE( u32_t get_tick, (void));
-_PROTOTYPE( u16_t get_video, (void));
-_PROTOTYPE( u16_t get_word, (int _off, int _seg));
-_PROTOTYPE( int getchar, (void));
-_PROTOTYPE( void minix, (void));
-_PROTOTYPE( void minix86, (int _kcs, int _kds, char *_bpar, int _psize));
-_PROTOTYPE( void minix386, (int _kcs, int _kds, char *_bpar, int _psize));
-_PROTOTYPE( int peekchar, (void));
-_PROTOTYPE( void put_word, (int _off, int _seg, int _word));
-_PROTOTYPE( int putchar, (char _c));
-_PROTOTYPE( int readsectors, (int _off, int _seg, off_t _adr, int _ct));
-_PROTOTYPE( void reboot, (void));
-_PROTOTYPE( void relocate, (void));
-_PROTOTYPE( int writesectors, (int _off, int _seg, off_t _adr, int _ct));
+void reset_video(int color);
+int dev_geometry(void);
+u16_t get_ext_memsize(void);
+u16_t get_low_memsize(void);
+u16_t get_processor(void);
+u32_t get_tick(void);
+u16_t get_video(void);
+u16_t get_word(int _off, int _seg);
+int getchar(void);
+void minix(void);
+void minix86(int _kcs, int _kds, char *_bpar, int _psize);
+void minix386(int _kcs, int _kds, char *_bpar, int _psize);
+int peekchar(void);
+void put_word(int _off, int _seg, int _word);
+int putchar(char _c);
+int readsectors(int _off, int _seg, off_t _adr, int _ct);
+void reboot(void);
+void relocate(void);
+int writesectors(int _off, int _seg, off_t _adr, int _ct);
#endif
#endif
#include "global.h"
#include "proto.h"
-FORWARD _PROTOTYPE( int mthread_increase_thread_pool, (void) );
-FORWARD _PROTOTYPE( void mthread_thread_init, (mthread_thread_t thread,
- mthread_attr_t *tattr,
- void *(*proc)(void *),
- void *arg) );
-
-FORWARD _PROTOTYPE( void mthread_thread_stop, (mthread_thread_t thread));
-FORWARD _PROTOTYPE( void mthread_trampoline, (void) );
+FORWARD int mthread_increase_thread_pool(void);
+FORWARD 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);
PRIVATE int initialized = 0;
#ifndef PGSHIFT
#include "proto.h"
PRIVATE struct __mthread_attr *va_front, *va_rear;
-FORWARD _PROTOTYPE( void mthread_attr_add, (mthread_attr_t *a) );
-FORWARD _PROTOTYPE( void mthread_attr_remove, (mthread_attr_t *a) );
-FORWARD _PROTOTYPE( int mthread_attr_valid, (mthread_attr_t *a) );
+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);
/*===========================================================================*
* mthread_init_valid_attributes *
#ifdef MTHREAD_STRICT
PRIVATE struct __mthread_cond *vc_front, *vc_rear;
-FORWARD _PROTOTYPE( void mthread_cond_add, (mthread_cond_t *c) );
-FORWARD _PROTOTYPE( void mthread_cond_remove, (mthread_cond_t *c) );
-FORWARD _PROTOTYPE( int mthread_cond_valid, (mthread_cond_t *c) );
+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);
#else
# define mthread_cond_add(c) ((*c)->mc_magic = MTHREAD_INIT_MAGIC)
# define mthread_cond_remove(c) ((*c)->mc_magic = MTHREAD_NOT_INUSE)
#ifdef MTHREAD_STRICT
PRIVATE struct __mthread_mutex *vm_front, *vm_rear;
-FORWARD _PROTOTYPE( void mthread_mutex_add, (mthread_mutex_t *m) );
-FORWARD _PROTOTYPE( void mthread_mutex_remove, (mthread_mutex_t *m) );
+FORWARD void mthread_mutex_add(mthread_mutex_t *m);
+FORWARD 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)
#define __MTHREAD_PROTO_H__
/* allocate.c */
-_PROTOTYPE( mthread_tcb_t * mthread_find_tcb, (mthread_thread_t thread) );
-_PROTOTYPE( void mthread_thread_reset, (mthread_thread_t thread) );
+mthread_tcb_t * mthread_find_tcb(mthread_thread_t thread);
+void mthread_thread_reset(mthread_thread_t thread);
/* attribute.c */
-_PROTOTYPE( void mthread_init_valid_attributes, (void) );
+void mthread_init_valid_attributes(void);
#ifdef MDEBUG
-_PROTOTYPE( int mthread_attr_verify, (void) );
+int mthread_attr_verify(void);
#endif
/* cond.c */
-_PROTOTYPE( void mthread_init_valid_conditions, (void) );
+void mthread_init_valid_conditions(void);
#ifdef MDEBUG
-_PROTOTYPE( int mthread_cond_verify, (void) );
+int mthread_cond_verify(void);
#endif
/* key.c */
-_PROTOTYPE( void mthread_init_keys, (void) );
-_PROTOTYPE( void mthread_cleanup_values, (void) );
+void mthread_init_keys(void);
+void mthread_cleanup_values(void);
/* misc.c */
#ifdef MDEBUG
#define mthread_panic(m) mthread_panic_f(__FILE__, __LINE__, (m))
-_PROTOTYPE( void mthread_panic_f, (const char *file, int line,
- const char *msg) );
+void mthread_panic_f(const char *file, int line, const char *msg);
#define mthread_debug(m) mthread_debug_f(__FILE__, __LINE__, (m))
-_PROTOTYPE( void mthread_debug_f, (const char *file, int line,
- const char *msg) );
+void mthread_debug_f(const char *file, int line, const char *msg);
#else
-_PROTOTYPE( void mthread_panic_s, (void) );
+void mthread_panic_s(void);
# define mthread_panic(m) mthread_panic_s()
# define mthread_debug(m)
#endif
/* mutex.c */
-_PROTOTYPE( void mthread_init_valid_mutexes, (void) );
+void mthread_init_valid_mutexes(void);
#ifdef MTHREAD_STRICT
-_PROTOTYPE( int mthread_mutex_valid, (mthread_mutex_t *mutex) );
+int mthread_mutex_valid(mthread_mutex_t *mutex);
#else
# define mthread_mutex_valid(x) ((*x)->mm_magic == MTHREAD_INIT_MAGIC)
#endif
#ifdef MDEBUG
-_PROTOTYPE( int mthread_mutex_verify, (void) );
+int mthread_mutex_verify(void);
#endif
/* schedule.c */
-_PROTOTYPE( int mthread_getcontext, (ucontext_t *ctxt) );
-_PROTOTYPE( void mthread_init_scheduler, (void) );
-_PROTOTYPE( void mthread_schedule, (void) );
-_PROTOTYPE( void mthread_suspend, (mthread_state_t state) );
-_PROTOTYPE( void mthread_unsuspend, (mthread_thread_t thread) );
+int mthread_getcontext(ucontext_t *ctxt);
+void mthread_init_scheduler(void);
+void mthread_schedule(void);
+void mthread_suspend(mthread_state_t state);
+void mthread_unsuspend(mthread_thread_t thread);
/* queue.c */
#ifdef MDEBUG
-_PROTOTYPE( void mthread_dump_queue, (mthread_queue_t *queue) );
+void mthread_dump_queue(mthread_queue_t *queue);
#endif
-_PROTOTYPE( void mthread_queue_init, (mthread_queue_t *queue) );
-_PROTOTYPE( void mthread_queue_add, (mthread_queue_t *queue,
- mthread_thread_t thread) );
-_PROTOTYPE( mthread_thread_t mthread_queue_remove, (mthread_queue_t *queue));
-_PROTOTYPE( int mthread_queue_isempty, (mthread_queue_t *queue) );
+void mthread_queue_init(mthread_queue_t *queue);
+void mthread_queue_add(mthread_queue_t *queue, mthread_thread_t thread);
+mthread_thread_t mthread_queue_remove(mthread_queue_t *queue);
+int mthread_queue_isempty(mthread_queue_t *queue);
#endif
/* TODO: it duplicates caller_uid and caller_gid */
EXTERN struct puffs_kcred global_kcred;
-extern _PROTOTYPE (int (*fs_call_vec[]), (void) ); /* fs call table */
+extern int(*fs_call_vec[]) (void);
EXTERN message fs_m_in;
EXTERN message fs_m_out;
return(r);
}
-FORWARD _PROTOTYPE( int remove_dir, (struct puffs_node *pn_dir,
- struct puffs_node *pn, struct puffs_cn *pcn));
-FORWARD _PROTOTYPE( int unlink_file, (struct puffs_node *dirp,
- struct puffs_node *pn, struct puffs_cn *pcn));
+FORWARD 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,
+ struct puffs_cn *pcn);
/*===========================================================================*
* fs_unlink *
PUBLIC char dot2[3] = ".."; /* permissions for . and .. */
-FORWARD _PROTOTYPE( char *get_name, (char *name, char string[NAME_MAX+1]) );
-FORWARD _PROTOTYPE( int ltraverse, (struct puffs_node *pn, char *suffix) );
-FORWARD _PROTOTYPE( int parse_path, (ino_t dir_ino, ino_t root_ino,
- int flags, struct puffs_node **res_inop,
- size_t *offsetp, int *symlinkp) );
+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
+ puffs_node **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
* fs_lookup *
#include "puffs.h"
#include "puffs_priv.h"
-FORWARD _PROTOTYPE( int in_group, (gid_t grp) );
+FORWARD int in_group(gid_t grp);
/*===========================================================================*
/* Function prototypes. */
-_PROTOTYPE( int fs_new_driver, (void) );
+int fs_new_driver(void);
/* inode.c */
-_PROTOTYPE( int fs_putnode, (void) );
-_PROTOTYPE( void release_node, (struct puffs_usermount *pu,
- struct puffs_node *pn ) );
+int fs_putnode(void);
+void release_node(struct puffs_usermount *pu, struct puffs_node *pn );
/* device.c */
-_PROTOTYPE( int dev_open, (endpoint_t driver_e, dev_t dev,
- endpoint_t proc_e, int flags) );
-_PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) );
+int dev_open(endpoint_t driver_e, dev_t dev, endpoint_t proc_e, int
+ flags);
+void dev_close(endpoint_t driver_e, dev_t dev);
/* link.c */
-_PROTOTYPE( int fs_ftrunc, (void) );
-_PROTOTYPE( int fs_link, (void) );
-_PROTOTYPE( int fs_rdlink, (void) );
-_PROTOTYPE( int fs_rename, (void) );
-_PROTOTYPE( int fs_unlink, (void) );
+int fs_ftrunc(void);
+int fs_link(void);
+int fs_rdlink(void);
+int fs_rename(void);
+int fs_unlink(void);
/* misc.c */
-_PROTOTYPE( int fs_flush, (void) );
-_PROTOTYPE( int fs_sync, (void) );
+int fs_flush(void);
+int fs_sync(void);
/* mount.c */
-_PROTOTYPE( int fs_mountpoint, (void) );
-_PROTOTYPE( int fs_readsuper, (void) );
-_PROTOTYPE( int fs_unmount, (void) );
+int fs_mountpoint(void);
+int fs_readsuper(void);
+int fs_unmount(void);
/* open.c */
-_PROTOTYPE( int fs_create, (void) );
-_PROTOTYPE( int fs_inhibread, (void) );
-_PROTOTYPE( int fs_mkdir, (void) );
-_PROTOTYPE( int fs_mknod, (void) );
-_PROTOTYPE( int fs_slink, (void) );
+int fs_create(void);
+int fs_inhibread(void);
+int fs_mkdir(void);
+int fs_mknod(void);
+int fs_slink(void);
/* path.c */
-_PROTOTYPE( int fs_lookup, (void) );
-_PROTOTYPE( struct puffs_node *advance, (struct puffs_node *dirp,
- char string[NAME_MAX + 1], int chk_perm));
+int fs_lookup(void);
+struct puffs_node *advance(struct puffs_node *dirp, char string[NAME_MAX
+ + 1], int chk_perm);
/* protect.c */
-_PROTOTYPE( int fs_chmod, (void) );
-_PROTOTYPE( int fs_chown, (void) );
-_PROTOTYPE( int fs_getdents, (void) );
-_PROTOTYPE( int forbidden, (struct puffs_node *rip,
- mode_t access_desired) );
+int fs_chmod(void);
+int fs_chown(void);
+int fs_getdents(void);
+int forbidden(struct puffs_node *rip, mode_t access_desired);
/* read.c */
-_PROTOTYPE( int fs_breadwrite, (void) );
-_PROTOTYPE( int fs_readwrite, (void) );
+int fs_breadwrite(void);
+int fs_readwrite(void);
/* stadir.c */
-_PROTOTYPE( int fs_fstatfs, (void) );
-_PROTOTYPE( int fs_stat, (void) );
-_PROTOTYPE( int fs_statvfs, (void) );
+int fs_fstatfs(void);
+int fs_stat(void);
+int fs_statvfs(void);
/* time.c */
-_PROTOTYPE( int fs_utime, (void) );
+int fs_utime(void);
/* utility.c */
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( void mfs_nul_f, (const char *file, int line, char *str,
- unsigned int len, unsigned int maxlen) );
-_PROTOTYPE( time_t clock_time, (void) );
-_PROTOTYPE( int update_times, (struct puffs_node *pn, int fl, time_t t) );
-_PROTOTYPE( void lpuffs_debug, (const char *format, ...) );
+int no_sys(void);
+void mfs_nul_f(const char *file, int line, char *str, unsigned int len,
+ unsigned int maxlen);
+time_t clock_time(void);
+int update_times(struct puffs_node *pn, int fl, time_t t);
+void lpuffs_debug(const char *format, ...);
#endif /* PUFFS_PROTO_H */
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (message *m_in) );
-FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
+FORWARD void get_work(message *m_in);
+FORWARD void reply(endpoint_t who, message *m_out);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
EXTERN int env_argc;
EXTERN char **env_argv;
#include "fs.h"
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
+PUBLIC int (*fs_call_vec[])(void) = {
no_sys, /* 0 not used */
no_sys, /* 1 */ /* Was: fs_getnode */
fs_putnode, /* 2 */
PUBLIC int env_argc = 0;
PUBLIC char **env_argv = NULL;
-FORWARD _PROTOTYPE( char *find_key, (const char *params, const char *key));
+FORWARD char *find_key(const char *params, const char *key);
/*===========================================================================*
* env_setargs *
#include <minix/const.h>
#include <minix/optset.h>
-FORWARD _PROTOTYPE( void optset_parse_entry, (struct optset *entry,
- char *ptr, int len) );
+FORWARD void optset_parse_entry(struct optset *entry, char *ptr, int
+ len);
/*===========================================================================*
* optset_parse_entry *
* of procentry */
PRIVATE int cprof_locked; /* for reentrancy */
-FORWARD _PROTOTYPE(void cprof_init, (void) );
-FORWARD _PROTOTYPE(void reset, (void) );
-FORWARD _PROTOTYPE(void clear_tbl, (void) );
+FORWARD void cprof_init(void);
+FORWARD void reset(void);
+FORWARD void clear_tbl(void);
PUBLIC void procentry (char *name)
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 _PROTOTYPE( void sef_debug_refresh_params, (void) );
-PUBLIC _PROTOTYPE( char* sef_debug_header, (void) );
+FORWARD void sef_debug_refresh_params(void);
+PUBLIC char* sef_debug_header(void);
#endif
/* SEF Init prototypes. */
#ifdef USE_COVERAGE
-EXTERN _PROTOTYPE( int do_sef_gcov_request, (message *m_ptr) );
+EXTERN int do_sef_gcov_request(message *m_ptr);
#endif
-EXTERN _PROTOTYPE( int do_sef_rs_init, (endpoint_t old_endpoint) );
-EXTERN _PROTOTYPE( int do_sef_init_request, (message *m_ptr) );
+EXTERN int do_sef_rs_init(endpoint_t old_endpoint);
+EXTERN int do_sef_init_request(message *m_ptr);
/* SEF Ping prototypes. */
-EXTERN _PROTOTYPE( int do_sef_ping_request, (message *m_ptr) );
+EXTERN int do_sef_ping_request(message *m_ptr);
/* SEF Live update prototypes. */
-EXTERN _PROTOTYPE( void do_sef_lu_before_receive, (void) );
-EXTERN _PROTOTYPE( int do_sef_lu_request, (message *m_ptr) );
+EXTERN void do_sef_lu_before_receive(void);
+EXTERN int do_sef_lu_request(message *m_ptr);
/* SEF Signal prototypes. */
-EXTERN _PROTOTYPE( int do_sef_signal_request, (message *m_ptr) );
+EXTERN int do_sef_signal_request(message *m_ptr);
/*===========================================================================*
* sef_startup *
};
/* SEF Init prototypes for sef_startup(). */
-PUBLIC _PROTOTYPE( int do_sef_rs_init, (endpoint_t old_endpoint) );
-PUBLIC _PROTOTYPE( int do_sef_init_request, (message *m_ptr) );
+PUBLIC int do_sef_rs_init(endpoint_t old_endpoint);
+PUBLIC int do_sef_init_request(message *m_ptr);
/* Debug. */
-EXTERN _PROTOTYPE( char* sef_debug_header, (void) );
+EXTERN char* sef_debug_header(void);
/* Information about SELF. */
EXTERN endpoint_t sef_self_endpoint;
};
/* SEF Live update prototypes for sef_receive(). */
-PUBLIC _PROTOTYPE( void do_sef_lu_before_receive, (void) );
-PUBLIC _PROTOTYPE( int do_sef_lu_request, (message *m_ptr) );
+PUBLIC void do_sef_lu_before_receive(void);
+PUBLIC int do_sef_lu_request(message *m_ptr);
/* SEF Live update helpers. */
-PRIVATE _PROTOTYPE( void sef_lu_ready, (int result) );
+PRIVATE void sef_lu_ready(int result);
/* Debug. */
-EXTERN _PROTOTYPE( char* sef_debug_header, (void) );
+EXTERN char* sef_debug_header(void);
PRIVATE int sef_lu_debug_cycle = 0;
/* Information about SELF. */
};
/* SEF Ping prototypes for sef_receive(). */
-PUBLIC _PROTOTYPE( int do_sef_ping_request, (message *m_ptr) );
+PUBLIC int do_sef_ping_request(message *m_ptr);
/* Debug. */
-EXTERN _PROTOTYPE( char* sef_debug_header, (void) );
+EXTERN char* sef_debug_header(void);
/*===========================================================================*
* do_sef_ping_request *
};
/* SEF Signal prototypes for sef_receive(). */
-PUBLIC _PROTOTYPE( int do_sef_signal_request, (message *m_ptr) );
+PUBLIC int do_sef_signal_request(message *m_ptr);
/* Debug. */
-EXTERN _PROTOTYPE( char* sef_debug_header, (void) );
+EXTERN char* sef_debug_header(void);
/* Information about SELF. */
EXTERN endpoint_t sef_self_endpoint;
PRIVATE struct usb_urb * pending_urbs = NULL;
PRIVATE endpoint_t hcd_ep;
-FORWARD _PROTOTYPE( void _usb_urb_complete,
- (struct usb_driver *ud, long urb_id));
+FORWARD void _usb_urb_complete(struct usb_driver *ud, long urb_id);
/*****************************************************************************
* usb_send_urb *
EXTERN int fs_mounted;
-extern _PROTOTYPE( int (*fs_call_vec[]), (void) );
+extern int(*fs_call_vec[]) (void);
#endif /* _VTREEFS_GLO_H */
#define _VTREEFS_PROTO_H
/* inode.c */
-_PROTOTYPE( void init_inodes, (unsigned int inodes,
- struct inode_stat *stat, index_t nr_indexed_entries) );
-_PROTOTYPE( void cleanup_inodes, (void) );
-_PROTOTYPE( struct inode *find_inode, (ino_t num) );
-_PROTOTYPE( struct inode *get_inode, (ino_t num) );
-_PROTOTYPE( void put_inode, (struct inode *node) );
-_PROTOTYPE( void ref_inode, (struct inode *node) );
-_PROTOTYPE( int get_inode_number, (struct inode *node) );
-_PROTOTYPE( int is_inode_deleted, (struct inode *node) );
-_PROTOTYPE( int fs_putnode, (void) );
+void init_inodes(unsigned int inodes, struct inode_stat *stat, index_t
+ nr_indexed_entries);
+void cleanup_inodes(void);
+struct inode *find_inode(ino_t num);
+struct inode *get_inode(ino_t num);
+void put_inode(struct inode *node);
+void ref_inode(struct inode *node);
+int get_inode_number(struct inode *node);
+int is_inode_deleted(struct inode *node);
+int fs_putnode(void);
/* link.c */
-_PROTOTYPE( int fs_rdlink, (void) );
+int fs_rdlink(void);
/* mount.c */
-_PROTOTYPE( int fs_readsuper, (void) );
-_PROTOTYPE( int fs_unmount, (void) );
+int fs_readsuper(void);
+int fs_unmount(void);
/* path.c */
-_PROTOTYPE( int fs_lookup, (void) );
+int fs_lookup(void);
/* read.c */
-_PROTOTYPE( int fs_read, (void) );
-_PROTOTYPE( int fs_getdents, (void) );
+int fs_read(void);
+int fs_getdents(void);
/* sdbm.c */
-_PROTOTYPE( long sdbm_hash, (char *str, int len) );
+long sdbm_hash(char *str, int len);
/* stadir.c */
-_PROTOTYPE( int fs_stat, (void) );
-_PROTOTYPE( int fs_fstatfs, (void) );
-_PROTOTYPE( int fs_statvfs, (void) );
+int fs_stat(void);
+int fs_fstatfs(void);
+int fs_statvfs(void);
/* utility.c */
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( int do_noop, (void) );
+int no_sys(void);
+int do_noop(void);
#endif /* _VTREEFS_PROTO_H */
#define _TABLE
#include "inc.h"
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
+PUBLIC int (*fs_call_vec[])(void) = {
no_sys, /* 0 */
no_sys, /* 1 getnode */
fs_putnode, /* 2 putnode */
#include "inc.h"
-FORWARD _PROTOTYPE( int get_work, (void) );
-FORWARD _PROTOTYPE( void send_reply, (int err, int transid) );
-FORWARD _PROTOTYPE( void got_signal, (int signal) );
+FORWARD int get_work(void);
+FORWARD void send_reply(int err, int transid);
+FORWARD void got_signal(int signal);
PRIVATE unsigned int inodes;
PRIVATE struct inode_stat *root_stat;
#include "proto.h"
-FORWARD _PROTOTYPE( struct devman_device*devman_dev_add_child,
- (struct devman_device *parent,
- struct devman_device_info *devinf) );
-FORWARD _PROTOTYPE( struct devman_device *_find_dev,
- (struct devman_device *dev, int dev_id) );
-FORWARD _PROTOTYPE( int devman_dev_add_info,
- (struct devman_device *dev,
- struct devman_device_info_entry *entry,
- char *buf) );
-FORWARD _PROTOTYPE( int devman_event_read,
- (char **ptr, size_t *len,off_t offset, void *data) );
-
-FORWARD _PROTOTYPE( int devman_del_device, (struct devman_device *dev) );
+FORWARD struct devman_device*devman_dev_add_child(struct devman_device
+ *parent, struct devman_device_info *devinf);
+FORWARD struct devman_device *_find_dev(struct devman_device *dev, int
+ dev_id);
+FORWARD int devman_dev_add_info(struct devman_device *dev, struct
+ devman_device_info_entry *entry, char *buf);
+FORWARD int devman_event_read(char **ptr, size_t *len,off_t offset, void
+ *data);
+
+FORWARD int devman_del_device(struct devman_device *dev);
PRIVATE int next_device_id = 1;
#define _DEVMAN_PROTO_H
/* buf.c */
-_PROTOTYPE( void buf_init, (off_t start, size_t len) );
-_PROTOTYPE( void buf_printf, (char *fmt, ...) );
-_PROTOTYPE( void buf_append, (char *data, size_t len) );
-_PROTOTYPE( size_t buf_get, (char **ptr) );
+void buf_init(off_t start, size_t len);
+void buf_printf(char *fmt, ...);
+void buf_append(char *data, size_t len);
+size_t buf_get(char **ptr);
/* message handlers */
-_PROTOTYPE(int do_add_device, (message *m));
-_PROTOTYPE(int do_del_device, (message *m));
-_PROTOTYPE(int do_bind_device, (message *m));
-_PROTOTYPE(int do_unbind_device, (message *m));
+int do_add_device(message *m);
+int do_del_device(message *m);
+int do_bind_device(message *m);
+int do_unbind_device(message *m);
/* local helper functions */
-_PROTOTYPE(void devman_init_devices, ());
-_PROTOTYPE(struct devman_device* devman_find_device,(int devid));
-_PROTOTYPE(void devman_get_device, (struct devman_device *dev));
-_PROTOTYPE(void devman_put_device, (struct devman_device *dev));
+void devman_init_devices();
+struct devman_device* devman_find_device(int devid);
+void devman_get_device(struct devman_device *dev);
+void devman_put_device(struct devman_device *dev);
#endif /* _DEVMAN_PROTO_H */
PRIVATE int callnr; /* system call number */
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (message *m_ptr) );
-FORWARD _PROTOTYPE(void reply, (endpoint_t whom, message *m_ptr) );
+FORWARD void get_work(message *m_ptr);
+FORWARD void reply(endpoint_t whom, message *m_ptr);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
/* Function prototypes. */
/* main.c */
-_PROTOTYPE(int main, (int argc, char **argv));
+int main(int argc, char **argv);
/* store.c */
-_PROTOTYPE(int do_publish, (message *m_ptr));
-_PROTOTYPE(int do_retrieve, (message *m_ptr));
-_PROTOTYPE(int do_retrieve_label, (const message *m_ptr));
-_PROTOTYPE(int do_subscribe, (message *m_ptr));
-_PROTOTYPE(int do_check, (message *m_ptr));
-_PROTOTYPE(int do_delete, (message *m_ptr));
-_PROTOTYPE(int do_snapshot, (message *m_ptr));
-_PROTOTYPE(int do_getsysinfo, (const message *m_ptr));
-_PROTOTYPE(int sef_cb_init_fresh, (int type, sef_init_info_t *info));
+int do_publish(message *m_ptr);
+int do_retrieve(message *m_ptr);
+int do_retrieve_label(const message *m_ptr);
+int do_subscribe(message *m_ptr);
+int do_check(message *m_ptr);
+int do_delete(message *m_ptr);
+int do_snapshot(message *m_ptr);
+int do_getsysinfo(const message *m_ptr);
+int sef_cb_init_fresh(int type, sef_init_info_t *info);
#endif
#include "const.h"
-FORWARD _PROTOTYPE( block_t alloc_block_bit, (struct super_block *sp,
- block_t origin,
- struct inode *rip));
+FORWARD block_t alloc_block_bit(struct super_block *sp, block_t origin,
+ struct inode *rip);
/*===========================================================================*
* discard_preallocated_blocks *
}
-FORWARD _PROTOTYPE( void check_block_number, (block_t block,
- struct super_block *sp,
- struct group_desc *gd) );
+FORWARD void check_block_number(block_t block, struct super_block *sp,
+ struct group_desc *gd);
/*===========================================================================*
* alloc_block_bit *
#include "super.h"
#include "inode.h"
-FORWARD _PROTOTYPE( void rm_lru, (struct buf *bp) );
-FORWARD _PROTOTYPE( void rw_block, (struct buf *, int) );
+FORWARD void rm_lru(struct buf *bp);
+FORWARD void rw_block(struct buf *, int);
PRIVATE int vmcache_avail = -1; /* 0 if not available, >0 if available. */
extern char dot1[2]; /* dot1 (&dot1[0]) and dot2 (&dot2[0]) have a special */
extern char dot2[3]; /* meaning to search_dir: no access permission check. */
-extern _PROTOTYPE (int (*fs_call_vec[]), (void) ); /* fs call table */
+extern int(*fs_call_vec[]) (void);
EXTERN message fs_m_in;
EXTERN message fs_m_out;
#include "const.h"
-FORWARD _PROTOTYPE( bit_t alloc_inode_bit, (struct super_block *sp,
- struct inode *parent,
- int is_dir));
-FORWARD _PROTOTYPE( void free_inode_bit, (struct super_block *sp,
- bit_t bit_returned,
- int is_dir));
-FORWARD _PROTOTYPE( void wipe_inode, (struct inode *rip));
+FORWARD 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,
+ int is_dir);
+FORWARD void wipe_inode(struct inode *rip);
/*===========================================================================*
}
-FORWARD _PROTOTYPE( int find_group_dir, (struct super_block *sp,
- struct inode *parent) );
-FORWARD _PROTOTYPE( int find_group_hashalloc, (struct super_block *sp,
- struct inode *parent) );
-FORWARD _PROTOTYPE( int find_group_any, (struct super_block *sp,
- struct inode *parent) );
-FORWARD _PROTOTYPE( int find_group_orlov, (struct super_block *sp,
- struct inode *parent) );
+FORWARD int find_group_dir(struct super_block *sp, struct inode
+ *parent);
+FORWARD int find_group_hashalloc(struct super_block *sp, struct inode
+ *parent);
+FORWARD int find_group_any(struct super_block *sp, struct inode
+ *parent);
+FORWARD int find_group_orlov(struct super_block *sp, struct inode
+ *parent);
/*===========================================================================*
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( void icopy, (struct inode *rip, d_inode *dip,
- int direction, int norm));
-FORWARD _PROTOTYPE( void addhash_inode, (struct inode *node) );
-FORWARD _PROTOTYPE( void unhash_inode, (struct inode *node) );
+FORWARD 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);
/*===========================================================================*
#define SAME 1000
-FORWARD _PROTOTYPE( int freesp_inode, (struct inode *rip, off_t st,
- off_t end) );
-FORWARD _PROTOTYPE( int remove_dir, (struct inode *rldirp,
- struct inode *rip, char dir_name[NAME_MAX + 1]) );
-FORWARD _PROTOTYPE( int unlink_file, (struct inode *dirp,
- struct inode *rip, char file_name[NAME_MAX + 1]));
-FORWARD _PROTOTYPE( off_t nextblock, (off_t pos, int blocksize) );
-FORWARD _PROTOTYPE( void zeroblock_half, (struct inode *i, off_t p, int l));
-FORWARD _PROTOTYPE( void zeroblock_range, (struct inode *i, off_t p, off_t h));
+FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end);
+FORWARD 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
+ 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);
/* Args to zeroblock_half() */
#define FIRST_HALF 0
#include "inode.h"
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (message *m_in) );
-FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
+FORWARD void get_work(message *m_in);
+FORWARD void reply(endpoint_t who, message *m_out);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
EXTERN int env_argc;
EXTERN char **env_argv;
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( struct inode *new_node, (struct inode *ldirp,
- char *string, mode_t bits, block_t z0));
+FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t
+ bits, block_t z0);
/*===========================================================================*
PUBLIC char dot1[2] = "."; /* used for search_dir to bypass the access */
PUBLIC char dot2[3] = ".."; /* permissions for . and .. */
-FORWARD _PROTOTYPE( char *get_name, (char *name, char string[NAME_MAX+1]) );
-FORWARD _PROTOTYPE( int ltraverse, (struct inode *rip, char *suffix) );
-FORWARD _PROTOTYPE( int parse_path, (ino_t dir_ino, ino_t root_ino,
- int flags, struct inode **res_inop,
- size_t *offsetp, int *symlinkp) );
+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
+ inode **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
* fs_lookup *
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( int in_group, (gid_t grp) );
+FORWARD int in_group(gid_t grp);
/*===========================================================================*
/* balloc.c */
-_PROTOTYPE( void discard_preallocated_blocks, (struct inode *rip) );
-_PROTOTYPE( block_t alloc_block, (struct inode *rip, block_t goal) );
-_PROTOTYPE( void free_block, (struct super_block *sp, bit_t bit) );
+void discard_preallocated_blocks(struct inode *rip);
+block_t alloc_block(struct inode *rip, block_t goal);
+void free_block(struct super_block *sp, bit_t bit);
/* cache.c */
-_PROTOTYPE( void buf_pool, (int bufs) );
-_PROTOTYPE( void flushall, (dev_t dev) );
-_PROTOTYPE( struct buf *get_block, (dev_t dev, block_t block,int only_search));
-_PROTOTYPE( void invalidate, (dev_t device) );
-_PROTOTYPE( void put_block, (struct buf *bp, int block_type) );
-_PROTOTYPE( void set_blocksize, (unsigned int blocksize, u32_t blocks,
- u32_t freeblocks, dev_t major));
-_PROTOTYPE( void rw_scattered, (dev_t dev,
- struct buf **bufq, int bufqsize, int rw_flag) );
+void buf_pool(int bufs);
+void flushall(dev_t dev);
+struct buf *get_block(dev_t dev, block_t block,int only_search);
+void invalidate(dev_t device);
+void put_block(struct buf *bp, int block_type);
+void set_blocksize(unsigned int blocksize, u32_t blocks, u32_t
+ freeblocks, dev_t major);
+void rw_scattered(dev_t dev, struct buf **bufq, int bufqsize, int
+ rw_flag);
/* ialloc.c */
-_PROTOTYPE( struct inode *alloc_inode, (struct inode *parent, mode_t bits));
-_PROTOTYPE( void free_inode, (struct inode *rip) );
+struct inode *alloc_inode(struct inode *parent, mode_t bits);
+void free_inode(struct inode *rip);
/* inode.c */
-_PROTOTYPE( void dup_inode, (struct inode *ip) );
-_PROTOTYPE( struct inode *find_inode, (dev_t dev, ino_t numb) );
-_PROTOTYPE( int fs_putnode, (void) );
-_PROTOTYPE( void init_inode_cache, (void) );
-_PROTOTYPE( struct inode *get_inode, (dev_t dev, ino_t numb) );
-_PROTOTYPE( void put_inode, (struct inode *rip) );
-_PROTOTYPE( void update_times, (struct inode *rip) );
-_PROTOTYPE( void rw_inode, (struct inode *rip, int rw_flag) );
+void dup_inode(struct inode *ip);
+struct inode *find_inode(dev_t dev, ino_t numb);
+int fs_putnode(void);
+void init_inode_cache(void);
+struct inode *get_inode(dev_t dev, ino_t numb);
+void put_inode(struct inode *rip);
+void update_times(struct inode *rip);
+void rw_inode(struct inode *rip, int rw_flag);
/* link.c */
-_PROTOTYPE( int fs_ftrunc, (void) );
-_PROTOTYPE( int fs_link, (void) );
-_PROTOTYPE( int fs_rdlink, (void) );
-_PROTOTYPE( int fs_rename, (void) );
-_PROTOTYPE( int fs_unlink, (void) );
-_PROTOTYPE( int truncate_inode, (struct inode *rip, off_t len) );
+int fs_ftrunc(void);
+int fs_link(void);
+int fs_rdlink(void);
+int fs_rename(void);
+int fs_unlink(void);
+int truncate_inode(struct inode *rip, off_t len);
/* misc.c */
-_PROTOTYPE( int fs_flush, (void) );
-_PROTOTYPE( int fs_sync, (void) );
-_PROTOTYPE( int fs_new_driver, (void) );
+int fs_flush(void);
+int fs_sync(void);
+int fs_new_driver(void);
/* mount.c */
-_PROTOTYPE( int fs_mountpoint, (void) );
-_PROTOTYPE( int fs_readsuper, (void) );
-_PROTOTYPE( int fs_unmount, (void) );
+int fs_mountpoint(void);
+int fs_readsuper(void);
+int fs_unmount(void);
/* open.c */
-_PROTOTYPE( int fs_create, (void) );
-_PROTOTYPE( int fs_inhibread, (void) );
-_PROTOTYPE( int fs_mkdir, (void) );
-_PROTOTYPE( int fs_mknod, (void) );
-_PROTOTYPE( int fs_slink, (void) );
+int fs_create(void);
+int fs_inhibread(void);
+int fs_mkdir(void);
+int fs_mknod(void);
+int fs_slink(void);
/* path.c */
-_PROTOTYPE( int fs_lookup, (void) );
-_PROTOTYPE( struct inode *advance, (struct inode *dirp,
- char string[NAME_MAX + 1], int chk_perm));
-_PROTOTYPE( int search_dir, (struct inode *ldir_ptr,
- char string [NAME_MAX + 1], ino_t *numb, int flag,
- int check_permissions, int ftype) );
+int fs_lookup(void);
+struct inode *advance(struct inode *dirp, char string[NAME_MAX + 1], int
+ chk_perm);
+int search_dir(struct inode *ldir_ptr, char string [NAME_MAX + 1], ino_t
+ *numb, int flag, int check_permissions, int ftype);
/* protect.c */
-_PROTOTYPE( int fs_chmod, (void) );
-_PROTOTYPE( int fs_chown, (void) );
-_PROTOTYPE( int fs_getdents, (void) );
-_PROTOTYPE( int forbidden, (struct inode *rip, mode_t access_desired) );
-_PROTOTYPE( int read_only, (struct inode *ip) );
+int fs_chmod(void);
+int fs_chown(void);
+int fs_getdents(void);
+int forbidden(struct inode *rip, mode_t access_desired);
+int read_only(struct inode *ip);
/* read.c */
-_PROTOTYPE( int fs_breadwrite, (void) );
-_PROTOTYPE( int fs_readwrite, (void) );
-_PROTOTYPE( void read_ahead, (void) );
-_PROTOTYPE( block_t read_map, (struct inode *rip, off_t pos) );
-_PROTOTYPE( block_t rd_indir, (struct buf *bp, int index) );
+int fs_breadwrite(void);
+int fs_readwrite(void);
+void read_ahead(void);
+block_t read_map(struct inode *rip, off_t pos);
+block_t rd_indir(struct buf *bp, int index);
/* stadir.c */
-_PROTOTYPE( int fs_fstatfs, (void) );
-_PROTOTYPE( int fs_stat, (void) );
-_PROTOTYPE( int fs_statvfs, (void) );
+int fs_fstatfs(void);
+int fs_stat(void);
+int fs_statvfs(void);
/* super.c */
-_PROTOTYPE( unsigned int get_block_size, (dev_t dev) );
-_PROTOTYPE( struct super_block *get_super, (dev_t dev) );
-_PROTOTYPE( int read_super, (struct super_block *sp) );
-_PROTOTYPE( void write_super, (struct super_block *sp) );
-_PROTOTYPE( struct group_desc* get_group_desc, (unsigned int bnum) );
+unsigned int get_block_size(dev_t dev);
+struct super_block *get_super(dev_t dev);
+int read_super(struct super_block *sp);
+void write_super(struct super_block *sp);
+struct group_desc* get_group_desc(unsigned int bnum);
/* time.c */
-_PROTOTYPE( int fs_utime, (void) );
+int fs_utime(void);
/* utility.c */
-_PROTOTYPE( time_t clock_time, (void) );
-_PROTOTYPE( unsigned conv2, (int norm, int w) );
-_PROTOTYPE( long conv4, (int norm, long x) );
-_PROTOTYPE( void mfs_nul_f, (char *file, int line, char *str,
- unsigned int len, unsigned int maxlen) );
-_PROTOTYPE( int min, (unsigned int l, unsigned int r) );
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( void sanitycheck, (char *file, int line) );
+time_t clock_time(void);
+unsigned conv2(int norm, int w);
+long conv4(int norm, long x);
+void mfs_nul_f(char *file, int line, char *str, unsigned int len,
+ unsigned int maxlen);
+int min(unsigned int l, unsigned int r);
+int no_sys(void);
+void sanitycheck(char *file, int line);
#define SANITYCHECK sanitycheck(__FILE__, __LINE__)
-_PROTOTYPE( int ansi_strcmp, (register const char* ansi_s,
- register const char *s2,
- register size_t ansi_s_length) );
-_PROTOTYPE( bit_t setbit, (bitchunk_t *bitmap, bit_t max_bits,
- unsigned int word));
-_PROTOTYPE( bit_t setbyte, (bitchunk_t *bitmap, bit_t max_bits,
- unsigned int word));
-_PROTOTYPE( int unsetbit, (bitchunk_t *bitmap, bit_t bit) );
+int ansi_strcmp(register const char* ansi_s, register const char *s2,
+ register size_t ansi_s_length);
+bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word);
+bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits, unsigned int word);
+int unsetbit(bitchunk_t *bitmap, bit_t bit);
/* write.c */
-_PROTOTYPE( struct buf *new_block, (struct inode *rip, off_t position) );
-_PROTOTYPE( void zero_block, (struct buf *bp) );
-_PROTOTYPE( int write_map, (struct inode *, off_t, block_t, int) );
+struct buf *new_block(struct inode *rip, off_t position);
+void zero_block(struct buf *bp);
+int write_map(struct inode *, off_t, block_t, int);
#endif /* EXT2_PROTO_H */
#include <sys/param.h>
-FORWARD _PROTOTYPE( struct buf *rahead, (struct inode *rip, block_t baseblock,
- u64_t position, unsigned bytes_ahead) );
-FORWARD _PROTOTYPE( 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));
+FORWARD 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,
+ 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];
#include "super.h"
#include "const.h"
-FORWARD _PROTOTYPE( off_t ext2_max_size, (int block_size) );
-FORWARD _PROTOTYPE( u32_t ext2_count_dirs, (struct super_block *sp) );
-
-FORWARD _PROTOTYPE( void super_copy, (register struct super_block *dest,
- register struct super_block *source));
-FORWARD _PROTOTYPE( void copy_group_descriptors,
- (register struct group_desc *dest_array,
- register struct group_desc *source_array,
- unsigned int ngroups));
+FORWARD off_t ext2_max_size(int block_size);
+FORWARD u32_t ext2_count_dirs(struct super_block *sp);
+
+FORWARD void super_copy(register struct super_block *dest, register
+ struct super_block *source);
+FORWARD 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;
#include "buf.h"
#include "super.h"
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
+PUBLIC int (*fs_call_vec[])(void) = {
no_sys, /* 0 not used */
no_sys, /* 1 */ /* Was: fs_getnode */
fs_putnode, /* 2 */
#include "inode.h"
#include "super.h"
-FORWARD _PROTOTYPE( void wr_indir, (struct buf *bp, int index, block_t block) );
-FORWARD _PROTOTYPE( int empty_indir, (struct buf *, struct super_block *) );
+FORWARD void wr_indir(struct buf *bp, int index, block_t block);
+FORWARD int empty_indir(struct buf *, struct super_block *);
/*===========================================================================*
* write_map *
PRIVATE LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS];
-FORWARD _PROTOTYPE( void del_one_dentry, (struct inode *ino) );
-FORWARD _PROTOTYPE( unsigned int hash_dentry, (struct inode *parent,
- char *name) );
+FORWARD void del_one_dentry(struct inode *ino);
+FORWARD unsigned int hash_dentry(struct inode *parent, char *name);
/*===========================================================================*
* init_dentry *
EXTERN struct state state; /* global state */
EXTERN struct opt opt; /* global options */
-extern _PROTOTYPE( int (*call_vec[]), (void) );
+extern int(*call_vec[]) (void);
#include <fcntl.h>
-FORWARD _PROTOTYPE( int force_remove, (char *path, int dir) );
+FORWARD int force_remove(char *path, int dir);
/*===========================================================================*
* do_create *
#include "inc.h"
-FORWARD _PROTOTYPE( int get_mask, (vfs_ucred_t *ucred) );
-FORWARD _PROTOTYPE( int access_as_dir, (struct inode *ino,
- struct hgfs_attr *attr, int uid, int mask) );
-FORWARD _PROTOTYPE( int next_name, (char **ptr, char **start,
- char name[NAME_MAX+1]) );
-FORWARD _PROTOTYPE( int go_up, (char path[PATH_MAX], struct inode *ino,
- struct inode **res_ino, struct hgfs_attr *attr) );
-FORWARD _PROTOTYPE( int go_down, (char path[PATH_MAX],
- struct inode *ino, char *name,
- struct inode **res_ino, struct hgfs_attr *attr) );
+FORWARD int get_mask(vfs_ucred_t *ucred);
+FORWARD 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
+ **res_ino, struct hgfs_attr *attr);
+FORWARD int go_down(char path[PATH_MAX], struct inode *ino, char *name,
+ struct inode **res_ino, struct hgfs_attr *attr);
/*===========================================================================*
* get_mask *
#include <unistd.h>
#include <stdlib.h>
-FORWARD _PROTOTYPE( void get_work, (endpoint_t *who_e) );
-FORWARD _PROTOTYPE( void send_reply, (int err, int transid) );
+FORWARD void get_work(endpoint_t *who_e);
+FORWARD void send_reply(int err, int transid);
PRIVATE struct optset optset_table[] = {
{ "prefix", OPT_STRING, opt.prefix, sizeof(opt.prefix) },
};
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* sef_cb_init_fresh *
/* dentry.c */
-_PROTOTYPE( void init_dentry, (void) );
-_PROTOTYPE( struct inode *lookup_dentry, (struct inode *parent,
- char *name) );
-_PROTOTYPE( void add_dentry, (struct inode *parent, char *name,
- struct inode *ino) );
-_PROTOTYPE( void del_dentry, (struct inode *ino) );
+void init_dentry(void);
+struct inode *lookup_dentry(struct inode *parent, char *name);
+void add_dentry(struct inode *parent, char *name, struct inode *ino);
+void del_dentry(struct inode *ino);
/* handle.c */
-_PROTOTYPE( int get_handle, (struct inode *ino) );
-_PROTOTYPE( void put_handle, (struct inode *ino) );
+int get_handle(struct inode *ino);
+void put_handle(struct inode *ino);
/* inode.c */
-_PROTOTYPE( struct inode *init_inode, (void) );
-_PROTOTYPE( struct inode *find_inode, (ino_t ino_nr) );
-_PROTOTYPE( void get_inode, (struct inode *ino) );
-_PROTOTYPE( void put_inode, (struct inode *ino) );
-_PROTOTYPE( void link_inode, (struct inode *parent, struct inode *ino) );
-_PROTOTYPE( void unlink_inode, (struct inode *ino) );
-_PROTOTYPE( struct inode *get_free_inode, (void) );
-_PROTOTYPE( int have_free_inode, (void) );
-_PROTOTYPE( int have_used_inode, (void) );
-_PROTOTYPE( int do_putnode, (void) );
+struct inode *init_inode(void);
+struct inode *find_inode(ino_t ino_nr);
+void get_inode(struct inode *ino);
+void put_inode(struct inode *ino);
+void link_inode(struct inode *parent, struct inode *ino);
+void unlink_inode(struct inode *ino);
+struct inode *get_free_inode(void);
+int have_free_inode(void);
+int have_used_inode(void);
+int do_putnode(void);
/* link.c */
-_PROTOTYPE( int do_create, (void) );
-_PROTOTYPE( int do_mkdir, (void) );
-_PROTOTYPE( int do_unlink, (void) );
-_PROTOTYPE( int do_rmdir, (void) );
-_PROTOTYPE( int do_rename, (void) );
+int do_create(void);
+int do_mkdir(void);
+int do_unlink(void);
+int do_rmdir(void);
+int do_rename(void);
/* lookup.c */
-_PROTOTYPE( int do_lookup, (void) );
+int do_lookup(void);
/* main.c */
-_PROTOTYPE( int main, (int argc, char *argv[]) );
+int main(int argc, char *argv[]);
/* misc.c */
-_PROTOTYPE( int do_fstatfs, (void) );
-_PROTOTYPE( int do_statvfs, (void) );
+int do_fstatfs(void);
+int do_statvfs(void);
/* mount.c */
-_PROTOTYPE( int do_readsuper, (void) );
-_PROTOTYPE( int do_unmount, (void) );
+int do_readsuper(void);
+int do_unmount(void);
/* name.c */
-_PROTOTYPE( void normalize_name, (char dst[NAME_MAX+1], char *src) );
-_PROTOTYPE( int compare_name, (char *name1, char *name2) );
+void normalize_name(char dst[NAME_MAX+1], char *src);
+int compare_name(char *name1, char *name2);
/* path.c */
-_PROTOTYPE( int make_path, (char path[PATH_MAX], struct inode *ino) );
-_PROTOTYPE( int push_path, (char path[PATH_MAX], char *name) );
-_PROTOTYPE( void pop_path, (char path[PATH_MAX]) );
+int make_path(char path[PATH_MAX], struct inode *ino);
+int push_path(char path[PATH_MAX], char *name);
+void pop_path(char path[PATH_MAX]);
/* read.c */
-_PROTOTYPE( int do_read, (void) );
-_PROTOTYPE( int do_getdents, (void) );
+int do_read(void);
+int do_getdents(void);
/* stat.c */
-_PROTOTYPE( mode_t get_mode, (struct inode *ino, int mode) );
-_PROTOTYPE( int do_stat, (void) );
-_PROTOTYPE( int do_chmod, (void) );
-_PROTOTYPE( int do_utime, (void) );
+mode_t get_mode(struct inode *ino, int mode);
+int do_stat(void);
+int do_chmod(void);
+int do_utime(void);
/* util.c */
-_PROTOTYPE( int get_name, (cp_grant_id_t grant, size_t len,
- char name[NAME_MAX+1]) );
-_PROTOTYPE( int do_noop, (void) );
-_PROTOTYPE( int no_sys, (void) );
+int get_name(cp_grant_id_t grant, size_t len, char name[NAME_MAX+1]);
+int do_noop(void);
+int no_sys(void);
/* verify.c */
-_PROTOTYPE( int verify_path, (char *path, struct inode *ino,
- struct hgfs_attr *attr, int *stale) );
-_PROTOTYPE( int verify_inode, (struct inode *ino, char path[PATH_MAX],
- struct hgfs_attr *attr) );
-_PROTOTYPE( int verify_dentry, (struct inode *parent,
- char name[NAME_MAX+1], char path[PATH_MAX],
- struct inode **res_ino) );
+int verify_path(char *path, struct inode *ino, struct hgfs_attr *attr,
+ int *stale);
+int verify_inode(struct inode *ino, char path[PATH_MAX], struct
+ hgfs_attr *attr);
+int verify_dentry(struct inode *parent, char name[NAME_MAX+1], char
+ path[PATH_MAX], struct inode **res_ino);
/* write.c */
-_PROTOTYPE( int do_write, (void) );
-_PROTOTYPE( int do_ftrunc, (void) );
+int do_write(void);
+int do_ftrunc(void);
#define _TABLE
#include "inc.h"
-PUBLIC _PROTOTYPE( int (*call_vec[]), (void) ) = {
+PUBLIC int (*call_vec[])(void) = {
no_sys, /* 0 */
no_sys, /* 1 getnode */
do_putnode, /* 2 putnode */
#include "inc.h"
-FORWARD _PROTOTYPE( int write_file, (struct inode *ino, u64_t *posp,
- size_t *countp, cp_grant_id_t *grantp) );
+FORWARD int write_file(struct inode *ino, u64_t *posp, size_t *countp,
+ cp_grant_id_t *grantp);
/*===========================================================================*
* write_file *
PRIVATE timer_t *timer_chain;
PRIVATE time_t next_timeout;
-FORWARD _PROTOTYPE( void clck_fast_release, (timer_t *timer) );
-FORWARD _PROTOTYPE( void set_timer, (void) );
+FORWARD void clck_fast_release(timer_t *timer);
+FORWARD void set_timer(void);
PUBLIC void clck_init()
{
u32_t system_hz;
#endif
-FORWARD _PROTOTYPE( void nw_conf, (void) );
-FORWARD _PROTOTYPE( void nw_init, (void) );
-FORWARD _PROTOTYPE( void ds_event, (void) );
+FORWARD void nw_conf(void);
+FORWARD void nw_init(void);
+FORWARD void ds_event(void);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+FORWARD void sef_local_startup(void);
+FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
PUBLIC int main(int argc, char *argv[])
{
#define THIS_FILE static char *this_file= __FILE__;
-_PROTOTYPE( void panic0, (char *file, int line) );
-_PROTOTYPE( void inet_panic, (void) ) _NORETURN;
+void panic0(char *file, int line);
+void inet_panic(void) _NORETURN;
#define ip_panic(print_list) \
(panic0(this_file, __LINE__), printf print_list, panic())
THIS_FILE
-FORWARD _PROTOTYPE( void setup_read, (eth_port_t *eth_port) );
-FORWARD _PROTOTYPE( void read_int, (eth_port_t *eth_port, int count) );
-FORWARD _PROTOTYPE( void eth_issue_send, (eth_port_t *eth_port) );
-FORWARD _PROTOTYPE( void write_int, (eth_port_t *eth_port) );
-FORWARD _PROTOTYPE( void eth_restart, (eth_port_t *eth_port,
- endpoint_t endpoint) );
-FORWARD _PROTOTYPE( void send_getstat, (eth_port_t *eth_port) );
+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()
{
int mq_allocated;
} mq_t;
-_PROTOTYPE( mq_t *mq_get, (void) );
-_PROTOTYPE( void mq_free, (mq_t *mq) );
-_PROTOTYPE( void mq_init, (void) );
+mq_t *mq_get(void);
+void mq_free(mq_t *mq);
+void mq_init(void);
#endif /* INET__MQ_H */
/* clock.c */
-_PROTOTYPE( void clck_tick, (message *mess) );
+void clck_tick(message *mess);
/* mnx_eth.c */
-_PROTOTYPE( void eth_rec, (message *m) );
-_PROTOTYPE( void eth_check_driver, (char *label, endpoint_t endpoint) );
+void eth_rec(message *m);
+void eth_check_driver(char *label, endpoint_t endpoint);
/* sr.c */
struct mq;
-_PROTOTYPE( void sr_rec, (struct mq *m) );
+void sr_rec(struct mq *m);
PRIVATE mq_t *repl_queue, *repl_queue_tail;
PRIVATE struct vscp_vec s_cp_req[SCPVEC_NR];
-FORWARD _PROTOTYPE ( int sr_open, (message *m) );
-FORWARD _PROTOTYPE ( void sr_close, (message *m) );
-FORWARD _PROTOTYPE ( int sr_rwio, (mq_t *m) );
-FORWARD _PROTOTYPE ( int sr_restart_read, (sr_fd_t *fdp) );
-FORWARD _PROTOTYPE ( int sr_restart_write, (sr_fd_t *fdp) );
-FORWARD _PROTOTYPE ( int sr_restart_ioctl, (sr_fd_t *fdp) );
-FORWARD _PROTOTYPE ( int sr_cancel, (message *m) );
-FORWARD _PROTOTYPE ( int sr_select, (message *m) );
-FORWARD _PROTOTYPE ( void sr_status, (message *m) );
-FORWARD _PROTOTYPE ( void sr_reply_, (mq_t *m, int reply, int is_revive) );
-FORWARD _PROTOTYPE ( sr_fd_t *sr_getchannel, (int minor));
-FORWARD _PROTOTYPE ( acc_t *sr_get_userdata, (int fd, size_t offset,
- size_t count, int for_ioctl) );
-FORWARD _PROTOTYPE ( int sr_put_userdata, (int fd, size_t offset,
- acc_t *data, int for_ioctl) );
-FORWARD _PROTOTYPE (void sr_select_res, (int fd, unsigned ops) );
-FORWARD _PROTOTYPE ( int sr_repl_queue, (int proc, int ref, int operation) );
-FORWARD _PROTOTYPE ( 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 _PROTOTYPE ( void sr_event, (event_t *evp, ev_arg_t arg) );
-FORWARD _PROTOTYPE ( int cp_u2b, (endpoint_t proc, cp_grant_id_t gid,
- vir_bytes offset, acc_t **var_acc_ptr, int size) );
-FORWARD _PROTOTYPE ( int cp_b2u, (acc_t *acc_ptr, endpoint_t proc,
- cp_grant_id_t gid, vir_bytes offset) );
+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
+ for_ioctl);
+FORWARD 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
+ **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,
+ acc_t **var_acc_ptr, int size);
+FORWARD int cp_b2u(acc_t *acc_ptr, endpoint_t proc, cp_grant_id_t gid,
+ vir_bytes offset);
PUBLIC void sr_init()
{
#include <errno.h>
#include <signal.h>
-_PROTOTYPE( int do_shmget, (message *) );
-_PROTOTYPE( int do_shmat, (message *) );
-_PROTOTYPE( int do_shmdt, (message *) );
-_PROTOTYPE( int do_shmctl, (message *) );
-_PROTOTYPE( int check_perm, (struct ipc_perm *, endpoint_t, int) );
-_PROTOTYPE( void update_refcount_and_destroy, (void) );
-_PROTOTYPE( int do_semget, (message *) );
-_PROTOTYPE( int do_semctl, (message *) );
-_PROTOTYPE( int do_semop, (message *) );
-_PROTOTYPE( int is_sem_nil, (void) );
-_PROTOTYPE( int is_shm_nil, (void) );
-_PROTOTYPE( void sem_process_vm_notify, (void) );
+int do_shmget(message *);
+int do_shmat(message *);
+int do_shmdt(message *);
+int do_shmctl(message *);
+int check_perm(struct ipc_perm *, endpoint_t, int);
+void update_refcount_and_destroy(void);
+int do_semget(message *);
+int do_semctl(message *);
+int do_semop(message *);
+int is_sem_nil(void);
+int is_shm_nil(void);
+void sem_process_vm_notify(void);
EXTERN int identifier;
EXTERN endpoint_t who_e;
PRIVATE int verbose = 0;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
PUBLIC int main(int argc, char *argv[])
{
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
/* Declare some local dump procedures. */
-FORWARD _PROTOTYPE( char *proc_name, (int proc_nr) );
-FORWARD _PROTOTYPE( char *s_traps_str, (int flags) );
-FORWARD _PROTOTYPE( char *s_flags_str, (int flags) );
-FORWARD _PROTOTYPE( char *p_rts_flags_str, (int flags) );
-FORWARD _PROTOTYPE( char *boot_flags_str, (int flags) );
+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);
/* Some global data that is shared among several dumping procedures.
* Note that the process table copy has the same name as in the kernel
PUBLIC struct rprocpub rprocpub[NR_SYS_PROCS];
PUBLIC struct rproc rproc[NR_SYS_PROCS];
-FORWARD _PROTOTYPE( char *s_flags_str, (int flags, int sys_flags) );
+FORWARD char *s_flags_str(int flags, int sys_flags);
/*===========================================================================*
* rproc_dmp *
extern int errno; /* error number set by system library */
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (void) );
-FORWARD _PROTOTYPE(void reply, (int whom, int result) );
+FORWARD void get_work(void);
+FORWARD void reply(int whom, int result);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
/* Function prototypes. */
/* main.c */
-_PROTOTYPE( int main, (int argc, char **argv) );
+int main(int argc, char **argv);
/* dmp.c */
-_PROTOTYPE( void map_unmap_fkeys, (int map) );
-_PROTOTYPE( int do_fkey_pressed, (message *m) );
-_PROTOTYPE( void mapping_dmp, (void) );
-_PROTOTYPE( void vm_dmp, (void) );
+void map_unmap_fkeys(int map);
+int do_fkey_pressed(message *m);
+void mapping_dmp(void);
+void vm_dmp(void);
/* dmp_kernel.c */
-_PROTOTYPE( void proctab_dmp, (void) );
-_PROTOTYPE( void procstack_dmp, (void) );
-_PROTOTYPE( void memmap_dmp, (void) );
-_PROTOTYPE( void privileges_dmp, (void) );
-_PROTOTYPE( void image_dmp, (void) );
-_PROTOTYPE( void irqtab_dmp, (void) );
-_PROTOTYPE( void kmessages_dmp, (void) );
-_PROTOTYPE( void monparams_dmp, (void) );
-_PROTOTYPE( void kenv_dmp, (void) );
+void proctab_dmp(void);
+void procstack_dmp(void);
+void memmap_dmp(void);
+void privileges_dmp(void);
+void image_dmp(void);
+void irqtab_dmp(void);
+void kmessages_dmp(void);
+void monparams_dmp(void);
+void kenv_dmp(void);
/* dmp_pm.c */
-_PROTOTYPE( void mproc_dmp, (void) );
-_PROTOTYPE( void sigaction_dmp, (void) );
+void mproc_dmp(void);
+void sigaction_dmp(void);
/* dmp_fs.c */
-_PROTOTYPE( void dtab_dmp, (void) );
-_PROTOTYPE( void fproc_dmp, (void) );
+void dtab_dmp(void);
+void fproc_dmp(void);
/* dmp_rs.c */
-_PROTOTYPE( void rproc_dmp, (void) );
+void rproc_dmp(void);
/* dmp_ds.c */
-_PROTOTYPE( void data_store_dmp, (void) );
+void data_store_dmp(void);
#include <minix/bdev.h>
#include "buf.h"
-FORWARD _PROTOTYPE(int read_block, (struct buf *));
+FORWARD int read_block(struct buf *);
PUBLIC struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the
* buffer cache to pick up*/
EXTERN int err_code; /* temporary storage for error number */
EXTERN int rdwt_err; /* status of last disk i/o request */
-EXTERN _PROTOTYPE (int (*fs_call_vec[]), (void) ); /* fs call table */
+EXTERN int(*fs_call_vec[]) (void);
EXTERN message fs_m_in; /* contains the input message of the request */
EXTERN message fs_m_out; /* contains the output message of the
#include "glo.h"
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (message *m_in) );
+FORWARD void get_work(message *m_in);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
#include "buf.h"
-FORWARD _PROTOTYPE( char *get_name, (char *name, char string[NAME_MAX+1]) );
-FORWARD _PROTOTYPE( int parse_path, (ino_t dir_ino, ino_t root_ino, int flags,
- struct dir_record **res_inop,
- size_t *offsetp) );
+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
+ dir_record **res_inop, size_t *offsetp);
/*===========================================================================*
/* main.c */
-_PROTOTYPE( int main, (void) );
-_PROTOTYPE( void reply, (int who, message *m_out) );
+int main(void);
+void reply(int who, message *m_out);
/* cache.c */
-_PROTOTYPE(struct buf *get_block,(block_t block));
-_PROTOTYPE(void put_block,(struct buf *bp));
+struct buf *get_block(block_t block);
+void put_block(struct buf *bp);
/* inode.c */
-_PROTOTYPE( int create_dir_record,(struct dir_record *dir, char *buffer,
- u32_t address) );
-_PROTOTYPE( int create_ext_attr,(struct ext_attr_rec *ext, char *buffer));
-_PROTOTYPE( int fs_getnode, (void) );
-_PROTOTYPE( int fs_putnode, (void) );
-_PROTOTYPE( struct dir_record *get_dir_record, (ino_t id_dir) );
-_PROTOTYPE( struct dir_record *get_free_dir_record, (void) );
-_PROTOTYPE( struct ext_attr_rec *get_free_ext_attr, (void) );
-_PROTOTYPE( struct dir_record *load_dir_record_from_disk,(u32_t address));
-_PROTOTYPE( int release_dir_record, (struct dir_record *dir) );
+int create_dir_record(struct dir_record *dir, char *buffer, u32_t
+ address);
+int create_ext_attr(struct ext_attr_rec *ext, char *buffer);
+int fs_getnode(void);
+int fs_putnode(void);
+struct dir_record *get_dir_record(ino_t id_dir);
+struct dir_record *get_free_dir_record(void);
+struct ext_attr_rec *get_free_ext_attr(void);
+struct dir_record *load_dir_record_from_disk(u32_t address);
+int release_dir_record(struct dir_record *dir);
/* misc.c */
-_PROTOTYPE( int fs_sync, (void) );
-_PROTOTYPE( int fs_new_driver, (void) );
+int fs_sync(void);
+int fs_new_driver(void);
/* mount.c */
-_PROTOTYPE( int fs_readsuper, (void) );
-_PROTOTYPE( int fs_mountpoint, (void) );
-_PROTOTYPE( int fs_unmount, (void) );
+int fs_readsuper(void);
+int fs_mountpoint(void);
+int fs_unmount(void);
/* path.c */
-_PROTOTYPE( int fs_lookup, (void) );
-_PROTOTYPE( int advance, (struct dir_record *dirp, char string[NAME_MAX],
- struct dir_record **resp) );
-_PROTOTYPE( int search_dir, (struct dir_record *ldir_ptr,
- char string [NAME_MAX], ino_t *numb) );
+int fs_lookup(void);
+int advance(struct dir_record *dirp, char string[NAME_MAX], struct
+ dir_record **resp);
+int search_dir(struct dir_record *ldir_ptr, char string [NAME_MAX],
+ ino_t *numb);
/* protect.c */
-_PROTOTYPE( int fs_access, (void) );
+int fs_access(void);
/* read.c */
-_PROTOTYPE( int fs_read, (void) );
-_PROTOTYPE( int fs_bread, (void) );
-_PROTOTYPE( int fs_getdents, (void) );
-_PROTOTYPE( int read_chunk, (struct dir_record *rip, u64_t position,
- unsigned off, int chunk, unsigned left,
- cp_grant_id_t gid, unsigned buf_off,
- int block_size, int *completed) );
+int fs_read(void);
+int fs_bread(void);
+int fs_getdents(void);
+int read_chunk(struct dir_record *rip, u64_t position, unsigned off, int
+ chunk, unsigned left, cp_grant_id_t gid, unsigned buf_off, int
+ block_size, int *completed);
/* stadir.c */
-_PROTOTYPE( int fs_stat, (void) );
-_PROTOTYPE( int fs_fstatfs, (void) );
-_PROTOTYPE( int fs_statvfs, (void) );
+int fs_stat(void);
+int fs_fstatfs(void);
+int fs_statvfs(void);
/* super.c */
-_PROTOTYPE(int release_v_pri, (struct iso9660_vd_pri *v_pri) );
-_PROTOTYPE(int read_vds, (struct iso9660_vd_pri *v_pri, dev_t dev) );
-_PROTOTYPE(int create_v_pri, (struct iso9660_vd_pri *v_pri, char *buffer,
- unsigned long address) );
+int release_v_pri(struct iso9660_vd_pri *v_pri);
+int read_vds(struct iso9660_vd_pri *v_pri, dev_t dev);
+int create_v_pri(struct iso9660_vd_pri *v_pri, char *buffer, unsigned
+ long address);
/* utility.c */
-_PROTOTYPE(int do_noop, (void) );
-_PROTOTYPE(int no_sys, (void) );
+int do_noop(void);
+int no_sys(void);
#include "inc.h"
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
+PUBLIC int (*fs_call_vec[])(void) = {
no_sys, /* 0: not used */
no_sys, /* 1: not used */
fs_putnode, /* 2 */
#include "super.h"
#include "inode.h"
-FORWARD _PROTOTYPE( void rm_lru, (struct buf *bp) );
-FORWARD _PROTOTYPE( void read_block, (struct buf *) );
+FORWARD void rm_lru(struct buf *bp);
+FORWARD void read_block(struct buf *);
PRIVATE int vmcache = 0; /* are we using vm's secondary cache? (initially not) */
extern char dot1[2]; /* dot1 (&dot1[0]) and dot2 (&dot2[0]) have a special */
extern char dot2[3]; /* meaning to search_dir: no access permission check. */
-extern _PROTOTYPE (int (*fs_call_vec[]), (void) ); /* fs call table */
+extern int(*fs_call_vec[]) (void);
EXTERN message fs_m_in;
EXTERN message fs_m_out;
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( void addhash_inode, (struct inode *node) );
-
-FORWARD _PROTOTYPE( void free_inode, (dev_t dev, ino_t numb) );
-FORWARD _PROTOTYPE( void new_icopy, (struct inode *rip, d2_inode *dip,
- int direction, int norm));
-FORWARD _PROTOTYPE( void old_icopy, (struct inode *rip, d1_inode *dip,
- int direction, int norm));
-FORWARD _PROTOTYPE( void unhash_inode, (struct inode *node) );
-FORWARD _PROTOTYPE( void wipe_inode, (struct inode *rip) );
+FORWARD 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,
+ int norm);
+FORWARD 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);
/*===========================================================================*
#define SAME 1000
-FORWARD _PROTOTYPE( int freesp_inode, (struct inode *rip, off_t st,
- off_t end) );
-FORWARD _PROTOTYPE( int remove_dir, (struct inode *rldirp,
- struct inode *rip, char dir_name[MFS_NAME_MAX]) );
-FORWARD _PROTOTYPE( int unlink_file, (struct inode *dirp,
- struct inode *rip, char file_name[MFS_NAME_MAX]) );
-FORWARD _PROTOTYPE( off_t nextblock, (off_t pos, int zone_size) );
-FORWARD _PROTOTYPE( void zerozone_half, (struct inode *rip, off_t pos,
- int half, int zone_size) );
-FORWARD _PROTOTYPE( void zerozone_range, (struct inode *rip, off_t pos,
- off_t len) );
+FORWARD int freesp_inode(struct inode *rip, off_t st, off_t end);
+FORWARD 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
+ 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
+ zone_size);
+FORWARD void zerozone_range(struct inode *rip, off_t pos, off_t len);
/* Args to zerozone_half() */
#define FIRST_HALF 0
/* Declare some local functions. */
-FORWARD _PROTOTYPE(void get_work, (message *m_in) );
-FORWARD _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
+FORWARD void get_work(message *m_in);
+FORWARD void reply(endpoint_t who, message *m_out);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( struct inode *new_node, (struct inode *ldirp,
- char *string, mode_t bits, zone_t z0));
+FORWARD struct inode *new_node(struct inode *ldirp, char *string, mode_t
+ bits, zone_t z0);
/*===========================================================================*
* fs_create *
PUBLIC char dot1[2] = "."; /* used for search_dir to bypass the access */
PUBLIC char dot2[3] = ".."; /* permissions for . and .. */
-FORWARD _PROTOTYPE( char *get_name, (char *name, char string[MFS_NAME_MAX+1]) );
-FORWARD _PROTOTYPE( int ltraverse, (struct inode *rip, char *suffix) );
-FORWARD _PROTOTYPE( int parse_path, (ino_t dir_ino, ino_t root_ino,
- int flags, struct inode **res_inop,
- size_t *offsetp, int *symlinkp) );
+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
+ inode **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
#include "super.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( int in_group, (gid_t grp) );
+FORWARD int in_group(gid_t grp);
/*===========================================================================*
/* cache.c */
-_PROTOTYPE( zone_t alloc_zone, (dev_t dev, zone_t z) );
-_PROTOTYPE( void buf_pool, (int bufs) );
-_PROTOTYPE( void flushall, (dev_t dev) );
-_PROTOTYPE( void free_zone, (dev_t dev, zone_t numb) );
-_PROTOTYPE( struct buf *get_block, (dev_t dev, block_t block,int only_search));
-_PROTOTYPE( void invalidate, (dev_t device) );
-_PROTOTYPE( void put_block, (struct buf *bp, int block_type) );
-_PROTOTYPE( void set_blocksize, (struct super_block *) );
-_PROTOTYPE( void rw_scattered, (dev_t dev,
- struct buf **bufq, int bufqsize, int rw_flag) );
-_PROTOTYPE( int block_write_ok, (struct buf *bp) );
+zone_t alloc_zone(dev_t dev, zone_t z);
+void buf_pool(int bufs);
+void flushall(dev_t dev);
+void free_zone(dev_t dev, zone_t numb);
+struct buf *get_block(dev_t dev, block_t block,int only_search);
+void invalidate(dev_t device);
+void put_block(struct buf *bp, int block_type);
+void set_blocksize(struct super_block *);
+void rw_scattered(dev_t dev, struct buf **bufq, int bufqsize, int
+ rw_flag);
+int block_write_ok(struct buf *bp);
/* inode.c */
-_PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t bits) );
-_PROTOTYPE( void dup_inode, (struct inode *ip) );
-_PROTOTYPE( struct inode *find_inode, (dev_t dev, ino_t numb) );
-_PROTOTYPE( int fs_putnode, (void) );
-_PROTOTYPE( void init_inode_cache, (void) );
-_PROTOTYPE( struct inode *get_inode, (dev_t dev, ino_t numb) );
-_PROTOTYPE( void put_inode, (struct inode *rip) );
-_PROTOTYPE( void update_times, (struct inode *rip) );
-_PROTOTYPE( void rw_inode, (struct inode *rip, int rw_flag) );
+struct inode *alloc_inode(dev_t dev, mode_t bits);
+void dup_inode(struct inode *ip);
+struct inode *find_inode(dev_t dev, ino_t numb);
+int fs_putnode(void);
+void init_inode_cache(void);
+struct inode *get_inode(dev_t dev, ino_t numb);
+void put_inode(struct inode *rip);
+void update_times(struct inode *rip);
+void rw_inode(struct inode *rip, int rw_flag);
/* link.c */
-_PROTOTYPE( int fs_ftrunc, (void) );
-_PROTOTYPE( int fs_link, (void) );
-_PROTOTYPE( int fs_rdlink, (void) );
-_PROTOTYPE( int fs_rename, (void) );
-_PROTOTYPE( int fs_unlink, (void) );
-_PROTOTYPE( int truncate_inode, (struct inode *rip, off_t len) );
+int fs_ftrunc(void);
+int fs_link(void);
+int fs_rdlink(void);
+int fs_rename(void);
+int fs_unlink(void);
+int truncate_inode(struct inode *rip, off_t len);
/* misc.c */
-_PROTOTYPE( int fs_flush, (void) );
-_PROTOTYPE( int fs_sync, (void) );
-_PROTOTYPE( int fs_new_driver, (void) );
+int fs_flush(void);
+int fs_sync(void);
+int fs_new_driver(void);
/* mount.c */
-_PROTOTYPE( int fs_mountpoint, (void) );
-_PROTOTYPE( int fs_readsuper, (void) );
-_PROTOTYPE( int fs_unmount, (void) );
+int fs_mountpoint(void);
+int fs_readsuper(void);
+int fs_unmount(void);
/* open.c */
-_PROTOTYPE( int fs_create, (void) );
-_PROTOTYPE( int fs_inhibread, (void) );
-_PROTOTYPE( int fs_mkdir, (void) );
-_PROTOTYPE( int fs_mknod, (void) );
-_PROTOTYPE( int fs_slink, (void) );
+int fs_create(void);
+int fs_inhibread(void);
+int fs_mkdir(void);
+int fs_mknod(void);
+int fs_slink(void);
/* path.c */
-_PROTOTYPE( int fs_lookup, (void) );
-_PROTOTYPE( struct inode *advance, (struct inode *dirp,
- char string[MFS_NAME_MAX], int chk_perm) );
-_PROTOTYPE( int search_dir, (struct inode *ldir_ptr,
- char string [MFS_NAME_MAX], ino_t *numb, int flag,
- int check_permissions) );
+int fs_lookup(void);
+struct inode *advance(struct inode *dirp, char string[MFS_NAME_MAX], int
+ chk_perm);
+int search_dir(struct inode *ldir_ptr, char string [MFS_NAME_MAX], ino_t
+ *numb, int flag, int check_permissions);
/* protect.c */
-_PROTOTYPE( int fs_chmod, (void) );
-_PROTOTYPE( int fs_chown, (void) );
-_PROTOTYPE( int fs_getdents, (void) );
-_PROTOTYPE( int forbidden, (struct inode *rip, mode_t access_desired) );
-_PROTOTYPE( int read_only, (struct inode *ip) );
+int fs_chmod(void);
+int fs_chown(void);
+int fs_getdents(void);
+int forbidden(struct inode *rip, mode_t access_desired);
+int read_only(struct inode *ip);
/* read.c */
-_PROTOTYPE( int fs_breadwrite, (void) );
-_PROTOTYPE( int fs_readwrite, (void) );
-_PROTOTYPE( void read_ahead, (void) );
-_PROTOTYPE( block_t read_map, (struct inode *rip, off_t pos) );
-_PROTOTYPE( zone_t rd_indir, (struct buf *bp, int index) );
+int fs_breadwrite(void);
+int fs_readwrite(void);
+void read_ahead(void);
+block_t read_map(struct inode *rip, off_t pos);
+zone_t rd_indir(struct buf *bp, int index);
/* stadir.c */
-_PROTOTYPE( int fs_fstatfs, (void) );
-_PROTOTYPE( int fs_stat, (void) );
-_PROTOTYPE( int fs_statvfs, (void) );
+int fs_fstatfs(void);
+int fs_stat(void);
+int fs_statvfs(void);
/* super.c */
-_PROTOTYPE( bit_t alloc_bit, (struct super_block *sp, int map, bit_t origin));
-_PROTOTYPE( void free_bit, (struct super_block *sp, int map,
- bit_t bit_returned) );
-_PROTOTYPE( unsigned int get_block_size, (dev_t dev) );
-_PROTOTYPE( struct super_block *get_super, (dev_t dev) );
-_PROTOTYPE( int read_super, (struct super_block *sp) );
-_PROTOTYPE( int write_super, (struct super_block *sp) );
+bit_t alloc_bit(struct super_block *sp, int map, bit_t origin);
+void free_bit(struct super_block *sp, int map, bit_t bit_returned);
+unsigned int get_block_size(dev_t dev);
+struct super_block *get_super(dev_t dev);
+int read_super(struct super_block *sp);
+int write_super(struct super_block *sp);
/* stats.c */
-_PROTOTYPE( bit_t count_free_bits, (struct super_block *sp, int map));
-_PROTOTYPE( void blockstats, (u32_t *total, u32_t *free, u32_t *avail));
+bit_t count_free_bits(struct super_block *sp, int map);
+void blockstats(u32_t *total, u32_t *free, u32_t *avail);
/* time.c */
-_PROTOTYPE( int fs_utime, (void) );
+int fs_utime(void);
/* utility.c */
-_PROTOTYPE( time_t clock_time, (void) );
-_PROTOTYPE( unsigned conv2, (int norm, int w) );
-_PROTOTYPE( long conv4, (int norm, long x) );
-_PROTOTYPE( void mfs_nul_f, (char *file, int line, char *str, unsigned int len,
- unsigned int maxlen) );
-_PROTOTYPE( int min, (unsigned int l, unsigned int r) );
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( void sanitycheck, (char *file, int line) );
+time_t clock_time(void);
+unsigned conv2(int norm, int w);
+long conv4(int norm, long x);
+void mfs_nul_f(char *file, int line, char *str, unsigned int len,
+ unsigned int maxlen);
+int min(unsigned int l, unsigned int r);
+int no_sys(void);
+void sanitycheck(char *file, int line);
#define SANITYCHECK sanitycheck(__FILE__, __LINE__)
/* write.c */
-_PROTOTYPE( void clear_zone, (struct inode *rip, off_t pos, int flag) );
-_PROTOTYPE( struct buf *new_block, (struct inode *rip, off_t position) );
-_PROTOTYPE( void zero_block, (struct buf *bp) );
-_PROTOTYPE( int write_map, (struct inode *, off_t, zone_t, int) );
+void clear_zone(struct inode *rip, off_t pos, int flag);
+struct buf *new_block(struct inode *rip, off_t position);
+void zero_block(struct buf *bp);
+int write_map(struct inode *, off_t, zone_t, int);
#endif
#include <assert.h>
-FORWARD _PROTOTYPE( struct buf *rahead, (struct inode *rip, block_t baseblock,
- u64_t position, unsigned bytes_ahead) );
-FORWARD _PROTOTYPE( 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) );
+FORWARD 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,
+ 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];
#include "buf.h"
#include "super.h"
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = {
+PUBLIC int (*fs_call_vec[])(void) = {
no_sys, /* 0 not used */
no_sys, /* 1 */ /* Was: fs_getnode */
fs_putnode, /* 2 */
#include "super.h"
-FORWARD _PROTOTYPE( void wr_indir, (struct buf *bp, int index, zone_t zone) );
-FORWARD _PROTOTYPE( int empty_indir, (struct buf *, struct super_block *) );
+FORWARD void wr_indir(struct buf *bp, int index, zone_t zone);
+FORWARD int empty_indir(struct buf *, struct super_block *);
/*===========================================================================*
#include <stdlib.h>
#include <string.h>
-FORWARD _PROTOTYPE( struct buf *new_block, (dev_t dev, ino_t inum) );
+FORWARD struct buf *new_block(dev_t dev, ino_t inum);
/*===========================================================================*
* buf_pool *
#include "glo.h"
#include "uds.h"
-FORWARD _PROTOTYPE( int uds_perform_read, (int minor, endpoint_t m_source,
- size_t size, int pretend));
-FORWARD _PROTOTYPE( int uds_perform_write, (int minor, endpoint_t m_source,
- size_t size, int pretend));
+FORWARD 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
+ size, int pretend);
PUBLIC int uds_open(message *dev_m_in, message *dev_m_out)
{
/* The following variables are used for returning results to the caller. */
EXTERN int err_code; /* temporary storage for error number */
-EXTERN _PROTOTYPE (int (*fs_call_vec[]), (message *fs_m_in, message *fs_m_out) ); /* fs call table */
-EXTERN _PROTOTYPE (int (*dev_call_vec[]), (message *fs_m_in, message *fs_m_out) ); /* dev call table */
+EXTERN int(*fs_call_vec[]) (message *fs_m_in, message *fs_m_out);
+EXTERN int(*dev_call_vec[]) (message *fs_m_in, message *fs_m_out);
EXTERN uid_t caller_uid;
EXTERN gid_t caller_gid;
#include "inode.h"
#include <minix/vfsif.h>
-FORWARD _PROTOTYPE( void addhash_inode, (struct inode * const node) );
-FORWARD _PROTOTYPE( void unhash_inode, (struct inode * const node) );
+FORWARD void addhash_inode(struct inode * const node);
+FORWARD void unhash_inode(struct inode * const node);
/*===========================================================================*
#include "inode.h"
#include "uds.h"
-FORWARD _PROTOTYPE(void get_work, (message *m_in) );
+FORWARD void get_work(message *m_in);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
struct ancillary;
/* buffer.c */
-_PROTOTYPE( struct buf *get_block, (dev_t dev, ino_t inum) );
-_PROTOTYPE( void put_block, (dev_t dev, ino_t inum) );
+struct buf *get_block(dev_t dev, ino_t inum);
+void put_block(dev_t dev, ino_t inum);
/* cache.c */
-_PROTOTYPE( void buf_pool, (void) );
+void buf_pool(void);
/* inode.c */
-_PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t mode) );
-_PROTOTYPE( void dup_inode, (struct inode *ip) );
-_PROTOTYPE( struct inode *find_inode, (ino_t numb) );
-_PROTOTYPE( void free_inode, (struct inode *rip) );
-_PROTOTYPE( int fs_putnode, (message *fs_m_in, message *fs_m_out) );
-_PROTOTYPE( void init_inode_cache, (void) );
-_PROTOTYPE( struct inode *get_inode, (dev_t dev, ino_t numb) );
-_PROTOTYPE( void put_inode, (struct inode *rip) );
-_PROTOTYPE( void update_times, (struct inode *rip) );
-_PROTOTYPE( void wipe_inode, (struct inode *rip) );
+struct inode *alloc_inode(dev_t dev, mode_t mode);
+void dup_inode(struct inode *ip);
+struct inode *find_inode(ino_t numb);
+void free_inode(struct inode *rip);
+int fs_putnode(message *fs_m_in, message *fs_m_out);
+void init_inode_cache(void);
+struct inode *get_inode(dev_t dev, ino_t numb);
+void put_inode(struct inode *rip);
+void update_times(struct inode *rip);
+void wipe_inode(struct inode *rip);
/* link.c */
-_PROTOTYPE( int fs_ftrunc, (message *fs_m_in, message *fs_m_out) );
-_PROTOTYPE( int truncate_inode, (struct inode *rip, off_t newsize) );
+int fs_ftrunc(message *fs_m_in, message *fs_m_out);
+int truncate_inode(struct inode *rip, off_t newsize);
/* main.c */
-_PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
+void reply(endpoint_t who, message *m_out);
/* misc.c */
-_PROTOTYPE( int fs_sync, (message *fs_m_in, message *fs_m_out) );
+int fs_sync(message *fs_m_in, message *fs_m_out);
/* mount.c */
-_PROTOTYPE( int fs_unmount, (message *fs_m_in, message *fs_m_out) );
+int fs_unmount(message *fs_m_in, message *fs_m_out);
/* open.c */
-_PROTOTYPE( int fs_newnode, (message *fs_m_in, message *fs_m_out) );
+int fs_newnode(message *fs_m_in, message *fs_m_out);
/* read.c */
-_PROTOTYPE( int fs_readwrite, (message *fs_m_in, message *fs_m_out) );
+int fs_readwrite(message *fs_m_in, message *fs_m_out);
/* utility.c */
-_PROTOTYPE( time_t clock_time, (void) );
-_PROTOTYPE( int no_sys, (message *pfs_m_in, message *pfs_m_out) );
+time_t clock_time(void);
+int no_sys(message *pfs_m_in, message *pfs_m_out);
/* stadir.c */
-_PROTOTYPE( int fs_stat, (message *fs_m_in, message *fs_m_out) );
+int fs_stat(message *fs_m_in, message *fs_m_out);
/* super.c */
-_PROTOTYPE( bit_t alloc_bit, (void) );
-_PROTOTYPE( void free_bit, (bit_t bit_returned) );
+bit_t alloc_bit(void);
+void free_bit(bit_t bit_returned);
/* dev_uds.c */
-_PROTOTYPE( int uds_open, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_close, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_read, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_write, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_ioctl, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_select, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int uds_unsuspend, (endpoint_t m_source, int minor) );
-_PROTOTYPE( int uds_cancel, (message *dev_m_in, message *dev_m_out) );
+int uds_open(message *dev_m_in, message *dev_m_out);
+int uds_close(message *dev_m_in, message *dev_m_out);
+int uds_read(message *dev_m_in, message *dev_m_out);
+int uds_write(message *dev_m_in, message *dev_m_out);
+int uds_ioctl(message *dev_m_in, message *dev_m_out);
+int uds_select(message *dev_m_in, message *dev_m_out);
+int uds_unsuspend(endpoint_t m_source, int minor);
+int uds_cancel(message *dev_m_in, message *dev_m_out);
/* uds.c */
-_PROTOTYPE( void uds_init, (void) );
-_PROTOTYPE( int do_accept, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_connect, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_listen, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_socket, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_bind, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockname, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getpeername, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_shutdown, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_socketpair, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_socketpair_old, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockopt_sotype,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockopt_peercred,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockopt_peercred_old,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockopt_sndbuf,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_setsockopt_sndbuf,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_getsockopt_rcvbuf,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_setsockopt_rcvbuf,
- (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_sendto, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_recvfrom, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_sendmsg, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int do_recvmsg, (message *dev_m_in, message *dev_m_out) );
-_PROTOTYPE( int perform_connection,
- (message *dev_m_in, message *dev_m_out,
- struct sockaddr_un *addr, int minorx,
- int minory) );
-_PROTOTYPE( int clear_fds, (int minor, struct ancillary *data) );
+void uds_init(void);
+int do_accept(message *dev_m_in, message *dev_m_out);
+int do_connect(message *dev_m_in, message *dev_m_out);
+int do_listen(message *dev_m_in, message *dev_m_out);
+int do_socket(message *dev_m_in, message *dev_m_out);
+int do_bind(message *dev_m_in, message *dev_m_out);
+int do_getsockname(message *dev_m_in, message *dev_m_out);
+int do_getpeername(message *dev_m_in, message *dev_m_out);
+int do_shutdown(message *dev_m_in, message *dev_m_out);
+int do_socketpair(message *dev_m_in, message *dev_m_out);
+int do_socketpair_old(message *dev_m_in, message *dev_m_out);
+int do_getsockopt_sotype(message *dev_m_in, message *dev_m_out);
+int do_getsockopt_peercred(message *dev_m_in, message *dev_m_out);
+int do_getsockopt_peercred_old(message *dev_m_in, message *dev_m_out);
+int do_getsockopt_sndbuf(message *dev_m_in, message *dev_m_out);
+int do_setsockopt_sndbuf(message *dev_m_in, message *dev_m_out);
+int do_getsockopt_rcvbuf(message *dev_m_in, message *dev_m_out);
+int do_setsockopt_rcvbuf(message *dev_m_in, message *dev_m_out);
+int do_sendto(message *dev_m_in, message *dev_m_out);
+int do_recvfrom(message *dev_m_in, message *dev_m_out);
+int do_sendmsg(message *dev_m_in, message *dev_m_out);
+int do_recvmsg(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);
+int clear_fds(int minor, struct ancillary *data);
#endif
#include "uds.h"
/* File System Handlers (pfs) */
-PUBLIC _PROTOTYPE (int (*fs_call_vec[]),
- (message *fs_m_in, message *fs_m_out) ) = {
+PUBLIC int (*fs_call_vec[])(message *fs_m_in, message *fs_m_out) = {
no_sys, /* 0 not used */
no_sys, /* 1 */
};
/* Device Handlers (/dev/uds) */
-PUBLIC _PROTOTYPE (int (*dev_call_vec[]),
- (message *dev_m_in, message *dev_m_out) ) = {
+PUBLIC int (*dev_call_vec[])(message *dev_m_in, message *dev_m_out) = {
uds_cancel, /* 0 CANCEL */
no_sys, /* 1 */
#define US 1000000 /* shortcut for microseconds per second */
-FORWARD _PROTOTYPE( clock_t ticks_from_timeval, (struct timeval *tv) );
-FORWARD _PROTOTYPE( void timeval_from_ticks, (struct timeval *tv,
- clock_t ticks) );
-FORWARD _PROTOTYPE( int is_sane_timeval, (struct timeval *tv) );
-FORWARD _PROTOTYPE( void getset_vtimer, (struct mproc *mp, int nwhich,
- struct itimerval *value, struct itimerval *ovalue) );
-FORWARD _PROTOTYPE( void get_realtimer, (struct mproc *mp,
- struct itimerval *value) );
-FORWARD _PROTOTYPE( void set_realtimer, (struct mproc *mp,
- struct itimerval *value) );
-FORWARD _PROTOTYPE( void cause_sigalrm, (struct timer *tp) );
+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
+ 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);
/*===========================================================================*
* ticks_from_timeval *
#define LAST_FEW 2 /* last few slots reserved for superuser */
-FORWARD _PROTOTYPE (void zombify, (struct mproc *rmp) );
-FORWARD _PROTOTYPE (void check_parent, (struct mproc *child,
- int try_cleanup) );
-FORWARD _PROTOTYPE (void tell_parent, (struct mproc *child) );
-FORWARD _PROTOTYPE (void tell_tracer, (struct mproc *child) );
-FORWARD _PROTOTYPE (void tracer_died, (struct mproc *child) );
-FORWARD _PROTOTYPE (void cleanup, (register struct mproc *rmp) );
+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);
/*===========================================================================*
* do_fork *
EXTERN int who_p, who_e; /* caller's proc number, endpoint */
EXTERN int call_nr; /* system call number */
-extern _PROTOTYPE (int (*call_vec[]), (void) ); /* system call handlers */
+extern int(*call_vec[]) (void);
EXTERN sigset_t core_sset; /* which signals cause core images */
EXTERN sigset_t ign_sset; /* which signals are by default ignored */
EXTERN sigset_t noign_sset; /* which signals cannot be ignored */
EXTERN unsigned long calls_stats[NCALLS];
#endif
-FORWARD _PROTOTYPE( void sendreply, (void) );
-FORWARD _PROTOTYPE( int get_nice_value, (int queue) );
-FORWARD _PROTOTYPE( void handle_vfs_reply, (void) );
+FORWARD void sendreply(void);
+FORWARD int get_nice_value(int queue);
+FORWARD void handle_vfs_reply(void);
#define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( int sef_cb_signal_manager, (endpoint_t target, int signo) );
+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);
/*===========================================================================*
* main *
#include "param.h"
#if SPROFILE || CPROFILE
-FORWARD _PROTOTYPE( int check_addrs, (int info_size) );
+FORWARD int check_addrs(int info_size);
#endif
/*===========================================================================*
#include <timers.h>
/* alarm.c */
-_PROTOTYPE( int do_alarm, (void) );
-_PROTOTYPE( int do_itimer, (void) );
-_PROTOTYPE( void set_alarm, (struct mproc *rmp, clock_t ticks) );
-_PROTOTYPE( void check_vtimer, (int proc_nr, int sig) );
+int do_alarm(void);
+int do_itimer(void);
+void set_alarm(struct mproc *rmp, clock_t ticks);
+void check_vtimer(int proc_nr, int sig);
/* break.c */
-_PROTOTYPE( int do_brk, (void) );
+int do_brk(void);
/* exec.c */
-_PROTOTYPE( int do_exec, (void) );
-_PROTOTYPE( int do_exec_newmem, (void) );
-_PROTOTYPE( int do_execrestart, (void) );
-_PROTOTYPE( void exec_restart, (struct mproc *rmp, int result,
- vir_bytes pc) );
+int do_exec(void);
+int do_exec_newmem(void);
+int do_execrestart(void);
+void exec_restart(struct mproc *rmp, int result, vir_bytes pc);
/* forkexit.c */
-_PROTOTYPE( int do_fork, (void) );
-_PROTOTYPE( int do_srv_fork, (void) );
-_PROTOTYPE( int do_exit, (void) );
-_PROTOTYPE( void exit_proc, (struct mproc *rmp, int exit_status,
- int dump_core) );
-_PROTOTYPE( void exit_restart, (struct mproc *rmp, int dump_core) );
-_PROTOTYPE( int do_waitpid, (void) );
-_PROTOTYPE( int wait_test, (struct mproc *rmp, struct mproc *child) );
+int do_fork(void);
+int do_srv_fork(void);
+int do_exit(void);
+void exit_proc(struct mproc *rmp, int exit_status, int dump_core);
+void exit_restart(struct mproc *rmp, int dump_core);
+int do_waitpid(void);
+int wait_test(struct mproc *rmp, struct mproc *child);
/* getset.c */
-_PROTOTYPE( int do_get, (void) );
-_PROTOTYPE( int do_set, (void) );
+int do_get(void);
+int do_set(void);
/* main.c */
-_PROTOTYPE( int main, (void) );
-_PROTOTYPE( void setreply, (int proc_nr, int result) );
+int main(void);
+void setreply(int proc_nr, int result);
/* mcontext.c */
-_PROTOTYPE( int do_getmcontext, (void) );
-_PROTOTYPE( int do_setmcontext, (void) );
+int do_getmcontext(void);
+int do_setmcontext(void);
#if ! USE_MCONTEXT
#define do_getmcontext no_sys
#define do_setmcontext no_sys
#endif
/* misc.c */
-_PROTOTYPE( int do_reboot, (void) );
-_PROTOTYPE( int do_sysuname, (void) );
-_PROTOTYPE( int do_getsysinfo, (void) );
-_PROTOTYPE( int do_getprocnr, (void) );
-_PROTOTYPE( int do_getepinfo, (void) );
-_PROTOTYPE( int do_getepinfo_o, (void) );
-_PROTOTYPE( int do_svrctl, (void) );
-_PROTOTYPE( int do_getsetpriority, (void) );
+int do_reboot(void);
+int do_sysuname(void);
+int do_getsysinfo(void);
+int do_getprocnr(void);
+int do_getepinfo(void);
+int do_getepinfo_o(void);
+int do_svrctl(void);
+int do_getsetpriority(void);
/* schedule.c */
-_PROTOTYPE( void sched_init, (void) );
-_PROTOTYPE( int sched_start_user, (endpoint_t ep, struct mproc *rmp) );
-_PROTOTYPE( int sched_nice, (struct mproc *rmp, int nice) );
+void sched_init(void);
+int sched_start_user(endpoint_t ep, struct mproc *rmp);
+int sched_nice(struct mproc *rmp, int nice);
/* profile.c */
-_PROTOTYPE( int do_sprofile, (void) );
-_PROTOTYPE( int do_cprofile, (void) );
+int do_sprofile(void);
+int do_cprofile(void);
/* signal.c */
-_PROTOTYPE( int do_kill, (void) );
-_PROTOTYPE( int do_srv_kill, (void) );
-_PROTOTYPE( int process_ksig, (endpoint_t proc_nr_e, int signo) );
-_PROTOTYPE( int do_pause, (void) );
-_PROTOTYPE( int check_sig, (pid_t proc_id, int signo, int ksig) );
-_PROTOTYPE( void sig_proc, (struct mproc *rmp, int signo, int trace,
- int ksig) );
-_PROTOTYPE( int do_sigaction, (void) );
-_PROTOTYPE( int do_sigpending, (void) );
-_PROTOTYPE( int do_sigprocmask, (void) );
-_PROTOTYPE( int do_sigreturn, (void) );
-_PROTOTYPE( int do_sigsuspend, (void) );
-_PROTOTYPE( void check_pending, (struct mproc *rmp) );
-_PROTOTYPE( void restart_sigs, (struct mproc *rmp) );
-_PROTOTYPE( void vm_notify_sig_wrapper, (endpoint_t ep) );
+int do_kill(void);
+int do_srv_kill(void);
+int process_ksig(endpoint_t proc_nr_e, int signo);
+int do_pause(void);
+int check_sig(pid_t proc_id, int signo, int ksig);
+void sig_proc(struct mproc *rmp, int signo, int trace, int ksig);
+int do_sigaction(void);
+int do_sigpending(void);
+int do_sigprocmask(void);
+int do_sigreturn(void);
+int do_sigsuspend(void);
+void check_pending(struct mproc *rmp);
+void restart_sigs(struct mproc *rmp);
+void vm_notify_sig_wrapper(endpoint_t ep);
/* time.c */
-_PROTOTYPE( int do_stime, (void) );
-_PROTOTYPE( int do_time, (void) );
-_PROTOTYPE( int do_times, (void) );
+int do_stime(void);
+int do_time(void);
+int do_times(void);
/* trace.c */
-_PROTOTYPE( int do_trace, (void) );
-_PROTOTYPE( void stop_proc, (struct mproc *rmp, int sig_nr) );
+int do_trace(void);
+void stop_proc(struct mproc *rmp, int sig_nr);
#if ! USE_TRACE
#define do_trace no_sys
#define stop_proc no_sys
#endif
/* utility.c */
-_PROTOTYPE( pid_t get_free_pid, (void) );
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( char *find_param, (const char *key) );
-_PROTOTYPE( struct mproc *find_proc, (pid_t lpid) );
-_PROTOTYPE( int nice_to_priority, (int nice, unsigned *new_q) );
-_PROTOTYPE( int pm_isokendpt, (int ep, int *proc) );
-_PROTOTYPE( void tell_vfs, (struct mproc *rmp, message *m_ptr) );
+pid_t get_free_pid(void);
+int no_sys(void);
+char *find_param(const char *key);
+struct mproc *find_proc(pid_t lpid);
+int nice_to_priority(int nice, unsigned *new_q);
+int pm_isokendpt(int ep, int *proc);
+void tell_vfs(struct mproc *rmp, message *m_ptr);
#include "mproc.h"
#include "param.h"
-FORWARD _PROTOTYPE( void unpause, (struct mproc *rmp) );
-FORWARD _PROTOTYPE( int sig_send, (struct mproc *rmp, int signo) );
-FORWARD _PROTOTYPE( void sig_proc_exit, (struct mproc *rmp, int signo) );
+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);
/*===========================================================================*
* do_sigaction *
#include "mproc.h"
#include "param.h"
-_PROTOTYPE (int (*call_vec[]), (void) ) = {
+int (*call_vec[])(void) = {
no_sys, /* 0 = unused */
do_exit, /* 1 = exit */
do_fork, /* 2 = fork */
#include "inc.h"
#include "cpuinfo.h"
-FORWARD _PROTOTYPE( void init_hook, (void) );
+FORWARD void init_hook(void);
/* The hook functions that will be called by VTreeFS. */
PRIVATE struct fs_hooks hooks = {
PRIVATE char s_frame[S_FRAME_SIZE]; /* static storage for process frame */
PRIVATE char *frame; /* pointer to process frame buffer */
-FORWARD _PROTOTYPE( void pid_psinfo, (int slot) );
-FORWARD _PROTOTYPE( void pid_cmdline, (int slot) );
-FORWARD _PROTOTYPE( void pid_environ, (int slot) );
-FORWARD _PROTOTYPE( void pid_map, (int slot) );
+FORWARD void pid_psinfo(int slot);
+FORWARD void pid_cmdline(int slot);
+FORWARD void pid_environ(int slot);
+FORWARD 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.
#define _PROCFS_PROTO_H
/* buf.c */
-_PROTOTYPE( void buf_init, (off_t start, size_t len) );
-_PROTOTYPE( void buf_printf, (char *fmt, ...) );
-_PROTOTYPE( void buf_append, (char *data, size_t len) );
-_PROTOTYPE( size_t buf_get, (char **ptr) );
+void buf_init(off_t start, size_t len);
+void buf_printf(char *fmt, ...);
+void buf_append(char *data, size_t len);
+size_t buf_get(char **ptr);
/* tree.c */
-_PROTOTYPE( int init_tree, (void) );
-_PROTOTYPE( int lookup_hook, (struct inode *parent, char *name,
- cbdata_t cbdata) );
-_PROTOTYPE( int getdents_hook, (struct inode *inode, cbdata_t cbdata) );
-_PROTOTYPE( int read_hook, (struct inode *inode, off_t offset,
- char **ptr, size_t *len, cbdata_t cbdata) );
-_PROTOTYPE( int rdlink_hook, (struct inode *inode, char *ptr,
- size_t max, cbdata_t cbdata) );
+int init_tree(void);
+int lookup_hook(struct inode *parent, char *name, cbdata_t cbdata);
+int getdents_hook(struct inode *inode, cbdata_t cbdata);
+int read_hook(struct inode *inode, off_t offset, char **ptr, size_t
+ *len, cbdata_t cbdata);
+int rdlink_hook(struct inode *inode, char *ptr, size_t max, cbdata_t
+ cbdata);
/* util.c */
-_PROTOTYPE( int procfs_getloadavg, (struct load *loadavg, int nelem) );
+int procfs_getloadavg(struct load *loadavg, int nelem);
#endif /* _PROCFS_PROTO_H */
#include <minix/dmap.h>
#include "cpuinfo.h"
-FORWARD _PROTOTYPE( void root_hz, (void) );
-FORWARD _PROTOTYPE( void root_uptime, (void) );
-FORWARD _PROTOTYPE( void root_loadavg, (void) );
-FORWARD _PROTOTYPE( void root_kinfo, (void) );
-FORWARD _PROTOTYPE( void root_meminfo, (void) );
-FORWARD _PROTOTYPE( void root_pci, (void) );
-FORWARD _PROTOTYPE( void root_dmap, (void) );
+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);
struct file root_files[] = {
{ "hz", REG_ALL_MODE, (data_t) root_hz },
index = get_inode_index(node);
/* Call the handler procedure for the file. */
- ((_PROTOTYPE(void (*), (int))) pid_files[index].data)(slot);
+((void (*) (int)) pid_files[index].data)(slot);
}
/*===========================================================================*
if (get_inode_index(node) != NO_INDEX) {
pid_read(node);
} else {
- ((_PROTOTYPE(void (*), (void))) cbdata)();
+ ((void (*) (void)) cbdata)();
}
*len = buf_get(ptr);
#include "type.h"
#include "glo.h"
-EXTERN _PROTOTYPE( int do_sef_lu_request, (message *m_ptr) );
+EXTERN int do_sef_lu_request(message *m_ptr);
#include "kernel/proc.h"
/* Declare some local functions. */
-FORWARD _PROTOTYPE(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 _PROTOTYPE(void catch_boot_init_ready, (endpoint_t endpoint) );
-FORWARD _PROTOTYPE(void get_work, (message *m_ptr, int *status_ptr) );
+FORWARD 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);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
-FORWARD _PROTOTYPE( int sef_cb_signal_manager, (endpoint_t target, int signo) );
+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);
/*===========================================================================*
struct rproc;
/* exec.c */
-_PROTOTYPE( int srv_execve, (int proc_e,
- char *exec, size_t exec_len, char *argv[], char **env));
+int srv_execve(int proc_e, char *exec, size_t exec_len, char *argv[],
+ char **env);
/* main.c */
-_PROTOTYPE( int main, (void));
+int main(void);
/* request.c */
-_PROTOTYPE( int do_up, (message *m));
-_PROTOTYPE( int do_down, (message *m));
-_PROTOTYPE( int do_refresh, (message *m));
-_PROTOTYPE( int do_restart, (message *m));
-_PROTOTYPE( int do_clone, (message *m));
-_PROTOTYPE( int do_edit, (message *m));
-_PROTOTYPE( int do_shutdown, (message *m));
-_PROTOTYPE( void do_period, (message *m));
-_PROTOTYPE( int do_init_ready, (message *m));
-_PROTOTYPE( int do_update, (message *m));
-_PROTOTYPE( int do_upd_ready, (message *m));
-_PROTOTYPE( void do_sigchld, (void));
-_PROTOTYPE( int do_getsysinfo, (message *m));
-_PROTOTYPE( int do_lookup, (message *m));
+int do_up(message *m);
+int do_down(message *m);
+int do_refresh(message *m);
+int do_restart(message *m);
+int do_clone(message *m);
+int do_edit(message *m);
+int do_shutdown(message *m);
+void do_period(message *m);
+int do_init_ready(message *m);
+int do_update(message *m);
+int do_upd_ready(message *m);
+void do_sigchld(void);
+int do_getsysinfo(message *m);
+int do_lookup(message *m);
/* manager.c */
-_PROTOTYPE( int check_call_permission, (endpoint_t caller, int call,
- struct rproc *rp) );
-_PROTOTYPE( int copy_rs_start, (endpoint_t src_e, char *src_rs_start,
- struct rs_start *rs_start) );
-_PROTOTYPE( int copy_label, (endpoint_t src_e, char *src_label, size_t src_len,
- char *dst_label, size_t dst_len) );
-_PROTOTYPE( void build_cmd_dep, (struct rproc *rp) );
-_PROTOTYPE( int srv_fork, (uid_t reuid, gid_t regid) );
-_PROTOTYPE( int srv_kill, (pid_t pid, int sig) );
-_PROTOTYPE( int srv_update, (endpoint_t src_e, endpoint_t dst_e) );
+int check_call_permission(endpoint_t caller, int call, struct rproc
+ *rp);
+int copy_rs_start(endpoint_t src_e, char *src_rs_start, struct rs_start
+ *rs_start);
+int copy_label(endpoint_t src_e, char *src_label, size_t src_len, char
+ *dst_label, size_t dst_len);
+void build_cmd_dep(struct rproc *rp);
+int srv_fork(uid_t reuid, gid_t regid);
+int srv_kill(pid_t pid, int sig);
+int srv_update(endpoint_t src_e, endpoint_t dst_e);
#define kill_service(rp, errstr, err) \
kill_service_debug(__FILE__, __LINE__, rp, errstr, err)
-_PROTOTYPE( int kill_service_debug, (char *file, int line, struct rproc *rp,
- char *errstr, int err) );
+int kill_service_debug(char *file, int line, struct rproc *rp, char
+ *errstr, int err);
#define crash_service(rp) \
crash_service_debug(__FILE__, __LINE__, rp)
-_PROTOTYPE( int crash_service_debug, (char *file, int line, struct rproc *rp) );
+int crash_service_debug(char *file, int line, struct rproc *rp);
#define cleanup_service(rp) \
cleanup_service_debug(__FILE__, __LINE__, rp)
-_PROTOTYPE( void cleanup_service_debug, (char *file, int line,
- struct rproc *rp) );
-_PROTOTYPE( int create_service, (struct rproc *rp) );
-_PROTOTYPE( int clone_service, (struct rproc *rp, int instance_flag) );
-_PROTOTYPE( int publish_service, (struct rproc *rp) );
-_PROTOTYPE( int unpublish_service, (struct rproc *rp) );
-_PROTOTYPE( int run_service, (struct rproc *rp, int init_type) );
-_PROTOTYPE( int start_service, (struct rproc *rp) );
-_PROTOTYPE( void stop_service, (struct rproc *rp,int how) );
-_PROTOTYPE( int update_service, (struct rproc **src_rpp,
- struct rproc **dst_rpp, int swap_flag) );
-_PROTOTYPE( void activate_service, (struct rproc *rp, struct rproc *ex_rp) );
-_PROTOTYPE( void terminate_service, (struct rproc *rp));
-_PROTOTYPE( void restart_service, (struct rproc *rp) );
-_PROTOTYPE( void inherit_service_defaults, (struct rproc *def_rp,
- struct rproc *rp) );
-_PROTOTYPE( void get_service_instances, (struct rproc *rp, struct rproc ***rps,
- int *length) );
-_PROTOTYPE( int read_exec, (struct rproc *rp) );
-_PROTOTYPE( void share_exec, (struct rproc *rp_src, struct rproc *rp_dst) );
-_PROTOTYPE( void free_exec, (struct rproc *rp) );
-_PROTOTYPE( int init_slot, (struct rproc *rp, struct rs_start *rs_start,
- endpoint_t source) );
-_PROTOTYPE( int edit_slot, (struct rproc *rp, struct rs_start *rs_start,
- endpoint_t source) );
-_PROTOTYPE( int clone_slot, (struct rproc *rp, struct rproc **clone_rpp) );
-_PROTOTYPE( void swap_slot, (struct rproc **src_rpp, struct rproc **dst_rpp) );
-_PROTOTYPE( struct rproc* lookup_slot_by_label, (char *label) );
-_PROTOTYPE( struct rproc* lookup_slot_by_pid, (pid_t pid) );
-_PROTOTYPE( struct rproc* lookup_slot_by_dev_nr, (dev_t dev_nr) );
-_PROTOTYPE( struct rproc* lookup_slot_by_flags, (int flags) );
-_PROTOTYPE( int alloc_slot, (struct rproc **rpp) );
-_PROTOTYPE( void free_slot, (struct rproc *rp) );
-_PROTOTYPE( char *get_next_label, (char *ptr, char *label, char *caller_label));
-_PROTOTYPE( void add_forward_ipc, (struct rproc *rp, struct priv *privp) );
-_PROTOTYPE( void add_backward_ipc, (struct rproc *rp, struct priv *privp) );
-_PROTOTYPE( void init_privs, (struct rproc *rp, struct priv *privp) );
-_PROTOTYPE( void update_period, (message *m_ptr) );
-_PROTOTYPE( void end_update, (int result, int reply_flag) );
+void cleanup_service_debug(char *file, int line, struct rproc *rp);
+int create_service(struct rproc *rp);
+int clone_service(struct rproc *rp, int instance_flag);
+int publish_service(struct rproc *rp);
+int unpublish_service(struct rproc *rp);
+int run_service(struct rproc *rp, int init_type);
+int start_service(struct rproc *rp);
+void stop_service(struct rproc *rp,int how);
+int update_service(struct rproc **src_rpp, struct rproc **dst_rpp, int
+ swap_flag);
+void activate_service(struct rproc *rp, struct rproc *ex_rp);
+void terminate_service(struct rproc *rp);
+void restart_service(struct rproc *rp);
+void inherit_service_defaults(struct rproc *def_rp, struct rproc *rp);
+void get_service_instances(struct rproc *rp, struct rproc ***rps, int
+ *length);
+int read_exec(struct rproc *rp);
+void share_exec(struct rproc *rp_src, struct rproc *rp_dst);
+void free_exec(struct rproc *rp);
+int init_slot(struct rproc *rp, struct rs_start *rs_start, endpoint_t
+ source);
+int edit_slot(struct rproc *rp, struct rs_start *rs_start, endpoint_t
+ source);
+int clone_slot(struct rproc *rp, struct rproc **clone_rpp);
+void swap_slot(struct rproc **src_rpp, struct rproc **dst_rpp);
+struct rproc* lookup_slot_by_label(char *label);
+struct rproc* lookup_slot_by_pid(pid_t pid);
+struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr);
+struct rproc* lookup_slot_by_flags(int flags);
+int alloc_slot(struct rproc **rpp);
+void free_slot(struct rproc *rp);
+char *get_next_label(char *ptr, char *label, char *caller_label);
+void add_forward_ipc(struct rproc *rp, struct priv *privp);
+void add_backward_ipc(struct rproc *rp, struct priv *privp);
+void init_privs(struct rproc *rp, struct priv *privp);
+void update_period(message *m_ptr);
+void end_update(int result, int reply_flag);
/* utility.c */
-_PROTOTYPE( int init_service, (struct rproc *rp, int type));
-_PROTOTYPE( void fill_send_mask, (sys_map_t *send_mask, int set_bits));
-_PROTOTYPE(void fill_call_mask, ( int *calls, int tot_nr_calls,
- bitchunk_t *call_mask, int call_base, int is_init));
-_PROTOTYPE( char* srv_to_string, (struct rproc *rp));
-_PROTOTYPE( void reply, (endpoint_t who, struct rproc *rp, message *m_ptr));
-_PROTOTYPE( void late_reply, (struct rproc *rp, int code));
-_PROTOTYPE( int rs_isokendpt, (endpoint_t endpoint, int *proc));
-_PROTOTYPE( int sched_init_proc, (struct rproc *rp));
-_PROTOTYPE( int update_sig_mgrs, (struct rproc *rp, endpoint_t sig_mgr,
- endpoint_t bak_sig_mgr));
+int init_service(struct rproc *rp, int type);
+void fill_send_mask(sys_map_t *send_mask, int set_bits);
+void fill_call_mask( int *calls, int tot_nr_calls, bitchunk_t
+ *call_mask, int call_base, int is_init);
+char* srv_to_string(struct rproc *rp);
+void reply(endpoint_t who, struct rproc *rp, message *m_ptr);
+void late_reply(struct rproc *rp, int code);
+int rs_isokendpt(endpoint_t endpoint, int *proc);
+int sched_init_proc(struct rproc *rp);
+int update_sig_mgrs(struct rproc *rp, endpoint_t sig_mgr, endpoint_t
+ bak_sig_mgr);
/* error.c */
-_PROTOTYPE( char * init_strerror, (int errnum) );
-_PROTOTYPE( char * lu_strerror, (int errnum) );
+char * init_strerror(int errnum);
+char * lu_strerror(int errnum);
#include "schedproc.h"
/* Declare some local functions. */
-FORWARD _PROTOTYPE( void reply, (endpoint_t whom, message *m_ptr) );
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void reply(endpoint_t whom, message *m_ptr);
+FORWARD void sef_local_startup(void);
PUBLIC struct machine machine; /* machine info */
#include <timers.h>
/* main.c */
-_PROTOTYPE( int main, (void) );
-_PROTOTYPE( void setreply, (int proc_nr, int result) );
+int main(void);
+void setreply(int proc_nr, int result);
/* schedule.c */
-_PROTOTYPE( int do_noquantum, (message *m_ptr) );
-_PROTOTYPE( int do_start_scheduling, (message *m_ptr) );
-_PROTOTYPE( int do_stop_scheduling, (message *m_ptr) );
-_PROTOTYPE( int do_nice, (message *m_ptr) );
-/*_PROTOTYPE( void balance_queues, (struct timer *tp) );*/
-_PROTOTYPE( void init_scheduling, (void) );
+int do_noquantum(message *m_ptr);
+int do_start_scheduling(message *m_ptr);
+int do_stop_scheduling(message *m_ptr);
+int do_nice(message *m_ptr);
+void init_scheduling(void);
/* utility.c */
-_PROTOTYPE( int no_sys, (int who_e, int call_nr) );
-_PROTOTYPE( int sched_isokendpt, (int ep, int *proc) );
-_PROTOTYPE( int sched_isemtyendpt, (int ep, int *proc) );
-_PROTOTYPE( int accept_message, (message *m_ptr) );
+int no_sys(int who_e, int call_nr);
+int sched_isokendpt(int ep, int *proc);
+int sched_isemtyendpt(int ep, int *proc);
+int accept_message(message *m_ptr);
#define BALANCE_TIMEOUT 5 /* how often to balance queues in seconds */
-FORWARD _PROTOTYPE( int schedule_process, (struct schedproc * rmp,
- unsigned flags));
-FORWARD _PROTOTYPE( void balance_queues, (struct timer *tp) );
+FORWARD int schedule_process(struct schedproc * rmp, unsigned flags);
+FORWARD void balance_queues(struct timer *tp);
#define SCHEDULE_CHANGE_PRIO 0x1
#define SCHEDULE_CHANGE_QUANTUM 0x2
#include <minix/vfsif.h>
#include <assert.h>
-FORWARD _PROTOTYPE( int sendmsg, (struct vmnt *vmp, struct fproc *rfp) );
-FORWARD _PROTOTYPE( int queuemsg, (struct vmnt *vmp) );
+FORWARD int sendmsg(struct vmnt *vmp, struct fproc *rfp);
+FORWARD int queuemsg(struct vmnt *vmp);
/*===========================================================================*
* sendmsg *
/* Include ELF headers */
#include <sys/elf_core.h>
-FORWARD _PROTOTYPE( void fill_elf_header, (Elf32_Ehdr *elf_header, int phnum));
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int get_memory_regions, (Elf32_Phdr phdrs[]) );
-FORWARD _PROTOTYPE( void fill_note_segment_and_entries_hdrs,
- (Elf32_Phdr phdrs[], Elf32_Nhdr nhdrs[]));
-FORWARD _PROTOTYPE( void adjust_offsets, (Elf32_Phdr phdrs[], int phnum));
-FORWARD _PROTOTYPE( void dump_elf_header, (struct filp *f,
- Elf32_Ehdr elf_header) );
-FORWARD _PROTOTYPE( void dump_notes, (struct filp *f, Elf32_Nhdr nhdrs[],
- int csig, char *proc_name) );
-FORWARD _PROTOTYPE( void dump_program_headers, (struct filp *f,
- Elf_Phdr phdrs[], int phnum));
-FORWARD _PROTOTYPE( void dump_segments, (struct filp *f, Elf32_Phdr phdrs[],
- int phnum) );
-FORWARD _PROTOTYPE( void write_buf, (struct filp *f, char *buf, size_t size));
+FORWARD void fill_elf_header(Elf32_Ehdr *elf_header, int phnum);
+FORWARD 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[],
+ 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,
+ char *proc_name);
+FORWARD void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int
+ phnum);
+FORWARD void dump_segments(struct filp *f, Elf32_Phdr phdrs[], int
+ phnum);
+FORWARD void write_buf(struct filp *f, char *buf, size_t size);
/*===========================================================================*
* write_elf_core_file *
#include "vmnt.h"
#include "param.h"
-FORWARD _PROTOTYPE( void restart_reopen, (int major) );
-FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, cp_grant_id_t *,
- int *,
- endpoint_t *, void **,
- size_t, u32_t *) );
+FORWARD void restart_reopen(int major);
+FORWARD int safe_io_conversion(endpoint_t, cp_grant_id_t *, int *,
+ endpoint_t *, void **, size_t, u32_t *);
PRIVATE int dummyproc;
*/
extern struct dmap {
- int _PROTOTYPE ((*dmap_opcl), (int, dev_t, int, int) );
- int _PROTOTYPE ((*dmap_io), (int, message *) );
+ int(*dmap_opcl) (int, dev_t, int, int);
+ int(*dmap_io) (int, message *);
endpoint_t dmap_driver;
char dmap_label[LABEL_MAX];
int dmap_flags;
#include <libexec.h>
#include "exec.h"
-FORWARD _PROTOTYPE( void lock_exec, (void) );
-FORWARD _PROTOTYPE( void unlock_exec, (void) );
-FORWARD _PROTOTYPE( 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 _PROTOTYPE( int is_script, (const char *exec_hdr, size_t exec_len));
-FORWARD _PROTOTYPE( int patch_stack, (struct vnode *vp, char stack[ARG_MAX],
- vir_bytes *stk_bytes, char path[PATH_MAX]) );
-FORWARD _PROTOTYPE( int insert_arg, (char stack[ARG_MAX], vir_bytes *stk_bytes,
- char *arg, int replace) );
-FORWARD _PROTOTYPE( void patch_ptr, (char stack[ARG_MAX], vir_bytes base));
-FORWARD _PROTOTYPE( void clo_exec, (struct fproc *rfp) );
-FORWARD _PROTOTYPE( int read_seg, (struct vnode *vp, off_t off, int proc_e,
- int seg, vir_bytes seg_addr,
- phys_bytes seg_bytes) );
-FORWARD _PROTOTYPE( int load_aout, (struct exec_info *execi) );
-FORWARD _PROTOTYPE( int load_elf, (struct exec_info *execi) );
-FORWARD _PROTOTYPE( int map_header, (char **exec_hdr,
- const struct vnode *vp) );
+FORWARD void lock_exec(void);
+FORWARD void unlock_exec(void);
+FORWARD 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
+ *stk_bytes, char path[PATH_MAX]);
+FORWARD 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,
+ 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);
#define PTRSIZE sizeof(char *) /* Size of pointers in argv[] and envp[]. */
#include "vnode.h"
-FORWARD _PROTOTYPE( filp_id_t verify_fd, (endpoint_t ep, int fd) );
+FORWARD filp_id_t verify_fd(endpoint_t ep, int fd);
#if LOCK_DEBUG
/*===========================================================================*
PRIVATE int depth = 0; /* current globals stack level */
-FORWARD _PROTOTYPE( int push_globals, (void) );
-FORWARD _PROTOTYPE( void pop_globals, (void) );
-FORWARD _PROTOTYPE( void set_globals, (message *m) );
+FORWARD int push_globals(void);
+FORWARD void pop_globals(void);
+FORWARD void set_globals(message *m);
/*===========================================================================*
* push_globals *
#include "file.h"
#include "fproc.h"
-_PROTOTYPE( int gcov_flush, (cp_grant_id_t grantid, size_t size ));
+int gcov_flush(cp_grant_id_t grantid, size_t size );
/*===========================================================================*
* do_gcov_flush *
EXTERN int err_code; /* temporary storage for error number */
/* Data initialized elsewhere. */
-extern _PROTOTYPE (int (*call_vec[]), (void) ); /* sys call table */
-extern _PROTOTYPE (int (*pfs_call_vec[]), (void) ); /* pfs callback table */
+extern int(*call_vec[]) (void);
+extern int(*pfs_call_vec[]) (void);
extern char mode_map[]; /* mapping from O_ACCMODE mask to R_BIT/W_BIT flags */
#endif
#endif
/* Thread related prototypes */
-FORWARD _PROTOTYPE( void thread_cleanup_f, (struct fproc *rfp, char *f,
- int l) );
+FORWARD void thread_cleanup_f(struct fproc *rfp, char *f, int l);
#define thread_cleanup(x) thread_cleanup_f(x, __FILE__, __LINE__)
-FORWARD _PROTOTYPE( void *do_async_dev_result, (void *arg) );
-FORWARD _PROTOTYPE( void *do_control_msgs, (void *arg) );
-FORWARD _PROTOTYPE( void *do_fs_reply, (struct job *job) );
-FORWARD _PROTOTYPE( void *do_work, (void *arg) );
-FORWARD _PROTOTYPE( void *do_pm, (void *arg) );
-FORWARD _PROTOTYPE( void *do_init_root, (void *arg) );
-FORWARD _PROTOTYPE( void handle_work, (void *(*func)(void *arg)) );
-
-FORWARD _PROTOTYPE( void get_work, (void) );
-FORWARD _PROTOTYPE( void lock_pm, (void) );
-FORWARD _PROTOTYPE( void unlock_pm, (void) );
-FORWARD _PROTOTYPE( void service_pm, (void) );
-FORWARD _PROTOTYPE( void service_pm_postponed, (void) );
-FORWARD _PROTOTYPE( int unblock, (struct fproc *rfp) );
+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);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
+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;
PUBLIC unsigned long calls_stats[NCALLS];
#endif
-FORWARD _PROTOTYPE( void free_proc, (struct fproc *freed, int flags) );
+FORWARD void free_proc(struct fproc *freed, int flags);
/*
-FORWARD _PROTOTYPE( int dumpcore, (int proc_e, struct mem_map *seg_ptr) );
-FORWARD _PROTOTYPE( int write_bytes, (struct inode *rip, off_t off,
- char *buf, size_t bytes) );
-FORWARD _PROTOTYPE( int write_seg, (struct inode *rip, off_t off, int proc_e,
- int seg, off_t seg_off, phys_bytes seg_bytes) );
+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
+ bytes);
+FORWARD int write_seg(struct inode *rip, off_t off, int proc_e, int seg,
+ off_t seg_off, phys_bytes seg_bytes);
*/
/*===========================================================================*
#define alloc_nonedev(dev) SET_BIT(nonedev, minor(dev) - 1)
#define free_nonedev(dev) UNSET_BIT(nonedev, minor(dev) - 1)
-FORWARD _PROTOTYPE( dev_t name_to_dev, (int allow_mountpt,
- char path[PATH_MAX]) );
-FORWARD _PROTOTYPE( dev_t find_free_nonedev, (void) );
-FORWARD _PROTOTYPE( void update_bspec, (dev_t dev, endpoint_t fs_e,
- int send_drv_e) );
+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);
/*===========================================================================*
* update_bspec *
PUBLIC char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
-FORWARD _PROTOTYPE( struct vnode *new_node, (struct lookup *resolve,
- int oflags, mode_t bits) );
-FORWARD _PROTOTYPE( int pipe_open, (struct vnode *vp, mode_t bits,
- int oflags) );
+FORWARD struct vnode *new_node(struct lookup *resolve, int oflags,
+ mode_t bits);
+FORWARD int pipe_open(struct vnode *vp, mode_t bits, int oflags);
/*===========================================================================*
*/
#define DO_POSIX_PATHNAME_RES 0
-FORWARD _PROTOTYPE( int lookup, (struct vnode *dirp, struct lookup *resolve,
- node_details_t *node, struct fproc *rfp));
-FORWARD _PROTOTYPE( int check_perms, (endpoint_t ep, cp_grant_id_t io_gr,
- size_t pathlen) );
+FORWARD 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
+ pathlen);
/*===========================================================================*
* advance *
typedef struct filp * filp_id_t;
/* comm.c */
-_PROTOTYPE(void fs_cancel, (struct vmnt *vmp) );
-_PROTOTYPE(int fs_sendrec, (endpoint_t fs_e, message *reqm) );
-_PROTOTYPE(void fs_sendmore, (struct vmnt *vmp) );
-_PROTOTYPE(void send_work, (void) );
+void fs_cancel(struct vmnt *vmp);
+int fs_sendrec(endpoint_t fs_e, message *reqm);
+void fs_sendmore(struct vmnt *vmp);
+void send_work(void);
/* device.c */
-_PROTOTYPE( int dev_open, (dev_t dev, endpoint_t proc_e, int flags) );
-_PROTOTYPE( int dev_reopen, (dev_t dev, int filp_no, int flags) );
-_PROTOTYPE( int dev_close, (dev_t dev, int filp_no) );
-_PROTOTYPE( int bdev_open, (dev_t dev, int access) );
-_PROTOTYPE( int bdev_close, (dev_t dev) );
-_PROTOTYPE( int dev_io, (int op, dev_t dev, endpoint_t proc_e, void *buf,
- u64_t pos, size_t bytes, int flags, int suspend_reopen) );
-_PROTOTYPE( int gen_opcl, (int op, dev_t dev, endpoint_t task_nr, int flags));
-_PROTOTYPE( int gen_io, (endpoint_t driver_e, message *mess_ptr) );
-_PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) );
-_PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) );
-_PROTOTYPE( int no_dev_io, (int, message *) );
-_PROTOTYPE( int tty_opcl, (int op, dev_t dev, endpoint_t proc, int flags));
-_PROTOTYPE( int ctty_opcl, (int op, dev_t dev, endpoint_t proc, int flags));
-_PROTOTYPE( int clone_opcl, (int op, dev_t dev, int proc, int flags) );
-_PROTOTYPE( int ctty_io, (int task_nr, message *mess_ptr) );
-_PROTOTYPE( int do_ioctl, (void) );
-_PROTOTYPE( void pm_setsid, (int proc_e) );
-_PROTOTYPE( void dev_status, (message *) );
-_PROTOTYPE( void bdev_up, (int major) );
-_PROTOTYPE( void cdev_up, (int major) );
-_PROTOTYPE( endpoint_t find_suspended_ep, (endpoint_t driver,
- cp_grant_id_t g) );
-_PROTOTYPE( void reopen_reply, (void) );
-_PROTOTYPE( void open_reply, (void) );
+int dev_open(dev_t dev, endpoint_t proc_e, int flags);
+int dev_reopen(dev_t dev, int filp_no, int flags);
+int dev_close(dev_t dev, int filp_no);
+int bdev_open(dev_t dev, int access);
+int bdev_close(dev_t dev);
+int dev_io(int op, dev_t dev, endpoint_t proc_e, void *buf, u64_t pos,
+ size_t bytes, int flags, int suspend_reopen);
+int gen_opcl(int op, dev_t dev, endpoint_t task_nr, int flags);
+int gen_io(endpoint_t driver_e, message *mess_ptr);
+int asyn_io(int task_nr, message *mess_ptr);
+int no_dev(int op, dev_t dev, int proc, int flags);
+int no_dev_io(int, message *);
+int tty_opcl(int op, dev_t dev, endpoint_t proc, int flags);
+int ctty_opcl(int op, dev_t dev, endpoint_t proc, int flags);
+int clone_opcl(int op, dev_t dev, int proc, int flags);
+int ctty_io(int task_nr, message *mess_ptr);
+int do_ioctl(void);
+void pm_setsid(int proc_e);
+void dev_status(message *);
+void bdev_up(int major);
+void cdev_up(int major);
+endpoint_t find_suspended_ep(endpoint_t driver, cp_grant_id_t g);
+void reopen_reply(void);
+void open_reply(void);
/* dmap.c */
-_PROTOTYPE( int do_mapdriver, (void) );
-_PROTOTYPE( void init_dmap, (void) );
-_PROTOTYPE( int dmap_driver_match, (endpoint_t proc, int major) );
-_PROTOTYPE( void dmap_endpt_up, (int proc_nr, int is_blk) );
-_PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) );
-_PROTOTYPE( struct dmap *get_dmap, (endpoint_t proc_e) );
-_PROTOTYPE( int do_mapdriver, (void) );
-_PROTOTYPE( int map_service, (struct rprocpub *rpub) );
-_PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) );
-_PROTOTYPE( struct dmap *get_dmap, (endpoint_t proc_e) );
-_PROTOTYPE( int map_driver, (const char *label, int major, endpoint_t proc_nr,
- int dev_style, int flags) );
-_PROTOTYPE( int map_service, (struct rprocpub *rpub) );
+int do_mapdriver(void);
+void init_dmap(void);
+int dmap_driver_match(endpoint_t proc, int major);
+void dmap_endpt_up(int proc_nr, int is_blk);
+void dmap_unmap_by_endpt(int proc_nr);
+struct dmap *get_dmap(endpoint_t proc_e);
+int do_mapdriver(void);
+int map_service(struct rprocpub *rpub);
+void dmap_unmap_by_endpt(int proc_nr);
+struct dmap *get_dmap(endpoint_t proc_e);
+int map_driver(const char *label, int major, endpoint_t proc_nr, int
+ dev_style, int flags);
+int map_service(struct rprocpub *rpub);
/* elf_core_dump.c */
-_PROTOTYPE( void write_elf_core_file, (struct filp *f, int csig,
- char *exe_name) );
+void write_elf_core_file(struct filp *f, int csig, char *exe_name);
/* exec.c */
-_PROTOTYPE( int pm_exec, (int proc_e, char *path, vir_bytes path_len,
- char *frame, vir_bytes frame_len, vir_bytes *pc));
+int pm_exec(int proc_e, char *path, vir_bytes path_len, char *frame,
+ vir_bytes frame_len, vir_bytes *pc);
#define check_bsf_lock() do { \
assert(mutex_trylock(&bsf_lock) == 0); \
unlock_bsf(); \
} while(0)
/* filedes.c */
-_PROTOTYPE( void check_filp_locks, (void) );
-_PROTOTYPE( void check_filp_locks_by_me, (void) );
-_PROTOTYPE( void init_filps, (void) );
-_PROTOTYPE( struct filp *find_filp, (struct vnode *vp, mode_t bits) );
-_PROTOTYPE( int get_fd, (int start, mode_t bits, int *k,
- struct filp **fpt) );
-_PROTOTYPE( struct filp *get_filp, (int fild, tll_access_t locktype) );
-_PROTOTYPE( struct filp *get_filp2, (struct fproc *rfp, int fild,
- tll_access_t locktype) );
-_PROTOTYPE( void lock_filp, (struct filp *filp, tll_access_t locktype) );
-_PROTOTYPE( void unlock_filp, (struct filp *filp) );
-_PROTOTYPE( void unlock_filps, (struct filp *filp1, struct filp *filp2) );
-_PROTOTYPE( int invalidate_filp, (struct filp *) );
-_PROTOTYPE( void invalidate_filp_by_endpt, (endpoint_t proc_e) );
-_PROTOTYPE( int do_verify_fd, (void) );
-_PROTOTYPE( int set_filp, (filp_id_t sfilp) );
-_PROTOTYPE( int do_set_filp, (void) );
-_PROTOTYPE( int copy_filp, (endpoint_t to_ep, filp_id_t cfilp) );
-_PROTOTYPE( int do_copy_filp, (void) );
-_PROTOTYPE( int put_filp, (filp_id_t pfilp) );
-_PROTOTYPE( int do_put_filp, (void) );
-_PROTOTYPE( int cancel_fd, (endpoint_t ep, int fd) );
-_PROTOTYPE( int do_cancel_fd, (void) );
-_PROTOTYPE( void close_filp, (struct filp *fp) );
+void check_filp_locks(void);
+void check_filp_locks_by_me(void);
+void init_filps(void);
+struct filp *find_filp(struct vnode *vp, mode_t bits);
+int get_fd(int start, mode_t bits, int *k, struct filp **fpt);
+struct filp *get_filp(int fild, tll_access_t locktype);
+struct filp *get_filp2(struct fproc *rfp, int fild, tll_access_t
+ locktype);
+void lock_filp(struct filp *filp, tll_access_t locktype);
+void unlock_filp(struct filp *filp);
+void unlock_filps(struct filp *filp1, struct filp *filp2);
+int invalidate_filp(struct filp *);
+void invalidate_filp_by_endpt(endpoint_t proc_e);
+int do_verify_fd(void);
+int set_filp(filp_id_t sfilp);
+int do_set_filp(void);
+int copy_filp(endpoint_t to_ep, filp_id_t cfilp);
+int do_copy_filp(void);
+int put_filp(filp_id_t pfilp);
+int do_put_filp(void);
+int cancel_fd(endpoint_t ep, int fd);
+int do_cancel_fd(void);
+void close_filp(struct filp *fp);
/* fscall.c */
-_PROTOTYPE( void nested_fs_call, (message *m) );
+void nested_fs_call(message *m);
/* link.c */
-_PROTOTYPE( int do_link, (void) );
-_PROTOTYPE( int do_unlink, (void) );
-_PROTOTYPE( int do_rename, (void) );
-_PROTOTYPE( int do_truncate, (void) );
-_PROTOTYPE( int do_ftruncate, (void) );
-_PROTOTYPE( int truncate_vnode, (struct vnode *vp, off_t newsize) );
-_PROTOTYPE( int rdlink_direct, (char *orig_path, char *link_path,
- struct fproc *rfp) );
+int do_link(void);
+int do_unlink(void);
+int do_rename(void);
+int do_truncate(void);
+int do_ftruncate(void);
+int truncate_vnode(struct vnode *vp, off_t newsize);
+int rdlink_direct(char *orig_path, char *link_path, struct fproc *rfp);
/* lock.c */
-_PROTOTYPE( int lock_op, (struct filp *f, int req) );
-_PROTOTYPE( void lock_revive, (void) );
+int lock_op(struct filp *f, int req);
+void lock_revive(void);
/* main.c */
-_PROTOTYPE( int main, (void) );
-_PROTOTYPE( void reply, (int whom, int result) );
-_PROTOTYPE( void lock_proc, (struct fproc *rfp, int force_lock) );
-_PROTOTYPE( void unlock_proc, (struct fproc *rfp) );
-_PROTOTYPE( void *do_dummy, (void *arg) );
+int main(void);
+void reply(int whom, int result);
+void lock_proc(struct fproc *rfp, int force_lock);
+void unlock_proc(struct fproc *rfp);
+void *do_dummy(void *arg);
/* misc.c */
-_PROTOTYPE( int do_dup, (void) );
-_PROTOTYPE( void pm_exit, (int proc) );
-_PROTOTYPE( int do_fcntl, (void) );
-_PROTOTYPE( void pm_fork, (int pproc, int cproc, int cpid) );
-_PROTOTYPE( void pm_setgid, (int proc_e, int egid, int rgid) );
-_PROTOTYPE( void pm_setuid, (int proc_e, int euid, int ruid) );
-_PROTOTYPE( void pm_setgroups, (int proc_e, int ngroups, gid_t *addr) );
-_PROTOTYPE( int do_sync, (void) );
-_PROTOTYPE( int do_fsync, (void) );
-_PROTOTYPE( void pm_reboot, (void) );
-_PROTOTYPE( int do_svrctl, (void) );
-_PROTOTYPE( int do_getsysinfo, (void) );
-_PROTOTYPE( int pm_dumpcore, (endpoint_t proc_e, int sig,
- vir_bytes exe_name) );
-_PROTOTYPE( void ds_event, (void) );
+int do_dup(void);
+void pm_exit(int proc);
+int do_fcntl(void);
+void pm_fork(int pproc, int cproc, int cpid);
+void pm_setgid(int proc_e, int egid, int rgid);
+void pm_setuid(int proc_e, int euid, int ruid);
+void pm_setgroups(int proc_e, int ngroups, gid_t *addr);
+int do_sync(void);
+int do_fsync(void);
+void pm_reboot(void);
+int do_svrctl(void);
+int do_getsysinfo(void);
+int pm_dumpcore(endpoint_t proc_e, int sig, vir_bytes exe_name);
+void ds_event(void);
/* mount.c */
-_PROTOTYPE( int do_fsready, (void) );
-_PROTOTYPE( int do_mount, (void) );
-_PROTOTYPE( int do_umount, (void) );
-_PROTOTYPE( int is_nonedev, (dev_t dev) );
-_PROTOTYPE( void mount_pfs, (void) );
-_PROTOTYPE( int mount_fs, (dev_t dev, char fullpath[PATH_MAX+1],
- endpoint_t fs_e, int rdonly,
- char mount_label[LABEL_MAX]) );
-_PROTOTYPE( int unmount, (dev_t dev, char *label) );
-_PROTOTYPE( void unmount_all, (void) );
+int do_fsready(void);
+int do_mount(void);
+int do_umount(void);
+int is_nonedev(dev_t dev);
+void mount_pfs(void);
+int mount_fs(dev_t dev, char fullpath[PATH_MAX+1], endpoint_t fs_e, int
+ rdonly, char mount_label[LABEL_MAX]);
+int unmount(dev_t dev, char *label);
+void unmount_all(void);
/* open.c */
-_PROTOTYPE( int do_close, (void) );
-_PROTOTYPE( int close_fd, (struct fproc *rfp, int fd_nr) );
-_PROTOTYPE( void close_reply, (void) );
-_PROTOTYPE( int common_open, (char path[PATH_MAX], int oflags,
- mode_t omode) );
-_PROTOTYPE( int do_creat, (void) );
-_PROTOTYPE( int do_lseek, (void) );
-_PROTOTYPE( int do_llseek, (void) );
-_PROTOTYPE( int do_mknod, (void) );
-_PROTOTYPE( int do_mkdir, (void) );
-_PROTOTYPE( int do_open, (void) );
-_PROTOTYPE( int do_slink, (void) );
-_PROTOTYPE( int do_vm_open, (void) );
-_PROTOTYPE( int do_vm_close, (void) );
+int do_close(void);
+int close_fd(struct fproc *rfp, int fd_nr);
+void close_reply(void);
+int common_open(char path[PATH_MAX], int oflags, mode_t omode);
+int do_creat(void);
+int do_lseek(void);
+int do_llseek(void);
+int do_mknod(void);
+int do_mkdir(void);
+int do_open(void);
+int do_slink(void);
+int do_vm_open(void);
+int do_vm_close(void);
/* path.c */
-_PROTOTYPE( struct vnode *advance, (struct vnode *dirp, struct lookup *resolve,
- struct fproc *rfp) );
-_PROTOTYPE( struct vnode *eat_path, (struct lookup *resolve,
- struct fproc *rfp) );
-_PROTOTYPE( struct vnode *last_dir, (struct lookup *resolve,
- struct fproc *rfp) );
-_PROTOTYPE( void lookup_init, (struct lookup *resolve, char *path, int flags,
- struct vmnt **vmp, struct vnode **vp) );
-_PROTOTYPE( int get_name, (struct vnode *dirp, struct vnode *entry,
- char *_name) );
-_PROTOTYPE( int canonical_path, (char *orig_path, struct fproc *rfp) );
-_PROTOTYPE( int do_check_perms, (void) );
+struct vnode *advance(struct vnode *dirp, struct lookup *resolve, struct
+ fproc *rfp);
+struct vnode *eat_path(struct lookup *resolve, struct fproc *rfp);
+struct vnode *last_dir(struct lookup *resolve, struct fproc *rfp);
+void lookup_init(struct lookup *resolve, char *path, int flags, struct
+ vmnt **vmp, struct vnode **vp);
+int get_name(struct vnode *dirp, struct vnode *entry, char *_name);
+int canonical_path(char *orig_path, struct fproc *rfp);
+int do_check_perms(void);
/* pipe.c */
-_PROTOTYPE( int do_pipe, (void) );
-_PROTOTYPE( int map_vnode, (struct vnode *vp, endpoint_t fs_e) );
-_PROTOTYPE( void unpause, (int proc_nr_e) );
-_PROTOTYPE( int pipe_check, (struct vnode *vp, int rw_flag,
- int oflags, int bytes, u64_t position, int notouch) );
-_PROTOTYPE( void release, (struct vnode *vp, int call_nr, int count) );
-_PROTOTYPE( void revive, (int proc_nr, int bytes) );
-_PROTOTYPE( void suspend, (int task) );
-_PROTOTYPE( void pipe_suspend, (struct filp *rfilp, char *buf, size_t size));
-_PROTOTYPE( void unsuspend_by_endpt, (endpoint_t) );
-_PROTOTYPE( void wait_for, (endpoint_t) );
+int do_pipe(void);
+int map_vnode(struct vnode *vp, endpoint_t fs_e);
+void unpause(int proc_nr_e);
+int pipe_check(struct vnode *vp, int rw_flag, int oflags, int bytes,
+ u64_t position, int notouch);
+void release(struct vnode *vp, int call_nr, int count);
+void revive(int proc_nr, int bytes);
+void suspend(int task);
+void pipe_suspend(struct filp *rfilp, char *buf, size_t size);
+void unsuspend_by_endpt(endpoint_t);
+void wait_for(endpoint_t);
#if DO_SANITYCHECKS
-_PROTOTYPE( int check_pipe, (void) );
+int check_pipe(void);
#endif
/* protect.c */
-_PROTOTYPE( int do_access, (void) );
-_PROTOTYPE( int do_chmod, (void) );
-_PROTOTYPE( int do_chown, (void) );
-_PROTOTYPE( int do_umask, (void) );
-_PROTOTYPE( int forbidden, (struct fproc *rfp, struct vnode *vp,
- mode_t access_desired) );
-_PROTOTYPE( int read_only, (struct vnode *vp) );
+int do_access(void);
+int do_chmod(void);
+int do_chown(void);
+int do_umask(void);
+int forbidden(struct fproc *rfp, struct vnode *vp, mode_t
+ access_desired);
+int read_only(struct vnode *vp);
/* read.c */
-_PROTOTYPE( int do_read, (void) );
-_PROTOTYPE( int do_getdents, (void) );
-_PROTOTYPE( void lock_bsf, (void) );
-_PROTOTYPE( void unlock_bsf, (void) );
-_PROTOTYPE( int do_read_write, (int rw_flag) );
-_PROTOTYPE( int read_write, (int rw_flag, struct filp *f, char *buffer,
- size_t nbytes, endpoint_t for_e) );
-_PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr, struct filp *f,
- char *buf, size_t req_size) );
+int do_read(void);
+int do_getdents(void);
+void lock_bsf(void);
+void unlock_bsf(void);
+int do_read_write(int rw_flag);
+int read_write(int rw_flag, struct filp *f, char *buffer, size_t nbytes,
+ endpoint_t for_e);
+int rw_pipe(int rw_flag, endpoint_t usr, struct filp *f, char *buf,
+ size_t req_size);
/* request.c */
-_PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e,
- dev_t dev, u64_t pos, unsigned int num_of_bytes,
- char *user_addr, int rw_flag,
- u64_t *new_posp, unsigned int *cum_iop) );
-_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, mode_t rmode,
- mode_t *new_modep) );
-_PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr,
- uid_t newuid, gid_t newgid, mode_t *new_modep) );
-_PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode,
- uid_t uid, gid_t gid, char *path, node_details_t *res) );
-_PROTOTYPE( int req_flush, (endpoint_t fs_e, dev_t dev) );
-_PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) );
-_PROTOTYPE( int req_statvfs, (int fs_e, int who_e, char *buf) );
-_PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr,
- off_t start, off_t end) );
-_PROTOTYPE( int req_getdents, (endpoint_t fs_e, ino_t inode_nr,
- u64_t pos, char *buf, size_t size,
- u64_t *new_pos, int direct) );
-_PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) );
-_PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent,
- char *lastc, ino_t linked_file) );
-_PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino,
- uid_t uid, gid_t gid, struct lookup *resolve,
- lookup_res_t *res, struct fproc *rfp) );
-_PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr,
- char *lastc, uid_t uid, gid_t gid, mode_t dmode) );
-_PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr,
- char *lastc, uid_t uid, gid_t gid,
- mode_t dmode, dev_t dev) );
-_PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) );
-_PROTOTYPE( int req_newnode, (endpoint_t fs_e, uid_t uid,
- gid_t gid, mode_t dmode,
- dev_t dev, struct node_details *res) );
-_PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) );
-_PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr,
- endpoint_t who_e, char *buf, size_t len,
- int direct) );
-_PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name,
- dev_t dev, int readonly, int isroot,
- struct node_details *res_nodep,
- int *con_reqs) );
-_PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr,
- u64_t pos, int rw_flag,
- endpoint_t user_e, char *user_addr,
- unsigned int num_of_bytes, u64_t *new_posp,
- unsigned int *cum_iop) );
-_PROTOTYPE( int req_rename, (endpoint_t fs_e, ino_t old_dir,
- char *old_name, ino_t new_dir, char *new_name) );
-_PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr,
- char *lastc) );
-_PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc,
- endpoint_t who_e, char *path_addr,
- unsigned short path_length, uid_t uid, gid_t gid) );
-_PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e,
- char *buf, int pos, int stat_version) );
-_PROTOTYPE( int req_sync, (endpoint_t fs_e) );
-_PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr,
- char *lastc) );
-_PROTOTYPE( int req_unmount, (endpoint_t fs_e) );
-_PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr,
- time_t actime, time_t modtime) );
-_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, dev_t dev,
- char *label) );
+int req_breadwrite(endpoint_t fs_e, endpoint_t user_e, dev_t dev, u64_t
+ pos, unsigned int num_of_bytes, char *user_addr, int rw_flag, u64_t
+ *new_posp, unsigned int *cum_iop);
+int req_chmod(int fs_e, ino_t inode_nr, mode_t rmode, mode_t
+ *new_modep);
+int req_chown(endpoint_t fs_e, ino_t inode_nr, uid_t newuid, gid_t
+ newgid, mode_t *new_modep);
+int req_create(int fs_e, ino_t inode_nr, int omode, uid_t uid, gid_t
+ gid, char *path, node_details_t *res);
+int req_flush(endpoint_t fs_e, dev_t dev);
+int req_fstatfs(int fs_e, int who_e, char *buf);
+int req_statvfs(int fs_e, int who_e, char *buf);
+int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end);
+int req_getdents(endpoint_t fs_e, ino_t inode_nr, u64_t pos, char *buf,
+ size_t size, u64_t *new_pos, int direct);
+int req_inhibread(endpoint_t fs_e, ino_t inode_nr);
+int req_link(endpoint_t fs_e, ino_t link_parent, char *lastc, ino_t
+ linked_file);
+int req_lookup(endpoint_t fs_e, ino_t dir_ino, ino_t root_ino, uid_t
+ uid, gid_t gid, struct lookup *resolve, lookup_res_t *res, struct fproc
+ *rfp);
+int req_mkdir(endpoint_t fs_e, ino_t inode_nr, char *lastc, uid_t uid,
+ gid_t gid, mode_t dmode);
+int req_mknod(endpoint_t fs_e, ino_t inode_nr, char *lastc, uid_t uid,
+ gid_t gid, mode_t dmode, dev_t dev);
+int req_mountpoint(endpoint_t fs_e, ino_t inode_nr);
+int req_newnode(endpoint_t fs_e, uid_t uid, gid_t gid, mode_t dmode,
+ dev_t dev, struct node_details *res);
+int req_putnode(int fs_e, ino_t inode_nr, int count);
+int req_rdlink(endpoint_t fs_e, ino_t inode_nr, endpoint_t who_e, char
+ *buf, size_t len, int direct);
+int req_readsuper(endpoint_t fs_e, char *driver_name, dev_t dev, int
+ readonly, int isroot, struct node_details *res_nodep, int *con_reqs);
+int req_readwrite(endpoint_t fs_e, ino_t inode_nr, u64_t pos, int
+ rw_flag, endpoint_t user_e, char *user_addr, unsigned int num_of_bytes,
+ u64_t *new_posp, unsigned int *cum_iop);
+int req_rename(endpoint_t fs_e, ino_t old_dir, char *old_name, ino_t
+ new_dir, char *new_name);
+int req_rmdir(endpoint_t fs_e, ino_t inode_nr, char *lastc);
+int req_slink(endpoint_t fs_e, ino_t inode_nr, char *lastc, endpoint_t
+ who_e, char *path_addr, unsigned short path_length, uid_t uid, gid_t
+ gid);
+int req_stat(int fs_e, ino_t inode_nr, int who_e, char *buf, int pos,
+ int stat_version);
+int req_sync(endpoint_t fs_e);
+int req_unlink(endpoint_t fs_e, ino_t inode_nr, char *lastc);
+int req_unmount(endpoint_t fs_e);
+int req_utime(endpoint_t fs_e, ino_t inode_nr, time_t actime, time_t
+ modtime);
+int req_newdriver(endpoint_t fs_e, dev_t dev, char *label);
/* stadir.c */
-_PROTOTYPE( int do_chdir, (void) );
-_PROTOTYPE( int do_fchdir, (void) );
-_PROTOTYPE( int do_chroot, (void) );
-_PROTOTYPE( int do_fstat, (void) );
-_PROTOTYPE( int do_stat, (void) );
-_PROTOTYPE( int do_fstatfs, (void) );
-_PROTOTYPE( int do_statvfs, (void) );
-_PROTOTYPE( int do_fstatvfs, (void) );
-_PROTOTYPE( int do_rdlink, (void) );
-_PROTOTYPE( int do_lstat, (void) );
+int do_chdir(void);
+int do_fchdir(void);
+int do_chroot(void);
+int do_fstat(void);
+int do_stat(void);
+int do_fstatfs(void);
+int do_statvfs(void);
+int do_fstatvfs(void);
+int do_rdlink(void);
+int do_lstat(void);
/* time.c */
-_PROTOTYPE( int do_utime, (void) );
+int do_utime(void);
/* tll.c */
-_PROTOTYPE( void tll_downgrade, (tll_t *tllp) );
-_PROTOTYPE( int tll_haspendinglock, (tll_t *tllp) );
-_PROTOTYPE( void tll_init, (tll_t *tllp) );
-_PROTOTYPE( int tll_islocked, (tll_t *tllp) );
-_PROTOTYPE( int tll_lock, (tll_t *tllp, tll_access_t locktype) );
-_PROTOTYPE( int tll_locked_by_me, (tll_t *tllp) );
-_PROTOTYPE( void tll_lockstat, (tll_t *tllp) );
-_PROTOTYPE( int tll_unlock, (tll_t *tllp) );
-_PROTOTYPE( void tll_upgrade, (tll_t *tllp) );
+void tll_downgrade(tll_t *tllp);
+int tll_haspendinglock(tll_t *tllp);
+void tll_init(tll_t *tllp);
+int tll_islocked(tll_t *tllp);
+int tll_lock(tll_t *tllp, tll_access_t locktype);
+int tll_locked_by_me(tll_t *tllp);
+void tll_lockstat(tll_t *tllp);
+int tll_unlock(tll_t *tllp);
+void tll_upgrade(tll_t *tllp);
/* utility.c */
-_PROTOTYPE( time_t clock_time, (void) );
-_PROTOTYPE( unsigned conv2, (int norm, int w) );
-_PROTOTYPE( long conv4, (int norm, long x) );
-_PROTOTYPE( int fetch_name, (char *path, int len, int flag, char *dest) );
-_PROTOTYPE( int no_sys, (void) );
-_PROTOTYPE( int isokendpt_f, (char *f, int l, endpoint_t e, int *p, int ft));
-_PROTOTYPE( int in_group, (struct fproc *rfp, gid_t grp) );
+time_t clock_time(void);
+unsigned conv2(int norm, int w);
+long conv4(int norm, long x);
+int fetch_name(char *path, int len, int flag, char *dest);
+int no_sys(void);
+int isokendpt_f(char *f, int l, endpoint_t e, int *p, int ft);
+int in_group(struct fproc *rfp, gid_t grp);
#define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
#define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
/* vmnt.c */
-_PROTOTYPE( void check_vmnt_locks, (void) );
-_PROTOTYPE( void check_vmnt_locks_by_me, (struct fproc *rfp) );
-_PROTOTYPE( void mark_vmnt_free, (struct vmnt *vmp) );
-_PROTOTYPE( struct vmnt *get_free_vmnt, (void) );
-_PROTOTYPE( struct vmnt *find_vmnt, (endpoint_t fs_e) );
-_PROTOTYPE( struct vmnt *get_locked_vmnt, (struct fproc *rfp) );
-_PROTOTYPE( void init_vmnts, (void) );
-_PROTOTYPE( int lock_vmnt, (struct vmnt *vp, tll_access_t locktype) );
-_PROTOTYPE( void unlock_vmnt, (struct vmnt *vp) );
-_PROTOTYPE( void vmnt_unmap_by_endpt, (endpoint_t proc_e) );
+void check_vmnt_locks(void);
+void check_vmnt_locks_by_me(struct fproc *rfp);
+void mark_vmnt_free(struct vmnt *vmp);
+struct vmnt *get_free_vmnt(void);
+struct vmnt *find_vmnt(endpoint_t fs_e);
+struct vmnt *get_locked_vmnt(struct fproc *rfp);
+void init_vmnts(void);
+int lock_vmnt(struct vmnt *vp, tll_access_t locktype);
+void unlock_vmnt(struct vmnt *vp);
+void vmnt_unmap_by_endpt(endpoint_t proc_e);
/* vnode.c */
-_PROTOTYPE( void check_vnode_locks, (void) );
-_PROTOTYPE( void check_vnode_locks_by_me, (struct fproc *rfp) );
-_PROTOTYPE( struct vnode *get_free_vnode, (void) );
-_PROTOTYPE( struct vnode *find_vnode, (int fs_e, int numb) );
-_PROTOTYPE( void init_vnodes, (void) );
-_PROTOTYPE( int is_vnode_locked, (struct vnode *vp) );
-_PROTOTYPE( int lock_vnode, (struct vnode *vp, tll_access_t locktype) );
-_PROTOTYPE( void unlock_vnode, (struct vnode *vp) );
-_PROTOTYPE( void dup_vnode, (struct vnode *vp) );
-_PROTOTYPE( void put_vnode, (struct vnode *vp) );
-_PROTOTYPE( void vnode_clean_refs, (struct vnode *vp) );
+void check_vnode_locks(void);
+void check_vnode_locks_by_me(struct fproc *rfp);
+struct vnode *get_free_vnode(void);
+struct vnode *find_vnode(int fs_e, int numb);
+void init_vnodes(void);
+int is_vnode_locked(struct vnode *vp);
+int lock_vnode(struct vnode *vp, tll_access_t locktype);
+void unlock_vnode(struct vnode *vp);
+void dup_vnode(struct vnode *vp);
+void put_vnode(struct vnode *vp);
+void vnode_clean_refs(struct vnode *vp);
#if DO_SANITYCHECKS
-_PROTOTYPE( int check_vrefs, (void) );
+int check_vrefs(void);
#endif
/* write.c */
-_PROTOTYPE( int do_write, (void) );
+int do_write(void);
/* gcov.c */
-_PROTOTYPE( int do_gcov_flush, (void) );
+int do_gcov_flush(void);
#if ! USE_COVERAGE
#define do_gcov_flush no_sys
#endif
/* select.c */
-_PROTOTYPE( int do_select, (void) );
-_PROTOTYPE( void init_select, (void) );
-_PROTOTYPE( void select_callback, (struct filp *, int ops) );
-_PROTOTYPE( void select_forget, (endpoint_t proc_e) );
-_PROTOTYPE( void select_reply1, (endpoint_t driver_e, int minor, int status));
-_PROTOTYPE( void select_reply2, (endpoint_t driver_e, int minor, int status));
-_PROTOTYPE( void select_timeout_check, (timer_t *) );
-_PROTOTYPE( void select_unsuspend_by_endpt, (endpoint_t proc) );
+int do_select(void);
+void init_select(void);
+void select_callback(struct filp *, int ops);
+void select_forget(endpoint_t proc_e);
+void select_reply1(endpoint_t driver_e, int minor, int status);
+void select_reply2(endpoint_t driver_e, int minor, int status);
+void select_timeout_check(timer_t *);
+void select_unsuspend_by_endpt(endpoint_t proc);
/* worker.c */
-_PROTOTYPE( int worker_available, (void) );
-_PROTOTYPE( struct worker_thread *worker_get, (thread_t worker_tid) );
-_PROTOTYPE( struct job *worker_getjob, (thread_t worker_tid) );
-_PROTOTYPE( void worker_init, (struct worker_thread *worker) );
-_PROTOTYPE( struct worker_thread *worker_self, (void) );
-_PROTOTYPE( void worker_signal, (struct worker_thread *worker) );
-_PROTOTYPE( void worker_start, (void *(*func)(void *arg)) );
-_PROTOTYPE( void worker_stop, (struct worker_thread *worker) );
-_PROTOTYPE( void worker_stop_by_endpt, (endpoint_t proc_e) );
-_PROTOTYPE( void worker_wait, (void) );
-_PROTOTYPE( void sys_worker_start, (void *(*func)(void *arg)) );
-_PROTOTYPE( void dl_worker_start, (void *(*func)(void *arg)) );
+int worker_available(void);
+struct worker_thread *worker_get(thread_t worker_tid);
+struct job *worker_getjob(thread_t worker_tid);
+void worker_init(struct worker_thread *worker);
+struct worker_thread *worker_self(void);
+void worker_signal(struct worker_thread *worker);
+void worker_start(void *(*func)(void *arg));
+void worker_stop(struct worker_thread *worker);
+void worker_stop_by_endpt(endpoint_t proc_e);
+void worker_wait(void);
+void sys_worker_start(void *(*func)(void *arg));
+void dl_worker_start(void *(*func)(void *arg));
#endif
timer_t timer; /* if expiry > 0 */
} selecttab[MAXSELECTS];
-FORWARD _PROTOTYPE(int copy_fdsets, (struct selectentry *se, int nfds,
- int direction) );
-FORWARD _PROTOTYPE(int do_select_request, (struct selectentry *se, int fd,
- int *ops) );
-FORWARD _PROTOTYPE(void filp_status, (struct filp *fp, int status) );
-FORWARD _PROTOTYPE(int is_deferred, (struct selectentry *se) );
-FORWARD _PROTOTYPE(void restart_proc, (struct selectentry *se) );
-FORWARD _PROTOTYPE(void ops2tab, (int ops, int fd, struct selectentry *e));
-FORWARD _PROTOTYPE(int is_regular_file, (struct filp *f) );
-FORWARD _PROTOTYPE(int is_pipe, (struct filp *f) );
-FORWARD _PROTOTYPE(int is_supported_major, (struct filp *f) );
-FORWARD _PROTOTYPE(void select_lock_filp, (struct filp *f, int ops) );
-FORWARD _PROTOTYPE(int select_request_async, (struct filp *f, int *ops,
- int block) );
-FORWARD _PROTOTYPE(int select_request_file, (struct filp *f, int *ops,
- int block) );
-FORWARD _PROTOTYPE(int select_request_major, (struct filp *f, int *ops,
- int block) );
-FORWARD _PROTOTYPE(int select_request_pipe, (struct filp *f, int *ops,
- int block) );
-FORWARD _PROTOTYPE(int select_request_sync, (struct filp *f, int *ops,
- int block) );
-FORWARD _PROTOTYPE(void select_cancel_all, (struct selectentry *e) );
-FORWARD _PROTOTYPE(void select_cancel_filp, (struct filp *f) );
-FORWARD _PROTOTYPE(void select_return, (struct selectentry *) );
-FORWARD _PROTOTYPE(void select_restart_filps, (void) );
-FORWARD _PROTOTYPE(int tab2ops, (int fd, struct selectentry *e) );
-FORWARD _PROTOTYPE(void wipe_select, (struct selectentry *s) );
+FORWARD 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 {
int (*select_request)(struct filp *, int *ops, int block);
#include "vnode.h"
#include "vmnt.h"
-FORWARD _PROTOTYPE( int change, (struct vnode **iip, char *name_ptr, int len));
-FORWARD _PROTOTYPE( int change_into, (struct vnode **iip, struct vnode *vp));
+FORWARD int change(struct vnode **iip, char *name_ptr, int len);
+FORWARD int change_into(struct vnode **iip, struct vnode *vp);
/*===========================================================================*
* do_fchdir *
#include "vnode.h"
#include "vmnt.h"
-PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
+PUBLIC int (*call_vec[])(void) = {
no_sys, /* 0 = unused */
no_sys, /* 1 = (exit) */
no_sys, /* 2 = (fork) */
/* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];
-PUBLIC _PROTOTYPE (int (*pfs_call_vec[]), (void) ) = {
+PUBLIC int (*pfs_call_vec[])(void) = {
no_sys, /* 0 */
do_check_perms, /* 1 */
#include "threads.h"
#include <assert.h>
-FORWARD _PROTOTYPE( int tll_append, (tll_t *tllp, tll_access_t locktype));
+FORWARD int tll_append(tll_t *tllp, tll_access_t locktype);
PRIVATE int tll_append(tll_t *tllp, tll_access_t locktype)
{
#include <assert.h>
#include "fproc.h"
-FORWARD _PROTOTYPE( int is_vmnt_locked, (struct vmnt *vmp) );
-FORWARD _PROTOTYPE( void clear_vmnt, (struct vmnt *vmp) );
+FORWARD int is_vmnt_locked(struct vmnt *vmp);
+FORWARD void clear_vmnt(struct vmnt *vmp);
/* Is vmp pointer reasonable? */
#define SANEVMP(v) ((((v) >= &vmnt[0] && (v) < &vmnt[NR_MNTS])))
#include "job.h"
#include <assert.h>
-FORWARD _PROTOTYPE( void append_job, (struct job *job,
- void *(*func)(void *arg)) );
-FORWARD _PROTOTYPE( void get_work, (struct worker_thread *worker) );
-FORWARD _PROTOTYPE( void *worker_main, (void *arg) );
-FORWARD _PROTOTYPE( void worker_sleep, (struct worker_thread *worker) );
-FORWARD _PROTOTYPE( void worker_wake, (struct worker_thread *worker) );
-FORWARD _PROTOTYPE( int worker_waiting_for, (struct worker_thread *worker,
- endpoint_t proc_e) );
+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
+ proc_e);
PRIVATE int init = 0;
PRIVATE mthread_attr_t tattr;
PRIVATE struct hole *hole_head; /* pointer to first hole */
PRIVATE struct hole *free_slots;/* ptr to list of unused table slots */
-FORWARD _PROTOTYPE( void del_slot, (struct hole *prev_ptr, struct hole *hp) );
-FORWARD _PROTOTYPE( void merge, (struct hole *hp) );
-FORWARD _PROTOTYPE( void free_pages, (phys_bytes addr, int pages) );
-FORWARD _PROTOTYPE( phys_bytes alloc_pages, (int pages, int flags,
- phys_bytes *ret));
+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);
#if SANITYCHECKS
-FORWARD _PROTOTYPE( void holes_sanity_f, (char *fn, int line) );
+FORWARD 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 */
#include "memory.h"
-FORWARD _PROTOTYPE( 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));
+FORWARD 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 *
(c) < VM_RQ_BASE + ELEMENTS(vm_calls)) ? \
((c) - VM_RQ_BASE) : -1)
-FORWARD _PROTOTYPE(int map_service, (struct rprocpub *rpub));
-FORWARD _PROTOTYPE(int vm_acl_ok, (endpoint_t caller, int call));
+FORWARD int map_service(struct rprocpub *rpub);
+FORWARD int vm_acl_ok(endpoint_t caller, int call);
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
-FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
-FORWARD _PROTOTYPE( void sef_cb_signal_handler, (int signo) );
+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);
/*===========================================================================*
* main *
#include "yielded.h"
/* alloc.c */
-_PROTOTYPE( phys_clicks alloc_mem, (phys_clicks clicks, u32_t flags) );
-_PROTOTYPE( struct memlist *alloc_mem_in_list, (phys_bytes bytes, u32_t flags));
-_PROTOTYPE( int do_adddma, (message *msg) );
-_PROTOTYPE( int do_deldma, (message *msg) );
-_PROTOTYPE( int do_getdma, (message *msg) );
-_PROTOTYPE( void release_dma, (struct vmproc *vmp) );
-_PROTOTYPE( void memstats, (int *nodes, int *pages, int *largest) );
-_PROTOTYPE( void printmemstats, (void) );
-_PROTOTYPE( void usedpages_reset, (void) );
-_PROTOTYPE( int usedpages_add_f, (phys_bytes phys, phys_bytes len,
- char *file, int line) );
-_PROTOTYPE( void free_mem, (phys_clicks base, phys_clicks clicks) );
-_PROTOTYPE( void free_mem_list, (struct memlist *list, int all));
-_PROTOTYPE( void print_mem_list, (struct memlist *ml));
+phys_clicks alloc_mem(phys_clicks clicks, u32_t flags);
+struct memlist *alloc_mem_in_list(phys_bytes bytes, u32_t flags);
+int do_adddma(message *msg);
+int do_deldma(message *msg);
+int do_getdma(message *msg);
+void release_dma(struct vmproc *vmp);
+void memstats(int *nodes, int *pages, int *largest);
+void printmemstats(void);
+void usedpages_reset(void);
+int usedpages_add_f(phys_bytes phys, phys_bytes len, char *file, int
+ line);
+void free_mem(phys_clicks base, phys_clicks clicks);
+void free_mem_list(struct memlist *list, int all);
+void print_mem_list(struct memlist *ml);
#define usedpages_add(a, l) usedpages_add_f(a, l, __FILE__, __LINE__)
-_PROTOTYPE( void mem_init, (struct memory *chunks) );
+void mem_init(struct memory *chunks);
/* utility.c */
-_PROTOTYPE( int get_mem_map, (int proc_nr, struct mem_map *mem_map) );
-_PROTOTYPE( void get_mem_chunks, (struct memory *mem_chunks));
-_PROTOTYPE( void reserve_proc_mem, (struct memory *mem_chunks,
- struct mem_map *map_ptr));
-_PROTOTYPE( int vm_isokendpt, (endpoint_t ep, int *proc) );
-_PROTOTYPE( int get_stack_ptr, (int proc_nr, vir_bytes *sp) );
-_PROTOTYPE( int do_info, (message *) );
-_PROTOTYPE( int swap_proc_slot, (struct vmproc *src_vmp, struct vmproc *dst_vmp));
-_PROTOTYPE( int swap_proc_dyn_data, (struct vmproc *src_vmp, struct vmproc *dst_vmp));
+int get_mem_map(int proc_nr, struct mem_map *mem_map);
+void get_mem_chunks(struct memory *mem_chunks);
+void reserve_proc_mem(struct memory *mem_chunks, struct mem_map
+ *map_ptr);
+int vm_isokendpt(endpoint_t ep, int *proc);
+int get_stack_ptr(int proc_nr, vir_bytes *sp);
+int do_info(message *);
+int swap_proc_slot(struct vmproc *src_vmp, struct vmproc *dst_vmp);
+int swap_proc_dyn_data(struct vmproc *src_vmp, struct vmproc *dst_vmp);
/* exit.c */
-_PROTOTYPE( void clear_proc, (struct vmproc *vmp) );
-_PROTOTYPE( int do_exit, (message *msg) );
-_PROTOTYPE( int do_willexit, (message *msg) );
-_PROTOTYPE( void free_proc, (struct vmproc *vmp) );
+void clear_proc(struct vmproc *vmp);
+int do_exit(message *msg);
+int do_willexit(message *msg);
+void free_proc(struct vmproc *vmp);
/* fork.c */
-_PROTOTYPE( int do_fork, (message *msg) );
+int do_fork(message *msg);
/* exec.c */
-_PROTOTYPE( int do_exec_newmem, (message *msg) );
-_PROTOTYPE( int proc_new, (struct vmproc *vmp, phys_bytes start,
- phys_bytes text_addr, phys_bytes text_bytes,
- phys_bytes data_addr, phys_bytes data_bytes,
- phys_bytes stack, phys_bytes gap,
- phys_bytes text_here, phys_bytes data_here, vir_bytes stacktop,
- int prealloc_stack, int is_elf));
-_PROTOTYPE( phys_bytes find_kernel_top, (void) );
+int do_exec_newmem(message *msg);
+int proc_new(struct vmproc *vmp, phys_bytes start, phys_bytes text_addr,
+ phys_bytes text_bytes, phys_bytes data_addr, phys_bytes data_bytes,
+ phys_bytes stack, phys_bytes gap, phys_bytes text_here, phys_bytes
+ data_here, vir_bytes stacktop, int prealloc_stack, int is_elf);
+phys_bytes find_kernel_top(void);
/* break.c */
-_PROTOTYPE( int do_brk, (message *msg) );
-_PROTOTYPE( int adjust, (struct vmproc *rmp,
- vir_clicks data_clicks, vir_bytes sp) );
-_PROTOTYPE( int real_brk, (struct vmproc *vmp, vir_bytes v));
+int do_brk(message *msg);
+int adjust(struct vmproc *rmp, vir_clicks data_clicks, vir_bytes sp);
+int real_brk(struct vmproc *vmp, vir_bytes v);
/* signal.c */
-_PROTOTYPE( int do_push_sig, (message *msg) );
+int do_push_sig(message *msg);
/* map_mem.c */
-_PROTOTYPE( int map_memory, (endpoint_t sour, endpoint_t dest,
- vir_bytes virt_s, vir_bytes virt_d, vir_bytes length, int flag));
-_PROTOTYPE( int unmap_memory, (endpoint_t sour, endpoint_t dest,
- vir_bytes virt_s, vir_bytes virt_d, vir_bytes length, int flag));
+int map_memory(endpoint_t sour, endpoint_t dest, vir_bytes virt_s,
+ vir_bytes virt_d, vir_bytes length, int flag);
+int unmap_memory(endpoint_t sour, endpoint_t dest, vir_bytes virt_s,
+ vir_bytes virt_d, vir_bytes length, int flag);
/* mmap.c */
-_PROTOTYPE(int do_mmap, (message *msg) );
-_PROTOTYPE(int do_munmap, (message *msg) );
-_PROTOTYPE(int do_map_phys, (message *msg) );
-_PROTOTYPE(int do_unmap_phys, (message *msg) );
-_PROTOTYPE(int do_remap, (message *m) );
-_PROTOTYPE(int do_get_phys, (message *m) );
-_PROTOTYPE(int do_shared_unmap, (message *m) );
-_PROTOTYPE(int do_get_refcount, (message *m) );
+int do_mmap(message *msg);
+int do_munmap(message *msg);
+int do_map_phys(message *msg);
+int do_unmap_phys(message *msg);
+int do_remap(message *m);
+int do_get_phys(message *m);
+int do_shared_unmap(message *m);
+int do_get_refcount(message *m);
/* pagefaults.c */
-_PROTOTYPE( void do_pagefaults, (message *m) );
-_PROTOTYPE( void do_memory, (void) );
-_PROTOTYPE( char *pf_errstr, (u32_t err));
-_PROTOTYPE( int handle_memory, (struct vmproc *vmp, vir_bytes mem,
- vir_bytes len, int wrflag));
+void do_pagefaults(message *m);
+void do_memory(void);
+char *pf_errstr(u32_t err);
+int handle_memory(struct vmproc *vmp, vir_bytes mem, vir_bytes len, int
+ wrflag);
/* $(ARCH)/pagetable.c */
-_PROTOTYPE( void pt_init, (phys_bytes limit) );
-_PROTOTYPE( void pt_init_mem, (void) );
-_PROTOTYPE( void pt_check, (struct vmproc *vmp) );
-_PROTOTYPE( int pt_new, (pt_t *pt) );
-_PROTOTYPE( void pt_free, (pt_t *pt) );
-_PROTOTYPE( int pt_map_in_range, (struct vmproc *src_vmp, struct vmproc *dst_vmp,
- vir_bytes start, vir_bytes end) );
-_PROTOTYPE( int pt_ptmap, (struct vmproc *src_vmp, struct vmproc *dst_vmp) );
-_PROTOTYPE( int pt_ptalloc_in_range, (pt_t *pt, vir_bytes start, vir_bytes end,
- u32_t flags, int verify));
-_PROTOTYPE( void pt_clearmapcache, (void) );
-_PROTOTYPE( int pt_writemap, (struct vmproc * vmp, pt_t *pt, vir_bytes v,
- phys_bytes physaddr, size_t bytes, u32_t flags,
- u32_t writemapflags));
-_PROTOTYPE( int pt_checkrange, (pt_t *pt, vir_bytes v, size_t bytes, int write));
-_PROTOTYPE( int pt_bind, (pt_t *pt, struct vmproc *who) );
-_PROTOTYPE( void *vm_allocpage, (phys_bytes *p, int cat));
-_PROTOTYPE( void pt_cycle, (void));
-_PROTOTYPE( int pt_mapkernel, (pt_t *pt));
-_PROTOTYPE( void vm_pagelock, (void *vir, int lockflag) );
-_PROTOTYPE( int vm_addrok, (void *vir, int write) );
+void pt_init(phys_bytes limit);
+void pt_init_mem(void);
+void pt_check(struct vmproc *vmp);
+int pt_new(pt_t *pt);
+void pt_free(pt_t *pt);
+int pt_map_in_range(struct vmproc *src_vmp, struct vmproc *dst_vmp,
+ vir_bytes start, vir_bytes end);
+int pt_ptmap(struct vmproc *src_vmp, struct vmproc *dst_vmp);
+int pt_ptalloc_in_range(pt_t *pt, vir_bytes start, vir_bytes end, u32_t
+ flags, int verify);
+void pt_clearmapcache(void);
+int pt_writemap(struct vmproc * vmp, pt_t *pt, vir_bytes v, phys_bytes
+ physaddr, size_t bytes, u32_t flags, u32_t writemapflags);
+int pt_checkrange(pt_t *pt, vir_bytes v, size_t bytes, int write);
+int pt_bind(pt_t *pt, struct vmproc *who);
+void *vm_allocpage(phys_bytes *p, int cat);
+void pt_cycle(void);
+int pt_mapkernel(pt_t *pt);
+void vm_pagelock(void *vir, int lockflag);
+int vm_addrok(void *vir, int write);
#if SANITYCHECKS
-_PROTOTYPE( void pt_sanitycheck, (pt_t *pt, char *file, int line) );
+void pt_sanitycheck(pt_t *pt, char *file, int line);
#endif
/* slaballoc.c */
-_PROTOTYPE(void *slaballoc,(int bytes));
-_PROTOTYPE(void slabfree,(void *mem, int bytes));
-_PROTOTYPE(void slabstats,(void));
-_PROTOTYPE(void slab_sanitycheck, (char *file, int line));
+void *slaballoc(int bytes);
+void slabfree(void *mem, int bytes);
+void slabstats(void);
+void slab_sanitycheck(char *file, int line);
#define SLABALLOC(var) (var = slaballoc(sizeof(*var)))
#define SLABFREE(ptr) do { slabfree(ptr, sizeof(*(ptr))); (ptr) = NULL; } while(0)
#if SANITYCHECKS
-_PROTOTYPE(void slabunlock,(void *mem, int bytes));
-_PROTOTYPE(void slablock,(void *mem, int bytes));
-_PROTOTYPE(int slabsane_f,(char *file, int line, void *mem, int bytes));
+void slabunlock(void *mem, int bytes);
+void slablock(void *mem, int bytes);
+int slabsane_f(char *file, int line, void *mem, int bytes);
#endif
/* region.c */
-_PROTOTYPE(void map_region_init, (void));
-_PROTOTYPE(struct vir_region * map_page_region,(struct vmproc *vmp, \
- vir_bytes min, vir_bytes max, vir_bytes length, vir_bytes what, \
- u32_t flags, int mapflags));
-_PROTOTYPE(struct vir_region * map_proc_kernel,(struct vmproc *dst));
-_PROTOTYPE(int map_region_extend,(struct vmproc *vmp, struct vir_region *vr, vir_bytes delta));
-_PROTOTYPE(int map_region_shrink,(struct vir_region *vr, vir_bytes delta));
-_PROTOTYPE(int map_unmap_region,(struct vmproc *vmp, struct vir_region *vr, vir_bytes len));
-_PROTOTYPE(int map_free_proc,(struct vmproc *vmp));
-_PROTOTYPE(int map_proc_copy,(struct vmproc *dst, struct vmproc *src));
-_PROTOTYPE(int map_proc_copy_from,(struct vmproc *dst, struct vmproc *src,
- struct vir_region *start_src_vr));
-_PROTOTYPE(struct vir_region *map_lookup,(struct vmproc *vmp, vir_bytes addr));
-_PROTOTYPE(int map_pf,(struct vmproc *vmp,
- struct vir_region *region, vir_bytes offset, int write));
-_PROTOTYPE(int map_pin_memory,(struct vmproc *vmp));
-_PROTOTYPE(int map_handle_memory,(struct vmproc *vmp,
- struct vir_region *region, vir_bytes offset, vir_bytes len, int write));
-_PROTOTYPE(void map_printmap, (struct vmproc *vmp));
-_PROTOTYPE(int map_writept, (struct vmproc *vmp));
-_PROTOTYPE(void printregionstats, (struct vmproc *vmp));
-_PROTOTYPE(phys_bytes map_lookup_phys, (struct vmproc *vmp, u32_t tag));
-_PROTOTYPE(void map_setparent, (struct vmproc *vmp));
-_PROTOTYPE(int yielded_block_cmp, (struct block_id *, struct block_id *));
-
-_PROTOTYPE(struct vir_region * map_region_lookup_tag, (struct vmproc *vmp, u32_t tag));
-_PROTOTYPE(void map_region_set_tag, (struct vir_region *vr, u32_t tag));
-_PROTOTYPE(u32_t map_region_get_tag, (struct vir_region *vr));
-_PROTOTYPE(int map_remap, (struct vmproc *dvmp, vir_bytes da, size_t size,
- struct vir_region *region, vir_bytes *r, int ro));
-_PROTOTYPE(int map_get_phys, (struct vmproc *vmp, vir_bytes addr, phys_bytes *r));
-_PROTOTYPE(int map_get_ref, (struct vmproc *vmp, vir_bytes addr, u8_t *cnt));
-
-_PROTOTYPE(void pb_unreferenced, (struct vir_region *region,
- struct phys_region *pr));
-_PROTOTYPE(void get_stats_info, (struct vm_stats_info *vsi));
-_PROTOTYPE(void get_usage_info, (struct vmproc *vmp,
- struct vm_usage_info *vui));
-_PROTOTYPE(int get_region_info, (struct vmproc *vmp,
- struct vm_region_info *vri, int count, vir_bytes *nextp));
-_PROTOTYPE(int copy_abs2region, (phys_bytes abs,
- struct vir_region *destregion, phys_bytes offset, phys_bytes len));
+void map_region_init(void);
+struct vir_region * map_page_region(struct vmproc *vmp, vir_bytes min,
+ vir_bytes max, vir_bytes length, vir_bytes what, u32_t flags, int
+ mapflags);
+struct vir_region * map_proc_kernel(struct vmproc *dst);
+int map_region_extend(struct vmproc *vmp, struct vir_region *vr,
+ vir_bytes delta);
+int map_region_shrink(struct vir_region *vr, vir_bytes delta);
+int map_unmap_region(struct vmproc *vmp, struct vir_region *vr,
+ vir_bytes len);
+int map_free_proc(struct vmproc *vmp);
+int map_proc_copy(struct vmproc *dst, struct vmproc *src);
+int map_proc_copy_from(struct vmproc *dst, struct vmproc *src, struct
+ vir_region *start_src_vr);
+struct vir_region *map_lookup(struct vmproc *vmp, vir_bytes addr);
+int map_pf(struct vmproc *vmp, struct vir_region *region, vir_bytes
+ offset, int write);
+int map_pin_memory(struct vmproc *vmp);
+int map_handle_memory(struct vmproc *vmp, struct vir_region *region,
+ vir_bytes offset, vir_bytes len, int write);
+void map_printmap(struct vmproc *vmp);
+int map_writept(struct vmproc *vmp);
+void printregionstats(struct vmproc *vmp);
+phys_bytes map_lookup_phys(struct vmproc *vmp, u32_t tag);
+void map_setparent(struct vmproc *vmp);
+int yielded_block_cmp(struct block_id *, struct block_id *);
+
+struct vir_region * map_region_lookup_tag(struct vmproc *vmp, u32_t
+ tag);
+void map_region_set_tag(struct vir_region *vr, u32_t tag);
+u32_t map_region_get_tag(struct vir_region *vr);
+int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size, struct
+ vir_region *region, vir_bytes *r, int ro);
+int map_get_phys(struct vmproc *vmp, vir_bytes addr, phys_bytes *r);
+int map_get_ref(struct vmproc *vmp, vir_bytes addr, u8_t *cnt);
+
+void pb_unreferenced(struct vir_region *region, struct phys_region *pr);
+void get_stats_info(struct vm_stats_info *vsi);
+void get_usage_info(struct vmproc *vmp, struct vm_usage_info *vui);
+int get_region_info(struct vmproc *vmp, struct vm_region_info *vri, int
+ count, vir_bytes *nextp);
+int copy_abs2region(phys_bytes abs, struct vir_region *destregion,
+ phys_bytes offset, phys_bytes len);
#if SANITYCHECKS
-_PROTOTYPE(void map_sanitycheck,(char *file, int line));
-_PROTOTYPE(void blockstats,(void));
+void map_sanitycheck(char *file, int line);
+void blockstats(void);
#endif
-_PROTOTYPE(int do_forgetblocks, (message *m));
-_PROTOTYPE(int do_forgetblock, (message *m));
-_PROTOTYPE(int do_yieldblockgetblock, (message *m));
-_PROTOTYPE(vir_bytes free_yielded, (vir_bytes bytes));
+int do_forgetblocks(message *m);
+int do_forgetblock(message *m);
+int do_yieldblockgetblock(message *m);
+vir_bytes free_yielded(vir_bytes bytes);
/* $(ARCH)/vm.c */
-_PROTOTYPE( vir_bytes arch_map2vir, (struct vmproc *vmp, vir_bytes addr));
-_PROTOTYPE( char *arch_map2str, (struct vmproc *vmp, vir_bytes addr));
-_PROTOTYPE( vir_bytes arch_map2info, (struct vmproc *vmp, vir_bytes addr,
- int *space, int *prot));
-_PROTOTYPE( vir_bytes arch_vir2map, (struct vmproc *vmp, vir_bytes addr));
-_PROTOTYPE( vir_bytes arch_vir2map_text, (struct vmproc *vmp, vir_bytes addr));
-_PROTOTYPE( vir_bytes arch_addrok, (struct vmproc *vmp, vir_bytes addr));
+vir_bytes arch_map2vir(struct vmproc *vmp, vir_bytes addr);
+char *arch_map2str(struct vmproc *vmp, vir_bytes addr);
+vir_bytes arch_map2info(struct vmproc *vmp, vir_bytes addr, int *space,
+ int *prot);
+vir_bytes arch_vir2map(struct vmproc *vmp, vir_bytes addr);
+vir_bytes arch_vir2map_text(struct vmproc *vmp, vir_bytes addr);
+vir_bytes arch_addrok(struct vmproc *vmp, vir_bytes addr);
/* rs.c */
-_PROTOTYPE(int do_rs_set_priv, (message *m));
-_PROTOTYPE(int do_rs_update, (message *m));
-_PROTOTYPE(int do_rs_memctl, (message *m));
+int do_rs_set_priv(message *m);
+int do_rs_update(message *m);
+int do_rs_memctl(message *m);
/* queryexit.c */
-_PROTOTYPE(int do_query_exit, (message *m));
-_PROTOTYPE(int do_watch_exit, (message *m));
-_PROTOTYPE(int do_notify_sig, (message *m));
-_PROTOTYPE(void init_query_exit, (void));
+int do_query_exit(message *m);
+int do_watch_exit(message *m);
+int do_notify_sig(message *m);
+void init_query_exit(void);
(((r)->flags & (VR_DIRECT | VR_SHARED)) || \
(pb)->refcount == 1))
-FORWARD _PROTOTYPE(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_new_physblock(struct vmproc *vmp, struct vir_region
+ *region, vir_bytes offset, vir_bytes length, phys_bytes what, u32_t
+ allocflags, int written);
-FORWARD _PROTOTYPE(int map_ph_writept, (struct vmproc *vmp, struct vir_region *vr,
- struct phys_region *pr));
+FORWARD int map_ph_writept(struct vmproc *vmp, struct vir_region *vr,
+ struct phys_region *pr);
-FORWARD _PROTOTYPE(phys_bytes freeyieldednode, (yielded_t *node, int freemem));
+FORWARD phys_bytes freeyieldednode(yielded_t *node, int freemem);
-FORWARD _PROTOTYPE(struct vir_region *map_copy_region, (struct vmproc *vmp, struct vir_region *vr));
+FORWARD struct vir_region *map_copy_region(struct vmproc *vmp, struct
+ vir_region *vr);
-FORWARD _PROTOTYPE(struct phys_region *map_clone_ph_block, (struct vmproc *vmp,
- struct vir_region *region, struct phys_region *ph, physr_iter *iter));
+FORWARD struct phys_region *map_clone_ph_block(struct vmproc *vmp,
+ struct vir_region *region, struct phys_region *ph, physr_iter *iter);
#if SANITYCHECKS
-FORWARD _PROTOTYPE(void lrucheck, (void));
+FORWARD void lrucheck(void);
#endif
/* hash table of yielded blocks */
} *list_head[LIST_NUMBER];
} slabs[SLABSIZES];
-FORWARD _PROTOTYPE( int objstats, (void *, int, struct slabheader **, struct slabdata **, int *));
+FORWARD int objstats(void *, int, struct slabheader **, struct slabdata
+ **, int *);
#define GETSLAB(b, s) { \
int i; \
int common_test_nr = -1, errct = 0, subtest;
-_PROTOTYPE(void cleanup, (void));
-_PROTOTYPE(int does_fs_truncate, (void));
-_PROTOTYPE(void e, (int n));
-_PROTOTYPE(int name_max, (char *path));
-_PROTOTYPE(void quit, (void));
-_PROTOTYPE(void rm_rf_dir, (int test_nr));
-_PROTOTYPE(void rm_rf_ppdir, (int test_nr));
-_PROTOTYPE(void start, (int test_nr));
+void cleanup(void);
+int does_fs_truncate(void);
+void e(int n);
+int name_max(char *path);
+void quit(void);
+void rm_rf_dir(int test_nr);
+void rm_rf_ppdir(int test_nr);
+void start(int test_nr);
void start(test_nr)
int test_nr;
}
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
char *key_u32 = "test_u32";
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
char buf_buf[BUF_SIZE + CLICK_SIZE];
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
}
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
int fid_send, fid_get;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
int fid_send, fid_get;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
int fid_send, fid_get;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* main *
int fid_send, fid_get;
/* SEF functions and variables. */
-FORWARD _PROTOTYPE( void sef_local_startup, (void) );
+FORWARD void sef_local_startup(void);
/*===========================================================================*
* read_write_buff *
#include <stdlib.h>
-_PROTOTYPE(int main, (void));
+int main(void);
int main()
{
int errct, subtest=1;
-_PROTOTYPE(int main, (int argc, char *argv [], char *envp []));
-_PROTOTYPE(int diff, (char *s1, char *s2));
-_PROTOTYPE(void e, (int n));
+int main(int argc, char *argv [], char *envp []);
+int diff(char *s1, char *s2);
+void e(int n);
int main(argc, argv, envp)
int argc;
int errct, subtest=1;
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(int diff, (char *s1, char *s2));
-_PROTOTYPE(void e, (int n));
+int main(int argc, char *argv []);
+int diff(char *s1, char *s2);
+void e(int n);
int main(argc, argv)
int argc;
int subtest;
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test1a, (void));
-_PROTOTYPE(void parent, (void));
-_PROTOTYPE(void child, (int i));
-_PROTOTYPE(void test1b, (void));
-_PROTOTYPE(void parent1, (int childpid));
-_PROTOTYPE(void func, (int s));
-_PROTOTYPE(void child1, (void));
+int main(int argc, char *argv []);
+void test1a(void);
+void parent(void);
+void child(int i);
+void test1b(void);
+void parent1(int childpid);
+void func(int s);
+void child1(void);
int main(argc, argv)
int argc;
#define MAX_ERROR 2
#include "common.c"
-_PROTOTYPE(int main, (void));
-_PROTOTYPE(void spawn, (int n));
-_PROTOTYPE(void mkfiles, (void));
-_PROTOTYPE(void cr_file, (char *name, int size));
-_PROTOTYPE(void rmfiles, (void));
-_PROTOTYPE(void quit, (void));
+int main(void);
+void spawn(int n);
+void mkfiles(void);
+void cr_file(char *name, int size);
+void rmfiles(void);
+void quit(void);
int main()
{
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(void test11a, (void));
-_PROTOTYPE(void test11b, (void));
-_PROTOTYPE(void test11c, (void));
-_PROTOTYPE(void test11d, (void));
+int main(int argc, char *argv[]);
+void test11a(void);
+void test11b(void);
+void test11c(void);
+void test11d(void);
int main(argc, argv)
int argc;
#include "common.c"
-_PROTOTYPE(int main, (void));
+int main(void);
int main()
{
#define MAX_ERROR 2
#include "common.c"
-_PROTOTYPE(int main, (void));
-_PROTOTYPE(void quit, (void));
+int main(void);
+void quit(void);
int main()
{
#include "common.c"
-_PROTOTYPE(int main, (void));
-_PROTOTYPE(void e, (int n));
-_PROTOTYPE(void quit, (void));
+int main(void);
+void e(int n);
+void quit(void);
int main()
{
#define MAX_ERROR 2
#include "common.c"
-_PROTOTYPE(void check, (int thing, int number));
-_PROTOTYPE(void equal, (char *a, char *b, int number));
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void first, (void));
-_PROTOTYPE(void second, (void));
+void check(int thing, int number);
+void equal(char *a, char *b, int number);
+int main(int argc, char *argv []);
+void first(void);
+void second(void);
/*
- check - complain if condition is not true
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test16a, (void));
-_PROTOTYPE(void get_times, (char *name, time_t *a, time_t *c, time_t *m));
+int main(int argc, char *argv []);
+void test16a(void);
+void get_times(char *name, time_t *a, time_t *c, time_t *m);
int main(argc, argv)
int argc;
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test, (int mask));
-_PROTOTYPE(void test01, (void));
-_PROTOTYPE(void test02, (void));
-_PROTOTYPE(void test08, (void));
-_PROTOTYPE(void test09, (void));
-_PROTOTYPE(void test10, (void));
-_PROTOTYPE(int link_alot, (char *bigboss));
-_PROTOTYPE(int unlink_alot, (int number));
-_PROTOTYPE(void get_new, (char name []));
-_PROTOTYPE(void test11, (void));
-_PROTOTYPE(void nlcr, (void));
-_PROTOTYPE(void str, (char *s));
-_PROTOTYPE(void test03, (void));
-_PROTOTYPE(void put_file_in_dir, (char *dirname, int mode));
-_PROTOTYPE(void init_array, (char *a));
-_PROTOTYPE(void clear_array, (char *b));
-_PROTOTYPE(int comp_array, (char *a, char *b, int range));
-_PROTOTYPE(void try_close, (int filedes, char *name));
-_PROTOTYPE(void try_unlink, (char *fname));
-_PROTOTYPE(void Remove, (int fdes, char *fname));
-_PROTOTYPE(int get_mode, (char *name));
-_PROTOTYPE(void check, (char *scall, int number));
-_PROTOTYPE(void put, (int nr));
-_PROTOTYPE(int open_alot, (void));
-_PROTOTYPE(int close_alot, (int number));
-_PROTOTYPE(void clean_up_the_mess, (void));
-_PROTOTYPE(void chmod_8_dirs, (int sw));
-_PROTOTYPE(void quit, (void));
+int main(int argc, char *argv []);
+void test(int mask);
+void test01(void);
+void test02(void);
+void test08(void);
+void test09(void);
+void test10(void);
+int link_alot(char *bigboss);
+int unlink_alot(int number);
+void get_new(char name []);
+void test11(void);
+void nlcr(void);
+void str(char *s);
+void test03(void);
+void put_file_in_dir(char *dirname, int mode);
+void init_array(char *a);
+void clear_array(char *b);
+int comp_array(char *a, char *b, int range);
+void try_close(int filedes, char *name);
+void try_unlink(char *fname);
+void Remove(int fdes, char *fname);
+int get_mode(char *name);
+void check(char *scall, int number);
+void put(int nr);
+int open_alot(void);
+int close_alot(int number);
+void clean_up_the_mess(void);
+void chmod_8_dirs(int sw);
+void quit(void);
/*****************************************************************************
* TEST *
#include "common.c"
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void test, (void));
-_PROTOTYPE(void test01, (void));
-_PROTOTYPE(void test02, (void));
-_PROTOTYPE(void test03, (void));
-_PROTOTYPE(void write_standards, (int filedes, char a []));
-_PROTOTYPE(void test04, (void));
-_PROTOTYPE(void read_standards, (int filedes, char a []));
-_PROTOTYPE(void read_more, (int filedes, char a []));
-_PROTOTYPE(void test05, (void));
-_PROTOTYPE(void try_open, (char *fname, int mode, int test));
-_PROTOTYPE(void test06, (void));
-_PROTOTYPE(void test07, (void));
-_PROTOTYPE(void access_standards, (void));
-_PROTOTYPE(void test08, (void));
-_PROTOTYPE(static int iovec_is_equal,
- (struct iovec *x, struct iovec *y, size_t size));
-_PROTOTYPE(static size_t iovec_setup,
- (int pattern, struct iovec *iovec, char *buffer, int count));
-_PROTOTYPE(static int power, (int base, int exponent));
-_PROTOTYPE(void try_access, (char *fname, int mode, int test));
-_PROTOTYPE(void make_and_fill_dirs, (void));
-_PROTOTYPE(void put_file_in_dir, (char *dirname, int mode));
-_PROTOTYPE(void init_array, (char *a));
-_PROTOTYPE(void clear_array, (char *b));
-_PROTOTYPE(int comp_array, (char *a, char *b, int range));
-_PROTOTYPE(void try_close, (int filedes, char *name));
-_PROTOTYPE(void try_unlink, (char *fname));
-_PROTOTYPE(void Remove, (int fdes, char *fname));
-_PROTOTYPE(int get_mode, (char *name));
-_PROTOTYPE(void check, (char *scall, int number));
-_PROTOTYPE(void put, (int nr));
-_PROTOTYPE(int open_alot, (void));
-_PROTOTYPE(int close_alot, (int number));
-_PROTOTYPE(void clean_up_the_mess, (void));
-_PROTOTYPE(void chmod_8_dirs, (int sw));
+int main(int argc, char **argv);
+void test(void);
+void test01(void);
+void test02(void);
+void test03(void);
+void write_standards(int filedes, char a []);
+void test04(void);
+void read_standards(int filedes, char a []);
+void read_more(int filedes, char a []);
+void test05(void);
+void try_open(char *fname, int mode, int test);
+void test06(void);
+void test07(void);
+void access_standards(void);
+void test08(void);
+static int iovec_is_equal(struct iovec *x, struct iovec *y, size_t
+ size);
+static size_t iovec_setup(int pattern, struct iovec *iovec, char
+ *buffer, int count);
+static int power(int base, int exponent);
+void try_access(char *fname, int mode, int test);
+void make_and_fill_dirs(void);
+void put_file_in_dir(char *dirname, int mode);
+void init_array(char *a);
+void clear_array(char *b);
+int comp_array(char *a, char *b, int range);
+void try_close(int filedes, char *name);
+void try_unlink(char *fname);
+void Remove(int fdes, char *fname);
+int get_mode(char *name);
+void check(char *scall, int number);
+void put(int nr);
+int open_alot(void);
+int close_alot(int number);
+void clean_up_the_mess(void);
+void chmod_8_dirs(int sw);
/*****************************************************************************
* TEST *
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(void test19a, (void));
-_PROTOTYPE(void test19b, (void));
-_PROTOTYPE(void test19c, (void));
-_PROTOTYPE(void test19d, (void));
-_PROTOTYPE(void test19e, (void));
-_PROTOTYPE(void test19f, (void));
-_PROTOTYPE(void test19g, (void));
-_PROTOTYPE(void clraa, (void));
-_PROTOTYPE(void pipecatcher, (int s));
+int main(int argc, char *argv[]);
+void test19a(void);
+void test19b(void);
+void test19c(void);
+void test19d(void);
+void test19e(void);
+void test19f(void);
+void test19g(void);
+void clraa(void);
+void pipecatcher(int s);
int main(argc, argv)
int argc;
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test2a, (void));
-_PROTOTYPE(void test2b, (void));
-_PROTOTYPE(void test2c, (void));
-_PROTOTYPE(void test2d, (void));
-_PROTOTYPE(void test2e, (void));
-_PROTOTYPE(void test2f, (void));
-_PROTOTYPE(void test2g, (void));
-_PROTOTYPE(void sigpip, (int s));
+int main(int argc, char *argv []);
+void test2a(void);
+void test2b(void);
+void test2c(void);
+void test2d(void);
+void test2e(void);
+void test2f(void);
+void test2g(void);
+void sigpip(int s);
int main(argc, argv)
int argc;
int superuser;
-_PROTOTYPE(void test20a, (void));
-_PROTOTYPE(void test20b, (void));
-_PROTOTYPE(void test20c, (void));
-_PROTOTYPE(void test20d, (void));
-_PROTOTYPE(int do_check, (void));
+void test20a(void);
+void test20b(void);
+void test20c(void);
+void test20d(void);
+int do_check(void);
char executable[1024];
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test21a, (void));
-_PROTOTYPE(void test21b, (void));
-_PROTOTYPE(void test21c, (void));
-_PROTOTYPE(void test21d, (void));
-_PROTOTYPE(void test21e, (void));
-_PROTOTYPE(void test21f, (void));
-_PROTOTYPE(void test21g, (void));
-_PROTOTYPE(void test21h, (void));
-_PROTOTYPE(void test21i, (void));
-_PROTOTYPE(void test21k, (void));
-_PROTOTYPE(void test21l, (void));
-_PROTOTYPE(void test21m, (void));
-_PROTOTYPE(void test21n, (void));
-_PROTOTYPE(void test21o, (void));
-_PROTOTYPE(int get_link, (char *name));
+int main(int argc, char *argv []);
+void test21a(void);
+void test21b(void);
+void test21c(void);
+void test21d(void);
+void test21e(void);
+void test21f(void);
+void test21g(void);
+void test21h(void);
+void test21i(void);
+void test21k(void);
+void test21l(void);
+void test21m(void);
+void test21n(void);
+void test21o(void);
+int get_link(char *name);
int main(argc, argv)
int argc;
#include "common.c"
-_PROTOTYPE(void test22a, (void));
-_PROTOTYPE(int mode, (char *filename));
-_PROTOTYPE(int umode, (char *filename));
-_PROTOTYPE(void e, (int number));
-_PROTOTYPE(void quit, (void));
+void test22a(void);
+int mode(char *filename);
+int umode(char *filename);
+void e(int number);
+void quit(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test23a, (void));
-_PROTOTYPE(void test23b, (void));
-_PROTOTYPE(void test23c, (void));
-_PROTOTYPE(void makelongnames, (void)); /* Fill MaxName etc. */
+void test23a(void);
+void test23b(void);
+void test23c(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
#include <time.h>
#include <stdio.h>
-_PROTOTYPE(void chk_dir, (DIR * dirpntr));
-_PROTOTYPE(void test24a, (void));
-_PROTOTYPE(void test24b, (void));
-_PROTOTYPE(void test24c, (void));
-_PROTOTYPE(void makelongnames, (void));
+void chk_dir(DIR * dirpntr);
+void test24a(void);
+void test24b(void);
+void test24c(void);
+void makelongnames(void);
#define OVERFLOW_DIR_NR (OPEN_MAX + 1)
#define MAX_ERROR 4
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test25a, (void));
-_PROTOTYPE(void test25b, (void));
-_PROTOTYPE(void test25c, (void));
-_PROTOTYPE(void test25d, (void));
-_PROTOTYPE(void test25e, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test25a(void);
+void test25b(void);
+void test25c(void);
+void test25d(void);
+void test25e(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
#include "common.c"
-_PROTOTYPE(void test26a, (void));
-_PROTOTYPE(void test26b, (void));
-_PROTOTYPE(void test26c, (void));
+void test26a(void);
+void test26b(void);
+void test26c(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1];
-_PROTOTYPE(void test27a, (void));
-_PROTOTYPE(void test27b, (void));
-_PROTOTYPE(void test27c, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test27a(void);
+void test27b(void);
+void test27c(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1];
-_PROTOTYPE(void test28a, (void));
-_PROTOTYPE(void test28c, (void));
-_PROTOTYPE(void test28b, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test28a(void);
+void test28c(void);
+void test28b(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
int superuser;
-_PROTOTYPE(void test29a, (void));
-_PROTOTYPE(void test29b, (void));
-_PROTOTYPE(void test29c, (void));
+void test29a(void);
+void test29b(void);
+void test29c(void);
int main(int argc, char *argv[])
{
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test3a, (void));
-_PROTOTYPE(void test3c, (void));
-_PROTOTYPE(void test3d, (void));
-_PROTOTYPE(void test3e, (void));
-_PROTOTYPE(void e, (int n));
+int main(int argc, char *argv []);
+void test3a(void);
+void test3c(void);
+void test3d(void);
+void test3e(void);
+void e(int n);
int main(argc, argv)
int argc;
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test30a, (void));
-_PROTOTYPE(void test30b, (void));
-_PROTOTYPE(void test30c, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test30a(void);
+void test30b(void);
+void test30c(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test31a, (void));
-_PROTOTYPE(void test31b, (void));
-_PROTOTYPE(void test31c, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test31a(void);
+void test31b(void);
+void test31c(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test32a, (void));
-_PROTOTYPE(void test32b, (void));
-_PROTOTYPE(void test32c, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test32a(void);
+void test32b(void);
+void test32c(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
char *ToLongName; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test33a, (void));
-_PROTOTYPE(void test33b, (void));
-_PROTOTYPE(void test33c, (void));
-_PROTOTYPE(void test33d, (void));
-_PROTOTYPE(void test_access, (void));
-_PROTOTYPE(void makelongnames, (void));
+void test33a(void);
+void test33b(void);
+void test33c(void);
+void test33d(void);
+void test_access(void);
+void makelongnames(void);
int main(int argc, char *argv[])
{
char *NameTooLong; /* Name of maximum +1 length */
char PathTooLong[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test34a, (void));
-_PROTOTYPE(void test34b, (void));
-_PROTOTYPE(void test34c, (void));
-_PROTOTYPE(mode_t mode, (char *file_name));
-_PROTOTYPE(void makelongnames, (void));
-_PROTOTYPE(void getids, (uid_t * uid, gid_t * gid));
+void test34a(void);
+void test34b(void);
+void test34c(void);
+mode_t mode(char *file_name);
+void makelongnames(void);
+void getids(uid_t * uid, gid_t * gid);
int main(int argc, char *argv[])
{
char *NameTooLong; /* Name of maximum +1 length */
char PathTooLong[PATH_MAX + 1]; /* Same for path, both too long */
-_PROTOTYPE(void test35a, (void));
-_PROTOTYPE(void test35b, (void));
-_PROTOTYPE(void test35c, (void));
-_PROTOTYPE(void makelongnames, (void));
-_PROTOTYPE(void getids, (uid_t * uid, gid_t * gid));
+void test35a(void);
+void test35b(void);
+void test35c(void);
+void makelongnames(void);
+void getids(uid_t * uid, gid_t * gid);
int main(int argc, char *argv[])
{
int superuser;
-_PROTOTYPE(void test36a, (void));
-_PROTOTYPE(void test36b, (void));
-_PROTOTYPE(void test36c, (void));
-_PROTOTYPE(void test36d, (void));
-_PROTOTYPE(int not_provided_option, (int _option));
-_PROTOTYPE(int provided_option, (int _option, int _minimum_value));
-_PROTOTYPE(int variating_option, (int _option, int _minimum_value));
+void test36a(void);
+void test36b(void);
+void test36c(void);
+void test36d(void);
+int not_provided_option(int _option);
+int provided_option(int _option, int _minimum_value);
+int variating_option(int _option, int _minimum_value);
char *testdirs[] = {
"/",
SIGTERM};
/* Prototypes produced automatically by mkptypes. */
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test37a, (void));
-_PROTOTYPE(void func1, (int sig));
-_PROTOTYPE(void func2, (int sig));
-_PROTOTYPE(void test37b, (void));
-_PROTOTYPE(void catch1, (int signo));
-_PROTOTYPE(void catch2, (int signo));
-_PROTOTYPE(void test37c, (void));
-_PROTOTYPE(void catch3, (int signo));
-_PROTOTYPE(void test37d, (void));
-_PROTOTYPE(void catch4, (int signo));
-_PROTOTYPE(void test37e, (void));
-_PROTOTYPE(void catch5, (int signo));
-_PROTOTYPE(void test37f, (void));
-_PROTOTYPE(void sigint_handler, (int signo));
-_PROTOTYPE(void sigpipe_handler, (int signo));
-_PROTOTYPE(void test37g, (void));
-_PROTOTYPE(void sighup8, (int signo));
-_PROTOTYPE(void sigpip8, (int signo));
-_PROTOTYPE(void sigter8, (int signo));
-_PROTOTYPE(void test37h, (void));
-_PROTOTYPE(void sighup9, (int signo));
-_PROTOTYPE(void sigter9, (int signo));
-_PROTOTYPE(void test37i, (void));
-_PROTOTYPE(void sighup10, (int signo));
-_PROTOTYPE(void sigalrm_handler10, (int signo));
-_PROTOTYPE(void test37j, (void));
-_PROTOTYPE(void test37k, (void));
-_PROTOTYPE(void test37l, (void));
-_PROTOTYPE(void func_m1, (void));
-_PROTOTYPE(void func_m2, (void));
-_PROTOTYPE(void test37m, (void));
-_PROTOTYPE(void test37p, (void));
-_PROTOTYPE(void test37q, (void));
-_PROTOTYPE(void longjerr, (void));
-_PROTOTYPE(void catch14, (int signo, int code, struct sigcontext * scp));
-_PROTOTYPE(void test37n, (void));
-_PROTOTYPE(void catch15, (int signo));
-_PROTOTYPE(void test37o, (void));
-_PROTOTYPE(void clearsigstate, (void));
-_PROTOTYPE(void wait_for, (int pid));
+int main(int argc, char *argv []);
+void test37a(void);
+void func1(int sig);
+void func2(int sig);
+void test37b(void);
+void catch1(int signo);
+void catch2(int signo);
+void test37c(void);
+void catch3(int signo);
+void test37d(void);
+void catch4(int signo);
+void test37e(void);
+void catch5(int signo);
+void test37f(void);
+void sigint_handler(int signo);
+void sigpipe_handler(int signo);
+void test37g(void);
+void sighup8(int signo);
+void sigpip8(int signo);
+void sigter8(int signo);
+void test37h(void);
+void sighup9(int signo);
+void sigter9(int signo);
+void test37i(void);
+void sighup10(int signo);
+void sigalrm_handler10(int signo);
+void test37j(void);
+void test37k(void);
+void test37l(void);
+void func_m1(void);
+void func_m2(void);
+void test37m(void);
+void test37p(void);
+void test37q(void);
+void longjerr(void);
+void catch14(int signo, int code, struct sigcontext * scp);
+void test37n(void);
+void catch15(int signo);
+void test37o(void);
+void clearsigstate(void);
+void wait_for(int pid);
int main(argc, argv)
int argc;
void test37n()
{
struct sigaction act;
- typedef _PROTOTYPE( void (*sighandler_t), (int sig) );
+ typedef void(*sighandler_t) (int sig);
subtest = 14;
clearsigstate();
int superuser;
int signumber = 0;
-_PROTOTYPE(void test38a, (void));
-_PROTOTYPE(void test38b, (void));
-_PROTOTYPE(void test38c, (void));
-_PROTOTYPE(void setsignumber, (int _signumber));
+void test38a(void);
+void test38b(void);
+void test38c(void);
+void setsignumber(int _signumber);
int main(int argc, char *argv[])
{
#define MAX_ERROR 1
#include "common.c"
-_PROTOTYPE( void test39a, (void) );
+void test39a(void);
int main(int argc, char *argv[])
{
#include "common.c"
-_PROTOTYPE(int main, (void));
-_PROTOTYPE(void subr, (void));
-_PROTOTYPE(void nofork, (void));
-_PROTOTYPE(void quit, (void));
+int main(void);
+void subr(void);
+void nofork(void);
+void quit(void);
int main()
{
UPPERUSEC(vu))) && \
(it).it_interval.tv_sec == (is) && EQUSEC((it).it_interval.tv_usec,iu))
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void test, (int m, int t));
-_PROTOTYPE(void test_which, (void));
-_PROTOTYPE(void test_getset, (void));
-_PROTOTYPE(void test_neglarge, (void));
-_PROTOTYPE(void test_zero, (void));
-_PROTOTYPE(void test_timer, (void));
-_PROTOTYPE(void test_alarm, (void));
-_PROTOTYPE(void test_fork, (void));
-_PROTOTYPE(void test_exec, (void));
-_PROTOTYPE(int do_check, (void));
-_PROTOTYPE(void got_alarm, (int sig));
-_PROTOTYPE(void busy_wait, (int secs));
-_PROTOTYPE(void my_e, (int n));
+int main(int argc, char **argv);
+void test(int m, int t);
+void test_which(void);
+void test_getset(void);
+void test_neglarge(void);
+void test_zero(void);
+void test_timer(void);
+void test_alarm(void);
+void test_fork(void);
+void test_exec(void);
+int do_check(void);
+void got_alarm(int sig);
+void busy_wait(int secs);
+void my_e(int n);
static char *executable;
static int signals;
#define timed_test(func) (timed_test_func(#func, func));
-_PROTOTYPE(int main, (int argc, char **argv));
-_PROTOTYPE(void test, (int m, int a));
-_PROTOTYPE(void timed_test_func, (const char *s, void (* func)(void)));
-_PROTOTYPE(void timed_test_timeout, (int signum));
-_PROTOTYPE(pid_t traced_fork, (_PROTOTYPE(void (*c), (void))));
-_PROTOTYPE(pid_t traced_pfork, (_PROTOTYPE(void (*c), (void))));
-_PROTOTYPE(void WRITE, (int value));
-_PROTOTYPE(int READ, (void));
-_PROTOTYPE(void traced_wait, (void));
-_PROTOTYPE(void detach_running, (pid_t pid));
-_PROTOTYPE(void dummy_handler, (int sig));
-_PROTOTYPE(void exit_handler, (int sig));
-_PROTOTYPE(void count_handler, (int sig));
-_PROTOTYPE(void catch_handler, (int sig));
-_PROTOTYPE(void test_wait_child, (void));
-_PROTOTYPE(void test_wait, (void));
-_PROTOTYPE(void test_exec_child, (void));
-_PROTOTYPE(void test_exec, (void));
-_PROTOTYPE(void test_step_child, (void));
-_PROTOTYPE(void test_step, (void));
-_PROTOTYPE(void test_sig_child, (void));
-_PROTOTYPE(void test_sig, (void));
-_PROTOTYPE(void test_exit_child, (void));
-_PROTOTYPE(void test_exit, (void));
-_PROTOTYPE(void test_term_child, (void));
-_PROTOTYPE(void test_term, (void));
-_PROTOTYPE(void test_catch_child, (void));
-_PROTOTYPE(void test_catch, (void));
-_PROTOTYPE(void test_kill_child, (void));
-_PROTOTYPE(void test_kill, (void));
-_PROTOTYPE(void test_attach_child, (void));
-_PROTOTYPE(void test_attach, (void));
-_PROTOTYPE(void test_detach_child, (void));
-_PROTOTYPE(void test_detach, (void));
-_PROTOTYPE(void test_death_child, (void));
-_PROTOTYPE(void test_death, (void));
-_PROTOTYPE(void test_zdeath_child, (void));
-_PROTOTYPE(void test_zdeath, (void));
-_PROTOTYPE(void test_syscall_child, (void));
-_PROTOTYPE(void test_syscall, (void));
-_PROTOTYPE(void test_tracefork_child, (void));
-_PROTOTYPE(void test_tracefork, (void));
-_PROTOTYPE(void sigexec, (int setflag, int opt, int *traps, int *stop));
-_PROTOTYPE(void test_trapexec, (void));
-_PROTOTYPE(void test_altexec, (void));
-_PROTOTYPE(void test_noexec, (void));
-_PROTOTYPE(void test_defexec, (void));
-_PROTOTYPE(void test_reattach_child, (void));
-_PROTOTYPE(void test_reattach, (void));
-_PROTOTYPE(void my_e, (int n));
+int main(int argc, char **argv);
+void test(int m, int a);
+void timed_test_func(const char *s, void (* func)(void));
+void timed_test_timeout(int signum);
+pid_t traced_fork(void (*c) (void));
+pid_t traced_pfork(void (*c) (void));
+void WRITE(int value);
+int READ(void);
+void traced_wait(void);
+void detach_running(pid_t pid);
+void dummy_handler(int sig);
+void exit_handler(int sig);
+void count_handler(int sig);
+void catch_handler(int sig);
+void test_wait_child(void);
+void test_wait(void);
+void test_exec_child(void);
+void test_exec(void);
+void test_step_child(void);
+void test_step(void);
+void test_sig_child(void);
+void test_sig(void);
+void test_exit_child(void);
+void test_exit(void);
+void test_term_child(void);
+void test_term(void);
+void test_catch_child(void);
+void test_catch(void);
+void test_kill_child(void);
+void test_kill(void);
+void test_attach_child(void);
+void test_attach(void);
+void test_detach_child(void);
+void test_detach(void);
+void test_death_child(void);
+void test_death(void);
+void test_zdeath_child(void);
+void test_zdeath(void);
+void test_syscall_child(void);
+void test_syscall(void);
+void test_tracefork_child(void);
+void test_tracefork(void);
+void sigexec(int setflag, int opt, int *traps, int *stop);
+void test_trapexec(void);
+void test_altexec(void);
+void test_noexec(void);
+void test_defexec(void);
+void test_reattach_child(void);
+void test_reattach(void);
+void my_e(int n);
static char *executable;
static int child = 0, attach;
}
pid_t traced_fork(c)
-_PROTOTYPE(void (*c), (void));
+void(*c) (void);
{
pid_t pid;
int r, status;
}
pid_t traced_pfork(c)
-_PROTOTYPE(void (*c), (void));
+void(*c) (void);
{
pid_t pid;
#include <sys/stat.h>
#include <fcntl.h>
-_PROTOTYPE( void api_test, (void) );
-_PROTOTYPE( void e, (int error_no) );
-_PROTOTYPE( void group_test, (void) );
-_PROTOTYPE( void limit_test, (void) );
-_PROTOTYPE( void group_test_1, (void) );
-_PROTOTYPE( void group_test_2, (void) );
-_PROTOTYPE( void group_test_3, (void) );
-_PROTOTYPE( void group_test_4, (void) );
-_PROTOTYPE( void group_test_5, (void) );
-_PROTOTYPE( int dotest, (void (*testfunc)(void)) );
+void api_test(void);
+void e(int error_no);
+void group_test(void);
+void limit_test(void);
+void group_test_1(void);
+void group_test_2(void);
+void group_test_3(void);
+void group_test_4(void);
+void group_test_5(void);
+int dotest(void (*testfunc)(void));
#define MAX_ERROR 5
#define IMAGINARY_GID 100
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(void test5a, (void));
-_PROTOTYPE(void parent, (int childpid));
-_PROTOTYPE(void child, (int parpid));
-_PROTOTYPE(void func1, (int s));
-_PROTOTYPE(void func8, (int s));
-_PROTOTYPE(void func10, (int s));
-_PROTOTYPE(void func11, (int s));
-_PROTOTYPE(void test5b, (void));
-_PROTOTYPE(void test5c, (void));
-_PROTOTYPE(void test5d, (void));
-_PROTOTYPE(void test5e, (void));
-_PROTOTYPE(void test5f, (void));
-_PROTOTYPE(void test5g, (void));
-_PROTOTYPE(void funcalrm, (int s));
-_PROTOTYPE(void test5h, (void));
-_PROTOTYPE(void test5i, (void));
-_PROTOTYPE(void ex, (void));
+int main(int argc, char *argv[]);
+void test5a(void);
+void parent(int childpid);
+void child(int parpid);
+void func1(int s);
+void func8(int s);
+void func10(int s);
+void func11(int s);
+void test5b(void);
+void test5c(void);
+void test5d(void);
+void test5e(void);
+void test5f(void);
+void test5g(void);
+void funcalrm(int s);
+void test5h(void);
+void test5i(void);
+void ex(void);
_VOLATILE int childsigs, parsigs, alarms;
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv[]));
-_PROTOTYPE(void prepare, (void));
-_PROTOTYPE(int make_file, (off_t size));
-_PROTOTYPE(void check_file, (int fd, off_t size, off_t hole_start,
- off_t hole_end));
-_PROTOTYPE(void all_sizes,
- (_PROTOTYPE(void (*call), (off_t osize, off_t nsize))));
-_PROTOTYPE(void test50a, (void));
-_PROTOTYPE(void test50b, (void));
-_PROTOTYPE(void test50c, (void));
-_PROTOTYPE(void test50d, (void));
-_PROTOTYPE(void sub50e, (off_t osize, off_t nsize));
-_PROTOTYPE(void test50e, (void));
-_PROTOTYPE(void sub50f, (off_t osize, off_t nsize));
-_PROTOTYPE(void test50f, (void));
-_PROTOTYPE(void sub50g, (off_t osize, off_t nsize));
-_PROTOTYPE(void test50g, (void));
-_PROTOTYPE(void sub50h, (off_t osize, off_t nsize));
-_PROTOTYPE(void test50h, (void));
-_PROTOTYPE(void sub50i, (off_t size, off_t off, size_t len, int type));
-_PROTOTYPE(void test50i, (void));
+int main(int argc, char *argv[]);
+void prepare(void);
+int make_file(off_t size);
+void check_file(int fd, off_t size, off_t hole_start, off_t hole_end);
+void all_sizes(void (*call) (off_t osize, off_t nsize));
+void test50a(void);
+void test50b(void);
+void test50c(void);
+void test50d(void);
+void sub50e(off_t osize, off_t nsize);
+void test50e(void);
+void sub50f(off_t osize, off_t nsize);
+void test50f(void);
+void sub50g(off_t osize, off_t nsize);
+void test50g(void);
+void sub50h(off_t osize, off_t nsize);
+void test50h(void);
+void sub50i(off_t size, off_t off, size_t len, int type);
+void test50i(void);
/* Some of the sizes have been chosen in such a way that they should be on the
* edge of direct/single indirect/double indirect switchovers for a MINIX
}
void all_sizes(call)
-_PROTOTYPE(void (*call), (off_t osize, off_t nsize));
+void(*call) (off_t osize, off_t nsize);
{
int i, j;
#include <sys/signal.h>
-_PROTOTYPE( void do_calcs, (void) );
-_PROTOTYPE( void do_child, (void) );
-_PROTOTYPE( void do_parent, (void) );
-_PROTOTYPE( void err, (int subtest, int error_no) );
-_PROTOTYPE( void func1, (int a, int b, int c, int d, int e, int f, int g,
- int h, int i, int j, int k, int l, int m, int n,
- int o, int p, int q, int r, int s, int t, int u,
- int v, int w, int x, int y, int z, int aa, int bb));
-_PROTOTYPE( void func2, (void) );
-_PROTOTYPE( void just_exit, (void) );
-_PROTOTYPE( void test_brk, (void) );
-_PROTOTYPE( void verify_main_reenter, (void) );
+void do_calcs(void);
+void do_child(void);
+void do_parent(void);
+void err(int subtest, int error_no);
+void func1(int a, int b, int c, int d, int e, int f, int g, int h, int
+ i, int j, int k, int l, int m, int n, int o, int p, int q, int r, int s,
+ int t, int u, int v, int w, int x, int y, int z, int aa, int bb);
+void func2(void);
+void just_exit(void);
+void test_brk(void);
+void verify_main_reenter(void);
#define MAX_ERROR 5
#define SSIZE 32768
#define TEST_PATH "a/b/c"
#define INTEGR_MSG "You might want to check fs integrity\n"
-_PROTOTYPE( void do_test, (void) );
+void do_test(void);
void do_test(void)
{
#define MEG 1024*1024
#define MAGIC ((signed) 0xb4a3f1c2)
-FORWARD _PROTOTYPE( void destr_a, (void *arg) );
-FORWARD _PROTOTYPE( void destr_b, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_a, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_b, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_c, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_d, (void *arg) );
-FORWARD _PROTOTYPE( void thread_e, (void) );
-FORWARD _PROTOTYPE( void *thread_f, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_g, (void *arg) );
-FORWARD _PROTOTYPE( void *thread_h, (void *arg) );
-FORWARD _PROTOTYPE( void test_scheduling, (void) );
-FORWARD _PROTOTYPE( void test_mutex, (void) );
-FORWARD _PROTOTYPE( void test_condition, (void) );
-FORWARD _PROTOTYPE( void test_attributes, (void) );
-FORWARD _PROTOTYPE( void test_keys, (void) );
-FORWARD _PROTOTYPE( void err, (int subtest, int error) );
+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);
/*===========================================================================*
* thread_a *
#include "common.c"
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test6a, (void));
-_PROTOTYPE(void test6b, (void));
+int main(int argc, char *argv []);
+void test6a(void);
+void test6b(void);
int main(argc, argv)
int argc;
#define timed_test(func) (timed_test_func(#func, func));
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void timed_test_func, (const char *s, void (* func)(void)));
-_PROTOTYPE(void timed_test_timeout, (int signum));
-_PROTOTYPE(void test7a, (void));
-_PROTOTYPE(void test7b, (void));
-_PROTOTYPE(void test7c, (void));
-_PROTOTYPE(void test7d, (void));
-_PROTOTYPE(void test7e, (void));
-_PROTOTYPE(void test7f, (void));
-_PROTOTYPE(void test7g, (void));
-_PROTOTYPE(void test7h, (void));
-_PROTOTYPE(void test7i, (void));
-_PROTOTYPE(void test7j, (void));
-_PROTOTYPE(void cloexec_test, (void));
-_PROTOTYPE(int set, (int how, int first, int last));
-_PROTOTYPE(int locked, (int b));
-_PROTOTYPE(void sigfunc, (int s));
+int main(int argc, char *argv []);
+void timed_test_func(const char *s, void (* func)(void));
+void timed_test_timeout(int signum);
+void test7a(void);
+void test7b(void);
+void test7c(void);
+void test7d(void);
+void test7e(void);
+void test7f(void);
+void test7g(void);
+void test7h(void);
+void test7i(void);
+void test7j(void);
+void cloexec_test(void);
+int set(int how, int first, int last);
+int locked(int b);
+void sigfunc(int s);
int main(argc, argv)
int argc;
int subtest;
-_PROTOTYPE(void test8a, (void));
-_PROTOTYPE(void test8b, (void));
+void test8a(void);
+void test8b(void);
int main(int argc, char *argv[])
{
char *tmpa;
-_PROTOTYPE(int main, (int argc, char *argv []));
-_PROTOTYPE(void test9a, (void));
-_PROTOTYPE(void test9b, (void));
-_PROTOTYPE(void test9c, (void));
-_PROTOTYPE(void test9d, (void));
-_PROTOTYPE(void test9e, (void));
-_PROTOTYPE(void test9f, (void));
-_PROTOTYPE(char *addr, (void));
-_PROTOTYPE(void garbage, (void));
-_PROTOTYPE(void level1, (void));
-_PROTOTYPE(void level2, (void));
-_PROTOTYPE(void dolev, (void));
-_PROTOTYPE(void catch, (int s));
-_PROTOTYPE(void hard, (void));
+int main(int argc, char *argv []);
+void test9a(void);
+void test9b(void);
+void test9c(void);
+void test9d(void);
+void test9e(void);
+void test9f(void);
+char *addr(void);
+void garbage(void);
+void level1(void);
+void level2(void);
+void dolev(void);
+void catch(int s);
+void hard(void);
int main(argc, argv)
int argc;