CVS commit: othersrc/external/historical/eawk
Module Name:othersrc Committed By: agc Date: Wed Aug 31 04:19:41 UTC 2011 Update of /cvsroot/othersrc/external/historical/eawk In directory ivanova.netbsd.org:/tmp/cvs-serv23294 Log Message: Embedded Awk This is a heresy I have done, of my own free will and volition, and which I now know as being a sin. Firstly, I have butchered the one true awk source code, made it re-entrant and embeddable in C programs, and now present it as a library (libeawk) and a small driver program (eawk). The driver program now uses getopt_long, and gives a good idea of how to use eawk in embedded code. Furthermore, I have "added" to the one true language. The additions are 4 functions: dlopen(handle, shared object name) dlproto(handle, C function prototype as a string) dlcall(handle, function, function args...) dlclose(handle) which allows you to do such abominations as: dlopen(libc, "libc"); dlproto(libc, "long write(int, awkptr, long)") dlcall(libc, "write", 1, "hi\n", 3) dlclose(libc) (i.e. allows interfacing to shared libraries and shared objects without any C glue or other shim in between the scripting language and the compiled library). Please note that you can specify the prototype at the same time as the foreign function call, with dlcall: dlopen(libc, "libc"); dlcall(libc, "long write(int, awkptr, long)", 1, "hi\n", 3) and then: % eawk 'BEGIN { dlopen(libc, "libc"); dlcall(libc, "int printf(awkptr)", "Hello world\n") }' /dev/null Hello world % In fact, the following scripts are all equivalent: % eawk 'BEGIN { dlopen(libc, "libc"); dlcall(libc, "long write(int, awkptr, long)", 1, "Hello world\n", 12) }' /dev/null Hello world % eawk 'BEGIN { dlopen(libc, "libc"); dlcall(libc, "int printf(awkptr)", "Hello world\n") }' /dev/null Hello world % eawk 'BEGIN { dlopen(libc, "libc"); dlcall(libc, "int fprintf(cvar, awkptr)", "stdout", "Hello world\n") }' /dev/null Hello world The type of arguments, and the return type, given in the dlproto() calls is important: awkptr - a string as passed from the eawk script cptr - a pointer to an object in the compiled shared object cref - the address of a pointer to an object in the compiled shared object. this is used to map the construct: &cp into an awk string cvar - the awk string which maps to a compiled well-known variable in the compiled shared object, typically stdin, stdout and stderr void - no return type bool - the boolean type int - standard integer type on this machine long - native long on this machine int64 - 64-bit data type In order to support foreign functions which typically use a structure passed into every function as a handle (very much like the eawk implementation here), I'd also added two other functions which can be called from scripts: buf = dlalloc(size) dlfree(buf) and also a new prototype keyword called "cptr" - this is functionally equivalent to long, but more intuitively obvious that the argument should be pre-allocated storage (at the native layer). % eawk 'BEGIN { dlopen(libc, "libc") size = 1024 buf = dlalloc(size) dlcall(libc, "int snprintf(cptr, int, awkptr, int)", buf, size, "allocated size is %d\n", size) dlcall(libc, "int printf(cptr)", buf) dlfree(buf) }' /dev/null allocated size is 1024 % Finally, we need a way to get information back from C structures and storage into an awk script, and we do that with the var = dlfield(storage, offset, type) function. This can be used as follows: % eawk 'BEGIN { dlopen(libc, "libc") st = dlalloc(1024) dlcall(libc, "int stat(awkptr, cptr)", "/etc/group", st) mode = dlfield(st, 8, "int16") printf("%s mode is %o\n", "/etc/group", mode) dlfree(st) }' /dev/null mode is 100644 % To illustrate some of the dlcall features a bit further, this script will print out the keys in the user's keyring, by direct calling of exported frunctionality from libnetpgp: % eawk ' BEGIN { dlopen(libc, "libc") dlopen(libnetpgp, "libnetpgp") netpgp = dlalloc(2048) ret = dlcall(libnetpgp, "int netpgp_set_homedir(cptr, awkptr, awkptr, int)", netpgp, ENVIRON["HOME"], "/.gnupg", quiet = 1) ret = dlcall(libnetpgp, "int netpgp_init(cptr)", netpgp) } END { ret = dlcall(libnetpgp, "int netpgp_list_keys_json(cptr, cref, int)", netpgp, json, psigs = 0) ret = dlcall(libnetpgp, "int netpgp_format_json(cvar, cptr, int)", "stdout", json, psigs = 0) }' /dev/null 126 keys found signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12 Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 uid Alistair Crooks uid Alistair Crooks uid
CVS commit: src/usr.bin/crunch/crunchide
Module Name:src Committed By: joerg Date: Tue Aug 30 23:15:14 UTC 2011 Modified Files: src/usr.bin/crunch/crunchide: crunchide.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/crunch/crunchide/crunchide.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/crunch/crunchide/crunchide.c diff -u src/usr.bin/crunch/crunchide/crunchide.c:1.13 src/usr.bin/crunch/crunchide/crunchide.c:1.14 --- src/usr.bin/crunch/crunchide/crunchide.c:1.13 Thu Aug 20 17:39:51 2009 +++ src/usr.bin/crunch/crunchide/crunchide.c Tue Aug 30 23:15:14 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crunchide.c,v 1.13 2009/08/20 17:39:51 he Exp $ */ +/* $NetBSD: crunchide.c,v 1.14 2011/08/30 23:15:14 joerg Exp $ */ /* * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved. @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: crunchide.c,v 1.13 2009/08/20 17:39:51 he Exp $"); +__RCSID("$NetBSD: crunchide.c,v 1.14 2011/08/30 23:15:14 joerg Exp $"); #endif #include @@ -77,14 +77,14 @@ #include "extern.h" -void usage(void); +__dead static void usage(void); -void add_to_keep_list(char *symbol); -void add_file_to_keep_list(char *filename); +static void add_to_keep_list(char *symbol); +static void add_file_to_keep_list(char *filename); -int hide_syms(const char *filename); +static int hide_syms(const char *filename); -int verbose; +static int verbose; int main(int argc, char *argv[]) @@ -124,7 +124,7 @@ return errors; } -void +static void usage(void) { fprintf(stderr, @@ -136,12 +136,12 @@ /* */ -struct keep { +static struct keep { struct keep *next; char *sym; } *keep_list; -void +static void add_to_keep_list(char *symbol) { struct keep *newp, *prevp, *curp; @@ -186,7 +186,7 @@ return curp && cmp == 0; } -void +static void add_file_to_keep_list(char *filename) { FILE *keepf; @@ -210,7 +210,7 @@ /* */ -struct { +static struct { const char *name; int (*check)(int, const char *); /* 1 if match, zero if not */ int (*hide)(int, const char *); /* non-zero if error */ @@ -232,7 +232,7 @@ #endif }; -int +static int hide_syms(const char *filename) { int fd, i, n, rv;
CVS commit: src/usr.bin/crunch/crunchgen
Module Name:src Committed By: joerg Date: Tue Aug 30 23:10:45 UTC 2011 Modified Files: src/usr.bin/crunch/crunchgen: crunchgen.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/usr.bin/crunch/crunchgen/crunchgen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/crunch/crunchgen/crunchgen.c diff -u src/usr.bin/crunch/crunchgen/crunchgen.c:1.79 src/usr.bin/crunch/crunchgen/crunchgen.c:1.80 --- src/usr.bin/crunch/crunchgen/crunchgen.c:1.79 Sun May 15 21:28:51 2011 +++ src/usr.bin/crunch/crunchgen/crunchgen.c Tue Aug 30 23:10:45 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crunchgen.c,v 1.79 2011/05/15 21:28:51 christos Exp $ */ +/* $NetBSD: crunchgen.c,v 1.80 2011/08/30 23:10:45 joerg Exp $ */ /* * Copyright (c) 1994 University of Maryland * All Rights Reserved. @@ -38,7 +38,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: crunchgen.c,v 1.79 2011/05/15 21:28:51 christos Exp $"); +__RCSID("$NetBSD: crunchgen.c,v 1.80 2011/08/30 23:10:45 joerg Exp $"); #endif #include @@ -83,45 +83,45 @@ /* global state */ -strlst_t *srcdirs = NULL; -strlst_t *libs= NULL; -strlst_t *vars = NULL; -prog_t *progs = NULL; - -char line[MAXLINELEN]; - -char confname[MAXPATHLEN], infilename[MAXPATHLEN]; -char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; -char cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; -char curdir[MAXPATHLEN]; -char topdir[MAXPATHLEN]; -char libdir[MAXPATHLEN] = "/usr/lib"; -char dbg[MAXPATHLEN] = "-Os"; -int linenum = -1; -int goterror = 0; - -const char *pname = "crunchgen"; - -int verbose, readcache, useobjs, oneobj; /* options */ -int reading_cache; -char *machine; -char *makeobjdirprefix; -char *makebin; -char *makeflags; +static strlst_t *srcdirs = NULL; +static strlst_t *libs= NULL; +static strlst_t *vars = NULL; +static prog_t *progs = NULL; + +static char line[MAXLINELEN]; + +static char confname[MAXPATHLEN], infilename[MAXPATHLEN]; +static char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; +static char cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; +static char curdir[MAXPATHLEN]; +static char topdir[MAXPATHLEN]; +static char libdir[MAXPATHLEN] = "/usr/lib"; +static char dbg[MAXPATHLEN] = "-Os"; +static int linenum = -1; +static int goterror = 0; + +static const char *pname = "crunchgen"; + +static int verbose, readcache, useobjs, oneobj; /* options */ +static int reading_cache; +static char *machine; +static char *makeobjdirprefix; +static char *makebin; +static char *makeflags; /* general library routines */ -void status(const char *str); -void out_of_memory(void); -void add_string(strlst_t **listp, char *str); -int is_dir(const char *pathname); -int is_nonempty_file(const char *pathname); +static void status(const char *str); +__dead static void out_of_memory(void); +static void add_string(strlst_t **listp, char *str); +static int is_dir(const char *pathname); +static int is_nonempty_file(const char *pathname); /* helper routines for main() */ -void usage(void); -void parse_conf_file(void); -void gen_outputs(void); +__dead static void usage(void); +static void parse_conf_file(void); +static void gen_outputs(void); extern char *crunched_skel[]; @@ -234,19 +234,19 @@ /* helper routines for parse_conf_file */ -void parse_one_file(char *filename); -void parse_line(char *line, int *fc, char **fv, int nf); -void add_srcdirs(int argc, char **argv); -void add_progs(int argc, char **argv); -void add_link(int argc, char **argv); -void add_libs(int argc, char **argv); -void add_special(int argc, char **argv); +static void parse_one_file(char *filename); +static void parse_line(char *line, int *fc, char **fv, int nf); +static void add_srcdirs(int argc, char **argv); +static void add_progs(int argc, char **argv); +static void add_link(int argc, char **argv); +static void add_libs(int argc, char **argv); +static void add_special(int argc, char **argv); -prog_t *find_prog(char *str); -void add_prog(char *progname); +static prog_t *find_prog(char *str); +static void add_prog(char *progname); -void +static void parse_conf_file(void) { if (!is_nonempty_file(infilename)) { @@ -262,7 +262,7 @@ } -void +static void parse_one_file(char *filename) { char *fieldv[MAXFIELDS]; @@ -315,7 +315,7 @@ } -void +static void parse_line(char *pline, int *fc, char **fv, int nf) { char *p; @@ -341,7 +341,7 @@ } -void +static void add_srcdirs(int argc, char **argv) { int i; @@ -369,7 +369,7 @@ } -void +static void add_progs(int argc, char **argv) { int i; @@ -379,7 +379,7 @@ } -void +static void add_prog(char *progname) { prog_t *p1, *p2; @@ -408,7 +408,7 @@ } -void +static void add_link(int argc, char **argv) { int i; @@ -426,7 +426,7 @@ } -void +static void
CVS commit: src/usr.bin/compress
Module Name:src Committed By: joerg Date: Tue Aug 30 23:08:05 UTC 2011 Modified Files: src/usr.bin/compress: compress.c Log Message: Use __printflike and __dead To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/usr.bin/compress/compress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/compress/compress.c diff -u src/usr.bin/compress/compress.c:1.25 src/usr.bin/compress/compress.c:1.26 --- src/usr.bin/compress/compress.c:1.25 Sat Apr 11 12:24:37 2009 +++ src/usr.bin/compress/compress.c Tue Aug 30 23:08:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compress.c,v 1.25 2009/04/11 12:24:37 lukem Exp $ */ +/* $NetBSD: compress.c,v 1.26 2011/08/30 23:08:05 joerg Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #else -__RCSID("$NetBSD: compress.c,v 1.25 2009/04/11 12:24:37 lukem Exp $"); +__RCSID("$NetBSD: compress.c,v 1.26 2011/08/30 23:08:05 joerg Exp $"); #endif #endif /* not lint */ @@ -55,19 +55,18 @@ #include #include -void compress(const char *, const char *, int); -void cwarn(const char *, ...) __attribute__((__format__(__printf__,1,2))); -void cwarnx(const char *, ...) __attribute__((__format__(__printf__,1,2))); -void decompress(const char *, const char *, int); -int permission(const char *); -void setfile(const char *, struct stat *); -void usage(int); +static void compress(const char *, const char *, int); +static void cwarn(const char *, ...) __printflike(1, 2); +static void cwarnx(const char *, ...) __printflike(1, 2); +static void decompress(const char *, const char *, int); +static int permission(const char *); +static void setfile(const char *, struct stat *); +__dead static void usage(int); -int main(int, char *[]); extern FILE *zopen(const char *fname, const char *mode, int bits); -int eval, force, verbose; -int isstdout, isstdin; +static int eval, force, verbose; +static int isstdout, isstdin; int main(int argc, char **argv) @@ -198,7 +197,7 @@ exit (eval); } -void +static void compress(const char *in, const char *out, int bits) { size_t nr; @@ -297,7 +296,7 @@ (void)fclose(ifp); } -void +static void decompress(const char *in, const char *out, int bits) { size_t nr; @@ -376,7 +375,7 @@ (void)fclose(ifp); } -void +static void setfile(const char *name, struct stat *fs) { static struct timeval tv[2]; @@ -411,7 +410,7 @@ cwarn("chflags: %s", name); } -int +static int permission(const char *fname) { int ch, first; @@ -425,7 +424,7 @@ return (first == 'y'); } -void +static void usage(int iscompress) { if (iscompress) @@ -437,7 +436,7 @@ exit(1); } -void +static void cwarnx(const char *fmt, ...) { va_list ap; @@ -448,7 +447,7 @@ eval = 1; } -void +static void cwarn(const char *fmt, ...) { va_list ap;
CVS commit: src/usr.bin/gzip
Module Name:src Committed By: joerg Date: Tue Aug 30 23:06:01 UTC 2011 Modified Files: src/usr.bin/gzip: gzip.c Log Message: Use __printflike and __dead. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/usr.bin/gzip/gzip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/gzip/gzip.c diff -u src/usr.bin/gzip/gzip.c:1.104 src/usr.bin/gzip/gzip.c:1.105 --- src/usr.bin/gzip/gzip.c:1.104 Wed Aug 17 14:07:31 2011 +++ src/usr.bin/gzip/gzip.c Tue Aug 30 23:06:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.104 2011/08/17 14:07:31 christos Exp $ */ +/* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */ /* * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -30,7 +30,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ Matthew R. Green. All rights reserved."); -__RCSID("$NetBSD: gzip.c,v 1.104 2011/08/17 14:07:31 christos Exp $"); +__RCSID("$NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $"); #endif /* not lint */ /* @@ -185,17 +185,13 @@ static char *infile; /* name of file coming in */ -static void maybe_err(const char *fmt, ...) -__attribute__((__noreturn__,__format__(__printf__, 1, 2))); +static void maybe_err(const char *fmt, ...) __printflike(1, 2) __dead; #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \ !defined(NO_XZ_SUPPORT) -static void maybe_errx(const char *fmt, ...) -__attribute__((__noreturn__,__format__(__printf__, 1, 2))); +static void maybe_errx(const char *fmt, ...) __printflike(1, 2) __dead; #endif -static void maybe_warn(const char *fmt, ...) -__attribute__((__format__(__printf__, 1, 2))); -static void maybe_warnx(const char *fmt, ...) -__attribute__((__format__(__printf__, 1, 2))); +static void maybe_warn(const char *fmt, ...) __printflike(1, 2); +static void maybe_warnx(const char *fmt, ...) __printflike(1, 2); static enum filetype file_gettype(u_char *); #ifdef SMALL #define gz_compress(if, of, sz, fn, tm) gz_compress(if, of, sz) @@ -210,8 +206,8 @@ static void handle_stdout(void); static void print_ratio(off_t, off_t, FILE *); static void print_list(int fd, off_t, const char *, time_t); -static void usage(void); -static void display_version(void); +__dead static void usage(void); +__dead static void display_version(void); static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); @@ -244,8 +240,6 @@ static off_t unxz(int, int, char *, size_t, off_t *); #endif -int main(int, char *p[]); - #ifdef SMALL #define getopt_long(a,b,c,d,e) getopt(a,b,c) #else
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Tue Aug 30 22:45:56 UTC 2011 Modified Files: src/sys/kern: sys_process.c Log Message: Process the signal now, otherwise calling issignal() and ignoring the return will lose the signal if it came from the debugger (issignal() clears p->p_xstat) To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/kern/sys_process.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.158 src/sys/kern/sys_process.c:1.159 --- src/sys/kern/sys_process.c:1.158 Mon Aug 29 13:31:50 2011 +++ src/sys/kern/sys_process.c Tue Aug 30 18:45:55 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.158 2011/08/29 17:31:50 jmcneill Exp $ */ +/* $NetBSD: sys_process.c,v 1.159 2011/08/30 22:45:55 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.158 2011/08/29 17:31:50 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.159 2011/08/30 22:45:55 christos Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -1051,6 +1051,7 @@ { struct lwp *l = curlwp; struct proc *p = l->l_proc, *pp; + int sig; mutex_enter(proc_lock); mutex_enter(p->p_lock); @@ -1072,7 +1073,8 @@ * from userret(). */ KERNEL_UNLOCK_ALL(l, &l->l_biglocks); - (void)issignal(l); + if ((sig = issignal(l)) != 0) + postsig(sig); mutex_exit(p->p_lock); KERNEL_LOCK(l->l_biglocks, l); }
CVS commit: src/sys/net
Module Name:src Committed By: rjs Date: Tue Aug 30 22:23:06 UTC 2011 Modified Files: src/sys/net: if_pppoe.c Log Message: Typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sys/net/if_pppoe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if_pppoe.c diff -u src/sys/net/if_pppoe.c:1.96 src/sys/net/if_pppoe.c:1.97 --- src/sys/net/if_pppoe.c:1.96 Mon Apr 5 07:22:23 2010 +++ src/sys/net/if_pppoe.c Tue Aug 30 22:23:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_pppoe.c,v 1.96 2010/04/05 07:22:23 joerg Exp $ */ +/* $NetBSD: if_pppoe.c,v 1.97 2011/08/30 22:23:06 rjs Exp $ */ /*- * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.96 2010/04/05 07:22:23 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.97 2011/08/30 22:23:06 rjs Exp $"); #include "pppoe.h" #include "opt_pfil_hooks.h" @@ -87,7 +87,7 @@ #define PPPOE_TAG_RELAYSID 0x0110 /* relay session id */ #define PPPOE_TAG_SNAME_ERR 0x0201 /* service name error */ #define PPPOE_TAG_ACSYS_ERR 0x0202 /* AC system error */ -#define PPPOE_TAG_GENERIC_ERR 0x0203 /* gerneric error */ +#define PPPOE_TAG_GENERIC_ERR 0x0203 /* generic error */ #define PPPOE_CODE_PADI 0x09 /* Active Discovery Initiation */ #define PPPOE_CODE_PADO 0x07 /* Active Discovery Offer */
CVS commit: src/usr.bin/comm
Module Name:src Committed By: joerg Date: Tue Aug 30 21:36:38 UTC 2011 Modified Files: src/usr.bin/comm: comm.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.bin/comm/comm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/comm/comm.c diff -u src/usr.bin/comm/comm.c:1.18 src/usr.bin/comm/comm.c:1.19 --- src/usr.bin/comm/comm.c:1.18 Sat Nov 28 03:56:38 2009 +++ src/usr.bin/comm/comm.c Tue Aug 30 21:36:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $ */ +/* $NetBSD: comm.c,v 1.19 2011/08/30 21:36:38 joerg Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)comm.c 8.4 (Berkeley) 5/4/95"; #endif -__RCSID("$NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $"); +__RCSID("$NetBSD: comm.c,v 1.19 2011/08/30 21:36:38 joerg Exp $"); #endif /* not lint */ #include @@ -55,12 +55,12 @@ #define MAXLINELEN (LINE_MAX + 1) -const char *tabs[] = { "", "\t", "\t\t" }; +static const char *tabs[] = { "", "\t", "\t\t" }; -FILE *file(const char *); -void show(FILE *, const char *, char *); -void usage(void); -char *getnextln(char *buf, FILE *); +static FILE *file(const char *); +static void show(FILE *, const char *, char *); +__dead static void usage(void); +static char *getnextln(char *buf, FILE *); int main(int argc, char **argv) @@ -164,14 +164,14 @@ exit(0); } -void +static void show(FILE *fp, const char *offset, char *buf) { while (printf("%s%s\n", offset, buf) >= 0 && getnextln(buf, fp)) ; } -FILE * +static FILE * file(const char *name) { FILE *fp; @@ -183,7 +183,7 @@ return (fp); } -void +static void usage(void) { @@ -191,7 +191,7 @@ exit(1); } -char * +static char * getnextln(char *buf, FILE *fp) { size_t i = 0;
CVS commit: src/usr.bin/colrm
Module Name:src Committed By: joerg Date: Tue Aug 30 21:35:09 UTC 2011 Modified Files: src/usr.bin/colrm: colrm.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/colrm/colrm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/colrm/colrm.c diff -u src/usr.bin/colrm/colrm.c:1.8 src/usr.bin/colrm/colrm.c:1.9 --- src/usr.bin/colrm/colrm.c:1.8 Mon Jul 21 14:19:21 2008 +++ src/usr.bin/colrm/colrm.c Tue Aug 30 21:35:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: colrm.c,v 1.8 2008/07/21 14:19:21 lukem Exp $ */ +/* $NetBSD: colrm.c,v 1.9 2011/08/30 21:35:09 joerg Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95"; #endif -__RCSID("$NetBSD: colrm.c,v 1.8 2008/07/21 14:19:21 lukem Exp $"); +__RCSID("$NetBSD: colrm.c,v 1.9 2011/08/30 21:35:09 joerg Exp $"); #endif /* not lint */ #include @@ -54,8 +54,8 @@ #define TAB 8 -void check(FILE *); -void usage(void); +static void check(FILE *); +__dead static void usage(void); int main(int argc, char *argv[]) @@ -120,7 +120,7 @@ } } -void +static void check(FILE *stream) { if (feof(stream)) @@ -129,8 +129,8 @@ err(1, "%s", stream == stdin ? "stdin" : "stdout"); } -void -usage() +static void +usage(void) { (void)fprintf(stderr, "usage: colrm [start [stop]]\n"); exit(1);
CVS commit: src/usr.bin/col
Module Name:src Committed By: joerg Date: Tue Aug 30 21:33:28 UTC 2011 Modified Files: src/usr.bin/col: col.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/col/col.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/col/col.c diff -u src/usr.bin/col/col.c:1.15 src/usr.bin/col/col.c:1.16 --- src/usr.bin/col/col.c:1.15 Mon Jul 21 14:19:21 2008 +++ src/usr.bin/col/col.c Tue Aug 30 21:33:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: col.c,v 1.15 2008/07/21 14:19:21 lukem Exp $ */ +/* $NetBSD: col.c,v 1.16 2011/08/30 21:33:28 joerg Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95"; #endif -__RCSID("$NetBSD: col.c,v 1.15 2008/07/21 14:19:21 lukem Exp $"); +__RCSID("$NetBSD: col.c,v 1.16 2011/08/30 21:33:28 joerg Exp $"); #endif /* not lint */ #include @@ -89,24 +89,24 @@ int l_max_col; /* max column in the line */ }; -LINE *alloc_line(void); -void dowarn(int); -void flush_line(LINE *); -void flush_lines(int); -void flush_blanks(void); -void free_line(LINE *); -void usage(void); -void wrerr(void); -void *xmalloc(void *, size_t); - -CSET last_set; /* char_set of last char printed */ -LINE *lines; -int compress_spaces; /* if doing space -> tab conversion */ -int fine; /* if `fine' resolution (half lines) */ -int max_bufd_lines; /* max # lines to keep in memory */ -int nblank_lines; /* # blanks after last flushed line */ -int no_backspaces; /* if not to output any backspaces */ -int pass_unknown_seqs; /* whether to pass unknown control sequences */ +static LINE *alloc_line(void); +static void dowarn(int); +static void flush_line(LINE *); +static void flush_lines(int); +static void flush_blanks(void); +static void free_line(LINE *); +__dead static void usage(void); +__dead static void wrerr(void); +static void *xmalloc(void *, size_t); + +static CSET last_set; /* char_set of last char printed */ +static LINE *lines; +static int compress_spaces; /* if doing space -> tab conversion */ +static int fine; /* if `fine' resolution (half lines) */ +static int max_bufd_lines; /* max # lines to keep in memory */ +static int nblank_lines; /* # blanks after last flushed line */ +static int no_backspaces; /* if not to output any backspaces */ +static int pass_unknown_seqs; /* whether to pass unknown control sequences */ #define PUTC(ch) \ if (putchar(ch) == EOF) \ @@ -324,7 +324,7 @@ /* NOTREACHED */ } -void +static void flush_lines(int nflush) { LINE *l; @@ -350,7 +350,7 @@ * is the number of half line feeds, otherwise it is the number of whole line * feeds. */ -void +static void flush_blanks(void) { int half, i, nb; @@ -379,7 +379,7 @@ * Write a line to stdout taking care of space to tab conversion (-h flag) * and character set shifts. */ -void +static void flush_line(LINE *l) { CHAR *c, *endc; @@ -478,7 +478,7 @@ static LINE *line_freelist; -LINE * +static LINE * alloc_line(void) { LINE *l; @@ -498,7 +498,7 @@ return (l); } -void +static void free_line(LINE *l) { @@ -506,7 +506,7 @@ line_freelist = l; } -void * +static void * xmalloc(void *p, size_t size) { void *q; @@ -517,7 +517,7 @@ return (p); } -void +static void usage(void) { @@ -525,7 +525,7 @@ exit(EXIT_FAILURE); } -void +static void wrerr(void) { @@ -533,7 +533,7 @@ exit(EXIT_FAILURE); } -void +static void dowarn(int line) {
CVS commit: src/usr.sbin/pvctxctl
Module Name:src Committed By: joerg Date: Tue Aug 30 21:28:27 UTC 2011 Modified Files: src/usr.sbin/pvctxctl: pvctxctl.c Log Message: Localize variables. Use __dead To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/pvctxctl/pvctxctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/pvctxctl/pvctxctl.c diff -u src/usr.sbin/pvctxctl/pvctxctl.c:1.6 src/usr.sbin/pvctxctl/pvctxctl.c:1.7 --- src/usr.sbin/pvctxctl/pvctxctl.c:1.6 Sun Apr 19 08:53:37 2009 +++ src/usr.sbin/pvctxctl/pvctxctl.c Tue Aug 30 21:28:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pvctxctl.c,v 1.6 2009/04/19 08:53:37 lukem Exp $ */ +/* $NetBSD: pvctxctl.c,v 1.7 2011/08/30 21:28:27 joerg Exp $ */ /* * Copyright (C) 1998 @@ -42,7 +42,7 @@ #include static int str2vc(char *str, int *vpi, int *vci); -static void usage(void); +__dead static void usage(void); static void usage(void) @@ -53,16 +53,6 @@ exit(1); } -int vpi = 0; -int vci = 0; -int joint_vpi = 0; -int joint_vci = 0; -int pcr = 0; -int llcsnap = ATM_PH_LLCSNAP; -int getinfo = 1; -int subinterface = 0; -int verbose = 1; - int main(int argc, char **argv) { @@ -70,6 +60,15 @@ int s, ch; long bandwidth; char *if_name, *cp; + int vpi = 0; + int vci = 0; + int joint_vpi = 0; + int joint_vci = 0; + int pcr = 0; + int llcsnap = ATM_PH_LLCSNAP; + int getinfo = 1; + int subinterface = 0; + int verbose = 1; if (argc < 2) usage();
CVS commit: src/usr.sbin/pvcsif
Module Name:src Committed By: joerg Date: Tue Aug 30 21:27:00 UTC 2011 Modified Files: src/usr.sbin/pvcsif: pvcsif.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/pvcsif/pvcsif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/pvcsif/pvcsif.c diff -u src/usr.sbin/pvcsif/pvcsif.c:1.4 src/usr.sbin/pvcsif/pvcsif.c:1.5 --- src/usr.sbin/pvcsif/pvcsif.c:1.4 Tue Jan 16 17:32:05 2007 +++ src/usr.sbin/pvcsif/pvcsif.c Tue Aug 30 21:27:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pvcsif.c,v 1.4 2007/01/16 17:32:05 hubertf Exp $ */ +/* $NetBSD: pvcsif.c,v 1.5 2011/08/30 21:27:00 joerg Exp $ */ /* * Copyright (C) 1998 @@ -40,8 +40,8 @@ #include -void usage __P((void)); -void list_all __P((void)); +__dead static void usage(void); +static void list_all(void); void usage(void) { @@ -94,7 +94,7 @@ return (0); } -void +static void list_all(void) { struct if_nameindex *ifn_list, *ifnp;
CVS commit: src/usr.sbin/route6d
Module Name:src Committed By: joerg Date: Tue Aug 30 21:26:11 UTC 2011 Modified Files: src/usr.sbin/route6d: route6d.c Log Message: static + __dead + G/C To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/usr.sbin/route6d/route6d.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/route6d/route6d.c diff -u src/usr.sbin/route6d/route6d.c:1.63 src/usr.sbin/route6d/route6d.c:1.64 --- src/usr.sbin/route6d/route6d.c:1.63 Fri Apr 23 15:30:30 2010 +++ src/usr.sbin/route6d/route6d.c Tue Aug 30 21:26:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: route6d.c,v 1.63 2010/04/23 15:30:30 plunky Exp $ */ +/* $NetBSD: route6d.c,v 1.64 2011/08/30 21:26:11 joerg Exp $ */ /* $KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $ */ /* @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: route6d.c,v 1.63 2010/04/23 15:30:30 plunky Exp $"); +__RCSID("$NetBSD: route6d.c,v 1.64 2011/08/30 21:26:11 joerg Exp $"); #endif #include @@ -129,16 +129,16 @@ struct iff *iff_next; }; -struct ifc *ifc; -int nifc; /* number of valid ifc's */ -struct ifc **index2ifc; -int nindex2ifc; -struct ifc *loopifcp = NULL; /* pointing to loopback */ -struct pollfd set[2]; -int rtsock; /* the routing socket */ -int ripsock; /* socket to send/receive RIP datagram */ +static struct ifc *ifc; +static int nifc; /* number of valid ifc's */ +static struct ifc **index2ifc; +static int nindex2ifc; +static struct ifc *loopifcp = NULL; /* pointing to loopback */ +static struct pollfd set[2]; +static int rtsock; /* the routing socket */ +static int ripsock; /* socket to send/receive RIP datagram */ -struct rip6 *ripbuf; /* packet buffer for sending */ +static struct rip6 *ripbuf; /* packet buffer for sending */ /* * Maintain the routes in a linked list. When the number of the routes @@ -163,41 +163,38 @@ int rrt_index; /* ifindex from which this route got */ }; -struct riprt *riprt = 0; +static struct riprt *riprt = 0; -int dflag = 0; /* debug flag */ -int qflag = 0; /* quiet flag */ -int nflag = 0; /* don't update kernel routing table */ -int aflag = 0; /* age out even the statically defined routes */ -int hflag = 0; /* don't split horizon */ -int lflag = 0; /* exchange site local routes */ -int sflag = 0; /* announce static routes w/ split horizon */ -int Sflag = 0; /* announce static routes to every interface */ -unsigned long routetag = 0; /* route tag attached on originating case */ +static int dflag = 0; /* debug flag */ +static int qflag = 0; /* quiet flag */ +static int nflag = 0; /* don't update kernel routing table */ +static int aflag = 0; /* age out even the statically defined routes */ +static int hflag = 0; /* don't split horizon */ +static int lflag = 0; /* exchange site local routes */ +static int sflag = 0; /* announce static routes w/ split horizon */ +static int Sflag = 0; /* announce static routes to every interface */ +static unsigned long routetag = 0; /* route tag attached on originating case */ -char *filter[MAXFILTER]; -int filtertype[MAXFILTER]; -int nfilter = 0; +static char *filter[MAXFILTER]; +static int filtertype[MAXFILTER]; +static int nfilter = 0; -pid_t pid; +static pid_t pid; -struct sockaddr_storage ripsin; +static struct sockaddr_storage ripsin; -struct rtentry rtentry; +static int interval = 1; +static time_t nextalarm = 0; -int interval = 1; -time_t nextalarm = 0; -time_t sup_trig_update = 0; +static FILE *rtlog = NULL; -FILE *rtlog = NULL; - -int logopened = 0; +static int logopened = 0; static int seq = 0; -volatile sig_atomic_t seenalrm; -volatile sig_atomic_t seenquit; -volatile sig_atomic_t seenusr1; +static volatile sig_atomic_t seenalrm; +static volatile sig_atomic_t seenquit; +static volatile sig_atomic_t seenusr1; #define RRTF_AGGREGATE 0x0800 #define RRTF_NOADVERTISE 0x1000 @@ -205,77 +202,66 @@ #define RRTF_SENDANYWAY 0x4000 #define RRTF_CHANGED 0x8000 -int main(int, char **); -void sighandler(int); -void ripalarm(void); -void riprecv(void); -void ripsend(struct ifc *, struct sockaddr_in6 *, int); -int out_filter(struct riprt *, struct ifc *); -void init(void); -void sockopt(struct ifc *); -void ifconfig(void); -void ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); -void rtrecv(void); -int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, +static void sighandler(int); +static void ripalarm(void); +static void riprecv(void); +static void ripsend(struct ifc *, struct sockaddr_in6 *, int); +static int out_filter(struct riprt *, struct ifc *); +static void init(void); +static void ifconfig(void); +static void ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); +static void rtrecv(void); +static int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, const struct sockaddr_in6 *); -int rt_deladdr(struct ifc *, const struct sockadd
CVS commit: src/usr.sbin/mld6query
Module Name:src Committed By: joerg Date: Tue Aug 30 21:18:11 UTC 2011 Modified Files: src/usr.sbin/mld6query: mld6.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mld6query/mld6.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/mld6query/mld6.c diff -u src/usr.sbin/mld6query/mld6.c:1.13 src/usr.sbin/mld6query/mld6.c:1.14 --- src/usr.sbin/mld6query/mld6.c:1.13 Sun Apr 19 07:54:08 2009 +++ src/usr.sbin/mld6query/mld6.c Tue Aug 30 21:18:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mld6.c,v 1.13 2009/04/19 07:54:08 lukem Exp $ */ +/* $NetBSD: mld6.c,v 1.14 2011/08/30 21:18:11 joerg Exp $ */ /* $KAME: mld6.c,v 1.9 2000/12/04 06:29:37 itojun Exp $ */ /* @@ -54,20 +54,20 @@ #include #include -struct msghdr m; -struct sockaddr_in6 dst; -struct mld6_hdr mldh; -struct in6_addr maddr = IN6ADDR_ANY_INIT, any = IN6ADDR_ANY_INIT; -struct ipv6_mreq mreq; -u_short ifindex; -int sock; +static struct msghdr m; +static struct sockaddr_in6 dst; +static struct mld6_hdr mldh; +static struct in6_addr maddr = IN6ADDR_ANY_INIT, any = IN6ADDR_ANY_INIT; +static struct ipv6_mreq mreq; +static u_short ifindex; +static int sock; #define QUERY_RESPONSE_INTERVAL 1 -void make_msg(int index, struct in6_addr *addr, u_int type); -void usage(void); -void dump(int); -void quit(int); +static void make_msg(int index, struct in6_addr *addr, u_int type); +__dead static void usage(void); +static void dump(int); +__dead static void quit(int); int main(int argc, char *argv[]) @@ -153,7 +153,7 @@ } } -void +static void make_msg(int idx, struct in6_addr *addr, u_int type) { static struct iovec iov[2]; @@ -244,7 +244,7 @@ #endif } -void +static void dump(int s) { int i; @@ -287,7 +287,7 @@ } /* ARGSUSED */ -void +static void quit(int signum) { mreq.ipv6mr_multiaddr = any; mreq.ipv6mr_interface = ifindex; @@ -298,8 +298,8 @@ exit(0); } -void -usage() +static void +usage(void) { (void)fprintf(stderr, "usage: %s [-dr] ifname [addr]\n", getprogname()); exit(1);
CVS commit: src/usr.sbin/rip6query
Module Name:src Committed By: joerg Date: Tue Aug 30 21:17:06 UTC 2011 Modified Files: src/usr.sbin/rip6query: rip6query.c Log Message: ANSIfy + static + __dead To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/rip6query/rip6query.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rip6query/rip6query.c diff -u src/usr.sbin/rip6query/rip6query.c:1.10 src/usr.sbin/rip6query/rip6query.c:1.11 --- src/usr.sbin/rip6query/rip6query.c:1.10 Mon Jan 5 23:23:38 2004 +++ src/usr.sbin/rip6query/rip6query.c Tue Aug 30 21:17:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rip6query.c,v 1.10 2004/01/05 23:23:38 jmmv Exp $ */ +/* $NetBSD: rip6query.c,v 1.11 2011/08/30 21:17:06 joerg Exp $ */ /* $KAME: rip6query.c,v 1.17 2002/09/08 01:35:17 itojun Exp $ */ /* @@ -57,23 +57,20 @@ #define DEFAULT_WAIT 5 -int s; -int query_wait = DEFAULT_WAIT; -struct sockaddr_in6 sin6; -struct rip6 *ripbuf; +static int s; +static int query_wait = DEFAULT_WAIT; +static struct sockaddr_in6 sin6; +static struct rip6 *ripbuf; #define RIPSIZE(n) (sizeof(struct rip6) + (n-1) * sizeof(struct netinfo6)) -int main __P((int, char **)); -static void usage __P((void)); -static void sigalrm_handler __P((int)); -static const char *sa_n2a __P((struct sockaddr *)); -static const char *inet6_n2a __P((struct in6_addr *)); +__dead static void usage(void); +__dead static void sigalrm_handler(int); +static const char *sa_n2a(struct sockaddr *); +static const char *inet6_n2a(struct in6_addr *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct netinfo6 *np; struct sockaddr_in6 fsock; @@ -99,17 +96,14 @@ break; default: usage(); - exit(1); /*NOTREACHED*/ } } argv += optind; argc -= optind; - if (argc != 1) { + if (argc != 1) usage(); - exit(1); - } if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { err(1, "socket"); @@ -184,15 +178,15 @@ } static void -usage() +usage(void) { fprintf(stderr, "usage: rip6query [-I iface] [-w wait] address\n"); + exit(1); } /* getnameinfo() is preferred as we may be able to show ifindex as ifname */ static const char * -sa_n2a(sa) - struct sockaddr *sa; +sa_n2a(struct sockaddr *sa) { static char buf[NI_MAXHOST]; @@ -204,8 +198,7 @@ } static const char * -inet6_n2a(addr) - struct in6_addr *addr; +inet6_n2a(struct in6_addr *addr) { static char buf[NI_MAXHOST]; @@ -213,8 +206,7 @@ } static void -sigalrm_handler(sig) - int sig; +sigalrm_handler(int sig) { _exit(0);
CVS commit: src/usr.sbin/faithd
Module Name:src Committed By: joerg Date: Tue Aug 30 21:14:06 UTC 2011 Modified Files: src/usr.sbin/faithd: faithd.c faithd.h tcp.c Log Message: __dead + __printflike To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/faithd/faithd.c cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/faithd/faithd.h \ src/usr.sbin/faithd/tcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/faithd/faithd.c diff -u src/usr.sbin/faithd/faithd.c:1.33 src/usr.sbin/faithd/faithd.c:1.34 --- src/usr.sbin/faithd/faithd.c:1.33 Fri Nov 26 18:58:43 2010 +++ src/usr.sbin/faithd/faithd.c Tue Aug 30 21:14:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: faithd.c,v 1.33 2010/11/26 18:58:43 christos Exp $ */ +/* $NetBSD: faithd.c,v 1.34 2011/08/30 21:14:06 joerg Exp $ */ /* $KAME: faithd.c,v 1.62 2003/08/19 21:20:33 itojun Exp $ */ /* @@ -95,19 +95,18 @@ static int inetd_main(int, char **); static int daemon_main(int, char **); -static void play_service(int); +static void play_service(int) __dead; static void play_child(int, struct sockaddr *); static int faith_prefix(struct sockaddr *); static int map6to4(struct sockaddr_in6 *, struct sockaddr_in *); static void sig_child(int); -static void sig_terminate(int); +static void sig_terminate(int) __dead; static void start_daemon(void); -static void exit_stderr(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +static void exit_stderr(const char *, ...) __printflike(1, 2) __dead; static void grab_myaddrs(void); static void free_myaddrs(void); static void update_myaddrs(void); -static void usage(void) __attribute__((__noreturn__)); +static void usage(void) __dead; int main(int argc, char **argv) @@ -675,7 +674,7 @@ (long)pid, status); } -void +static void /*ARGSUSED*/ sig_terminate(int sig) { Index: src/usr.sbin/faithd/faithd.h diff -u src/usr.sbin/faithd/faithd.h:1.10 src/usr.sbin/faithd/faithd.h:1.11 --- src/usr.sbin/faithd/faithd.h:1.10 Fri Nov 26 18:58:43 2010 +++ src/usr.sbin/faithd/faithd.h Tue Aug 30 21:14:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: faithd.h,v 1.10 2010/11/26 18:58:43 christos Exp $ */ +/* $NetBSD: faithd.h,v 1.11 2011/08/30 21:14:06 joerg Exp $ */ /* $KAME: faithd.h,v 1.9 2002/05/09 09:41:24 itojun Exp $ */ /* @@ -33,14 +33,12 @@ extern char logname[]; extern int dflag; -extern void tcp_relay(int, int, const char *); +extern void tcp_relay(int, int, const char *) __dead; extern void ftp_relay(int, int); extern int ftp_active(int, int, int *, int *); extern int ftp_passive(int, int, int *, int *); -extern void exit_success(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); -extern void exit_failure(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +extern void exit_success(const char *, ...) __dead __printflike(1, 2); +extern void exit_failure(const char *, ...) __dead __printflike(1, 2); #define DEFAULT_PORT_NAME "telnet" #define DEFAULT_DIR "/usr/libexec" Index: src/usr.sbin/faithd/tcp.c diff -u src/usr.sbin/faithd/tcp.c:1.10 src/usr.sbin/faithd/tcp.c:1.11 --- src/usr.sbin/faithd/tcp.c:1.10 Fri Nov 26 18:58:43 2010 +++ src/usr.sbin/faithd/tcp.c Tue Aug 30 21:14:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp.c,v 1.10 2010/11/26 18:58:43 christos Exp $ */ +/* $NetBSD: tcp.c,v 1.11 2011/08/30 21:14:06 joerg Exp $ */ /* $KAME: tcp.c,v 1.10 2002/08/20 23:01:01 itojun Exp $ */ /* @@ -64,11 +64,11 @@ static time_t parent_lastactive = (time_t)0; static void sig_ctimeout(int); -static void sig_child(int); +static void sig_child(int) __dead; static void notify_inactive(void); static void notify_active(void); static void send_data(int, int, const char *, int); -static void relay(int, int, const char *, int); +static void relay(int, int, const char *, int) __dead; /* * Inactivity timer:
CVS commit: src/usr.sbin/ypserv
Module Name:src Committed By: joerg Date: Tue Aug 30 21:10:29 UTC 2011 Modified Files: src/usr.sbin/ypserv/makedbm: makedbm.c src/usr.sbin/ypserv/mkalias: mkalias.c src/usr.sbin/ypserv/mknetid: mknetid.c src/usr.sbin/ypserv/revnetgroup: revnetgroup.c src/usr.sbin/ypserv/stdethers: stdethers.c src/usr.sbin/ypserv/stdhosts: stdhosts.c src/usr.sbin/ypserv/yppush: yppush.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/ypserv/makedbm/makedbm.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ypserv/mkalias/mkalias.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ypserv/mknetid/mknetid.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/ypserv/revnetgroup/revnetgroup.c cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/ypserv/stdethers/stdethers.c cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/ypserv/stdhosts/stdhosts.c cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/ypserv/yppush/yppush.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/ypserv/makedbm/makedbm.c diff -u src/usr.sbin/ypserv/makedbm/makedbm.c:1.24 src/usr.sbin/ypserv/makedbm/makedbm.c:1.25 --- src/usr.sbin/ypserv/makedbm/makedbm.c:1.24 Tue Oct 20 00:51:14 2009 +++ src/usr.sbin/ypserv/makedbm/makedbm.c Tue Aug 30 21:10:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: makedbm.c,v 1.24 2009/10/20 00:51:14 snj Exp $ */ +/* $NetBSD: makedbm.c,v 1.25 2011/08/30 21:10:28 joerg Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: makedbm.c,v 1.24 2009/10/20 00:51:14 snj Exp $"); +__RCSID("$NetBSD: makedbm.c,v 1.25 2011/08/30 21:10:28 joerg Exp $"); #endif #include @@ -50,13 +50,12 @@ #include "ypdb.h" #include "ypdef.h" -int main(int, char *[]); -void usage(void); -int add_record(DBM *, const char *, const char *, int); -char *file_date(char *); -void list_database(char *); -void create_database(char *, char *, char *, char *, char *, char *, - int, int, int); +__dead static void usage(void); +static int add_record(DBM *, const char *, const char *, int); +static char *file_date(char *); +static void list_database(char *); +static void create_database(char *, char *, char *, char *, char *, + char *, int, int, int); int main(int argc, char *argv[]) @@ -143,7 +142,7 @@ exit(0); } -int +static int add_record(DBM *db, const char *str1, const char *str2, int check) { datum key, val; @@ -169,7 +168,7 @@ return 0; } -char * +static char * file_date(char *filename) { struct stat finfo; @@ -190,7 +189,7 @@ return datestr; } -void +static void list_database(char *database) { DBM *db; @@ -220,7 +219,7 @@ ypdb_close(db); } -void +static void create_database(char *infile, char *database, char *yp_input_file, char *yp_output_file, char *yp_master_name, char *yp_domain_name, int bflag, int lflag, int sflag) @@ -346,7 +345,7 @@ } } -void +static void usage(void) { Index: src/usr.sbin/ypserv/mkalias/mkalias.c diff -u src/usr.sbin/ypserv/mkalias/mkalias.c:1.17 src/usr.sbin/ypserv/mkalias/mkalias.c:1.18 --- src/usr.sbin/ypserv/mkalias/mkalias.c:1.17 Tue Oct 20 00:51:14 2009 +++ src/usr.sbin/ypserv/mkalias/mkalias.c Tue Aug 30 21:10:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mkalias.c,v 1.17 2009/10/20 00:51:14 snj Exp $ */ +/* $NetBSD: mkalias.c,v 1.18 2011/08/30 21:10:28 joerg Exp $ */ /* * Copyright (c) 1997 Mats O Jansson @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mkalias.c,v 1.17 2009/10/20 00:51:14 snj Exp $"); +__RCSID("$NetBSD: mkalias.c,v 1.18 2011/08/30 21:10:28 joerg Exp $"); #endif #include @@ -52,13 +52,12 @@ #include "ypdb.h" #include "ypdef.h" -void capitalize(char *, int); -int check_host(char *, char *, int, int, int); -int main(int, char *[]); -void split_address(char *, int, char *, char *); -void usage(void); +static void capitalize(char *, int); +static int check_host(char *, char *, int, int, int); +static void split_address(char *, int, char *, char *); +__dead static void usage(void); -void +static void split_address(char *address, int len, char *user, char *host) { char *c, *s, *r; @@ -95,7 +94,7 @@ } } -int +static int check_host(char *address, char *host, int dflag, int uflag, int Eflag) { u_char answer[PACKETSZ]; @@ -119,7 +118,7 @@ return(status == -1); } -void +static void capitalize(char *name, int len) { char last = ' '; @@ -331,7 +330,7 @@ exit(0); } -void +static void usage(void) { fprintf(stderr, Index: src/usr.sbin/ypserv/mknetid/mknetid.c diff -u src/usr.sbin/ypserv/mknetid/mknetid.c:1.17 src/usr.sbin/ypserv/mknetid/mknetid.c:1.18 --- src/usr.sbin/ypserv/mknetid/mknetid.c:1.17 Tue Oct 20 00:51:14 2009 +++ src/usr.sbin/ypserv/mknetid/mknetid.c Tue Aug 30 21:10:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mknetid.c,v 1.17 2009/10/20 00:51:14 snj Exp $ */ +/* $NetBSD: mknetid.c,v 1
CVS commit: src/usr.sbin/wsmuxctl
Module Name:src Committed By: joerg Date: Tue Aug 30 21:03:31 UTC 2011 Modified Files: src/usr.sbin/wsmuxctl: wsmuxctl.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/wsmuxctl/wsmuxctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/wsmuxctl/wsmuxctl.c diff -u src/usr.sbin/wsmuxctl/wsmuxctl.c:1.10 src/usr.sbin/wsmuxctl/wsmuxctl.c:1.11 --- src/usr.sbin/wsmuxctl/wsmuxctl.c:1.10 Mon Apr 28 20:24:17 2008 +++ src/usr.sbin/wsmuxctl/wsmuxctl.c Tue Aug 30 21:03:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: wsmuxctl.c,v 1.10 2008/04/28 20:24:17 martin Exp $ */ +/* $NetBSD: wsmuxctl.c,v 1.11 2011/08/30 21:03:31 joerg Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -41,12 +41,11 @@ #include -static void usage(void); -int main(int, char**); +__dead static void usage(void); -const char *ctlpath = "/dev/wsmuxctl"; +static const char *ctlpath = "/dev/wsmuxctl"; -const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" }; +static const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" }; static void usage(void)
CVS commit: src/usr.sbin/wiconfig
Module Name:src Committed By: joerg Date: Tue Aug 30 21:01:51 UTC 2011 Modified Files: src/usr.sbin/wiconfig: wiconfig.c Log Message: ANSIfy + static + __dead To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/wiconfig/wiconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/wiconfig/wiconfig.c diff -u src/usr.sbin/wiconfig/wiconfig.c:1.42 src/usr.sbin/wiconfig/wiconfig.c:1.43 --- src/usr.sbin/wiconfig/wiconfig.c:1.42 Sun Apr 19 01:52:09 2009 +++ src/usr.sbin/wiconfig/wiconfig.c Tue Aug 30 21:01:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: wiconfig.c,v 1.42 2009/04/19 01:52:09 lukem Exp $ */ +/* $NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -68,7 +68,7 @@ #if !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 1999\ Bill Paul. All rights reserved."); -__RCSID("$NetBSD: wiconfig.c,v 1.42 2009/04/19 01:52:09 lukem Exp $"); +__RCSID("$NetBSD: wiconfig.c,v 1.43 2011/08/30 21:01:50 joerg Exp $"); #endif struct wi_table { @@ -96,35 +96,32 @@ #define WI_APRATE_11 0x6E /* 11 Mbps */ #ifdef WI_RID_SCAN_APS -static void wi_apscan __P((char *)); -static int get_if_flags __P((int, const char *)); -static int set_if_flags __P((int, const char *, int)); +static void wi_apscan(char *); +static int get_if_flags(int, const char *); +static int set_if_flags(int, const char *, int); #endif -static int wi_getval __P((char *, struct wi_req *)); -static void wi_setval __P((char *, struct wi_req *)); -static void wi_printstr __P((struct wi_req *)); -static void wi_setstr __P((char *, int, char *)); -static void wi_setbytes __P((char *, int, char *, int)); -static void wi_setword __P((char *, int, int)); -static void wi_sethex __P((char *, int, char *)); -static void wi_printwords __P((struct wi_req *)); -static void wi_printbool __P((struct wi_req *)); -static void wi_printhex __P((struct wi_req *)); -static void wi_printbits __P((struct wi_req *)); -static void wi_checkwifi __P((char *)); -static void wi_dumpinfo __P((char *)); -static void wi_printkeys __P((struct wi_req *)); -static void wi_printvendor __P((struct wi_req *)); -static void wi_dumpstats __P((char *)); -static void usage __P((void)); -static struct wi_table * - wi_optlookup __P((struct wi_table *, int)); -int main __P((int argc, char **argv)); +static int wi_getval(char *, struct wi_req *); +static void wi_setval(char *, struct wi_req *); +static void wi_printstr(struct wi_req *); +static void wi_setstr(char *, int, char *); +static void wi_setbytes(char *, int, char *, int); +static void wi_setword(char *, int, int); +static void wi_sethex(char *, int, char *); +static void wi_printwords(struct wi_req *); +static void wi_printbool(struct wi_req *); +static void wi_printhex(struct wi_req *); +static void wi_printbits(struct wi_req *); +static void wi_checkwifi(char *); +static void wi_dumpinfo(char *); +static void wi_printkeys(struct wi_req *); +static void wi_printvendor(struct wi_req *); +static void wi_dumpstats(char *); +__dead static void usage(void); +static struct wi_table *wi_optlookup(struct wi_table *, int); #ifdef WI_RID_SCAN_APS -static int get_if_flags(s, name) - int s; - const char *name; +static int +get_if_flags(int s, const char *name) { struct ifreq ifreq; int flags; @@ -137,10 +134,8 @@ return flags; } -static int set_if_flags(s, name, flags) - int s; - const char *name; - int flags; +static int +set_if_flags(int s, const char *name, int flags) { struct ifreq ifreq; @@ -152,8 +147,8 @@ return 0; } -static void wi_apscan(iface) - char *iface; +static void +wi_apscan(char *iface) { struct wi_req wreq; struct ifreq ifr; @@ -284,9 +279,8 @@ } #endif -static int wi_getval(iface, wreq) - char *iface; - struct wi_req *wreq; +static int +wi_getval(char *iface, struct wi_req *wreq) { struct ifreq ifr; int s, error; @@ -312,9 +306,8 @@ return error; } -static void wi_setval(iface, wreq) - char *iface; - struct wi_req *wreq; +static void +wi_setval(char *iface, struct wi_req *wreq) { struct ifreq ifr; int s; @@ -337,8 +330,8 @@ return; } -void wi_printstr(wreq) - struct wi_req *wreq; +static void +wi_printstr(struct wi_req *wreq) { char *ptr; int i; @@ -365,10 +358,8 @@ return; } -void wi_setstr(iface, code, str) - char *iface; - int code; - char *str; +static void +wi_setstr(char *iface, int code, char *str) { struct wi_req wreq; @@ -387,11 +378,8 @@ return; } -void wi_setbytes(iface, code, bytes, len) - char *iface; - int code; - char *bytes; - int len; +static void +wi_setbytes(char *iface, int code, char *bytes, int len) { struct wi_req wreq; @@ -406,10 +394,8 @@ return; } -void wi_setword(iface, code, word) - char *iface; - int code; - int word
CVS commit: src/usr.sbin/vnconfig
Module Name:src Committed By: joerg Date: Tue Aug 30 20:54:18 UTC 2011 Modified Files: src/usr.sbin/vnconfig: vnconfig.c Log Message: ANSIfy + static + __dead To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/vnconfig/vnconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/vnconfig/vnconfig.c diff -u src/usr.sbin/vnconfig/vnconfig.c:1.39 src/usr.sbin/vnconfig/vnconfig.c:1.40 --- src/usr.sbin/vnconfig/vnconfig.c:1.39 Tue Feb 8 20:20:28 2011 +++ src/usr.sbin/vnconfig/vnconfig.c Tue Aug 30 20:54:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vnconfig.c,v 1.39 2011/02/08 20:20:28 rmind Exp $ */ +/* $NetBSD: vnconfig.c,v 1.40 2011/08/30 20:54:18 joerg Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -91,22 +91,18 @@ #define VND_UNCONFIG 2 #define VND_GET 3 -int verbose = 0; -int readonly = 0; -int force = 0; -int compressed = 0; -char *tabname; - -int config __P((char *, char *, char *, int)); -int getgeom __P((struct vndgeom *, char *)); -int main __P((int, char **)); -char *rawdevice __P((char *)); -void usage __P((void)); +static int verbose = 0; +static int readonly = 0; +static int force = 0; +static int compressed = 0; +static char *tabname; + +static int config(char *, char *, char *, int); +static int getgeom(struct vndgeom *, char *); +__dead static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, rv, action = VND_CONFIG; @@ -237,10 +233,8 @@ exit(rv); } -int -config(dev, file, geom, action) - char *dev, *file, *geom; - int action; +static int +config(char *dev, char *file, char *geom, int action) { struct vnd_ioctl vndio; struct disklabel *lp; @@ -337,10 +331,8 @@ return (rv < 0); } -int -getgeom(vng, cp) - struct vndgeom *vng; - char *cp; +static int +getgeom(struct vndgeom *vng, char *cp) { char *secsize, *nsectors, *ntracks, *ncylinders; @@ -381,8 +373,8 @@ return (0); } -void -usage() +static void +usage(void) { (void)fprintf(stderr, "%s%s",
CVS commit: src/usr.sbin/vipw
Module Name:src Committed By: joerg Date: Tue Aug 30 20:52:10 UTC 2011 Modified Files: src/usr.sbin/vipw: vipw.c Log Message: De-__P + __dead To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/vipw/vipw.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/vipw/vipw.c diff -u src/usr.sbin/vipw/vipw.c:1.14 src/usr.sbin/vipw/vipw.c:1.15 --- src/usr.sbin/vipw/vipw.c:1.14 Sun Apr 19 00:44:49 2009 +++ src/usr.sbin/vipw/vipw.c Tue Aug 30 20:52:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vipw.c,v 1.14 2009/04/19 00:44:49 lukem Exp $ */ +/* $NetBSD: vipw.c,v 1.15 2011/08/30 20:52:10 joerg Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)vipw.c 8.3 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: vipw.c,v 1.14 2009/04/19 00:44:49 lukem Exp $"); +__RCSID("$NetBSD: vipw.c,v 1.15 2011/08/30 20:52:10 joerg Exp $"); #endif #endif /* not lint */ @@ -57,11 +57,10 @@ #include #include -int main __P((int, char **)); -static void copyfile __P((int, int)); -static void usage __P((void)); +static void copyfile(int, int); +__dead static void usage(void); -char mpwd[MAXPATHLEN], mpwdl[MAXPATHLEN]; +static char mpwd[MAXPATHLEN], mpwdl[MAXPATHLEN]; int main(int argc, char *argv[])
CVS commit: src/usr.sbin/usbdevs
Module Name:src Committed By: joerg Date: Tue Aug 30 20:51:29 UTC 2011 Modified Files: src/usr.sbin/usbdevs: usbdevs.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/usbdevs/usbdevs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/usbdevs/usbdevs.c diff -u src/usr.sbin/usbdevs/usbdevs.c:1.27 src/usr.sbin/usbdevs/usbdevs.c:1.28 --- src/usr.sbin/usbdevs/usbdevs.c:1.27 Mon Aug 15 14:31:58 2011 +++ src/usr.sbin/usbdevs/usbdevs.c Tue Aug 30 20:51:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdevs.c,v 1.27 2011/08/15 14:31:58 wiz Exp $ */ +/* $NetBSD: usbdevs.c,v 1.28 2011/08/30 20:51:29 joerg Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -44,17 +44,16 @@ #define USBDEV "/dev/usb" -int verbose = 0; -int showdevs = 0; +static int verbose = 0; +static int showdevs = 0; -void usage(void); -void usbdev(int f, int a, int rec); -void usbdump(int f); -void dumpone(char *name, int f, int addr); -int main(int, char **); +__dead static void usage(void); +static void usbdev(int f, int a, int rec); +static void usbdump(int f); +static void dumpone(char *name, int f, int addr); -void -usage() +static void +usage(void) { fprintf(stderr, "usage: %s [-dv] [-a addr] [-f dev]\n", @@ -62,10 +61,10 @@ exit(1); } -char done[USB_MAX_DEVICES]; -int indent; +static char done[USB_MAX_DEVICES]; +static int indent; #define MAXLEN USB_MAX_ENCODED_STRING_LEN /* assume can't grow over UTF-8 */ -char vendor[MAXLEN], product[MAXLEN], serial[MAXLEN]; +static char vendor[MAXLEN], product[MAXLEN], serial[MAXLEN]; static void u2t(const char *utf8str, char *termstr) @@ -93,7 +92,7 @@ strcpy(termstr, "(invalid)"); } -void +static void usbdev(int f, int a, int rec) { struct usb_device_info di; @@ -170,7 +169,7 @@ } } -void +static void usbdump(int f) { int a; @@ -181,7 +180,7 @@ } } -void +static void dumpone(char *name, int f, int addr) { if (verbose)
CVS commit: src/usr.sbin/unlink
Module Name:src Committed By: joerg Date: Tue Aug 30 20:50:24 UTC 2011 Modified Files: src/usr.sbin/unlink: unlink.c Log Message: ANSIfy + __dead To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/unlink/unlink.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/unlink/unlink.c diff -u src/usr.sbin/unlink/unlink.c:1.4 src/usr.sbin/unlink/unlink.c:1.5 --- src/usr.sbin/unlink/unlink.c:1.4 Mon Jul 21 13:37:00 2008 +++ src/usr.sbin/unlink/unlink.c Tue Aug 30 20:50:24 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: unlink.c,v 1.4 2008/07/21 13:37:00 lukem Exp $ */ +/* $NetBSD: unlink.c,v 1.5 2011/08/30 20:50:24 joerg Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1999\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: unlink.c,v 1.4 2008/07/21 13:37:00 lukem Exp $"); +__RCSID("$NetBSD: unlink.c,v 1.5 2011/08/30 20:50:24 joerg Exp $"); #endif #include @@ -41,13 +41,10 @@ #include #include -int main __P((int, char *[])); -static void usage __P((void)); +__dead static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { (void)setlocale(LC_ALL, ""); @@ -65,7 +62,7 @@ } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: unlink file\n");
CVS commit: src/usr.sbin/trpt
Module Name:src Committed By: joerg Date: Tue Aug 30 20:49:30 UTC 2011 Modified Files: src/usr.sbin/trpt: trpt.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/trpt/trpt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/trpt/trpt.c diff -u src/usr.sbin/trpt/trpt.c:1.26 src/usr.sbin/trpt/trpt.c:1.27 --- src/usr.sbin/trpt/trpt.c:1.26 Sun Apr 19 00:26:18 2009 +++ src/usr.sbin/trpt/trpt.c Tue Aug 30 20:49:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trpt.c,v 1.26 2009/04/19 00:26:18 lukem Exp $ */ +/* $NetBSD: trpt.c,v 1.27 2011/08/30 20:49:29 joerg Exp $ */ /*- * Copyright (c) 1997, 2005, 2006 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ #if 0 static char sccsid[] = "@(#)trpt.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: trpt.c,v 1.26 2009/04/19 00:26:18 lukem Exp $"); +__RCSID("$NetBSD: trpt.c,v 1.27 2011/08/30 20:49:29 joerg Exp $"); #endif #endif /* not lint */ @@ -123,7 +123,7 @@ #include #include -struct nlist nl[] = { +static struct nlist nl[] = { #define N_HARDCLOCK_TICKS 0 { "_hardclock_ticks", 0, 0, 0, 0 }, #define N_TCP_DEBUG 1 @@ -138,18 +138,17 @@ static int aflag, follow, sflag, tflag; /* see sys/netinet/tcp_debug.c */ -struct tcp_debug tcp_debug[TCP_NDEBUG]; -int tcp_debx; +static struct tcp_debug tcp_debug[TCP_NDEBUG]; +static int tcp_debx; -int main(int, char *[]); -void dotrace(caddr_t); -void tcp_trace(short, short, struct tcpcb *, struct tcpcb *, +static void dotrace(caddr_t); +static void tcp_trace(short, short, struct tcpcb *, struct tcpcb *, int, void *, int); -int numeric(const void *, const void *); -void usage(void); +static int numeric(const void *, const void *); +__dead static void usage(void); -kvm_t *kd; -int use_sysctl; +static kvm_t *kd; +static int use_sysctl; int main(int argc, char *argv[]) @@ -277,7 +276,7 @@ exit(0); } -void +static void dotrace(caddr_t tcpcb) { struct tcp_debug *td; @@ -380,7 +379,7 @@ * Tcp debug routines */ /*ARGSUSED*/ -void +static void tcp_trace(short act, short ostate, struct tcpcb *atp, struct tcpcb *tp, int family, void *packet, int req) { @@ -550,7 +549,7 @@ } } -int +static int numeric(const void *v1, const void *v2) { const caddr_t *c1 = v1; @@ -567,7 +566,7 @@ return (rv); } -void +static void usage(void) {
CVS commit: src/usr.sbin/spray
Module Name:src Committed By: joerg Date: Tue Aug 30 20:45:31 UTC 2011 Modified Files: src/usr.sbin/spray: spray.c Log Message: static + ANSIfy + __dead To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/spray/spray.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/spray/spray.c diff -u src/usr.sbin/spray/spray.c:1.6 src/usr.sbin/spray/spray.c:1.7 --- src/usr.sbin/spray/spray.c:1.6 Sat Apr 18 14:01:37 2009 +++ src/usr.sbin/spray/spray.c Tue Aug 30 20:45:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: spray.c,v 1.6 2009/04/18 14:01:37 lukem Exp $ */ +/* $NetBSD: spray.c,v 1.7 2011/08/30 20:45:31 joerg Exp $ */ /* * Copyright (c) 1993 Winning Strategies, Inc. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: spray.c,v 1.6 2009/04/18 14:01:37 lukem Exp $"); +__RCSID("$NetBSD: spray.c,v 1.7 2011/08/30 20:45:31 joerg Exp $"); #endif #include @@ -46,22 +46,19 @@ #define SPRAYOVERHEAD 86 #endif -int main __P((int, char **)); -void print_xferstats __P((int, int, double)); -void usage __P((void)); +static void print_xferstats(int, int, double); +__dead static void usage(void); /* spray buffer */ -char spray_buffer[SPRAYMAX]; +static char spray_buffer[SPRAYMAX]; /* RPC timeouts */ -struct timeval NO_DEFAULT = { -1, -1 }; -struct timeval ONE_WAY = { 0, 0 }; -struct timeval TIMEOUT = { 25, 0 }; +static struct timeval NO_DEFAULT = { -1, -1 }; +static struct timeval ONE_WAY = { 0, 0 }; +static struct timeval TIMEOUT = { 25, 0 }; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { char *progname; spraycumul host_stats; @@ -197,11 +194,8 @@ } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -221,9 +215,8 @@ printf("bytes/sec\n"); } - -void -usage () +static void +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); exit(1);
CVS commit: src/usr.sbin/sntp
Module Name:src Committed By: joerg Date: Tue Aug 30 20:43:43 UTC 2011 Removed Files: src/usr.sbin/sntp: Makefile sntp.1 Log Message: G/C To generate a diff of this commit: cvs rdiff -u -r1.4 -r0 src/usr.sbin/sntp/Makefile cvs rdiff -u -r1.8 -r0 src/usr.sbin/sntp/sntp.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/sliplogin
Module Name:src Committed By: joerg Date: Tue Aug 30 20:42:22 UTC 2011 Modified Files: src/usr.sbin/sliplogin: sliplogin.c Log Message: static + ANSIfy + __dead To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sliplogin/sliplogin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sliplogin/sliplogin.c diff -u src/usr.sbin/sliplogin/sliplogin.c:1.22 src/usr.sbin/sliplogin/sliplogin.c:1.23 --- src/usr.sbin/sliplogin/sliplogin.c:1.22 Mon Jul 21 13:36:59 2008 +++ src/usr.sbin/sliplogin/sliplogin.c Tue Aug 30 20:42:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sliplogin.c,v 1.22 2008/07/21 13:36:59 lukem Exp $ */ +/* $NetBSD: sliplogin.c,v 1.23 2011/08/30 20:42:22 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)sliplogin.c 8.2 (Berkeley) 2/1/94"; #else -__RCSID("$NetBSD: sliplogin.c,v 1.22 2008/07/21 13:36:59 lukem Exp $"); +__RCSID("$NetBSD: sliplogin.c,v 1.23 2011/08/30 20:42:22 joerg Exp $"); #endif #endif /* not lint */ @@ -100,21 +100,19 @@ #include "pathnames.h" -int unit; -int speed; -int uid; -char loginargs[BUFSIZ]; -char loginfile[MAXPATHLEN]; -char loginname[BUFSIZ]; - -void findid __P((char *)); -void hup_handler __P((int)); -int main __P((int, char **)); -const char *sigstr __P((int)); +static int unit; +static int speed; +static int uid; +static char loginargs[BUFSIZ]; +static char loginfile[MAXPATHLEN]; +static char loginname[BUFSIZ]; + +static void findid(const char *); +__dead static void hup_handler(int); +static const char *sigstr(int); -void -findid(name) - char *name; +static void +findid(const char *name) { FILE *fp; static char slopt[5][16]; @@ -168,9 +166,8 @@ /* NOTREACHED */ } -const char * -sigstr(s) - int s; +static const char * +sigstr(int s) { if (s > 0 && s < NSIG) @@ -183,9 +180,8 @@ } } -void -hup_handler(s) - int s; +static void +hup_handler(int s) { char logoutfile[MAXPATHLEN]; @@ -208,9 +204,7 @@ } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int fd, s, ldisc, odisc; char *name;
CVS commit: src/usr.sbin/screenblank
Module Name:src Committed By: joerg Date: Tue Aug 30 20:33:31 UTC 2011 Modified Files: src/usr.sbin/screenblank: screenblank.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/screenblank/screenblank.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/screenblank/screenblank.c diff -u src/usr.sbin/screenblank/screenblank.c:1.28 src/usr.sbin/screenblank/screenblank.c:1.29 --- src/usr.sbin/screenblank/screenblank.c:1.28 Mon Jul 21 13:36:59 2008 +++ src/usr.sbin/screenblank/screenblank.c Tue Aug 30 20:33:30 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: screenblank.c,v 1.28 2008/07/21 13:36:59 lukem Exp $ */ +/* $NetBSD: screenblank.c,v 1.29 2011/08/30 20:33:30 joerg Exp $ */ /*- * Copyright (c) 1996-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1996-2002\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: screenblank.c,v 1.28 2008/07/21 13:36:59 lukem Exp $"); +__RCSID("$NetBSD: screenblank.c,v 1.29 2011/08/30 20:33:30 joerg Exp $"); #endif #include @@ -68,9 +68,9 @@ #include "pathnames.h" -u_long setvideo = WSDISPLAYIO_SVIDEO; /* "set video" ioctl */ -int videoon = WSDISPLAYIO_VIDEO_ON; /* value for "on" */ -int videooff = WSDISPLAYIO_VIDEO_OFF; /* value for "off" */ +static u_long setvideo = WSDISPLAYIO_SVIDEO; /* "set video" ioctl */ +static int videoon = WSDISPLAYIO_VIDEO_ON; /* value for "on" */ +static int videooff = WSDISPLAYIO_VIDEO_OFF; /* value for "off" */ struct dev_stat { LIST_ENTRY(dev_stat) ds_link; /* linked list */ @@ -79,15 +79,14 @@ time_t ds_atime; /* time device last accessed */ time_t ds_mtime; /* time device last modified */ }; -LIST_HEAD(ds_list, dev_stat) ds_list; +static LIST_HEAD(ds_list, dev_stat) ds_list; -int main(int, char *[]); static void add_dev(const char *, int); static void change_state(int); static void cvt_arg(char *, struct timespec *); -static void sighandler(int); +__dead static void sighandler(int); static int is_graphics_fb(struct dev_stat *); -static void usage(void); +__dead static void usage(void); int main(int argc, char *argv[])
CVS commit: src/usr.sbin/rpc.bootparamd
Module Name:src Committed By: joerg Date: Tue Aug 30 20:29:41 UTC 2011 Modified Files: src/usr.sbin/rpc.bootparamd: bootparamd.c test.c Log Message: ANSIFy + static + __dead To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/rpc.bootparamd/bootparamd.c cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/rpc.bootparamd/test.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rpc.bootparamd/bootparamd.c diff -u src/usr.sbin/rpc.bootparamd/bootparamd.c:1.45 src/usr.sbin/rpc.bootparamd/bootparamd.c:1.46 --- src/usr.sbin/rpc.bootparamd/bootparamd.c:1.45 Sat Apr 18 12:57:10 2009 +++ src/usr.sbin/rpc.bootparamd/bootparamd.c Tue Aug 30 20:29:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootparamd.c,v 1.45 2009/04/18 12:57:10 lukem Exp $ */ +/* $NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $ */ /* * This code is not copyright, and is placed in the public domain. @@ -11,7 +11,7 @@ #include #ifndef lint -__RCSID("$NetBSD: bootparamd.c,v 1.45 2009/04/18 12:57:10 lukem Exp $"); +__RCSID("$NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $"); #endif #include @@ -53,7 +53,7 @@ static char askname[MAX_MACHINE_NAME]; static char domain_name[MAX_MACHINE_NAME]; -extern void bootparamprog_1 __P((struct svc_req *, SVCXPRT *)); +extern void bootparamprog_1(struct svc_req *, SVCXPRT *); int _rpcsvcdirty = 0; int _rpcpmstart = 0; @@ -64,19 +64,16 @@ const char *bootpfile = _PATH_BOOTPARAMS; char *iface = NULL; -int main __P((int, char *[])); -int lookup_bootparam __P((char *, char *, char *, char **, char **)); -void usage __P((void)); -static int get_localaddr __P((const char *, struct sockaddr_in *)); +static int lookup_bootparam(char *, char *, char *, char **, char **); +__dead static void usage(void); +static int get_localaddr(const char *, struct sockaddr_in *); /* * ever familiar */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; struct hostent *he; @@ -154,9 +151,7 @@ } bp_whoami_res * -bootparamproc_whoami_1_svc(whoami, rqstp) - bp_whoami_arg *whoami; - struct svc_req *rqstp; +bootparamproc_whoami_1_svc(bp_whoami_arg *whoami, struct svc_req *rqstp) { static bp_whoami_res res; struct hostent *he; @@ -228,9 +223,7 @@ bp_getfile_res * -bootparamproc_getfile_1_svc(getfile, rqstp) - bp_getfile_arg *getfile; - struct svc_req *rqstp; +bootparamproc_getfile_1_svc(bp_getfile_arg *getfile, struct svc_req *rqstp) { static bp_getfile_res res; struct hostent *he; @@ -312,13 +305,9 @@ } -int -lookup_bootparam(client, client_canonical, id, server, path) - char *client; - char *client_canonical; - char *id; - char **server; - char **path; +static int +lookup_bootparam(char *client, char *client_canonical, char *id, +char **server, char **path) { FILE *f = fopen(bootpfile, "r"); #ifdef YP @@ -462,8 +451,8 @@ return found ? ENOENT : EPERM; } -void -usage() +static void +usage(void) { fprintf(stderr, "usage: %s [-ds] [-i interface] [-r router] [-f bootparamsfile]\n", @@ -472,9 +461,7 @@ } static int -get_localaddr(ifname, sin) - const char *ifname; - struct sockaddr_in *sin; +get_localaddr(const char *ifname, struct sockaddr_in *sin) { struct ifaddrs *ifap, *ifa; Index: src/usr.sbin/rpc.bootparamd/test.c diff -u src/usr.sbin/rpc.bootparamd/test.c:1.3 src/usr.sbin/rpc.bootparamd/test.c:1.4 --- src/usr.sbin/rpc.bootparamd/test.c:1.3 Mon Apr 28 20:24:17 2008 +++ src/usr.sbin/rpc.bootparamd/test.c Tue Aug 30 20:29:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: test.c,v 1.3 2008/04/28 20:24:17 martin Exp $ */ +/* $NetBSD: test.c,v 1.4 2011/08/30 20:29:41 joerg Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: test.c,v 1.3 2008/04/28 20:24:17 martin Exp $"); +__RCSID("$NetBSD: test.c,v 1.4 2011/08/30 20:29:41 joerg Exp $"); #endif #include @@ -45,12 +45,8 @@ /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = {25, 0}; -int main(int, char *[]); - bp_whoami_res * -bootparamproc_whoami_1(argp, clnt) - bp_whoami_arg *argp; - CLIENT *clnt; +bootparamproc_whoami_1(bp_whoami_arg *argp, CLIENT *clnt) { static bp_whoami_res res; enum clnt_stat st; @@ -66,10 +62,8 @@ } -int -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { CLIENT *cli; bp_whoami_res *out;
CVS commit: src/usr.sbin/rarpd
Module Name:src Committed By: joerg Date: Tue Aug 30 20:25:18 UTC 2011 Modified Files: src/usr.sbin/rarpd: mkarp.c rarpd.c Log Message: static + __printflike + __dead To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/rarpd/mkarp.c cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/rarpd/rarpd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rarpd/mkarp.c diff -u src/usr.sbin/rarpd/mkarp.c:1.8 src/usr.sbin/rarpd/mkarp.c:1.9 --- src/usr.sbin/rarpd/mkarp.c:1.8 Sat Apr 18 08:50:23 2009 +++ src/usr.sbin/rarpd/mkarp.c Tue Aug 30 20:25:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mkarp.c,v 1.8 2009/04/18 08:50:23 lukem Exp $ */ +/* $NetBSD: mkarp.c,v 1.9 2011/08/30 20:25:18 joerg Exp $ */ /* * Copyright (c) 1984, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)arp.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: mkarp.c,v 1.8 2009/04/18 08:50:23 lukem Exp $"); +__RCSID("$NetBSD: mkarp.c,v 1.9 2011/08/30 20:25:18 joerg Exp $"); #endif #endif /* not lint */ @@ -82,7 +82,7 @@ int rtmsg(int, int, struct rt_msghdr *, struct sockaddr_inarp *, struct sockaddr_dl *); -struct { +static struct { struct rt_msghdr m_rtm; char m_space[512]; } m_rtmsg; Index: src/usr.sbin/rarpd/rarpd.c diff -u src/usr.sbin/rarpd/rarpd.c:1.58 src/usr.sbin/rarpd/rarpd.c:1.59 --- src/usr.sbin/rarpd/rarpd.c:1.58 Sat Apr 18 08:50:23 2009 +++ src/usr.sbin/rarpd/rarpd.c Tue Aug 30 20:25:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rarpd.c,v 1.58 2009/04/18 08:50:23 lukem Exp $ */ +/* $NetBSD: rarpd.c,v 1.59 2011/08/30 20:25:18 joerg Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -25,7 +25,7 @@ #endif /* not lint */ #ifndef lint -__RCSID("$NetBSD: rarpd.c,v 1.58 2009/04/18 08:50:23 lukem Exp $"); +__RCSID("$NetBSD: rarpd.c,v 1.59 2011/08/30 20:25:18 joerg Exp $"); #endif @@ -89,44 +89,41 @@ * The list of all interfaces that are being listened to. rarp_loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +static struct if_info *iflist; -u_int32_t choose_ipaddr(u_int32_t **, u_int32_t, u_int32_t); -void debug(const char *,...) - __attribute__((__format__(__printf__, 1, 2))); -void init_some(char *name); -void init_one(char *, u_int32_t); -u_int32_t ipaddrtonetmask(u_int32_t); -void lookup_eaddr(char *, u_char *); -void lookup_ipaddr(char *, u_int32_t *, u_int32_t *); -int main(int, char **); -void rarp_loop(void); -int rarp_open(char *); -void rarp_process(struct if_info *, u_char *); -void rarp_reply(struct if_info *, struct ether_header *, u_int32_t, - struct hostent *); -void rarperr(int, const char *,...) - __attribute__((__format__(__printf__, 2, 3))); +static u_int32_t choose_ipaddr(u_int32_t **, u_int32_t, u_int32_t); +static void debug(const char *,...) __printflike(1, 2); +static void init_some(char *name); +static void init_one(char *, u_int32_t); +static u_int32_t ipaddrtonetmask(u_int32_t); +static void lookup_eaddr(char *, u_char *); +static void lookup_ipaddr(char *, u_int32_t *, u_int32_t *); +static void rarp_loop(void) __dead; +static int rarp_open(char *); +static void rarp_process(struct if_info *, u_char *); +static void rarp_reply(struct if_info *, struct ether_header *, u_int32_t, + struct hostent *); +static void rarperr(int, const char *,...) __printflike(2, 3); #if defined(__NetBSD__) #include "mkarp.h" #else -void update_arptab(u_char *, u_int32_t); +static void update_arptab(u_char *, u_int32_t); #endif -void usage(void); +__dead static void usage(void); static int bpf_open(void); static int rarp_check(u_char *, int); #ifdef REQUIRE_TFTPBOOT -int rarp_bootable(u_int32_t); +static int rarp_bootable(u_int32_t); #endif -int aflag = 0; /* listen on "all" interfaces */ -int dflag = 0; /* print debugging messages */ -int fflag = 0; /* don't fork */ -int lflag = 0; /* log all replies */ +static int aflag = 0; /* listen on "all" interfaces */ +static int dflag = 0; /* print debugging messages */ +static int fflag = 0; /* don't fork */ +static int lflag = 0; /* log all replies */ int main(int argc, char **argv) @@ -189,7 +186,7 @@ * Add 'ifname' to the interface list. Lookup its IP address and network * mask and Ethernet address, and open a BPF file for it. */ -void +static void init_one(char *ifname, u_int32_t ipaddr) { struct if_info *h; @@ -237,7 +234,7 @@ * configuration list. A "candidate" is up, not loopback and not * point to point. */ -void +static void init_some(char *name) { struct ifaddrs *ifap, *ifa, *p; @@ -267,7 +264,7 @@ freeifaddrs(ifap); } -void +static void usage(void) { (void) fprintf(stderr, "Usage: %s -a [-d|-f] [-l]\n", getprogname()); @@ -293,7 +290,7 @@ * Open a BPF file and attach it to the interface named 'device'. * Set immediate mode, and set a filter that accepts only RARP
CVS commit: src/usr.sbin/perfused
Module Name:src Committed By: joerg Date: Tue Aug 30 20:17:01 UTC 2011 Modified Files: src/usr.sbin/perfused: debug.c msg.c perfused.c perfused.h Log Message: Fast backward code to 1989 and use ANSI C consistently. Use __dead. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/perfused/debug.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/perfused/msg.c cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/perfused/perfused.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/perfused/perfused.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/perfused/debug.c diff -u src/usr.sbin/perfused/debug.c:1.3 src/usr.sbin/perfused/debug.c:1.4 --- src/usr.sbin/perfused/debug.c:1.3 Wed Sep 15 01:51:44 2010 +++ src/usr.sbin/perfused/debug.c Tue Aug 30 20:17:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.3 2010/09/15 01:51:44 manu Exp $ */ +/* $NetBSD: debug.c,v 1.4 2011/08/30 20:17:00 joerg Exp $ */ /*- * Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved. @@ -35,9 +35,7 @@ #ifdef PERFUSE_DEBUG void -perfuse_hexdump(addr, len) - char *addr; - size_t len; +perfuse_hexdump(const char *addr, size_t len) { unsigned int i, j, k; Index: src/usr.sbin/perfused/msg.c diff -u src/usr.sbin/perfused/msg.c:1.15 src/usr.sbin/perfused/msg.c:1.16 --- src/usr.sbin/perfused/msg.c:1.15 Tue Aug 9 07:00:13 2011 +++ src/usr.sbin/perfused/msg.c Tue Aug 30 20:17:01 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.c,v 1.15 2011/08/09 07:00:13 manu Exp $ */ +/* $NetBSD: msg.c,v 1.16 2011/08/30 20:17:01 joerg Exp $ */ /*- * Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved. @@ -111,10 +111,7 @@ void * -perfuse_recv_early(fd, sockcred, sockcred_len) - int fd; - struct sockcred *sockcred; - size_t sockcred_len; +perfuse_recv_early(int fd, struct sockcred *sockcred, size_t sockcred_len) { struct fuse_out_header foh; size_t len; @@ -169,12 +166,8 @@ perfuse_msg_t * -perfuse_new_pb (pu, opc, opcode, payload_len, cred) - struct puffs_usermount *pu; - puffs_cookie_t opc; - int opcode; - size_t payload_len; - const struct puffs_cred *cred; +perfuse_new_pb (struct puffs_usermount *pu, puffs_cookie_t opc, int opcode, +size_t payload_len, const struct puffs_cred *cred) { struct puffs_framebuf *pb; struct fuse_in_header *fih; @@ -236,11 +229,8 @@ * This xchg_pb_inloop() variant allow early communication. */ static int -xchg_pb_early(pu, pb, fd, reply) - struct puffs_usermount *pu; - struct puffs_framebuf *pb; - int fd; - enum perfuse_xchg_pb_reply reply; +xchg_pb_early(struct puffs_usermount *pu, struct puffs_framebuf *pb, int fd, +enum perfuse_xchg_pb_reply reply) { int done; int error; @@ -268,11 +258,8 @@ } static int -xchg_pb_inloop(pu, pb, fd, reply) - struct puffs_usermount *pu; - struct puffs_framebuf *pb; - int fd; - enum perfuse_xchg_pb_reply reply; +xchg_pb_inloop(struct puffs_usermount *pu, struct puffs_framebuf *pb, int fd, +enum perfuse_xchg_pb_reply reply) { struct puffs_cc *pcc; int error; @@ -288,11 +275,8 @@ } int -perfuse_xchg_pb(pu, pm, expected_len, reply) - struct puffs_usermount *pu; - perfuse_msg_t *pm; - size_t expected_len; - enum perfuse_xchg_pb_reply reply; +perfuse_xchg_pb(struct puffs_usermount *pu, perfuse_msg_t *pm, +size_t expected_len, enum perfuse_xchg_pb_reply reply) { struct puffs_framebuf *pb = (struct puffs_framebuf *)(void *)pm; int fd; @@ -378,8 +362,7 @@ struct fuse_in_header * -perfuse_get_inhdr(pm) - perfuse_msg_t *pm; +perfuse_get_inhdr(perfuse_msg_t *pm) { struct puffs_framebuf *pb; struct fuse_in_header *fih; @@ -399,8 +382,7 @@ } struct fuse_out_header * -perfuse_get_outhdr(pm) - perfuse_msg_t *pm; +perfuse_get_outhdr(perfuse_msg_t *pm) { struct puffs_framebuf *pb; struct fuse_out_header *foh; @@ -420,8 +402,7 @@ } char * -perfuse_get_inpayload(pm) - perfuse_msg_t *pm; +perfuse_get_inpayload(perfuse_msg_t *pm) { struct puffs_framebuf *pb; struct fuse_in_header *fih; @@ -448,8 +429,7 @@ } char * -perfuse_get_outpayload(pm) - perfuse_msg_t *pm; +perfuse_get_outpayload(perfuse_msg_t *pm) { struct puffs_framebuf *pb; struct fuse_out_header *foh; @@ -490,11 +470,8 @@ /* ARGSUSED0 */ int -perfuse_readframe(pu, pufbuf, fd, done) - struct puffs_usermount *pu; - struct puffs_framebuf *pufbuf; - int fd; - int *done; +perfuse_readframe(struct puffs_usermount *pu, struct puffs_framebuf *pufbuf, +int fd, int *done) { struct fuse_out_header foh; size_t len; @@ -583,11 +560,8 @@ /* ARGSUSED0 */ int -perfuse_writeframe(pu, pufbuf, fd, done) - struct puffs_usermount *pu; - struct puffs_framebuf *pufbuf; - int fd; - int *done; +perfuse_writeframe(struct puffs_usermount *pu, struct puffs_framebuf *pufbuf, +int fd, int *done) { size_t len; ssize_t written; @@ -632,11 +606,8 @@ /* ARGSUSED0 */ int -perfuse_cmpframe(pu, pb1, pb2, match) - struct puffs_user
CVS commit: src/usr.sbin/pcictl
Module Name:src Committed By: joerg Date: Tue Aug 30 20:08:38 UTC 2011 Modified Files: src/usr.sbin/pcictl: pcictl.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/pcictl/pcictl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/pcictl/pcictl.c diff -u src/usr.sbin/pcictl/pcictl.c:1.17 src/usr.sbin/pcictl/pcictl.c:1.18 --- src/usr.sbin/pcictl/pcictl.c:1.17 Fri Feb 25 21:40:48 2011 +++ src/usr.sbin/pcictl/pcictl.c Tue Aug 30 20:08:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pcictl.c,v 1.17 2011/02/25 21:40:48 jmcneill Exp $ */ +/* $NetBSD: pcictl.c,v 1.18 2011/08/30 20:08:38 joerg Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -63,21 +63,21 @@ int open_flags; }; -static void usage(void); +__dead static void usage(void); -int pcifd; +static int pcifd; -struct pciio_businfo pci_businfo; +static struct pciio_businfo pci_businfo; -const char *dvname; -char dvname_store[MAXPATHLEN]; -const char *cmdname; -int print_numbers = 0; +static const char *dvname; +static char dvname_store[MAXPATHLEN]; +static const char *cmdname; +static int print_numbers = 0; static void cmd_list(int, char *[]); static void cmd_dump(int, char *[]); -const struct command commands[] = { +static const struct command commands[] = { { "list", "[-n] [-b bus] [-d device] [-f function]", cmd_list,
CVS commit: src/usr.sbin/nfsd
Module Name:src Committed By: joerg Date: Tue Aug 30 20:07:32 UTC 2011 Modified Files: src/usr.sbin/nfsd: nfsd.c Log Message: static + ANSIfy + __dead To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/nfsd/nfsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/nfsd/nfsd.c diff -u src/usr.sbin/nfsd/nfsd.c:1.57 src/usr.sbin/nfsd/nfsd.c:1.58 --- src/usr.sbin/nfsd/nfsd.c:1.57 Mon Dec 21 05:06:55 2009 +++ src/usr.sbin/nfsd/nfsd.c Tue Aug 30 20:07:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: nfsd.c,v 1.57 2009/12/21 05:06:55 christos Exp $ */ +/* $NetBSD: nfsd.c,v 1.58 2011/08/30 20:07:31 joerg Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95"; #else -__RCSID("$NetBSD: nfsd.c,v 1.57 2009/12/21 05:06:55 christos Exp $"); +__RCSID("$NetBSD: nfsd.c,v 1.58 2011/08/30 20:07:31 joerg Exp $"); #endif #endif /* not lint */ @@ -86,14 +86,13 @@ fprintf(stderr,(s), ## args); \ fprintf(stderr, "\n"); \ } while (/*CONSTCOND*/0) -int debug = 1; +static int debug = 1; #else -int debug = 0; +static int debug = 0; #endif -int main __P((int, char **)); -void nonfs __P((int)); -void usage __P((void)); +static void nonfs(int); +__dead static void usage(void); static void * worker(void *dummy) @@ -135,9 +134,7 @@ * followed by "n" which is the number of nfsd threads to create */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct nfsd_args nfsdargs; struct addrinfo *ai_udp, *ai_tcp, *ai_udp6, *ai_tcp6, hints; @@ -570,16 +567,15 @@ } } -void -usage() +static void +usage(void) { (void)fprintf(stderr, "usage: nfsd %s\n", USAGE); exit(1); } -void -nonfs(signo) - int signo; +static void +nonfs(int signo) { syslog(LOG_ERR, "missing system call: NFS not available."); }
CVS commit: src/usr.sbin/moused
Module Name:src Committed By: joerg Date: Tue Aug 30 20:03:52 UTC 2011 Modified Files: src/usr.sbin/moused: moused.c Log Message: static + __printflike + __dead + format string fixes To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/moused/moused.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/moused/moused.c diff -u src/usr.sbin/moused/moused.c:1.18 src/usr.sbin/moused/moused.c:1.19 --- src/usr.sbin/moused/moused.c:1.18 Fri Apr 17 14:02:21 2009 +++ src/usr.sbin/moused/moused.c Tue Aug 30 20:03:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: moused.c,v 1.18 2009/04/17 14:02:21 lukem Exp $ */ +/* $NetBSD: moused.c,v 1.19 2011/08/30 20:03:50 joerg Exp $ */ /** ** Copyright (c) 1995 Michael Smith, All rights reserved. ** @@ -48,7 +48,7 @@ #include #ifndef lint -__RCSID("$NetBSD: moused.c,v 1.18 2009/04/17 14:02:21 lukem Exp $"); +__RCSID("$NetBSD: moused.c,v 1.19 2011/08/30 20:03:50 joerg Exp $"); #endif /* not lint */ #include @@ -133,11 +133,11 @@ /* global variables */ -int dbg = 0; -int nodaemon = FALSE; -int background = FALSE; -int identify = ID_NONE; -const char *pidfile = "/var/run/moused.pid"; +static int dbg = 0; +static int nodaemon = FALSE; +static int background = FALSE; +static int identify = ID_NONE; +static const char *pidfile = "/var/run/moused.pid"; /* local variables */ @@ -438,9 +438,9 @@ /* function prototypes */ static void moused(const char *); -static void hup(int sig); -static void cleanup(int sig); -static void usage(void); +__dead static void hup(int sig); +__dead static void cleanup(int sig); +__dead static void usage(void); static int r_identify(void); static const char *r_if(int type); @@ -468,7 +468,7 @@ static int kidspad(u_char rxc, mousestatus_t *act); -static void +__printflike(1, 2) static void debug(const char *fmt, ...) { va_list ap; @@ -479,7 +479,7 @@ va_end(ap); } -static void +__dead __printflike(2, 3) static void logerr(int e, const char *fmt, ...) { va_list ap; @@ -496,7 +496,7 @@ va_end(ap); } -static void +__printflike(1, 2) static void logwarn(const char *fmt, ...) { va_list ap; @@ -512,7 +512,7 @@ va_end(ap); } -static void +__printflike(1, 2) static void logwarnx(const char *fmt, ...) { va_list ap; @@ -2152,7 +2152,7 @@ tv2.tv_sec = rodent.clickthreshold/1000; tv2.tv_usec = (rodent.clickthreshold%1000)*1000; timersub(&tv1, &tv2, &tv); -debug("tv: %ld %ld", tv.tv_sec, tv.tv_usec); +debug("tv: %ld %ld", tv.tv_sec, (long)tv.tv_usec); /* 3 button emulation timeout */ tv2.tv_sec = rodent.button2timeout/1000; @@ -2165,7 +2165,7 @@ if (act->button & button) { /* the button is down */ debug(" : %ld %ld", - bstate[i].tv.tv_sec, bstate[i].tv.tv_usec); + bstate[i].tv.tv_sec, (long)bstate[i].tv.tv_usec); if (timercmp(&tv, &bstate[i].tv, >)) { bstate[i].count = 1; } else {
CVS commit: src/usr.sbin/mountd
Module Name:src Committed By: joerg Date: Tue Aug 30 20:00:58 UTC 2011 Modified Files: src/usr.sbin/mountd: mountd.c Log Message: ANSIfy. Use __dead. To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/usr.sbin/mountd/mountd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/mountd/mountd.c diff -u src/usr.sbin/mountd/mountd.c:1.121 src/usr.sbin/mountd/mountd.c:1.122 --- src/usr.sbin/mountd/mountd.c:1.121 Tue Aug 30 17:06:21 2011 +++ src/usr.sbin/mountd/mountd.c Tue Aug 30 20:00:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mountd.c,v 1.121 2011/08/30 17:06:21 plunky Exp $ */ +/* $NetBSD: mountd.c,v 1.122 2011/08/30 20:00:58 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: mountd.c,v 1.121 2011/08/30 17:06:21 plunky Exp $"); +__RCSID("$NetBSD: mountd.c,v 1.122 2011/08/30 20:00:58 joerg Exp $"); #endif #endif/* not lint */ @@ -164,57 +164,57 @@ }; /* Global defs */ -static char*add_expdir __P((struct dirlist **, char *, int)); -static void add_dlist __P((struct dirlist **, struct dirlist *, -struct grouplist *, int)); -static void add_mlist __P((char *, char *, int)); -static int check_dirpath __P((const char *, size_t, char *)); -static int check_options __P((const char *, size_t, struct dirlist *)); -static int chk_host __P((struct dirlist *, struct sockaddr *, int *, int *)); -static int del_mlist __P((char *, char *, struct sockaddr *)); -static struct dirlist *dirp_search __P((struct dirlist *, char *)); -static int do_nfssvc __P((const char *, size_t, struct exportlist *, -struct grouplist *, int, struct uucred *, char *, int, struct statvfs *)); -static int do_opt __P((const char *, size_t, char **, char **, -struct exportlist *, struct grouplist *, int *, int *, struct uucred *)); -static struct exportlist *ex_search __P((fsid_t *)); -static int parse_directory __P((const char *, size_t, struct grouplist *, -int, char *, struct exportlist **, struct statvfs *)); -static int parse_host_netgroup __P((const char *, size_t, struct exportlist *, -struct grouplist *, char *, int *, struct grouplist **)); -static struct exportlist *get_exp __P((void)); -static void free_dir __P((struct dirlist *)); -static void free_exp __P((struct exportlist *)); -static void free_grp __P((struct grouplist *)); -static void free_host __P((struct hostlist *)); -static void get_exportlist __P((int)); -static int get_host __P((const char *, size_t, const char *, -struct grouplist *)); -static struct hostlist *get_ht __P((void)); -static void get_mountlist __P((void)); -static int get_net __P((char *, struct netmsk *, int)); -static void free_exp_grp __P((struct exportlist *, struct grouplist *)); -static struct grouplist *get_grp __P((void)); -static void hang_dirp __P((struct dirlist *, struct grouplist *, -struct exportlist *, int)); -static void mntsrv __P((struct svc_req *, SVCXPRT *)); -static void nextfield __P((char **, char **)); -static void parsecred __P((char *, struct uucred *)); -static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *)); -static int scan_tree __P((struct dirlist *, struct sockaddr *)); -static void send_umntall __P((int)); -static int umntall_each __P((caddr_t, struct sockaddr_in *)); -static int xdr_dir __P((XDR *, char *)); -static int xdr_explist __P((XDR *, caddr_t)); -static int xdr_fhs __P((XDR *, caddr_t)); -static int xdr_mlist __P((XDR *, caddr_t)); -static int bitcmp __P((void *, void *, int)); -static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int)); -static int sacmp __P((struct sockaddr *, struct sockaddr *)); -static int allones __P((struct sockaddr_storage *, int)); -static int countones __P((struct sockaddr *)); -static void bind_resv_port __P((int, sa_family_t, in_port_t)); -static void no_nfs(int); +static char*add_expdir(struct dirlist **, char *, int); +static void add_dlist(struct dirlist **, struct dirlist *, +struct grouplist *, int); +static void add_mlist(char *, char *, int); +static int check_dirpath(const char *, size_t, char *); +static int check_options(const char *, size_t, struct dirlist *); +static int chk_host(struct dirlist *, struct sockaddr *, int *, int *); +static int del_mlist(char *, char *, struct sockaddr *); +static struct dirlist *dirp_search(struct dirlist *, char *); +static int do_nfssvc(const char *, size_t, struct exportlist *, +struct grouplist *, int, struct uucred *, char *, int, struct statvfs *); +static int do_opt(const char *, size_t, char **, char **, +struct exportlist *, struct grouplist *, int *, int *, struct uucred *); +static struct exportlist *ex_search(fsid_t *); +static int parse_directory(const char *, size_t, struct grouplist *, +int, char *, struct exportlist **, struct stat
CVS commit: src/usr.sbin/mopd
Module Name:src Committed By: joerg Date: Tue Aug 30 19:49:11 UTC 2011 Modified Files: src/usr.sbin/mopd/common: cmp.h common.h device.c device.h dl.h file.c get.h log.h loop-bsd.c mopdef.c nma.c nma.h pf.h print.h put.h rc.h src/usr.sbin/mopd/mopchk: mopchk.c src/usr.sbin/mopd/mopcopy: mopcopy.c src/usr.sbin/mopd/mopd: mopd.c process.h src/usr.sbin/mopd/mopprobe: mopprobe.c src/usr.sbin/mopd/moptrace: moptrace.c Log Message: ANSIfy + __printflike + __dead To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/common/cmp.h \ src/usr.sbin/mopd/common/device.h src/usr.sbin/mopd/common/dl.h \ src/usr.sbin/mopd/common/nma.h src/usr.sbin/mopd/common/pf.h \ src/usr.sbin/mopd/common/print.h src/usr.sbin/mopd/common/put.h \ src/usr.sbin/mopd/common/rc.h cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/mopd/common/common.h cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/mopd/common/device.c cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mopd/common/file.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/mopd/common/get.h \ src/usr.sbin/mopd/common/nma.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/mopd/common/log.h cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mopd/common/loop-bsd.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/mopd/common/mopdef.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/mopd/mopchk/mopchk.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/mopd/mopcopy/mopcopy.c cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mopd/mopd/mopd.c cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/mopd/mopd/process.h cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mopd/mopprobe/mopprobe.c cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mopd/moptrace/moptrace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/mopd/common/cmp.h diff -u src/usr.sbin/mopd/common/cmp.h:1.6 src/usr.sbin/mopd/common/cmp.h:1.7 --- src/usr.sbin/mopd/common/cmp.h:1.6 Tue Nov 17 18:58:07 2009 +++ src/usr.sbin/mopd/common/cmp.h Tue Aug 30 19:49:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: cmp.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: cmp.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ * */ @@ -31,7 +31,7 @@ #define _CMP_H_ __BEGIN_DECLS -int mopCmpEAddr __P((const u_char *, const u_char *)); +int mopCmpEAddr(const u_char *, const u_char *); __END_DECLS #endif /* _CMP_H_ */ Index: src/usr.sbin/mopd/common/device.h diff -u src/usr.sbin/mopd/common/device.h:1.6 src/usr.sbin/mopd/common/device.h:1.7 --- src/usr.sbin/mopd/common/device.h:1.6 Tue Nov 17 18:58:07 2009 +++ src/usr.sbin/mopd/common/device.h Tue Aug 30 19:49:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: device.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: device.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ * */ @@ -32,17 +32,17 @@ __BEGIN_DECLS #ifdef DEV_NEW_CONF -void deviceEthAddr __P((const char *, u_char *)); +void deviceEthAddr(const char *, u_char *); #endif -void deviceInitOne __P((const char *)); -void deviceInitAll __P((void)); +void deviceInitOne(const char *); +void deviceInitAll(void); /* from loop-bsd.c */ -void Loop __P((void)); -int mopOpenDL __P((struct if_info *, int)); -int mopOpenRC __P((struct if_info *, int)); -void mopReadDL __P((void)); -void mopReadRC __P((void)); +__dead void Loop(void); +int mopOpenDL(struct if_info *, int); +int mopOpenRC(struct if_info *, int); +void mopReadDL(void); +void mopReadRC(void); __END_DECLS #endif /* _DEVICE_H_ */ Index: src/usr.sbin/mopd/common/dl.h diff -u src/usr.sbin/mopd/common/dl.h:1.6 src/usr.sbin/mopd/common/dl.h:1.7 --- src/usr.sbin/mopd/common/dl.h:1.6 Tue Nov 17 18:58:07 2009 +++ src/usr.sbin/mopd/common/dl.h Tue Aug 30 19:49:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: dl.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: dl.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ * */ @@ -31,7 +31,7 @@ #define _DL_H_ __BEG
CVS commit: src/usr.sbin/lpr
Module Name:src Committed By: joerg Date: Tue Aug 30 19:27:37 UTC 2011 Modified Files: src/usr.sbin/lpr/common_source: lp.h src/usr.sbin/lpr/filters: lpf.c src/usr.sbin/lpr/lpc: extern.h lpc.c src/usr.sbin/lpr/lpd: extern.h lpd.c printjob.c recvjob.c src/usr.sbin/lpr/lpr: lpr.c src/usr.sbin/lpr/pac: pac.c Log Message: static, __printflike, __dead To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/lpr/common_source/lp.h cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/lpr/filters/lpf.c cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/lpr/lpc/extern.h cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/lpr/lpc/lpc.c cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/lpr/lpd/extern.h cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/lpr/lpd/lpd.c \ src/usr.sbin/lpr/lpd/printjob.c cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/lpr/lpd/recvjob.c cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/lpr/lpr/lpr.c cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/lpr/pac/pac.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/lpr/common_source/lp.h diff -u src/usr.sbin/lpr/common_source/lp.h:1.24 src/usr.sbin/lpr/common_source/lp.h:1.25 --- src/usr.sbin/lpr/common_source/lp.h:1.24 Mon Jul 13 19:05:41 2009 +++ src/usr.sbin/lpr/common_source/lp.h Tue Aug 30 19:27:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lp.h,v 1.24 2009/07/13 19:05:41 roy Exp $ */ +/* $NetBSD: lp.h,v 1.25 2011/08/30 19:27:37 joerg Exp $ */ /* * Copyright (c) 1983, 1993 @@ -105,8 +105,7 @@ int chk(const char *); void displayq(int); void dump(const char *, const char *, int); -void fatal(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +void fatal(const char *, ...) __dead __printflike(1, 2); size_t get_line(FILE *); const char *gethost(const char *); int getport(const char *); @@ -121,7 +120,7 @@ int lockchk(const char *); void prank(int); void process(const char *); -void rmjob(void); +void rmjob(void) __dead; void rmremote(void); void show(const char *, const char *, int); int startdaemon(const char *); Index: src/usr.sbin/lpr/filters/lpf.c diff -u src/usr.sbin/lpr/filters/lpf.c:1.13 src/usr.sbin/lpr/filters/lpf.c:1.14 --- src/usr.sbin/lpr/filters/lpf.c:1.13 Mon Jul 21 13:36:58 2008 +++ src/usr.sbin/lpr/filters/lpf.c Tue Aug 30 19:27:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lpf.c,v 1.13 2008/07/21 13:36:58 lukem Exp $ */ +/* $NetBSD: lpf.c,v 1.14 2011/08/30 19:27:37 joerg Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)lpf.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: lpf.c,v 1.13 2008/07/21 13:36:58 lukem Exp $"); +__RCSID("$NetBSD: lpf.c,v 1.14 2011/08/30 19:27:37 joerg Exp $"); #endif #endif /* not lint */ @@ -57,22 +57,21 @@ #define MAXWIDTH 132 #define MAXREP10 -char buf[MAXREP][MAXWIDTH]; -int maxcol[MAXREP] = {-1}; -int lineno; -int width = 132; /* default line length */ -int length = 66; /* page length */ -int indent; /* indentation length */ -int npages = 1; -int literal; /* print control characters */ -char *name; /* user's login name */ -char *host; /* user's machine name */ -char *acctfile; /* accounting information file */ -int crnl; /* \n -> \r\n */ -int need_cr; +static char buf[MAXREP][MAXWIDTH]; +static int maxcol[MAXREP] = {-1}; +static int lineno; +static int width = 132; /* default line length */ +static int length = 66; /* page length */ +static int indent; /* indentation length */ +static int npages = 1; +static int literal; /* print control characters */ +static char *name; /* user's login name */ +static char *host; /* user's machine name */ +static char *acctfile; /* accounting information file */ +static int crnl; /* \n -> \r\n */ +static int need_cr; -int main(int, char *[]); -void usage(void); +__dead static void usage(void); int main(int argc, char *argv[]) @@ -226,7 +225,7 @@ exit(0); } -void +static void usage(void) { fprintf(stderr, Index: src/usr.sbin/lpr/lpc/extern.h diff -u src/usr.sbin/lpr/lpc/extern.h:1.5 src/usr.sbin/lpr/lpc/extern.h:1.6 --- src/usr.sbin/lpr/lpc/extern.h:1.5 Thu Aug 7 11:25:27 2003 +++ src/usr.sbin/lpr/lpc/extern.h Tue Aug 30 19:27:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.5 2003/08/07 11:25:27 agc Exp $ */ +/* $NetBSD: extern.h,v 1.6 2011/08/30 19:27:37 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -43,7 +43,7 @@ void down(int, char **); void enable(int, char **); void help(int, char **); -void quit(int, char **); +void quit(int, char **) __dead; void restart(int, char **); void startcmd(int, char **); void status(int, char **); Index: src/usr.sbin/lpr/lpc/lpc.c diff -u src/usr.sbin/lpr/lpc/lpc.c:1.25 src/usr.sbin/lpr/lpc/lpc.c:1.26 --- src/usr.sbin/lpr/lpc/lpc.c:1.25 Sun Jan 18 09:57:26 2009 +++ src/usr.sbin/lpr/lp
CVS commit: src/usr.sbin/lockstat
Module Name:src Committed By: joerg Date: Tue Aug 30 19:20:20 UTC 2011 Modified Files: src/usr.sbin/lockstat: main.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/lockstat/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/lockstat/main.c diff -u src/usr.sbin/lockstat/main.c:1.17 src/usr.sbin/lockstat/main.c:1.18 --- src/usr.sbin/lockstat/main.c:1.17 Thu Apr 16 06:14:13 2009 +++ src/usr.sbin/lockstat/main.c Tue Aug 30 19:20:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.17 2009/04/16 06:14:13 lukem Exp $ */ +/* $NetBSD: main.c,v 1.18 2011/08/30 19:20:20 joerg Exp $ */ /*- * Copyright (c) 2006, 2007, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.17 2009/04/16 06:14:13 lukem Exp $"); +__RCSID("$NetBSD: main.c,v 1.18 2011/08/30 19:20:20 joerg Exp $"); #endif /* not lint */ #include @@ -88,7 +88,7 @@ int mask; } name_t; -const name_t locknames[] = { +static const name_t locknames[] = { { "adaptive_mutex", LB_ADAPTIVE_MUTEX }, { "spin_mutex", LB_SPIN_MUTEX }, { "rwlock", LB_RWLOCK }, @@ -98,14 +98,14 @@ { NULL, 0 } }; -const name_t eventnames[] = { +static const name_t eventnames[] = { { "spin", LB_SPIN }, { "sleep_exclusive", LB_SLEEP1 }, { "sleep_shared", LB_SLEEP2 }, { NULL, 0 }, }; -const name_t alltypes[] = { +static const name_t alltypes[] = { { "Adaptive mutex spin", LB_ADAPTIVE_MUTEX | LB_SPIN }, { "Adaptive mutex sleep", LB_ADAPTIVE_MUTEX | LB_SLEEP1 }, { "Spin mutex spin", LB_SPIN_MUTEX | LB_SPIN }, @@ -118,43 +118,43 @@ { NULL, 0 } }; -const name_t xtypes[] = { +static const name_t xtypes[] = { { "Spin", LB_SPIN }, { "Sleep (writer)", LB_SLEEP1 }, { "Sleep (reader)", LB_SLEEP2 }, { NULL, 0 } }; -locklist_t locklist; -locklist_t freelist; -locklist_t sortlist; - -lsbuf_t *bufs; -lsdisable_t ld; -bool lflag; -bool fflag; -int nbufs; -bool cflag; -bool xflag; -int lsfd; -int displayed; -int bin64; -double tscale; -double cscale; -double cpuscale[sizeof(ld.ld_freq) / sizeof(ld.ld_freq[0])]; -FILE *outfp; - -void findsym(findsym_t, char *, uintptr_t *, uintptr_t *, bool); -void spawn(int, char **); -void display(int, const char *name); -void listnames(const name_t *); -void collapse(bool, bool); -int matchname(const name_t *, char *); -void makelists(int, int); -void nullsig(int); -void usage(void); -int ncpu(void); -lock_t *morelocks(void); +static locklist_t locklist; +static locklist_t freelist; +static locklist_t sortlist; + +static lsbuf_t *bufs; +static lsdisable_t ld; +static bool lflag; +static bool fflag; +static int nbufs; +static bool cflag; +static bool xflag; +static int lsfd; +static int displayed; +static int bin64; +static double tscale; +static double cscale; +static double cpuscale[sizeof(ld.ld_freq) / sizeof(ld.ld_freq[0])]; +static FILE *outfp; + +static void findsym(findsym_t, char *, uintptr_t *, uintptr_t *, bool); +static void spawn(int, char **); +static void display(int, const char *name); +__dead static void listnames(const name_t *); +static void collapse(bool, bool); +static int matchname(const name_t *, char *); +static void makelists(int, int); +static void nullsig(int); +__dead static void usage(void); +static int ncpu(void); +static lock_t *morelocks(void); int main(int argc, char **argv) @@ -386,7 +386,7 @@ exit(EXIT_SUCCESS); } -void +static void usage(void) { @@ -415,14 +415,14 @@ exit(EXIT_FAILURE); } -void +static void nullsig(int junk) { (void)junk; } -void +static void listnames(const name_t *name) { @@ -432,7 +432,7 @@ exit(EXIT_SUCCESS); } -int +static int matchname(const name_t *name, char *string) { int empty, mask; @@ -465,7 +465,7 @@ /* * Return the number of CPUs in the running system. */ -int +static int ncpu(void) { int rv, mib[2]; @@ -483,7 +483,7 @@ /* * Call into the ELF parser and look up a symbol by name or by address. */ -void +static void findsym(findsym_t find, char *name, uintptr_t *start, uintptr_t *end, bool chg) { uintptr_t tend, sa, ea; @@ -527,7 +527,7 @@ * so that the caller can use Ctrl-C to stop tracing early and still get * useful results. */ -void +static void spawn(int argc, char **argv) { pid_t pid; @@ -552,7 +552,7 @@ /* * Allocate a new block of lock_t structures. */ -lock_t * +static lock_t * morelocks(void) { const int batch = 32; @@ -569,7 +569,7 @@ /* * Collapse addresses from unique objects. */ -void +static void collapse(bool func, bool lock) { lsbuf_t *lb, *max; @@ -590,7 +590,7 @@ * From the kernel supplied data, construct two dimensional lists of locks * and event buffers, indexed by lock type and sorted by event type. */ -void +static void makelists(int mask, int event) { lsbuf_t *lb, *lb2, *max
CVS commit: src/usr.sbin/link
Module Name:src Committed By: joerg Date: Tue Aug 30 19:18:17 UTC 2011 Modified Files: src/usr.sbin/link: link.c Log Message: ANSIfy + __dead To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/link/link.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/link/link.c diff -u src/usr.sbin/link/link.c:1.4 src/usr.sbin/link/link.c:1.5 --- src/usr.sbin/link/link.c:1.4 Mon Jul 21 13:36:58 2008 +++ src/usr.sbin/link/link.c Tue Aug 30 19:18:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: link.c,v 1.4 2008/07/21 13:36:58 lukem Exp $ */ +/* $NetBSD: link.c,v 1.5 2011/08/30 19:18:17 joerg Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ __COPYRIGHT( "@(#) Copyright (c) 1999\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: link.c,v 1.4 2008/07/21 13:36:58 lukem Exp $"); +__RCSID("$NetBSD: link.c,v 1.5 2011/08/30 19:18:17 joerg Exp $"); #endif #include @@ -42,13 +42,10 @@ #include #include -int main __P((int, char *[])); -static void usage __P((void)); +__dead static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { (void)setlocale(LC_ALL, ""); @@ -66,7 +63,7 @@ } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: link file1 file2\n");
CVS commit: src/usr.sbin/irdaattach
Module Name:src Committed By: joerg Date: Tue Aug 30 19:07:07 UTC 2011 Modified Files: src/usr.sbin/irdaattach: irdaattach.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/irdaattach/irdaattach.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/irdaattach/irdaattach.c diff -u src/usr.sbin/irdaattach/irdaattach.c:1.8 src/usr.sbin/irdaattach/irdaattach.c:1.9 --- src/usr.sbin/irdaattach/irdaattach.c:1.8 Thu Apr 16 02:11:44 2009 +++ src/usr.sbin/irdaattach/irdaattach.c Tue Aug 30 19:07:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: irdaattach.c,v 1.8 2009/04/16 02:11:44 lukem Exp $ */ +/* $NetBSD: irdaattach.c,v 1.9 2011/08/30 19:07:07 joerg Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -46,8 +46,7 @@ #include #include -int main(int, char **); -void usage(void); +__dead static void usage(void); int main(int argc, char **argv) @@ -157,8 +156,8 @@ sigsuspend(&nsigset); } -void -usage() +static void +usage(void) { fprintf(stderr, "usage: %s [-d donglename] [-fhHlmnp] ttyname\n",
CVS commit: src/usr.sbin/iostat
Module Name:src Committed By: joerg Date: Tue Aug 30 19:06:06 UTC 2011 Modified Files: src/usr.sbin/iostat: iostat.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/iostat/iostat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/iostat/iostat.c diff -u src/usr.sbin/iostat/iostat.c:1.59 src/usr.sbin/iostat/iostat.c:1.60 --- src/usr.sbin/iostat/iostat.c:1.59 Mon Feb 14 02:43:37 2011 +++ src/usr.sbin/iostat/iostat.c Tue Aug 30 19:06:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $ */ +/* $NetBSD: iostat.c,v 1.60 2011/08/30 19:06:06 joerg Exp $ */ /* * Copyright (c) 1996 John M. Vinopal @@ -71,7 +71,7 @@ #if 0 static char sccsid[] = "@(#)iostat.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $"); +__RCSID("$NetBSD: iostat.c,v 1.60 2011/08/30 19:06:06 joerg Exp $"); #endif #endif /* not lint */ @@ -94,7 +94,8 @@ /* Namelist and memory files. */ char *nlistf, *memf; -int hz, reps, interval; +int hz; +static int reps, interval; static int todo = 0; static int defdrives; static int winlines = 20; @@ -118,12 +119,10 @@ static void sig_header(int); static volatile int do_header; static void header(void); -static void usage(void); +__dead static void usage(void); static void display(void); static int selectdrives(int, char *[]); -int main(int, char *[]); - int main(int argc, char *argv[]) { @@ -248,7 +247,7 @@ } static void -header() +header(void) { size_t i;
CVS commit: src/sys/dist/pf/net
Module Name:src Committed By: jmcneill Date: Tue Aug 30 19:05:12 UTC 2011 Modified Files: src/sys/dist/pf/net: pf_ioctl.c Log Message: fix -Wshadow warnings when ALTQ is enabled To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dist/pf/net/pf_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dist/pf/net/pf_ioctl.c diff -u src/sys/dist/pf/net/pf_ioctl.c:1.44 src/sys/dist/pf/net/pf_ioctl.c:1.45 --- src/sys/dist/pf/net/pf_ioctl.c:1.44 Mon Aug 29 09:50:04 2011 +++ src/sys/dist/pf/net/pf_ioctl.c Tue Aug 30 19:05:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pf_ioctl.c,v 1.44 2011/08/29 09:50:04 jmcneill Exp $ */ +/* $NetBSD: pf_ioctl.c,v 1.45 2011/08/30 19:05:12 jmcneill Exp $ */ /* $OpenBSD: pf_ioctl.c,v 1.182 2007/06/24 11:17:13 mcbride Exp $ */ /* @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.44 2011/08/29 09:50:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.45 2011/08/30 19:05:12 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2221,10 +2221,10 @@ } case DIOCADDALTQ: { - struct pfioc_altq *pa = (struct pfioc_altq *)addr; + struct pfioc_altq *paa = (struct pfioc_altq *)addr; struct pf_altq *altq, *a; - if (pa->ticket != ticket_altqs_inactive) { + if (paa->ticket != ticket_altqs_inactive) { error = EBUSY; break; } @@ -2233,7 +2233,7 @@ error = ENOMEM; break; } - bcopy(&pa->altq, altq, sizeof(struct pf_altq)); + bcopy(&paa->altq, altq, sizeof(struct pf_altq)); /* * if this is for a queue, find the discipline and @@ -2261,33 +2261,33 @@ } TAILQ_INSERT_TAIL(pf_altqs_inactive, altq, entries); - bcopy(altq, &pa->altq, sizeof(struct pf_altq)); + bcopy(altq, &paa->altq, sizeof(struct pf_altq)); break; } case DIOCGETALTQS: { - struct pfioc_altq *pa = (struct pfioc_altq *)addr; + struct pfioc_altq *paa = (struct pfioc_altq *)addr; struct pf_altq *altq; - pa->nr = 0; + paa->nr = 0; TAILQ_FOREACH(altq, pf_altqs_active, entries) - pa->nr++; - pa->ticket = ticket_altqs_active; + paa->nr++; + paa->ticket = ticket_altqs_active; break; } case DIOCGETALTQ: { - struct pfioc_altq *pa = (struct pfioc_altq *)addr; + struct pfioc_altq *paa = (struct pfioc_altq *)addr; struct pf_altq *altq; u_int32_t nr; - if (pa->ticket != ticket_altqs_active) { + if (paa->ticket != ticket_altqs_active) { error = EBUSY; break; } nr = 0; altq = TAILQ_FIRST(pf_altqs_active); - while ((altq != NULL) && (nr < pa->nr)) { + while ((altq != NULL) && (nr < paa->nr)) { altq = TAILQ_NEXT(altq, entries); nr++; } @@ -2295,7 +2295,7 @@ error = EBUSY; break; } - bcopy(altq, &pa->altq, sizeof(struct pf_altq)); + bcopy(altq, &paa->altq, sizeof(struct pf_altq)); break; }
CVS commit: src/usr.sbin/iopctl
Module Name:src Committed By: joerg Date: Tue Aug 30 19:03:25 UTC 2011 Modified Files: src/usr.sbin/iopctl: iopctl.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/iopctl/iopctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/iopctl/iopctl.c diff -u src/usr.sbin/iopctl/iopctl.c:1.21 src/usr.sbin/iopctl/iopctl.c:1.22 --- src/usr.sbin/iopctl/iopctl.c:1.21 Sun Aug 14 23:13:43 2011 +++ src/usr.sbin/iopctl/iopctl.c Tue Aug 30 19:03:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $ */ +/* $NetBSD: iopctl.c,v 1.22 2011/08/30 19:03:25 joerg Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #ifndef lint #include -__RCSID("$NetBSD: iopctl.c,v 1.21 2011/08/14 23:13:43 dholland Exp $"); +__RCSID("$NetBSD: iopctl.c,v 1.22 2011/08/30 19:03:25 joerg Exp $"); #endif /* not lint */ #include @@ -51,23 +51,21 @@ #include #include -const char *class2str(int); -void getparam(int, int, void *, int); -int gettid(char **); -int main(int, char **); -int show(const char *, const char *, ...) -__attribute__((__format__(__printf__, 2, 3))); -void i2ostrvis(const u_char *, int, char *, int); -void usage(void); - -void reconfig(char **); -void showdevid(char **); -void showddmid(char **); -void showlct(char **); -void showstatus(char **); -void showtidmap(char **); +static const char *class2str(int); +static void getparam(int, int, void *, int); +static int gettid(char **); +static int show(const char *, const char *, ...) __printflike(2, 3); +static void i2ostrvis(const u_char *, int, char *, int); +static void usage(void) __dead; + +static void reconfig(char **); +static void showdevid(char **); +static void showddmid(char **); +static void showlct(char **); +static void showstatus(char **); +static void showtidmap(char **); -struct { +static struct { int class; const char *caption; } const i2oclass[] = { @@ -87,7 +85,7 @@ { I2O_CLASS_BUS_ADAPTER_PORT, "bus adapter port" }, }; -struct { +static struct { const char *label; int takesargs; void (*func)(char **); @@ -100,9 +98,9 @@ { "showtidmap", 0, showtidmap }, }; -int fd; -char buf[32768]; -struct i2o_status status; +static int fd; +static char buf[32768]; +static struct i2o_status status; int main(int argc, char **argv) @@ -153,7 +151,7 @@ /* NOTREACHED */ } -void +static void usage(void) { @@ -163,7 +161,7 @@ /* NOTREACHED */ } -int +static int show(const char *hdr, const char *fmt, ...) { int i; @@ -178,7 +176,7 @@ return (i); } -const char * +static const char * class2str(int class) { size_t i; @@ -190,7 +188,7 @@ return ("unknown"); } -void +static void getparam(int tid, int group, void *pbuf, int pbufsize) { struct ioppt pt; @@ -237,7 +235,7 @@ rf->reqstatus); } -void +static void showlct(char **argv) { struct iovec iov; @@ -291,7 +289,7 @@ } } -void +static void showstatus(char **argv) { char ident[sizeof(status.productid) + 1]; @@ -333,7 +331,7 @@ le32toh(status.currentpriviobase)); } -void +static void showddmid(char **argv) { struct { @@ -358,7 +356,7 @@ show("serial #", "%08x%08x%08x", serial[0], serial[1], serial[2]); } -void +static void showdevid(char **argv) { struct { @@ -392,7 +390,7 @@ show("revision level", "<%s>", ident); } -void +static void reconfig(char **argv) { @@ -400,7 +398,7 @@ err(EXIT_FAILURE, "IOPIOCRECONFIG"); } -void +static void showtidmap(char **argv) { struct iovec iov; @@ -421,7 +419,7 @@ printf("%s\ttid %d\n", it->it_dvname, it->it_tid); } -void +static void i2ostrvis(const u_char *src, int slen, char *dst, int dlen) { int hc, lc, i, nit; @@ -455,7 +453,7 @@ dst[lc] = '\0'; } -int +static int gettid(char **argv) { char *argp;
CVS commit: src/usr.sbin/ifwatchd
Module Name:src Committed By: joerg Date: Tue Aug 30 18:57:38 UTC 2011 Modified Files: src/usr.sbin/ifwatchd: ifwatchd.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/ifwatchd/ifwatchd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/ifwatchd/ifwatchd.c diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.25 src/usr.sbin/ifwatchd/ifwatchd.c:1.26 --- src/usr.sbin/ifwatchd/ifwatchd.c:1.25 Fri Feb 4 14:31:23 2011 +++ src/usr.sbin/ifwatchd/ifwatchd.c Tue Aug 30 18:57:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ifwatchd.c,v 1.25 2011/02/04 14:31:23 martin Exp $ */ +/* $NetBSD: ifwatchd.c,v 1.26 2011/08/30 18:57:38 joerg Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ enum event { ARRIVAL, DEPARTURE, UP, DOWN, CARRIER, NO_CARRIER }; /* local functions */ -static void usage(void); +__dead static void usage(void); static void dispatch(void*, size_t); static void check_addrs(char *cp, int addrs, enum event ev); static void invoke_script(struct sockaddr *sa, struct sockaddr *dst, enum event ev, int ifindex, const char *ifname_hint); @@ -110,7 +110,7 @@ int last_carrier_status; char * ifname; }; -SLIST_HEAD(,interface_data) ifs = SLIST_HEAD_INITIALIZER(ifs); +static SLIST_HEAD(,interface_data) ifs = SLIST_HEAD_INITIALIZER(ifs); int main(int argc, char **argv)
CVS commit: src/usr.sbin/gspa/gspa
Module Name:src Committed By: joerg Date: Tue Aug 30 18:53:42 UTC 2011 Modified Files: src/usr.sbin/gspa/gspa: gsp_ass.h gspa.c Log Message: Use __dead and __printflike To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/gspa/gspa/gsp_ass.h cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/gspa/gspa/gspa.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/gspa/gspa/gsp_ass.h diff -u src/usr.sbin/gspa/gspa/gsp_ass.h:1.12 src/usr.sbin/gspa/gspa/gsp_ass.h:1.13 --- src/usr.sbin/gspa/gspa/gsp_ass.h:1.12 Wed Apr 15 08:26:34 2009 +++ src/usr.sbin/gspa/gspa/gsp_ass.h Tue Aug 30 18:53:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gsp_ass.h,v 1.12 2009/04/15 08:26:34 lukem Exp $ */ +/* $NetBSD: gsp_ass.h,v 1.13 2011/08/30 18:53:41 joerg Exp $ */ /* * GSP assembler - definitions * @@ -144,10 +144,8 @@ void listing(void); symbol lookup(char *id, bool makeit); expr num_expr(int); -void p1err(const char *fmt, ...) - __attribute__((__format__(__printf__, 1, 2))); -void perr(const char *fmt, ...) - __attribute__((__format__(__printf__, 1, 2))); +void p1err(const char *fmt, ...) __printflike(1, 2); +void perr(const char *fmt, ...) __printflike(1, 2); void pseudo(int code, operand operands); void push_input(char *fn); void putcode(u_int16_t *, int); @@ -162,7 +160,7 @@ void statement(char *opcode, operand operands); operand string_op(char *); void ucasify(char *); -void yyerror(const char *err); +__dead void yyerror(const char *err); int yylex(void); Index: src/usr.sbin/gspa/gspa/gspa.c diff -u src/usr.sbin/gspa/gspa/gspa.c:1.14 src/usr.sbin/gspa/gspa/gspa.c:1.15 --- src/usr.sbin/gspa/gspa/gspa.c:1.14 Wed Apr 15 08:26:35 2009 +++ src/usr.sbin/gspa/gspa/gspa.c Tue Aug 30 18:53:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gspa.c,v 1.14 2009/04/15 08:26:35 lukem Exp $ */ +/* $NetBSD: gspa.c,v 1.15 2011/08/30 18:53:41 joerg Exp $ */ /* * GSP assembler main program * @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("$NetBSD: gspa.c,v 1.14 2009/04/15 08:26:35 lukem Exp $"); +__RCSID("$NetBSD: gspa.c,v 1.15 2011/08/30 18:53:41 joerg Exp $"); #endif #include @@ -83,7 +83,7 @@ jmp_buf synerrjmp; void setext(char *, const char *, const char *); -void usage(void); +__dead static void usage(void); int yyparse(void); void c_dumpbuf(void); @@ -287,8 +287,8 @@ longjmp(synerrjmp, 1); } -void -usage() +static void +usage(void) { fprintf(stderr, "Usage: gspa [-c c_array_name] [-l list_file] [-o hex_file] [infile]\n");
CVS commit: src/usr.sbin/gpioctl
Module Name:src Committed By: joerg Date: Tue Aug 30 18:50:48 UTC 2011 Modified Files: src/usr.sbin/gpioctl: gpioctl.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/gpioctl/gpioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/gpioctl/gpioctl.c diff -u src/usr.sbin/gpioctl/gpioctl.c:1.11 src/usr.sbin/gpioctl/gpioctl.c:1.12 --- src/usr.sbin/gpioctl/gpioctl.c:1.11 Sun Aug 28 07:48:50 2011 +++ src/usr.sbin/gpioctl/gpioctl.c Tue Aug 30 18:50:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gpioctl.c,v 1.11 2011/08/28 07:48:50 mbalmer Exp $ */ +/* $NetBSD: gpioctl.c,v 1.12 2011/08/30 18:50:48 joerg Exp $ */ /* * Copyright (c) 2008, 2010 Marc Balmer @@ -36,9 +36,9 @@ #include #include -char *dev; -int devfd = -1; -int quiet = 0; +static char *dev; +static int devfd = -1; +static int quiet = 0; static void getinfo(void); static void gpioread(int, char *); @@ -48,12 +48,12 @@ static void gpiounset(int pin, char *name); static void devattach(char *, int, uint32_t); static void devdetach(char *); -static void usage(void); +__dead static void usage(void); extern long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp); -const struct bitstr { +static const struct bitstr { unsigned int mask; const char *string; } pinflags[] = {
CVS commit: src/usr.sbin/fssconfig
Module Name:src Committed By: joerg Date: Tue Aug 30 18:30:13 UTC 2011 Modified Files: src/usr.sbin/fssconfig: fssconfig.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/fssconfig/fssconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/fssconfig/fssconfig.c diff -u src/usr.sbin/fssconfig/fssconfig.c:1.7 src/usr.sbin/fssconfig/fssconfig.c:1.8 --- src/usr.sbin/fssconfig/fssconfig.c:1.7 Thu Feb 24 09:38:58 2011 +++ src/usr.sbin/fssconfig/fssconfig.c Tue Aug 30 18:30:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fssconfig.c,v 1.7 2011/02/24 09:38:58 hannken Exp $ */ +/* $NetBSD: fssconfig.c,v 1.8 2011/08/30 18:30:13 joerg Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -45,13 +45,13 @@ #include -int vflag = 0; -int xflag = 0; +static int vflag = 0; +static int xflag = 0; -void config(int, char **); -void unconfig(int, char **); -void list(int, char **); -void usage(void); +static void config(int, char **); +static void unconfig(int, char **); +static void list(int, char **); +__dead static void usage(void); int main(int argc, char **argv) @@ -93,7 +93,7 @@ exit(0); } -void +static void config(int argc, char **argv) { int fd, isreg, istmp, ispersistent; @@ -182,7 +182,7 @@ list(1, argv); } -void +static void unconfig(int argc, char **argv) { int fd; @@ -201,7 +201,7 @@ err(1, "%s: FSSIOCCLR", full); } -void +static void list(int argc, char **argv) { int n, fd, flags; @@ -265,7 +265,7 @@ } } -void +static void usage(void) { fprintf(stderr, "%s",
CVS commit: src/usr.sbin/eshconfig
Module Name:src Committed By: joerg Date: Tue Aug 30 18:28:59 UTC 2011 Modified Files: src/usr.sbin/eshconfig: eshconfig.c Log Message: ANSIfy + static + __dead To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/eshconfig/eshconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/eshconfig/eshconfig.c diff -u src/usr.sbin/eshconfig/eshconfig.c:1.9 src/usr.sbin/eshconfig/eshconfig.c:1.10 --- src/usr.sbin/eshconfig/eshconfig.c:1.9 Wed Apr 15 05:50:20 2009 +++ src/usr.sbin/eshconfig/eshconfig.c Tue Aug 30 18:28:59 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: eshconfig.c,v 1.9 2009/04/15 05:50:20 lukem Exp $ */ +/* $NetBSD: eshconfig.c,v 1.10 2011/08/30 18:28:59 joerg Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: eshconfig.c,v 1.9 2009/04/15 05:50:20 lukem Exp $"); +__RCSID("$NetBSD: eshconfig.c,v 1.10 2011/08/30 18:28:59 joerg Exp $"); #endif /* not lint */ #include @@ -68,7 +68,7 @@ u_int32_t rr_value; }; -struct map_dma read_dma_map[] = {{0,RR_PS_READ_DISABLE}, +static struct map_dma read_dma_map[] = {{0,RR_PS_READ_DISABLE}, {4,RR_PS_READ_4}, {16, RR_PS_READ_16}, {32, RR_PS_READ_32}, @@ -78,7 +78,7 @@ {1024, RR_PS_READ_1024}, {-1,0}}; -struct map_dma write_dma_map[] = {{0,RR_PS_WRITE_DISABLE}, +static struct map_dma write_dma_map[] = {{0,RR_PS_WRITE_DISABLE}, {4,RR_PS_WRITE_4}, {16, RR_PS_WRITE_16}, {32, RR_PS_WRITE_32}, @@ -101,29 +101,26 @@ u_int32_t ee_addr; }; -static u_int32_t do_map __P((int, struct map_dma *)); -static void eeprom_upload __P((const char *)); -static void eeprom_download __P((const char *)); -static u_int32_t rr_checksum __P((const u_int32_t *, int)); -static void esh_tune __P((void)); -static void esh_tune_eeprom __P((void)); -static void esh_tuning_stats __P((void)); -static void esh_stats __P((int)); -static void esh_reset __P((void)); -static int drvspec_ioctl __P((char *, int, int, int, caddr_t)); -static void usage __P((void)); -int main __P((int, char *[])); - - -struct ifreq ifr; -char name[30] = "esh0"; -int s; +static u_int32_t do_map(int, struct map_dma *); +static void eeprom_upload(const char *); +static void eeprom_download(const char *); +static u_int32_t rr_checksum(const u_int32_t *, int); +static void esh_tune(void); +static void esh_tune_eeprom(void); +static void esh_tuning_stats(void); +static void esh_stats(int); +static void esh_reset(void); +static int drvspec_ioctl(char *, int, int, int, caddr_t); +__dead static void usage(void); + +static char name[30] = "esh0"; +static int s; #define RR_EE_SIZE 8192 -u_int32_t eeprom[RR_EE_SIZE]; -u_int32_t runcode[RR_EE_SIZE]; +static u_int32_t eeprom[RR_EE_SIZE]; +static u_int32_t runcode[RR_EE_SIZE]; -struct ifdrv ifd; +static struct ifdrv ifd; /* drvspec_ioctl * @@ -145,7 +142,7 @@ } static void -usage() +usage(void) { fprintf(stderr, "eshconfig -- configure Essential Communications " "HIPPI driver\n"); @@ -201,29 +198,27 @@ } -int dma_thresh_read = -1; -int dma_thresh_write = -1; -int dma_min_grab = -1; -int dma_max_read = -1; -int dma_max_write = -1; - -int interrupt_delay = -1; - -int get_stats = 0; -int get_tuning_stats = 0; -int eeprom_write = 0; -char *eeprom_download_filename = NULL; -char *eeprom_upload_filename = NULL; -int reset = 0; +static int dma_thresh_read = -1; +static int dma_thresh_write = -1; +static int dma_min_grab = -1; +static int dma_max_read = -1; +static int dma_max_write = -1; + +static int interrupt_delay = -1; + +static int get_stats = 0; +static int get_tuning_stats = 0; +static int eeprom_write = 0; +static char *eeprom_download_filename = NULL; +static char *eeprom_upload_filename = NULL; +static int reset = 0; -struct rr_tuning rr_tune; +static struct rr_tuning rr_tune; struct rr_eeprom rr_eeprom; struct rr_stats rr_stats; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; @@ -326,7 +321,7 @@ } static void -esh_tune() +esh_tune(void) { dma_max_read = do_map(dma_max_read, read_dma_map); if (dma_max_read != -1) { @@ -381,7 +376,7 @@ */ static void -esh_tune_eeprom() +esh_tune_eeprom(void) { #define LAST (RR_EE_HEADER_CHECKSUM / RR_EE_WORD_LEN) #define FIRST (RR_EE_HEADER_CHECKSUM / RR_EE_WORD_LEN) @@ -632,12 +627,10 @@ return checksum; } -struct stats_values { +static struct stats_values { int offset; const char *name; -}; - -struct stats_values stats_values[] = { +} stats_values[] = { {0x04, "receive rings created"}, {0x08, "receive rings deleted"}, {0x0c, "interrupts"}, @@ -693,7 +686,7 @@ }; static void -esh_reset() +esh_reset(void) { if (drvspec_ioctl(name, s, EIOCRESET, 0, 0) < 0) err(1, "io
CVS commit: src/usr.sbin/dumpfs
Module Name:src Committed By: joerg Date: Tue Aug 30 18:24:18 UTC 2011 Modified Files: src/usr.sbin/dumpfs: dumpfs.c Log Message: static + __dead To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/dumpfs/dumpfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/dumpfs/dumpfs.c diff -u src/usr.sbin/dumpfs/dumpfs.c:1.57 src/usr.sbin/dumpfs/dumpfs.c:1.58 --- src/usr.sbin/dumpfs/dumpfs.c:1.57 Sat Feb 27 12:07:40 2010 +++ src/usr.sbin/dumpfs/dumpfs.c Tue Aug 30 18:24:17 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dumpfs.c,v 1.57 2010/02/27 12:07:40 mlelstv Exp $ */ +/* $NetBSD: dumpfs.c,v 1.58 2011/08/30 18:24:17 joerg Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: dumpfs.c,v 1.57 2010/02/27 12:07:40 mlelstv Exp $"); +__RCSID("$NetBSD: dumpfs.c,v 1.58 2011/08/30 18:24:17 joerg Exp $"); #endif #endif /* not lint */ @@ -66,21 +66,21 @@ #include #include -union fsun { +static union fsun { struct fs fs; char pad[MAXBSIZE]; } fsun; #define afs fsun.fs -uint16_t opostblsave[32*8]; +static uint16_t opostblsave[32*8]; -union { +static union { struct cg cg; char pad[MAXBSIZE]; } cgun; #define acg cgun.cg -union { +static union { struct wapbl_wc_header wh; struct wapbl_wc_null wn; char pad[MAXBSIZE]; @@ -101,29 +101,28 @@ opt_cg_summary | opt_superblock | opt_journal ) #define DFLT_OPTS (opt_superblock | opt_cg_summary | opt_cg_info | opt_verbose) -long dev_bsize = 512; -int needswap, printold, is_ufs2; -int Fflag; - -uint opt_flags; - -int dumpfs(const char *); -int print_superblock(struct fs *, uint16_t *, const char *, int, off_t); -int print_cgsum(const char *, int); -int print_cginfo(const char *, int); -int print_inodes(const char *, int, int, int); -int print_alt_super(const char *, int); -int print_journal(const char *, int); -void print_journal_header(const char *); -off_t print_journal_entries(const char *, size_t); -int dumpcg(const char *, int, int); -int main(int, char **); -int openpartition(const char *, int, char *, size_t); -void pbits(int, void *, int); -void usage(void); -void print_ufs1_inode(int, int, void *); -void print_ufs2_inode(int, int, void *); -void fix_superblock(struct fs *, uint16_t *); +static long dev_bsize = 512; +static int needswap, printold, is_ufs2; +static int Fflag; + +static uint opt_flags; + +static int dumpfs(const char *); +static int print_superblock(struct fs *, uint16_t *, const char *, int, off_t); +static int print_cgsum(const char *, int); +static int print_cginfo(const char *, int); +static int print_inodes(const char *, int, int, int); +static int print_alt_super(const char *, int); +static int print_journal(const char *, int); +static void print_journal_header(const char *); +static off_t print_journal_entries(const char *, size_t); +static int dumpcg(const char *, int, int); +static int openpartition(const char *, int, char *, size_t); +static void pbits(int, void *, int); +__dead static void usage(void); +static void print_ufs1_inode(int, int, void *); +static void print_ufs2_inode(int, int, void *); +static void fix_superblock(struct fs *, uint16_t *); int main(int argc, char *argv[]) @@ -165,7 +164,7 @@ } -int +static int dumpfs(const char *name) { static const off_t sblock_try[] = SBLOCKSEARCH; @@ -247,7 +246,7 @@ return rval; } -void +static void fix_superblock(struct fs *fs, uint16_t *opostbl) { if (needswap && @@ -286,7 +285,7 @@ fs->fs_old_nrpos = 8; } -int +static int print_superblock(struct fs *fs, uint16_t *opostbl, const char *name, int fd, off_t sblock) { @@ -465,7 +464,7 @@ return 0; } -int +static int print_cgsum(const char *name, int fd) { struct csum *ccsp; @@ -507,7 +506,7 @@ return 0; } -int +static int print_alt_super(const char *name, int fd) { union fsun alt; @@ -534,7 +533,7 @@ return 0; } -int +static int print_cginfo(const char *name, int fd) { int i; @@ -550,7 +549,7 @@ return 0; } -int +static int print_inodes(const char *name, int fd, int c, int n) { void *ino_buf = malloc(afs.fs_bsize); @@ -576,7 +575,7 @@ return 0; } -int +static int dumpcg(const char *name, int fd, int c) { off_t cur; @@ -655,7 +654,7 @@ return (0); } -void +static void print_ufs1_inode(int inum, int i_off, void *ibuf) { struct ufs1_dinode *i = ibuf; @@ -682,7 +681,7 @@ i->di_gen, i->di_uid, i->di_gid); } -void +static void print_ufs2_inode(int inum, int i_off, void *ibuf) { struct ufs2_dinode *i = ibuf; @@ -706,7 +705,7 @@ i->di_gen, i->di_uid, i->di_gid); } -void +static void pbits(int offset, void *vp, int max) { int i; @@ -728,7 +727,7 @@ printf("\n"); } -int +static int print_journal(const char *name, int fd) { daddr_t off; @@ -825,7 +824,7 @@ return
CVS commit: src
Module Name:src Committed By: plunky Date: Tue Aug 30 17:09:52 UTC 2011 Modified Files: src/include/rpc: xdr.h src/lib/libc/rpc: rpc.3 Log Message: provide a complete prototype for xdrproc_t (I found no instances where three arguments were actually used, as per the claim in the comment. If there are any in third party code then they will need to use a cast) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/include/rpc/xdr.h cvs rdiff -u -r1.22 -r1.23 src/lib/libc/rpc/rpc.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/rpc/xdr.h diff -u src/include/rpc/xdr.h:1.26 src/include/rpc/xdr.h:1.27 --- src/include/rpc/xdr.h:1.26 Mon Jul 4 07:54:38 2011 +++ src/include/rpc/xdr.h Tue Aug 30 17:09:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: xdr.h,v 1.26 2011/07/04 07:54:38 manu Exp $ */ +/* $NetBSD: xdr.h,v 1.27 2011/08/30 17:09:51 plunky Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -130,10 +130,8 @@ * The opaque pointer generally points to a structure of the data type * to be decoded. If this pointer is 0, then the type routines should * allocate dynamic storage of the appropriate size and return it. - * - * XXX can't actually prototype it, because some take three args!!! */ -typedef bool_t (*xdrproc_t)(/* XDR *, void *, u_int */); +typedef bool_t (*xdrproc_t)(XDR *, const void *); /* * Operations defined on a XDR handle Index: src/lib/libc/rpc/rpc.3 diff -u src/lib/libc/rpc/rpc.3:1.22 src/lib/libc/rpc/rpc.3:1.23 --- src/lib/libc/rpc/rpc.3:1.22 Mon Mar 22 19:30:54 2010 +++ src/lib/libc/rpc/rpc.3 Tue Aug 30 17:09:52 2011 @@ -1,6 +1,6 @@ .\" @(#)rpc.3n 1.31 93/08/31 SMI; from SVr4 .\" Copyright 1989 AT&T -.\" $NetBSD: rpc.3,v 1.22 2010/03/22 19:30:54 joerg Exp $ +.\" $NetBSD: rpc.3,v 1.23 2011/08/30 17:09:52 plunky Exp $ .Dd May 7, 1993 .Dt RPC 3 .Os @@ -254,9 +254,8 @@ * structure of the data type to be decoded. If this points to 0, * then the type routines should allocate dynamic storage of the * appropriate size and return it. - * bool_t (*xdrproc_t)(XDR *, caddr_t *); */ -typedef bool_t (*xdrproc_t)(); +typedef bool_t (*xdrproc_t)(XDR *, const void *); /* * The XDR handle.
CVS commit: src
Module Name:src Committed By: plunky Date: Tue Aug 30 17:06:22 UTC 2011 Modified Files: src/include/rpc: clnt.h svc.h src/lib/libquota: getnfsquota.c src/lib/librpcsvc: rnusers.x src/libexec/rpc.rquotad: rquotad.c src/libexec/rpc.rstatd: rstat_proc.c src/libexec/rpc.rusersd: rusers_proc.c src/libexec/rpc.rwalld: rwalld.c src/libexec/rpc.sprayd: sprayd.c src/tests/fs/nfs/nfsservice: mountd.c src/usr.bin/rup: rup.c src/usr.bin/rusers: rusers.c src/usr.bin/showmount: showmount.c src/usr.bin/ypwhich: ypwhich.c src/usr.sbin/mountd: mountd.c src/usr.sbin/rpc.lockd: lockd_lock.c src/usr.sbin/rpc.yppasswdd: rpc.yppasswdd.c yppasswdd_mkpw.c src/usr.sbin/ypbind: ypbind.c src/usr.sbin/yppoll: yppoll.c src/usr.sbin/ypserv/common: yplib_host.c src/usr.sbin/ypserv/yppush: yppush_svc.c src/usr.sbin/ypserv/ypserv: ypserv.c ypserv_proc.c Log Message: Apply casts to cases where xdrproc_t is expected but is not strictly passed, for example because the second argument is a different kind of pointer. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/include/rpc/clnt.h cvs rdiff -u -r1.23 -r1.24 src/include/rpc/svc.h cvs rdiff -u -r1.1 -r1.2 src/lib/libquota/getnfsquota.c cvs rdiff -u -r1.13 -r1.14 src/lib/librpcsvc/rnusers.x cvs rdiff -u -r1.28 -r1.29 src/libexec/rpc.rquotad/rquotad.c cvs rdiff -u -r1.44 -r1.45 src/libexec/rpc.rstatd/rstat_proc.c cvs rdiff -u -r1.26 -r1.27 src/libexec/rpc.rusersd/rusers_proc.c cvs rdiff -u -r1.21 -r1.22 src/libexec/rpc.rwalld/rwalld.c cvs rdiff -u -r1.16 -r1.17 src/libexec/rpc.sprayd/sprayd.c cvs rdiff -u -r1.5 -r1.6 src/tests/fs/nfs/nfsservice/mountd.c cvs rdiff -u -r1.27 -r1.28 src/usr.bin/rup/rup.c cvs rdiff -u -r1.23 -r1.24 src/usr.bin/rusers/rusers.c cvs rdiff -u -r1.18 -r1.19 src/usr.bin/showmount/showmount.c cvs rdiff -u -r1.18 -r1.19 src/usr.bin/ypwhich/ypwhich.c cvs rdiff -u -r1.120 -r1.121 src/usr.sbin/mountd/mountd.c cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/rpc.lockd/lockd_lock.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c cvs rdiff -u -r1.89 -r1.90 src/usr.sbin/ypbind/ypbind.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/yppoll/yppoll.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/ypserv/common/yplib_host.c cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/ypserv/yppush/yppush_svc.c cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/ypserv/ypserv/ypserv.c cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/ypserv/ypserv/ypserv_proc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/rpc/clnt.h diff -u src/include/rpc/clnt.h:1.20 src/include/rpc/clnt.h:1.21 --- src/include/rpc/clnt.h:1.20 Sat Dec 3 15:16:19 2005 +++ src/include/rpc/clnt.h Tue Aug 30 17:06:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clnt.h,v 1.20 2005/12/03 15:16:19 yamt Exp $ */ +/* $NetBSD: clnt.h,v 1.21 2011/08/30 17:06:20 plunky Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -206,11 +206,13 @@ * struct timeval timeout; */ #define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ - (const char *)(const void *)(argsp), xres, (caddr_t)(void *)resp, secs)) + ((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs, \ + (const char *)(const void *)(argsp), (xdrproc_t)xres, \ + (caddr_t)(void *)resp, secs)) #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ - (const char *)(const void *)(argsp), xres, (caddr_t)(void *)resp, secs)) + ((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs, \ + (const char *)(const void *)(argsp), (xdrproc_t)xres, \ + (caddr_t)(void *)resp, secs)) /* * void Index: src/include/rpc/svc.h diff -u src/include/rpc/svc.h:1.23 src/include/rpc/svc.h:1.24 --- src/include/rpc/svc.h:1.23 Mon Dec 26 19:01:47 2005 +++ src/include/rpc/svc.h Tue Aug 30 17:06:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: svc.h,v 1.23 2005/12/26 19:01:47 perry Exp $ */ +/* $NetBSD: svc.h,v 1.24 2011/08/30 17:06:20 plunky Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -163,9 +163,9 @@ (*(xprt)->xp_ops->xp_stat)(xprt) #define SVC_GETARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) + (*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp)) #define svc_getargs(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) + (*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp)) #define SVC_REPLY(xprt, msg)\ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) @@ -173,9 +173,9 @@ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) #define SVC_FREEARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_freearg
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 16:06:20 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: machdep.c Log Message: Hack to try to help usermode/i386 by setting the EBX register To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/usermode/usermode/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/machdep.c diff -u src/sys/arch/usermode/usermode/machdep.c:1.18 src/sys/arch/usermode/usermode/machdep.c:1.19 --- src/sys/arch/usermode/usermode/machdep.c:1.18 Mon Aug 29 12:46:58 2011 +++ src/sys/arch/usermode/usermode/machdep.c Tue Aug 30 16:06:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.18 2011/08/29 12:46:58 reinoud Exp $ */ +/* $NetBSD: machdep.c,v 1.19 2011/08/30 16:06:20 reinoud Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2011/08/29 12:46:58 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2011/08/30 16:06:20 reinoud Exp $"); #include #include @@ -150,6 +150,12 @@ ucp->uc_stack.ss_size = pack->ep_ssize; thunk_makecontext_trapframe2go(ucp, (void *) pack->ep_entry, &pcb->pcb_tf); +#ifdef __i386__ +int *reg; +reg = (int *) &ucp->uc_mcontext; +reg[8] = l->l_proc->p_psstrp; /* _REG_EBX */ +#endif + printf("updated pcb %p\n", pcb); printf("\tpcb->pcb_ucp.uc_stack.ss_sp = %p\n", pcb->pcb_ucp.uc_stack.ss_sp); printf("\tpcb->pcb_ucp.uc_stack.ss_size = %d\n", (int) pcb->pcb_ucp.uc_stack.ss_size);
CVS commit: src/sys
Module Name:src Committed By: bouyer Date: Tue Aug 30 14:22:22 UTC 2011 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h src/sys/net: bpf.c bpf.h bpfdesc.h Log Message: Provide netbsd32 compat for bpf. Beside the ioctls, the structure returned to userland by read(2) also needs to be converted. For this, the bpf descriptor is flagged as compat32 (or not) in the open and ioctl functions (where the user process's pid is also updated in the descriptor). When the bpf buffer is filled in, the 32bits or native header is used depending on the information stored in the descriptor. This won't work if a 64bit binary does the open and ioctls, and then exec a 32bit program which will do the read. But this is very unlikely to happen in real life ... Tested on i386 and loongson; with these changes my loongson can run dhclient and tcpdump with a n32 userland. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_ioctl.h cvs rdiff -u -r1.165 -r1.166 src/sys/net/bpf.c cvs rdiff -u -r1.57 -r1.58 src/sys/net/bpf.h cvs rdiff -u -r1.32 -r1.33 src/sys/net/bpfdesc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.59 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.60 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.59 Tue Aug 30 07:54:15 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Tue Aug 30 14:22:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.59 2011/08/30 07:54:15 macallan Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.60 2011/08/30 14:22:22 bouyer Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.59 2011/08/30 07:54:15 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.60 2011/08/30 14:22:22 bouyer Exp $"); #include #include @@ -61,6 +61,7 @@ #include #include +#include #include #include #include @@ -294,6 +295,22 @@ p->wc_count = s32p->wc_count; } +static inline void +netbsd32_to_bpf_program(struct netbsd32_bpf_program *s32p, struct bpf_program *p, u_long cmd) +{ + + p->bf_insns = (void *)NETBSD32PTR64(s32p->bf_insns); + p->bf_len = s32p->bf_len; +} + +static inline void +netbsd32_to_bpf_dltlist(struct netbsd32_bpf_dltlist *s32p, struct bpf_dltlist *p, u_long cmd) +{ + + p->bfl_list = (void *)NETBSD32PTR64(s32p->bfl_list); + p->bfl_len = s32p->bfl_len; +} + /* wsdisplay stuff */ static inline void netbsd32_to_wsdisplay_addscreendata(struct netbsd32_wsdisplay_addscreendata *asd32, @@ -515,6 +532,22 @@ } static inline void +netbsd32_from_bpf_program(struct bpf_program *p, struct netbsd32_bpf_program *s32p, u_long cmd) +{ + + NETBSD32PTR32(s32p->bf_insns, p->bf_insns); + s32p->bf_len = p->bf_len; +} + +static inline void +netbsd32_from_bpf_dltlist(struct bpf_dltlist *p, struct netbsd32_bpf_dltlist *s32p, u_long cmd) +{ + + NETBSD32PTR32(s32p->bfl_list, p->bfl_list); + s32p->bfl_len = p->bfl_len; +} + +static inline void netbsd32_from_u_long(u_long *p, netbsd32_u_long *s32p, u_long cmd) { @@ -825,6 +858,15 @@ case WDOGIOC_GWDOGS32: IOCTL_STRUCT_CONV_TO(WDOGIOC_GWDOGS, wdog_conf); + case BIOCSETF32: + IOCTL_STRUCT_CONV_TO(BIOCSETF, bpf_program); + case BIOCSTCPF32: + IOCTL_STRUCT_CONV_TO(BIOCSTCPF, bpf_program); + case BIOCSUDPF32: + IOCTL_STRUCT_CONV_TO(BIOCSUDPF, bpf_program); + case BIOCGDLTLIST32: + IOCTL_STRUCT_CONV_TO(BIOCGDLTLIST, bpf_dltlist); + case WSDISPLAYIO_ADDSCREEN32: IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata); Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.38 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.39 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.38 Tue Aug 30 07:54:15 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Tue Aug 30 14:22:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.38 2011/08/30 07:54:15 macallan Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.39 2011/08/30 14:22:22 bouyer Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -90,6 +90,23 @@ #define DIOCWFORMAT32 _IOWR('d', 106, struct netbsd32_format_op) #endif +/* from */ +struct netbsd32_bpf_program { + u_int bf_len; + netbsd32_pointer_t bf_insns; +}; + +struct netbsd32_bpf_dltlist { + u_int bfl_len; + netbsd32_pointer_t bfl_list; +}; + +#define BIOCSETF32 _IOW('B',103, struct netbsd32_bpf_program) +#define BIOCSTCPF32 _IOW('B',114, struct netbsd32_bpf_program) +#define BIOCSUDPF32 _IOW('B',115, struct netbsd32_bpf_program) +#define BIOCGDLTLIST32 _IOWR('B',119, struct netbsd32_bpf_dltlist) + + struct netbsd32_wsdisplay_addscreendata { int idx; /* screen index */ netbsd32_charp screentype; @@ -129,9 +146,6 @@ dev/wscons/
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: mbalmer Date: Tue Aug 30 13:07:30 UTC 2011 Modified Files: src/sys/arch/amd64/conf: GENERIC Log Message: Add gpio entries, commented out, since I am working with them as modules atm. To generate a diff of this commit: cvs rdiff -u -r1.336 -r1.337 src/sys/arch/amd64/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.336 src/sys/arch/amd64/conf/GENERIC:1.337 --- src/sys/arch/amd64/conf/GENERIC:1.336 Tue Aug 30 12:13:25 2011 +++ src/sys/arch/amd64/conf/GENERIC Tue Aug 30 13:07:30 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.336 2011/08/30 12:13:25 jmcneill Exp $ +# $NetBSD: GENERIC,v 1.337 2011/08/30 13:07:30 mbalmer Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.336 $" +#ident "GENERIC-$Revision: 1.337 $" maxusers 64 # estimated number of users @@ -500,6 +500,22 @@ # XXX dpti.c wants a processor type that is not assigned for x86-64 #dpti* at iop? tid 0 # DPT/Adaptec control interface +# GPIO devices +#gpio* at gpiobus? +#gpioow* at gpio? +#onewire* at gpioow? + +# 1- Wire support +#gpioow* at gpio? offset ? mask ? # 1-wire bitbanging via gpio +#gpioow* at gpio? +#onewire* at gpioow? + +# I2C support +#gpioiic* at gpio? +#iic* at gpioiic? + +# Keylock support +#gpiolock* at gpio? # SCSI Controllers and Devices
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: mbalmer Date: Tue Aug 30 13:03:17 UTC 2011 Modified Files: src/sys/arch/i386/conf: GENERIC Log Message: Attach gpio* at gpiobus? instead of at individual drivers. To generate a diff of this commit: cvs rdiff -u -r1.1051 -r1.1052 src/sys/arch/i386/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1051 src/sys/arch/i386/conf/GENERIC:1.1052 --- src/sys/arch/i386/conf/GENERIC:1.1051 Tue Aug 30 12:13:25 2011 +++ src/sys/arch/i386/conf/GENERIC Tue Aug 30 13:03:17 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1051 2011/08/30 12:13:25 jmcneill Exp $ +# $NetBSD: GENERIC,v 1.1052 2011/08/30 13:03:17 mbalmer Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1051 $" +#ident "GENERIC-$Revision: 1.1052 $" maxusers 64 # estimated number of users @@ -441,7 +441,6 @@ # System Controllers elansc* at mainbus? bus ? # AMD Elan SC520 System Controller -gpio* at elansc? # Temperatures amdtemp* at pchb? # AMD CPU Temperature sensors @@ -454,7 +453,7 @@ fwhrng* at ichlpcib? # Intel 82802 FWH Random Number Generator #hpet* at ichlpcib? gcscpcib* at pci? dev ? function ? # AMD CS5535/CS5536 PCI-ISA w/ -gpio* at gcscpcib? # timecounter, watchdog and GPIO + # timecounter, watchdog and GPIO #piixpcib* at pci? dev ? function ? # Intel PIIX4 PCI-ISA w/ SpeedStep gscpcib* at pci? dev ? function ? # NS Geode SC1100 PCI-ISA w/ GPIO viapcib* at pci? dev ? function ? # VIA VT8235 PCI-ISA w/ SMBus support @@ -681,7 +680,6 @@ # PC87366 hardware monitor #nsclpcsio* at isa? -#gpio* at nsclpcsio? # Abit uGuru Hardware system monitor #ug0 at isa? port 0xe0 @@ -706,8 +704,7 @@ dpti* at iop? tid 0 # DPT/Adaptec control interface # GPIO devices -gpio* at gscpcib? -#gpio* at gpiosim? +gpio* at gpiobus? # 1-Wire support #gpioow* at gpio? offset ? mask ? # 1-wire bitbanging via gpio
CVS commit: [cherry-xenmp] src/sys/arch
Module Name:src Committed By: cherry Date: Tue Aug 30 12:53:46 UTC 2011 Modified Files: src/sys/arch/i386/i386 [cherry-xenmp]: machdep.c src/sys/arch/xen/x86 [cherry-xenmp]: cpu.c x86_xpmap.c Log Message: Add per-cpu mmu queues To generate a diff of this commit: cvs rdiff -u -r1.702.2.5 -r1.702.2.6 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.56.2.8 -r1.56.2.9 src/sys/arch/xen/x86/cpu.c cvs rdiff -u -r1.26.2.7 -r1.26.2.8 src/sys/arch/xen/x86/x86_xpmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.702.2.5 src/sys/arch/i386/i386/machdep.c:1.702.2.6 --- src/sys/arch/i386/i386/machdep.c:1.702.2.5 Sat Aug 20 19:22:46 2011 +++ src/sys/arch/i386/i386/machdep.c Tue Aug 30 12:53:45 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.702.2.5 2011/08/20 19:22:46 cherry Exp $ */ +/* $NetBSD: machdep.c,v 1.702.2.6 2011/08/30 12:53:45 cherry Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.702.2.5 2011/08/20 19:22:46 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.702.2.6 2011/08/30 12:53:45 cherry Exp $"); #include "opt_beep.h" #include "opt_compat_ibcs2.h" @@ -539,6 +539,9 @@ } #ifdef XEN +/* Shim for curcpu() until %fs is ready */ +extern struct cpu_info * (*xpq_cpu)(void); + /* * Switch context: * - honor CR0_TS in saved CR0 and request DNA exception on FPU use @@ -566,6 +569,12 @@ update_descriptor(&ci->ci_gdt[GUGS_SEL], (union descriptor *) &pcb->pcb_gsd); + /* setup curcpu() to use %fs now */ + /* XXX: find a way to do this, just once */ + if (__predict_false(xpq_cpu != x86_curcpu)) { + xpq_cpu = x86_curcpu; + } + physop.cmd = PHYSDEVOP_SET_IOPL; physop.u.set_iopl.iopl = pcb->pcb_iopl; HYPERVISOR_physdev_op(&physop); Index: src/sys/arch/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.56.2.8 src/sys/arch/xen/x86/cpu.c:1.56.2.9 --- src/sys/arch/xen/x86/cpu.c:1.56.2.8 Fri Aug 26 13:33:34 2011 +++ src/sys/arch/xen/x86/cpu.c Tue Aug 30 12:53:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.56.2.8 2011/08/26 13:33:34 cherry Exp $ */ +/* $NetBSD: cpu.c,v 1.56.2.9 2011/08/30 12:53:46 cherry Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.56.2.8 2011/08/26 13:33:34 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.56.2.9 2011/08/30 12:53:46 cherry Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -1104,7 +1104,14 @@ } -void +/* curcpu() uses %fs - shim for until cpu_init_msrs(), below */ +static struct cpu_info *cpu_primary(void) +{ + return &cpu_info_primary; +} +struct cpu_info * (*xpq_cpu)(void) = cpu_primary; + + void cpu_init_msrs(struct cpu_info *ci, bool full) { #ifdef __x86_64__ @@ -1112,6 +1119,7 @@ HYPERVISOR_set_segment_base (SEGBASE_FS, 0); HYPERVISOR_set_segment_base (SEGBASE_GS_KERNEL, (uint64_t) ci); HYPERVISOR_set_segment_base (SEGBASE_GS_USER, 0); + xpq_cpu = x86_curcpu; } #endif /* __x86_64__ */ Index: src/sys/arch/xen/x86/x86_xpmap.c diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.26.2.7 src/sys/arch/xen/x86/x86_xpmap.c:1.26.2.8 --- src/sys/arch/xen/x86/x86_xpmap.c:1.26.2.7 Sat Aug 20 19:22:47 2011 +++ src/sys/arch/xen/x86/x86_xpmap.c Tue Aug 30 12:53:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_xpmap.c,v 1.26.2.7 2011/08/20 19:22:47 cherry Exp $ */ +/* $NetBSD: x86_xpmap.c,v 1.26.2.8 2011/08/30 12:53:46 cherry Exp $ */ /* * Copyright (c) 2006 Mathieu Ropert @@ -69,7 +69,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.26.2.7 2011/08/20 19:22:47 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.26.2.8 2011/08/30 12:53:46 cherry Exp $"); #include "opt_xen.h" #include "opt_ddb.h" @@ -164,12 +164,14 @@ #endif #define XPQUEUE_SIZE 2048 -static mmu_update_t xpq_queue[XPQUEUE_SIZE]; -static int xpq_idx = 0; +static mmu_update_t xpq_queue_array[MAXCPUS][XPQUEUE_SIZE]; +static int xpq_idx_array[MAXCPUS]; #ifdef MULTIPROCESSOR static struct simplelock xpq_lock = SIMPLELOCK_INITIALIZER; +extern struct cpu_info * (*xpq_cpu)(void); + void xpq_queue_lock(void) { @@ -195,7 +197,11 @@ { int i, ok, ret; + mmu_update_t *xpq_queue = xpq_queue_array[xpq_cpu()->ci_cpuid]; + int xpq_idx = xpq_idx_array[xpq_cpu()->ci_cpuid]; + KASSERT(xpq_queue_locked()); + XENPRINTK2(("flush queue %p entries %d\n", xpq_queue, xpq_idx)); for (i = 0; i < xpq_idx; i++) XENPRINTK2(("%d: 0x%08" PRIx64 " 0x%08" PRIx64 "\n", i, @@ -211,7 +217,7 @@ xpq_queue[i].ptr, xpq_queue[i].val); panic("HYPERVISOR_mmu_update failed, ret: %d\n", ret); } - xpq_idx = 0; + xpq_idx_array[xpq_cpu()->ci_cpuid] = 0; } /* Must be called with xpq_lock held */ @@ -220,14 +226,17 @@ { KASSERT(xpq_
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Tue Aug 30 12:13:25 UTC 2011 Modified Files: src/sys/arch/amd64/conf: GENERIC src/sys/arch/i386/conf: GENERIC Log Message: revert previous To generate a diff of this commit: cvs rdiff -u -r1.335 -r1.336 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.1050 -r1.1051 src/sys/arch/i386/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.335 src/sys/arch/amd64/conf/GENERIC:1.336 --- src/sys/arch/amd64/conf/GENERIC:1.335 Tue Aug 30 08:01:13 2011 +++ src/sys/arch/amd64/conf/GENERIC Tue Aug 30 12:13:25 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.335 2011/08/30 08:01:13 jruoho Exp $ +# $NetBSD: GENERIC,v 1.336 2011/08/30 12:13:25 jmcneill Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.335 $" +#ident "GENERIC-$Revision: 1.336 $" maxusers 64 # estimated number of users @@ -1032,8 +1032,8 @@ # TV cards # Brooktree 848/849/878/879 based TV cards -#bktr* at pci? dev ? function ? -#radio* at bktr? +bktr* at pci? dev ? function ? +radio* at bktr? # Conexant CX2388[0-3]-based DTV cards #cxdtv* at pci? dev ? function ? Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1050 src/sys/arch/i386/conf/GENERIC:1.1051 --- src/sys/arch/i386/conf/GENERIC:1.1050 Tue Aug 30 08:01:13 2011 +++ src/sys/arch/i386/conf/GENERIC Tue Aug 30 12:13:25 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1050 2011/08/30 08:01:13 jruoho Exp $ +# $NetBSD: GENERIC,v 1.1051 2011/08/30 12:13:25 jmcneill Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1050 $" +#ident "GENERIC-$Revision: 1.1051 $" maxusers 64 # estimated number of users @@ -1433,8 +1433,8 @@ # TV cards # Brooktree 848/849/878/879 based TV cards -#bktr* at pci? dev ? function ? -#radio* at bktr? +bktr* at pci? dev ? function ? +radio* at bktr? # Conexant CX2388[0-3]-based DTV cards #cxdtv* at pci? dev ? function ?
CVS commit: src
Module Name:src Committed By: apb Date: Tue Aug 30 12:04:12 UTC 2011 Modified Files: src: build.sh Log Message: Escape '$' in double quotes. To generate a diff of this commit: cvs rdiff -u -r1.246 -r1.247 src/build.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/build.sh diff -u src/build.sh:1.246 src/build.sh:1.247 --- src/build.sh:1.246 Mon Aug 15 14:48:00 2011 +++ src/build.sh Tue Aug 30 12:04:12 2011 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.246 2011/08/15 14:48:00 wiz Exp $ +# $NetBSD: build.sh,v 1.247 2011/08/30 12:04:12 apb Exp $ # # Copyright (c) 2001-2009 The NetBSD Foundation, Inc. # All rights reserved. @@ -743,7 +743,7 @@ -M) eval ${optargcmd}; resolvepath OPTARG case "${OPTARG}" in - \$*) usage "-M argument must not begin with '$'" + \$*) usage "-M argument must not begin with '\$'" ;; *\$*) # can use resolvepath, but can't set TOP_objdir resolvepath OPTARG @@ -782,7 +782,7 @@ -O) eval ${optargcmd} case "${OPTARG}" in - *\$*) usage "-O argument must not contain '$'" + *\$*) usage "-O argument must not contain '\$'" ;; *) resolvepath OPTARG TOP_objdir="${OPTARG}" @@ -1387,7 +1387,7 @@ eval cat <
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 12:02:38 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_clear_reference() To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.47 src/sys/arch/usermode/usermode/pmap.c:1.48 --- src/sys/arch/usermode/usermode/pmap.c:1.47 Tue Aug 30 11:57:20 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 12:02:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.47 2011/08/30 11:57:20 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.48 2011/08/30 12:02:38 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.47 2011/08/30 11:57:20 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.48 2011/08/30 12:02:38 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -908,10 +908,21 @@ } bool -pmap_clear_reference(struct vm_page *pg) +pmap_clear_reference(struct vm_page *page) { -aprint_debug("pmap_clear_reference not implemented\n"); - return true; + uintptr_t ppn; + bool rv; + + ppn = atop(VM_PAGE_TO_PHYS(page)); + rv = pmap_is_referenced(page); + + aprint_debug("pmap_clear_reference page %"PRIiPTR"\n", ppn); + + if (rv) { + pv_table[ppn].pv_pflags &= ~PV_REFERENCED; + pmap_update_page(ppn); + } + return rv; } bool
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 11:57:20 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_is_referenced() To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.46 src/sys/arch/usermode/usermode/pmap.c:1.47 --- src/sys/arch/usermode/usermode/pmap.c:1.46 Tue Aug 30 11:53:22 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 11:57:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.46 2011/08/30 11:53:22 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.47 2011/08/30 11:57:20 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.46 2011/08/30 11:53:22 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.47 2011/08/30 11:57:20 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -929,10 +929,14 @@ } bool -pmap_is_referenced(struct vm_page *pg) +pmap_is_referenced(struct vm_page *page) { -aprint_debug("pmap_is_referenced not implemented\n"); - return false; + intptr_t ppn; + + ppn = atop(VM_PAGE_TO_PHYS(page)); + aprint_debug("pmap_is_referenced page %"PRIiPTR"\n", ppn); + + return (pv_table[ppn].pv_pflags & PV_REFERENCED) != 0; } paddr_t
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 11:53:22 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Cleanup PV_UNMAGED handling in pmap_do_enter To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.45 src/sys/arch/usermode/usermode/pmap.c:1.46 --- src/sys/arch/usermode/usermode/pmap.c:1.45 Tue Aug 30 11:40:46 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 11:53:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.45 2011/08/30 11:40:46 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.46 2011/08/30 11:53:22 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.45 2011/08/30 11:40:46 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.46 2011/08/30 11:53:22 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -508,11 +508,12 @@ static void pv_update(struct pv_entry *pv) { - int pflags; + int pflags, vflags; int mmap_ppl; /* get our per-physical-page flags */ pflags = pv_table[pv->pv_ppn].pv_pflags; + vflags = pv_table[pv->pv_ppn].pv_vflags; /* create referenced/modified emulation */ if ((pv->pv_prot & VM_PROT_WRITE) && @@ -523,6 +524,11 @@ mmap_ppl = PROT_READ; else mmap_ppl = PROT_NONE; + + /* unmanaged pages are special; they dont track r/m */ + if (vflags & PV_UNMANAGED) + mmap_ppl = PROT_READ | PROT_WRITE; + pv->pv_mmap_ppl = mmap_ppl; } @@ -588,9 +594,7 @@ if (unmanaged) { /* dont track r/m */ pv->pv_vflags |= PV_UNMANAGED; - ppv->pv_pflags |= PV_MODIFIED | PV_REFERENCED; /* XXX */ } else { - /* XXX flag it dirty(?) if prot write? */ if (flags & VM_PROT_WRITE) ppv->pv_pflags |= PV_REFERENCED | PV_MODIFIED; else if (flags & (VM_PROT_ALL))
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 11:40:46 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Make still unimplemented pmap_protect() more verbose To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.44 src/sys/arch/usermode/usermode/pmap.c:1.45 --- src/sys/arch/usermode/usermode/pmap.c:1.44 Tue Aug 30 11:31:57 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 11:40:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.44 2011/08/30 11:31:57 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.45 2011/08/30 11:40:46 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.44 2011/08/30 11:31:57 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.45 2011/08/30 11:40:46 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -696,7 +696,7 @@ void pmap_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) { -aprint_debug("pmap_protect not implemented\n"); +aprint_debug("pmap_protect not implemented sva %p, eva %p, prot %d\n", (void *) sva, (void *) eva, prot); } void
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 11:31:57 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_page_protect() To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.43 src/sys/arch/usermode/usermode/pmap.c:1.44 --- src/sys/arch/usermode/usermode/pmap.c:1.43 Tue Aug 30 10:58:41 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 11:31:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43 2011/08/30 10:58:41 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.44 2011/08/30 11:31:57 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.43 2011/08/30 10:58:41 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.44 2011/08/30 11:31:57 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -825,10 +825,56 @@ aprint_debug("pmap_copy_page not implemented\n"); } +/* change access permissions on a given physical page */ void -pmap_page_protect(struct vm_page *pg, vm_prot_t prot) +pmap_page_protect(struct vm_page *page, vm_prot_t prot) { -aprint_debug("pmap_page_protect not implemented\n"); + intptr_t ppn; + struct pv_entry *pv, *npv; + + ppn = atop(VM_PAGE_TO_PHYS(page)); + aprint_debug("pmap_page_protect page %"PRIiPTR" to prot %d\n", ppn, prot); + + if (prot == VM_PROT_NONE) { + /* visit all mappings */ + npv = pv = &pv_table[ppn]; + while (pv != NULL && pv->pv_pmap != NULL) { + /* skip unmanaged entries */ + if (pv->pv_vflags & PV_UNMANAGED) { +pv = pv->pv_next; +continue; + } + + /* if in an active pmap deactivate */ + if (pv->pv_pmap->pm_flags & PM_ACTIVE) +pmap_page_deactivate(pv); + + /* if not on the head, remember our next */ + if (pv != &pv_table[ppn]) +npv = pv->pv_next; + + /* remove from pmap */ + pv->pv_pmap->pm_entries[pv->pv_lpn] = NULL; + if (pv->pv_vflags & PV_WIRED) +pv->pv_pmap->pm_stats.wired_count--; + pv_release(pv->pv_pmap, ppn, pv->pv_lpn); + + pv = npv; + } + } else if (prot != VM_PROT_ALL) { + /* visit all mappings */ + for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) { + /* if managed and in a pmap restrict access */ + if ((pv->pv_pmap != NULL) && + ((pv->pv_vflags & PV_UNMANAGED) == 0)) { +pv->pv_prot &= prot; +pv_update(pv); +/* if in active pmap (re)activate page */ +if (pv->pv_pmap->pm_flags & PM_ACTIVE) + pmap_page_activate(pv); + } + } + } } bool
CVS commit: src/share/man/man4
Module Name:src Committed By: jruoho Date: Tue Aug 30 11:24:38 UTC 2011 Modified Files: src/share/man/man4: dtviic.4 Log Message: Use more .Nm, offset indent. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/dtviic.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/dtviic.4 diff -u src/share/man/man4/dtviic.4:1.3 src/share/man/man4/dtviic.4:1.4 --- src/share/man/man4/dtviic.4:1.3 Tue Aug 30 06:51:27 2011 +++ src/share/man/man4/dtviic.4 Tue Aug 30 11:24:38 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dtviic.4,v 1.3 2011/08/30 06:51:27 jruoho Exp $ +.\" $NetBSD: dtviic.4,v 1.4 2011/08/30 11:24:38 jruoho Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -117,20 +117,24 @@ Xceive XC5000 analog and digital tuner .El .Sh FILES -.Bl -bullet +.Bl -bullet -offset indent .It .Pa dvb-fe-nxt2004.fw -needed by nxt2k +needed by +.Nm nxt2k .It +.Pa xc3028-v27.fw +or .Pa xc3028L-v36.fw (provided by .Pa pkgsrc/sysutils/xc3028l-firmware ) -or -.Pa xc3028-v27.fw -needed by xc3028 +needed by +.Nm xc3028 .It .Pa dvb-fe-xc5000-1.6.114.fw -needed by xc5k, provided by +needed by +.Nm xc5k , +provided by the .Pa pkgsrc/sysutils/xc5k-firmware .El .Sh SEE ALSO
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 10:58:42 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_clear_modify() and pmap_is_modified() To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.42 src/sys/arch/usermode/usermode/pmap.c:1.43 --- src/sys/arch/usermode/usermode/pmap.c:1.42 Tue Aug 30 10:44:06 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 10:58:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.42 2011/08/30 10:44:06 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.43 2011/08/30 10:58:41 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.42 2011/08/30 10:44:06 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.43 2011/08/30 10:58:41 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -832,10 +832,29 @@ } bool -pmap_clear_modify(struct vm_page *pg) +pmap_clear_modify(struct vm_page *page) { -aprint_debug("pmap_clear_modify not implemented\n"); - return true; + struct pv_entry *pv; + uintptr_t ppn; + bool rv; + + ppn = atop(VM_PAGE_TO_PHYS(page)); + rv = pmap_is_modified(page); + + aprint_debug("pmap_clear_modify page %"PRIiPTR"\n", ppn); + + /* if marked modified, clear it in all the pmap's referencing it */ + if (rv) { + /* if its marked modified in a kernel mapping, don't clear it */ + for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) + if (pv->pv_pmap == pmap_kernel() && + (pv->pv_prot & VM_PROT_WRITE)) +return rv; + /* clear it */ + pv_table[ppn].pv_pflags &= ~PV_MODIFIED; + pmap_update_page(ppn); + } + return rv; } bool @@ -846,10 +865,17 @@ } bool -pmap_is_modified(struct vm_page *pg) +pmap_is_modified(struct vm_page *page) { -aprint_debug("pmap_is_modified not implemented\n"); - return false; + intptr_t ppn; + bool rv; + + ppn = atop(VM_PAGE_TO_PHYS(page)); + rv = (pv_table[ppn].pv_pflags & PV_MODIFIED) != 0; + + aprint_debug("pmap_is_modified page %"PRIiPTR" : %s\n", ppn, rv?"yes":"no"); + + return rv; } bool
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 10:44:06 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_destroy() following Ben Harris's template To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.41 src/sys/arch/usermode/usermode/pmap.c:1.42 --- src/sys/arch/usermode/usermode/pmap.c:1.41 Tue Aug 30 10:37:42 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 10:44:06 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.41 2011/08/30 10:37:42 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.42 2011/08/30 10:44:06 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41 2011/08/30 10:37:42 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.42 2011/08/30 10:44:06 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -356,7 +356,24 @@ void pmap_destroy(pmap_t pmap) { -aprint_debug("pmap_destroy not implemented!\n"); + int i; + + /* if multiple references exist just remove a reference */ + aprint_debug("pmap_destroy %p\n", pmap); + if (--pmap->pm_count > 0) + return; + + /* safe guard against silly errors */ + KASSERT((pmap->pm_flags & PM_ACTIVE) == 0); + KASSERT(pmap->pm_stats.resident_count == 0); + KASSERT(pmap->pm_stats.wired_count == 0); +#ifdef DIAGNOSTIC + for (i = 0; i < pm_nentries; i++) + if (pmap->pm_entries[i] != NULL) + panic("pmap_destroy: pmap isn't empty"); +#endif + free((void *)pmap->pm_entries, M_VMPMAP); + pool_put(&pmap_pool, pmap); } void
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 10:37:43 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_reference(). Note that i have no idea as to when this reference is released... To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.40 src/sys/arch/usermode/usermode/pmap.c:1.41 --- src/sys/arch/usermode/usermode/pmap.c:1.40 Tue Aug 30 10:29:34 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 10:37:42 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.40 2011/08/30 10:29:34 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.41 2011/08/30 10:37:42 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.40 2011/08/30 10:29:34 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41 2011/08/30 10:37:42 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -362,7 +362,8 @@ void pmap_reference(pmap_t pmap) { -aprint_debug("pmap_reference %p\n", (void *) pmap); + aprint_debug("pmap_reference %p\n", (void *) pmap); + pmap->pm_count++; } long
CVS commit: src/sys/arch/usermode/usermode
Module Name:src Committed By: reinoud Date: Tue Aug 30 10:29:34 UTC 2011 Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Remove panic that prevented multiple mappings of a pv entry To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.39 src/sys/arch/usermode/usermode/pmap.c:1.40 --- src/sys/arch/usermode/usermode/pmap.c:1.39 Mon Aug 29 14:59:09 2011 +++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 10:29:34 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.39 2011/08/29 14:59:09 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.40 2011/08/30 10:29:34 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.39 2011/08/29 14:59:09 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.40 2011/08/30 10:29:34 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -411,7 +411,6 @@ ppn, lpn); assert(ppn < phys_npages); assert(ppn >= 0); -panic("pv_get: multiple\n"); pv = pv_alloc(); if (pv == NULL) return NULL;
CVS commit: src/usr.sbin/diskpart
Module Name:src Committed By: joerg Date: Tue Aug 30 10:12:06 UTC 2011 Modified Files: src/usr.sbin/diskpart: diskpart.c Log Message: ANSIfy + static + dead. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/diskpart/diskpart.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/diskpart/diskpart.c diff -u src/usr.sbin/diskpart/diskpart.c:1.18 src/usr.sbin/diskpart/diskpart.c:1.19 --- src/usr.sbin/diskpart/diskpart.c:1.18 Wed Apr 15 05:41:09 2009 +++ src/usr.sbin/diskpart/diskpart.c Tue Aug 30 10:12:06 2011 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "from: @(#)diskpart.c 8.3 (Berkeley) 11/30/94"; #else -__RCSID("$NetBSD: diskpart.c,v 1.18 2009/04/15 05:41:09 lukem Exp $"); +__RCSID("$NetBSD: diskpart.c,v 1.19 2011/08/30 10:12:06 joerg Exp $"); #endif #endif /* not lint */ @@ -64,7 +64,7 @@ * Default partition sizes, where they exist. */ #define NDEFAULTS 4 -int defpart[NDEFAULTS][NPARTITIONS] = { +static int defpart[NDEFAULTS][NPARTITIONS] = { { 15884, 66880, 0, 15884, 307200, 0, 0, 291346 }, /* ~ 356+ Mbytes */ { 15884, 33440, 0, 15884, 55936, 0, 0, 291346 }, /* ~ 206-355 Mbytes */ { 15884, 33440, 0, 15884, 55936, 0, 0, 0 }, /* ~ 61-205 Mbytes */ @@ -77,7 +77,7 @@ * covers the physical space on a disk. */ #define NLAYOUTS 3 -char layouts[NLAYOUTS][NPARTITIONS] = { +static char layouts[NLAYOUTS][NPARTITIONS] = { { 'a', 'b', 'h', 'g' }, { 'a', 'b', 'h', 'd', 'e', 'f' }, { 'c' }, @@ -89,7 +89,7 @@ * with zero block and frag sizes are special cases * (e.g. swap areas or for access to the entire device). */ -struct partition defparam[NPARTITIONS] = { +static struct partition defparam[NPARTITIONS] = { { 0, 0, { 1024 }, FS_UNUSED, 8, { 0 }, }, /* a */ { 0, 0, { 1024 }, FS_SWAP, 8, { 0 }, }, /* b */ { 0, 0, { 1024 }, FS_UNUSED, 8, { 0 }, }, /* c */ @@ -108,20 +108,17 @@ * table; another 126 sectors past this is needed as a * pool of replacement sectors. */ -int badsecttable = 126; /* # sectors */ +static int badsecttable = 126; /* # sectors */ -int pflag; /* print device driver partition tables */ -int dflag; /* print disktab entry */ +static int pflag; /* print device driver partition tables */ +static int dflag; /* print disktab entry */ -int gettype __P((const char *, const char *const *)); -int main __P((int, char **)); -struct disklabel *promptfordisk __P((const char *)); -void usage __P((void)); +static int gettype(const char *, const char *const *); +static struct disklabel *promptfordisk(const char *); +__dead static void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct disklabel *dp; int spc, def, part, layout, j, ch; @@ -363,9 +360,9 @@ exit(0); } -struct disklabel disk; +static struct disklabel disk; -struct field { +static struct field { const char *f_name; const char *f_defaults; u_int32_t *f_location; @@ -377,9 +374,8 @@ { NULL, NULL, 0 }, }; -struct disklabel * -promptfordisk(name) - const char *name; +static struct disklabel * +promptfordisk(const char *name) { struct disklabel *dp = &disk; struct field *fp; @@ -496,10 +492,8 @@ return (dp); } -int -gettype(t, names) - const char *t; - const char *const *names; +static int +gettype(const char *t, const char *const *names) { const char *const *nm; @@ -511,7 +505,7 @@ return (-1); } -void +static void usage(void) { (void)fprintf(stderr, "usage: diskpart [-dp] [-s size] disk-type\n");
CVS commit: src/usr.bin/crontab
Module Name:src Committed By: christos Date: Tue Aug 30 10:09:26 UTC 2011 Removed Files: src/usr.bin/crontab: Makefile Log Message: in external now. To generate a diff of this commit: cvs rdiff -u -r1.27 -r0 src/usr.bin/crontab/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/cron
Module Name:src Committed By: christos Date: Tue Aug 30 10:08:12 UTC 2011 Removed Files: src/usr.sbin/cron: Makefile compat.c compat.h config.h cron.8 cron.c cron.h crontab.1 crontab.5 crontab.c database.c do_command.c entry.c env.c externs.h job.c misc.c pathnames.h popen.c user.c Log Message: in external now To generate a diff of this commit: cvs rdiff -u -r1.15 -r0 src/usr.sbin/cron/Makefile src/usr.sbin/cron/env.c cvs rdiff -u -r1.5 -r0 src/usr.sbin/cron/compat.c src/usr.sbin/cron/cron.h \ src/usr.sbin/cron/pathnames.h cvs rdiff -u -r1.4 -r0 src/usr.sbin/cron/compat.h src/usr.sbin/cron/externs.h \ src/usr.sbin/cron/user.c cvs rdiff -u -r1.7 -r0 src/usr.sbin/cron/config.h src/usr.sbin/cron/crontab.1 \ src/usr.sbin/cron/database.c cvs rdiff -u -r1.8 -r0 src/usr.sbin/cron/cron.8 cvs rdiff -u -r1.13 -r0 src/usr.sbin/cron/cron.c cvs rdiff -u -r1.14 -r0 src/usr.sbin/cron/crontab.5 src/usr.sbin/cron/misc.c cvs rdiff -u -r1.33 -r0 src/usr.sbin/cron/crontab.c cvs rdiff -u -r1.25 -r0 src/usr.sbin/cron/do_command.c cvs rdiff -u -r1.10 -r0 src/usr.sbin/cron/entry.c cvs rdiff -u -r1.6 -r0 src/usr.sbin/cron/job.c cvs rdiff -u -r1.11 -r0 src/usr.sbin/cron/popen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/dev_mkdb
Module Name:src Committed By: joerg Date: Tue Aug 30 10:04:50 UTC 2011 Modified Files: src/usr.sbin/dev_mkdb: dev_mkdb.c Log Message: static openinfo. dead, not unused usage. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/dev_mkdb/dev_mkdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/dev_mkdb/dev_mkdb.c diff -u src/usr.sbin/dev_mkdb/dev_mkdb.c:1.27 src/usr.sbin/dev_mkdb/dev_mkdb.c:1.28 --- src/usr.sbin/dev_mkdb/dev_mkdb.c:1.27 Wed Apr 15 01:01:06 2009 +++ src/usr.sbin/dev_mkdb/dev_mkdb.c Tue Aug 30 10:04:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dev_mkdb.c,v 1.27 2009/04/15 01:01:06 lukem Exp $ */ +/* $NetBSD: dev_mkdb.c,v 1.28 2011/08/30 10:04:50 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "from: @(#)dev_mkdb.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: dev_mkdb.c,v 1.27 2009/04/15 01:01:06 lukem Exp $"); +__RCSID("$NetBSD: dev_mkdb.c,v 1.28 2011/08/30 10:04:50 joerg Exp $"); #endif #endif /* not lint */ @@ -59,9 +59,9 @@ #include #include -static void usage(void) __unused; +static void usage(void) __dead; -HASHINFO openinfo = { +static HASHINFO openinfo = { 4096, /* bsize */ 128, /* ffactor */ 1024, /* nelem */
CVS commit: src/sys/arch
Module Name:src Committed By: jruoho Date: Tue Aug 30 08:01:13 UTC 2011 Modified Files: src/sys/arch/amd64/conf: GENERIC src/sys/arch/i386/conf: GENERIC Log Message: Comment out the legacy bktr(4) from the GENERICs. To generate a diff of this commit: cvs rdiff -u -r1.334 -r1.335 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.1049 -r1.1050 src/sys/arch/i386/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.334 src/sys/arch/amd64/conf/GENERIC:1.335 --- src/sys/arch/amd64/conf/GENERIC:1.334 Thu Aug 18 20:55:21 2011 +++ src/sys/arch/amd64/conf/GENERIC Tue Aug 30 08:01:13 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.334 2011/08/18 20:55:21 jakllsch Exp $ +# $NetBSD: GENERIC,v 1.335 2011/08/30 08:01:13 jruoho Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.334 $" +#ident "GENERIC-$Revision: 1.335 $" maxusers 64 # estimated number of users @@ -1032,8 +1032,8 @@ # TV cards # Brooktree 848/849/878/879 based TV cards -bktr* at pci? dev ? function ? -radio* at bktr? +#bktr* at pci? dev ? function ? +#radio* at bktr? # Conexant CX2388[0-3]-based DTV cards #cxdtv* at pci? dev ? function ? Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1049 src/sys/arch/i386/conf/GENERIC:1.1050 --- src/sys/arch/i386/conf/GENERIC:1.1049 Sat Aug 27 09:28:55 2011 +++ src/sys/arch/i386/conf/GENERIC Tue Aug 30 08:01:13 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1049 2011/08/27 09:28:55 mbalmer Exp $ +# $NetBSD: GENERIC,v 1.1050 2011/08/30 08:01:13 jruoho Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1049 $" +#ident "GENERIC-$Revision: 1.1050 $" maxusers 64 # estimated number of users @@ -1433,8 +1433,8 @@ # TV cards # Brooktree 848/849/878/879 based TV cards -bktr* at pci? dev ? function ? -radio* at bktr? +#bktr* at pci? dev ? function ? +#radio* at bktr? # Conexant CX2388[0-3]-based DTV cards #cxdtv* at pci? dev ? function ?
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: macallan Date: Tue Aug 30 07:54:15 UTC 2011 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: support SIOCG80211NWKEY To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.37 -r1.38 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.58 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.59 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.58 Tue Aug 30 07:06:39 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Tue Aug 30 07:54:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.58 2011/08/30 07:06:39 macallan Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.59 2011/08/30 07:54:15 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.58 2011/08/30 07:06:39 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.59 2011/08/30 07:54:15 macallan Exp $"); #include #include @@ -305,6 +305,23 @@ asd->idx = asd32->idx; } +static inline void +netbsd32_to_ieee80211_nwkey(struct netbsd32_ieee80211_nwkey *nwk32, + struct ieee80211_nwkey *nwk, + u_long cmd) +{ + int i; + + strncpy(nwk->i_name, nwk32->i_name, IFNAMSIZ); + nwk->i_wepon = nwk32->i_wepon; + nwk->i_defkid = nwk32->i_defkid; + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + nwk->i_key[i].i_keylen = nwk32->i_key[i].i_keylen; + nwk->i_key[i].i_keydat = + NETBSD32PTR64(nwk32->i_key[i].i_keydat); + } +} + /* * handle ioctl conversions from 64-bit kernel -> netbsd32 */ @@ -481,6 +498,23 @@ } static inline void +netbsd32_from_ieee80211_nwkey(struct ieee80211_nwkey *nwk, +struct netbsd32_ieee80211_nwkey *nwk32, +u_long cmd) +{ + int i; + + strncpy(nwk32->i_name, nwk->i_name, IFNAMSIZ); + nwk32->i_wepon = nwk->i_wepon; + nwk32->i_defkid = nwk->i_defkid; + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + nwk32->i_key[i].i_keylen = nwk->i_key[i].i_keylen; + NETBSD32PTR32(nwk32->i_key[i].i_keydat, +nwk->i_key[i].i_keydat); + } +} + +static inline void netbsd32_from_u_long(u_long *p, netbsd32_u_long *s32p, u_long cmd) { @@ -794,6 +828,9 @@ case WSDISPLAYIO_ADDSCREEN32: IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata); + case SIOCS80211NWKEY32: + IOCTL_STRUCT_CONV_TO(SIOCG80211NWKEY, ieee80211_nwkey); + default: #ifdef NETBSD32_MD_IOCTL error = netbsd32_md_ioctl(fp, com, data32, l); Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.37 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.38 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.37 Tue Aug 30 07:06:39 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Tue Aug 30 07:54:15 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.37 2011/08/30 07:06:39 macallan Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.38 2011/08/30 07:54:15 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -36,6 +36,7 @@ #include #include +#include /* we define some handy macros here... */ #define IOCTL_STRUCT_CONV_TO(cmd, type) \ @@ -96,6 +97,19 @@ }; #define WSDISPLAYIO_ADDSCREEN32 _IOW('W', 78, struct netbsd32_wsdisplay_addscreendata) +/* the first member must be matched with struct ifreq */ +struct netbsd32_ieee80211_nwkey { + char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ + int i_wepon; /* wep enabled flag */ + int i_defkid; /* default encrypt key id */ + struct { + int i_keylen; + netbsd32_charp i_keydat; + } i_key[IEEE80211_WEP_NKID]; +}; +#define SIOCS80211NWKEY32 _IOW('i', 232, struct netbsd32_ieee80211_nwkey) +#define SIOCG80211NWKEY32 _IOWR('i', 233, struct netbsd32_ieee80211_nwkey) + /* can wait! */ #if 0 dev/ccdvar.h:219:#define CCDIOCSET _IOWR('F', 16, struct ccd_ioctl) /* enable ccd */
CVS commit: src/share/man/man4
Module Name:src Committed By: mbalmer Date: Tue Aug 30 07:44:37 UTC 2011 Modified Files: src/share/man/man4: iic.4 Log Message: Also mention gpioiic(4). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/iic.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/iic.4 diff -u src/share/man/man4/iic.4:1.7 src/share/man/man4/iic.4:1.8 --- src/share/man/man4/iic.4:1.7 Tue Aug 30 06:27:17 2011 +++ src/share/man/man4/iic.4 Tue Aug 30 07:44:37 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: iic.4,v 1.7 2011/08/30 06:27:17 wiz Exp $ +.\" $NetBSD: iic.4,v 1.8 2011/08/30 07:44:37 mbalmer Exp $ .\" $OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $ .\" .\" Copyright (c) 2004, 2006 Alexander Yurchenko @@ -37,6 +37,7 @@ .Cd "iic0 at ausmbus0 # evbmips " .Cd "iic0 at cuda0# macppc " .Cd "iic0 at gpiic? # evbppc " +.Cd "iic* at gpioiic? # amd64 i386 " .Cd "iic* at gtiic? # evbppc " .Cd "iic* at gxiic? # evbarm " .Cd "iic* at ichsmb? # amd64 i386 " @@ -118,6 +119,8 @@ .It Xr iomdiic 4 .It Xr iopiic 4 .It Xr ki2c 4 +.It Xr gpioiic 4 +GPIO bit-banging .It Xr nfsmb 4 NVIDIA nForce 2/3/4 SMBus controller and SMBus driver .It Xr ociic 4
CVS commit: src/share/man/man4
Module Name:src Committed By: jruoho Date: Tue Aug 30 07:27:59 UTC 2011 Modified Files: src/share/man/man4: emdtv.4 Log Message: Clarify that the ATI USB dongle uses XC3028L (and not XC3028). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/emdtv.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/emdtv.4 diff -u src/share/man/man4/emdtv.4:1.3 src/share/man/man4/emdtv.4:1.4 --- src/share/man/man4/emdtv.4:1.3 Tue Aug 30 07:07:04 2011 +++ src/share/man/man4/emdtv.4 Tue Aug 30 07:27:59 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: emdtv.4,v 1.3 2011/08/30 07:07:04 jruoho Exp $ +.\" $NetBSD: emdtv.4,v 1.4 2011/08/30 07:27:59 jruoho Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -46,12 +46,10 @@ .Pp Supported cards include: .Pp -.Bl -column -offset indent \ -"Pinnacle PCTV HD Pro Stick 800e" \ -" " \ -" " +.Bl -column -offset 2n \ +"Pinnacle PCTV HD Pro Stick 800e" "Demodulator" "Tuner" .It Sy "Device" Ta Sy "Demodulator" Ta Sy "Tuner" -.It "ATI TV Wonder 600 USB" Ta Xr lg3303 4 Ta Xr xc3028 4 +.It "ATI TV Wonder 600 USB" Ta Xr lg3303 4 Ta Xr xc3028 4 (XC3028L) .\" .It "Pinnacle PCTV HD Pro Stick 800e" Ta Xr lg3303 4 Ta Xr xc3028 4 .\" Empia Hybrid XS ATSC? .El @@ -60,7 +58,7 @@ .\" XXX: No package for the XC3028 (and not XC3028L) used in the Pinnacle? .\" The -.Xr xc3028 4 +.Dv XC3028L digital tuner requires firmware. This is provided by the .Pa pkgsrc/sysutils/xc3028l-firmware
CVS commit: src/share/man/man4
Module Name:src Committed By: jruoho Date: Tue Aug 30 07:24:01 UTC 2011 Modified Files: src/share/man/man4: dtv.4 Log Message: Remove trailing comma. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man4/dtv.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/dtv.4 diff -u src/share/man/man4/dtv.4:1.8 src/share/man/man4/dtv.4:1.9 --- src/share/man/man4/dtv.4:1.8 Tue Aug 30 07:08:47 2011 +++ src/share/man/man4/dtv.4 Tue Aug 30 07:24:01 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dtv.4,v 1.8 2011/08/30 07:08:47 jruoho Exp $ +.\" $NetBSD: dtv.4,v 1.9 2011/08/30 07:24:01 jruoho Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -96,7 +96,7 @@ .Xr video 9 .Pp .Pa pkgsrc/multimedia/dvb-apps , -.Pa pkgsrc/multimedia/mplayer , +.Pa pkgsrc/multimedia/mplayer .Rs .%T Linux Media Infrastructure API. .%T Part II. Linux DVB API
CVS commit: src/share/man/man4
Module Name:src Committed By: jruoho Date: Tue Aug 30 07:23:05 UTC 2011 Modified Files: src/share/man/man4: auvitek.4 Log Message: Xref au8522(4) and xc5k(4) in the list of supported cards. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/auvitek.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/auvitek.4 diff -u src/share/man/man4/auvitek.4:1.5 src/share/man/man4/auvitek.4:1.6 --- src/share/man/man4/auvitek.4:1.5 Sun Aug 14 15:21:46 2011 +++ src/share/man/man4/auvitek.4 Tue Aug 30 07:23:05 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: auvitek.4,v 1.5 2011/08/14 15:21:46 wiz Exp $ +.\" $NetBSD: auvitek.4,v 1.6 2011/08/30 07:23:05 jruoho Exp $ .\" .\" Copyright (c) 2010, 2011 Jared D. McNeill .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 14, 2011 +.Dd August 30, 2011 .Dt AUVITEK 4 .Os .Sh NAME @@ -68,10 +68,13 @@ .Nm driver: .Pp -.Bl -column -.It Em "VendorChip DecoderTuner" -.It"Hauppauge WinTV-HVR-850 AU8522 XC5000" -.It"Hauppauge WinTV-HVR-950Q AU8522 XC5000" +.Bl -column -offset indent \ +"Hauppauge WinTV-HVR-950Q " \ +" " \ +" " +.It Sy "Device" Ta Sy "Decoder" Ta Sy "Tuner" +.It "Hauppauge WinTV-HVR-850" Ta Xr au8522 4 Ta Xr xc5k 4 +.It "Hauppauge WinTV-HVR-950Q" Ta Xr au8522 4 Ta Xr xc5k 4 .El .Pp Cards with an XC5000 tuner require the firmware provided by the @@ -80,9 +83,11 @@ .Sh SEE ALSO .Xr audio 4 , .Xr dtv 4 , +.Xr dtviic 4 , .Xr ehci 4 , .Xr uaudio 4 , -.Xr video 4 , +.Xr video 4 +.Pp .Pa pkgsrc/sysutils/xc5k-firmware .Sh HISTORY The
CVS commit: src/sys/dev
Module Name:src Committed By: mbalmer Date: Tue Aug 30 07:22:12 UTC 2011 Modified Files: src/sys/dev/gpio: gpio.c gpiosim.c src/sys/dev/pci: pwdog.c Log Message: Unconditionally include . To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/gpio/gpio.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/gpio/gpiosim.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/pwdog.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/gpio/gpio.c diff -u src/sys/dev/gpio/gpio.c:1.37 src/sys/dev/gpio/gpio.c:1.38 --- src/sys/dev/gpio/gpio.c:1.37 Mon Aug 29 15:14:04 2011 +++ src/sys/dev/gpio/gpio.c Tue Aug 30 07:22:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gpio.c,v 1.37 2011/08/29 15:14:04 mbalmer Exp $ */ +/* $NetBSD: gpio.c,v 1.38 2011/08/30 07:22:11 mbalmer Exp $ */ /* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */ /* @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.37 2011/08/29 15:14:04 mbalmer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.38 2011/08/30 07:22:11 mbalmer Exp $"); /* * General Purpose Input/Output framework. @@ -40,9 +40,7 @@ #include #include #include -#ifdef _MODULE #include -#endif #include #include "locators.h" Index: src/sys/dev/gpio/gpiosim.c diff -u src/sys/dev/gpio/gpiosim.c:1.12 src/sys/dev/gpio/gpiosim.c:1.13 --- src/sys/dev/gpio/gpiosim.c:1.12 Mon Aug 29 15:14:04 2011 +++ src/sys/dev/gpio/gpiosim.c Tue Aug 30 07:22:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gpiosim.c,v 1.12 2011/08/29 15:14:04 mbalmer Exp $ */ +/* $NetBSD: gpiosim.c,v 1.13 2011/08/30 07:22:12 mbalmer Exp $ */ /* $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $ */ /* @@ -25,9 +25,7 @@ #include #include #include -#ifdef _MODULE #include -#endif #include #include #include Index: src/sys/dev/pci/pwdog.c diff -u src/sys/dev/pci/pwdog.c:1.6 src/sys/dev/pci/pwdog.c:1.7 --- src/sys/dev/pci/pwdog.c:1.6 Mon Aug 29 15:06:49 2011 +++ src/sys/dev/pci/pwdog.c Tue Aug 30 07:22:12 2011 @@ -1,4 +1,4 @@ -/* $$NetBSD: pwdog.c,v 1.6 2011/08/29 15:06:49 mbalmer Exp $ */ +/* $$NetBSD: pwdog.c,v 1.7 2011/08/30 07:22:12 mbalmer Exp $ */ /* $OpenBSD: pwdog.c,v 1.7 2010/04/08 00:23:53 tedu Exp $ */ /* @@ -21,9 +21,7 @@ #include #include #include -#ifdef _MODULE #include -#endif #include #include
CVS commit: src/share/man/man4
Module Name:src Committed By: jruoho Date: Tue Aug 30 07:08:47 UTC 2011 Modified Files: src/share/man/man4: dtv.4 Log Message: Note emdtv(4). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/dtv.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/dtv.4 diff -u src/share/man/man4/dtv.4:1.7 src/share/man/man4/dtv.4:1.8 --- src/share/man/man4/dtv.4:1.7 Tue Aug 30 05:43:30 2011 +++ src/share/man/man4/dtv.4 Tue Aug 30 07:08:47 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dtv.4,v 1.7 2011/08/30 05:43:30 jruoho Exp $ +.\" $NetBSD: dtv.4,v 1.8 2011/08/30 07:08:47 jruoho Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -57,6 +57,8 @@ .Bl -tag -width "auvitek(4) " -offset indent .It Xr auvitek 4 Auvitek AU0828-based video capture cards +.It Xr emdtv 4 +EM28XX-based DTV cards .\" .\" XXX: Uncomment once the stub-pages are actually installed. .\" @@ -64,8 +66,6 @@ .\" Hauppauge WinTV-HVR-1250 .\" .It Xr cxdtv 4 .\" Conexant CX2388X-based DTV cards -.\" .It Xr emdtv 4 -.\" EM28XX-based DTV cards .El .Pp Note that the @@ -90,9 +90,9 @@ .Sh SEE ALSO .Xr auvitek 4 , .Xr dtviic 4 , +.Xr emdtv 4 , .\" coram 4 , .\" cxdtv 4 , -.\" emdtv 4 , .Xr video 9 .Pp .Pa pkgsrc/multimedia/dvb-apps ,
CVS commit: src
Module Name:src Committed By: jruoho Date: Tue Aug 30 07:07:05 UTC 2011 Modified Files: src/distrib/sets/lists/man: mi src/share/man/man4: Makefile emdtv.4 Log Message: Install the emdtv(4) manual page, based on earlier feedback from jmcneill@ (includes some XXX comments; should be updated alongside with the driver). Also use the new dtviic(4) links to build a list of supported cards. To generate a diff of this commit: cvs rdiff -u -r1.1337 -r1.1338 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.568 -r1.569 src/share/man/man4/Makefile cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/emdtv.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1337 src/distrib/sets/lists/man/mi:1.1338 --- src/distrib/sets/lists/man/mi:1.1337 Tue Aug 30 05:59:44 2011 +++ src/distrib/sets/lists/man/mi Tue Aug 30 07:07:05 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1337 2011/08/30 05:59:44 jruoho Exp $ +# $NetBSD: mi,v 1.1338 2011/08/30 07:07:05 jruoho Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -940,6 +940,7 @@ ./usr/share/man/cat4/eisa.0 man-sys-catman .cat ./usr/share/man/cat4/el.0 man-sys-catman .cat ./usr/share/man/cat4/elmc.0 man-sys-catman .cat +./usr/share/man/cat4/emdtv.0 man-sys-catman .cat ./usr/share/man/cat4/emips/ace.0 man-sys-catman .cat ./usr/share/man/cat4/emips/autoconf.0 man-sys-catman .cat ./usr/share/man/cat4/emips/dz.0 man-sys-catman .cat @@ -3759,6 +3760,7 @@ ./usr/share/man/html4/eisa.html man-sys-htmlman html ./usr/share/man/html4/el.html man-sys-htmlman html ./usr/share/man/html4/elmc.html man-sys-htmlman html +./usr/share/man/html4/emdtv.html man-sys-htmlman html ./usr/share/man/html4/emips/ace.html man-sys-htmlman html ./usr/share/man/html4/emips/autoconf.html man-sys-htmlman html ./usr/share/man/html4/emips/dz.html man-sys-htmlman html @@ -6353,6 +6355,7 @@ ./usr/share/man/man4/eisa.4 man-sys-man .man ./usr/share/man/man4/el.4 man-sys-man .man ./usr/share/man/man4/elmc.4 man-sys-man .man +./usr/share/man/man4/emdtv.4 man-sys-man .man ./usr/share/man/man4/emips/ace.4 man-sys-man .man ./usr/share/man/man4/emips/autoconf.4 man-sys-man .man ./usr/share/man/man4/emips/dz.4 man-sys-man .man Index: src/share/man/man4/Makefile diff -u src/share/man/man4/Makefile:1.568 src/share/man/man4/Makefile:1.569 --- src/share/man/man4/Makefile:1.568 Tue Aug 30 05:59:44 2011 +++ src/share/man/man4/Makefile Tue Aug 30 07:07:04 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.568 2011/08/30 05:59:44 jruoho Exp $ +# $NetBSD: Makefile,v 1.569 2011/08/30 07:07:04 jruoho Exp $ # @(#)Makefile 8.1 (Berkeley) 6/18/93 MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \ @@ -10,7 +10,7 @@ an.4 arcmsr.4 aria.4 artsata.4 ata.4 atalk.4 ataraid.4 \ ath.4 atphy.4 atppc.4 attimer.4 atw.4 \ auacer.4 audio.4 audiocs.4 auich.4 \ - auixp.4 autri.4 auvia.4 auvitek.4 awi.4 azalia.4 \ + auixp.4 autri.4 auvia.4 awi.4 azalia.4 \ battery_pmu.4 bba.4 bce.4 bcsp.4 be.4 bge.4 bnx.4 bha.4 \ bio.4 bktr.4 bluetooth.4 bmtphy.4 bpf.4 \ brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 \ @@ -143,6 +143,10 @@ # machine-independent Xen devices MAN+= pciback.4 xbd.4 xbdback.4 xenbus.4 xennet.4 xpci.4 xvif.4 +# DTV drivers +MAN+= auvitek.4 \ + emdtv.4 + # DTV I2C modules MLINKS+=dtviic.4 au8522.4 \ dtviic.4 cx24227.4 \ Index: src/share/man/man4/emdtv.4 diff -u src/share/man/man4/emdtv.4:1.2 src/share/man/man4/emdtv.4:1.3 --- src/share/man/man4/emdtv.4:1.2 Sun Aug 14 15:21:01 2011 +++ src/share/man/man4/emdtv.4 Tue Aug 30 07:07:04 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: emdtv.4,v 1.2 2011/08/14 15:21:01 wiz Exp $ +.\" $NetBSD: emdtv.4,v 1.3 2011/08/30 07:07:04 jruoho Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 13, 2011 +.Dd August 30, 2011 .Dt EMDTV 4 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nd digital video driver for Empia Technology EM28xx based cards .Sh SYNOPSIS .Cd "emdtv* at uhub?" +.Cd "dtv* at dtvbus?" .Sh DESCRIPTION The .Nm @@ -44,16 +45,29 @@ This chip is used in USB products. .Pp Supported cards include: -.Bl -bullet -offset indent -.It -ATI/AMD TV Wonder 600 USB -.\".It -.\"Empia Hybrid XS ATSC -.It -Pinnacle PCTV HD Pro Stick (800e) +.Pp +.Bl -column -offset indent \ +"Pinnacle PCTV HD Pro Stick 800e" \ +" " \ +" " +.It Sy "Device" Ta Sy "Demodulator" Ta Sy "Tuner" +.It "ATI TV Wonder 600 USB" Ta Xr lg3303 4 Ta Xr xc3028 4 +.\" .It "Pinnacle PCTV HD Pro Stick 800e" Ta Xr lg3303 4 Ta Xr xc3028 4 +.\" Empia Hybrid XS ATSC? .El +.Pp +.\" +.\" XXX: No package for the XC3028 (and not XC3028L) used in the Pinnacle? +.\" +The +.Xr x
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: macallan Date: Tue Aug 30 07:06:39 UTC 2011 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: add WSDISPLAYIO_ADDSCREEN To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.57 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.58 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.57 Sat Aug 27 19:25:35 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Tue Aug 30 07:06:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.57 2011/08/27 19:25:35 bouyer Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.58 2011/08/30 07:06:39 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.57 2011/08/27 19:25:35 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.58 2011/08/30 07:06:39 macallan Exp $"); #include #include @@ -126,6 +126,12 @@ struct netbsd32_sioc_sg_req *, u_long); +/* wsdisplay stuff */ +static inline void netbsd32_to_wsdisplay_addscreendata( + struct netbsd32_wsdisplay_addscreendata *, + struct wsdisplay_addscreendata *, + u_long); + /* convert to/from different structures */ static inline void @@ -288,6 +294,17 @@ p->wc_count = s32p->wc_count; } +/* wsdisplay stuff */ +static inline void +netbsd32_to_wsdisplay_addscreendata(struct netbsd32_wsdisplay_addscreendata *asd32, + struct wsdisplay_addscreendata *asd, + u_long cmd) +{ + asd->screentype = (char *)NETBSD32PTR64(asd32->screentype); + asd->emul = (char *)NETBSD32PTR64(asd32->emul); + asd->idx = asd32->idx; +} + /* * handle ioctl conversions from 64-bit kernel -> netbsd32 */ @@ -452,6 +469,17 @@ s32p->wc_count = p->wc_count; } +/* wsdisplay stuff */ +static inline void +netbsd32_from_wsdisplay_addscreendata(struct wsdisplay_addscreendata *asd, + struct netbsd32_wsdisplay_addscreendata *asd32, + u_long cmd) +{ + NETBSD32PTR32(asd32->screentype, asd->screentype); + NETBSD32PTR32(asd32->emul, asd->emul); + asd32->idx = asd->idx; +} + static inline void netbsd32_from_u_long(u_long *p, netbsd32_u_long *s32p, u_long cmd) { @@ -763,6 +791,9 @@ case WDOGIOC_GWDOGS32: IOCTL_STRUCT_CONV_TO(WDOGIOC_GWDOGS, wdog_conf); + case WSDISPLAYIO_ADDSCREEN32: + IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata); + default: #ifdef NETBSD32_MD_IOCTL error = netbsd32_md_ioctl(fp, com, data32, l); Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.36 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.37 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.36 Sat Aug 27 19:25:35 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Tue Aug 30 07:06:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.36 2011/08/27 19:25:35 bouyer Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.37 2011/08/30 07:06:39 macallan Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -35,6 +35,8 @@ #include #include +#include + /* we define some handy macros here... */ #define IOCTL_STRUCT_CONV_TO(cmd, type) \ size = IOCPARM_LEN(cmd); \ @@ -87,6 +89,13 @@ #define DIOCWFORMAT32 _IOWR('d', 106, struct netbsd32_format_op) #endif +struct netbsd32_wsdisplay_addscreendata { + int idx; /* screen index */ + netbsd32_charp screentype; + netbsd32_charp emul; +}; +#define WSDISPLAYIO_ADDSCREEN32 _IOW('W', 78, struct netbsd32_wsdisplay_addscreendata) + /* can wait! */ #if 0 dev/ccdvar.h:219:#define CCDIOCSET _IOWR('F', 16, struct ccd_ioctl) /* enable ccd */