CVS commit: src/sbin/svhlabel

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 10:44:46 UTC 2013

Modified Files:
src/sbin/svhlabel: svhlabel.c

Log Message:
getrawpartition(3) may fail, so call it only once and test for failure.
Coverity CID 274527.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/svhlabel/svhlabel.c

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

Modified files:

Index: src/sbin/svhlabel/svhlabel.c
diff -u src/sbin/svhlabel/svhlabel.c:1.6 src/sbin/svhlabel/svhlabel.c:1.7
--- src/sbin/svhlabel/svhlabel.c:1.6	Sat Aug 27 18:55:58 2011
+++ src/sbin/svhlabel/svhlabel.c	Thu Feb  7 10:44:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svhlabel.c,v 1.6 2011/08/27 18:55:58 joerg Exp $	*/
+/*	$NetBSD: svhlabel.c,v 1.7 2013/02/07 10:44:45 apb Exp $	*/
 
 /*
  * Copyright (C) 2007 Stephen M. Rumble.
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: svhlabel.c,v 1.6 2011/08/27 18:55:58 joerg Exp $);
+__RCSID($NetBSD: svhlabel.c,v 1.7 2013/02/07 10:44:45 apb Exp $);
 #endif /* not lint */
 
 #include stdio.h
@@ -67,6 +67,7 @@ static int	is_efs(int, uint32_t);
 static struct sgi_boot_block *convert_sgi_boot_block(unsigned char *);
 
 struct disklabel label;
+static int	rawpart;
 
 static void
 getlabel(int sd)
@@ -80,8 +81,8 @@ getlabel(int sd)
 	 * Some ports seem to not set the number of partitions
 	 * correctly, albeit they seem to set the raw partition ok!
 	 */
-	if (label.d_npartitions = getrawpartition())
-		label.d_npartitions = getrawpartition() + 1;
+	if (label.d_npartitions = rawpart)
+		label.d_npartitions = rawpart + 1;
 }
 
 static void
@@ -164,7 +165,7 @@ getparts(int sd, int verbose)
 		if (j = label.d_npartitions)
 			break;
 
-		if (j == getrawpartition()) {
+		if (j == rawpart) {
 			if (++j = label.d_npartitions)
 break;
 		}
@@ -186,7 +187,7 @@ getparts(int sd, int verbose)
 	label.d_secpercyl = 1;
 	label.d_ncylinders = label.d_secperunit;
 
-	i = getrawpartition();
+	i = rawpart;
 	if (label.d_partitions[i].p_fstype != FS_UNUSED ||
 	label.d_partitions[i].p_offset != 0 ||
 	label.d_partitions[i].p_size != label.d_secperunit) {
@@ -322,6 +323,10 @@ main(int argc, char **argv)
 	if (argc != 1)
 		usage();
 
+	rawpart = getrawpartition();
+	if (rawpart  0)
+		err(EXIT_FAILURE, getrawpartition);
+
 	if ((sd = opendisk(argv[0], write_it ? O_RDWR : O_RDONLY, name,
 	(size_t)MAXPATHLEN, 1))  0) {
 		perror(argv[0]);



CVS commit: src/sbin/newfs_ext2fs

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 11:01:00 UTC 2013

Modified Files:
src/sbin/newfs_ext2fs: mke2fs.c

Log Message:
free(bbp) in error paths.  Coverity CID 274748.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sbin/newfs_ext2fs/mke2fs.c

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

Modified files:

Index: src/sbin/newfs_ext2fs/mke2fs.c
diff -u src/sbin/newfs_ext2fs/mke2fs.c:1.17 src/sbin/newfs_ext2fs/mke2fs.c:1.18
--- src/sbin/newfs_ext2fs/mke2fs.c:1.17	Tue Jan 22 09:39:13 2013
+++ src/sbin/newfs_ext2fs/mke2fs.c	Thu Feb  7 11:00:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mke2fs.c,v 1.17 2013/01/22 09:39:13 dholland Exp $	*/
+/*	$NetBSD: mke2fs.c,v 1.18 2013/02/07 11:00:59 apb Exp $	*/
 
 /*-
  * Copyright (c) 2007 Izumi Tsutsui.  All rights reserved.
@@ -100,7 +100,7 @@
 #if 0
 static char sccsid[] = @(#)mkfs.c	8.11 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: mke2fs.c,v 1.17 2013/01/22 09:39:13 dholland Exp $);
+__RCSID($NetBSD: mke2fs.c,v 1.18 2013/02/07 11:00:59 apb Exp $);
 #endif
 #endif /* not lint */
 
@@ -1276,8 +1276,10 @@ alloc(uint32_t size, uint16_t mode)
 #endif
 
 	loc = skpc(~0U, len, bbp);
-	if (loc == 0)
+	if (loc == 0) {
+		free(bbp);
 		return 0;
+	}
 	loc = len - loc;
 	map = bbp[loc];
 	bno = loc * NBBY;
@@ -1285,6 +1287,7 @@ alloc(uint32_t size, uint16_t mode)
 		if ((map  (1  i)) == 0)
 			goto gotit;
 	}
+	free(bbp);
 	return 0;
 	
  gotit:



CVS commit: src/sbin/ifconfig

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 11:24:15 UTC 2013

Modified Files:
src/sbin/ifconfig: env.c

Log Message:
Don't call prop_distionary_make_immutable on a NULL pointer.
Coverity CID 275179.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/ifconfig/env.c

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

Modified files:

Index: src/sbin/ifconfig/env.c
diff -u src/sbin/ifconfig/env.c:1.7 src/sbin/ifconfig/env.c:1.8
--- src/sbin/ifconfig/env.c:1.7	Mon Dec 13 17:35:08 2010
+++ src/sbin/ifconfig/env.c	Thu Feb  7 11:24:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: env.c,v 1.7 2010/12/13 17:35:08 pooka Exp $	*/
+/*	$NetBSD: env.c,v 1.8 2013/02/07 11:24:15 apb Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: env.c,v 1.7 2010/12/13 17:35:08 pooka Exp $);
+__RCSID($NetBSD: env.c,v 1.8 2013/02/07 11:24:15 apb Exp $);
 #endif /* not lint */
 
 #include errno.h
@@ -67,7 +67,8 @@ prop_dictionary_augment(prop_dictionary_
 		}
 	}
 	prop_object_iterator_release(i);
-	prop_dictionary_make_immutable(d);
+	if (d !== NULL)
+		prop_dictionary_make_immutable(d);
 	return d;
 }
 



CVS commit: src/sbin/modload

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 12:04:02 UTC 2013

Modified Files:
src/sbin/modload: main.c

Log Message:
Don't pass NULL to prop_dictionary_set.
Coverity CID 275196.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/modload/main.c

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

Modified files:

Index: src/sbin/modload/main.c
diff -u src/sbin/modload/main.c:1.14 src/sbin/modload/main.c:1.15
--- src/sbin/modload/main.c:1.14	Mon Dec 13 20:48:44 2010
+++ src/sbin/modload/main.c	Thu Feb  7 12:04:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $	*/
+/*	$NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $);
+__RCSID($NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $);
 #endif /* !lint */
 
 #include sys/module.h
@@ -185,6 +185,7 @@ parse_bool_param(prop_dictionary_t props
 		 const char *value)
 {
 	bool boolvalue;
+	prop_object_t po;
 
 	assert(name != NULL);
 	assert(value != NULL);
@@ -200,7 +201,10 @@ parse_bool_param(prop_dictionary_t props
 	else
 		errx(EXIT_FAILURE, Invalid boolean value `%s', value);
 
-	prop_dictionary_set(props, name, prop_bool_create(boolvalue));
+	po = prop_bool_create(boolvalue);
+	if (po == NULL)
+		err(EXIT_FAILURE, prop_bool_create);
+	prop_dictionary_set(props, name, po);
 }
 
 static void
@@ -208,6 +212,7 @@ parse_int_param(prop_dictionary_t props,
 		const char *value)
 {
 	int64_t intvalue;
+	prop_object_t po;
 
 	assert(name != NULL);
 	assert(value != NULL);
@@ -215,8 +220,10 @@ parse_int_param(prop_dictionary_t props,
 	if (dehumanize_number(value, intvalue) != 0)
 		err(EXIT_FAILURE, Invalid integer value `%s', value);
 
-	prop_dictionary_set(props, name,
-	prop_number_create_integer(intvalue));
+	po = prop_number_create_integer(intvalue);
+	if (po == NULL)
+		err(EXIT_FAILURE, prop_number_create_integer);
+	prop_dictionary_set(props, name, po);
 }
 
 static void
@@ -243,11 +250,15 @@ static void
 parse_string_param(prop_dictionary_t props, const char *name,
 		   const char *value)
 {
+	prop_object_t po;
 
 	assert(name != NULL);
 	assert(value != NULL);
 
-	prop_dictionary_set(props, name, prop_string_create_cstring(value));
+	po = prop_string_create_cstring(value);
+	if (po == NULL)
+		err(EXIT_FAILURE, prop_string_create_cstring);
+	prop_dictionary_set(props, name, po);
 }
 
 static void



CVS commit: src/sbin/ifconfig

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 13:20:51 UTC 2013

Modified Files:
src/sbin/ifconfig: env.c

Log Message:
Avoid dereferencing NULL.  Coverity CID 275201.
Also fix a typo in previous: !== should be !=


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/ifconfig/env.c

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

Modified files:

Index: src/sbin/ifconfig/env.c
diff -u src/sbin/ifconfig/env.c:1.8 src/sbin/ifconfig/env.c:1.9
--- src/sbin/ifconfig/env.c:1.8	Thu Feb  7 11:24:15 2013
+++ src/sbin/ifconfig/env.c	Thu Feb  7 13:20:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: env.c,v 1.8 2013/02/07 11:24:15 apb Exp $	*/
+/*	$NetBSD: env.c,v 1.9 2013/02/07 13:20:51 apb Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: env.c,v 1.8 2013/02/07 11:24:15 apb Exp $);
+__RCSID($NetBSD: env.c,v 1.9 2013/02/07 13:20:51 apb Exp $);
 #endif /* not lint */
 
 #include errno.h
@@ -53,10 +53,12 @@ prop_dictionary_augment(prop_dictionary_
 	const char *key;
 
 	d = prop_dictionary_copy_mutable(bottom);
+	if (d == NULL)
+		return NULL;
 
 	i = prop_dictionary_iterator(top);
 
-	while ((ko = prop_object_iterator_next(i)) != NULL) {
+	while (i != NULL  (ko = prop_object_iterator_next(i)) != NULL) {
 		k = (prop_dictionary_keysym_t)ko;
 		key = prop_dictionary_keysym_cstring_nocopy(k);
 		o = prop_dictionary_get_keysym(top, k);
@@ -66,8 +68,9 @@ prop_dictionary_augment(prop_dictionary_
 			break;
 		}
 	}
-	prop_object_iterator_release(i);
-	if (d !== NULL)
+	if (i != NULL)
+		prop_object_iterator_release(i);
+	if (d != NULL)
 		prop_dictionary_make_immutable(d);
 	return d;
 }



CVS commit: src/sbin/ifconfig

2013-02-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Feb  7 13:21:35 UTC 2013

Modified Files:
src/sbin/ifconfig: ifconfig.c

Log Message:
Abort on error from prop_dictionary_augment.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sbin/ifconfig/ifconfig.c

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.228 src/sbin/ifconfig/ifconfig.c:1.229
--- src/sbin/ifconfig/ifconfig.c:1.228	Thu Nov  1 13:43:23 2012
+++ src/sbin/ifconfig/ifconfig.c	Thu Feb  7 13:21:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifconfig.c,v 1.228 2012/11/01 13:43:23 pgoyette Exp $	*/
+/*	$NetBSD: ifconfig.c,v 1.229 2013/02/07 13:21:34 apb Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef lint
 __COPYRIGHT(@(#) Copyright (c) 1983, 1993\
  The Regents of the University of California.  All rights reserved.);
-__RCSID($NetBSD: ifconfig.c,v 1.228 2012/11/01 13:43:23 pgoyette Exp $);
+__RCSID($NetBSD: ifconfig.c,v 1.229 2013/02/07 13:21:34 apb Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -681,8 +681,12 @@ main(int argc, char **argv)
 	env = (nmatch  0) ? match[(int)nmatch - 1].m_env : NULL;
 	if (env == NULL)
 		env = oenv;
-	else
+	else {
 		env = prop_dictionary_augment(env, oenv);
+		if (env == NULL)
+			err(EXIT_FAILURE, %s: prop_dictionary_augment,
+			__func__);
+	}
 
 	/* Process any media commands that may have been issued. */
 	process_media_commands(env);



CVS commit: xsrc/external/mit/pixman/dist/pixman

2013-02-07 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Feb  7 13:30:48 UTC 2013

Modified Files:
xsrc/external/mit/pixman/dist/pixman: pixman-ppc.c

Log Message:
enable altivec detection via sysctl(machdep.altivec)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c

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

Modified files:

Index: xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c
diff -u xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.1.1.1 xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.2
--- xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c:1.1.1.1	Thu Jan 31 10:28:48 2013
+++ xsrc/external/mit/pixman/dist/pixman/pixman-ppc.c	Thu Feb  7 13:30:48 2013
@@ -48,7 +48,7 @@ pixman_have_vmx (void)
 return have_vmx;
 }
 
-#elif defined (__OpenBSD__)
+#elif defined (__OpenBSD__) || defined(__NetBSD__)
 #include sys/param.h
 #include sys/sysctl.h
 #include machine/cpu.h



CVS commit: src/external/mit/xorg/lib/pixman

2013-02-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  7 13:33:50 UTC 2013

Modified Files:
src/external/mit/xorg/lib/pixman: Makefile

Log Message:
build altivec support on powerpc


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/xorg/lib/pixman/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/pixman/Makefile
diff -u src/external/mit/xorg/lib/pixman/Makefile:1.18 src/external/mit/xorg/lib/pixman/Makefile:1.19
--- src/external/mit/xorg/lib/pixman/Makefile:1.18	Sun Feb  3 12:41:40 2013
+++ src/external/mit/xorg/lib/pixman/Makefile	Thu Feb  7 13:33:50 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2013/02/03 12:41:40 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.19 2013/02/07 13:33:50 macallan Exp $
 
 NOLINT=	1	# defined
 
@@ -55,6 +55,13 @@ COPTS.pixman-mmx.c=	-mmmx -fvisibility=h
 #COPTS.pixman-sse2.c=	-msse2 -fvisibility=hidden
 .endif
 
+.if ${MACHINE_ARCH} == powerpc
+SRCS+=	pixman-vmx.c
+COPTS.pixman-vmx.c=	-maltivec
+CPPFLAGS+=		-DUSE_VMX
+MKDEPFLAGS+=		-maltivec
+.endif
+
 .if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmhf
 # ARM SIMD
 SRCS+=		pixman-arm-simd.c 		\
@@ -71,10 +78,6 @@ COPTS.pixman-mmx.c=	-mcpu=iwmmxt
 CPPFLAGS+=	-DUSE_ARM_IWMMXT
 .endif
 
-# .if VMX
-# SRCS+=	pixman-vmx.c
-# .endif
-
 INCS=	pixman.h pixman-version.h
 INCSDIR=${X11INCDIR}/pixman-1
 



CVS commit: src/usr.bin/flock

2013-02-07 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Thu Feb  7 13:57:40 UTC 2013

Modified Files:
src/usr.bin/flock: flock.c

Log Message:
Don't crash if flock is used to lock a file descriptor e.g. via
flock --nb 8.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/flock/flock.c

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

Modified files:

Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.6 src/usr.bin/flock/flock.c:1.7
--- src/usr.bin/flock/flock.c:1.6	Fri Nov  2 17:03:16 2012
+++ src/usr.bin/flock/flock.c	Thu Feb  7 13:57:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: flock.c,v 1.6 2012/11/02 17:03:16 christos Exp $	*/
+/*	$NetBSD: flock.c,v 1.7 2013/02/07 13:57:40 tron Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: flock.c,v 1.6 2012/11/02 17:03:16 christos Exp $);
+__RCSID($NetBSD: flock.c,v 1.7 2013/02/07 13:57:40 tron Exp $);
 
 #include stdio.h
 #include string.h
@@ -212,9 +212,12 @@ main(int argc, char *argv[])
 		if (cls)
 			usage(Close is valid only for descriptors);
 		fd = strtol(argv[0], NULL, 0);	// XXX: error checking
-		if (debug)
+		if (debug) {
 			fprintf(stderr, descriptor %s lock %s\n,
 			argv[0], lock2name(lock));
+		}
+		break;
+
 	default:
 		if ((lock  LOCK_NB) == LOCK_UN)
 			usage(Unlock is only valid for descriptors);



CVS commit: src/sys/dev/pci

2013-02-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  7 15:38:42 UTC 2013

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
Fix RAL_TABSIZE for ICH8, 82576, 82580 and I350.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.241 src/sys/dev/pci/if_wm.c:1.242
--- src/sys/dev/pci/if_wm.c:1.241	Thu Feb  7 02:10:18 2013
+++ src/sys/dev/pci/if_wm.c	Thu Feb  7 15:38:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.241 2013/02/07 02:10:18 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.242 2013/02/07 15:38:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.241 2013/02/07 02:10:18 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.242 2013/02/07 15:38:42 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -5643,10 +5643,17 @@ wm_set_filter(struct wm_softc *sc)
 	 * Set the station address in the first RAL slot, and
 	 * clear the remaining slots.
 	 */
-	if ((sc-sc_type == WM_T_ICH8) || (sc-sc_type == WM_T_ICH9)
-	|| (sc-sc_type == WM_T_ICH10) || (sc-sc_type == WM_T_PCH)
-	|| (sc-sc_type == WM_T_PCH2))
-		size = WM_ICH8_RAL_TABSIZE;
+	if (sc-sc_type == WM_T_ICH8)
+		size = WM_RAL_TABSIZE_ICH8 -1;
+	else if ((sc-sc_type == WM_T_ICH9) || (sc-sc_type == WM_T_ICH10)
+	|| (sc-sc_type == WM_T_PCH) || (sc-sc_type == WM_T_PCH2))
+		size = WM_RAL_TABSIZE_ICH8;
+	else if (sc-sc_type == WM_T_82575)
+		size = WM_RAL_TABSIZE_82575;
+	else if ((sc-sc_type == WM_T_82576) || (sc-sc_type == WM_T_82580))
+		size = WM_RAL_TABSIZE_82576;
+	else if (sc-sc_type == WM_T_I350)
+		size = WM_RAL_TABSIZE_I350;
 	else
 		size = WM_RAL_TABSIZE;
 	wm_set_ral(sc, CLLADDR(ifp-if_sadl), 0);

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.48 src/sys/dev/pci/if_wmreg.h:1.49
--- src/sys/dev/pci/if_wmreg.h:1.48	Wed Aug 29 20:39:24 2012
+++ src/sys/dev/pci/if_wmreg.h	Thu Feb  7 15:38:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.48 2012/08/29 20:39:24 bouyer Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.49 2013/02/07 15:38:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -420,8 +420,11 @@ struct livengood_tcpip_ctxdesc {
 #define	RAL_RDR1	(1U  30)	/* put packet in alt. rx ring */
 #define	RAL_AV		(1U  31)	/* entry is valid */
 
-#define	WM_RAL_TABSIZE	16
-#define	WM_ICH8_RAL_TABSIZE 7
+#define	WM_RAL_TABSIZE		15	/* RAL size for old devices */
+#define	WM_RAL_TABSIZE_ICH8	7	/* RAL size for ICH* and PCH* */
+#define	WM_RAL_TABSIZE_82575	16	/* RAL size for 82575 */
+#define	WM_RAL_TABSIZE_82576	24	/* RAL size for 82576 and 82580 */
+#define	WM_RAL_TABSIZE_I350	32	/* RAL size for I350 */
 
 #define	WMREG_ICR	0x00c0	/* Interrupt Cause Register */
 #define	ICR_TXDW	(1U  0)	/* Tx desc written back */



CVS commit: src/sys/arch/sparc/dev

2013-02-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  7 16:14:30 UTC 2013

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
- implement buttom-up copies in cg14_bitblt() so scrolling down works now
- use more registers when copying
- use hardware to draw the cursor
- use putchar() for horizontal scrolling since byte-wise overlapping copy
  ops wouldn't be any faster anyway


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc/dev/cgfourteen.c

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

Modified files:

Index: src/sys/arch/sparc/dev/cgfourteen.c
diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.70 src/sys/arch/sparc/dev/cgfourteen.c:1.71
--- src/sys/arch/sparc/dev/cgfourteen.c:1.70	Wed Feb  6 04:10:54 2013
+++ src/sys/arch/sparc/dev/cgfourteen.c	Thu Feb  7 16:14:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.70 2013/02/06 04:10:54 macallan Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.71 2013/02/07 16:14:30 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -151,12 +151,13 @@ static int  cg14_do_cursor(struct cgfour
 #if NSX  0
 static void cg14_wait_idle(struct cgfourteen_softc *);
 static void cg14_rectfill(struct cgfourteen_softc *, int, int, int, int, uint32_t);
+static void cg14_invert(struct cgfourteen_softc *, int, int, int, int);
 static void cg14_bitblt(void *, int, int, int, int, int, int, int);
 
 #if 0
-static void cg14_cursor(void *, int, int, int);
 static void cg14_putchar_aa(void *, int, int, u_int, long);
 #endif
+static void cg14_cursor(void *, int, int, int);
 static void cg14_putchar(void *, int, int, u_int, long);
 static void cg14_copycols(void *, int, int, int, int);
 static void cg14_erasecols(void *, int, int, int, long);
@@ -360,14 +361,13 @@ cgfourteenattach(device_t parent, device
 		sc-sc_fbaddr, 0, 0, 0)  0xf000;
 		aprint_normal_dev(sc-sc_dev, using %s\n, 
 		device_xname(sc-sc_sx-sc_dev));
-		aprint_normal_dev(sc-sc_dev, fb paddr: %08x\n,
+		aprint_debug_dev(sc-sc_dev, fb paddr: %08x\n,
 		sc-sc_fb_paddr);
-#if 0
 		sx_write(sc-sc_sx, SX_PAGE_BOUND_LOWER, sc-sc_fb_paddr);
 		sx_write(sc-sc_sx, SX_PAGE_BOUND_UPPER,
 		sc-sc_fb_paddr + 0x03ff);
-#endif
 	}
+	cg14_wait_idle(sc);
 #endif
 	cg14_setup_wsdisplay(sc, isconsole);
 #endif
@@ -1012,7 +1012,13 @@ cg14_init_screen(void *cookie, struct vc
 
 	ri-ri_bits = (char *)sc-sc_fb.fb_pixels;
 #if NSX  0
-	if (sc-sc_sx == NULL)
+	/*
+	 * unaligned copies with horizontal overlap are slow, so don't bother
+	 * handling them in cg14_bitblt() and use putchar() instead
+	 */
+	if (sc-sc_sx != NULL) {
+		scr-scr_flags |= VCONS_NO_COPYCOLS;
+	} else
 #endif
 	scr-scr_flags |= VCONS_DONT_READ;
 
@@ -1034,8 +1040,8 @@ cg14_init_screen(void *cookie, struct vc
 		ri-ri_ops.copycols = cg14_copycols;
 		ri-ri_ops.eraserows = cg14_eraserows;
 		ri-ri_ops.erasecols = cg14_erasecols;
-#if 0
 		ri-ri_ops.cursor = cg14_cursor;
+#if 0
 		if (FONT_IS_ALPHA(ri-ri_font)) {
 			ri-ri_ops.putchar = cg14_putchar_aa;
 		} else
@@ -1184,25 +1190,112 @@ cg14_rectfill(struct cgfourteen_softc *s
  uint32_t colour)
 {
 	uint32_t addr, pptr;
-	int line, cnt;
+	int line, cnt, pre, words;
 	int stride = sc-sc_fb.fb_type.fb_width;
 
 	addr = sc-sc_fb_paddr + x + stride * y;
 	sx_write(sc-sc_sx, SX_QUEUED(8), colour);
 	sx_write(sc-sc_sx, SX_QUEUED(9), colour);
+	/*
+	 * Calculate the number of pixels we need to do one by one
+	 * until we're 32bit aligned, then do the rest in 32bit
+	 * mode. Assumes that stride is always a multiple of 4. 
+	 */ 
+	pre = addr  3;
+	if (pre != 0) pre = 4 - pre;
 	for (line = 0; line  he; line++) {
 		pptr = addr;
 		cnt = wi;
-		while(cnt  32) {
-			sta(pptr, ASI_SX, SX_STBS(8, 31, pptr  7));
-			pptr += 32;
-			cnt -= 32;
+		if (pre) {
+			sta(pptr, ASI_SX, SX_STBS(8, pre - 1, pptr  7));
+			pptr += pre;
+			cnt -= pre;
 		}
+		/* now do the aligned pixels in 32bit chunks */
+		while(cnt  31) {
+			words = min(32, cnt  2);
+			sta(pptr, ASI_SX, SX_STS(8, words - 1, pptr  7));
+			pptr += words  2;
+			cnt -= words  2;
+		}
+		/* do any remaining pixels byte-wise again */
 		if (cnt  0)
 			sta(pptr, ASI_SX, SX_STBS(8, cnt - 1, pptr  7));
 		addr += stride;
 	}
-	cg14_wait_idle(sc);
+}
+
+static void
+cg14_invert(struct cgfourteen_softc *sc, int x, int y, int wi, int he)
+{
+	uint32_t addr, pptr;
+	int line, cnt, pre, words;
+	int stride = sc-sc_fb.fb_type.fb_width;
+
+	addr = sc-sc_fb_paddr + x + stride * y;
+	sx_write(sc-sc_sx, SX_ROP_CONTROL, 0x33); /* ~src a */
+	/*
+	 * Calculate the number of pixels we need to do one by one
+	 * until we're 32bit aligned, then do the rest in 32bit
+	 * mode. Assumes that stride is always a multiple of 4. 
+	 */ 
+	pre = addr  3;
+	if (pre != 0) pre = 4 - pre;
+	for (line = 0; line  he; line++) {
+		pptr = addr;
+		cnt = wi;
+		if (pre) {
+			sta(pptr, ASI_SX, SX_LDB(8, pre - 1, pptr  7));
+			sx_write(sc-sc_sx, SX_INSTRUCTIONS,
+			  

CVS commit: src/sys/arch/sparc/conf

2013-02-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  7 16:19:16 UTC 2013

Modified Files:
src/sys/arch/sparc/conf: GENERIC INSTALL

Log Message:
add sx at mainbus


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/sparc/conf/INSTALL

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

Modified files:

Index: src/sys/arch/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.235 src/sys/arch/sparc/conf/GENERIC:1.236
--- src/sys/arch/sparc/conf/GENERIC:1.235	Wed Oct 17 14:48:17 2012
+++ src/sys/arch/sparc/conf/GENERIC	Thu Feb  7 16:19:15 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.235 2012/10/17 14:48:17 apb Exp $
+# $NetBSD: GENERIC,v 1.236 2013/02/07 16:19:15 macallan Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	arch/sparc/conf/std.sparc
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.235 $
+#ident 		GENERIC-$Revision: 1.236 $
 
 maxusers	32
 
@@ -261,6 +261,9 @@ cpuunit0	at mainbus0			# sun4d
 cpuunit*	at mainbus0			# sun4d
 cpu0	at cpuunit0# sun4d
 
+ SX rendering engine found in SS20 and SS10SX
+sx0	at mainbus0
+
  Bus types found on SPARC systems.
 
 sbus0	at mainbus0# sun4c

Index: src/sys/arch/sparc/conf/INSTALL
diff -u src/sys/arch/sparc/conf/INSTALL:1.83 src/sys/arch/sparc/conf/INSTALL:1.84
--- src/sys/arch/sparc/conf/INSTALL:1.83	Fri Aug 17 20:11:41 2012
+++ src/sys/arch/sparc/conf/INSTALL	Thu Feb  7 16:19:16 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.83 2012/08/17 20:11:41 abs Exp $
+#	$NetBSD: INSTALL,v 1.84 2013/02/07 16:19:16 macallan Exp $
 #
 # from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
 #
@@ -212,6 +212,9 @@ options 	INET		# IP (Internet Protocol) 
 mainbus0 at root
 cpu0	at mainbus0
 
+ SX rendering engine found in SS20 and SS10SX
+sx0	at mainbus0
+
  Bus types found on SPARC systems.
 
 sbus0	at mainbus0# sun4c



CVS commit: src/doc

2013-02-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  7 16:22:16 UTC 2013

Modified Files:
src/doc: CHANGES

Log Message:
mention hardware acceleration for cgfourteen/sx


To generate a diff of this commit:
cvs rdiff -u -r1.1788 -r1.1789 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.1788 src/doc/CHANGES:1.1789
--- src/doc/CHANGES:1.1788	Tue Feb  5 21:35:18 2013
+++ src/doc/CHANGES	Thu Feb  7 16:22:16 2013
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1788 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1789 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -186,3 +186,5 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	makefs(8): Add support for msdos, creating filesystems at an offset,
 	merging directories with common files.  [christos 20130202]
 	openssl: update to 1.0.1d [christos 20130205]
+	sparc: Add hardware acceleration for cgfourteen(4) using SX
+		[macallan 20130207]



CVS commit: src/distrib/sets

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 16:27:41 UTC 2013

Modified Files:
src/distrib/sets: maketars

Log Message:
We always have a valid mtree file, so always specify -M


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/distrib/sets/maketars

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

Modified files:

Index: src/distrib/sets/maketars
diff -u src/distrib/sets/maketars:1.79 src/distrib/sets/maketars:1.80
--- src/distrib/sets/maketars:1.79	Wed Feb  6 20:24:04 2013
+++ src/distrib/sets/maketars	Thu Feb  7 11:27:41 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.79 2013/02/07 01:24:04 christos Exp $
+# $NetBSD: maketars,v 1.80 2013/02/07 16:27:41 christos Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -195,8 +195,8 @@ fi
 runpax() {
 	local s=$1
 	shift
-	(cd ${dest}  cut -d   -f 1 ${setlistdir}/set.${s} | 
-	${PAX} -dOw -N${etcdir} ${metalog:+-M} $@)
+	(cd ${dest}  
+	${PAX} -dOw -N${etcdir} -M $@  ${setlistdir}/set.${s})
 }
 
 #



CVS commit: src/distrib/sets/lists/comp

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 16:54:54 UTC 2013

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
new man page


To generate a diff of this commit:
cvs rdiff -u -r1.1799 -r1.1800 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1799 src/distrib/sets/lists/comp/mi:1.1800
--- src/distrib/sets/lists/comp/mi:1.1799	Thu Jan 31 15:57:58 2013
+++ src/distrib/sets/lists/comp/mi	Thu Feb  7 11:54:53 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1799 2013/01/31 20:57:58 riastradh Exp $
+#	$NetBSD: mi,v 1.1800 2013/02/07 16:54:53 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3885,6 +3885,7 @@
 ./usr/share/man/cat3/EVP_OpenInit.0		comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/EVP_PKEY_new.0		comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/EVP_PKEY_set1_RSA.0	comp-c-catman		crypto,.cat
+./usr/share/man/cat3/EVP_PKEY_verify_recover.0	comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/EVP_SealInit.0		comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/EVP_SignInit.0		comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/EVP_VerifyInit.0		comp-c-catman		crypto,.cat
@@ -10423,6 +10424,7 @@
 ./usr/share/man/html3/EVP_OpenInit.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/EVP_PKEY_new.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/EVP_PKEY_set1_RSA.html	comp-c-htmlman		crypto,html
+./usr/share/man/html3/EVP_PKEY_verify_recover.html	comp-c-htmlman	crypto,html
 ./usr/share/man/html3/EVP_SealInit.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/EVP_SignInit.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/EVP_VerifyInit.html	comp-c-htmlman		crypto,html
@@ -16759,6 +16761,7 @@
 ./usr/share/man/man3/EVP_OpenInit.3		comp-c-man		crypto,.man
 ./usr/share/man/man3/EVP_PKEY_new.3		comp-c-man		crypto,.man
 ./usr/share/man/man3/EVP_PKEY_set1_RSA.3	comp-c-man		crypto,.man
+./usr/share/man/man3/EVP_PKEY_verify_recover.3	comp-c-man		crypto,.man
 ./usr/share/man/man3/EVP_SealInit.3		comp-c-man		crypto,.man
 ./usr/share/man/man3/EVP_SignInit.3		comp-c-man		crypto,.man
 ./usr/share/man/man3/EVP_VerifyInit.3		comp-c-man		crypto,.man



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/man

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 17:30:08 UTC 2013

Added Files:
src/crypto/external/bsd/openssl/lib/libcrypto/man:
EVP_PKEY_verify_recover.3

Log Message:
commit the new man page.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/openssl/lib/libcrypto/man/EVP_PKEY_verify_recover.3

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

Added files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/man/EVP_PKEY_verify_recover.3
diff -u /dev/null src/crypto/external/bsd/openssl/lib/libcrypto/man/EVP_PKEY_verify_recover.3:1.1
--- /dev/null	Thu Feb  7 12:30:08 2013
+++ src/crypto/external/bsd/openssl/lib/libcrypto/man/EVP_PKEY_verify_recover.3	Thu Feb  7 12:30:08 2013
@@ -0,0 +1,230 @@
+.\	$NetBSD: EVP_PKEY_verify_recover.3,v 1.1 2013/02/07 17:30:08 christos Exp $
+.\
+.\ Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20)
+.\
+.\ Standard preamble:
+.\ 
+.de Sp \ Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \ Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \ End verbatim text
+.ft R
+.fi
+..
+.\ Set up some character translations and predefined strings.  \*(-- will
+.\ give an unbreakable dash, \*(PI will give pi, \*(L will give a left
+.\ double quote, and \*(R will give a right double quote.  \*(C+ will
+.\ give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\ therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\ nothing in troff, for use with C.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.ds -- \(*W-
+.ds PI pi
+.if (\n(.H=4u)(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\ diablo 10 pitch
+.if (\n(.H=4u)(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\  diablo 12 pitch
+.ds L 
+.ds R 
+.ds C` 
+.ds C' 
+'br\}
+.el\{\
+.ds -- \|\(em\|
+.ds PI \(*p
+.ds L ``
+.ds R ''
+'br\}
+.\
+.\ Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el   .ds Aq '
+.\
+.\ If the F register is turned on, we'll generate index entries on stderr for
+.\ titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\ entries marked with X in POD.  Of course, you'll have to process the
+.\ output yourself in some meaningful fashion.
+.ie \nF \{\
+.de IX
+.tm Index:\\$1\t\\n%\t\\$2
+..
+.nr % 0
+.rr F
+.\}
+.el \{\
+.de IX
+..
+.\}
+.\
+.\ Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\ Fear.  Run.  Save yourself.  No user-serviceable parts.
+.\ fudge factors for nroff and troff
+.if n \{\
+.ds #H 0
+.ds #V .8m
+.ds #F .3m
+.ds #[ \f1
+.ds #] \fP
+.\}
+.if t \{\
+.ds #H ((1u-(n(.fu%2u))*.13m)
+.ds #V .6m
+.ds #F 0
+.ds #[ \
+.ds #] \
+.\}
+.\ simple accents for nroff and troff
+.if n \{\
+.ds ' \
+.ds ` \
+.ds ^ \
+.ds , \
+.ds ~ ~
+.ds /
+.\}
+.if t \{\
+.ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h|\\n:u
+.ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.\ troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.\ corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.\ for low resolution devices (crt and lpr)
+.if \n(.H23 .if \n(.V19 \
+\{\
+.ds : e
+.ds 8 ss
+.ds o a
+.ds d- d\h'-1'\(ga
+.ds D- D\h'-1'\(hy
+.ds th \o'bp'
+.ds Th \o'LP'
+.ds ae ae
+.ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\ 
+.\
+.IX Title EVP_PKEY_verify_recover 3
+.TH EVP_PKEY_verify_recover 3 2013-02-05 1.0.1d OpenSSL
+.\ For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\ way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH NAME
+EVP_PKEY_verify_recover_init, EVP_PKEY_verify_recover \- recover signature using a public key algorithm
+.SH LIBRARY
+libcrypto, -lcrypto
+.SH SYNOPSIS
+.IX Header SYNOPSIS
+.Vb 1
+\ #include 

CVS commit: src/sys/sys

2013-02-07 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Feb  7 18:53:35 UTC 2013

Modified Files:
src/sys/sys: cdefs_elf.h

Log Message:
Remove spurious \ from last line of __link_set_decl macro.

The next line is blank, so this was not actually causing a problem.
But, removing that blank line would lead to odd lossage.

(From Richard Hansen of BBN.)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/sys/cdefs_elf.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/sys/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.42 src/sys/sys/cdefs_elf.h:1.43
--- src/sys/sys/cdefs_elf.h:1.42	Sat Feb  2 17:58:11 2013
+++ src/sys/sys/cdefs_elf.h	Thu Feb  7 18:53:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.42 2013/02/02 17:58:11 matt Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.43 2013/02/07 18:53:34 gdt Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -154,7 +154,7 @@
 
 #define	__link_set_decl(set, ptype)	\
 	extern ptype * const __start_link_set_##set[] __dso_hidden;	\
-	extern ptype * const __stop_link_set_##set[] __dso_hidden	\
+	extern ptype * const __stop_link_set_##set[] __dso_hidden
 
 #define	__link_set_start(set)	(__start_link_set_##set)
 #define	__link_set_end(set)	(__stop_link_set_##set)



CVS commit: src/etc/rc.d

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 19:32:19 UTC 2013

Modified Files:
src/etc/rc.d: sshd

Log Message:
PR/47540: Felix Deichmann: DSA keys can only be 1024 bits.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/etc/rc.d/sshd

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

Modified files:

Index: src/etc/rc.d/sshd
diff -u src/etc/rc.d/sshd:1.21 src/etc/rc.d/sshd:1.22
--- src/etc/rc.d/sshd:1.21	Sun Jul 24 23:04:23 2011
+++ src/etc/rc.d/sshd	Thu Feb  7 14:32:19 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.21 2011/07/25 03:04:23 christos Exp $
+# $NetBSD: sshd,v 1.22 2013/02/07 19:32:19 christos Exp $
 #
 
 # PROVIDE: sshd
@@ -33,7 +33,7 @@ sshd_keygen()
 		in /etc/ssh/ssh_host_dsa_key
 		echo Skipping protocol version 2 DSA Key Generation
 	else
-		/usr/bin/ssh-keygen -t dsa ${ssh_keygen_flags} \
+		/usr/bin/ssh-keygen -t dsa -b 1024 \
 		-f /etc/ssh/ssh_host_dsa_key -N ''
 	fi
 



CVS commit: src/lib/libcompat

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 20:15:07 UTC 2013

Modified Files:
src/lib/libcompat: Makefile
Removed Files:
src/lib/libcompat/regexp: regerror.c

Log Message:
Don't provide 2 versions of __compat_regerror() (the other one comes
from 4.3/regex.c via symbol renaming). Anyway this one did nada, so
no great loss :-)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcompat/Makefile
cvs rdiff -u -r1.9 -r0 src/lib/libcompat/regexp/regerror.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/libcompat/Makefile
diff -u src/lib/libcompat/Makefile:1.31 src/lib/libcompat/Makefile:1.32
--- src/lib/libcompat/Makefile:1.31	Wed Mar 21 06:08:30 2012
+++ src/lib/libcompat/Makefile	Thu Feb  7 15:15:07 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2012/03/21 10:08:30 matt Exp $
+#	$NetBSD: Makefile,v 1.32 2013/02/07 20:15:07 christos Exp $
 
 .include bsd.own.mk
 
@@ -46,7 +46,7 @@ MAN+=	cuserid.3
 
 
 # regexp sources
-SRCS+=	regerror.c regexp.c regsub.c
+SRCS+=	regexp.c regsub.c
 MAN+=	regexp.3
 
 .include bsd.lib.mk



CVS commit: src/tools/compat

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 20:30:29 UTC 2013

Added Files:
src/tools/compat: rmd160.h sha1.h sha2.h

Log Message:
add shaX and rmd160 headers, same as mdX


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.4 src/tools/compat/rmd160.h
cvs rdiff -u -r0 -r1.5 src/tools/compat/sha1.h
cvs rdiff -u -r0 -r1.1 src/tools/compat/sha2.h

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

Added files:

Index: src/tools/compat/rmd160.h
diff -u /dev/null src/tools/compat/rmd160.h:1.4
--- /dev/null	Thu Feb  7 15:30:29 2013
+++ src/tools/compat/rmd160.h	Thu Feb  7 15:30:29 2013
@@ -0,0 +1,5 @@
+/*	$NetBSD: rmd160.h,v 1.4 2013/02/07 20:30:29 christos Exp $	*/
+
+/* We unconditionally use the NetBSD rmd160 in libnbcompat. */
+#include nbtool_config.h
+#include ../../sys/sys/rmd160.h

Index: src/tools/compat/sha1.h
diff -u /dev/null src/tools/compat/sha1.h:1.5
--- /dev/null	Thu Feb  7 15:30:29 2013
+++ src/tools/compat/sha1.h	Thu Feb  7 15:30:29 2013
@@ -0,0 +1,5 @@
+/*	$NetBSD: sha1.h,v 1.5 2013/02/07 20:30:29 christos Exp $	*/
+
+/* We unconditionally use the NetBSD sha1 in libnbcompat. */
+#include nbtool_config.h
+#include ../../sys/sys/sha1.h

Index: src/tools/compat/sha2.h
diff -u /dev/null src/tools/compat/sha2.h:1.1
--- /dev/null	Thu Feb  7 15:30:29 2013
+++ src/tools/compat/sha2.h	Thu Feb  7 15:30:29 2013
@@ -0,0 +1,5 @@
+/*	$NetBSD: sha2.h,v 1.1 2013/02/07 20:30:29 christos Exp $	*/
+
+/* We unconditionally use the NetBSD sha2 in libnbcompat. */
+#include nbtool_config.h
+#include ../../sys/sys/md5.h



CVS commit: src/tools/compat

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  7 20:31:52 UTC 2013

Modified Files:
src/tools/compat: sha2.h

Log Message:
yes, but include the right file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tools/compat/sha2.h

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

Modified files:

Index: src/tools/compat/sha2.h
diff -u src/tools/compat/sha2.h:1.1 src/tools/compat/sha2.h:1.2
--- src/tools/compat/sha2.h:1.1	Thu Feb  7 15:30:29 2013
+++ src/tools/compat/sha2.h	Thu Feb  7 15:31:52 2013
@@ -1,5 +1,5 @@
-/*	$NetBSD: sha2.h,v 1.1 2013/02/07 20:30:29 christos Exp $	*/
+/*	$NetBSD: sha2.h,v 1.2 2013/02/07 20:31:52 christos Exp $	*/
 
 /* We unconditionally use the NetBSD sha2 in libnbcompat. */
 #include nbtool_config.h
-#include ../../sys/sys/md5.h
+#include ../../sys/sys/sha2.h



CVS commit: src/sys/arch/evbarm/stand/bootimx23

2013-02-07 Thread Jochen Kunz
Module Name:src
Committed By:   jkunz
Date:   Thu Feb  7 21:56:36 UTC 2013

Modified Files:
src/sys/arch/evbarm/stand/bootimx23: pinctrl_prep.c

Log Message:
Contribution from Petri Laakso:
Enable debug UART input
Fixes issue with some OLinuXino boards which were not able to
accept input from the user.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/stand/bootimx23/pinctrl_prep.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/evbarm/stand/bootimx23/pinctrl_prep.c
diff -u src/sys/arch/evbarm/stand/bootimx23/pinctrl_prep.c:1.2 src/sys/arch/evbarm/stand/bootimx23/pinctrl_prep.c:1.3
--- src/sys/arch/evbarm/stand/bootimx23/pinctrl_prep.c:1.2	Sun Dec 16 19:08:44 2012
+++ src/sys/arch/evbarm/stand/bootimx23/pinctrl_prep.c	Thu Feb  7 21:56:36 2013
@@ -1,4 +1,4 @@
-/* $Id: pinctrl_prep.c,v 1.2 2012/12/16 19:08:44 jkunz Exp $ */
+/* $Id: pinctrl_prep.c,v 1.3 2013/02/07 21:56:36 jkunz Exp $ */
 
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -42,9 +42,10 @@
 static void configure_emi_mux(void);
 static void configure_emi_drive(int);
 static void disable_emi_padkeepers(void);
-static void configure_ssp_mux();
+static void configure_ssp_mux(void);
 static void configure_ssp_drive(int);
 static void configure_ssp_pullups(void);
+static void configure_dbuart_mux(void);
 
 /* EMI pins output drive strengths */
 #define DRIVE_04_MA	0x0	/* 4 mA */
@@ -72,6 +73,9 @@ pinctrl_prep(void)
 	configure_ssp_drive(DRIVE_16_MA);
 	configure_ssp_pullups();
 
+	/* Debug UART. */
+	configure_dbuart_mux();
+
 	return 0;
 }
 
@@ -484,3 +488,19 @@ configure_ssp_pullups(void)
 
 	return;
 }
+
+/*
+ * Configure Debug UART MUX.
+ */
+static
+void configure_dbuart_mux(void)
+{
+	REG_WR(HW_PINCTRL_BASE + HW_PINCTRL_MUXSEL3_CLR,
+	__SHIFTIN(0x3, HW_PINCTRL_MUXSEL3_BANK1_PIN27) |
+	__SHIFTIN(0x3, HW_PINCTRL_MUXSEL3_BANK1_PIN26));
+	REG_WR(HW_PINCTRL_BASE + HW_PINCTRL_MUXSEL3_SET,
+	__SHIFTIN(0x2, HW_PINCTRL_MUXSEL3_BANK1_PIN27) |
+	__SHIFTIN(0x2, HW_PINCTRL_MUXSEL3_BANK1_PIN26));
+
+	return;
+}



CVS commit: src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 01:41:36 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string: memcpy.S

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/memcpy.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/memcpy.S
diff -u src/common/lib/libc/arch/arm/string/memcpy.S:1.2 src/common/lib/libc/arch/arm/string/memcpy.S:1.3
--- src/common/lib/libc/arch/arm/string/memcpy.S:1.2	Wed Dec 12 15:51:09 2012
+++ src/common/lib/libc/arch/arm/string/memcpy.S	Fri Feb  8 01:41:35 2013
@@ -1,6 +1,6 @@
-/*	$NetBSD: memcpy.S,v 1.2 2012/12/12 15:51:09 matt Exp $	*/
+/*	$NetBSD: memcpy.S,v 1.3 2013/02/08 01:41:35 matt Exp $	*/
 
-#if !defined(_ARM_ARCH_DWORK_OK) || defined(_STANDALONE)
+#if !defined(_ARM_ARCH_DWORD_OK) || defined(_STANDALONE)
 #include memcpy_arm.S
 #else
 #include memcpy_xscale.S



CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 01:41:49 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string [matt-nb6-plus]: memcpy.S

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1.54.1 -r1.1.54.2 \
src/common/lib/libc/arch/arm/string/memcpy.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/memcpy.S
diff -u src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.1 src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.2
--- src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.1	Thu Feb  7 07:05:59 2013
+++ src/common/lib/libc/arch/arm/string/memcpy.S	Fri Feb  8 01:41:49 2013
@@ -1,6 +1,6 @@
-/*	$NetBSD: memcpy.S,v 1.1.54.1 2013/02/07 07:05:59 matt Exp $	*/
+/*	$NetBSD: memcpy.S,v 1.1.54.2 2013/02/08 01:41:49 matt Exp $	*/
 
-#if !defined(_ARM_ARCH_DWORK_OK) || defined(_STANDALONE)
+#if !defined(_ARM_ARCH_DWORD_OK) || defined(_STANDALONE)
 #include memcpy_arm.S
 #else
 #include memcpy_xscale.S



CVS commit: src/crypto/external

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  8 01:54:20 UTC 2013

Added Files:
src/crypto/external: Makefile

Log Message:
descend!


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/Makefile

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

Added files:

Index: src/crypto/external/Makefile
diff -u /dev/null src/crypto/external/Makefile:1.1
--- /dev/null	Thu Feb  7 20:54:20 2013
+++ src/crypto/external/Makefile	Thu Feb  7 20:54:20 2013
@@ -0,0 +1,5 @@
+#	$NetBSD: Makefile,v 1.1 2013/02/08 01:54:20 christos Exp $
+
+SUBDIR+= bsd cpl
+
+.include bsd.subdir.mk



CVS commit: src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 02:19:36 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string: strchr_arm.S strrchr_arm.S

Log Message:
Fix corner cases when searching for NUL.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/string/strchr_arm.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/strrchr_arm.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4 src/common/lib/libc/arch/arm/string/strchr_arm.S:1.5
--- src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4	Thu Feb  7 01:20:29 2013
+++ src/common/lib/libc/arch/arm/string/strchr_arm.S	Fri Feb  8 02:19:35 2013
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: strchr_arm.S,v 1.4 2013/02/07 01:20:29 matt Exp $)
+RCSID($NetBSD: strchr_arm.S,v 1.5 2013/02/08 02:19:35 matt Exp $)
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -90,6 +90,8 @@ ENTRY(strchr)
 	 * We've encountered a NUL or a match but we don't know which happened
 	 * first.
 	 */
+	teq	r2, #0			/* searching for NUL? */
+	beq	.Lfind_match		/*   yes, find the match */
 	mvns	ip, ip			/* did we encounter a NUL? */
 	beq	.Lfind_match		/*   no, find the match */
 	bics	r3, r3, ip		/* clear match for the NUL(s) */

Index: src/common/lib/libc/arch/arm/string/strrchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2 src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.3
--- src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2	Mon Jan 28 06:23:14 2013
+++ src/common/lib/libc/arch/arm/string/strrchr_arm.S	Fri Feb  8 02:19:36 2013
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: strrchr_arm.S,v 1.2 2013/01/28 06:23:14 matt Exp $)
+RCSID($NetBSD: strrchr_arm.S,v 1.3 2013/02/08 02:19:36 matt Exp $)
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -47,16 +47,24 @@ RCSID($NetBSD: strrchr_arm.S,v 1.2 2013
 
 	.text
 ENTRY(strrchr)
-	mov	ip, r0			/* we use r0 at the return value */
+	teq	r1, #0			/* searching for NUL? */
+	bne	1f			/*   no, do it the hard way */
+	push	{r0, lr}		/* save pointer and return addr */
+	bl	PLT_SYM(strlen)		/* get length */
+	pop	{r1, lr}		/* restore pointer and returna addr */
+	add	r0, r0, r1		/* add pointer to length */
+	RET/* return */
+
+1:	mov	ip, r0			/* we use r0 at the return value */
 	mov	r0, #0			/* return NULL by default */
 	and	r2, r1, #0xff		/* restrict to byte value */
-1:	tst	ip, #3			/* test for word alignment */
+2:	tst	ip, #3			/* test for word alignment */
 	beq	.Lpre_main_loop		/*   finally word aligned */
 	ldrb	r3, [ip], #1		/* load a byte */
 	cmp	r3, r2			/* did it match? */
 	subeq	r0, ip, #1		/*   yes, remember that it did */
 	teq	r3, #0			/* was it NUL? */
-	bne	1b			/*   no, try next byte */
+	bne	2b			/*   no, try next byte */
 	RET/* return */
 .Lpre_main_loop:
 	push	{r4, r5}		/* save some registers */



CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 02:22:41 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string [matt-nb6-plus]: strchr_arm.S
strrchr_arm.S

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 \
src/common/lib/libc/arch/arm/string/strchr_arm.S
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 \
src/common/lib/libc/arch/arm/string/strrchr_arm.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.2 src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.3
--- src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.2	Thu Feb  7 07:06:00 2013
+++ src/common/lib/libc/arch/arm/string/strchr_arm.S	Fri Feb  8 02:22:41 2013
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: strchr_arm.S,v 1.4.2.2 2013/02/07 07:06:00 matt Exp $)
+RCSID($NetBSD: strchr_arm.S,v 1.4.2.3 2013/02/08 02:22:41 matt Exp $)
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -90,6 +90,8 @@ ENTRY(strchr)
 	 * We've encountered a NUL or a match but we don't know which happened
 	 * first.
 	 */
+	teq	r2, #0			/* searching for NUL? */
+	beq	.Lfind_match		/*   yes, find the match */
 	mvns	ip, ip			/* did we encounter a NUL? */
 	beq	.Lfind_match		/*   no, find the match */
 	bics	r3, r3, ip		/* clear match for the NUL(s) */

Index: src/common/lib/libc/arch/arm/string/strrchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.2 src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.3
--- src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.2	Thu Feb  7 07:06:02 2013
+++ src/common/lib/libc/arch/arm/string/strrchr_arm.S	Fri Feb  8 02:22:41 2013
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: strrchr_arm.S,v 1.2.2.2 2013/02/07 07:06:02 matt Exp $)
+RCSID($NetBSD: strrchr_arm.S,v 1.2.2.3 2013/02/08 02:22:41 matt Exp $)
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -47,16 +47,24 @@ RCSID($NetBSD: strrchr_arm.S,v 1.2.2.2 
 
 	.text
 ENTRY(strrchr)
-	mov	ip, r0			/* we use r0 at the return value */
+	teq	r1, #0			/* searching for NUL? */
+	bne	1f			/*   no, do it the hard way */
+	push	{r0, lr}		/* save pointer and return addr */
+	bl	PLT_SYM(strlen)		/* get length */
+	pop	{r1, lr}		/* restore pointer and returna addr */
+	add	r0, r0, r1		/* add pointer to length */
+	RET/* return */
+
+1:	mov	ip, r0			/* we use r0 at the return value */
 	mov	r0, #0			/* return NULL by default */
 	and	r2, r1, #0xff		/* restrict to byte value */
-1:	tst	ip, #3			/* test for word alignment */
+2:	tst	ip, #3			/* test for word alignment */
 	beq	.Lpre_main_loop		/*   finally word aligned */
 	ldrb	r3, [ip], #1		/* load a byte */
 	cmp	r3, r2			/* did it match? */
 	subeq	r0, ip, #1		/*   yes, remember that it did */
 	teq	r3, #0			/* was it NUL? */
-	bne	1b			/*   no, try next byte */
+	bne	2b			/*   no, try next byte */
 	RET/* return */
 .Lpre_main_loop:
 	push	{r4, r5}		/* save some registers */



CVS commit: src/share/mk

2013-02-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  8 02:30:53 UTC 2013

Modified Files:
src/share/mk: bsd.lib.mk

Log Message:
- factor out variables so that the code is more readable, make them conistent
- use _LIB_PREFIX correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/share/mk/bsd.lib.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.326 src/share/mk/bsd.lib.mk:1.327
--- src/share/mk/bsd.lib.mk:1.326	Tue Jan 22 15:43:17 2013
+++ src/share/mk/bsd.lib.mk	Thu Feb  7 21:30:53 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.326 2013/01/22 20:43:17 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.327 2013/02/08 02:30:53 christos Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include bsd.init.mk
@@ -64,7 +64,7 @@ LIBDO.${_lib}!=	cd ${_dir}  ${PRINTO
 LDADD+=		-l${_lib}
 .else
 LDADD+=		-L${LIBDO.${_lib}} -l${_lib}
-DPADD+=		${LIBDO.${_lib}}/lib${_lib}.so
+DPADD+=		${LIBDO.${_lib}}/lib${_lib}.so	# Don't use _LIB_PREFIX
 .endif
 .endfor
 .endif	# }
@@ -86,7 +86,7 @@ checkver:
 	@(cd ${.CURDIR}  \
 	HOST_SH=${HOST_SH:Q} AWK=${TOOL_AWK:Q} \
 	${HOST_SH} ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
-		-d ${DESTDIR}${_LIBSODIR} ${LIB})
+		-d ${_DEST.OBJ} ${LIB})
 .endif
 .endif	# }
 
@@ -201,7 +201,7 @@ MKSHLIBOBJS= no
 
 # Platform-independent linker flags for ELF shared libraries
 SHLIB_SOVERSION=	${SHLIB_MAJOR}
-SHLIB_SHFLAGS=		-Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
+SHLIB_SHFLAGS=		-Wl,-soname,${_LIB}.so.${SHLIB_SOVERSION}
 SHLIB_SHFLAGS+=		-Wl,--warn-shared-textrel
 SHLIB_LDSTARTFILE?=	${_GCC_CRTI} ${_GCC_CRTBEGINS}
 SHLIB_LDENDFILE?=	${_GCC_CRTENDS} ${_GCC_CRTN}
@@ -392,10 +392,32 @@ CTFFLAGS+=	-g
 	${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 
+# Declare a few variables to make our life easier later.
+_LIB:=${_LIB_PREFIX}${LIB}
+_LIB.a:=${_LIB}.a
+_LIB_p.a:=${_LIB}_p.a
+_LIB_g.a:=${_LIB}_g.a
+_LIB_pic.a:=${_LIB}_pic.a
+_LIB.ln:=llib-l${LIB}.ln
+
+.if ${MKPIC} != no  defined(SHLIB_FULLVERSION)
+_LIB.so:=${_LIB}.so
+_LIB.so.major:=${_LIB}.so.${SHLIB_MAJOR}
+_LIB.so.full:=${_LIB}.so.${SHLIB_FULLVERSION}
+.if ${MKDEBUG} != no
+_LIB.so.debug:=${_LIB.so.full}.debug
+.endif
+.endif
+
+_DEST.LIB:=${DESTDIR}${LIBDIR}
+_DEST.OBJ:=${DESTDIR}${_LIBSODIR}
+_DEST.LINT:=${DESTDIR}${LINTLIBDIR}
+_DEST.DEBUG:=${DESTDIR}${DEBUGDIR}${LIBDIR}
+
 .if defined(LIB)			# {
 .if (${MKPIC} == no || (defined(LDSTATIC)  ${LDSTATIC} != ) \
 	|| ${MKLINKLIB} != no)  ${MKSTATICLIB} != no
-_LIBS=lib${LIB}.a
+_LIBS=${_LIB.a}
 .else
 _LIBS=
 .endif
@@ -414,18 +436,18 @@ OBJS+=  	${f:R:S/$/.o/}
 .endfor
 
 .if !empty(COMBINESRCS)
-OBJS+=		lib${LIB}_combine.o
-lib${LIB}_combine.o: ${COMBINESRCS}
+OBJS+=		${_LIB}_combine.o
+${_LIB}_combine.o: ${COMBINESRCS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} -MD --combine ${.ALLSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
 	${OBJCOPY} -x ${.TARGET}
 .endif
 
-CLEANFILES+=	lib${LIB}_combine.d
+CLEANFILES+=	${_LIB}_combine.d
 
-.if exists(lib${LIB}_combine.d)
-.include lib${LIB}_combine.d
+.if exists(${_LIB}_combine.d)
+.include ${_LIB}_combine.d
 .endif
 .endif   # empty(XSRCS.${LIB})
 .else			# } {
@@ -442,13 +464,13 @@ libinstall::
 .endif
 
 .if ${MKDEBUGLIB} != no
-_LIBS+=lib${LIB}_g.a
+_LIBS+=${_LIB_g.a}
 GOBJS+=${OBJS:.o=.go}
 DEBUGFLAGS?=-DDEBUG
 .endif
 
 .if ${MKPROFILE} != no
-_LIBS+=lib${LIB}_p.a
+_LIBS+=${_LIB_p.a}
 POBJS+=${OBJS:.o=.po}
 PROFFLAGS?=-DGPROF -DPROF
 .endif
@@ -459,27 +481,23 @@ PROFFLAGS?=-DGPROF -DPROF
 # make _pic.a, which isn't really pic,
 # since it's needed for making shared lib.
 # but don't install it.
-SOLIB=lib${LIB}_pic.a
+SOLIB=${_LIB_pic.a}
 SOBJS+=${OBJS:.o=.pico}
 .else
-SOLIB=lib${LIB}.a
+SOLIB=${_LIB.a}
 .endif
 .else
-SOLIB=lib${LIB}_pic.a
+SOLIB=${_LIB_pic.a}
 _LIBS+=${SOLIB}
 SOBJS+=${OBJS:.o=.pico}
 .endif
 .if defined(SHLIB_FULLVERSION)
-_LIB.so:=lib${LIB}.so.${SHLIB_FULLVERSION}
-.if ${MKDEBUG} != no
-_LIB.debug:=${_LIB.so}.debug
-.endif
-_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+_LIBS+=${_LIB.so.full}
 .endif
 .endif	# }
 
 .if ${MKLINT} != no  !empty(LOBJS)
-_LIBS+=llib-l${LIB}.ln
+_LIBS+=${_LIB.ln}
 .endif
 
 ALLOBJS=
@@ -500,7 +518,7 @@ _YLSRCS=	${SRCS:M*.[ly]:C/\..$/.c/} ${YH
 
 .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
 
-realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.debug}
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.so.debug}
 
 MKARZERO?=no
 
@@ -539,13 +557,13 @@ CLEANFILES+=	${_YLSRCS}
 
 ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
 
-lib${LIB}.a:: ${STOBJS} __archivebuild
+${_LIB.a}:: ${STOBJS} __archivebuild
 
-lib${LIB}_p.a:: ${POBJS} __archivebuild
+${_LIB_p.a}:: ${POBJS} __archivebuild
 
-lib${LIB}_pic.a:: ${SOBJS} 

CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 03:05:44 UTC 2013

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc: ppccpuid.S

Log Message:
Change  bclr 14,2 to beqlr


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S:1.6
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S:1.5	Tue Feb  5 19:21:27 2013
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/ppccpuid.S	Fri Feb  8 03:05:43 2013
@@ -89,7 +89,7 @@ OPENSSL_cleanse:
 	li	0,0
 	bge	.Lot
 	cmplwi	4,0
-	bclr	14,2
+	beqlr
 .Little:	mtctr	4
 	stb	0,0(3)
 	addi	3,3,1



CVS commit: src/sbin/atactl

2013-02-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Feb  8 03:58:36 UTC 2013

Modified Files:
src/sbin/atactl: atactl.c

Log Message:
Decode 6Gbps signaling SATA capability in IDENTIFY DEVICE data.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/atactl/atactl.c

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

Modified files:

Index: src/sbin/atactl/atactl.c
diff -u src/sbin/atactl/atactl.c:1.68 src/sbin/atactl/atactl.c:1.69
--- src/sbin/atactl/atactl.c:1.68	Wed Jan  9 21:58:23 2013
+++ src/sbin/atactl/atactl.c	Fri Feb  8 03:58:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atactl.c,v 1.68 2013/01/09 21:58:23 riastradh Exp $	*/
+/*	$NetBSD: atactl.c,v 1.69 2013/02/08 03:58:36 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: atactl.c,v 1.68 2013/01/09 21:58:23 riastradh Exp $);
+__RCSID($NetBSD: atactl.c,v 1.69 2013/02/08 03:58:36 jakllsch Exp $);
 #endif
 
 
@@ -239,6 +239,7 @@ static const struct bitinfo ata_cmd_ext[
 static const struct bitinfo ata_sata_caps[] = {
 	{ SATA_SIGNAL_GEN1, 1.5Gb/s signaling },
 	{ SATA_SIGNAL_GEN2, 3.0Gb/s signaling },
+	{ SATA_SIGNAL_GEN3, 6.0Gb/s signaling },
 	{ SATA_NATIVE_CMDQ, Native Command Queuing },
 	{ SATA_HOST_PWR_MGMT, Host-Initiated Interface Power Management },
 	{ SATA_PHY_EVNT_CNT, PHY Event Counters },



CVS commit: src/share/mk

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 04:06:25 UTC 2013

Modified Files:
src/share/mk: bsd.lib.mk

Log Message:
Add missing }


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/share/mk/bsd.lib.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.327 src/share/mk/bsd.lib.mk:1.328
--- src/share/mk/bsd.lib.mk:1.327	Fri Feb  8 02:30:53 2013
+++ src/share/mk/bsd.lib.mk	Fri Feb  8 04:06:25 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.327 2013/02/08 02:30:53 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.328 2013/02/08 04:06:25 matt Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include bsd.init.mk
@@ -613,7 +613,7 @@ ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPL
 	${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
 	${_LDFLAGS.${_LIB}} -o ${.TARGET} ${_LIBLDOPTS} \
 	-Wl,--whole-archive ${SOLIB} \
-	-Wl,--no-whole-archive ${_LDADD.${_LIB}
+	-Wl,--no-whole-archive ${_LDADD.${_LIB}}
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX



CVS commit: src/distrib/sets/lists/debug

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 04:36:35 UTC 2013

Modified Files:
src/distrib/sets/lists/debug: shl.mi

Log Message:
Add pre-name changed debug libraries as obsolete.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.6 src/distrib/sets/lists/debug/shl.mi:1.7
--- src/distrib/sets/lists/debug/shl.mi:1.6	Fri Feb  8 02:32:35 2013
+++ src/distrib/sets/lists/debug/shl.mi	Fri Feb  8 04:36:35 2013
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.6 2013/02/08 02:32:35 christos Exp $
+# $NetBSD: shl.mi,v 1.7 2013/02/08 04:36:35 matt Exp $
 ./usr/libdata/debug/usr/lib/i18n/libBIG5.so.5.0.debug	comp-i18n-debug	debug
 ./usr/libdata/debug/usr/lib/i18n/libDECHanyu.so.5.0.debug	comp-i18n-debug	debug
 ./usr/libdata/debug/usr/lib/i18n/libEUC.so.5.0.debug	comp-i18n-debug	debug
@@ -224,8 +224,13 @@
 ./usr/libdata/debug/usr/lib/npf/ext_log.so.0.0.debug	comp-sys-debug	debug,npf
 ./usr/libdata/debug/usr/lib/npf/ext_normalise.so.0.0.debug	comp-sys-debug	debug,npf
 ./usr/libdata/debug/usr/lib/npf/ext_rndblock.so.0.0.debug	comp-sys-debug	debug,npf
+./usr/libdata/debug/usr/lib/npf/libext_log.so.0.0.debug	comp-obsolete	debug,npf,obsolete
+./usr/libdata/debug/usr/lib/npf/libext_normalise.so.0.0.debug	comp-obsolete	debug,npf,obsolete
+./usr/libdata/debug/usr/lib/npf/libext_rndblock.so.0.0.debug	comp-obsolete	debug,npf,obsolete
 ./usr/libdata/debug/usr/tests/lib/csu/h_initfini3_dso.so.1.debug	tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/csu/libh_initfini3_dso.so.1.debug	tests-obsolete		debug,atf,obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/tls/h_tls_dlopen.so.1.debug	tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/tls/libh_tls_dlopen.so.1.debug	tests-obsolete		debug,atf,obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/tls/libh_tls_dynamic.so.1.debug	tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/tls/t_tls_dlopen.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/tls/t_tls_dynamic.debug		tests-lib-debug		debug,atf