CVS commit: src/lib/libc/gdtoa

2011-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov 18 08:20:13 UTC 2011

Modified Files:
src/lib/libc/gdtoa: misc.c

Log Message:
Release dtoa lock before returning, pointed out by enami.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gdtoa/misc.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/misc.c
diff -u src/lib/libc/gdtoa/misc.c:1.9 src/lib/libc/gdtoa/misc.c:1.10
--- src/lib/libc/gdtoa/misc.c:1.9	Fri Nov 18 04:17:23 2011
+++ src/lib/libc/gdtoa/misc.c	Fri Nov 18 08:20:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.9 2011/11/18 04:17:23 christos Exp $ */
+/* $NetBSD: misc.c,v 1.10 2011/11/18 08:20:13 martin Exp $ */
 
 /
 
@@ -444,8 +444,10 @@ pow5mult
 			ACQUIRE_DTOA_LOCK(1);
 			if (!(p51 = p5-next)) {
 p51 = p5-next = mult(p5,p5);
-if (p51 == NULL)
+if (p51 == NULL) {
+	FREE_DTOA_LOCK(1);
 	return NULL;
+}
 p51-next = 0;
 }
 			FREE_DTOA_LOCK(1);



CVS commit: src/sys/compat/linux/common

2011-11-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov 18 09:17:09 UTC 2011

Modified Files:
src/sys/compat/linux/common: linux_siginfo.h

Log Message:
Provide linux_siginfo_t for all archs, to unbreak kdump build.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/linux/common/linux_siginfo.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/linux/common/linux_siginfo.h
diff -u src/sys/compat/linux/common/linux_siginfo.h:1.15 src/sys/compat/linux/common/linux_siginfo.h:1.16
--- src/sys/compat/linux/common/linux_siginfo.h:1.15	Fri Nov 18 04:07:44 2011
+++ src/sys/compat/linux/common/linux_siginfo.h	Fri Nov 18 09:17:09 2011
@@ -1,4 +1,4 @@
-/* 	$NetBSD: linux_siginfo.h,v 1.15 2011/11/18 04:07:44 christos Exp $	*/
+/* 	$NetBSD: linux_siginfo.h,v 1.16 2011/11/18 09:17:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -46,6 +46,8 @@
 #include compat/linux/arch/arm/linux_siginfo.h
 #elif defined(__amd64__)
 #include compat/linux/arch/amd64/linux_siginfo.h
+#else
+#define linux_siginfo_t siginfo_t
 #endif
 
 /* si_code values for non signal */



CVS commit: src/libexec/httpd

2011-11-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov 18 09:40:37 UTC 2011

Update of /cvsroot/src/libexec/httpd
In directory ivanova.netbsd.org:/tmp/cvs-serv15395

Log Message:
update to bozohttpd 2018.  nothing major is missing here but
the changes since the prior import were:

o  add -P pidfile option, from j...@netbsd.org
o  avoid crashes with http basic auth, from po...@netbsd.org
o  add support for REDIRECT_STATUS variable, from t...@netbsd.org
o  support .mp4 files in the default map
o  directory indexes with files with : are now displayed properly, from
   r...@netbsd.org
o  allow -I option to be useful in non-inetd mode as well

Status:

Vendor Tag: bozohttpd
Release Tags:   bozohttpd-2018

C src/libexec/httpd/CHANGES
U src/libexec/httpd/Makefile
U src/libexec/httpd/Makefile.boot
C src/libexec/httpd/auth-bozo.c
C src/libexec/httpd/bozohttpd.8
C src/libexec/httpd/bozohttpd.c
C src/libexec/httpd/bozohttpd.h
C src/libexec/httpd/cgi-bozo.c
C src/libexec/httpd/content-bozo.c
C src/libexec/httpd/daemon-bozo.c
C src/libexec/httpd/dir-index-bozo.c
C src/libexec/httpd/main.c
U src/libexec/httpd/queue.h
C src/libexec/httpd/ssl-bozo.c
C src/libexec/httpd/tilde-luzah-bozo.c
U src/libexec/httpd/debug/Makefile
U src/libexec/httpd/libbozohttpd/Makefile
U src/libexec/httpd/libbozohttpd/libbozohttpd.3
U src/libexec/httpd/libbozohttpd/shlib_version
U src/libexec/httpd/lua/Makefile
U src/libexec/httpd/lua/bozo.lua
U src/libexec/httpd/lua/glue.c
U src/libexec/httpd/lua/optparse.lua
U src/libexec/httpd/lua/shlib_version
U src/libexec/httpd/small/Makefile
U src/libexec/httpd/testsuite/Makefile
C src/libexec/httpd/testsuite/html_cmp
U src/libexec/httpd/testsuite/t1.in
U src/libexec/httpd/testsuite/t1.out
U src/libexec/httpd/testsuite/t10.in
U src/libexec/httpd/testsuite/t10.out
U src/libexec/httpd/testsuite/t2.in
U src/libexec/httpd/testsuite/t2.out
U src/libexec/httpd/testsuite/t3.in
U src/libexec/httpd/testsuite/t3.out
U src/libexec/httpd/testsuite/t4.in
U src/libexec/httpd/testsuite/t4.out
U src/libexec/httpd/testsuite/t5.in
U src/libexec/httpd/testsuite/t5.out
U src/libexec/httpd/testsuite/t6.in
U src/libexec/httpd/testsuite/t6.out
U src/libexec/httpd/testsuite/t7.in
U src/libexec/httpd/testsuite/t7.out
U src/libexec/httpd/testsuite/t8.in
U src/libexec/httpd/testsuite/t8.out
U src/libexec/httpd/testsuite/t9.in
U src/libexec/httpd/testsuite/t9.out
U src/libexec/httpd/testsuite/test-bigfile
U src/libexec/httpd/testsuite/data/bigfile
U src/libexec/httpd/testsuite/data/bigfile.partial4000
U src/libexec/httpd/testsuite/data/bigfile.partial8000
U src/libexec/httpd/testsuite/data/file
U src/libexec/httpd/testsuite/data/index.html

13 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jbozohttpd:yesterday -jbozohttpd src/libexec/httpd



CVS commit: src/libexec/httpd

2011-11-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov 18 09:51:31 UTC 2011

Modified Files:
src/libexec/httpd: CHANGES auth-bozo.c bozohttpd.8 bozohttpd.c
bozohttpd.h cgi-bozo.c content-bozo.c daemon-bozo.c
dir-index-bozo.c main.c ssl-bozo.c tilde-luzah-bozo.c
src/libexec/httpd/testsuite: html_cmp
Removed Files:
src/libexec/httpd: bozohttpd.html8

Log Message:
merge bozohttpd 2018


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.9 -r1.10 src/libexec/httpd/auth-bozo.c
cvs rdiff -u -r1.31 -r1.32 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.29 -r1.30 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.19 -r1.20 src/libexec/httpd/bozohttpd.h \
src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.1.1.1 -r0 src/libexec/httpd/bozohttpd.html8
cvs rdiff -u -r1.6 -r1.7 src/libexec/httpd/content-bozo.c
cvs rdiff -u -r1.14 -r1.15 src/libexec/httpd/daemon-bozo.c
cvs rdiff -u -r1.12 -r1.13 src/libexec/httpd/dir-index-bozo.c \
src/libexec/httpd/ssl-bozo.c
cvs rdiff -u -r1.4 -r1.5 src/libexec/httpd/main.c
cvs rdiff -u -r1.8 -r1.9 src/libexec/httpd/tilde-luzah-bozo.c
cvs rdiff -u -r1.3 -r1.4 src/libexec/httpd/testsuite/html_cmp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.10 src/libexec/httpd/CHANGES:1.11
--- src/libexec/httpd/CHANGES:1.10	Mon Sep 20 23:11:38 2010
+++ src/libexec/httpd/CHANGES	Fri Nov 18 09:51:31 2011
@@ -1,4 +1,13 @@
-$eterna: CHANGES,v 1.77 2010/09/20 22:26:28 mrg Exp $
+$eterna: CHANGES,v 1.78 2011/11/18 01:25:11 mrg Exp $
+
+changes since bozohttpd 20100920:
+	o  add -P pidfile option, from j...@netbsd.org
+	o  avoid crashes with http basic auth, from po...@netbsd.org
+	o  add support for REDIRECT_STATUS variable, from t...@netbsd.org
+	o  support .mp4 files in the default map
+	o  directory indexes with files with : are now displayed properly, from
+	   r...@netbsd.org
+	o  allow -I option to be useful in non-inetd mode as well
 
 changes since bozohttpd 20100617:
 	o  properly fully disable multi-file mode for now

Index: src/libexec/httpd/auth-bozo.c
diff -u src/libexec/httpd/auth-bozo.c:1.9 src/libexec/httpd/auth-bozo.c:1.10
--- src/libexec/httpd/auth-bozo.c:1.9	Mon May 10 14:44:19 2010
+++ src/libexec/httpd/auth-bozo.c	Fri Nov 18 09:51:31 2011
@@ -1,9 +1,9 @@
-/*	$NetBSD: auth-bozo.c,v 1.9 2010/05/10 14:44:19 mrg Exp $	*/
+/*	$NetBSD: auth-bozo.c,v 1.10 2011/11/18 09:51:31 mrg Exp $	*/
 
-/*	$eterna: auth-bozo.c,v 1.16 2010/05/10 14:36:37 mrg Exp $	*/
+/*	$eterna: auth-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $	*/
 
 /*
- * Copyright (c) 1997-2010 Matthew R. Green
+ * Copyright (c) 1997-2011 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.31 src/libexec/httpd/bozohttpd.8:1.32
--- src/libexec/httpd/bozohttpd.8:1.31	Thu Nov 17 23:19:30 2011
+++ src/libexec/httpd/bozohttpd.8	Fri Nov 18 09:51:31 2011
@@ -1,6 +1,6 @@
-.\	$NetBSD: bozohttpd.8,v 1.31 2011/11/17 23:19:30 wiz Exp $
+.\	$NetBSD: bozohttpd.8,v 1.32 2011/11/18 09:51:31 mrg Exp $
 .\
-.\	$eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $
+.\	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\
 .\ Copyright (c) 1997-2010 Matthew R. Green
 .\ All rights reserved.
@@ -34,19 +34,19 @@
 .Nd hyper text transfer protocol version 1.1 daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl befHnrsuVX
+.Op Fl CIMPSZciptvx
 .Op Fl C Ar suffix cgihandler
-.Op Fl c Ar cgibin
 .Op Fl I Ar port
-.Op Fl i Ar address
 .Op Fl M Ar suffix type encoding encoding11
 .Op Fl P Ar pidfile
-.Op Fl p Ar pubdir
 .Op Fl S Ar server_software
+.Op Fl Z Ar cert privkey
+.Op Fl c Ar cgibin
+.Op Fl i Ar address
+.Op Fl p Ar pubdir
 .Op Fl t Ar chrootdir
 .Op Fl v Ar virtualroot
 .Op Fl x Ar index
-.Op Fl Z Ar cert privkey
 .Ar slashdir
 .Op Ar myname
 .Sh DESCRIPTION

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.29 src/libexec/httpd/bozohttpd.c:1.30
--- src/libexec/httpd/bozohttpd.c:1.29	Thu Nov 17 22:09:12 2011
+++ src/libexec/httpd/bozohttpd.c	Fri Nov 18 09:51:31 2011
@@ -1,9 +1,9 @@
-/*	$NetBSD: bozohttpd.c,v 1.29 2011/11/17 22:09:12 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.30 2011/11/18 09:51:31 mrg Exp $	*/
 
-/*	$eterna: bozohttpd.c,v 1.176 2010/09/20 22:26:28 mrg Exp $	*/
+/*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
 /*
- * Copyright (c) 1997-2010 Matthew R. Green
+ * Copyright (c) 1997-2011 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -109,7 +109,7 @@
 #define INDEX_HTML		index.html
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		bozohttpd/20100920
+#define SERVER_SOFTWARE		bozohttpd/2018
 #endif
 #ifndef

CVS commit: src/doc

2011-11-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov 18 10:06:56 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
note bozohttpd 2018


To generate a diff of this commit:
cvs rdiff -u -r1.1626 -r1.1627 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1626 src/doc/CHANGES:1.1627
--- src/doc/CHANGES:1.1626	Sun Nov 13 14:39:02 2011
+++ src/doc/CHANGES	Fri Nov 18 10:06:56 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1626 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1627 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1169,3 +1169,4 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 	luna68k: Finally complete LUNA-II support. [tsutsui 2012]
 	gpiopwm(4): A new driver to pulse GPIO pins in software.
 		[mbalmer 2013]
+	httpd(8): Import bozohttpd-2018. [mrg 2018]



CVS commit: src/sys/compat/linux/common

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 15:45:47 UTC 2011

Modified Files:
src/sys/compat/linux/common: linux_signal.c

Log Message:
remove incorrect assertions (the len passed is the size of the bsd structure
not the linux one)


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/compat/linux/common/linux_signal.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/compat/linux/common/linux_signal.c
diff -u src/sys/compat/linux/common/linux_signal.c:1.73 src/sys/compat/linux/common/linux_signal.c:1.74
--- src/sys/compat/linux/common/linux_signal.c:1.73	Thu Nov 17 23:07:44 2011
+++ src/sys/compat/linux/common/linux_signal.c	Fri Nov 18 10:45:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_signal.c,v 1.73 2011/11/18 04:07:44 christos Exp $	*/
+/*	$NetBSD: linux_signal.c,v 1.74 2011/11/18 15:45:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_signal.c,v 1.73 2011/11/18 04:07:44 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_signal.c,v 1.74 2011/11/18 15:45:47 christos Exp $);
 
 #define COMPAT_LINUX 1
 
@@ -559,7 +559,6 @@ fetchss(const void *u, void *s, size_t l
 	int error;
 	linux_sigset_t lss;
 	
-	KASSERT(len == sizeof(lss));
 	if ((error = copyin(u, lss, sizeof(lss))) != 0)
 		return error;
 
@@ -573,7 +572,6 @@ fetchts(const void *u, void *s, size_t l
 	int error;
 	struct linux_timespec lts;
 	
-	KASSERT(len == sizeof(lts));
 	if ((error = copyin(u, lts, sizeof(lts))) != 0)
 		return error;
 



CVS commit: src/sys/compat/linux32/common

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 15:46:29 UTC 2011

Modified Files:
src/sys/compat/linux32/common: linux32_signal.c

Log Message:
remove incorrect assertions (the len passed is the size of the bsd structure
not the linux one)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/linux32/common/linux32_signal.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/compat/linux32/common/linux32_signal.c
diff -u src/sys/compat/linux32/common/linux32_signal.c:1.14 src/sys/compat/linux32/common/linux32_signal.c:1.15
--- src/sys/compat/linux32/common/linux32_signal.c:1.14	Thu Nov 17 23:08:56 2011
+++ src/sys/compat/linux32/common/linux32_signal.c	Fri Nov 18 10:46:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_signal.c,v 1.14 2011/11/18 04:08:56 christos Exp $ */
+/*	$NetBSD: linux32_signal.c,v 1.15 2011/11/18 15:46:29 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux32_signal.c,v 1.14 2011/11/18 04:08:56 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux32_signal.c,v 1.15 2011/11/18 15:46:29 christos Exp $);
 
 #include sys/param.h
 #include sys/ucred.h
@@ -438,7 +438,6 @@ fetchss(const void *u, void *s, size_t l
 	int error;
 	linux32_sigset_t lss;
 	
-	KASSERT(len == sizeof(lss));
 	if ((error = copyin(u, lss, sizeof(lss))) != 0)
 		return error;
 
@@ -452,7 +451,6 @@ fetchts(const void *u, void *s, size_t l
 	int error;
 	struct linux32_timespec lts;
 	
-	KASSERT(len == sizeof(lts));
 	if ((error = copyin(u, lts, sizeof(lts))) != 0)
 		return error;
 
@@ -472,7 +470,6 @@ storeinfo(const void *s, void *u, size_t
 {
 	linux32_siginfo_t lsi;
 
-	KASSERT(len == sizeof(lsi));
 
 	native_to_linux32_siginfo(lsi, ((const siginfo_t *)s)-_info);
 	return copyout(lsi, u, sizeof(lsi));



CVS commit: src

2011-11-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Nov 18 16:10:03 UTC 2011

Modified Files:
src/lib/libc/arch/arm: Makefile.inc
src/libexec/ld.elf_so/arch/arm: mdreloc.c
src/sys/arch/arm/include: types.h
Added Files:
src/lib/libc/arch/arm/sys: __aeabi_read_tp.S

Log Message:
Hook up TLS support on ARM. Tested by martin@, kernel support from matt@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/arm/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/arm/sys/__aeabi_read_tp.S
cvs rdiff -u -r1.36 -r1.37 src/libexec/ld.elf_so/arch/arm/mdreloc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/include/types.h

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/arch/arm/Makefile.inc
diff -u src/lib/libc/arch/arm/Makefile.inc:1.9 src/lib/libc/arch/arm/Makefile.inc:1.10
--- src/lib/libc/arch/arm/Makefile.inc:1.9	Tue Jul  6 05:59:52 2010
+++ src/lib/libc/arch/arm/Makefile.inc	Fri Nov 18 16:10:02 2011
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile.inc,v 1.9 2010/07/06 05:59:52 mrg Exp $
+# $NetBSD: Makefile.inc,v 1.10 2011/11/18 16:10:02 joerg Exp $
 
 .include bsd.own.mk
 
-SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+SRCS+=	__aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
 
 CPPFLAGS += -DSOFTFLOAT
 

Index: src/libexec/ld.elf_so/arch/arm/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.36 src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.37
--- src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.36	Tue Apr 12 16:40:04 2011
+++ src/libexec/ld.elf_so/arch/arm/mdreloc.c	Fri Nov 18 16:10:03 2011
@@ -1,8 +1,8 @@
-/*	$NetBSD: mdreloc.c,v 1.36 2011/04/12 16:40:04 matt Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.37 2011/11/18 16:10:03 joerg Exp $	*/
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: mdreloc.c,v 1.36 2011/04/12 16:40:04 matt Exp $);
+__RCSID($NetBSD: mdreloc.c,v 1.37 2011/11/18 16:10:03 joerg Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -179,7 +179,6 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 			rdbg((COPY (avoid in main)));
 			break;
 
-#ifdef __HAVE_TLS_VARIANT_I
 		case R_TYPE(TLS_DTPOFF32):
 			def = _rtld_find_symdef(symnum, obj, defobj, false);
 			if (def == NULL)
@@ -232,7 +231,6 @@ _rtld_relocate_nonplt_objects(Obj_Entry 
 			obj-strtab + obj-symtab[symnum].st_name,
 			obj-path, (void *)tmp));
 			break;
-#endif /* __HAVE_TLS_VARIANT_I */
 
 		default:
 			rdbg((sym = %lu, type = %lu, offset = %p, 

Index: src/sys/arch/arm/include/types.h
diff -u src/sys/arch/arm/include/types.h:1.20 src/sys/arch/arm/include/types.h:1.21
--- src/sys/arch/arm/include/types.h:1.20	Sun Jul 17 23:46:49 2011
+++ src/sys/arch/arm/include/types.h	Fri Nov 18 16:10:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.20 2011/07/17 23:46:49 dyoung Exp $	*/
+/*	$NetBSD: types.h,v 1.21 2011/11/18 16:10:02 joerg Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -86,6 +86,8 @@ typedef	volatile int		__cpu_simple_lock_
 #define	__HAVE_MINIMAL_EMUL
 #define __HAVE_CPU_DATA_FIRST
 #define	__HAVE___LWP_GETPRIVATE_FAST
+#define	__HAVE_COMMON___TLS_GET_ADDR
+#define	__HAVE_TLS_VARIANT_I
 
 #if defined(_KERNEL)
 #define	__HAVE_RAS

Added files:

Index: src/lib/libc/arch/arm/sys/__aeabi_read_tp.S
diff -u /dev/null src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.1
--- /dev/null	Fri Nov 18 16:10:03 2011
+++ src/lib/libc/arch/arm/sys/__aeabi_read_tp.S	Fri Nov 18 16:10:02 2011
@@ -0,0 +1,5 @@
+#include SYS.h
+
+ENTRY(__aeabi_read_tp)
+	mrc p15, 0, r0, c13, c0, 3
+	RET



CVS commit: src/sys/compat/linux/common

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 17:36:06 UTC 2011

Modified Files:
src/sys/compat/linux/common: linux_signal.c

Log Message:
remove one more kassert


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/common/linux_signal.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/compat/linux/common/linux_signal.c
diff -u src/sys/compat/linux/common/linux_signal.c:1.74 src/sys/compat/linux/common/linux_signal.c:1.75
--- src/sys/compat/linux/common/linux_signal.c:1.74	Fri Nov 18 10:45:47 2011
+++ src/sys/compat/linux/common/linux_signal.c	Fri Nov 18 12:36:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_signal.c,v 1.74 2011/11/18 15:45:47 christos Exp $	*/
+/*	$NetBSD: linux_signal.c,v 1.75 2011/11/18 17:36:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_signal.c,v 1.74 2011/11/18 15:45:47 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_signal.c,v 1.75 2011/11/18 17:36:06 christos Exp $);
 
 #define COMPAT_LINUX 1
 
@@ -553,6 +553,7 @@ linux_sys_rt_sigsuspend(struct lwp *l, c
 
 	return (sigsuspend1(l, bss));
 }
+
 static int
 fetchss(const void *u, void *s, size_t len)
 {
@@ -591,8 +592,6 @@ storeinfo(const void *s, void *u, size_t
 {
 	struct linux_siginfo lsi;
 
-	KASSERT(len == sizeof(lsi));
-
 	native_to_linux_siginfo(lsi, ((const siginfo_t *)s)-_info);
 	return copyout(lsi, u, sizeof(lsi));
 }



CVS commit: src/lib/libc/arch/x86_64/sys

2011-11-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Nov 18 20:17:46 UTC 2011

Modified Files:
src/lib/libc/arch/x86_64/sys: cerror.S

Log Message:
Explicitly mark __cerror as hidden


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/x86_64/sys/cerror.S

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/arch/x86_64/sys/cerror.S
diff -u src/lib/libc/arch/x86_64/sys/cerror.S:1.3 src/lib/libc/arch/x86_64/sys/cerror.S:1.4
--- src/lib/libc/arch/x86_64/sys/cerror.S:1.3	Thu Aug  7 16:42:37 2003
+++ src/lib/libc/arch/x86_64/sys/cerror.S	Fri Nov 18 20:17:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cerror.S,v 1.3 2003/08/07 16:42:37 agc Exp $	*/
+/*	$NetBSD: cerror.S,v 1.4 2011/11/18 20:17:46 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,12 +36,13 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: cerror.S,v 1.3 2003/08/07 16:42:37 agc Exp $)
+	RCSID($NetBSD: cerror.S,v 1.4 2011/11/18 20:17:46 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
 
 	.globl	_C_LABEL(__errno)
+	.hidden	CERROR
 
 _ENTRY(CERROR)
 	pushq	%r12



CVS commit: src/lib/libc/arch/i386/sys

2011-11-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Nov 18 20:21:41 UTC 2011

Modified Files:
src/lib/libc/arch/i386/sys: __clone.S __syscall.S __vfork14.S brk.S
cerror.S exect.S ptrace.S sbrk.S syscall.S

Log Message:
Mark __cerror as hidden and exploit that to simplify assembler.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/i386/sys/__clone.S \
src/lib/libc/arch/i386/sys/__syscall.S
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/sys/__vfork14.S
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/arch/i386/sys/brk.S
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/i386/sys/cerror.S
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/sys/exect.S
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/arch/i386/sys/ptrace.S
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/arch/i386/sys/sbrk.S
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/i386/sys/syscall.S

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/arch/i386/sys/__clone.S
diff -u src/lib/libc/arch/i386/sys/__clone.S:1.3 src/lib/libc/arch/i386/sys/__clone.S:1.4
--- src/lib/libc/arch/i386/sys/__clone.S:1.3	Wed Jul 18 12:24:53 2001
+++ src/lib/libc/arch/i386/sys/__clone.S	Fri Nov 18 20:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: __clone.S,v 1.3 2001/07/18 12:24:53 fvdl Exp $	*/
+/*	$NetBSD: __clone.S,v 1.4 2011/11/18 20:21:41 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -100,11 +100,4 @@ ENTRY(__clone)
 	addl	$12,%esp
 5:
 	popl	%ebp
-#ifdef PIC
-	PIC_PROLOGUE
-	movl	PIC_GOT(CERROR),%edx
-	PIC_EPILOGUE
-	jmp	*%edx
-#else
 	jmp	CERROR
-#endif
Index: src/lib/libc/arch/i386/sys/__syscall.S
diff -u src/lib/libc/arch/i386/sys/__syscall.S:1.3 src/lib/libc/arch/i386/sys/__syscall.S:1.4
--- src/lib/libc/arch/i386/sys/__syscall.S:1.3	Thu Aug  7 16:42:08 2003
+++ src/lib/libc/arch/i386/sys/__syscall.S	Fri Nov 18 20:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc Exp $	*/
+/*	$NetBSD: __syscall.S,v 1.4 2011/11/18 20:21:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc Exp $)
+	RCSID($NetBSD: __syscall.S,v 1.4 2011/11/18 20:21:41 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -52,11 +52,4 @@ ENTRY(__syscall)
 	jc	err
 	ret
 err:
-#ifdef PIC
-	PIC_PROLOGUE
-	mov	PIC_GOT(CERROR), %ecx
-	PIC_EPILOGUE
-	jmp	*%ecx
-#else
 	jmp	CERROR
-#endif

Index: src/lib/libc/arch/i386/sys/__vfork14.S
diff -u src/lib/libc/arch/i386/sys/__vfork14.S:1.8 src/lib/libc/arch/i386/sys/__vfork14.S:1.9
--- src/lib/libc/arch/i386/sys/__vfork14.S:1.8	Fri Mar  9 14:30:48 2007
+++ src/lib/libc/arch/i386/sys/__vfork14.S	Fri Nov 18 20:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad Exp $	*/
+/*	$NetBSD: __vfork14.S,v 1.9 2011/11/18 20:21:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad Exp $)
+	RCSID($NetBSD: __vfork14.S,v 1.9 2011/11/18 20:21:41 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -57,11 +57,4 @@ ENTRY(__vfork14)
 	jmp	*%ecx
 err:
 	pushl	%ecx
-#ifdef PIC
-	PIC_PROLOGUE
-	mov	PIC_GOT(CERROR), %ecx
-	PIC_EPILOGUE
-	jmp	*%ecx
-#else
 	jmp	CERROR
-#endif

Index: src/lib/libc/arch/i386/sys/brk.S
diff -u src/lib/libc/arch/i386/sys/brk.S:1.21 src/lib/libc/arch/i386/sys/brk.S:1.22
--- src/lib/libc/arch/i386/sys/brk.S:1.21	Fri Mar  9 14:30:56 2007
+++ src/lib/libc/arch/i386/sys/brk.S	Fri Nov 18 20:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad Exp $	*/
+/*	$NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad Exp $)
+	RCSID($NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -74,10 +74,7 @@ ENTRY(_brk)
 	xorl	%eax,%eax
 	ret
 err:
-	PIC_PROLOGUE
-	mov	PIC_GOT(CERROR),%edx
-	PIC_EPILOGUE
-	jmp	*%edx
+	jmp	CERROR
 #else
 	movl	4(%esp),%ecx
 	cmpl	%ecx,_C_LABEL(__minbrk)

Index: src/lib/libc/arch/i386/sys/cerror.S
diff -u src/lib/libc/arch/i386/sys/cerror.S:1.14 src/lib/libc/arch/i386/sys/cerror.S:1.15
--- src/lib/libc/arch/i386/sys/cerror.S:1.14	Thu Aug  7 16:42:08 2003
+++ src/lib/libc/arch/i386/sys/cerror.S	Fri Nov 18 20:21:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cerror.S,v 1.14 2003/08/07 16:42:08 agc Exp $	*/
+/*	$NetBSD: cerror.S,v 1.15 2011/11/18 20:21:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,12 

CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:22:03 UTC 2011

Modified Files:
src/lib/libedit: el.c

Log Message:
remove unrecheable code (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/lib/libedit/el.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/libedit/el.c
diff -u src/lib/libedit/el.c:1.68 src/lib/libedit/el.c:1.69
--- src/lib/libedit/el.c:1.68	Fri Jul 29 11:16:33 2011
+++ src/lib/libedit/el.c	Fri Nov 18 15:22:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.68 2011/07/29 15:16:33 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.69 2011/11/18 20:22:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)el.c	8.2 (Berkeley) 1/3/94;
 #else
-__RCSID($NetBSD: el.c,v 1.68 2011/07/29 15:16:33 christos Exp $);
+__RCSID($NetBSD: el.c,v 1.69 2011/11/18 20:22:03 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -423,17 +423,8 @@ FUN(el,get)(EditLine *el, int op, ...)
 			if ((argv[i] = va_arg(ap, char *)) == NULL)
 break;
 
-		switch (op) {
-		case EL_GETTC:
-			argv[0] = name;
-			rv = terminal_gettc(el, i, argv);
-			break;
-
-		default:
-			rv = -1;
-			EL_ABORT((el-el_errfile, Bad op %d\n, op));
-			break;
-		}
+		argv[0] = name;
+		rv = terminal_gettc(el, i, argv);
 		break;
 	}
 



CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:24:21 UTC 2011

Modified Files:
src/lib/libedit: vi.c

Log Message:
Off by one in allocation could cause buffer overflow (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libedit/vi.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/libedit/vi.c
diff -u src/lib/libedit/vi.c:1.41 src/lib/libedit/vi.c:1.42
--- src/lib/libedit/vi.c:1.41	Tue Oct  4 11:27:04 2011
+++ src/lib/libedit/vi.c	Fri Nov 18 15:24:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $	*/
+/*	$NetBSD: vi.c,v 1.42 2011/11/18 20:24:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)vi.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $);
+__RCSID($NetBSD: vi.c,v 1.42 2011/11/18 20:24:21 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -1026,7 +1026,7 @@ vi_histedit(EditLine *el, Int c __attrib
 		close(fd);
 		return CC_ERROR;
 	}
-	line = el_malloc(len * sizeof(*line));
+	line = el_malloc(len * sizeof(*line) + 1);
 	if (line == NULL) {
 		el_free(cp);
 		return CC_ERROR;



CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:25:48 UTC 2011

Modified Files:
src/lib/libedit: terminal.c

Log Message:
check for negative return of ct_visual_char (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libedit/terminal.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/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.10 src/lib/libedit/terminal.c:1.11
--- src/lib/libedit/terminal.c:1.10	Tue Oct  4 11:27:04 2011
+++ src/lib/libedit/terminal.c	Fri Nov 18 15:25:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)term.c	8.2 (Berkeley) 4/30/95;
 #else
-__RCSID($NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $);
+__RCSID($NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -1262,6 +1262,8 @@ terminal_writec(EditLine *el, Int c)
 {
 	Char visbuf[VISUAL_WIDTH_MAX +1];
 	ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
+	if (vcnt  0)
+		vcnt = 0;
 	visbuf[vcnt] = '\0';
 	terminal_overwrite(el, visbuf, (size_t)vcnt);
 	terminal__flush(el);



CVS commit: src/lib/libc/gen

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:28:17 UTC 2011

Modified Files:
src/lib/libc/gen: unvis.c

Log Message:
initialize t to protect against empty string (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/gen/unvis.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/gen/unvis.c
diff -u src/lib/libc/gen/unvis.c:1.37 src/lib/libc/gen/unvis.c:1.38
--- src/lib/libc/gen/unvis.c:1.37	Sat Nov  5 23:42:33 2011
+++ src/lib/libc/gen/unvis.c	Fri Nov 18 15:28:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: unvis.c,v 1.37 2011/11/06 03:42:33 christos Exp $	*/
+/*	$NetBSD: unvis.c,v 1.38 2011/11/18 20:28:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)unvis.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: unvis.c,v 1.37 2011/11/06 03:42:33 christos Exp $);
+__RCSID($NetBSD: unvis.c,v 1.38 2011/11/18 20:28:17 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -488,7 +488,7 @@ int
 strnunvisx(char *dst, size_t dlen, const char *src, int flag)
 {
 	char c;
-	char t, *start = dst;
+	char t = '\0', *start = dst;
 	int state = 0;
 
 	_DIAGASSERT(src != NULL);



CVS commit: src/lib/libedit/TEST

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:30:01 UTC 2011

Modified Files:
src/lib/libedit/TEST: wtc1.c

Log Message:
Initialize res (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libedit/TEST/wtc1.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/libedit/TEST/wtc1.c
diff -u src/lib/libedit/TEST/wtc1.c:1.5 src/lib/libedit/TEST/wtc1.c:1.6
--- src/lib/libedit/TEST/wtc1.c:1.5	Thu Aug  4 10:33:05 2011
+++ src/lib/libedit/TEST/wtc1.c	Fri Nov 18 15:30:01 2011
@@ -62,7 +62,7 @@ complete(EditLine *el, int ch)
 	char *buf, *bptr;
 	const LineInfoW *lf = el_wline(el);
 	int len, mblen, i;
-	unsigned char res;
+	unsigned char res = 0;
 	wchar_t dir[1024];
 
 	/* Find the last word */



CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:32:00 UTC 2011

Modified Files:
src/lib/libedit: terminal.c

Log Message:
Initialize termbuf (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libedit/terminal.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/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.11 src/lib/libedit/terminal.c:1.12
--- src/lib/libedit/terminal.c:1.11	Fri Nov 18 15:25:48 2011
+++ src/lib/libedit/terminal.c	Fri Nov 18 15:32:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.12 2011/11/18 20:32:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)term.c	8.2 (Berkeley) 4/30/95;
 #else
-__RCSID($NetBSD: terminal.c,v 1.11 2011/11/18 20:25:48 christos Exp $);
+__RCSID($NetBSD: terminal.c,v 1.12 2011/11/18 20:32:00 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -330,6 +330,7 @@ terminal_alloc(EditLine *el, const struc
 	char **tlist = el-el_terminal.t_str;
 	char **tmp, **str = tlist[t - tstr];
 
+	(void) memset(termbuf, 0, sizeof(termbuf));
 	if (cap == NULL || *cap == '\0') {
 		*str = NULL;
 		return;
@@ -877,7 +878,7 @@ terminal_set(EditLine *el, const char *t
 	if (strcmp(term, emacs) == 0)
 		el-el_flags |= EDIT_DISABLED;
 
-	memset(el-el_terminal.t_cap, 0, TC_BUFSIZE);
+	(void) memset(el-el_terminal.t_cap, 0, TC_BUFSIZE);
 
 	i = tgetent(el-el_terminal.t_cap, term);
 



CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:38:42 UTC 2011

Modified Files:
src/lib/libedit: readline.c

Log Message:
Add missing *


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/lib/libedit/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.99 src/lib/libedit/readline.c:1.100
--- src/lib/libedit/readline.c:1.99	Tue Aug 16 12:25:15 2011
+++ src/lib/libedit/readline.c	Fri Nov 18 15:38:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.99 2011/08/16 16:25:15 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.100 2011/11/18 20:38:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include config.h
 #if !defined(lint)  !defined(SCCSID)
-__RCSID($NetBSD: readline.c,v 1.99 2011/08/16 16:25:15 christos Exp $);
+__RCSID($NetBSD: readline.c,v 1.100 2011/11/18 20:38:42 christos Exp $);
 #endif /* not lint  not SCCSID */
 
 #include sys/types.h
@@ -887,7 +887,7 @@ history_expand(char *str, char **output)
 	*output = NULL;
 	if (str[0] == history_subst_char) {
 		/* ^foo^foo2^ is equivalent to !!:s^foo^foo2^ */
-		*output = el_malloc((strlen(str) + 4 + 1) * sizeof(*output));
+		*output = el_malloc((strlen(str) + 4 + 1) * sizeof(**output));
 		if (*output == NULL)
 			return 0;
 		(*output)[0] = (*output)[1] = history_expansion_char;



CVS commit: src/lib/libedit

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 20:39:18 UTC 2011

Modified Files:
src/lib/libedit: history.c map.c

Log Message:
Add coverity annotations about unreachable code (Kamil Dudka)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/history.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libedit/map.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/libedit/history.c
diff -u src/lib/libedit/history.c:1.45 src/lib/libedit/history.c:1.46
--- src/lib/libedit/history.c:1.45	Fri Jul 29 19:44:44 2011
+++ src/lib/libedit/history.c	Fri Nov 18 15:39:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: history.c,v 1.45 2011/07/29 23:44:44 christos Exp $	*/
+/*	$NetBSD: history.c,v 1.46 2011/11/18 20:39:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)history.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: history.c,v 1.45 2011/07/29 23:44:44 christos Exp $);
+__RCSID($NetBSD: history.c,v 1.46 2011/11/18 20:39:18 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -689,7 +689,8 @@ history_set_fun(TYPE(History) *h, TYPE(H
 	nh-h_enter == NULL || nh-h_add == NULL || nh-h_clear == NULL ||
 	nh-h_del == NULL || nh-h_ref == NULL) {
 		if (h-h_next != history_def_next) {
-			history_def_init(h-h_ref, ev, 0);
+			if (history_def_init(h-h_ref, ev, 0) == -1)
+return -1;
 			h-h_first = history_def_first;
 			h-h_next = history_def_next;
 			h-h_last = history_def_last;

Index: src/lib/libedit/map.c
diff -u src/lib/libedit/map.c:1.30 src/lib/libedit/map.c:1.31
--- src/lib/libedit/map.c:1.30	Tue Aug 16 12:25:15 2011
+++ src/lib/libedit/map.c	Fri Nov 18 15:39:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: map.c,v 1.30 2011/08/16 16:25:15 christos Exp $	*/
+/*	$NetBSD: map.c,v 1.31 2011/11/18 20:39:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)map.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: map.c,v 1.30 2011/08/16 16:25:15 christos Exp $);
+__RCSID($NetBSD: map.c,v 1.31 2011/11/18 20:39:18 christos Exp $);
 #endif
 #endif /* not lint  not SCCSID */
 
@@ -1380,6 +1380,7 @@ map_bind(EditLine *el, int argc, const C
 		}
 		break;
 
+	/* coverity[dead_error_begin] */
 	default:
 		EL_ABORT((el-el_errfile, Bad XK_ type %d\n, ntype));
 		break;



CVS commit: src/lib/libc/arch/x86_64

2011-11-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Nov 18 20:43:01 UTC 2011

Modified Files:
src/lib/libc/arch/x86_64: SYS.h
src/lib/libc/arch/x86_64/sys: __clone.S __vfork14.S brk.S exect.S
ptrace.S sbrk.S

Log Message:
Exploit hidden __cerror


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/x86_64/SYS.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/x86_64/sys/__clone.S \
src/lib/libc/arch/x86_64/sys/exect.S \
src/lib/libc/arch/x86_64/sys/ptrace.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/x86_64/sys/__vfork14.S \
src/lib/libc/arch/x86_64/sys/brk.S src/lib/libc/arch/x86_64/sys/sbrk.S

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/arch/x86_64/SYS.h
diff -u src/lib/libc/arch/x86_64/SYS.h:1.10 src/lib/libc/arch/x86_64/SYS.h:1.11
--- src/lib/libc/arch/x86_64/SYS.h:1.10	Fri Nov 23 07:36:05 2007
+++ src/lib/libc/arch/x86_64/SYS.h	Fri Nov 18 20:43:01 2011
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)SYS.h	5.5 (Berkeley) 5/7/91
- *	$NetBSD: SYS.h,v 1.10 2007/11/23 07:36:05 dsl Exp $
+ *	$NetBSD: SYS.h,v 1.11 2011/11/18 20:43:01 joerg Exp $
  */
 
 #include machine/asm.h
@@ -49,14 +49,8 @@
 	ENTRY(x);			\
 	SYSTRAP(y)
 
-#ifdef PIC
 #define _SYSCALL_ERR	 		\
-	mov PIC_GOT(CERROR), %rcx;	\
-	jmp *%rcx
-#else
-#define _SYSCALL_ERR			\
 	jmp CERROR
-#endif
 
 #define _SYSCALL(x,y)			\
 	.text; _ALIGN_TEXT;		\

Index: src/lib/libc/arch/x86_64/sys/__clone.S
diff -u src/lib/libc/arch/x86_64/sys/__clone.S:1.2 src/lib/libc/arch/x86_64/sys/__clone.S:1.3
--- src/lib/libc/arch/x86_64/sys/__clone.S:1.2	Thu Jun  6 20:51:17 2002
+++ src/lib/libc/arch/x86_64/sys/__clone.S	Fri Nov 18 20:43:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: __clone.S,v 1.2 2002/06/06 20:51:17 fvdl Exp $	*/
+/*	$NetBSD: __clone.S,v 1.3 2011/11/18 20:43:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -93,9 +93,4 @@ ENTRY(__clone)
 5:
 	popq	%r13
 	popq	%r12
-#ifdef PIC
-	movq	PIC_GOT(CERROR),%rdx
-	jmp	*%rdx
-#else
 	jmp	CERROR
-#endif
Index: src/lib/libc/arch/x86_64/sys/exect.S
diff -u src/lib/libc/arch/x86_64/sys/exect.S:1.2 src/lib/libc/arch/x86_64/sys/exect.S:1.3
--- src/lib/libc/arch/x86_64/sys/exect.S:1.2	Thu Aug  7 16:42:37 2003
+++ src/lib/libc/arch/x86_64/sys/exect.S	Fri Nov 18 20:43:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exect.S,v 1.2 2003/08/07 16:42:37 agc Exp $	*/
+/*	$NetBSD: exect.S,v 1.3 2011/11/18 20:43:01 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: exect.S,v 1.2 2003/08/07 16:42:37 agc Exp $)
+	RCSID($NetBSD: exect.S,v 1.3 2011/11/18 20:43:01 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -47,9 +47,4 @@ ENTRY(exect)
 	orb	$(PSL_T8),1(%rsp)
 	popfq
 	SYSTRAP(execve)
-#ifdef PIC
-	movq	PIC_GOT(CERROR), %rcx
-	jmp	*%rcx
-#else
 	jmp	CERROR
-#endif
Index: src/lib/libc/arch/x86_64/sys/ptrace.S
diff -u src/lib/libc/arch/x86_64/sys/ptrace.S:1.2 src/lib/libc/arch/x86_64/sys/ptrace.S:1.3
--- src/lib/libc/arch/x86_64/sys/ptrace.S:1.2	Thu Aug  7 16:42:37 2003
+++ src/lib/libc/arch/x86_64/sys/ptrace.S	Fri Nov 18 20:43:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.S,v 1.2 2003/08/07 16:42:37 agc Exp $	*/
+/*	$NetBSD: ptrace.S,v 1.3 2011/11/18 20:43:01 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: ptrace.S,v 1.2 2003/08/07 16:42:37 agc Exp $)
+	RCSID($NetBSD: ptrace.S,v 1.3 2011/11/18 20:43:01 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -54,9 +54,4 @@ ENTRY(ptrace)
 	jc	err
 	ret
 err:
-#ifdef PIC
-	movq	PIC_GOT(CERROR), %rcx
-	jmp	*%rcx
-#else
 	jmp	CERROR
-#endif

Index: src/lib/libc/arch/x86_64/sys/__vfork14.S
diff -u src/lib/libc/arch/x86_64/sys/__vfork14.S:1.3 src/lib/libc/arch/x86_64/sys/__vfork14.S:1.4
--- src/lib/libc/arch/x86_64/sys/__vfork14.S:1.3	Thu Aug  7 16:42:37 2003
+++ src/lib/libc/arch/x86_64/sys/__vfork14.S	Fri Nov 18 20:43:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: __vfork14.S,v 1.3 2003/08/07 16:42:37 agc Exp $	*/
+/*	$NetBSD: __vfork14.S,v 1.4 2011/11/18 20:43:01 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include machine/asm.h
 #if defined(SYSLIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: __vfork14.S,v 1.3 2003/08/07 16:42:37 agc Exp $)
+	RCSID($NetBSD: __vfork14.S,v 1.4 2011/11/18 20:43:01 joerg Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include SYS.h
@@ -57,9 +57,4 @@ ENTRY(__vfork14)
 	jmp	*%r9
 err:
 	pushq	%r9
-#ifdef PIC
-	movq	PIC_GOT(CERROR), %rcx
-	jmp	*%rcx
-#else
 	jmp	CERROR
-#endif
Index: src/lib/libc/arch/x86_64/sys/brk.S
diff -u src/lib/libc/arch/x86_64/sys/brk.S:1.3 

CVS commit: src/lib/libc/sys

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 21:04:22 UTC 2011

Modified Files:
src/lib/libc/sys: mount.2

Log Message:
document MNT_RELATIME


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/sys/mount.2

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/sys/mount.2
diff -u src/lib/libc/sys/mount.2:1.48 src/lib/libc/sys/mount.2:1.49
--- src/lib/libc/sys/mount.2:1.48	Fri Jun 17 14:12:32 2011
+++ src/lib/libc/sys/mount.2	Fri Nov 18 16:04:21 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: mount.2,v 1.48 2011/06/17 18:12:32 wiz Exp $
+.\	$NetBSD: mount.2,v 1.49 2011/11/18 21:04:21 christos Exp $
 .\
 .\ Copyright (c) 1980, 1989, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)mount.2	8.3 (Berkeley) 5/24/95
 .\
-.Dd June 17, 2011
+.Dd November 18, 2011
 .Dt MOUNT 2
 .Os
 .Sh NAME
@@ -98,6 +98,10 @@ Do not interpret special files on the fi
 Do not allow programs to dump core files on the file system.
 .It Dv MNT_NOATIME
 Never update access time in the file system.
+.It Dv MNT_RELATIME
+Update access time on write and change.
+This helps programs that verify that the file has been read after written
+to work.
 .It Dv MNT_NODEVMTIME
 Never update modification time of device files.
 .It Dv MNT_SYMPERM



CVS commit: [netbsd-5] src/sys/arch/i386/i386

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 21:09:24 UTC 2011

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: vector.S

Log Message:
Pull up the following revisions(s) (requested by dholland in ticket #1687):
sys/arch/i386/i386/vector.S:revision 1.54

Keep interrupts disabled in NMI handler. Addresses PR/43007.


To generate a diff of this commit:
cvs rdiff -u -r1.42.6.3 -r1.42.6.4 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/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.42.6.3 src/sys/arch/i386/i386/vector.S:1.42.6.4
--- src/sys/arch/i386/i386/vector.S:1.42.6.3	Thu May 20 05:51:59 2010
+++ src/sys/arch/i386/i386/vector.S	Fri Nov 18 21:09:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.42.6.3 2010/05/20 05:51:59 snj Exp $	*/
+/*	$NetBSD: vector.S,v 1.42.6.4 2011/11/18 21:09:24 sborrill Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include machine/asm.h
-__KERNEL_RCSID(0, $NetBSD: vector.S,v 1.42.6.3 2010/05/20 05:51:59 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: vector.S,v 1.42.6.4 2011/11/18 21:09:24 sborrill Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -841,7 +841,10 @@ IDTVEC(trap00)
 IDTVEC(trap01)
 	BPTTRAP(T_TRCTRAP)
 IDTVEC(trap02)
-	ZTRAP(T_NMI)
+	pushl $0
+	pushl $(T_NMI)
+	INTRENTRY
+	jmp _C_LABEL(calltrap)
 IDTVEC(trap03)
 	BPTTRAP(T_BPTFLT)
 IDTVEC(trap04)



CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 21:11:26 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1687


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.108 -r1.1.2.109 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.108 src/doc/CHANGES-5.2:1.1.2.109
--- src/doc/CHANGES-5.2:1.1.2.108	Thu Nov  3 17:54:02 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 21:11:25 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.108 2011/11/03 17:54:02 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.109 2011/11/18 21:11:25 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5746,3 +5746,8 @@ external/ibm-public/postfix/dist/src/smt
 	Update Postfix to version 2.7.7.
 	[tron, ticket #1686]
 
+sys/arch/i386/i386/vector.S			1.54
+
+	Keep interrupts disabled in NMI handler. Addresses PR/43007.
+	[dholland, ticket #1687]
+



CVS commit: src/sys

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 21:17:46 UTC 2011

Modified Files:
src/sys/kern: vfs_mount.c vfs_syscalls.c
src/sys/sys: fstypes.h statvfs.h

Log Message:
- collect the long (and sometimes incomplete) lists of basic flags into
  the header file and use that.
- sort the list of basic flags
- add MNT_RELATIME, ST_RELATIME
- mask all the op flags, for symmetry.

The real bit difference is (which is harmless):
- mount was missing MNT_EXTATTR
- update sets MNT_RDONLY twice
- ops also could or in MNT_GETARGS, but this is impossible because the
  code would have chosen to do getargs then.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.440 -r1.441 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/fstypes.h
cvs rdiff -u -r1.16 -r1.17 src/sys/sys/statvfs.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/kern/vfs_mount.c
diff -u src/sys/kern/vfs_mount.c:1.11 src/sys/kern/vfs_mount.c:1.12
--- src/sys/kern/vfs_mount.c:1.11	Fri Oct 14 05:23:31 2011
+++ src/sys/kern/vfs_mount.c	Fri Nov 18 16:17:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.11 2011/10/14 09:23:31 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.11 2011/10/14 09:23:31 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -696,11 +696,7 @@ mount_domount(struct lwp *l, vnode_t **v
 	 *
 	 * Set the mount level flags.
 	 */
-	mp-mnt_flag = flags 
-	   (MNT_FORCE | MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG | MNT_IGNORE | MNT_RDONLY);
+	mp-mnt_flag = flags  (MNT_BASIC_FLAGS | MNT_FORCE | MNT_IGNORE);
 
 	mutex_enter(mp-mnt_updating);
 	error = VFS_MOUNT(mp, path, data, data_len);

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.440 src/sys/kern/vfs_syscalls.c:1.441
--- src/sys/kern/vfs_syscalls.c:1.440	Fri Oct 14 05:23:31 2011
+++ src/sys/kern/vfs_syscalls.c	Fri Nov 18 16:17:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.440 2011/10/14 09:23:31 hannken Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.441 2011/11/18 21:17:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.440 2011/10/14 09:23:31 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.441 2011/11/18 21:17:45 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_fileassoc.h
@@ -221,7 +221,7 @@ mount_update(struct lwp *l, struct vnode
 	mutex_enter(mp-mnt_updating);
 
 	mp-mnt_flag = ~MNT_OP_FLAGS;
-	mp-mnt_flag |= flags  (MNT_RELOAD | MNT_FORCE | MNT_UPDATE);
+	mp-mnt_flag |= flags  MNT_OP_FLAGS;
 
 	/*
 	 * Set the mount level flags.
@@ -230,17 +230,8 @@ mount_update(struct lwp *l, struct vnode
 		mp-mnt_flag |= MNT_RDONLY;
 	else if (mp-mnt_flag  MNT_RDONLY)
 		mp-mnt_iflag |= IMNT_WANTRDWR;
-	mp-mnt_flag =
-	  ~(MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG | MNT_EXTATTR);
-	mp-mnt_flag |= flags 
-	   (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG | MNT_EXTATTR | MNT_IGNORE);
-
+	mp-mnt_flag = ~MNT_BASIC_FLAGS;
+	mp-mnt_flag |= flags  MNT_BASIC_FLAGS;
 	error = VFS_MOUNT(mp, path, data, data_len);
 
 	if (error  data != NULL) {

Index: src/sys/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.29 src/sys/sys/fstypes.h:1.30
--- src/sys/sys/fstypes.h:1.29	Fri Jun 17 10:23:51 2011
+++ src/sys/sys/fstypes.h	Fri Nov 18 16:17:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.h,v 1.29 2011/06/17 14:23:51 manu Exp $	*/
+/*	$NetBSD: fstypes.h,v 1.30 2011/11/18 21:17:45 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -83,9 +83,8 @@ typedef struct fhandle	fhandle_t;
  * one of the __MNT_UNUSED flags.
  */
 
-#define	__MNT_UNUSED1	0x0002
-#define	__MNT_UNUSED2	0x0020
-#define	__MNT_UNUSED3	0x0080
+#define	__MNT_UNUSED1	0x0020
+#define	__MNT_UNUSED2	0x0080
 
 #define	MNT_RDONLY	0x0001	/* read only filesystem */
 #define	MNT_SYNCHRONOUS	0x0002	/* file system written synchronously */
@@ -95,6 +94,7 @@ typedef struct fhandle	fhandle_t;
 #define	MNT_UNION	0x0020	/* union with underlying filesystem */
 #define	MNT_ASYNC	0x0040	/* file system written asynchronously */
 #define	

CVS commit: src/sys

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 18 21:18:52 UTC 2011

Modified Files:
src/sys/fs/nilfs: nilfs_vnops.c
src/sys/fs/ptyfs: ptyfs_vnops.c
src/sys/fs/puffs: puffs_vnops.c
src/sys/fs/tmpfs: tmpfs_vnops.c
src/sys/fs/udf: udf_vnops.c
src/sys/ufs/ext2fs: ext2fs_readwrite.c ext2fs_vnops.c
src/sys/ufs/ufs: ufs_readwrite.c ufs_vnops.c

Log Message:
Obey MNT_RELATIME, the only addition is that mkdir in ufs sets IN_ACCESS too.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/fs/nilfs/nilfs_vnops.c
cvs rdiff -u -r1.36 -r1.37 src/sys/fs/ptyfs/ptyfs_vnops.c
cvs rdiff -u -r1.161 -r1.162 src/sys/fs/puffs/puffs_vnops.c
cvs rdiff -u -r1.92 -r1.93 src/sys/fs/tmpfs/tmpfs_vnops.c
cvs rdiff -u -r1.68 -r1.69 src/sys/fs/udf/udf_vnops.c
cvs rdiff -u -r1.57 -r1.58 src/sys/ufs/ext2fs/ext2fs_readwrite.c
cvs rdiff -u -r1.100 -r1.101 src/sys/ufs/ext2fs/ext2fs_vnops.c
cvs rdiff -u -r1.99 -r1.100 src/sys/ufs/ufs/ufs_readwrite.c
cvs rdiff -u -r1.205 -r1.206 src/sys/ufs/ufs/ufs_vnops.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/fs/nilfs/nilfs_vnops.c
diff -u src/sys/fs/nilfs/nilfs_vnops.c:1.15 src/sys/fs/nilfs/nilfs_vnops.c:1.16
--- src/sys/fs/nilfs/nilfs_vnops.c:1.15	Sun Oct 16 08:41:45 2011
+++ src/sys/fs/nilfs/nilfs_vnops.c	Fri Nov 18 16:18:50 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.15 2011/10/16 12:41:45 hannken Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.16 2011/11/18 21:18:50 christos Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__KERNEL_RCSID(0, $NetBSD: nilfs_vnops.c,v 1.15 2011/10/16 12:41:45 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: nilfs_vnops.c,v 1.16 2011/11/18 21:18:50 christos Exp $);
 #endif /* not lint */
 
 
@@ -280,6 +280,8 @@ return EIO;
 
 	/* mark node changed and request update */
 	nilfs_node-i_flags |= IN_CHANGE | IN_UPDATE;
+	if (vp-v_mount-mnt_flag  MNT_RELATIME)
+		nilfs_node-i_flags |= IN_ACCESS;
 
 	/*
 	 * XXX TODO FFS has code here to reset setuid  setgid when we're not

Index: src/sys/fs/ptyfs/ptyfs_vnops.c
diff -u src/sys/fs/ptyfs/ptyfs_vnops.c:1.36 src/sys/fs/ptyfs/ptyfs_vnops.c:1.37
--- src/sys/fs/ptyfs/ptyfs_vnops.c:1.36	Fri Sep 16 14:43:44 2011
+++ src/sys/fs/ptyfs/ptyfs_vnops.c	Fri Nov 18 16:18:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptyfs_vnops.c,v 1.36 2011/09/16 18:43:44 christos Exp $	*/
+/*	$NetBSD: ptyfs_vnops.c,v 1.37 2011/11/18 21:18:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1993, 1995
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ptyfs_vnops.c,v 1.36 2011/09/16 18:43:44 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ptyfs_vnops.c,v 1.37 2011/11/18 21:18:50 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -426,8 +426,11 @@ ptyfs_setattr(void *v)
 		if (vap-va_atime.tv_sec != VNOVAL)
 			if (!(vp-v_mount-mnt_flag  MNT_NOATIME))
 ptyfs-ptyfs_flag |= PTYFS_ACCESS;
-		if (vap-va_mtime.tv_sec != VNOVAL)
+		if (vap-va_mtime.tv_sec != VNOVAL) {
 			ptyfs-ptyfs_flag |= PTYFS_CHANGE | PTYFS_MODIFY;
+			if (vp-v_mount-mnt_flag  MNT_RELATIME)
+ptyfs-ptyfs_flag |= PTYFS_ACCESS;
+		}
 		if (vap-va_birthtime.tv_sec != VNOVAL)
 			ptyfs-ptyfs_birthtime = vap-va_birthtime;
 		ptyfs-ptyfs_flag |= PTYFS_CHANGE;

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.161 src/sys/fs/puffs/puffs_vnops.c:1.162
--- src/sys/fs/puffs/puffs_vnops.c:1.161	Sun Oct 30 09:24:13 2011
+++ src/sys/fs/puffs/puffs_vnops.c	Fri Nov 18 16:18:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.161 2011/10/30 13:24:13 hannken Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.162 2011/11/18 21:18:50 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.161 2011/10/30 13:24:13 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.162 2011/11/18 21:18:50 christos Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -1967,6 +1967,8 @@ puffs_vnop_write(void *v)
 
 		origoff = uio-uio_offset;
 		while (uio-uio_resid  0) {
+			if (vp-v_mount-mnt_flag  MNT_RELATIME)
+uflags |= PUFFS_UPDATEATIME;
 			uflags |= PUFFS_UPDATECTIME;
 			uflags |= PUFFS_UPDATEMTIME;
 			oldoff = uio-uio_offset;

Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.92 src/sys/fs/tmpfs/tmpfs_vnops.c:1.93
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.92	Mon Sep 26 21:32:21 2011
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Fri Nov 18 16:18:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.92 2011/09/27 01:32:21 christos Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.93 2011/11/18 21:18:51 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: 

CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 21:23:21 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1688


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.109 -r1.1.2.110 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.109 src/doc/CHANGES-5.2:1.1.2.110
--- src/doc/CHANGES-5.2:1.1.2.109	Fri Nov 18 21:11:25 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 21:23:20 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.109 2011/11/18 21:11:25 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.110 2011/11/18 21:23:20 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5751,3 +5751,9 @@ sys/arch/i386/i386/vector.S			1.54
 	Keep interrupts disabled in NMI handler. Addresses PR/43007.
 	[dholland, ticket #1687]
 
+sys/kern/kern_module.c1.84
+	Return ENOEXEC instead of 0 if the info of a kernel module
+	doesn't have the expected size. This prevents kernel panics
+	when loading broken modules.
+	[tron, ticket #1688]
+



CVS commit: src/distrib/sparc/miniroot

2011-11-18 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Nov 18 21:32:46 UTC 2011

Modified Files:
src/distrib/sparc/miniroot: list

Log Message:
Switch from COPYDIR to COPY/LINK when populating usr/mdec directory, to
avoid file duplication.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/distrib/sparc/miniroot/list

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sparc/miniroot/list
diff -u src/distrib/sparc/miniroot/list:1.36 src/distrib/sparc/miniroot/list:1.37
--- src/distrib/sparc/miniroot/list:1.36	Sun Jul  3 23:11:33 2011
+++ src/distrib/sparc/miniroot/list	Fri Nov 18 21:32:46 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.36 2011/07/03 23:11:33 tron Exp $
+#	$NetBSD: list,v 1.37 2011/11/18 21:32:46 njoly Exp $
 
 # Sparc extra's
 PROG	bin/rcmd
@@ -24,9 +24,15 @@ SPECIAL	less	srcdir external/bsd/less/bi
 SYMLINK	/tmp	var/tmp
 
 # we need the contents of /usr/mdec
-COPYDIR	${DESTDIR}/usr/mdec	usr/mdec
-# ensure binstall is executable
-MTREE	./usr/mdec/binstall	mode=0555
+COPY	${DESTDIR}/usr/mdec/binstall	usr/mdec/binstall	555
+COPY	${DESTDIR}/usr/mdec/boot	usr/mdec/boot
+LINK	usr/mdec/boot			usr/mdec/boot.388000
+COPY	${DESTDIR}/usr/mdec/boot.net	usr/mdec/boot.net
+COPY	${DESTDIR}/usr/mdec/bootblk	usr/mdec/bootblk
+COPY	${DESTDIR}/usr/mdec/bootjs.net	usr/mdec/bootjs.net
+COPY	${DESTDIR}/usr/mdec/bootxx	usr/mdec/bootxx
+COPY	${DESTDIR}/usr/mdec/ofwboot	usr/mdec/ofwboot
+LINK	usr/mdec/ofwboot		usr/mdec/ofwboot.net
 
 # copy the kernel
 COPY	${KERNOBJDIR}/GENERIC/netbsd	netbsd



CVS commit: [netbsd-5] src/gnu/dist/gcc4/gcc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 21:35:21 UTC 2011

Modified Files:
src/gnu/dist/gcc4/gcc [netbsd-5]: version.c
src/gnu/dist/gcc4/gcc/config/arm [netbsd-5]: arm.md

Log Message:
Pull up the following revisions(s) (requested by is in ticket #1689):
gnu/dist/gcc4/gcc/version.c:revision 1.19
gnu/dist/gcc4/gcc/config/arm/arm.md:revision 1.1.1.2-1.2

Remove pattern for arith_adjacentmem in arm.md, thus fixing
PR toolchain/45576 at a very small run-time cost.


To generate a diff of this commit:
cvs rdiff -u -r1.16.10.1 -r1.16.10.2 src/gnu/dist/gcc4/gcc/version.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.24.1 src/gnu/dist/gcc4/gcc/config/arm/arm.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/gcc4/gcc/version.c
diff -u src/gnu/dist/gcc4/gcc/version.c:1.16.10.1 src/gnu/dist/gcc4/gcc/version.c:1.16.10.2
--- src/gnu/dist/gcc4/gcc/version.c:1.16.10.1	Sat Nov 22 05:17:03 2008
+++ src/gnu/dist/gcc4/gcc/version.c	Fri Nov 18 21:35:21 2011
@@ -8,7 +8,7 @@
in parentheses.  You may also wish to include a number indicating
the revision of your modified compiler.  */
 
-#define VERSUFFIX  (NetBSD nb2 20081120)
+#define VERSUFFIX  (NetBSD nb3 2007)
 
 /* This is the location of the online document giving instructions for
reporting bugs.  If you distribute a modified version of GCC,

Index: src/gnu/dist/gcc4/gcc/config/arm/arm.md
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm.md:1.1.1.2 src/gnu/dist/gcc4/gcc/config/arm/arm.md:1.1.1.2.24.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm.md:1.1.1.2	Sat Oct 21 23:02:40 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/arm.md	Fri Nov 18 21:35:21 2011
@@ -9338,109 +9338,13 @@
(set_attr length 4,8,8)]
 )
 
-(define_insn *arith_adjacentmem
-  [(set (match_operand:SI 0 s_register_operand =r)
-	(match_operator:SI 1 shiftable_operator
-	 [(match_operand:SI 2 memory_operand m)
-	  (match_operand:SI 3 memory_operand m)]))
-   (clobber (match_scratch:SI 4 =r))]
-  TARGET_ARM  adjacent_mem_locations (operands[2], operands[3])
-  *
-  {
-rtx ldm[3];
-rtx arith[4];
-rtx base_reg;
-HOST_WIDE_INT val1 = 0, val2 = 0;
-
-if (REGNO (operands[0])  REGNO (operands[4]))
-  {
-	ldm[1] = operands[4];
-	ldm[2] = operands[0];
-  }
-else
-  {
-	ldm[1] = operands[0];
-	ldm[2] = operands[4];
-  }
-
-base_reg = XEXP (operands[2], 0);
-
-if (!REG_P (base_reg))
-  {
-	val1 = INTVAL (XEXP (base_reg, 1));
-	base_reg = XEXP (base_reg, 0);
-  }
-
-if (!REG_P (XEXP (operands[3], 0)))
-  val2 = INTVAL (XEXP (XEXP (operands[3], 0), 1));
-
-arith[0] = operands[0];
-arith[3] = operands[1];
-
-if (val1  val2)
-  {
-	arith[1] = ldm[1];
-	arith[2] = ldm[2];
-  }
-else
-  {
-	arith[1] = ldm[2];
-	arith[2] = ldm[1];
-  }
-
-ldm[0] = base_reg;
-if (val1 !=0  val2 != 0)
-  {
-	rtx ops[3];
 
-	if (val1 == 4 || val2 == 4)
-	  /* Other val must be 8, since we know they are adjacent and neither
-	 is zero.  */
-	  output_asm_insn (\ldm%?ib\\t%0, {%1, %2}\, ldm);
-	else if (const_ok_for_arm (val1) || const_ok_for_arm (-val1))
-	  {
-	ldm[0] = ops[0] = operands[4];
-	ops[1] = base_reg;
-	ops[2] = GEN_INT (val1);
-	output_add_immediate (ops);
-	if (val1  val2)
-	  output_asm_insn (\ldm%?ia\\t%0, {%1, %2}\, ldm);
-	else
-	  output_asm_insn (\ldm%?da\\t%0, {%1, %2}\, ldm);
-	  }
-	else
-	  {
-	/* Offset is out of range for a single add, so use two ldr.  */
-	ops[0] = ldm[1];
-	ops[1] = base_reg;
-	ops[2] = GEN_INT (val1);
-	output_asm_insn (\ldr%?\\t%0, [%1, %2]\, ops);
-	ops[0] = ldm[2];
-	ops[2] = GEN_INT (val2);
-	output_asm_insn (\ldr%?\\t%0, [%1, %2]\, ops);
-	  }
-  }
-else if (val1 != 0)
-  {
-	if (val1  val2)
-	  output_asm_insn (\ldm%?da\\t%0, {%1, %2}\, ldm);
-	else
-	  output_asm_insn (\ldm%?ia\\t%0, {%1, %2}\, ldm);
-  }
-else
-  {
-	if (val1  val2)
-	  output_asm_insn (\ldm%?ia\\t%0, {%1, %2}\, ldm);
-	else
-	  output_asm_insn (\ldm%?da\\t%0, {%1, %2}\, ldm);
-  }
-output_asm_insn (\%I3%?\\t%0, %1, %2\, arith);
-return \\;
-  }
-  [(set_attr length 12)
-   (set_attr predicable yes)
-   (set_attr type load1)]
-)
+;-
+;arith_adjacentmem removed as a quick fix, suggested by rearnsha@
+;broken at least in gcc 4.1.3 - 4.4
+;known fixed in 4.5.3 (is@)
+;known fixed in post-4.6 trunk (rearnsha@)
+;-
 
 ; This pattern is never tried by combine, so do it as a peephole
 



CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 21:37:06 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1689


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.110 -r1.1.2.111 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.110 src/doc/CHANGES-5.2:1.1.2.111
--- src/doc/CHANGES-5.2:1.1.2.110	Fri Nov 18 21:23:20 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 21:37:06 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.110 2011/11/18 21:23:20 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.111 2011/11/18 21:37:06 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5752,8 +5752,16 @@ sys/arch/i386/i386/vector.S			1.54
 	[dholland, ticket #1687]
 
 sys/kern/kern_module.c1.84
+
 	Return ENOEXEC instead of 0 if the info of a kernel module
 	doesn't have the expected size. This prevents kernel panics
 	when loading broken modules.
 	[tron, ticket #1688]
 
+gnu/dist/gcc4/gcc/version.c			1.19
+gnu/dist/gcc4/gcc/config/arm/arm.md		1.1.1.2-1.2
+
+	Remove pattern for arith_adjacentmem in arm.md, thus fixing
+	PR toolchain/45576 at a very small run-time cost.
+	[is, ticket #1689]
+



CVS commit: src/sys

2011-11-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 18 22:18:09 UTC 2011

Modified Files:
src/sys/arch/i386/conf: ALL files.i386
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: consinit.c
src/sys/arch/xen/conf: files.compat
src/sys/dev/i2c: files.i2c
Removed Files:
src/sys/arch/i386/conf: XBOX
src/sys/arch/i386/include: xbox.h
src/sys/arch/i386/xbox: xbox.c xboxfb.c xboxlcd.c
src/sys/dev/i2c: pic16lc.c xbseeprom.c

Log Message:
remove Xbox support


To generate a diff of this commit:
cvs rdiff -u -r1.325 -r1.326 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.27 -r0 src/sys/arch/i386/conf/XBOX
cvs rdiff -u -r1.361 -r1.362 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.712 -r1.713 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/include/xbox.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/xbox/xbox.c
cvs rdiff -u -r1.15 -r0 src/sys/arch/i386/xbox/xboxfb.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/xbox/xboxlcd.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/conf/files.compat
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r1.18 -r0 src/sys/dev/i2c/pic16lc.c
cvs rdiff -u -r1.6 -r0 src/sys/dev/i2c/xbseeprom.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/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.325 src/sys/arch/i386/conf/ALL:1.326
--- src/sys/arch/i386/conf/ALL:1.325	Sun Oct 30 12:12:21 2011
+++ src/sys/arch/i386/conf/ALL	Fri Nov 18 22:18:07 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.325 2011/10/30 12:12:21 hannken Exp $
+# $NetBSD: ALL,v 1.326 2011/11/18 22:18:07 jmcneill Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	arch/i386/conf/std.i386
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		ALL-$Revision: 1.325 $
+#ident 		ALL-$Revision: 1.326 $
 
 maxusers	64		# estimated number of users
 
@@ -39,9 +39,6 @@ powernow0	at cpu0		# AMD PowerNow! and C
 viac7temp*	at cpu?		# VIA C7 temperature sensor
 vmt0		at cpu0		# VMware Tools
 
-# XBOX support
-options 	XBOX
-
 options 	MTRR		# memory-type range register syscall support
 # doesn't work with MP just yet..
 options 	PERFCTRS	# performance-monitoring counters support
@@ -576,9 +573,6 @@ voodoofb*	at pci? dev ? function ?
 wcfb*	at pci? dev ? function ?
 wsdisplay*	at wsemuldisplaydev?
 
-# XBOX framebuffer console
-xboxfb0 	at pci? dev ? function ?
-
 # DRI driver
 i915drm*	at drm?		# Intel i915, i945 DRM driver
 mach64drm*	at drm?		# mach64 (3D Rage Pro, Rage) DRM driver
@@ -704,9 +698,6 @@ lm0	at iic?	addr 0x2e flags 0x0
 smscmon*	at iic? addr 0x2c
 #smscmon*	at iic? addr 0x2d	# (alternate address)
 
-pic16lc*	at iic? addr 0x10	# XBOX PIC16LC
-xbseeprom*	at iic? addr 0x54	# XBOX serial EEPROM
-
 # IBM Thinkpad Active Protection System
 aps0	at isa? port 0x1600
 

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.361 src/sys/arch/i386/conf/files.i386:1.362
--- src/sys/arch/i386/conf/files.i386:1.361	Sat Aug 27 12:47:49 2011
+++ src/sys/arch/i386/conf/files.i386	Fri Nov 18 22:18:07 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.361 2011/08/27 12:47:49 bouyer Exp $
+#	$NetBSD: files.i386,v 1.362 2011/11/18 22:18:07 jmcneill Exp $
 #
 # new style config file for i386 architecture
 #
@@ -15,8 +15,8 @@ defparam opt_kernbase.h	KERNBASE
 # delay before cpu_reset() for reboot.
 defparam		CPURESET_DELAY
 
-# Xbox support
-defflag			XBOX
+# Obsolete Xbox support
+obsolete defflag	XBOX
 
 # VM86 emulation
 defflag			VM86
@@ -328,17 +328,6 @@ attach	apm at apmbus with apmbios: biosc
 file	arch/i386/i386/apmbios.c	apmbios	needs-flag
 file	arch/i386/i386/apmcall.S	apmbios
 
-# XBox LED  system support
-file	arch/i386/xbox/xbox.c			xbox
-
-# XBox X3LCD support (*very* rudimentary)
-file	arch/i386/xbox/xboxlcd.c		xbox
-
-# XBox framebuffer support
-device	xboxfb: wsemuldisplaydev, rasops32, vcons
-attach	xboxfb at pci
-file	arch/i386/xbox/xboxfb.c			xboxfb needs-flag
-
 #
 # Compatibility modules
 #

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.712 src/sys/arch/i386/i386/machdep.c:1.713
--- src/sys/arch/i386/i386/machdep.c:1.712	Thu Nov 10 00:12:04 2011
+++ src/sys/arch/i386/i386/machdep.c	Fri Nov 18 22:18:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.712 2011/11/10 00:12:04 jym Exp $	*/
+/*	$NetBSD: machdep.c,v 1.713 2011/11/18 22:18:08 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.712 2011/11/10 00:12:04 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: 

CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:36:37 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1690


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.111 -r1.1.2.112 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.111 src/doc/CHANGES-5.2:1.1.2.112
--- src/doc/CHANGES-5.2:1.1.2.111	Fri Nov 18 21:37:06 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 22:36:37 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.111 2011/11/18 21:37:06 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.112 2011/11/18 22:36:37 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5765,3 +5765,16 @@ gnu/dist/gcc4/gcc/config/arm/arm.md		1.1
 	PR toolchain/45576 at a very small run-time cost.
 	[is, ticket #1689]
 
+distrib/sets/lists/base/mi			patch
+distrib/sets/lists/man/mi			patch
+sbin/Makefile	patch
+sbin/resize_ffs/Makefile			patch
+sbin/resize_ffs/TODOpatch
+sbin/resize_ffs/resize_ffs.8			patch
+sbin/resize_ffs/resize_ffs.c			patch
+
+	Fix resize_ffs(8) so that growing and shrinking all FFSv1
+	(including byteswapped) and growing FFSv2 file systems is supported.
+	Also, cause resize_ffs(8) to be built.
+	[riz, ticket #1690]
+



CVS commit: [netbsd-5] src/sys/uvm

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:42:47 UTC 2011

Modified Files:
src/sys/uvm [netbsd-5]: uvm_meter.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1691):
sys/uvm/uvm_meter.c:revision 1.57

Dereference correct variable and thus stop a sysctl crash.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.8.1 src/sys/uvm/uvm_meter.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/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.49 src/sys/uvm/uvm_meter.c:1.49.8.1
--- src/sys/uvm/uvm_meter.c:1.49	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_meter.c	Fri Nov 18 22:42:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.49.8.1 2011/11/18 22:42:47 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49.8.1 2011/11/18 22:42:47 sborrill Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -152,7 +152,7 @@ sysctl_vm_uvmexp(SYSCTLFN_ARGS)
 	struct sysctlnode node;
 
 	node = *rnode;
-	if (oldp)
+	if (oldlenp)
 		node.sysctl_size = min(*oldlenp, node.sysctl_size);
 
 	return (sysctl_lookup(SYSCTLFN_CALL(node)));



CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:43:53 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1691


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.112 -r1.1.2.113 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.112 src/doc/CHANGES-5.2:1.1.2.113
--- src/doc/CHANGES-5.2:1.1.2.112	Fri Nov 18 22:36:37 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 22:43:53 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.112 2011/11/18 22:36:37 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.113 2011/11/18 22:43:53 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5778,3 +5778,8 @@ sbin/resize_ffs/resize_ffs.c			patch
 	Also, cause resize_ffs(8) to be built.
 	[riz, ticket #1690]
 
+sys/uvm/uvm_meter.c1.57
+
+	Dereference correct variable and thus stop a sysctl crash.
+	[christos, ticket #1691]
+



CVS commit: [netbsd-5-1] src/sys/uvm

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:46:52 UTC 2011

Modified Files:
src/sys/uvm [netbsd-5-1]: uvm_meter.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1691):
sys/uvm/uvm_meter.c:revision 1.57

Dereference correct variable and thus stop a sysctl crash.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.18.1 src/sys/uvm/uvm_meter.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/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.49 src/sys/uvm/uvm_meter.c:1.49.18.1
--- src/sys/uvm/uvm_meter.c:1.49	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_meter.c	Fri Nov 18 22:46:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.49.18.1 2011/11/18 22:46:52 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49.18.1 2011/11/18 22:46:52 sborrill Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -152,7 +152,7 @@ sysctl_vm_uvmexp(SYSCTLFN_ARGS)
 	struct sysctlnode node;
 
 	node = *rnode;
-	if (oldp)
+	if (oldlenp)
 		node.sysctl_size = min(*oldlenp, node.sysctl_size);
 
 	return (sysctl_lookup(SYSCTLFN_CALL(node)));



CVS commit: [netbsd-5-0] src/sys/uvm

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:47:35 UTC 2011

Modified Files:
src/sys/uvm [netbsd-5-0]: uvm_meter.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1691):
sys/uvm/uvm_meter.c:revision 1.57

Dereference correct variable and thus stop a sysctl crash.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.14.1 src/sys/uvm/uvm_meter.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/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.49 src/sys/uvm/uvm_meter.c:1.49.14.1
--- src/sys/uvm/uvm_meter.c:1.49	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_meter.c	Fri Nov 18 22:47:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.49.14.1 2011/11/18 22:47:35 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49 2008/06/04 12:45:28 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.49.14.1 2011/11/18 22:47:35 sborrill Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -152,7 +152,7 @@ sysctl_vm_uvmexp(SYSCTLFN_ARGS)
 	struct sysctlnode node;
 
 	node = *rnode;
-	if (oldp)
+	if (oldlenp)
 		node.sysctl_size = min(*oldlenp, node.sysctl_size);
 
 	return (sysctl_lookup(SYSCTLFN_CALL(node)));



CVS commit: [netbsd-5-0] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:48:42 UTC 2011

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3

Log Message:
Ticlet #1691


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-5.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.52 src/doc/CHANGES-5.0.3:1.1.2.53
--- src/doc/CHANGES-5.0.3:1.1.2.52	Thu Nov  3 17:56:27 2011
+++ src/doc/CHANGES-5.0.3	Fri Nov 18 22:48:42 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.52 2011/11/03 17:56:27 riz Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.53 2011/11/18 22:48:42 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -2851,3 +2851,8 @@ sys/arch/xen/xen/xbdback_xenbus.c		1.45 
 	panic. PR#45158.
 	[bouyer, ticket #1682]
 
+sys/uvm/uvm_meter.c1.57
+
+	Dereference correct variable and thus stop a sysctl crash.
+	[christos, ticket #1691]
+



CVS commit: [netbsd-5-1] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 22:49:37 UTC 2011

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.1

Log Message:
Ticket #1691


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-5.1.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.1.1
diff -u src/doc/CHANGES-5.1.1:1.1.2.38 src/doc/CHANGES-5.1.1:1.1.2.39
--- src/doc/CHANGES-5.1.1:1.1.2.38	Thu Nov  3 17:55:15 2011
+++ src/doc/CHANGES-5.1.1	Fri Nov 18 22:49:37 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.1,v 1.1.2.38 2011/11/03 17:55:15 riz Exp $
+# $NetBSD: CHANGES-5.1.1,v 1.1.2.39 2011/11/18 22:49:37 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1
 release:
@@ -2547,3 +2547,8 @@ sys/arch/xen/xen/xbdback_xenbus.c		1.45 
 	panic. PR#45158.
 	[bouyer, ticket #1682]
 
+sys/uvm/uvm_meter.c1.57
+
+	Dereference correct variable and thus stop a sysctl crash.
+	[christos, ticket #1691]
+



CVS commit: [netbsd-5] src/dist/bind

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:03:22 UTC 2011

Modified Files:
src/dist/bind/bin/named [netbsd-5]: query.c
src/dist/bind/lib/dns [netbsd-5]: rbtdb.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1692):
dist/bind/bin/named/query.c patch
dist/bind/lib/dns/rbtdb.c   patch

Cache lookup could return RRSIG data associated with nonexistent records,
leading to an assertion failure.  Fixes CVE-2011-4313.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.4 -r1.8.4.5 src/dist/bind/bin/named/query.c
cvs rdiff -u -r1.1.1.6.4.5 -r1.1.1.6.4.6 src/dist/bind/lib/dns/rbtdb.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/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.4.4 src/dist/bind/bin/named/query.c:1.8.4.5
--- src/dist/bind/bin/named/query.c:1.8.4.4	Sat Jun 18 11:19:48 2011
+++ src/dist/bind/bin/named/query.c	Fri Nov 18 23:03:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.4.4 2011/06/18 11:19:48 bouyer Exp $	*/
+/*	$NetBSD: query.c,v 1.8.4.5 2011/11/18 23:03:22 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -1282,11 +1282,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1327,8 +1325,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1777,10 +1776,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/dist/bind/lib/dns/rbtdb.c
diff -u src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.5 src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.6
--- src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.5	Thu Jul  7 12:44:25 2011
+++ src/dist/bind/lib/dns/rbtdb.c	Fri Nov 18 23:03:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtdb.c,v 1.1.1.6.4.5 2011/07/07 12:44:25 sborrill Exp $	*/
+/*	$NetBSD: rbtdb.c,v 1.1.1.6.4.6 2011/11/18 23:03:22 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -4824,7 +4824,7 @@ cache_find(dns_db_t *db, dns_name_t *nam
 			  rdataset);
 		if (need_headerupdate(found, search.now))
 			update = found;
-		if (foundsig != NULL) {
+		if (!NEGATIVE(found)  foundsig != NULL) {
 			bind_rdataset(search.rbtdb, node, foundsig, search.now,
   sigrdataset);
 			if (need_headerupdate(foundsig, search.now))
@@ -5453,7 +5453,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn
 	}
 	if (found != NULL) {
 		bind_rdataset(rbtdb, rbtnode, found, now, rdataset);
-		if (foundsig != NULL)
+		if (!NEGATIVE(found)  foundsig != NULL)
 			bind_rdataset(rbtdb, rbtnode, foundsig, now,
   sigrdataset);
 	}



CVS commit: [netbsd-5-1] src/dist/bind

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:06:03 UTC 2011

Modified Files:
src/dist/bind/bin/named [netbsd-5-1]: query.c
src/dist/bind/lib/dns [netbsd-5-1]: rbtdb.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1692):
dist/bind/bin/named/query.c patch
dist/bind/lib/dns/rbtdb.c   patch

Cache lookup could return RRSIG data associated with nonexistent records,
leading to an assertion failure.  Fixes CVE-2011-4313.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.2.2.2 -r1.8.4.2.2.3 src/dist/bind/bin/named/query.c
cvs rdiff -u -r1.1.1.6.4.2.2.3 -r1.1.1.6.4.2.2.4 \
src/dist/bind/lib/dns/rbtdb.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/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.4.2.2.2 src/dist/bind/bin/named/query.c:1.8.4.2.2.3
--- src/dist/bind/bin/named/query.c:1.8.4.2.2.2	Sat Jun 18 11:26:54 2011
+++ src/dist/bind/bin/named/query.c	Fri Nov 18 23:06:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.4.2.2.2 2011/06/18 11:26:54 bouyer Exp $	*/
+/*	$NetBSD: query.c,v 1.8.4.2.2.3 2011/11/18 23:06:03 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -1282,11 +1282,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1327,8 +1325,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1777,10 +1776,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/dist/bind/lib/dns/rbtdb.c
diff -u src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.2.2.3 src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.2.2.4
--- src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.4.2.2.3	Fri Jul  8 21:04:03 2011
+++ src/dist/bind/lib/dns/rbtdb.c	Fri Nov 18 23:06:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtdb.c,v 1.1.1.6.4.2.2.3 2011/07/08 21:04:03 sborrill Exp $	*/
+/*	$NetBSD: rbtdb.c,v 1.1.1.6.4.2.2.4 2011/11/18 23:06:03 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -4824,7 +4824,7 @@ cache_find(dns_db_t *db, dns_name_t *nam
 			  rdataset);
 		if (need_headerupdate(found, search.now))
 			update = found;
-		if (foundsig != NULL) {
+		if (!NEGATIVE(found)  foundsig != NULL) {
 			bind_rdataset(search.rbtdb, node, foundsig, search.now,
   sigrdataset);
 			if (need_headerupdate(foundsig, search.now))
@@ -5453,7 +5453,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn
 	}
 	if (found != NULL) {
 		bind_rdataset(rbtdb, rbtnode, found, now, rdataset);
-		if (foundsig != NULL)
+		if (!NEGATIVE(found)  foundsig != NULL)
 			bind_rdataset(rbtdb, rbtnode, foundsig, now,
   sigrdataset);
 	}



CVS commit: [netbsd-5-0] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:08:39 UTC 2011

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3

Log Message:
Ticket #1692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-5.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.53 src/doc/CHANGES-5.0.3:1.1.2.54
--- src/doc/CHANGES-5.0.3:1.1.2.53	Fri Nov 18 22:48:42 2011
+++ src/doc/CHANGES-5.0.3	Fri Nov 18 23:08:39 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.53 2011/11/18 22:48:42 sborrill Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.54 2011/11/18 23:08:39 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -2856,3 +2856,10 @@ sys/uvm/uvm_meter.c1.57
 	Dereference correct variable and thus stop a sysctl crash.
 	[christos, ticket #1691]
 
+dist/bind/bin/named/query.c			patch
+dist/bind/lib/dns/rbtdb.c			patch
+
+	Cache lookup could return RRSIG data associated with nonexistent
+	records, leading to an assertion failure.  Fixes CVE-2011-4313.
+	[christos, ticket #1692]
+



CVS commit: [netbsd-5-1] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:09:48 UTC 2011

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.1

Log Message:
Ticket #1692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/doc/CHANGES-5.1.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.1.1
diff -u src/doc/CHANGES-5.1.1:1.1.2.39 src/doc/CHANGES-5.1.1:1.1.2.40
--- src/doc/CHANGES-5.1.1:1.1.2.39	Fri Nov 18 22:49:37 2011
+++ src/doc/CHANGES-5.1.1	Fri Nov 18 23:09:48 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.1,v 1.1.2.39 2011/11/18 22:49:37 sborrill Exp $
+# $NetBSD: CHANGES-5.1.1,v 1.1.2.40 2011/11/18 23:09:48 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.1.1
 release:
@@ -2552,3 +2552,10 @@ sys/uvm/uvm_meter.c1.57
 	Dereference correct variable and thus stop a sysctl crash.
 	[christos, ticket #1691]
 
+dist/bind/bin/named/query.c			patch
+dist/bind/lib/dns/rbtdb.c			patch
+
+	Cache lookup could return RRSIG data associated with nonexistent
+	records, leading to an assertion failure.  Fixes CVE-2011-4313.
+	[christos, ticket #1692]
+



CVS commit: [netbsd-5-0] src/dist/bind

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:05:07 UTC 2011

Modified Files:
src/dist/bind/bin/named [netbsd-5-0]: query.c
src/dist/bind/lib/dns [netbsd-5-0]: rbtdb.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1692):
dist/bind/bin/named/query.c patch
dist/bind/lib/dns/rbtdb.c   patch

Cache lookup could return RRSIG data associated with nonexistent records,
leading to an assertion failure.  Fixes CVE-2011-4313.


To generate a diff of this commit:
cvs rdiff -u -r1.8.8.4 -r1.8.8.5 src/dist/bind/bin/named/query.c
cvs rdiff -u -r1.1.1.6.8.5 -r1.1.1.6.8.6 src/dist/bind/lib/dns/rbtdb.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/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.8.4 src/dist/bind/bin/named/query.c:1.8.8.5
--- src/dist/bind/bin/named/query.c:1.8.8.4	Sat Jun 18 11:35:06 2011
+++ src/dist/bind/bin/named/query.c	Fri Nov 18 23:05:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.8.4 2011/06/18 11:35:06 bouyer Exp $	*/
+/*	$NetBSD: query.c,v 1.8.8.5 2011/11/18 23:05:07 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -1282,11 +1282,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1327,8 +1325,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			   ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL 
+			dns_rdataset_isassociated(sigrdataset))
+dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1777,10 +1776,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/dist/bind/lib/dns/rbtdb.c
diff -u src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.8.5 src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.8.6
--- src/dist/bind/lib/dns/rbtdb.c:1.1.1.6.8.5	Thu Jul  7 20:27:41 2011
+++ src/dist/bind/lib/dns/rbtdb.c	Fri Nov 18 23:05:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtdb.c,v 1.1.1.6.8.5 2011/07/07 20:27:41 sborrill Exp $	*/
+/*	$NetBSD: rbtdb.c,v 1.1.1.6.8.6 2011/11/18 23:05:07 sborrill Exp $	*/
 
 /*
  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. (ISC)
@@ -4824,7 +4824,7 @@ cache_find(dns_db_t *db, dns_name_t *nam
 			  rdataset);
 		if (need_headerupdate(found, search.now))
 			update = found;
-		if (foundsig != NULL) {
+		if (!NEGATIVE(found)  foundsig != NULL) {
 			bind_rdataset(search.rbtdb, node, foundsig, search.now,
   sigrdataset);
 			if (need_headerupdate(foundsig, search.now))
@@ -5453,7 +5453,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn
 	}
 	if (found != NULL) {
 		bind_rdataset(rbtdb, rbtnode, found, now, rdataset);
-		if (foundsig != NULL)
+		if (!NEGATIVE(found)  foundsig != NULL)
 			bind_rdataset(rbtdb, rbtnode, foundsig, now,
   sigrdataset);
 	}



CVS commit: [netbsd-5] src/sys/kern

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:17:53 UTC 2011

Modified Files:
src/sys/kern [netbsd-5]: kern_event.c

Log Message:
Pull up the following revisions(s) (requested by christos in ticket #1693):
sys/kern/kern_event.c:  revision 1.73

PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout value
makes DIAGNOSTIC kernel panic. If the computed ticks are = 0 set it to 1.


To generate a diff of this commit:
cvs rdiff -u -r1.60.6.2 -r1.60.6.3 src/sys/kern/kern_event.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/kern_event.c
diff -u src/sys/kern/kern_event.c:1.60.6.2 src/sys/kern/kern_event.c:1.60.6.3
--- src/sys/kern/kern_event.c:1.60.6.2	Sat Jan  9 01:08:39 2010
+++ src/sys/kern/kern_event.c	Fri Nov 18 23:17:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.60.6.2 2010/01/09 01:08:39 snj Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.60.6.3 2011/11/18 23:17:53 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.60.6.2 2010/01/09 01:08:39 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.60.6.3 2011/11/18 23:17:53 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -571,6 +571,8 @@ filt_timerexpire(void *knx)
 	knote_activate(kn);
 	if ((kn-kn_flags  EV_ONESHOT) == 0) {
 		tticks = mstohz(kn-kn_sdata);
+		if (tticks = 0)
+			tticks = 1;
 		callout_schedule((callout_t *)kn-kn_hook, tticks);
 	}
 	mutex_exit(kqueue_misc_lock);



CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:19:21 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.114 -r1.1.2.115 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.114 src/doc/CHANGES-5.2:1.1.2.115
--- src/doc/CHANGES-5.2:1.1.2.114	Fri Nov 18 23:07:43 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 23:19:21 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.114 2011/11/18 23:07:43 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.115 2011/11/18 23:19:21 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5790,3 +5790,10 @@ dist/bind/lib/dns/rbtdb.c			patch
 	records, leading to an assertion failure.  Fixes CVE-2011-4313.
 	[christos, ticket #1692]
 
+sys/kern/kern_event.c1.73
+
+	PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller
+	timeout value makes DIAGNOSTIC kernel panic. If the computed
+	ticks are = 0 set it to 1.
+	[christos, ticket #1693]
+



CVS commit: [netbsd-5] src/sys/dev/pci

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:25:40 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_age.c

Log Message:
Pull up the following revisions(s) (requested by bouyer in ticket #1694):
sys/dev/pci/if_age.c:   revision 1.40 via patch

- age_init() is called from age_watchdog() which is in interrupt context; we
can't sleep here or we get a DIAGNOSTIC panic when age_watchdog() fires.
- More correct bus_dma(9) usage in age_encap()
- Introduce a age_shutdown() to be called by pmf(9) at shutdown time,
to stop the DMA engine.
- Be consistent in WAIT/NOWAIT use in init routines
- Use BUS_DMA_COHERENT where appropriate
- Rework the interrupt routine a bit, and ACK but do not disable interrupts
here. There seems to be a race where interrupts would not be properly
reenabled after this, leading do watchdog timeouts.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.5 -r1.28.2.6 src/sys/dev/pci/if_age.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_age.c
diff -u src/sys/dev/pci/if_age.c:1.28.2.5 src/sys/dev/pci/if_age.c:1.28.2.6
--- src/sys/dev/pci/if_age.c:1.28.2.5	Sun Nov  8 22:03:32 2009
+++ src/sys/dev/pci/if_age.c	Fri Nov 18 23:25:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj Exp $ */
+/*	$NetBSD: if_age.c,v 1.28.2.6 2011/11/18 23:25:40 sborrill Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.6 2011/11/18 23:25:40 sborrill Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -93,6 +93,7 @@ static int	age_init(struct ifnet *);
 static int	age_ioctl(struct ifnet *, u_long, void *);
 static void	age_start(struct ifnet *);
 static void	age_watchdog(struct ifnet *);
+static bool	age_shutdown(device_t, int);
 static void	age_mediastatus(struct ifnet *, struct ifmediareq *);
 static int	age_mediachange(struct ifnet *);
 
@@ -287,7 +288,7 @@ age_attach(device_t parent, device_t sel
 	if_attach(ifp);
 	ether_ifattach(ifp, sc-sc_enaddr);
 
-	if (!pmf_device_register(self, NULL, age_resume))
+	if (!pmf_device_register1(self, NULL, age_resume, age_shutdown))
 		aprint_error_dev(self, couldn't establish power handler\n);
 	else
 		pmf_class_network_register(self, ifp);
@@ -495,65 +496,61 @@ age_intr(void *arg)
 	cmb = sc-age_rdata.age_cmb_block;
 	if (cmb == NULL) {
 		/* Happens when bringing up the interface
-		 * w/o having a carrier. Ack. the interrupt.
+		 * w/o having a carrier. Ack the interrupt.
 		 */
 		CSR_WRITE_4(sc, AGE_INTR_STATUS, status);
 		return 0;
 	}
 
-	/* Disable interrupts. */
-	CSR_WRITE_4(sc, AGE_INTR_STATUS, status | INTR_DIS_INT);
-		
-	bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
-	sc-age_cdata.age_cmb_block_map-dm_mapsize, BUS_DMASYNC_POSTREAD);
-	status = le32toh(cmb-intr_status);
-	if ((status  AGE_INTRS) == 0)
-		goto back;
-
-	sc-age_tpd_cons = (le32toh(cmb-tpd_cons)  TPD_CONS_MASK) 
-	TPD_CONS_SHIFT;
-	sc-age_rr_prod = (le32toh(cmb-rprod_cons)  RRD_PROD_MASK) 
-	RRD_PROD_SHIFT;
-
-	/* Let hardware know CMB was served. */
-	cmb-intr_status = 0;
 	bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
 	sc-age_cdata.age_cmb_block_map-dm_mapsize,
-	BUS_DMASYNC_PREWRITE);
-
-	if (ifp-if_flags  IFF_RUNNING) {
-		if (status  INTR_CMB_RX)
-			age_rxintr(sc, sc-age_rr_prod);
-
-		if (status  INTR_CMB_TX)
-			age_txintr(sc, sc-age_tpd_cons);
-
-		if (status  (INTR_DMA_RD_TO_RST | INTR_DMA_WR_TO_RST)) {
-			if (status  INTR_DMA_RD_TO_RST)
-printf(%s: DMA read error! -- resetting\n,
-device_xname(sc-sc_dev));
-			if (status  INTR_DMA_WR_TO_RST)
-printf(%s: DMA write error! -- resetting\n,
-device_xname(sc-sc_dev));
-			age_init(ifp);
-		}
+	BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+	status = le32toh(cmb-intr_status);
+	/* ACK/reenable interrupts */
+	CSR_WRITE_4(sc, AGE_INTR_STATUS, status);
+	while ((status  AGE_INTRS) != 0) {
+		sc-age_tpd_cons = (le32toh(cmb-tpd_cons)  TPD_CONS_MASK) 
+		TPD_CONS_SHIFT;
+		sc-age_rr_prod = (le32toh(cmb-rprod_cons)  RRD_PROD_MASK) 
+		RRD_PROD_SHIFT;
+
+		/* Let hardware know CMB was served. */
+		cmb-intr_status = 0;
+		bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
+		sc-age_cdata.age_cmb_block_map-dm_mapsize,
+		BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+
+		if (ifp-if_flags  IFF_RUNNING) {
+			if (status  INTR_CMB_RX)
+age_rxintr(sc, sc-age_rr_prod);
+
+			if (status  INTR_CMB_TX)
+age_txintr(sc, sc-age_tpd_cons);
+
+			if (status  (INTR_DMA_RD_TO_RST | INTR_DMA_WR_TO_RST)) {
+if (status  INTR_DMA_RD_TO_RST)
+	printf(%s: DMA read error! -- 
+	resetting\n,
+

CVS commit: [netbsd-5] src/doc

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:28:00 UTC 2011

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1694


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 src/doc/CHANGES-5.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.115 src/doc/CHANGES-5.2:1.1.2.116
--- src/doc/CHANGES-5.2:1.1.2.115	Fri Nov 18 23:19:21 2011
+++ src/doc/CHANGES-5.2	Fri Nov 18 23:27:59 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.115 2011/11/18 23:19:21 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.116 2011/11/18 23:27:59 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5797,3 +5797,18 @@ sys/kern/kern_event.c1.73
 	ticks are = 0 set it to 1.
 	[christos, ticket #1693]
 
+sys/dev/pci/if_age.c1.40 via patch
+
+	- age_init() is called from age_watchdog() which is in interrupt
+	context; we can't sleep here or we get a DIAGNOSTIC panic when
+	age_watchdog() fires.
+	- More correct bus_dma(9) usage in age_encap()
+	- Introduce a age_shutdown() to be called by pmf(9) at shutdown time,
+	to stop the DMA engine.
+	- Be consistent in WAIT/NOWAIT use in init routines
+	- Use BUS_DMA_COHERENT where appropriate
+	- Rework the interrupt routine a bit, and ACK but do not disable
+	interrupts here. There seems to be a race where interrupts would
+	not be properly reenabled after this, leading do watchdog timeouts.
+	[bouyer, ticket #1694]
+



CVS commit: src/sys/dev/pci

2011-11-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 19 02:39:14 UTC 2011

Modified Files:
src/sys/dev/pci: amdpm_smbus.c

Log Message:
bye xbox


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/amdpm_smbus.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/amdpm_smbus.c
diff -u src/sys/dev/pci/amdpm_smbus.c:1.16 src/sys/dev/pci/amdpm_smbus.c:1.17
--- src/sys/dev/pci/amdpm_smbus.c:1.16	Tue Feb  3 11:27:13 2009
+++ src/sys/dev/pci/amdpm_smbus.c	Fri Nov 18 21:39:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdpm_smbus.c,v 1.16 2009/02/03 16:27:13 pgoyette Exp $ */
+/*	$NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 christos Exp $ */
 
 /*
  * Copyright (c) 2005 Anil Gopinath (anil_pub...@yahoo.com)
@@ -32,7 +32,7 @@
  * AMD-8111 HyperTransport I/O Hub
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amdpm_smbus.c,v 1.16 2009/02/03 16:27:13 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: amdpm_smbus.c,v 1.17 2011/11/19 02:39:14 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -53,14 +53,6 @@ __KERNEL_RCSID(0, $NetBSD: amdpm_smbus.
 
 #include dev/pci/amdpm_smbusreg.h
 
-#ifdef __i386__
-#include opt_xbox.h
-#endif
-
-#ifdef XBOX
-extern int arch_i386_is_xbox;
-#endif
-
 static int   amdpm_smbus_acquire_bus(void *, int);
 static void  amdpm_smbus_release_bus(void *, int);
 static int   amdpm_smbus_exec(void *, i2c_op_t, i2c_addr_t, const void *,
@@ -75,18 +67,10 @@ static int   amdpm_smbus_write_1(str
 static int   amdpm_smbus_receive_1(struct amdpm_softc *, i2c_op_t);
 static int   amdpm_smbus_read_1(struct amdpm_softc *sc, uint8_t, i2c_op_t);
 
-#ifdef XBOX
-static int	 amdpm_smbus_intr(void *);
-#endif
-
 void
 amdpm_smbus_attach(struct amdpm_softc *sc)
 {
 struct i2cbus_attach_args iba;
-#ifdef XBOX
-	pci_intr_handle_t ih;
-	const char *intrstr;
-#endif
 	
 	/* register with iic */
 	sc-sc_i2c.ic_cookie = sc; 
@@ -101,67 +85,10 @@ amdpm_smbus_attach(struct amdpm_softc *s
 
 	rw_init(sc-sc_rwlock);
 
-#ifdef XBOX
-#define XBOX_SMBA	0x8000
-#define XBOX_SMSIZE	256
-#define XBOX_INTRLINE	12
-#define XBOX_REG_ACPI_PM1a_EN		0x02
-#define XBOX_REG_ACPI_PM1a_EN_TIMER		0x01
-	/* XXX pci0 dev 1 function 2 System Management doesn't probe */
-	if (arch_i386_is_xbox) {
-		uint16_t val;
-		sc-sc_pa-pa_intrline = XBOX_INTRLINE;
-
-		if (bus_space_map(sc-sc_iot, XBOX_SMBA, XBOX_SMSIZE,
-		0, sc-sc_sm_ioh) == 0) {
-			aprint_normal_dev(sc-sc_dev, system management at 0x%04x\n, XBOX_SMBA);
-
-			/* Disable PM ACPI timer SCI interrupt */
-			val = bus_space_read_2(sc-sc_iot, sc-sc_sm_ioh,
-			XBOX_REG_ACPI_PM1a_EN);
-			bus_space_write_2(sc-sc_iot, sc-sc_sm_ioh,
-			XBOX_REG_ACPI_PM1a_EN,
-			val  ~XBOX_REG_ACPI_PM1a_EN_TIMER);
-		}
-	}
-
-	if (pci_intr_map(sc-sc_pa, ih))
-		aprint_error_dev(sc-sc_dev, couldn't map interrupt\n);
-	else {
-		intrstr = pci_intr_string(sc-sc_pc, ih);
-		sc-sc_ih = pci_intr_establish(sc-sc_pc, ih, IPL_BIO,
-		amdpm_smbus_intr, sc);
-		if (sc-sc_ih != NULL)
-			aprint_normal_dev(sc-sc_dev, interrupting at %s\n,
-			intrstr);
-	}
-#endif
-
 	iba.iba_tag = sc-sc_i2c;
 	(void)config_found_ia(sc-sc_dev, i2cbus, iba, iicbus_print);
 }
 
-#ifdef XBOX
-static int
-amdpm_smbus_intr(void *cookie)
-{
-	struct amdpm_softc *sc;
-	uint32_t status;
-
-	sc = (struct amdpm_softc *)cookie;
-
-	if (arch_i386_is_xbox) {
-		status = bus_space_read_4(sc-sc_iot, sc-sc_sm_ioh, 0x20);
-		bus_space_write_4(sc-sc_iot, sc-sc_sm_ioh, 0x20, status);
-	
-		if (status  2)
-			return iic_smbus_intr(sc-sc_i2c);
-	}
-
-	return 0;
-}
-#endif
-
 static int
 amdpm_smbus_acquire_bus(void *cookie, int flags)
 {