CVS commit: src/doc

2012-11-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov  2 06:28:40 UTC 2012

Modified Files:
src/doc: CHANGES.prev

Log Message:
note that sparc64 got pcie/pyro(4) support last november.

XXX: pull up to netbsd-6 doc/CHANGES.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/doc/CHANGES.prev

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.prev
diff -u src/doc/CHANGES.prev:1.117 src/doc/CHANGES.prev:1.118
--- src/doc/CHANGES.prev:1.117	Fri Oct  5 18:36:28 2012
+++ src/doc/CHANGES.prev	Fri Nov  2 06:28:39 2012
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.117 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.118 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -11075,6 +11075,8 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 		need to either add tre.h in /usr/include, or enhance
 		regex.h and provide more tre_ -> libc names aliases.
 		[christos 2005]
+	sparc64: Add support for PCI-E based systems Ultra25/45, pyro(4)
+		ported from OpenBSD.  [mrg 2008]
 	postfix(1): Import version 2.8.7 [tron 2009]
 	asm: Add assembly language examples in share/examples/asm/.
 		These provide the end user with some ready-to-use sample



CVS commit: src/sys/dev/usb

2012-11-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Nov  2 02:30:15 UTC 2012

Modified Files:
src/sys/dev/usb: uftdi.c

Log Message:
match USB_PRODUCT_FTDI_MAXSTREAM_PKG_U


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/uftdi.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/usb/uftdi.c
diff -u src/sys/dev/usb/uftdi.c:1.53 src/sys/dev/usb/uftdi.c:1.54
--- src/sys/dev/usb/uftdi.c:1.53	Sat Aug 11 07:09:09 2012
+++ src/sys/dev/usb/uftdi.c	Fri Nov  2 02:30:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uftdi.c,v 1.53 2012/08/11 07:09:09 riastradh Exp $	*/
+/*	$NetBSD: uftdi.c,v 1.54 2012/11/02 02:30:15 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.53 2012/08/11 07:09:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.54 2012/11/02 02:30:15 jakllsch Exp $");
 
 #include 
 #include 
@@ -151,6 +151,7 @@ static const struct usb_devno uftdi_devs
 	{ USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_634 },
 	{ USB_VENDOR_FTDI, USB_PRODUCT_FTDI_LCD_CFA_635 },
 	{ USB_VENDOR_FTDI, USB_PRODUCT_FTDI_OPENRD_JTAGKEY },
+	{ USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MAXSTREAM_PKG_U },
 	{ USB_VENDOR_xxFTDI, USB_PRODUCT_xxFTDI_SHEEVAPLUG_JTAG },
 	{ USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_VALUECAN },
 	{ USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_NEOVI },



CVS commit: src/usr.bin/flock

2012-11-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Nov  2 02:07:19 UTC 2012

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

Log Message:
Use longer -c description.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/flock/flock.1
cvs rdiff -u -r1.3 -r1.4 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.1
diff -u src/usr.bin/flock/flock.1:1.4 src/usr.bin/flock/flock.1:1.5
--- src/usr.bin/flock/flock.1:1.4	Fri Nov  2 02:03:18 2012
+++ src/usr.bin/flock/flock.1	Fri Nov  2 02:07:19 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: flock.1,v 1.4 2012/11/02 02:03:18 wiz Exp $
+.\"	$NetBSD: flock.1,v 1.5 2012/11/02 02:07:19 wiz Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,7 +39,8 @@
 .Op Fl dnosvx
 .Op Fl w Ar timeout
 .Ar lockfile|lockdir
-.Op Fl c
+.Op Fl c Ar command
+|
 .Op Ar command ...
 .Nm
 .Op Fl dnsuvx

Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.3 src/usr.bin/flock/flock.c:1.4
--- src/usr.bin/flock/flock.c:1.3	Fri Nov  2 02:03:18 2012
+++ src/usr.bin/flock/flock.c	Fri Nov  2 02:07:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: flock.c,v 1.3 2012/11/02 02:03:18 wiz Exp $	*/
+/*	$NetBSD: flock.c,v 1.4 2012/11/02 02:07:19 wiz Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: flock.c,v 1.3 2012/11/02 02:03:18 wiz Exp $");
+__RCSID("$NetBSD: flock.c,v 1.4 2012/11/02 02:07:19 wiz Exp $");
 
 #include 
 #include 
@@ -65,8 +65,8 @@ static sig_atomic_t timeout_expired;
 
 static __dead void usage(void) 
 {
-	fprintf(stderr, "Usage: %s [-dnosvx] [-w timeout] lockfile|lockdir [-c] "
-	"command\n\t%s [-dnsuvx] [-w timeout] lockfd\n", getprogname(),
+	fprintf(stderr, "Usage: %s [-dnosvx] [-w timeout] lockfile|lockdir [-c command]| "
+	"command ...\n\t%s [-dnsuvx] [-w timeout] lockfd\n", getprogname(),
 	getprogname());
 	exit(EXIT_FAILURE);
 }



CVS commit: src/usr.bin/flock

2012-11-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Nov  2 02:03:18 UTC 2012

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

Log Message:
Sort options and their descriptions. Sync usage with man page.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/flock/flock.1
cvs rdiff -u -r1.2 -r1.3 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.1
diff -u src/usr.bin/flock/flock.1:1.3 src/usr.bin/flock/flock.1:1.4
--- src/usr.bin/flock/flock.1:1.3	Fri Nov  2 01:30:46 2012
+++ src/usr.bin/flock/flock.1	Fri Nov  2 02:03:18 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: flock.1,v 1.3 2012/11/02 01:30:46 christos Exp $
+.\"	$NetBSD: flock.1,v 1.4 2012/11/02 02:03:18 wiz Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -29,21 +29,20 @@
 .\"
 .\"
 .Dd November 1, 2012
-.Dt flock 1
+.Dt FLOCK 1
 .Os
 .Sh NAME
 .Nm flock
 .Nd Provide locking API for shell scripts
 .Sh SYNOPSIS
 .Nm
-.Op Fl dnosxv
+.Op Fl dnosvx
 .Op Fl w Ar timeout
 .Ar lockfile|lockdir
-.Op Fl c Ar command
-|
+.Op Fl c
 .Op Ar command ...
 .Nm
-.Op Fl dnusxv
+.Op Fl dnsuvx
 .Op Fl w Ar timeout
 .Ar lockfd
 .Sh DESCRIPTION
@@ -57,44 +56,44 @@ If the file or directory does not exist,
 .Pp
 The second form can use an arbitrary file descriptor that is provided from a
 shell script for example:
-.nf
+.Bd -literal
 (
 	flock -s 100
 	# commands to be executed under the lock
 ) 100> /path/to/lockfile
-.if
+.Ed
 .Pp
 The following options are available:
 .Bl -tag -width "X"
 .It Fl c Ar command
 Pass a command to a the shell.
-.It Fl d Fl Fl debug
+.It Fl d , Fl Fl debug
 Provide debugging output.
-.It Fl s Fl Fl shared
+.It Fl n , Fl Fl nb , Fl Fl nonblock
+Don't block and fail immediately if the lock could not be obtained.
+.It Fl o , Fl Fl close
+Close the file before executing the command.
+This is useful if the child forks and should not be holding the lock.
+.It Fl s , Fl Fl shared
 Obtain a shared lock.
-.It Fl e Fl x Fl Fl exclusive
-Obtain an exclusive lock.
-.It Fl u Fl Fl unlock
+.It Fl u , Fl Fl unlock
 Unlock an existing lock.
 This is available only for a file descriptor.
-.It Fl n Fl Fl nb Fl Fl nonblock
-Don't block and fail immediately if the lock could not be obtained.
-.If Fl v Fl Fl verbose
+.It Fl v , Fl Fl verbose
 On error print an explanation of the failure.
-.It Fl w Fl Fl wait Fl Fl timeout Ar seconds
+.It Fl w , Fl Fl wait , Fl Fl timeout Ar seconds
 Fail if the lock could not be obtained after
 .Ar seconds .
 Seconds are truncated to integer values.
-.It Fl o Fl Fl close
-Close the file before executing the command.
-This is useful if the child forks and should not be holding the lock.
+.It Fl x , Fl Fl exclusive
+Obtain an exclusive lock.
 .El
 .Sh EXIT STATUS
 .Ex -std
 .Sh SEE ALSO
 .Xr flock 2
 .Sh HISTORY
-A
+An
 .Nm
 utility appeared in
-.Nx 7
+.Nx 7.0 .

Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.2 src/usr.bin/flock/flock.c:1.3
--- src/usr.bin/flock/flock.c:1.2	Fri Nov  2 01:30:46 2012
+++ src/usr.bin/flock/flock.c	Fri Nov  2 02:03:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: flock.c,v 1.2 2012/11/02 01:30:46 christos Exp $	*/
+/*	$NetBSD: flock.c,v 1.3 2012/11/02 02:03:18 wiz Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: flock.c,v 1.2 2012/11/02 01:30:46 christos Exp $");
+__RCSID("$NetBSD: flock.c,v 1.3 2012/11/02 02:03:18 wiz Exp $");
 
 #include 
 #include 
@@ -65,8 +65,8 @@ static sig_atomic_t timeout_expired;
 
 static __dead void usage(void) 
 {
-	fprintf(stderr, "Usage: %s [-dnosxv] [-w ] file|directory [-c] "
-	"\n\t%s [-dnusxv] [-w ] fd\n", getprogname(),
+	fprintf(stderr, "Usage: %s [-dnosvx] [-w timeout] lockfile|lockdir [-c] "
+	"command\n\t%s [-dnsuvx] [-w timeout] lockfd\n", getprogname(),
 	getprogname());
 	exit(EXIT_FAILURE);
 }
@@ -121,13 +121,12 @@ main(int argc, char *argv[])
 
 	setprogname(argv[0]);
 
-	while ((c = getopt_long(argc, argv, "+dnosxuw:", flock_longopts, NULL))
+	while ((c = getopt_long(argc, argv, "+dnosuw:x", flock_longopts, NULL))
 	!= -1)
 		switch (c) {
 		case 'd':
 			debug++;
 			break;
-		case 'e':
 		case 'x':
 			lock = LOCK_EX | (lock & ~LOCK_NB);
 			break;



CVS commit: src/usr.bin/flock

2012-11-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov  2 01:30:47 UTC 2012

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

Log Message:
treat a command without -c like an argument vector
default to exclusive lock


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/flock/flock.1
cvs rdiff -u -r1.1 -r1.2 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.1
diff -u src/usr.bin/flock/flock.1:1.2 src/usr.bin/flock/flock.1:1.3
--- src/usr.bin/flock/flock.1:1.2	Thu Nov  1 19:34:44 2012
+++ src/usr.bin/flock/flock.1	Thu Nov  1 21:30:46 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: flock.1,v 1.2 2012/11/01 23:34:44 christos Exp $
+.\"	$NetBSD: flock.1,v 1.3 2012/11/02 01:30:46 christos Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,8 +39,9 @@
 .Op Fl dnosxv
 .Op Fl w Ar timeout
 .Ar lockfile|lockdir
-.Op Fl c
-.Ar command
+.Op Fl c Ar command
+|
+.Op Ar command ...
 .Nm
 .Op Fl dnusxv
 .Op Fl w Ar timeout

Index: src/usr.bin/flock/flock.c
diff -u src/usr.bin/flock/flock.c:1.1 src/usr.bin/flock/flock.c:1.2
--- src/usr.bin/flock/flock.c:1.1	Thu Nov  1 19:30:19 2012
+++ src/usr.bin/flock/flock.c	Thu Nov  1 21:30:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: flock.c,v 1.1 2012/11/01 23:30:19 christos Exp $	*/
+/*	$NetBSD: flock.c,v 1.2 2012/11/02 01:30:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: flock.c,v 1.1 2012/11/01 23:30:19 christos Exp $");
+__RCSID("$NetBSD: flock.c,v 1.2 2012/11/02 01:30:46 christos Exp $");
 
 #include 
 #include 
@@ -61,6 +61,7 @@ struct option flock_longopts[] = {
 };
 
 static int verbose = 0;
+static sig_atomic_t timeout_expired;
 
 static __dead void usage(void) 
 {
@@ -73,11 +74,7 @@ static __dead void usage(void) 
 static __dead void
 sigalrm(int sig)
 {
-	if (verbose) {
-		errno = ETIMEDOUT;
-		errx(EXIT_FAILURE, "");
-	} else
-		exit(EXIT_FAILURE);
+	timeout_expired++;
 }
 
 static const char *
@@ -112,36 +109,36 @@ int
 main(int argc, char *argv[])
 {
 	int c;
-	int lock = 0;
+	int lock = LOCK_EX;
 	double timeout = 0;
 	int cls = 0;
 	int fd = -1;
 	int debug = 0;
-	char *command = NULL;
+	char *mcargv[] = {
+	__UNCONST(_PATH_BSHELL), __UNCONST("-c"), NULL, NULL
+	};
+	char **cmdargv = NULL;
 
 	setprogname(argv[0]);
 
-	while ((c = getopt_long(argc, argv, "c:dnosxuw:", flock_longopts, NULL))
+	while ((c = getopt_long(argc, argv, "+dnosxuw:", flock_longopts, NULL))
 	!= -1)
 		switch (c) {
-		case 'c':
-			command = optarg;
-			break;
 		case 'd':
 			debug++;
 			break;
 		case 'e':
 		case 'x':
-			lock |= LOCK_EX;
+			lock = LOCK_EX | (lock & ~LOCK_NB);
 			break;
 		case 'n':
 			lock |= LOCK_NB;
 			break;
 		case 's':
-			lock |= LOCK_SH;
+			lock = LOCK_SH | (lock & ~LOCK_NB);
 			break;
 		case 'u':
-			lock |= LOCK_UN;
+			lock = LOCK_UN | (lock & ~LOCK_NB);
 			break;
 		case 'w':
 			timeout = strtod(optarg, NULL);
@@ -159,26 +156,37 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (command) {
+	switch (argc) {
+	case 0:
+		usage();
+	case 1:
+		if (cls)
+			usage();
+		fd = strtol(argv[0], NULL, 0);	// XXX: error checking
+		if (debug)
+			fprintf(stderr, "descriptor %s lock %s\n",
+			argv[0], lock2name(lock));
 		if (lock == LOCK_UN)
 			usage();
+	default:
+		if (strcmp(argv[1], "-c") == 0 ||
+		strcmp(argv[1], "--command") == 0) {
+			if (argc == 2)
+usage();
+			mcargv[2] = argv[2];
+			cmdargv = mcargv;
+		} else
+			cmdargv = argv + 1;
+			
 		if ((fd = open(argv[0], O_RDONLY)) == -1) {
 			if (errno != ENOENT || 
 			(fd = open(argv[0], O_RDWR|O_CREAT, 0600)) == -1)
 err(EXIT_FAILURE, "Cannot open `%s'", argv[0]);
 		}
 		if (debug)
-			fprintf(stderr, "file %s lock %s command %s\n",
-			argv[0], lock2name(lock), command);
-
-			
-	} else {
-		if (cls)
-			usage();
-		fd = strtol(argv[0], NULL, 0);	// XXX: error checking
-		if (debug)
-			fprintf(stderr, "descriptor %s lock %s\n",
-			argv[0], lock2name(lock));
+			fprintf(stderr, "file %s lock %s command %s ...\n",
+			argv[0], lock2name(lock), cmdargv[0]);
+		break;
 	}
 
 	if (timeout) {
@@ -188,7 +196,9 @@ main(int argc, char *argv[])
 			fprintf(stderr, "alarm %d\n", (int)timeout);
 	}
 
-	if (flock(fd, lock) == -1) {
+	while (flock(fd, lock) == -1) {
+		if (errno == EINTR && timeout_expired == 0)
+			continue;
 		if (verbose)
 			err(EXIT_FAILURE, "flock(%d, %s)", fd, lock2name(lock));
 		else
@@ -201,11 +211,9 @@ main(int argc, char *argv[])
 	if (cls)
 		(void)close(fd);
 
-	if (command == NULL)
-		return 0;
-	if (debug)
-		fprintf(stderr, "execute %s -c '%s'\n", _PATH_BSHELL, command);
-	execlp(_PATH_BSHELL, "sh", "-c", command, NULL);
-	err(EXIT_FAILURE, "exec %s -c '%s'", _PATH_BSHELL, command);
+	if (cmdargv != NULL) {
+		execvp(

CVS commit: src/sys/dev/usb

2012-11-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Nov  2 00:58:49 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.623 -r1.624 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.624 -r1.625 src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.623 src/sys/dev/usb/usbdevs.h:1.624
--- src/sys/dev/usb/usbdevs.h:1.623	Sat Oct  6 14:38:06 2012
+++ src/sys/dev/usb/usbdevs.h	Fri Nov  2 00:58:48 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.623 2012/10/06 14:38:06 christos Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.624 2012/11/02 00:58:48 jakllsch Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.630 2012/10/06 14:37:41 christos Exp
+ *	NetBSD: usbdevs,v 1.631 2012/11/02 00:57:57 jakllsch Exp
  */
 
 /*
@@ -1473,6 +1473,7 @@
 #define	USB_PRODUCT_FTDI_PS2KBDMS	0x8371		/* PS/2 Keyboard/Mouse */
 #define	USB_PRODUCT_FTDI_SERIAL_8U100AX	0x8372		/* 8U100AX Serial converter */
 #define	USB_PRODUCT_FTDI_OPENRD_JTAGKEY	0x9e90		/* OpenRD JTAGKey FT2232D B */
+#define	USB_PRODUCT_FTDI_MAXSTREAM_PKG_U	0xee18		/* MaxStream PKG-U */
 #define	USB_PRODUCT_FTDI_MHAM_KW	0xeee8		/* KW */
 #define	USB_PRODUCT_FTDI_MHAM_YS	0xeee9		/* YS */
 #define	USB_PRODUCT_FTDI_MHAM_Y6	0xeeea		/* Y6 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.624 src/sys/dev/usb/usbdevs_data.h:1.625
--- src/sys/dev/usb/usbdevs_data.h:1.624	Sat Oct  6 14:38:06 2012
+++ src/sys/dev/usb/usbdevs_data.h	Fri Nov  2 00:58:48 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.624 2012/10/06 14:38:06 christos Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.625 2012/11/02 00:58:48 jakllsch Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.630 2012/10/06 14:37:41 christos Exp
+ *	NetBSD: usbdevs,v 1.631 2012/11/02 00:57:57 jakllsch Exp
  */
 
 /*
@@ -4655,6 +4655,10 @@ const struct usb_product usb_products[] 
 	"OpenRD JTAGKey FT2232D B",
 	},
 	{
+	USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MAXSTREAM_PKG_U,
+	"MaxStream PKG-U",
+	},
+	{
 	USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MHAM_KW,
 	"KW",
 	},
@@ -9835,4 +9839,4 @@ const struct usb_product usb_products[] 
 	"Prestige",
 	},
 };
-const int usb_nproducts = 1930;
+const int usb_nproducts = 1931;



CVS commit: src/sys/dev/usb

2012-11-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Nov  2 00:57:57 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
add (FTDI) MaxStream PKG-U


To generate a diff of this commit:
cvs rdiff -u -r1.630 -r1.631 src/sys/dev/usb/usbdevs

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/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.630 src/sys/dev/usb/usbdevs:1.631
--- src/sys/dev/usb/usbdevs:1.630	Sat Oct  6 14:37:41 2012
+++ src/sys/dev/usb/usbdevs	Fri Nov  2 00:57:57 2012
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.630 2012/10/06 14:37:41 christos Exp $
+$NetBSD: usbdevs,v 1.631 2012/11/02 00:57:57 jakllsch Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1466,6 +1466,7 @@ product FTDI SERIAL_232H0x6014	C
 product FTDI PS2KBDMS		0x8371	PS/2 Keyboard/Mouse
 product FTDI SERIAL_8U100AX	0x8372	8U100AX Serial converter
 product FTDI OPENRD_JTAGKEY	0x9e90	OpenRD JTAGKey FT2232D B
+product FTDI MAXSTREAM_PKG_U	0xee18	MaxStream PKG-U
 product FTDI MHAM_KW		0xeee8	KW
 product FTDI MHAM_YS		0xeee9	YS
 product FTDI MHAM_Y6		0xeeea	Y6



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp

2012-11-01 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Nov  2 00:35:51 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libbn [agc-netpgp-standalone]:
misc.c misc.h
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
libverify.c pgpsum.c
src/crypto/external/bsd/netpgp/lib/verify [agc-netpgp-standalone]:
Makefile
Removed Files:
src/crypto/external/bsd/netpgp/dist/src/libbn [agc-netpgp-standalone]:
digest.h

Log Message:
more changes to netpgpverify on agc-netpgp-standalone branch:

+ remove the copy of digest.h from libbn sources, use the one in
libdigest, and fix up lib/verify/Makefile to accommodate

+ get rid of header files we don't need, and pick up header files
from the correct directory

+ remove the hexdump utility routine from the libbn misc support
routines, it's not needed

+ add a comment describing the pubring primary key parser structure


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r0 \
src/crypto/external/bsd/netpgp/dist/src/libbn/digest.h
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/dist/src/libverify/pgpsum.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 \
src/crypto/external/bsd/netpgp/lib/verify/Makefile

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/netpgp/dist/src/libbn/misc.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.2 src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.3
--- src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c:1.1.2.2	Mon Oct 29 15:46:50 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/misc.c	Fri Nov  2 00:35:50 2012
@@ -80,45 +80,3 @@ logmessage(const int level, const char *
 	}
 }
 #endif
-
-#ifndef _KERNEL
-#define LINELEN	16
-
-#define PRIsize	"z"
-
-/* show hexadecimal/ascii dump */
-void 
-hexdump(FILE *fp, const char *header, const uint8_t *src, size_t length)
-{
-	size_t	i;
-	char	line[LINELEN + 1];
-
-	if (src == NULL) {
-		return;
-	}
-	if (fp == NULL) {
-		fp = stdout;
-	}
-	(void) fprintf(fp, "%s%s", (header) ? header : "", (header) ? "\n" : "");
-	(void) fprintf(fp, "[%" PRIsize "u char%s]\n", length, (length == 1) ? "" : "s");
-	for (i = 0 ; i < length ; i++) {
-		if (i % LINELEN == 0) {
-			(void) fprintf(fp, "%.5" PRIsize "u | ", i);
-		}
-		(void) fprintf(fp, "%.02x ", (uint8_t)src[i]);
-		line[i % LINELEN] = (isprint(src[i])) ? src[i] : '.';
-		if (i % LINELEN == LINELEN - 1) {
-			line[LINELEN] = 0x0;
-			(void) fprintf(fp, " | %s\n", line);
-		}
-	}
-	if (i % LINELEN != 0) {
-		for ( ; i % LINELEN != 0 ; i++) {
-			(void) fprintf(fp, "   ");
-			line[i % LINELEN] = ' ';
-		}
-		line[LINELEN] = 0x0;
-		(void) fprintf(fp, " | %s\n", line);
-	}
-}
-#endif

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.1.2.1 src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.1.2.2
--- src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h:1.1.2.1	Sun May  6 17:34:56 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/misc.h	Fri Nov  2 00:35:50 2012
@@ -46,7 +46,6 @@ void netpgp_deallocate(void */*ptr*/, si
 
 #ifndef _KERNEL
 void logmessage(const int /*level*/, const char */*fmt*/, ...);
-void hexdump(FILE */*fp*/, const char */*header*/, const uint8_t */*src*/, size_t /*length*/);
 #endif
 
 __END_DECLS

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.11 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.12
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.11	Thu Nov  1 01:35:35 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Fri Nov  2 00:35:50 2012
@@ -27,13 +27,9 @@
 #include 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -43,7 +39,9 @@
 #include 
 
 #include "array.h"
+#include "bn.h"
 #include "b64.h"
+#include "digest.h"
 #include "pgpsum.h"
 #include "rsa.h"
 #include "verify.h"
@@ -356,7 +354,7 @@ fmt_binary_mpi(pgpv_bignum_t *mpi, uint8
 
 	bytes = BITS_TO_BYTES(mpi->bits);
 	if ((size_t)bytes + 2 + 1 > size) {
-		fprintf(stderr, "truncated mpi\n");
+		warn("truncated mpi");
 		return 0;
 	}
 	if (mpi->bn == NULL || BN_is_zero(mpi->bn)) {
@@ -1361,7 +1359,6 @@ fmt_pubkey(char *s, size_t size, pgpv_pu
 	if (pubkey->expiry) {
 		cc += fmt_time(&s[cc], size - cc, " [Expiry ", pubkey->birth + pubkey->expiry, "]", 0);
 	}
-	/* XXX - revoked? */
 	cc += snprintf(&s[cc]

CVS commit: src/sys/arch/sparc

2012-11-01 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Fri Nov  2 00:01:20 UTC 2012

Modified Files:
src/sys/arch/sparc/include: types.h
src/sys/arch/sparc/sparc: genassym.cf locore.s machdep.c

Log Message:
Add RAS support for sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/sparc/include/types.h
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.266 -r1.267 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.324 -r1.325 src/sys/arch/sparc/sparc/machdep.c

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

Modified files:

Index: src/sys/arch/sparc/include/types.h
diff -u src/sys/arch/sparc/include/types.h:1.61 src/sys/arch/sparc/include/types.h:1.62
--- src/sys/arch/sparc/include/types.h:1.61	Sat Jul 30 19:29:12 2011
+++ src/sys/arch/sparc/include/types.h	Fri Nov  2 00:01:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.61 2011/07/30 19:29:12 martin Exp $ */
+/*	$NetBSD: types.h,v 1.62 2012/11/02 00:01:19 chs Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -122,15 +122,13 @@ typedef	volatile unsigned char		__cpu_si
 #define	__GENERIC_SOFT_INTERRUPTS_ALL_LEVELS
 #define __HAVE_CPU_DATA_FIRST
 #define	__HAVE_CPU_VMSPACE_EXEC
+#define	__HAVE_RAS
 
 #ifdef SUN4U
 #define	__HAVE_DEVICE_REGISTER_POSTCONFIG
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_CPU_COUNTER	/* sparc v9 CPUs have %tick */
 #define	__HAVE_FAST_SOFTINTS
-#if defined(_KERNEL)
-#define	__HAVE_RAS
-#endif
 #else
 #define	__HAVE_MM_MD_READWRITE
 #endif

Index: src/sys/arch/sparc/sparc/genassym.cf
diff -u src/sys/arch/sparc/sparc/genassym.cf:1.67 src/sys/arch/sparc/sparc/genassym.cf:1.68
--- src/sys/arch/sparc/sparc/genassym.cf:1.67	Mon Aug 15 02:19:44 2011
+++ src/sys/arch/sparc/sparc/genassym.cf	Fri Nov  2 00:01:19 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.67 2011/08/15 02:19:44 mrg Exp $
+#	$NetBSD: genassym.cf,v 1.68 2012/11/02 00:01:19 chs Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -106,18 +106,23 @@ include 
 define	BSD		BSD
 define	USRSTACK	USRSTACK
 
-# proc fields and values
+# LWP fields and values
 define	L_PCB		offsetof(struct lwp, l_addr)
 define	L_PROC		offsetof(struct lwp, l_proc)
 define	L_STAT		offsetof(struct lwp, l_stat)
 define	L_WCHAN		offsetof(struct lwp, l_wchan)
 define	L_CPU		offsetof(struct lwp, l_cpu)
 define	L_PRIORITY	offsetof(struct lwp, l_priority)
-define	P_VMSPACE	offsetof(struct proc, p_vmspace)
-define	P_MD_SYSCALL	offsetof(struct proc, p_md.md_syscall)
+define	L_TF		offsetof(struct lwp, l_md.md_tf)
+
 define	LSRUN		LSRUN
 define	LSONPROC	LSONPROC
 
+# proc fields
+define	P_VMSPACE	offsetof(struct proc, p_vmspace)
+define	P_RASLIST	offsetof(struct proc, p_raslist)
+define	P_MD_SYSCALL	offsetof(struct proc, p_md.md_syscall)
+
 # VM structure fields
 define	VM_PMAP		offsetof(struct vmspace, vm_map.pmap)
 define	PMAP_CTX	offsetof(struct pmap, pm_ctx)
@@ -219,6 +224,10 @@ define	PCB_PC		offsetof(struct pcb, pcb_
 define	PCB_UW		offsetof(struct pcb, pcb_uw)
 define	PCB_WIM		offsetof(struct pcb, pcb_wim)
 
+# trapframe fields
+define	TF_PC		offsetof(struct trapframe, tf_pc)
+define	TF_NPC		offsetof(struct trapframe, tf_npc)
+
 # interrupt enable register PTE
 define	IE_REG_PTE_PG	(PG_V | PG_W | PG_S | PG_NC | PG_OBIO)
 

Index: src/sys/arch/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.266 src/sys/arch/sparc/sparc/locore.s:1.267
--- src/sys/arch/sparc/sparc/locore.s:1.266	Sun Feb 19 21:06:28 2012
+++ src/sys/arch/sparc/sparc/locore.s	Fri Nov  2 00:01:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.266 2012/02/19 21:06:28 rmind Exp $	*/
+/*	$NetBSD: locore.s,v 1.267 2012/11/02 00:01:19 chs Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -4949,8 +4949,27 @@ Lnosaveoldlwp:
 	st	%o0, [%o4 + PMAP_CPUSET]
 #endif
 
+	/*
+	 * Check for restartable atomic sequences (RAS)
+	 */
+	ld	[%g3 + L_PROC], %o0	! now %o0 points to p
+	ld	[%o0 + P_RASLIST], %o1	! any RAS in p?
+	cmp	%o1, 0
+	be	Lsw_noras		! no, skip RAS check
+	 mov	%g1, %i0		! restore oldlwp (for return value)
+	ld	[%g3 + L_TF], %l3	! pointer to trap frame
+	call	_C_LABEL(ras_lookup)
+	 ld	[%l3 + TF_PC], %o1
+	cmp	%o0, -1
+	be	Lsw_noras
+	 add	%o0, 4, %o1
+	st	%o0, [%l3 + TF_PC]	! store rewound %pc
+	st	%o1, [%l3 + TF_NPC]	! and %npc
+
+Lsw_noras:
+
 	ret
-	 restore %g0, %g1, %o0		! return (lastproc)
+	 restore			! return (oldlwp)
 
 /*
  * Call the idlespin() function if it exists, otherwise just return.

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.324 src/sys/arch/sparc/sparc/machdep.c:1.325
--- src/sys/arch/sparc/sparc/machdep.c:1.324	Thu Sep 13 11:49:16 2012
+++ src/sys/arch/sparc/sparc/machdep.c	Fri Nov  2 00:01:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.324 2012/09/13 11:49:16 martin Exp $ */
+/*	$NetBSD: machdep.c,v 1.325 2012/11/02 00:01:20 chs Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation

CVS commit: src/usr.bin/flock

2012-11-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  1 23:34:44 UTC 2012

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

Log Message:
fix usage


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/flock/flock.1

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.1
diff -u src/usr.bin/flock/flock.1:1.1 src/usr.bin/flock/flock.1:1.2
--- src/usr.bin/flock/flock.1:1.1	Thu Nov  1 19:30:19 2012
+++ src/usr.bin/flock/flock.1	Thu Nov  1 19:34:44 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: flock.1,v 1.1 2012/11/01 23:30:19 christos Exp $
+.\"	$NetBSD: flock.1,v 1.2 2012/11/01 23:34:44 christos Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,7 +39,7 @@
 .Op Fl dnosxv
 .Op Fl w Ar timeout
 .Ar lockfile|lockdir
-.Op Ar c
+.Op Fl c
 .Ar command
 .Nm
 .Op Fl dnusxv



CVS commit: src/doc

2012-11-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  1 23:34:03 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
add flock


To generate a diff of this commit:
cvs rdiff -u -r1.1754 -r1.1755 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.1754 src/doc/CHANGES:1.1755
--- src/doc/CHANGES:1.1754	Sun Oct 28 13:13:59 2012
+++ src/doc/CHANGES	Thu Nov  1 19:34:03 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1754 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1755 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -134,3 +134,5 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	libc: Import tzcode2012g. [christos 20121023]
 	zoneinfo: Import tzdata2012h. [apb 20121027]
 	libc: Update to tzcode2012h. [christos 20121028]
+	flock(1): Add a utility to provide locks to shell scripts similar
+		to shlock(1) [christos 20121101]



CVS commit: src/distrib/sets/lists

2012-11-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  1 23:33:13 UTC 2012

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

Log Message:
add flock(1)


To generate a diff of this commit:
cvs rdiff -u -r1.1010 -r1.1011 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1785 -r1.1786 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1403 -r1.1404 src/distrib/sets/lists/man/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/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1010 src/distrib/sets/lists/base/mi:1.1011
--- src/distrib/sets/lists/base/mi:1.1010	Wed Oct 31 23:26:42 2012
+++ src/distrib/sets/lists/base/mi	Thu Nov  1 19:33:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1010 2012/11/01 03:26:42 christos Exp $
+# $NetBSD: mi,v 1.1011 2012/11/01 23:33:10 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -463,6 +463,7 @@
 ./usr/bin/fincorebase-util-bin
 ./usr/bin/find	base-util-bin
 ./usr/bin/fingerbase-util-bin
+./usr/bin/flock	base-util-bin
 ./usr/bin/fmt	base-util-bin
 ./usr/bin/fold	base-util-bin
 ./usr/bin/from	base-mail-bin

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1785 src/distrib/sets/lists/comp/mi:1.1786
--- src/distrib/sets/lists/comp/mi:1.1785	Wed Oct 31 23:26:43 2012
+++ src/distrib/sets/lists/comp/mi	Thu Nov  1 19:33:11 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1785 2012/11/01 03:26:43 christos Exp $
+#	$NetBSD: mi,v 1.1786 2012/11/01 23:33:11 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3617,6 +3617,7 @@
 ./usr/libdata/debug/usr/bin/fincore.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/find.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/finger.debug	comp-util-debug		debug
+./usr/libdata/debug/usr/bin/flock.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/fmt.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/fold.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/fort77.debug	comp-fortran-debug	gcc=3,gcccmds,debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1403 src/distrib/sets/lists/man/mi:1.1404
--- src/distrib/sets/lists/man/mi:1.1403	Sun Sep 16 14:59:26 2012
+++ src/distrib/sets/lists/man/mi	Thu Nov  1 19:33:13 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1403 2012/09/16 18:59:26 tls Exp $
+# $NetBSD: mi,v 1.1404 2012/11/01 23:33:13 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -159,6 +159,7 @@
 ./usr/share/man/cat1/fincore.0			man-util-catman		.cat
 ./usr/share/man/cat1/find.0			man-util-catman		.cat
 ./usr/share/man/cat1/finger.0			man-util-catman		.cat
+./usr/share/man/cat1/flock.0			man-util-catman		.cat
 ./usr/share/man/cat1/fmt.0			man-util-catman		.cat
 ./usr/share/man/cat1/fold.0			man-util-catman		.cat
 ./usr/share/man/cat1/foreach.0			man-util-catman		.cat
@@ -3125,6 +3126,7 @@
 ./usr/share/man/html1/fincore.html		man-util-htmlman	html
 ./usr/share/man/html1/find.html			man-util-htmlman	html
 ./usr/share/man/html1/finger.html		man-util-htmlman	html
+./usr/share/man/html1/flock.html		man-util-htmlman	html
 ./usr/share/man/html1/fmt.html			man-util-htmlman	html
 ./usr/share/man/html1/fold.html			man-util-htmlman	html
 ./usr/share/man/html1/foreach.html		man-util-htmlman	html
@@ -5708,6 +5710,7 @@
 ./usr/share/man/man1/fincore.1			man-util-man		.man
 ./usr/share/man/man1/find.1			man-util-man		.man
 ./usr/share/man/man1/finger.1			man-util-man		.man
+./usr/share/man/man1/flock.1			man-util-man		.man
 ./usr/share/man/man1/fmt.1			man-util-man		.man
 ./usr/share/man/man1/fold.1			man-util-man		.man
 ./usr/share/man/man1/foreach.1			man-util-man		.man



CVS commit: src/usr.bin

2012-11-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  1 23:30:19 UTC 2012

Modified Files:
src/usr.bin: Makefile
Added Files:
src/usr.bin/flock: Makefile flock.1 flock.c

Log Message:
Add an flock program inspired by the linux one with the same name.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/flock/Makefile src/usr.bin/flock/flock.1 \
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/Makefile
diff -u src/usr.bin/Makefile:1.210 src/usr.bin/Makefile:1.211
--- src/usr.bin/Makefile:1.210	Wed Aug  8 10:13:46 2012
+++ src/usr.bin/Makefile	Thu Nov  1 19:30:19 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.210 2012/08/08 14:13:46 christos Exp $
+#	$NetBSD: Makefile,v 1.211 2012/11/01 23:30:19 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include 
@@ -10,7 +10,7 @@ SUBDIR= apply asa at audio audiocfg \
 	column comm compress config crunch csplit ctags cut \
 	deroff db dirname du \
 	eject elf2aout elf2ecoff env error expand extattr \
-	false fdformat fgen fincore find finger fmt fold fpr from \
+	false fdformat fgen fincore find finger flock fmt fold fpr from \
 	fsplit fstat ftp gcore genassym gencat getconf getent getopt gprof \
 	head hexdump iconv id indent infocmp innetgr ipcrm ipcs join jot \
 	kdump ktrace ktruss lam last lastcomm ldd leave \

Added files:

Index: src/usr.bin/flock/Makefile
diff -u /dev/null src/usr.bin/flock/Makefile:1.1
--- /dev/null	Thu Nov  1 19:30:19 2012
+++ src/usr.bin/flock/Makefile	Thu Nov  1 19:30:19 2012
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2012/11/01 23:30:19 christos Exp $
+#	@(#)Makefile	8.1 (Berkeley) 6/6/93
+
+PROG=	flock
+#LDADD+=	-lutil
+#DPADD+=	${LIBUTIL}
+
+.include 
Index: src/usr.bin/flock/flock.1
diff -u /dev/null src/usr.bin/flock/flock.1:1.1
--- /dev/null	Thu Nov  1 19:30:19 2012
+++ src/usr.bin/flock/flock.1	Thu Nov  1 19:30:19 2012
@@ -0,0 +1,99 @@
+.\"	$NetBSD: flock.1,v 1.1 2012/11/01 23:30:19 christos Exp $
+.\"
+.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Christos Zoulas.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\"
+.Dd November 1, 2012
+.Dt flock 1
+.Os
+.Sh NAME
+.Nm flock
+.Nd Provide locking API for shell scripts
+.Sh SYNOPSIS
+.Nm
+.Op Fl dnosxv
+.Op Fl w Ar timeout
+.Ar lockfile|lockdir
+.Op Ar c
+.Ar command
+.Nm
+.Op Fl dnusxv
+.Op Fl w Ar timeout
+.Ar lockfd
+.Sh DESCRIPTION
+The
+.Nm
+utility provides
+.Xr flock 2
+access to the command line or scripts.
+The first form locks a file or directory while the command provided is executed.
+If the file or directory does not exist, then a file is created.
+.Pp
+The second form can use an arbitrary file descriptor that is provided from a
+shell script for example:
+.nf
+(
+	flock -s 100
+	# commands to be executed under the lock
+) 100> /path/to/lockfile
+.if
+.Pp
+The following options are available:
+.Bl -tag -width "X"
+.It Fl c Ar command
+Pass a command to a the shell.
+.It Fl d Fl Fl debug
+Provide debugging output.
+.It Fl s Fl Fl shared
+Obtain a shared lock.
+.It Fl e Fl x Fl Fl exclusive
+Obtain an exclusive lock.
+.It Fl u Fl Fl unlock
+Unlock an existing lock.
+This is available only for a file descriptor.
+.It Fl n Fl Fl nb Fl Fl nonblock
+Don't block and fail immediately if the lock could not be obtained.
+.If Fl v Fl Fl verbose
+On error print an explanation of the failure.
+.It Fl w Fl Fl wait Fl Fl timeout 

CVS commit: src/sys/arch/mips/mips

2012-11-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov  1 22:15:25 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_emul.c

Log Message:
We need to jump out of two switches to emulate rdhwr rt,$29 correctly.
Only one would result in segv.

Fixes pthread apps on mips1. Tested using gxemul.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/mips/mips/mips_emul.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/mips/mips/mips_emul.c
diff -u src/sys/arch/mips/mips/mips_emul.c:1.25 src/sys/arch/mips/mips/mips_emul.c:1.26
--- src/sys/arch/mips/mips/mips_emul.c:1.25	Thu Aug 18 21:04:23 2011
+++ src/sys/arch/mips/mips/mips_emul.c	Thu Nov  1 22:15:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_emul.c,v 1.25 2011/08/18 21:04:23 matt Exp $ */
+/*	$NetBSD: mips_emul.c,v 1.26 2012/11/01 22:15:25 skrll Exp $ */
 
 /*
  * Copyright (c) 1999 Shuichiro URATA.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.25 2011/08/18 21:04:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.26 2012/11/01 22:15:25 skrll Exp $");
 
 #include 
 #include 
@@ -457,7 +457,7 @@ mips_emul_special3(uint32_t inst, struct
 		case 29:
 			tf->tf_regs[instfmt.RType.rt] =
 			(mips_reg_t)(intptr_t)curlwp->l_private;
-			break;
+			goto done;
 		}
 		/* FALLTHROUGH */
 	illopc:
@@ -472,7 +472,7 @@ mips_emul_special3(uint32_t inst, struct
 		(*curproc->p_emul->e_trapsignal)(curlwp, &ksi);
 		return;
 	}
-
+done:
 	update_pc(tf, cause);
 }
 



CVS commit: src/sys/arch/arm/broadcom

2012-11-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov  1 21:33:13 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_eth.c

Log Message:
If IFF_LINK2 is set, copy all transmitted packets into a single mbuf to
avoid DMA corruption problems with chained buffers.
Fix various conditions with setting INTMASK.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm53xx_eth.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/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.14 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.15
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.14	Fri Oct 26 05:28:41 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Thu Nov  1 21:33:12 2012
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.14 2012/10/26 05:28:41 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.15 2012/11/01 21:33:12 matt Exp $");
 
 #include 
 #include 
@@ -138,7 +138,7 @@ struct bcmeth_softc {
 
 	uint32_t sc_maxfrm;
 	uint32_t sc_cmdcfg;
-	volatile uint32_t sc_intmask;
+	uint32_t sc_intmask;
 	uint32_t sc_rcvlazy;
 	volatile uint32_t sc_soft_flags;
 #define	SOFT_RXINTR		0x01
@@ -1381,6 +1381,31 @@ bcmeth_txq_enqueue(
 		} else {
 			txq->txq_next = NULL;
 		}
+		/*
+		 * If LINK2 is set and this packet uses multiple mbufs,
+		 * consolidate it into a single mbuf.
+		 */
+		if (m->m_next != NULL && (sc->sc_if.if_flags & IFF_LINK2)) {
+			struct mbuf *m0 = m_gethdr(M_DONTWAIT, m->m_type);
+			if (m0 == NULL) {
+txq->txq_next = m;
+return true;
+			}
+			M_COPY_PKTHDR(m0, m);
+			MCLAIM(m0, m->m_owner);
+			if (m0->m_pkthdr.len > MHLEN) {
+MCLGET(m0, M_DONTWAIT);
+if ((m0->m_flags & M_EXT) == 0) {
+	m_freem(m0);
+	txq->txq_next = m;
+	return true;
+}
+			}
+			m0->m_len = m->m_pkthdr.len;
+			m_copydata(m, 0, m0->m_len, mtod(m0, void *));
+			m_freem(m);
+			m = m0;
+		}
 		int error = bcmeth_txq_map_load(sc, txq, m);
 		if (error) {
 			aprint_error_dev(sc->sc_dev,
@@ -1566,11 +1591,12 @@ bcmeth_intr(void *arg)
 
 	mutex_enter(sc->sc_hwlock);
 
+	uint32_t intmask = sc->sc_intmask;
 	sc->sc_ev_intr.ev_count++;
 
 	for (;;) {
 		uint32_t intstatus = bcmeth_read_4(sc, GMAC_INTSTATUS);
-		intstatus &= sc->sc_intmask;
+		intstatus &= intmask;
 		bcmeth_write_4(sc, GMAC_INTSTATUS, intstatus);	/* write 1 to clear */
 		if (intstatus == 0) {
 			break;
@@ -1581,8 +1607,7 @@ bcmeth_intr(void *arg)
 #endif
 		if (intstatus & RCVINT) {
 			struct bcmeth_rxqueue * const rxq = &sc->sc_rxq;
-			intstatus &= ~RCVINT;
-			atomic_and_32(&sc->sc_intmask, (uint32_t)~RCVINT);
+			intmask &= ~RCVINT;
 
 			uint32_t rcvsts0 = bcmeth_read_4(sc, rxq->rxq_reg_rcvsts0);
 			uint32_t descs = __SHIFTOUT(rcvsts0, RCV_CURRDSCR);
@@ -1610,17 +1635,16 @@ bcmeth_intr(void *arg)
 		}
 
 		if (intstatus & XMTINT_0) {
-			intstatus &= ~XMTINT_0;
-			atomic_and_32(&sc->sc_intmask, (uint32_t)~XMTINT_0);
+			intmask &= ~XMTINT_0;
 			soft_flags |= SOFT_TXINTR;
 		}
 
 		if (intstatus & RCVDESCUF) {
-			intstatus &= ~RCVDESCUF;
-			atomic_and_32(&sc->sc_intmask, (uint32_t)~RCVDESCUF);
+			intmask &= ~RCVDESCUF;
 			work_flags |= WORK_RXUNDERFLOW;
 		}
 
+		intstatus &= intmask;
 		if (intstatus) {
 			aprint_error_dev(sc->sc_dev,
 			"intr: intstatus=%#x\n", intstatus);
@@ -1638,14 +1662,13 @@ bcmeth_intr(void *arg)
 			bcmeth_read_4(sc, sc->sc_txq.txq_reg_xmtptr),
 			bcmeth_read_4(sc, sc->sc_txq.txq_reg_xmtsts0),
 			bcmeth_read_4(sc, sc->sc_txq.txq_reg_xmtsts1));
-			Debugger();
-			atomic_and_32(&sc->sc_intmask, ~intstatus);
+			intmask &= ~intstatus;
 			work_flags |= WORK_REINIT;
 			break;
 		}
 	}
 
-	if (work_flags | soft_flags) {
+	if (intmask != sc->sc_intmask) {
 		bcmeth_write_4(sc, GMAC_INTMASK, sc->sc_intmask);
 	}
 
@@ -1675,6 +1698,7 @@ bcmeth_soft_intr(void *arg)
 {
 	struct bcmeth_softc * const sc = arg;
 	struct ifnet * const ifp = &sc->sc_if;
+	uint32_t intmask = 0;
 
 	mutex_enter(sc->sc_lock);
 
@@ -1695,7 +1719,7 @@ bcmeth_soft_intr(void *arg)
 		} else {
 			ifp->if_flags &= ~IFF_OACTIVE;
 		}
-		atomic_or_32(&sc->sc_intmask, XMTINT_0);
+		intmask |= XMTINT_0;
 	}
 
 	if (soft_flags & SOFT_RXINTR) {
@@ -1703,12 +1727,13 @@ bcmeth_soft_intr(void *arg)
 		 * Let's consume 
 		 */
 		bcmeth_rxq_consume(sc, &sc->sc_rxq);
-		atomic_or_32(&sc->sc_intmask, RCVINT);
+		intmask |= RCVINT;
 	}
 
 	if (ifp->if_flags & IFF_RUNNING) {
 		bcmeth_rxq_produce(sc, &sc->sc_rxq);
 		mutex_spin_enter(sc->sc_hwlock);
+		sc->sc_intmask |= intmask;
 		bcmeth_write_4(sc, GMAC_INTMASK, sc->sc_intmask);
 		mutex_spin_exit(sc->sc_hwlock);
 	}
@@ -1721,6 +1746,7 @@ bcmeth_worker(struct work *wk, void *arg
 {
 	struct bcmeth_softc * const sc = arg;
 	struct ifnet * const ifp = &sc->sc_if;
+	uint32_t intmask = 0;
 
 	mutex_enter(sc->sc_lock);
 
@@ -1741,7 +1767,7 @@ bcmeth_worker(struct work

CVS commit: src/sys/arch/arm/broadcom

2012-11-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov  1 21:29:42 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_reg.h

Log Message:
Add PCIE_RC_AXI_CONFIG definitions


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/broadcom/bcm53xx_reg.h

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_reg.h
diff -u src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.9 src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10
--- src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.9	Fri Oct 26 04:45:36 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_reg.h	Thu Nov  1 21:29:42 2012
@@ -405,6 +405,12 @@
 
 #define	PCIE_CLK_CONTROL	0x000
 
+#define PCIE_RC_AXI_CONFIG	0x100
+#define	 PCIE_AWCACHE_CONFIG	__BITS(17,14)
+#define	 PCIE_AWUSER_CONFIG	__BITS(13,9)
+#define	 PCIE_ARCACHE_CONFIG	__BITS(8,5)
+#define	 PCIE_ARUSER_CONFIG	__BITS(4,0)
+
 #define	PCIE_CFG_IND_ADDR	0x120
 #define	 CFG_IND_ADDR_FUNC	__BITS(15,13)
 #define  CFG_IND_ADDR_LAYER	__BITS(12,11)



CVS commit: src/sys/arch/arm/cortex

2012-11-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov  1 20:17:44 UTC 2012

Modified Files:
src/sys/arch/arm/cortex: pl310.c

Log Message:
Invalidate the L2 cache before enabling it.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/cortex/pl310.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/arm/cortex/pl310.c
diff -u src/sys/arch/arm/cortex/pl310.c:1.7 src/sys/arch/arm/cortex/pl310.c:1.8
--- src/sys/arch/arm/cortex/pl310.c:1.7	Wed Oct 17 20:45:49 2012
+++ src/sys/arch/arm/cortex/pl310.c	Thu Nov  1 20:17:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pl310.c,v 1.7 2012/10/17 20:45:49 matt Exp $	*/
+/*	$NetBSD: pl310.c,v 1.8 2012/11/01 20:17:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.7 2012/10/17 20:45:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.8 2012/11/01 20:17:44 matt Exp $");
 
 #include 
 #include 
@@ -237,7 +237,7 @@ arml2cc_enable(struct arml2cc_softc *sc)
 
 	arml2cc_write_4(sc, L2C_CTL, 1);	// turn it on
 
-	//arml2cc_cache_way_op(sc, L2C_INV_WAY, sc->sc_waymask);
+	arml2cc_cache_way_op(sc, L2C_INV_WAY, sc->sc_waymask);
 	arml2cc_cache_sync(sc);
 
 	mutex_spin_exit(&sc->sc_lock);



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

2012-11-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov  1 15:54:28 UTC 2012

Modified Files:
src/sys/arch/macppc/dev: smartbat.c

Log Message:
- apply limits consistently
- remove suspect pointer fudgery when interpreting PMU battery data
now if we had any idea what units these data are in...


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/macppc/dev/smartbat.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/macppc/dev/smartbat.c
diff -u src/sys/arch/macppc/dev/smartbat.c:1.13 src/sys/arch/macppc/dev/smartbat.c:1.14
--- src/sys/arch/macppc/dev/smartbat.c:1.13	Wed Oct 31 05:46:49 2012
+++ src/sys/arch/macppc/dev/smartbat.c	Thu Nov  1 15:54:28 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: smartbat.c,v 1.13 2012/10/31 05:46:49 macallan Exp $ */
+/*	$NetBSD: smartbat.c,v 1.14 2012/11/01 15:54:28 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smartbat.c,v 1.13 2012/10/31 05:46:49 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smartbat.c,v 1.14 2012/11/01 15:54:28 macallan Exp $");
 
 #include 
 #include 
@@ -82,6 +82,8 @@ struct smartbat_softc {
 	int sc_voltage;
 	int sc_charge;
 	int sc_max_charge;
+	int sc_warn;
+	int sc_low;
 	int sc_draw;
 	int sc_time;
 	uint32_t sc_timestamp;
@@ -131,6 +133,8 @@ smartbat_attach(device_t parent, device_
 
 	printf(" addr %d: smart battery\n", sc->sc_num);
 
+	sc->sc_charge = 0;
+	sc->sc_max_charge = 0;
 	smartbat_update(sc, 1);
 	/* trigger a status update */
 	sc->sc_oflags = ~sc->sc_flags;
@@ -229,6 +233,10 @@ smartbat_setup_envsys(struct smartbat_so
 		}
 	}
 
+	sc->sc_low  = sc->sc_max_charge * 1000 / 100 * 10; /* 10% */
+	sc->sc_warn = sc->sc_max_charge * 1000 / 100 * 20; /* 20% */
+
+
 	sc->sc_bat_sme->sme_name = device_xname(sc->sc_dev);
 	sc->sc_bat_sme->sme_cookie = sc;
 	sc->sc_bat_sme->sme_refresh = smartbat_refresh;
@@ -273,9 +281,9 @@ smartbat_refresh(struct sysmon_envsys *s
 			edata->value_max = sc->sc_max_charge * 1000;
 			if (ch < 6) {
 edata->state = ENVSYS_SCRITICAL;
-			} else if (ch < 11) {
+			} else if (edata->value_cur < sc->sc_low) {
 edata->state = ENVSYS_SCRITUNDER;
-			} else if (ch < 20) {
+			} else if (edata->value_cur < sc->sc_warn) {
 edata->state = ENVSYS_SWARNUNDER;
 			}
 			break;
@@ -288,13 +296,15 @@ smartbat_refresh(struct sysmon_envsys *s
 			break;
 		case BAT_CHARGE_STATE:
 			{
+int chr = sc->sc_charge * 1000;
+
 if (ch < 6) {
 	edata->value_cur = 
 	ENVSYS_BATTERY_CAPACITY_CRITICAL;
-} else if (ch < 10) {
+} else if (chr < sc->sc_low) {
 	edata->value_cur = 
 	ENVSYS_BATTERY_CAPACITY_LOW;
-} else if (ch < 20) {
+} else if (chr < sc->sc_warn) {
 	edata->value_cur = 
 	ENVSYS_BATTERY_CAPACITY_WARNING;
 } else {
@@ -338,8 +348,8 @@ smartbat_get_limits(struct sysmon_envsys
 	if (edata->sensor != BAT_CHARGE)
 		return;
 
-	limits->sel_critmin = sc->sc_max_charge * 1000 / 100 * 10; /* 20% */
-	limits->sel_warnmin = sc->sc_max_charge * 1000 / 100 * 20; /* 10% */
+	limits->sel_critmin = sc->sc_low;
+	limits->sel_warnmin = sc->sc_warn;
 
 	*props |= PROP_BATTCAP | PROP_BATTWARN | PROP_DRIVER_LIMITS;
 }
@@ -372,6 +382,7 @@ smartbat_update(struct smartbat_softc *s
 {
 	int len;
 	uint8_t buf[16];
+	int8_t *sbuf = (int8_t *)buf;
 	uint8_t battery_number;
 
 	if (sc->sc_timestamp == time_second)
@@ -417,13 +428,13 @@ smartbat_update(struct smartbat_softc *s
 	case 4:
 		sc->sc_charge = buf[3];
 		sc->sc_max_charge = buf[4];
-		sc->sc_draw = *((signed char *)&buf[5]);
+		sc->sc_draw = sbuf[5];
 		sc->sc_voltage = buf[6];
 		break;
 	case 5:
 		sc->sc_charge = ((buf[3] << 8) | (buf[4]));
 		sc->sc_max_charge = ((buf[5] << 8) | (buf[6]));
-		sc->sc_draw = *((signed short *)&buf[7]);
+		sc->sc_draw = sbuf[7];
 		sc->sc_voltage = ((buf[9] << 8) | (buf[8]));
 		break;
 	default:



CVS commit: src/sys/arch/x68k/stand

2012-11-01 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Nov  1 14:46:26 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/boot: dp8390.c dp8390.h if_ne.c ne.c
src/sys/arch/x68k/stand/libsa: clock.c
src/sys/arch/x68k/stand/netboot: Makefile boot.c conf.c

Log Message:
Remove my local RCS IDs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/boot/dp8390.c \
src/sys/arch/x68k/stand/boot/dp8390.h \
src/sys/arch/x68k/stand/boot/if_ne.c src/sys/arch/x68k/stand/boot/ne.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/libsa/clock.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/netboot/Makefile \
src/sys/arch/x68k/stand/netboot/boot.c \
src/sys/arch/x68k/stand/netboot/conf.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/x68k/stand/boot/dp8390.c
diff -u src/sys/arch/x68k/stand/boot/dp8390.c:1.1 src/sys/arch/x68k/stand/boot/dp8390.c:1.2
--- src/sys/arch/x68k/stand/boot/dp8390.c:1.1	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/boot/dp8390.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/*	$NetBSD: dp8390.c,v 1.1 2012/10/12 20:15:52 tsutsui Exp $	*/
-/*	Id: dp8390.c,v 1.14 2011/10/05 13:16:20 isaki Exp 	*/
+/*	$NetBSD: dp8390.c,v 1.2 2012/11/01 14:46:26 isaki Exp $	*/
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/dp8390.c
Index: src/sys/arch/x68k/stand/boot/dp8390.h
diff -u src/sys/arch/x68k/stand/boot/dp8390.h:1.1 src/sys/arch/x68k/stand/boot/dp8390.h:1.2
--- src/sys/arch/x68k/stand/boot/dp8390.h:1.1	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/boot/dp8390.h	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/*	$NetBSD: dp8390.h,v 1.1 2012/10/12 20:15:52 tsutsui Exp $	*/
-/*	Id: dp8390.h,v 1.7 2011/10/05 13:16:20 isaki Exp 	*/
+/*	$NetBSD: dp8390.h,v 1.2 2012/11/01 14:46:26 isaki Exp $	*/
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/dp8390.h
Index: src/sys/arch/x68k/stand/boot/if_ne.c
diff -u src/sys/arch/x68k/stand/boot/if_ne.c:1.1 src/sys/arch/x68k/stand/boot/if_ne.c:1.2
--- src/sys/arch/x68k/stand/boot/if_ne.c:1.1	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/boot/if_ne.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/* $NetBSD: if_ne.c,v 1.1 2012/10/12 20:15:52 tsutsui Exp $ */
-/* Id: if_ne.c,v 1.28 2011/10/05 13:17:06 isaki Exp  */
+/* $NetBSD: if_ne.c,v 1.2 2012/11/01 14:46:26 isaki Exp $ */
 
 /*
  * Copyright (c) 2003 Tetsuya Isaki. All rights reserved.
Index: src/sys/arch/x68k/stand/boot/ne.c
diff -u src/sys/arch/x68k/stand/boot/ne.c:1.1 src/sys/arch/x68k/stand/boot/ne.c:1.2
--- src/sys/arch/x68k/stand/boot/ne.c:1.1	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/boot/ne.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/*	$NetBSD: ne.c,v 1.1 2012/10/12 20:15:52 tsutsui Exp $	*/
-/*	Id: ne.c,v 1.22 2011/10/05 13:16:20 isaki Exp 	*/
+/*	$NetBSD: ne.c,v 1.2 2012/11/01 14:46:26 isaki Exp $	*/
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/ne.c

Index: src/sys/arch/x68k/stand/libsa/clock.c
diff -u src/sys/arch/x68k/stand/libsa/clock.c:1.1 src/sys/arch/x68k/stand/libsa/clock.c:1.2
--- src/sys/arch/x68k/stand/libsa/clock.c:1.1	Fri Oct 12 20:15:52 2012
+++ src/sys/arch/x68k/stand/libsa/clock.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/* $NetBSD: clock.c,v 1.1 2012/10/12 20:15:52 tsutsui Exp $ */
-/* Id: clock.c,v 1.4 2011/04/10 09:21:45 isaki Exp  */
+/* $NetBSD: clock.c,v 1.2 2012/11/01 14:46:26 isaki Exp $ */
 
 /*
  * Copyright (c) 2003 Tetsuya Isaki. All rights reserved.

Index: src/sys/arch/x68k/stand/netboot/Makefile
diff -u src/sys/arch/x68k/stand/netboot/Makefile:1.1 src/sys/arch/x68k/stand/netboot/Makefile:1.2
--- src/sys/arch/x68k/stand/netboot/Makefile:1.1	Fri Oct 12 20:15:53 2012
+++ src/sys/arch/x68k/stand/netboot/Makefile	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2012/10/12 20:15:53 tsutsui Exp $
-#	Id: Makefile,v 1.14 2011/10/04 12:59:33 isaki Exp 
+#	$NetBSD: Makefile,v 1.2 2012/11/01 14:46:26 isaki Exp $
 
 NOMAN=		# defined
 
Index: src/sys/arch/x68k/stand/netboot/boot.c
diff -u src/sys/arch/x68k/stand/netboot/boot.c:1.1 src/sys/arch/x68k/stand/netboot/boot.c:1.2
--- src/sys/arch/x68k/stand/netboot/boot.c:1.1	Fri Oct 12 20:15:53 2012
+++ src/sys/arch/x68k/stand/netboot/boot.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/*	$NetBSD: boot.c,v 1.1 2012/10/12 20:15:53 tsutsui Exp $	*/
-/*	Id: boot.c,v 1.19 2011/10/04 12:45:16 isaki Exp 	*/
+/*	$NetBSD: boot.c,v 1.2 2012/11/01 14:46:26 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 Minoura Makoto
Index: src/sys/arch/x68k/stand/netboot/conf.c
diff -u src/sys/arch/x68k/stand/netboot/conf.c:1.1 src/sys/arch/x68k/stand/netboot/conf.c:1.2
--- src/sys/arch/x68k/stand/netboot/conf.c:1.1	Fri Oct 12 20:15:53 2012
+++ src/sys/arch/x68k/stand/netboot/conf.c	Thu Nov  1 14:46:26 2012
@@ -1,5 +1,4 @@
-/*	$NetBSD: conf.c,v 1.1 2012/10/12 20:15:53 tsutsui Exp $	*/
-/*	Id: conf.c,v 1.7 2011/04/10

CVS commit: src/sys/arch/x68k/stand/boot_ufs

2012-11-01 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Nov  1 14:33:31 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: boot.S

Log Message:
Fix typo in comment. s/d1/d0/


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/boot_ufs/boot.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/x68k/stand/boot_ufs/boot.S
diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.9 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.10
--- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.9	Mon Feb 21 02:31:58 2011
+++ src/sys/arch/x68k/stand/boot_ufs/boot.S	Thu Nov  1 14:33:31 2012
@@ -2,7 +2,7 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.9 2011/02/21 02:31:58 itohy Exp $
+| $NetBSD: boot.S,v 1.10 2012/11/01 14:33:31 isaki Exp $
 
 #include 
 #include "iocscall.h"
@@ -64,7 +64,7 @@ clrbss:		clrb	%a1@+
 
 		| we use 68020 instructions, and check MPU beforehand
 		|
-		| here d1.w = -1, and the above "subw a1,d0" = 0x9049, and
+		| here d0.w = -1, and the above "subw a1,d0" = 0x9049, and
 		|	if MPU <= 010	loads 0x49,
 		|	if MPU >= 020	loads 0x90.
 		| This is a move, not a tst instruction



CVS commit: src/sys/dev/ata

2012-11-01 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Thu Nov  1 13:46:52 UTC 2012

Modified Files:
src/sys/dev/ata: ata.c

Log Message:
Allow setting ATADEBUG_MASK to default value of atadebug_mask


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/ata/ata.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.125 src/sys/dev/ata/ata.c:1.126
--- src/sys/dev/ata/ata.c:1.125	Sat Aug  4 21:21:09 2012
+++ src/sys/dev/ata/ata.c	Thu Nov  1 13:46:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.125 2012/08/04 21:21:09 bouyer Exp $	*/
+/*	$NetBSD: ata.c,v 1.126 2012/11/01 13:46:52 abs Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.125 2012/08/04 21:21:09 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.126 2012/11/01 13:46:52 abs Exp $");
 
 #include "opt_ata.h"
 
@@ -70,7 +70,10 @@ __KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.12
 #define DEBUG_DETACH 0x20
 #define	DEBUG_XFERS  0x40
 #ifdef ATADEBUG
-int atadebug_mask = 0;
+#ifndef ATADEBUG_MASK
+#define ATADEBUG_MASK 0
+#endif
+int atadebug_mask = ATADEBUG_MASK;
 #define ATADEBUG_PRINT(args, level) \
 	if (atadebug_mask & (level)) \
 		printf args



CVS commit: src/sbin/ifconfig

2012-11-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Nov  1 13:43:23 UTC 2012

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

Log Message:
Use snprintb_m(3) to split flags/capabilities/enabled across multiple
output lines.

As discussed on current-users


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/ifconfig/ether.c
cvs rdiff -u -r1.227 -r1.228 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/ether.c
diff -u src/sbin/ifconfig/ether.c:1.1 src/sbin/ifconfig/ether.c:1.2
--- src/sbin/ifconfig/ether.c:1.1	Wed Oct 31 10:17:34 2012
+++ src/sbin/ifconfig/ether.c	Thu Nov  1 13:43:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ether.c,v 1.1 2012/10/31 10:17:34 msaitoh Exp $	*/
+/*	$NetBSD: ether.c,v 1.2 2012/11/01 13:43:23 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ether.c,v 1.1 2012/10/31 10:17:34 msaitoh Exp $");
+__RCSID("$NetBSD: ether.c,v 1.2 2012/11/01 13:43:23 pgoyette Exp $");
 #endif /* not lint */
 
 #include  
@@ -58,11 +58,14 @@ static void ether_constructor(void) __at
 
 static status_func_t status;
 
+#define MAX_PRINT_LEN 55
+
 void
 ether_status(prop_dictionary_t env, prop_dictionary_t oenv)
 {
 	struct eccapreq eccr;
 	char fbuf[BUFSIZ];
+	char *bp;
 
 	memset(&eccr, 0, sizeof(eccr));
 
@@ -70,12 +73,20 @@ ether_status(prop_dictionary_t env, prop
 		return;
 
 	if (eccr.eccr_capabilities != 0) {
-		(void)snprintb(fbuf, sizeof(fbuf), ECCAPBITS,
-		eccr.eccr_capabilities);
-		printf("\tec_capabilities=%s\n", &fbuf[2]);
-		(void)snprintb(fbuf, sizeof(fbuf), ECCAPBITS,
-		eccr.eccr_capenable);
-		printf("\tec_enabled=%s\n", &fbuf[2]);
+		(void)snprintb_m(fbuf, sizeof(fbuf), ECCAPBITS,
+		eccr.eccr_capabilities, MAX_PRINT_LEN);
+		bp = fbuf;
+		while (*bp != '\0') {
+			printf("\tec_capabilities=%s\n", &bp[2]);
+			bp += strlen(bp) + 1;
+		}
+		(void)snprintb_m(fbuf, sizeof(fbuf), ECCAPBITS,
+		eccr.eccr_capenable, MAX_PRINT_LEN);
+		bp = fbuf;
+		while (*bp != '\0') {
+			printf("\tec_enabled=%s\n", &bp[2]);
+			bp += strlen(bp) + 1;
+		}
 	}
 }
 

Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.227 src/sbin/ifconfig/ifconfig.c:1.228
--- src/sbin/ifconfig/ifconfig.c:1.227	Sat Jan 28 15:01:44 2012
+++ src/sbin/ifconfig/ifconfig.c	Thu Nov  1 13:43:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifconfig.c,v 1.227 2012/01/28 15:01:44 mbalmer Exp $	*/
+/*	$NetBSD: ifconfig.c,v 1.228 2012/11/01 13:43:23 pgoyette 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.227 2012/01/28 15:01:44 mbalmer Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.228 2012/11/01 13:43:23 pgoyette Exp $");
 #endif /* not lint */
 
 #include 
@@ -1163,6 +1163,9 @@ print_human_bytes(bool humanize, uint64_
  * Print the status of the interface.  If an address family was
  * specified, show it and it only; otherwise, show them all.
  */
+
+#define MAX_PRINT_LEN 58	/* XXX need a better way to determine this! */
+
 void
 status(const struct sockaddr *sdl, prop_dictionary_t env,
 prop_dictionary_t oenv)
@@ -1174,6 +1177,7 @@ status(const struct sockaddr *sdl, prop_
 	struct ifreq ifr;
 	struct ifdrv ifdrv;
 	char fbuf[BUFSIZ];
+	char *bp;
 	int af, s;
 	const char *ifname;
 	struct ifcapreq ifcr;
@@ -1193,8 +1197,12 @@ status(const struct sockaddr *sdl, prop_
 	if ((ifname = getifinfo(env, oenv, &flags)) == NULL)
 		err(EXIT_FAILURE, "%s: getifinfo", __func__);
 
-	(void)snprintb(fbuf, sizeof(fbuf), IFFBITS, flags);
-	printf("%s: flags=%s", ifname, &fbuf[2]);
+	(void)snprintb_m(fbuf, sizeof(fbuf), IFFBITS, flags, MAX_PRINT_LEN);
+	bp = fbuf;
+	while (*bp != '\0') {
+		printf("%s: flags=%s", ifname, &bp[2]);
+		bp += strlen(bp) + 1;
+	}
 
 	estrlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
 	if (prog_ioctl(s, SIOCGIFMETRIC, &ifr) == -1)
@@ -1211,12 +1219,20 @@ status(const struct sockaddr *sdl, prop_
 		err(EXIT_FAILURE, "%s: getifcaps", __func__);
 
 	if (ifcr.ifcr_capabilities != 0) {
-		(void)snprintb(fbuf, sizeof(fbuf), IFCAPBITS,
-		ifcr.ifcr_capabilities);
-		printf("\tcapabilities=%s\n", &fbuf[2]);
-		(void)snprintb(fbuf, sizeof(fbuf), IFCAPBITS,
-		ifcr.ifcr_capenable);
-		printf("\tenabled=%s\n", &fbuf[2]);
+		(void)snprintb_m(fbuf, sizeof(fbuf), IFCAPBITS,
+		ifcr.ifcr_capabilities, MAX_PRINT_LEN);
+		bp = fbuf;
+		while (*bp != '\0') {
+			printf("\tcapabilities=%s\n", &bp[2]);
+			bp += strlen(bp) + 1;
+		}
+		(void)snprintb_m(fbuf, sizeof(fbuf), IFCAPBITS,
+		ifcr.ifcr_capenable, MAX_PRINT_LEN);
+		bp = fbuf;
+		while (*bp != '\0') {
+			printf("\tenabled=%s\n", &bp[2]);
+			bp += strlen(bp) + 1;
+		}
 	}
 
 	SIMPLEQ_FOREACH

CVS commit: src/share/man/man4

2012-11-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Nov  1 11:33:35 UTC 2012

Modified Files:
src/share/man/man4: acpiwmi.4

Log Message:
Remove line "acpiwmibus* at acpiwmi?".


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/acpiwmi.4

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

Modified files:

Index: src/share/man/man4/acpiwmi.4
diff -u src/share/man/man4/acpiwmi.4:1.7 src/share/man/man4/acpiwmi.4:1.8
--- src/share/man/man4/acpiwmi.4:1.7	Wed Feb 16 07:30:26 2011
+++ src/share/man/man4/acpiwmi.4	Thu Nov  1 11:33:34 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpiwmi.4,v 1.7 2011/02/16 07:30:26 jruoho Exp $
+.\" $NetBSD: acpiwmi.4,v 1.8 2012/11/01 11:33:34 jruoho Exp $
 .\"
 .\" Copyright (c) 2010 Jukka Ruohonen 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 16, 2011
+.Dd November 1, 2012
 .Dt ACPIWMI 4
 .Os
 .Sh NAME
@@ -33,7 +33,6 @@
 .Tn ACPI
 .Sh SYNOPSIS
 .Cd "acpiwmi* at acpi?"
-.Cd "acpiwmibus* at acpiwmi?"
 .Cd "wmidell* at acpiwmibus?"
 .Cd "wmieeepc* at acpiwmibus?"
 .Cd "wmihp* at acpiwmibus?"