CVS commit: src/usr.sbin/rtsold
Module Name:src Committed By: christos Date: Mon Jan 18 04:53:10 UTC 2010 Modified Files: src/usr.sbin/rtsold: probe.c Log Message: check if i is in range before using it. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/rtsold/probe.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/rtsold/probe.c diff -u src/usr.sbin/rtsold/probe.c:1.10 src/usr.sbin/rtsold/probe.c:1.11 --- src/usr.sbin/rtsold/probe.c:1.10 Thu May 11 04:37:24 2006 +++ src/usr.sbin/rtsold/probe.c Sun Jan 17 23:53:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: probe.c,v 1.10 2006/05/11 08:37:24 mrg Exp $ */ +/* $NetBSD: probe.c,v 1.11 2010/01/18 04:53:10 christos Exp $ */ /* $KAME: probe.c,v 1.15 2002/05/31 21:22:08 itojun Exp $ */ /* @@ -116,7 +116,7 @@ goto closeandend; } - for (i = 0; dr.defrouter[i].if_index && i < PRLSTSIZ; i++) { + for (i = 0; i < PRLSTSIZ && dr.defrouter[i].if_index; i++) { if (ifindex && dr.defrouter[i].if_index == ifindex) { /* sanity check */ if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) {
CVS commit: src/sys/dev/ic
Module Name:src Committed By: pooka Date: Mon Jan 18 01:51:26 UTC 2010 Modified Files: src/sys/dev/ic: midway.c Log Message: Nuke "u" quality macro. It's outside __NetBSD__, so not functional change, but some C parsers that don't know which cpp macros are defined fall and hurt themselves quite badly with it. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/dev/ic/midway.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/ic/midway.c diff -u src/sys/dev/ic/midway.c:1.88 src/sys/dev/ic/midway.c:1.89 --- src/sys/dev/ic/midway.c:1.88 Wed Apr 15 20:44:25 2009 +++ src/sys/dev/ic/midway.c Mon Jan 18 01:51:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: midway.c,v 1.88 2009/04/15 20:44:25 elad Exp $ */ +/* $NetBSD: midway.c,v 1.89 2010/01/18 01:51:25 pooka Exp $ */ /* (sync'd to midway.c 1.68) */ /* @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.88 2009/04/15 20:44:25 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.89 2010/01/18 01:51:25 pooka Exp $"); #include "opt_natm.h" @@ -139,8 +139,6 @@ #ifdef __NetBSD__ #include "opt_ddb.h" #include "opt_inet.h" -#else -#define snprintb((q), (f), "%b", q,f,b,l) snprintf((b), (l)) #endif #if NEN > 0 || !defined(__FreeBSD__)
CVS commit: src/lib/libpam/modules/pam_nologin
Module Name:src Committed By: wiz Date: Sun Jan 17 23:17:08 UTC 2010 Modified Files: src/lib/libpam/modules/pam_nologin: pam_nologin.c Log Message: Close file handle after using it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libpam/modules/pam_nologin/pam_nologin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpam/modules/pam_nologin/pam_nologin.c diff -u src/lib/libpam/modules/pam_nologin/pam_nologin.c:1.7 src/lib/libpam/modules/pam_nologin/pam_nologin.c:1.8 --- src/lib/libpam/modules/pam_nologin/pam_nologin.c:1.7 Sun Jan 27 01:23:20 2008 +++ src/lib/libpam/modules/pam_nologin/pam_nologin.c Sun Jan 17 23:17:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pam_nologin.c,v 1.7 2008/01/27 01:23:20 christos Exp $ */ +/* $NetBSD: pam_nologin.c,v 1.8 2010/01/17 23:17:08 wiz Exp $ */ /*- * Copyright 2001 Mark R V Murray @@ -40,7 +40,7 @@ #ifdef __FreeBSD__ __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_nologin/pam_nologin.c,v 1.10 2002/04/12 22:27:21 des Exp $"); #else -__RCSID("$NetBSD: pam_nologin.c,v 1.7 2008/01/27 01:23:20 christos Exp $"); +__RCSID("$NetBSD: pam_nologin.c,v 1.8 2010/01/17 23:17:08 wiz Exp $"); #endif @@ -127,8 +127,10 @@ PAM_LOG("Opened %s file", nologin); - if (fstat(fd, &st) < 0) + if (fstat(fd, &st) < 0) { + close(fd); return PAM_AUTH_ERR; + } mtmp = malloc(st.st_size + 1); if (mtmp != NULL) { @@ -137,6 +139,7 @@ pam_error(pamh, "%s", mtmp); free(mtmp); } + close(fd); PAM_VERBOSE_ERROR("Administrator refusing you: %s", nologin);
CVS commit: src/lib/libc/ssp
Module Name:src Committed By: wiz Date: Sun Jan 17 23:13:32 UTC 2010 Modified Files: src/lib/libc/ssp: gets_chk.c Log Message: Free malloc()ed buffer in error case. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/ssp/gets_chk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/ssp/gets_chk.c diff -u src/lib/libc/ssp/gets_chk.c:1.5 src/lib/libc/ssp/gets_chk.c:1.6 --- src/lib/libc/ssp/gets_chk.c:1.5 Mon Apr 28 20:23:00 2008 +++ src/lib/libc/ssp/gets_chk.c Sun Jan 17 23:13:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: gets_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: gets_chk.c,v 1.6 2010/01/17 23:13:32 wiz Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: gets_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); +__RCSID("$NetBSD: gets_chk.c,v 1.6 2010/01/17 23:13:32 wiz Exp $"); /*LINTLIBRARY*/ @@ -54,8 +54,10 @@ if ((abuf = malloc(slen + 1)) == NULL) return gets(buf); - if (fgets(abuf, (int)(slen + 1), stdin) == NULL) + if (fgets(abuf, (int)(slen + 1), stdin) == NULL) { + free(abuf); return NULL; + } len = strlen(abuf); if (len > 0 && abuf[len - 1] == '\n')
CVS commit: src/lib/libc/locale
Module Name:src Committed By: wiz Date: Sun Jan 17 23:12:30 UTC 2010 Modified Files: src/lib/libc/locale: ctypeio.c Log Message: Close file handles in error cases. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/ctypeio.c diff -u src/lib/libc/locale/ctypeio.c:1.10 src/lib/libc/locale/ctypeio.c:1.11 --- src/lib/libc/locale/ctypeio.c:1.10 Wed Oct 21 01:07:45 2009 +++ src/lib/libc/locale/ctypeio.c Sun Jan 17 23:12:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctypeio.c,v 1.10 2009/10/21 01:07:45 snj Exp $ */ +/* $NetBSD: ctypeio.c,v 1.11 2010/01/17 23:12:30 wiz Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -26,7 +26,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: ctypeio.c,v 1.10 2009/10/21 01:07:45 snj Exp $"); +__RCSID("$NetBSD: ctypeio.c,v 1.11 2010/01/17 23:12:30 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -74,8 +74,10 @@ ptr = malloc(sizeof(*data) + ((sizeof(uint8_t) + sizeof(int16_t) + sizeof(int16_t)) * (len + 1))); - if (ptr == NULL) + if (ptr == NULL) { + fclose(fp); return ENOMEM; + } data = (_BSDCTypeLocale *)(void *)ptr; ptr += sizeof(*data); @@ -117,5 +119,6 @@ bad1: free(data); bad0: + fclose(fp); return EFTYPE; }
CVS commit: src/lib/libc/hash
Module Name:src Committed By: wiz Date: Sun Jan 17 23:10:20 UTC 2010 Modified Files: src/lib/libc/hash: hashhl.c Log Message: Close file handle in error case. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/hash/hashhl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/hash/hashhl.c diff -u src/lib/libc/hash/hashhl.c:1.3 src/lib/libc/hash/hashhl.c:1.4 --- src/lib/libc/hash/hashhl.c:1.3 Fri Mar 6 18:15:23 2009 +++ src/lib/libc/hash/hashhl.c Sun Jan 17 23:10:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: hashhl.c,v 1.3 2009/03/06 18:15:23 apb Exp $ */ +/* $NetBSD: hashhl.c,v 1.4 2010/01/17 23:10:20 wiz Exp $ */ /* * @@ -106,8 +106,10 @@ } len = sb.st_size; } - if (off > 0 && lseek(fd, off, SEEK_SET) < 0) + if (off > 0 && lseek(fd, off, SEEK_SET) < 0) { + close(fd); return (NULL); + } while ((nr = read(fd, buffer, (size_t) MIN((off_t)sizeof(buffer), len))) > 0) {
CVS commit: src/lib/libc/gmon
Module Name:src Committed By: wiz Date: Sun Jan 17 23:09:02 UTC 2010 Modified Files: src/lib/libc/gmon: gmon.c Log Message: Close log file handle after using it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/lib/libc/gmon/gmon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gmon/gmon.c diff -u src/lib/libc/gmon/gmon.c:1.30 src/lib/libc/gmon/gmon.c:1.31 --- src/lib/libc/gmon/gmon.c:1.30 Thu Feb 12 04:57:46 2009 +++ src/lib/libc/gmon/gmon.c Sun Jan 17 23:09:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: gmon.c,v 1.30 2009/02/12 04:57:46 lukem Exp $ */ +/* $NetBSD: gmon.c,v 1.31 2010/01/17 23:09:02 wiz Exp $ */ /* * Copyright (c) 2003, 2004 Wasabi Systems, Inc. @@ -69,7 +69,7 @@ #if 0 static char sccsid[] = "@(#)gmon.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: gmon.c,v 1.30 2009/02/12 04:57:46 lukem Exp $"); +__RCSID("$NetBSD: gmon.c,v 1.31 2010/01/17 23:09:02 wiz Exp $"); #endif #endif @@ -481,6 +481,9 @@ } } close(fd); +#ifdef DEBUG + close(logfd); +#endif } /*
CVS commit: src/lib/libc/gdtoa
Module Name:src Committed By: wiz Date: Sun Jan 17 23:06:31 UTC 2010 Modified Files: src/lib/libc/gdtoa: arithchk.c Log Message: Close file handle after using it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gdtoa/arithchk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gdtoa/arithchk.c diff -u src/lib/libc/gdtoa/arithchk.c:1.2 src/lib/libc/gdtoa/arithchk.c:1.3 --- src/lib/libc/gdtoa/arithchk.c:1.2 Wed Jan 25 15:27:42 2006 +++ src/lib/libc/gdtoa/arithchk.c Sun Jan 17 23:06:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: arithchk.c,v 1.2 2006/01/25 15:27:42 kleink Exp $ */ +/* $NetBSD: arithchk.c,v 1.3 2010/01/17 23:06:31 wiz Exp $ */ / Copyright (C) 1997, 1998 Lucent Technologies @@ -178,8 +178,14 @@ fprintf(f, "#define NO_LONG_LONG\n"); if (a->kind <= 2 && fzcheck()) fprintf(f, "#define Sudden_Underflow\n"); +#ifdef WRITE_ARITH_H + fclose(f); +#endif return 0; } fprintf(f, "/* Unknown arithmetic */\n"); +#ifdef WRITE_ARITH_H + fclose(f); +#endif return 1; }
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: wiz Date: Sun Jan 17 23:03:01 UTC 2010 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: sainfo.c Log Message: Free strdeupped string after using it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/crypto/dist/ipsec-tools/src/racoon/sainfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/sainfo.c diff -u src/crypto/dist/ipsec-tools/src/racoon/sainfo.c:1.11 src/crypto/dist/ipsec-tools/src/racoon/sainfo.c:1.12 --- src/crypto/dist/ipsec-tools/src/racoon/sainfo.c:1.11 Thu Nov 6 14:12:28 2008 +++ src/crypto/dist/ipsec-tools/src/racoon/sainfo.c Sun Jan 17 23:03:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sainfo.c,v 1.11 2008/11/06 14:12:28 vanhu Exp $ */ +/* $NetBSD: sainfo.c,v 1.12 2010/01/17 23:03:01 wiz Exp $ */ /* $KAME: sainfo.c,v 1.16 2003/06/27 07:32:39 sakane Exp $ */ @@ -115,6 +115,7 @@ racoon_free(dloc); racoon_free(drmt); racoon_free(dpeer); +racoon_free(dclient); } LIST_FOREACH(s, &sitree, chain) {
CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Module Name:src Committed By: wiz Date: Sun Jan 17 23:02:48 UTC 2010 Modified Files: src/crypto/dist/ipsec-tools/src/racoon: eaytest.c ipsec_doi.c Log Message: Close file handles after using them. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/crypto/dist/ipsec-tools/src/racoon/eaytest.c cvs rdiff -u -r1.43 -r1.44 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/src/racoon/eaytest.c diff -u src/crypto/dist/ipsec-tools/src/racoon/eaytest.c:1.9 src/crypto/dist/ipsec-tools/src/racoon/eaytest.c:1.10 --- src/crypto/dist/ipsec-tools/src/racoon/eaytest.c:1.9 Tue Jul 15 00:47:09 2008 +++ src/crypto/dist/ipsec-tools/src/racoon/eaytest.c Sun Jan 17 23:02:48 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: eaytest.c,v 1.9 2008/07/15 00:47:09 mgrooms Exp $ */ +/* $NetBSD: eaytest.c,v 1.10 2010/01/17 23:02:48 wiz Exp $ */ /* Id: eaytest.c,v 1.22 2005/06/19 18:02:54 manubsd Exp */ @@ -572,6 +572,7 @@ n++; } + closedir(dirp); p = (char **)realloc(certs, (n + 1) * sizeof(certs)); if (p == NULL) Index: src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c diff -u src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.43 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.44 --- src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c:1.43 Tue May 19 09:34:52 2009 +++ src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c Sun Jan 17 23:02:48 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec_doi.c,v 1.43 2009/05/19 09:34:52 tteras Exp $ */ +/* $NetBSD: ipsec_doi.c,v 1.44 2010/01/17 23:02:48 wiz Exp $ */ /* Id: ipsec_doi.c,v 1.55 2006/08/17 09:20:41 vanhu Exp */ @@ -3830,6 +3830,7 @@ memcpy(new->v + tlen, b, len); tlen += len; } + fclose(fp); break; }
CVS commit: src/games/sail
Module Name:src Committed By: wiz Date: Sun Jan 17 22:56:32 UTC 2010 Modified Files: src/games/sail: lo_main.c Log Message: Close file when finished with it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/games/sail/lo_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/games/sail/lo_main.c diff -u src/games/sail/lo_main.c:1.17 src/games/sail/lo_main.c:1.18 --- src/games/sail/lo_main.c:1.17 Wed Aug 12 09:05:08 2009 +++ src/games/sail/lo_main.c Sun Jan 17 22:56:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lo_main.c,v 1.17 2009/08/12 09:05:08 dholland Exp $ */ +/* $NetBSD: lo_main.c,v 1.18 2010/01/17 22:56:32 wiz Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)lo_main.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: lo_main.c,v 1.17 2009/08/12 09:05:08 dholland Exp $"); +__RCSID("$NetBSD: lo_main.c,v 1.18 2010/01/17 22:56:32 wiz Exp $"); #endif #endif /* not lint */ @@ -92,6 +92,7 @@ title[n++], sbuf, ship->shipname, log.l_netpoints, (float) log.l_netpoints / ship->specs->pts); } + fclose(fp); printf("\n%d people have played.\n", npeople); return 0; }
CVS commit: src/games/hack
Module Name:src Committed By: wiz Date: Sun Jan 17 22:55:21 UTC 2010 Modified Files: src/games/hack: alloc.c Log Message: Simplify alloc() to avoid ifdef(LINT) workaround. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/games/hack/alloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/hack/alloc.c diff -u src/games/hack/alloc.c:1.7 src/games/hack/alloc.c:1.8 --- src/games/hack/alloc.c:1.7 Wed Aug 12 07:28:40 2009 +++ src/games/hack/alloc.c Sun Jan 17 22:55:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */ +/* $NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,41 +63,21 @@ #include #ifndef lint -__RCSID("$NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $"); +__RCSID("$NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $"); #endif/* not lint */ #include #include "hack.h" #include "extern.h" -#ifdef LINT - -/* - a ridiculous definition, suppressing - "possible pointer alignment problem" for (long *) malloc() - "enlarg defined but never used" - "ftell defined (in ) but never used" - from lint -*/ -long * -alloc(unsigned n) -{ - longdummy = ftell(stderr); - if (n) - dummy = 0; /* make sure arg is used */ - return (&dummy); -} - -#else - long * alloc(unsigned lth) { - char *ptr; + long *ptr; if (!(ptr = malloc(lth))) panic("Cannot get %d bytes", lth); - return ((long *) ptr); + return (ptr); } #if 0 /* unused */ @@ -111,5 +91,3 @@ return ((long *) nptr); } #endif - -#endif /* LINT */
CVS commit: src/games/fortune/fortune
Module Name:src Committed By: wiz Date: Sun Jan 17 22:52:00 UTC 2010 Modified Files: src/games/fortune/fortune: fortune.c Log Message: Close two file descriptors after using them. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/games/fortune/fortune/fortune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/fortune/fortune/fortune.c diff -u src/games/fortune/fortune/fortune.c:1.62 src/games/fortune/fortune/fortune.c:1.63 --- src/games/fortune/fortune/fortune.c:1.62 Thu Aug 27 03:09:17 2009 +++ src/games/fortune/fortune/fortune.c Sun Jan 17 22:52:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.62 2009/08/27 03:09:17 dholland Exp $ */ +/* $NetBSD: fortune.c,v 1.63 2010/01/17 22:52:00 wiz Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.62 2009/08/27 03:09:17 dholland Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.63 2010/01/17 22:52:00 wiz Exp $"); #endif #endif /* not lint */ @@ -233,6 +233,7 @@ #ifdef LOCK_EX (void) flock(fd, LOCK_UN); #endif /* LOCK_EX */ + close(fd); #endif /* OK_TO_WRITE_DISK */ if (Wait) { if (Fort_len == 0) @@ -716,6 +717,7 @@ else free(name); } + (void) closedir(dir); if (fp->num_children == 0) { warnx("`%s': No fortune files in directory.", fp->path); return FALSE;
CVS commit: src/distrib/utils/sysinst
Module Name:src Committed By: wiz Date: Sun Jan 17 22:48:50 UTC 2010 Modified Files: src/distrib/utils/sysinst: wskbd.c Log Message: Only a return value below 0 denotes an error in open(2). Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/sysinst/wskbd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/sysinst/wskbd.c diff -u src/distrib/utils/sysinst/wskbd.c:1.8 src/distrib/utils/sysinst/wskbd.c:1.9 --- src/distrib/utils/sysinst/wskbd.c:1.8 Sat Jan 2 18:06:57 2010 +++ src/distrib/utils/sysinst/wskbd.c Sun Jan 17 22:48:50 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $ */ +/* $NetBSD: wskbd.c,v 1.9 2010/01/17 22:48:50 wiz Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: wskbd.c,v 1.8 2010/01/02 18:06:57 dsl Exp $"); +__RCSID("$NetBSD: wskbd.c,v 1.9 2010/01/17 22:48:50 wiz Exp $"); #include #include @@ -96,7 +96,7 @@ const char *dflt = msg_string(MSG_kb_default); fd = open("/dev/wskbd0", O_WRONLY); - if (fd <= 0) + if (fd < 0) return; if (ioctl(fd, WSKBDIO_GETENCODING, &kbdencoding) >= 0) { memset(&opt, 0, sizeof opt);
CVS commit: src/distrib/utils/sysinst/arch/mac68k
Module Name:src Committed By: wiz Date: Sun Jan 17 22:47:19 UTC 2010 Modified Files: src/distrib/utils/sysinst/arch/mac68k: md.c Log Message: Close file when finished with it. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/distrib/utils/sysinst/arch/mac68k/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/sysinst/arch/mac68k/md.c diff -u src/distrib/utils/sysinst/arch/mac68k/md.c:1.56 src/distrib/utils/sysinst/arch/mac68k/md.c:1.57 --- src/distrib/utils/sysinst/arch/mac68k/md.c:1.56 Sat Jan 2 18:06:58 2010 +++ src/distrib/utils/sysinst/arch/mac68k/md.c Sun Jan 17 22:47:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.56 2010/01/02 18:06:58 dsl Exp $ */ +/* $NetBSD: md.c,v 1.57 2010/01/17 22:47:18 wiz Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -777,6 +777,7 @@ strncat(name, " (", len_name-strlen(name)); strncat(name, &macosblk[37], len_name-strlen(name)); strncat(name, ")", len_name-strlen(name)); + close(fd); } break; default:
CVS commit: src/dist/dhcp/common
Module Name:src Committed By: wiz Date: Sun Jan 17 22:42:36 UTC 2010 Modified Files: src/dist/dhcp/common: conflex.c Log Message: Add missing parentheses in ifdef(OLD_LEXER). Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/common/conflex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/dhcp/common/conflex.c diff -u src/dist/dhcp/common/conflex.c:1.5 src/dist/dhcp/common/conflex.c:1.6 --- src/dist/dhcp/common/conflex.c:1.5 Thu Aug 11 17:13:21 2005 +++ src/dist/dhcp/common/conflex.c Sun Jan 17 22:42:36 2010 @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: conflex.c,v 1.5 2005/08/11 17:13:21 drochner Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n"; +"$Id: conflex.c,v 1.6 2010/01/17 22:42:36 wiz Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -467,7 +467,7 @@ log_fatal("read_number():%s:%d: impossible case", MDL); } #else /* OLD_LEXER */ - if (!seenx && (c == 'x') { + if (!seenx && (c == 'x')) { seenx = 1; } else if (!isascii (c) || !isxdigit (c)) { if (c != EOF) {
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: dsl Date: Sun Jan 17 22:21:18 UTC 2010 Modified Files: src/sys/arch/i386/i386: trap.c vector.S Log Message: Fix 'fault on load of %gs during retirn to userspace' to look for the correct instruction bytes. Take the 'fault on load segment register' through the same path as 'fault on iret' so we don't have to fixup the broken stackframe that contains a mix of user and kernel registers, Update comments about how the faults during return to userspace are processed. Setting an invalid %gs in the saved context of a signal handler causes a SIGSEGV handler to be entered with what look like valid registers. To generate a diff of this commit: cvs rdiff -u -r1.252 -r1.253 src/sys/arch/i386/i386/trap.c cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/i386/vector.S 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/trap.c diff -u src/sys/arch/i386/i386/trap.c:1.252 src/sys/arch/i386/i386/trap.c:1.253 --- src/sys/arch/i386/i386/trap.c:1.252 Sun Jan 10 15:37:36 2010 +++ src/sys/arch/i386/i386/trap.c Sun Jan 17 22:21:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.252 2010/01/10 15:37:36 dsl Exp $ */ +/* $NetBSD: trap.c,v 1.253 2010/01/17 22:21:18 dsl Exp $ */ /*- * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.252 2010/01/10 15:37:36 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.253 2010/01/17 22:21:18 dsl Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -123,7 +123,7 @@ static inline int xmm_si_code(struct lwp *); void trap(struct trapframe *); void trap_tss(struct i386tss *, int, int); -void trap_return_iret(struct trapframe *) __dead; +void trap_return_fault_return(struct trapframe *) __dead; #ifdef KVM86 #include @@ -300,7 +300,7 @@ struct proc *p; struct pcb *pcb; extern char fusubail[], kcopy_fault[], return_address_fault[], - trapreturn[], IDTVEC(osyscall)[]; + IDTVEC(osyscall)[]; struct trapframe *vframe; ksiginfo_t ksi; void *onfault; @@ -398,96 +398,76 @@ /* * Check for failure during return to user mode. + * This can happen loading invalid values into the segment + * registers, or during the 'iret' itself. * * We do this by looking at the instruction we faulted on. * The specific instructions we recognize only happen when * returning from a trap, syscall, or interrupt. - * - * At this point, there are (at least) two trap frames on - * the kernel stack; we presume here that we faulted while - * loading our registers out of the outer one. */ KSI_INIT_TRAP(&ksi); ksi.ksi_signo = SIGSEGV; - /* There is no fault address! */ ksi.ksi_code = SEGV_ACCERR; ksi.ksi_trap = type; switch (*(u_char *)frame->tf_eip) { case 0xcf: /* iret */ /* - * The outer trap frame only contains the user space - * return address and stack pointer. - * The user registers are in the inner frame following - * the kernel address of the iret. - * We must copy the registers next to the userspace - * return address so we have a frame for md_regs. - * - * Also, we might have faulted trying to execute the - * trampoline for a local (nested) signal handler. - * If we change the %cs (eg to include the stack) - * just return the return to user. + * The 'iret' instruction faulted, so we have the + * 'user' registers saved after the kernel %eip:%cs:%fl + * of the 'iret' and below that the user %eip:%cs:%fl + * the 'iret' was processing. + * We must delete the 3 words of kernel return address + * from the stack to generate a normal stack frame + * (eg for sending a SIGSEGV). */ vframe = (void *)((int *)frame + 3); if (KERNELMODE(vframe->tf_cs, vframe->tf_eflags)) goto we_re_toast; memmove(vframe, frame, offsetof(struct trapframe, tf_eip)); - l->l_md.md_regs = vframe; + /* Set the faulting address to the user %eip */ ksi.ksi_addr = (void *)vframe->tf_eip; - if (!pmap_exec_fixup(&p->p_vmspace->vm_map, vframe, - lwp_getpcb(l))) -(*p->p_emul->e_trapsignal)(l, &ksi); - trap_return_iret(vframe); - /* NOTREACHED */ + break; case 0x8e: switch (*(uint32_t *)frame->tf_eip) { - case 0x0c245c8e: /* movl 0xc(%esp,1),%ds */ - case 0x0824448e: /* movl 0x8(%esp,1),%es */ - case 0x0424648e: /* movl 0x4(%esp,1),%fs */ - case 0x00246c8e: /* movl 0x0(%esp,1),%gs */ + case 0x8e242c8e: /* mov (%esp,%gs), then */ + case 0x0424648e: /* mov 0x4(%esp),%fs */ + case 0x0824448e: /* mov 0x8(%esp),%es */ + case 0x0c245c8e: /* mov 0xc(%esp),%ds */ break; default: goto we_re_toast; } + /* + * We faulted loading one if the user segment registers. + * The stack frame containing the user registers is + * still valid and is just below the %eip:
CVS commit: src/sys
Module Name:src Committed By: pooka Date: Sun Jan 17 19:45:07 UTC 2010 Modified Files: src/sys/dev/ic: anvar.h athvar.h atwvar.h pdqvar.h rt2560var.h rt2661var.h rtwvar.h wivar.h src/sys/dev/pci: if_iwnvar.h if_wpivar.h src/sys/dev/usb: if_rumvar.h if_uralvar.h if_zydreg.h src/sys/net: bpf.c bpf.h if.h src/sys/net80211: ieee80211_var.h Log Message: Forward declare struct bpf_if and use that as the type for bpf_if instead of "void *". Buys us oo times the type-safety for 0 times the price. (no functional change) To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/anvar.h cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/athvar.h cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/atwvar.h cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/pdqvar.h cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/rt2560var.h cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/rt2661var.h cvs rdiff -u -r1.40 -r1.41 src/sys/dev/ic/rtwvar.h cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/wivar.h cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_iwnvar.h cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/if_wpivar.h cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_rumvar.h cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_uralvar.h cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/if_zydreg.h cvs rdiff -u -r1.151 -r1.152 src/sys/net/bpf.c cvs rdiff -u -r1.50 -r1.51 src/sys/net/bpf.h cvs rdiff -u -r1.145 -r1.146 src/sys/net/if.h cvs rdiff -u -r1.27 -r1.28 src/sys/net80211/ieee80211_var.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/dev/ic/anvar.h diff -u src/sys/dev/ic/anvar.h:1.19 src/sys/dev/ic/anvar.h:1.20 --- src/sys/dev/ic/anvar.h:1.19 Thu Nov 12 19:28:59 2009 +++ src/sys/dev/ic/anvar.h Sun Jan 17 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: anvar.h,v 1.19 2009/11/12 19:28:59 dyoung Exp $ */ +/* $NetBSD: anvar.h,v 1.20 2010/01/17 19:45:06 pooka Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -146,7 +146,7 @@ } sc_buf; /* radiotap header */ - void * sc_drvbpf; + struct bpf_if * sc_drvbpf; union { struct an_rx_radiotap_header tap; u_int8_t pad[64]; Index: src/sys/dev/ic/athvar.h diff -u src/sys/dev/ic/athvar.h:1.29 src/sys/dev/ic/athvar.h:1.30 --- src/sys/dev/ic/athvar.h:1.29 Wed Sep 16 16:34:50 2009 +++ src/sys/dev/ic/athvar.h Sun Jan 17 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: athvar.h,v 1.29 2009/09/16 16:34:50 dyoung Exp $ */ +/* $NetBSD: athvar.h,v 1.30 2010/01/17 19:45:06 pooka Exp $ */ /*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -243,7 +243,7 @@ u_int16_t sc_ledoff; /* off time for current blink */ struct callout sc_ledtimer; /* led off timer */ - void * sc_drvbpf; + struct bpf_if * sc_drvbpf; union { struct ath_tx_radiotap_header th; u_int8_t pad[64]; Index: src/sys/dev/ic/atwvar.h diff -u src/sys/dev/ic/atwvar.h:1.34 src/sys/dev/ic/atwvar.h:1.35 --- src/sys/dev/ic/atwvar.h:1.34 Fri Jan 8 20:02:39 2010 +++ src/sys/dev/ic/atwvar.h Sun Jan 17 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: atwvar.h,v 1.34 2010/01/08 20:02:39 dyoung Exp $ */ +/* $NetBSD: atwvar.h,v 1.35 2010/01/17 19:45:06 pooka Exp $ */ /* * Copyright (c) 2003, 2004 The NetBSD Foundation, Inc. All rights reserved. @@ -200,7 +200,7 @@ u_int16_t *sc_srom; u_int16_t sc_sromsz; - void * sc_radiobpf; + struct bpf_if * sc_radiobpf; bus_dma_segment_t sc_cdseg; /* control data memory */ int sc_cdnseg; /* number of segments */ Index: src/sys/dev/ic/pdqvar.h diff -u src/sys/dev/ic/pdqvar.h:1.41 src/sys/dev/ic/pdqvar.h:1.42 --- src/sys/dev/ic/pdqvar.h:1.41 Wed Mar 18 16:00:18 2009 +++ src/sys/dev/ic/pdqvar.h Sun Jan 17 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pdqvar.h,v 1.41 2009/03/18 16:00:18 cegger Exp $ */ +/* $NetBSD: pdqvar.h,v 1.42 2010/01/17 19:45:06 pooka Exp $ */ /*- * Copyright (c) 1995, 1996 Matt Thomas @@ -348,7 +348,7 @@ #if !defined(__bsdi__) || _BSDI_VERSION >= 199401 #define sc_bpf sc_if.if_bpf #else -void *sc_bpf; +struct bpf_if *sc_bpf; #endif #if defined(PDQ_BUS_DMA) #if !defined(__NetBSD__) Index: src/sys/dev/ic/rt2560var.h diff -u src/sys/dev/ic/rt2560var.h:1.6 src/sys/dev/ic/rt2560var.h:1.7 --- src/sys/dev/ic/rt2560var.h:1.6 Sun Dec 9 20:27:58 2007 +++ src/sys/dev/ic/rt2560var.h Sun Jan 17 19:45:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rt2560var.h,v 1.6 2007/12/09 20:27:58 jmcneill Exp $ */ +/* $NetBSD: rt2560var.h,v 1.7 2010/01/17 19:45:06 pooka Exp $ */ /* $OpenBSD: rt2560var.h,v 1.2 2006/01/14 12:43:27 damien Exp $ */ /*- @@ -150,7 +150,7 @@ int dwelltime; #if NBPFILTER > 0 - void * sc_drvbpf; + struct bpf_if * sc_drvbpf; union { struct rt2560_rx_radiotap_header th; Index: src/sys/dev/ic/rt2661var.h diff -u src/sys/dev/ic/rt2661var.h:1.8 src/sys/dev/ic/rt2661var.h:1.9 --- src/sys/dev/ic/rt2661var.h:1.8 Tue Apr 29 22:21:45 2008 +++ src/sys/dev/ic/rt2661var.h Sun
CVS commit: othersrc/usr.bin/tn3270
Module Name:othersrc Committed By: spz Date: Sun Jan 17 18:00:07 UTC 2010 Update of /cvsroot/othersrc/usr.bin/tn3270 In directory ivanova.netbsd.org:/tmp/cvs-serv17966 Log Message: tn3270 ex from src, conditioned to be built outside of src by dholland@ Status: Vendor Tag: TNF Release Tags: othersrc-base N othersrc/usr.bin/tn3270/Makefile N othersrc/usr.bin/tn3270/api/api_bsd.c N othersrc/usr.bin/tn3270/api/api_exch.c N othersrc/usr.bin/tn3270/api/api_exch.h N othersrc/usr.bin/tn3270/api/apilib.c N othersrc/usr.bin/tn3270/api/apilib.h N othersrc/usr.bin/tn3270/api/asc_ebc.c N othersrc/usr.bin/tn3270/api/asc_ebc.h N othersrc/usr.bin/tn3270/api/astosc.c N othersrc/usr.bin/tn3270/api/astosc.h N othersrc/usr.bin/tn3270/api/dctype.c N othersrc/usr.bin/tn3270/api/dctype.h N othersrc/usr.bin/tn3270/api/disp_asc.c N othersrc/usr.bin/tn3270/api/disp_asc.h N othersrc/usr.bin/tn3270/api/ebc_disp.c N othersrc/usr.bin/tn3270/api/ebc_disp.h N othersrc/usr.bin/tn3270/ascii/default.map N othersrc/usr.bin/tn3270/ascii/map3270.c N othersrc/usr.bin/tn3270/ascii/map3270.h N othersrc/usr.bin/tn3270/ascii/mset.c N othersrc/usr.bin/tn3270/ascii/state.h N othersrc/usr.bin/tn3270/ascii/termin.c N othersrc/usr.bin/tn3270/ctlr/3180.kbd N othersrc/usr.bin/tn3270/ctlr/3270pc.kbd N othersrc/usr.bin/tn3270/ctlr/api.c N othersrc/usr.bin/tn3270/ctlr/api.h N othersrc/usr.bin/tn3270/ctlr/declare.h N othersrc/usr.bin/tn3270/ctlr/function.c N othersrc/usr.bin/tn3270/ctlr/function.h N othersrc/usr.bin/tn3270/ctlr/hostctlr.h N othersrc/usr.bin/tn3270/ctlr/inbound.c N othersrc/usr.bin/tn3270/ctlr/oia.c N othersrc/usr.bin/tn3270/ctlr/oia.h N othersrc/usr.bin/tn3270/ctlr/options.c N othersrc/usr.bin/tn3270/ctlr/options.h N othersrc/usr.bin/tn3270/ctlr/outbound.c N othersrc/usr.bin/tn3270/ctlr/screen.h N othersrc/usr.bin/tn3270/ctlr/scrnctlr.h N othersrc/usr.bin/tn3270/ctlr/unix.kbd N othersrc/usr.bin/tn3270/general/genbsubs.c N othersrc/usr.bin/tn3270/general/general.h N othersrc/usr.bin/tn3270/general/globals.c N othersrc/usr.bin/tn3270/general/globals.h N othersrc/usr.bin/tn3270/general/vaxbsubs.s N othersrc/usr.bin/tn3270/mk/prog.mk N othersrc/usr.bin/tn3270/mk/setup.mk N othersrc/usr.bin/tn3270/mset/Makefile N othersrc/usr.bin/tn3270/mset/map3270 N othersrc/usr.bin/tn3270/mset/map3270.5 N othersrc/usr.bin/tn3270/mset/mset.1 N othersrc/usr.bin/tn3270/sys_curses/system.c N othersrc/usr.bin/tn3270/sys_curses/telextrn.h N othersrc/usr.bin/tn3270/sys_curses/terminal.h N othersrc/usr.bin/tn3270/sys_curses/termout.c N othersrc/usr.bin/tn3270/telnet/commands.c N othersrc/usr.bin/tn3270/telnet/defines.h N othersrc/usr.bin/tn3270/telnet/externs.h N othersrc/usr.bin/tn3270/telnet/general.h N othersrc/usr.bin/tn3270/telnet/main.c N othersrc/usr.bin/tn3270/telnet/network.c N othersrc/usr.bin/tn3270/telnet/ring.c N othersrc/usr.bin/tn3270/telnet/ring.h N othersrc/usr.bin/tn3270/telnet/sys_bsd.c N othersrc/usr.bin/tn3270/telnet/telnet.c N othersrc/usr.bin/tn3270/telnet/terminal.c N othersrc/usr.bin/tn3270/telnet/tn3270.c N othersrc/usr.bin/tn3270/telnet/types.h N othersrc/usr.bin/tn3270/telnet/utilities.c N othersrc/usr.bin/tn3270/telnet/libtelnet/genget.c N othersrc/usr.bin/tn3270/telnet/libtelnet/misc-proto.h N othersrc/usr.bin/tn3270/telnet/libtelnet/misc.h N othersrc/usr.bin/tn3270/tn3270/Makefile N othersrc/usr.bin/tn3270/tn3270/tn3270.1 N othersrc/usr.bin/tn3270/tools/Makefile N othersrc/usr.bin/tn3270/tools/mkastods/Makefile N othersrc/usr.bin/tn3270/tools/mkastods/mkastods.c N othersrc/usr.bin/tn3270/tools/mkastosc/Makefile N othersrc/usr.bin/tn3270/tools/mkastosc/mkastosc.c N othersrc/usr.bin/tn3270/tools/mkdctype/Makefile N othersrc/usr.bin/tn3270/tools/mkdctype/ectype.c N othersrc/usr.bin/tn3270/tools/mkdctype/ectype.h N othersrc/usr.bin/tn3270/tools/mkdctype/mkdctype.c N othersrc/usr.bin/tn3270/tools/mkdstoas/Makefile N othersrc/usr.bin/tn3270/tools/mkdstoas/mkdstoas.c N othersrc/usr.bin/tn3270/tools/mkhits/Makefile N othersrc/usr.bin/tn3270/tools/mkhits/dohits.c N othersrc/usr.bin/tn3270/tools/mkhits/dohits.h N othersrc/usr.bin/tn3270/tools/mkhits/mkhits.c N othersrc/usr.bin/tn3270/tools/mkmake/Makefile N othersrc/usr.bin/tn3270/tools/mkmake/mkmake.y N othersrc/usr.bin/tn3270/tools/prt3270/Makefile N othersrc/usr.bin/tn3270/tools/prt3270/prt3270.c No conflicts created by this import
CVS commit: src/sys/arch/i386/stand/pxeboot
Module Name:src Committed By: drochner Date: Sun Jan 17 17:02:47 UTC 2010 Modified Files: src/sys/arch/i386/stand/pxeboot: Makefile Log Message: fix tyop in default flag definition To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/pxeboot/Makefile 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/stand/pxeboot/Makefile diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.19 src/sys/arch/i386/stand/pxeboot/Makefile:1.20 --- src/sys/arch/i386/stand/pxeboot/Makefile:1.19 Sun Jan 17 14:54:44 2010 +++ src/sys/arch/i386/stand/pxeboot/Makefile Sun Jan 17 17:02:47 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.19 2010/01/17 14:54:44 drochner Exp $ +# $NetBSD: Makefile,v 1.20 2010/01/17 17:02:47 drochner Exp $ S= ${.CURDIR}/../../../.. @@ -65,7 +65,7 @@ # modules and boot.cfg need special DHCP server setup, disable # per default for compatibility with existing setups -CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0xc0 +CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0x0c #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
CVS commit: src/sys/arch/powerpc/oea
Module Name:src Committed By: phx Date: Sun Jan 17 16:47:17 UTC 2010 Modified Files: src/sys/arch/powerpc/oea: ofwoea_machdep.c Log Message: Heed modeldata.ranges_offset while constructing the ranges bitmap. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/oea/ofwoea_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/powerpc/oea/ofwoea_machdep.c diff -u src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.17 src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.18 --- src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.17 Fri Feb 13 22:41:03 2009 +++ src/sys/arch/powerpc/oea/ofwoea_machdep.c Sun Jan 17 16:47:17 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ofwoea_machdep.c,v 1.17 2009/02/13 22:41:03 apb Exp $ */ +/* $NetBSD: ofwoea_machdep.c,v 1.18 2010/01/17 16:47:17 phx Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.17 2009/02/13 22:41:03 apb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.18 2010/01/17 16:47:17 phx Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -349,7 +349,7 @@ /* - * Scan the device tree for ranges, and batmap them. + * Scan the device tree for ranges, and return them as bitmap 0..15 */ static u_int16_t @@ -373,7 +373,11 @@ if (j == -1) goto noranges; +#ifdef ofppc + reclen = acells + modeldata.ranges_offset + scells; +#else reclen = acells + 1 + scells; +#endif for (i=0; i < (mlen/4)/reclen; i++) { addr = map[reclen * i + acells];
CVS commit: src/sys/arch/sparc/dev
Module Name:src Committed By: tsutsui Date: Sun Jan 17 16:23:43 UTC 2010 Modified Files: src/sys/arch/sparc/dev: zs.c Log Message: Make sure to set ZS_HWFLAG_USE_CONSDEV and zs_consdev into zsc_args passed to child devices even in !(NWSKBD == 0) case so that zs console functions are actually used rather than the default prom console. Fixes stray interrupts on MP machines running GENERIC.MP kernel with zs serial console. Ok'ed by m...@. To generate a diff of this commit: cvs rdiff -u -r1.116 -r1.117 src/sys/arch/sparc/dev/zs.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/sparc/dev/zs.c diff -u src/sys/arch/sparc/dev/zs.c:1.116 src/sys/arch/sparc/dev/zs.c:1.117 --- src/sys/arch/sparc/dev/zs.c:1.116 Sun May 31 17:09:03 2009 +++ src/sys/arch/sparc/dev/zs.c Sun Jan 17 16:23:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.116 2009/05/31 17:09:03 martin Exp $ */ +/* $NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.116 2009/05/31 17:09:03 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -464,6 +464,10 @@ } } else { zsc_args.hwflags = hwflags; + if (zsc_args.hwflags & ZS_HWFLAG_CONSOLE) { +zsc_args.hwflags |= ZS_HWFLAG_USE_CONSDEV; +zsc_args.consdev = &zs_consdev; + } } #endif if ((zsc_args.hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0) {
CVS commit: src
Module Name:src Committed By: drochner Date: Sun Jan 17 14:54:44 UTC 2010 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/lib: boot_params.S src/sys/arch/i386/stand/pxeboot: Makefile main.c src/sys/sys: bootblock.h src/usr.sbin/installboot/arch: i386.c Log Message: Invert the flag bits to control module loading: rename LOADMODULES->NOMODULES and READBOOTCONF->NOBOOTCONF. This way, the default value (0) wired into old bootxx_* and installed to file systems remains valid and we avoid problems on partial updates. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/boot_params.S cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/pxeboot/Makefile cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/stand/pxeboot/main.c cvs rdiff -u -r1.49 -r1.50 src/sys/sys/bootblock.h cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/installboot/arch/i386.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/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.46 src/sys/arch/i386/stand/boot/boot2.c:1.47 --- src/sys/arch/i386/stand/boot/boot2.c:1.46 Thu Jan 14 17:49:31 2010 +++ src/sys/arch/i386/stand/boot/boot2.c Sun Jan 17 14:54:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.46 2010/01/14 17:49:31 drochner Exp $ */ +/* $NetBSD: boot2.c,v 1.47 2010/01/17 14:54:44 drochner Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -291,8 +291,8 @@ #endif gateA20(); - boot_modules_enabled = !!(boot_params.bp_flags - & X86_BP_FLAGS_LOADMODULES); + boot_modules_enabled = !(boot_params.bp_flags + & X86_BP_FLAGS_NOMODULES); if (boot_params.bp_flags & X86_BP_FLAGS_RESET_VIDEO) biosvideomode(); @@ -310,7 +310,7 @@ default_filename = DEFFILENAME; #ifndef SMALL - if (boot_params.bp_flags & X86_BP_FLAGS_READBOOTCONF) + if (!(boot_params.bp_flags & X86_BP_FLAGS_NOBOOTCONF)) parsebootconf(BOOTCONF); /* Index: src/sys/arch/i386/stand/lib/boot_params.S diff -u src/sys/arch/i386/stand/lib/boot_params.S:1.5 src/sys/arch/i386/stand/lib/boot_params.S:1.6 --- src/sys/arch/i386/stand/lib/boot_params.S:1.5 Thu Jan 14 17:49:31 2010 +++ src/sys/arch/i386/stand/lib/boot_params.S Sun Jan 17 14:54:44 2010 @@ -1,11 +1,11 @@ -/* $NetBSD: boot_params.S,v 1.5 2010/01/14 17:49:31 drochner Exp $ */ +/* $NetBSD: boot_params.S,v 1.6 2010/01/17 14:54:44 drochner Exp $ */ /* Default boot parameters - must match struct x86_boot_params in bootblock.h */ #ifdef BOOTPARAM_DEFFLAGS .long BOOTPARAM_DEFFLAGS #else - .long 0x0c /* flags: bootconf+modules */ + .long 0x0 #endif .long 5 /* timeout in seconds */ .long 0 /* console device 0 => CONSDEV_PC */ Index: src/sys/arch/i386/stand/pxeboot/Makefile diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.18 src/sys/arch/i386/stand/pxeboot/Makefile:1.19 --- src/sys/arch/i386/stand/pxeboot/Makefile:1.18 Thu Jan 14 17:49:31 2010 +++ src/sys/arch/i386/stand/pxeboot/Makefile Sun Jan 17 14:54:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.18 2010/01/14 17:49:31 drochner Exp $ +# $NetBSD: Makefile,v 1.19 2010/01/17 14:54:44 drochner Exp $ S= ${.CURDIR}/../../../.. @@ -65,7 +65,7 @@ # modules and boot.cfg need special DHCP server setup, disable # per default for compatibility with existing setups -CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0 +CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0xc0 #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main Index: src/sys/arch/i386/stand/pxeboot/main.c diff -u src/sys/arch/i386/stand/pxeboot/main.c:1.23 src/sys/arch/i386/stand/pxeboot/main.c:1.24 --- src/sys/arch/i386/stand/pxeboot/main.c:1.23 Thu Jan 14 17:49:31 2010 +++ src/sys/arch/i386/stand/pxeboot/main.c Sun Jan 17 14:54:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.23 2010/01/14 17:49:31 drochner Exp $ */ +/* $NetBSD: main.c,v 1.24 2010/01/17 14:54:44 drochner Exp $ */ /* * Copyright (c) 1996 @@ -130,11 +130,11 @@ initio(CONSDEV_PC); #endif gateA20(); - boot_modules_enabled = !!(boot_params.bp_flags - & X86_BP_FLAGS_LOADMODULES); + boot_modules_enabled = !(boot_params.bp_flags + & X86_BP_FLAGS_NOMODULES); #ifndef SMALL - if (boot_params.bp_flags & X86_BP_FLAGS_READBOOTCONF) + if (!(boot_params.bp_flags & X86_BP_FLAGS_NOBOOTCONF)) parsebootconf(BOOTCONF); /* Index: src/sys/sys/bootblock.h diff -u src/sys/sys/bootblock.h:1.49 src/sys/sys/bootblock.h:1.50 --- src/sys/sys/bootblock.h:1.49 Thu Jan 14 17:49:31 2010 +++ src/sys/sys/bootblock.h Sun Jan 17 14:54:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: bootblock.h,v 1.49 2010/01/14 17:49:31 drochner Exp $ */ +/* $NetBSD: bootblock.h,v 1.50 2010/01/17 14:54:43 drochner Exp $ */ /*- * Copyright (c) 2002-2004 The NetBSD Foundation, Inc. @@ -1068,8 +1068,8 @@ /* va
CVS commit: src/games/fortune/strfile
Module Name:src Committed By: mbalmer Date: Sun Jan 17 13:35:00 UTC 2010 Modified Files: src/games/fortune/strfile: strfile.8 Log Message: The default output file extension is '.dat', not '.out'. >From Lars Nooden via OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/games/fortune/strfile/strfile.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/games/fortune/strfile/strfile.8 diff -u src/games/fortune/strfile/strfile.8:1.12 src/games/fortune/strfile/strfile.8:1.13 --- src/games/fortune/strfile/strfile.8:1.12 Thu Sep 9 22:03:21 2004 +++ src/games/fortune/strfile/strfile.8 Sun Jan 17 13:35:00 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: strfile.8,v 1.12 2004/09/09 22:03:21 wiz Exp $ +.\" $NetBSD: strfile.8,v 1.13 2010/01/17 13:35:00 mbalmer Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" .\" @(#)strfile.8 8.1 (Berkeley) 6/9/93 .\" -.Dd June 9, 1993 +.Dd January 17, 2010 .Dt STRFILE 8 .Os .Sh NAME @@ -57,7 +57,7 @@ This allows random access of the strings. .Pp The output file, if not specified on the command line, is named -.Ar source_file Ns Sy .out . +.Ar source_file Ns Sy .dat . .Pp The options are as follows: .Bl -tag -width "-c char" @@ -130,7 +130,7 @@ to dump them out in the table order. .Sh FILES .Bl -tag -width strfile.out -compact -.It Pa strfile.out +.It Pa strfile.dat default output file. .El .Sh SEE ALSO
CVS commit: src/bin/csh
Module Name:src Committed By: wiz Date: Sun Jan 17 12:15:37 UTC 2010 Modified Files: src/bin/csh: lex.c Log Message: Match curly braces in undef(FILEC) case. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/bin/csh/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/csh/lex.c diff -u src/bin/csh/lex.c:1.26 src/bin/csh/lex.c:1.27 --- src/bin/csh/lex.c:1.26 Mon Jul 16 18:26:10 2007 +++ src/bin/csh/lex.c Sun Jan 17 12:15:36 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.26 2007/07/16 18:26:10 christos Exp $ */ +/* $NetBSD: lex.c,v 1.27 2010/01/17 12:15:36 wiz Exp $ */ /*- * Copyright (c) 1980, 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: lex.c,v 1.26 2007/07/16 18:26:10 christos Exp $"); +__RCSID("$NetBSD: lex.c,v 1.27 2010/01/17 12:15:36 wiz Exp $"); #endif #endif /* not lint */ @@ -1476,7 +1476,9 @@ } else if (errno != EINTR) break; +#ifdef FILEC } +#endif if (c <= 0) return (-1); feobp += c;
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: haad Date: Sun Jan 17 12:08:29 UTC 2010 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Fix problem where xbdi->xbdi_size was set to 0 after succesfull DIOCGWEDGEINFO call. Problem reported in private mail. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.29 src/sys/arch/xen/xen/xbdback_xenbus.c:1.30 --- src/sys/arch/xen/xen/xbdback_xenbus.c:1.29 Tue Dec 15 00:19:52 2009 +++ src/sys/arch/xen/xen/xbdback_xenbus.c Sun Jan 17 12:08:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: xbdback_xenbus.c,v 1.29 2009/12/15 00:19:52 haad Exp $ */ +/* $NetBSD: xbdback_xenbus.c,v 1.30 2010/01/17 12:08:29 haad Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.29 2009/12/15 00:19:52 haad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.30 2010/01/17 12:08:29 haad Exp $"); #include #include @@ -731,9 +731,9 @@ "for domain %d\n", wi.dkw_devname, xbdi->xbdi_size, xbdi->xbdi_domid); } - /* ENOTTY should be returned only when device doesn't implement - DIOCGWEDGEINFO and we are working with non wedge like device. */ - if (err != ENOTTY) { + if ((err != 0) && (err != ENOTTY)) { + /* ENOTTY should be returned only when device doesn't implement + DIOCGWEDGEINFO and we are working with non wedge like device. */ printf("xbdback %s: can't DIOCGWEDGEINFO device " "0x%"PRIx64": %d\n", xbusd->xbusd_path, xbdi->xbdi_dev, err);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jdc Date: Sun Jan 17 11:57:29 UTC 2010 Modified Files: src/sys/dev/pci: if_cas.c Log Message: Mask out (disable) cas interrupts on detach and suspend. (Re-)enable interrupts on resume. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_cas.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/pci/if_cas.c diff -u src/sys/dev/pci/if_cas.c:1.2 src/sys/dev/pci/if_cas.c:1.3 --- src/sys/dev/pci/if_cas.c:1.2 Sat Jan 9 13:34:33 2010 +++ src/sys/dev/pci/if_cas.c Sun Jan 17 11:57:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cas.c,v 1.2 2010/01/09 13:34:33 martin Exp $ */ +/* $NetBSD: if_cas.c,v 1.3 2010/01/17 11:57:29 jdc Exp $ */ /* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ /* @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.2 2010/01/09 13:34:33 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.3 2010/01/17 11:57:29 jdc Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -115,7 +115,7 @@ #define TRIES 1 -static bool cas_estintr(struct cas_softc *sc); +static bool cas_estintr(struct cas_softc *sc, int); bool cas_shutdown(device_t, int); static bool cas_suspend(device_t, pmf_qual_t); static bool cas_resume(device_t, pmf_qual_t); @@ -385,7 +385,7 @@ return; } sc->sc_pc = pa->pa_pc; - if (!cas_estintr(sc)) { + if (!cas_estintr(sc, CAS_INTR_PCI)) { bus_space_unmap(sc->sc_memt, sc->sc_memh, sc->sc_size); aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n"); return; @@ -657,6 +657,8 @@ { int i; struct cas_softc *sc = device_private(self); + bus_space_tag_t t = sc->sc_memt; + bus_space_handle_t h = sc->sc_memh; struct ifnet *ifp = &sc->sc_ethercom.ec_if; /* @@ -665,6 +667,7 @@ */ switch (sc->sc_att_stage) { case CAS_ATT_FINISHED: + bus_space_write_4(t, h, CAS_INTMASK, ~(uint32_t)0); pmf_device_deregister(self); cas_stop(&sc->sc_ethercom.ec_if, 1); evcnt_detach(&sc->sc_ev_intr); @@ -695,7 +698,7 @@ for (i = 0; i < CAS_NRXDESC; i++) { if (sc->sc_rxsoft[i].rxs_dmamap != NULL) bus_dmamap_unload(sc->sc_dmatag, - sc->sc_rxsoft[i].rxs_dmamap); +sc->sc_rxsoft[i].rxs_dmamap); if (sc->sc_rxsoft[i].rxs_dmamap != NULL) bus_dmamap_destroy(sc->sc_dmatag, sc->sc_rxsoft[i].rxs_dmamap); @@ -1139,18 +1142,7 @@ } /* step 8. Global Configuration & Interrupt Mask */ - bus_space_write_4(t, h, CAS_INTMASK, - ~(CAS_INTR_TX_INTME|CAS_INTR_TX_EMPTY| - CAS_INTR_TX_TAG_ERR| - CAS_INTR_RX_DONE|CAS_INTR_RX_NOBUF| - CAS_INTR_RX_TAG_ERR| - CAS_INTR_RX_COMP_FULL|CAS_INTR_PCS| - CAS_INTR_MAC_CONTROL|CAS_INTR_MIF| - CAS_INTR_BERR)); - bus_space_write_4(t, h, CAS_MAC_RX_MASK, - CAS_MAC_RX_DONE|CAS_MAC_RX_FRAME_CNT); - bus_space_write_4(t, h, CAS_MAC_TX_MASK, CAS_MAC_TX_XMIT_DONE); - bus_space_write_4(t, h, CAS_MAC_CONTROL_MASK, 0); /* */ + cas_estintr(sc, CAS_INTR_REG); /* step 9. ETX Configuration: use mostly default values */ @@ -1240,7 +1232,7 @@ /* Secondary MAC addresses set to 0:0:0:0:0:0 */ for (r = CAS_MAC_ADDR3; r < CAS_MAC_ADDR42; r += 4) - bus_space_write_4(t, h, r, 0); + bus_space_write_4(t, h, r, 0); /* MAC control addr set to 0:1:c2:0:1:80 */ bus_space_write_4(t, h, CAS_MAC_ADDR42, 0x0001); @@ -1515,9 +1507,9 @@ if (status & CAS_INTR_RX_MAC) { int rxstat = bus_space_read_4(t, seb, CAS_MAC_RX_STATUS); #ifdef CAS_DEBUG - if (rxstat & ~CAS_MAC_RX_DONE) - printf("%s: MAC rx fault, status %x\n", - device_xname(sc->sc_dev), rxstat); + if (rxstat & ~CAS_MAC_RX_DONE) + printf("%s: MAC rx fault, status %x\n", + device_xname(sc->sc_dev), rxstat); #endif /* * On some chip revisions CAS_MAC_RX_OVERFLOW happen often @@ -1833,11 +1825,6 @@ } } - /* Try to get things going again */ -/* - if (ifp->if_flags & IFF_UP) - cas_start(ifp); -*/ splx(s); return (error); } @@ -1846,7 +1833,10 @@ cas_suspend(device_t self, pmf_qual_t qual) { struct cas_softc *sc = device_private(self); + bus_space_tag_t t = sc->sc_memt; + bus_space_handle_t h = sc->sc_memh; + bus_space_write_4(t, h, CAS_INTMASK, ~(uint32_t)0); if (sc->sc_ih != NULL) { pci_intr_disestablish(sc->sc_pc, sc->sc_ih); sc->sc_ih = NULL; @@ -1860,26 +1850,48 @@ { struct cas_softc *sc = device_private(self); - return cas_estintr(sc); + return cas_estintr(sc, CAS_INTR_PCI | CAS_INTR_REG); } static bool -cas_estintr(struct cas_softc *sc) +cas_estintr(struct cas_softc *sc, int what) { + bus_space_tag_t t = sc->sc_memt; + bus_space_handle_t h = sc->sc_memh; const char *intrstr = NULL; - intrstr = pci_intr_string(sc->sc_pc, sc->sc_handle); - sc->sc_ih = pci_intr_establish(sc->sc_pc, sc->sc_handle, - IPL_NET, cas_intr, sc); - if (sc->sc_ih == NULL) { - aprint_error_dev(sc->sc_dev, "unable to establish interrupt"); -
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 17 08:50:04 UTC 2010 Modified Files: src/sys/arch/hppa/hppa: trap.c vm_machdep.c Log Message: Use pmap_extract instead of kvtop. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/arch/hppa/hppa/trap.c cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hppa/hppa/vm_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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.70 src/sys/arch/hppa/hppa/trap.c:1.71 --- src/sys/arch/hppa/hppa/trap.c:1.70 Sat Jan 16 13:29:47 2010 +++ src/sys/arch/hppa/hppa/trap.c Sun Jan 17 08:50:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.71 2010/01/17 08:50:04 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2010/01/16 13:29:47 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.71 2010/01/17 08:50:04 skrll Exp $"); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -462,10 +462,15 @@ SANITY(l != NULL || (tf->tf_sp >= minsp && tf->tf_sp < maxsp)); } else { + bool ok; + paddr_t pa; + + ok = pmap_extract(pmap_kernel(), uvm_lwp_getuarea(l), &pa); + KASSERT(ok); + SANITY(USERMODE(tf->tf_iioq_head)); SANITY(USERMODE(tf->tf_iioq_tail)); - SANITY(l != NULL && - tf->tf_cr30 == kvtop((void *)uvm_lwp_getuarea(l))); + SANITY(l != NULL && tf->tf_cr30 == pa); } #undef SANITY out: Index: src/sys/arch/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.39 src/sys/arch/hppa/hppa/vm_machdep.c:1.40 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.39 Sun Nov 29 04:15:42 2009 +++ src/sys/arch/hppa/hppa/vm_machdep.c Sun Jan 17 08:50:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.39 2009/11/29 04:15:42 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.40 2010/01/17 08:50:04 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.39 2009/11/29 04:15:42 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.40 2010/01/17 08:50:04 skrll Exp $"); #include #include @@ -54,6 +54,7 @@ cpu_activate_pcb(struct lwp *l) { struct trapframe *tf = l->l_md.md_regs; + bool ok; struct pcb *pcb = lwp_getpcb(l); vaddr_t uarea = (vaddr_t)pcb; #ifdef DIAGNOSTIC @@ -64,7 +65,9 @@ * Stash the physical for the pcb of U for later perusal */ pcb->pcb_uva = uarea; - tf->tf_cr30 = kvtop((void *)uarea); + ok = pmap_extract(pmap_kernel(), uarea, (paddr_t *)&tf->tf_cr30); + KASSERT(ok); + fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb, sizeof(struct pcb)); #ifdef DIAGNOSTIC
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 17 08:48:50 UTC 2010 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Remove an old comment. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hppa/hppa/trap.S 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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.37 src/sys/arch/hppa/hppa/trap.S:1.38 --- src/sys/arch/hppa/hppa/trap.S:1.37 Sat Jan 16 13:53:58 2010 +++ src/sys/arch/hppa/hppa/trap.S Sun Jan 17 08:48:50 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.37 2010/01/16 13:53:58 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.38 2010/01/17 08:48:50 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -664,7 +664,6 @@ #define DTLBPRE \ mfctl %ior, %r9 /* Offset */ ! \ mfctl %isr, %r8 /* Space */ - /* CR28XXX according to a popular belief cr28 should be read here */ #define HPMCPRE \ nop
CVS commit: src/sys/arch/hp700/dev
Module Name:src Committed By: skrll Date: Sun Jan 17 08:33:54 UTC 2010 Modified Files: src/sys/arch/hp700/dev: mongoose.c Log Message: Don't panic when bus_space_map fails. Just report and error and carry on. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp700/dev/mongoose.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/hp700/dev/mongoose.c diff -u src/sys/arch/hp700/dev/mongoose.c:1.17 src/sys/arch/hp700/dev/mongoose.c:1.18 --- src/sys/arch/hp700/dev/mongoose.c:1.17 Tue Nov 3 05:07:25 2009 +++ src/sys/arch/hp700/dev/mongoose.c Sun Jan 17 08:33:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mongoose.c,v 1.17 2009/11/03 05:07:25 snj Exp $ */ +/* $NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $ */ /* $OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.17 2009/11/03 05:07:25 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $"); #define MONGOOSE_DEBUG 9 @@ -603,12 +603,19 @@ sc->sc_bt = ca->ca_iot; sc->sc_iomap = ca->ca_hpa; if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_MONGOOSE, - sizeof(struct mongoose_regs), 0, &ioh)) - panic("mgattach: can't map registers"); + sizeof(struct mongoose_regs), 0, &ioh)) { + aprint_error(": can't map registers\n"); + return; + } sc->sc_regs = (struct mongoose_regs *)ioh; + if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_CTRL, - sizeof(struct mongoose_ctrl), 0, &ioh)) - panic("mgattach: can't map control registers"); + sizeof(struct mongoose_ctrl), 0, &ioh)) { + aprint_error(": can't map control registers\n"); + bus_space_unmap(ca->ca_iot, (bus_space_handle_t)sc->sc_regs, + sizeof(struct mongoose_regs)); + return; + } sc->sc_ctrl = (struct mongoose_ctrl *)ioh; viper_eisa_en();
CVS commit: src/sys/arch/hp700/dev
Module Name:src Committed By: skrll Date: Sun Jan 17 08:29:01 UTC 2010 Modified Files: src/sys/arch/hp700/dev: dino.c Log Message: Add some comments. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c diff -u src/sys/arch/hp700/dev/dino.c:1.21 src/sys/arch/hp700/dev/dino.c:1.22 --- src/sys/arch/hp700/dev/dino.c:1.21 Tue Dec 8 09:56:42 2009 +++ src/sys/arch/hp700/dev/dino.c Sun Jan 17 08:29:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $ */ +/* $NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $ */ /* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $"); /* #include "cardbus.h" */ @@ -62,6 +62,7 @@ extern struct extent *hp700_io_extent; struct dino_regs { + /* HPA Supervisory Register Set */ uint32_t pad0; /* 0x000 */ uint32_t iar0; /* 0x004 rw intr addr reg 0 */ uint32_t iodc; /* 0x008 rw iodc data/addr */ @@ -78,6 +79,8 @@ uint32_t io_status; /* 0x034 r status register */ uint32_t io_control; /* 0x038 rw control register */ uint32_t pad2; /* 0x03c AUX registers follow */ + + /* HPA Auxiliary Register Set */ uint32_t io_gsc_err_addr;/* 0x040 GSC error address */ uint32_t io_err_info; /* 0x044 error info register */ uint32_t io_pci_err_addr;/* 0x048 PCI error address */ @@ -89,8 +92,12 @@ uint32_t pci_io_data; /* 0x06c PCI io data reg */ uint32_t pci_mem_data; /* 0x070 PCI memory data reg */ uint32_t pad4[0x740/4]; /* 0x074 */ + + /* HPA Bus (GSC) Specific-Dependent Register Set */ uint32_t gsc2x_config; /* 0x7b4 GSC2X config reg */ uint32_t pad5[0x48/4]; /* 0x7b8: BSRS registers follow */ + + /* HPA HVERSION (Dino)-Dependent Register Set */ uint32_t gmask; /* 0x800 GSC arbitration mask */ uint32_t pamr; /* 0x804 PCI arbitration mask */ uint32_t papr; /* 0x808 PCI arbitration priority */
CVS commit: src/sys/arch/hppa/include
Module Name:src Committed By: skrll Date: Sun Jan 17 08:24:06 UTC 2010 Modified Files: src/sys/arch/hppa/include: param.h Log Message: Simplify. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/include/param.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/arch/hppa/include/param.h diff -u src/sys/arch/hppa/include/param.h:1.13 src/sys/arch/hppa/include/param.h:1.14 --- src/sys/arch/hppa/include/param.h:1.13 Thu Apr 30 07:01:27 2009 +++ src/sys/arch/hppa/include/param.h Sun Jan 17 08:24:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.13 2009/04/30 07:01:27 skrll Exp $ */ +/* $NetBSD: param.h,v 1.14 2010/01/17 08:24:06 skrll Exp $ */ /* $OpenBSD: param.h,v 1.12 2001/07/06 02:07:41 provos Exp $ */ @@ -25,9 +25,7 @@ * Utah $Hdr: param.h 1.18 94/12/16$ */ -#include - -#if defined(_NETBSD_SOURCE) +#ifdef _KERNEL #include #endif
CVS commit: src/libexec/ld.elf_so
Module Name:src Committed By: skrll Date: Sun Jan 17 08:04:20 UTC 2010 Modified Files: src/libexec/ld.elf_so: rtld.h Log Message: Restore backwards compatibility for binaries referencing the main Obj_Entry. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/libexec/ld.elf_so/rtld.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/rtld.h diff -u src/libexec/ld.elf_so/rtld.h:1.87 src/libexec/ld.elf_so/rtld.h:1.88 --- src/libexec/ld.elf_so/rtld.h:1.87 Sat Jan 16 10:37:51 2010 +++ src/libexec/ld.elf_so/rtld.h Sun Jan 17 08:04:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.h,v 1.87 2010/01/16 10:37:51 skrll Exp $ */ +/* $NetBSD: rtld.h,v 1.88 2010/01/17 08:04:20 skrll Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -130,7 +130,6 @@ caddr_t entry; /* Entry point */ const Elf_Phdr *__junk001; size_t pathlen; /* Pathname length */ - void *ehdr; /* Items from the dynamic section. */ Elf_Addr *pltgot; /* PLTGOT table */ @@ -195,6 +194,8 @@ Objlist dagmembers; /* DAG has these members (%) */ dev_t dev; /* Object's filesystem's device */ ino_t ino; /* Object's inode number */ + + void *ehdr; } Obj_Entry; #if defined(_RTLD_SOURCE)