CVS commit: src/sys/dev/usb

2015-04-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr  6 17:16:25 UTC 2015

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

Log Message:
Regen (Add Apple Magic Trackpad)


To generate a diff of this commit:
cvs rdiff -u -r1.687 -r1.688 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.688 -r1.689 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.687 src/sys/dev/usb/usbdevs.h:1.688
--- src/sys/dev/usb/usbdevs.h:1.687	Sun Apr  5 09:22:13 2015
+++ src/sys/dev/usb/usbdevs.h	Mon Apr  6 17:16:25 2015
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.687 2015/04/05 09:22:13 skrll Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.688 2015/04/06 17:16:25 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.695 2015/04/05 09:18:13 skrll Exp
+ *	NetBSD: usbdevs,v 1.696 2015/04/06 17:15:32 bouyer Exp
  */
 
 /*
@@ -862,6 +862,7 @@
 #define	USB_PRODUCT_APPLE_FOUNTAIN_TP	0x030a		/* Apple Internal Trackpad (Fountain) */
 #define	USB_PRODUCT_APPLE_GEYSER1_TP	0x030b		/* Apple Internal Trackpad (Geyser) */
 #define	USB_PRODUCT_APPLE_MAGICMOUSE	0x030d		/* Magic Mouse */
+#define	USB_PRODUCT_APPLE_MAGICTRACKPAD	0x030e		/* Magic Trackpad */
 #define	USB_PRODUCT_APPLE_BLUETOOTH_HIDMODE	0x1000		/* Bluetooth HCI (HID-proxy mode) */
 #define	USB_PRODUCT_APPLE_EXT_KBD_HUB	0x1003		/* Hub in Apple Extended USB Keyboard */
 #define	USB_PRODUCT_APPLE_SPEAKERS	0x1101		/* Speakers */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.688 src/sys/dev/usb/usbdevs_data.h:1.689
--- src/sys/dev/usb/usbdevs_data.h:1.688	Sun Apr  5 09:22:13 2015
+++ src/sys/dev/usb/usbdevs_data.h	Mon Apr  6 17:16:25 2015
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.688 2015/04/05 09:22:13 skrll Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.689 2015/04/06 17:16:25 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.695 2015/04/05 09:18:13 skrll Exp
+ *	NetBSD: usbdevs,v 1.696 2015/04/06 17:15:32 bouyer Exp
  */
 
 /*
@@ -932,6 +932,8 @@ static const uint16_t usb_products[] = {
 	1539, 5889, 6199, 6219, 0,
 	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_MAGICMOUSE, 
 	6228, 6193, 0,
+	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_MAGICTRACKPAD, 
+	6228, 6199, 0,
 	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH_HIDMODE, 
 	4714, 6234, 6238, 6249, 0,
 	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_EXT_KBD_HUB, 
@@ -5477,10 +5479,10 @@ static const char usb_words[] = { . 
 	mouse\0 /* 17 refs @ 6180 */
 	Mighty\0 /* 2 refs @ 6186 */
 	Mouse\0 /* 11 refs @ 6193 */
-	Trackpad\0 /* 2 refs @ 6199 */
+	Trackpad\0 /* 3 refs @ 6199 */
 	(Fountain)\0 /* 1 refs @ 6208 */
 	(Geyser)\0 /* 1 refs @ 6219 */
-	Magic\0 /* 1 refs @ 6228 */
+	Magic\0 /* 2 refs @ 6228 */
 	HCI\0 /* 1 refs @ 6234 */
 	(HID-proxy\0 /* 1 refs @ 6238 */
 	mode)\0 /* 1 refs @ 6249 */



CVS commit: src/sys/dev/usb

2015-04-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr  6 17:15:32 UTC 2015

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

Log Message:
Add Apple Magic Trackpad device id (bluetooth device)


To generate a diff of this commit:
cvs rdiff -u -r1.695 -r1.696 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.695 src/sys/dev/usb/usbdevs:1.696
--- src/sys/dev/usb/usbdevs:1.695	Sun Apr  5 09:18:13 2015
+++ src/sys/dev/usb/usbdevs	Mon Apr  6 17:15:32 2015
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.695 2015/04/05 09:18:13 skrll Exp $
+$NetBSD: usbdevs,v 1.696 2015/04/06 17:15:32 bouyer Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -855,6 +855,7 @@ product APPLE MIGHTYMOUSE	0x0304	Mighty 
 product APPLE FOUNTAIN_TP	0x030a	Apple Internal Trackpad (Fountain)
 product APPLE GEYSER1_TP	0x030b	Apple Internal Trackpad (Geyser)
 product APPLE MAGICMOUSE	0x030d	Magic Mouse
+product APPLE MAGICTRACKPAD	0x030e	Magic Trackpad
 product APPLE BLUETOOTH_HIDMODE	0x1000	Bluetooth HCI (HID-proxy mode)
 product APPLE EXT_KBD_HUB	0x1003	Hub in Apple Extended USB Keyboard
 product APPLE SPEAKERS		0x1101	Speakers



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 18:30:39 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.16 -r1.28.2.17 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.16 src/sys/dev/usb/xhci.c:1.28.2.17
--- src/sys/dev/usb/xhci.c:1.28.2.16	Sun Mar 22 08:09:44 2015
+++ src/sys/dev/usb/xhci.c	Mon Apr  6 18:30:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.16 2015/03/22 08:09:44 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.17 2015/04/06 18:30:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.16 2015/03/22 08:09:44 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.17 2015/04/06 18:30:39 skrll Exp $);
 
 #include opt_usb.h
 
@@ -2188,7 +2188,7 @@ static int xhci_roothub_ctrl(struct usbd
 	return totlen;
 }
 
-/* root hub intrerrupt */
+/* root hub interrupt */
 
 static usbd_status
 xhci_root_intr_transfer(struct usbd_xfer *xfer)



CVS commit: src/sys/dev/bluetooth

2015-04-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr  6 17:45:31 UTC 2015

Modified Files:
src/sys/dev/bluetooth: btmagic.c

Log Message:
Add support for Apple Magic Trackpad.
3 button emulation by detecting in which area of the bottom of
the device the trackpad's button is pressed.
Pointer move support with 1 finger touch, X/Y scroll with 2-finger touch.
TODO:
- detect tap to emulate button press and drag/n/drop.
- Detect and support zoom, if wsmouse allows to report this


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/bluetooth/btmagic.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/bluetooth/btmagic.c
diff -u src/sys/dev/bluetooth/btmagic.c:1.11 src/sys/dev/bluetooth/btmagic.c:1.12
--- src/sys/dev/bluetooth/btmagic.c:1.11	Tue Aug  5 07:55:31 2014
+++ src/sys/dev/bluetooth/btmagic.c	Mon Apr  6 17:45:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: btmagic.c,v 1.11 2014/08/05 07:55:31 rtr Exp $	*/
+/*	$NetBSD: btmagic.c,v 1.12 2015/04/06 17:45:31 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: btmagic.c,v 1.11 2014/08/05 07:55:31 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: btmagic.c,v 1.12 2015/04/06 17:45:31 bouyer Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -163,11 +163,13 @@ struct btmagic_softc {
 	int			sc_rw;
 
 	/* previous touches */
-	uint32_t		sc_smask;	/* scrolling */
-	int			sc_az[16];
-	int			sc_aw[16];
+	uint32_t		sc_smask;	/* active(s) IDs */
+	int			sc_nfingers;	/* number of active IDs */
+	int			sc_ax[16];
+	int			sc_ay[16];
 
 	/* previous mouse buttons */
+	int			sc_mb_id; /* which ID selects the button */
 	uint32_t		sc_mb;
 };
 
@@ -216,7 +218,16 @@ static void  btmagic_complete(void *, in
 static void  btmagic_linkmode(void *, int);
 static void  btmagic_input(void *, struct mbuf *);
 static void  btmagic_input_basic(struct btmagic_softc *, uint8_t *, size_t);
-static void  btmagic_input_magic(struct btmagic_softc *, uint8_t *, size_t);
+static void  btmagic_input_magicm(struct btmagic_softc *, uint8_t *, size_t);
+static void  btmagic_input_magict(struct btmagic_softc *, uint8_t *, size_t);
+
+/* report types (data[1]) */
+#define BASIC_REPORT_ID		0x10
+#define TRACKPAD_REPORT_ID	0x28
+#define MOUSE_REPORT_ID		0x29
+#define BATT_STAT_REPORT_ID	0x30
+#define BATT_STRENGHT_REPORT_ID	0x47
+#define SURFACE_REPORT_ID	0x61
 
 static const struct btproto btmagic_ctl_proto = {
 	btmagic_connecting,
@@ -259,7 +270,8 @@ btmagic_match(device_t self, cfdata_t cf
 	if (prop_dictionary_get_uint16(aux, BTDEVvendor, v)
 	 prop_dictionary_get_uint16(aux, BTDEVproduct, p)
 	 v == USB_VENDOR_APPLE
-	 p == USB_PRODUCT_APPLE_MAGICMOUSE)
+	 (p == USB_PRODUCT_APPLE_MAGICMOUSE ||
+		p == USB_PRODUCT_APPLE_MAGICTRACKPAD))
 		return 2;	/* trump bthidev(4) */
 
 	return 0;
@@ -1047,15 +1059,18 @@ btmagic_input(void *arg, struct mbuf *m)
 			break;
 
 		switch (data[1]) {
-		case 0x10: /* Basic mouse (input) */
+		case BASIC_REPORT_ID: /* Basic mouse (input) */
 			btmagic_input_basic(sc, data + 2, len - 2);
 			break;
 
-		case 0x29: /* Magic touch (input) */
-			btmagic_input_magic(sc, data + 2, len - 2);
+		case TRACKPAD_REPORT_ID: /* Magic trackpad (input) */
+			btmagic_input_magict(sc, data + 2, len - 2);
+			break;
+		case MOUSE_REPORT_ID: /* Magic touch (input) */
+			btmagic_input_magicm(sc, data + 2, len - 2);
 			break;
 
-		case 0x30: /* Battery status (input) */
+		case BATT_STAT_REPORT_ID: /* Battery status (input) */
 			if (len != 3)
 break;
 
@@ -1068,7 +1083,7 @@ btmagic_input(void *arg, struct mbuf *m)
 			}
 			break;
 
-		case 0x47: /* Battery strength (feature) */
+		case BATT_STRENGHT_REPORT_ID: /* Battery strength (feature) */
 			if (len != 3)
 break;
 
@@ -1076,7 +1091,7 @@ btmagic_input(void *arg, struct mbuf *m)
 			data[2]);
 			break;
 
-		case 0x61: /* Surface detection (input) */
+		case SURFACE_REPORT_ID: /* Surface detection (input) */
 			if (len != 3)
 break;
 
@@ -1246,7 +1261,7 @@ static const struct {
 #define BTMAGIC_PHASE_CANCEL	0x0
 
 static void
-btmagic_input_magic(struct btmagic_softc *sc, uint8_t *data, size_t len)
+btmagic_input_magicm(struct btmagic_softc *sc, uint8_t *data, size_t len)
 {
 	uint32_t mb;
 	int dx, dy, dz, dw;
@@ -1290,10 +1305,12 @@ btmagic_input_magic(struct btmagic_softc
 
 		switch (hid_get_udata(data, touch.phase)) {
 		case BTMAGIC_PHASE_CONT:
+#define sc_az sc_ay
+#define sc_aw sc_ax
 			tz = az - sc-sc_az[id];
 			tw = aw - sc-sc_aw[id];
 
-			if (ISSET(sc-sc_smask, id)) {
+			if (ISSET(sc-sc_smask, __BIT(id))) {
 /* scrolling finger */
 dz += btmagic_scale(tz, sc-sc_rz,
 sc-sc_resolution / sc-sc_scale);
@@ -1307,7 +1324,7 @@ btmagic_input_magic(struct btmagic_softc
 	

CVS commit: src/share/man/man4

2015-04-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr  6 17:57:51 UTC 2015

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

Log Message:
Mention magic trackpad support


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/btmagic.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/btmagic.4
diff -u src/share/man/man4/btmagic.4:1.2 src/share/man/man4/btmagic.4:1.3
--- src/share/man/man4/btmagic.4:1.2	Mon Oct 11 15:15:57 2010
+++ src/share/man/man4/btmagic.4	Mon Apr  6 17:57:51 2015
@@ -1,4 +1,4 @@
-.\ $NetBSD: btmagic.4,v 1.2 2010/10/11 15:15:57 plunky Exp $
+.\ $NetBSD: btmagic.4,v 1.3 2015/04/06 17:57:51 bouyer Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,12 +27,12 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 11, 2010
+.Dd April 6, 2015
 .Dt BTMAGIC 4
 .Os
 .Sh NAME
 .Nm btmagic
-.Nd Apple Magic Mouse
+.Nd Apple Magic Mouse and Apple Magic Trackpad
 .Sh SYNOPSIS
 .Cd btmagic*	at bthub?
 .Cd wsmouse*	at btmagic?
@@ -42,6 +42,8 @@ The
 driver provides support for the
 .Tn Bluetooth
 .Dq Magic Mouse
+and
+.Dq Magic Trackpad
 from
 .Tn Apple, Inc .
 As remote devices cannot be discovered by autoconfig, configuring
@@ -49,7 +51,7 @@ a mouse is normally carried out with the
 .Xr btdevctl 8
 program.
 .Pp
-The Magic Mouse uses the standard
+The Magic Mouse and Magic Trackpad use the standard
 .Tn USB
 Human Interface Device protocol to communicate, but does not provide a
 proper HID Descriptor, and requires specific initializations to enable
@@ -69,6 +71,19 @@ along with the pressure needed to discer
 distance necessary to trigger scrolling and the additional downscale
 factor applied to scroll movements.
 .Pp
+The Magic Trackpad provides multi touch functionality and one button.
+The
+.Nm
+driver emulates 3 buttons by splitting the area at the bottom of the
+device if 3 equal zones and detect finger presence in one of these zones
+when the button is pressed. Pointer movement is reported for single-touch
+movements over the device, and scroll is reported for multi-touch movements.
+
+The trackpad has a base resolution of 1300dpi, which the driver scales
+by default to a less sensitive 650dpi, but this is adjustable with
+.Xr sysctl 8
+along with the additional downscale factor applied to scroll movements.
+.Pp
 .Nm
 interfaces to the system as usual through the
 .Xr wsmouse 4
@@ -77,7 +92,7 @@ driver, and the following properties are
 .It vendor-id
 Must be 0x05ac.
 .It product-id
-Must be 0x030d.
+Must be 0x030d or 0x030e.
 .It local-bdaddr
 Local device address.
 .It remote-bdaddr
@@ -115,3 +130,9 @@ with reference to the
 .Tn Linux
 driver written by
 .An Michael Poole .
+.An Manuel Bouyer added Magic Trackpad support, with reference to the
+.Tn Linux
+driver written by
+.An Michael Poole
+and
+.An Chase Douglas .



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 17:59:36 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
resizing of ffsv2 still doesn't work well, so revert previous, and instead
explicitly set fsize=2048/bsize=16384, which gives a pretty decent boost
to resize_ffs performance on its own


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.53 src/distrib/utils/embedded/mkimage:1.54
--- src/distrib/utils/embedded/mkimage:1.53	Sun Apr  5 17:05:45 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 17:59:36 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.53 2015/04/05 17:05:45 jmcneill Exp $
+# $NetBSD: mkimage,v 1.54 2015/04/06 17:59:36 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -178,7 +178,7 @@ if [ -z ${bootonly} ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
 	-O ${ffsoffset} \
-	-o v=2,d=4096 -b $((${extra}))m \
+	-o d=4096,f=2048,b=16384 -b $((${extra}))m \
 	-F $tmp/selected_sets ${image} ${release} ${mnt}
 fi
 



CVS commit: src/doc

2015-04-06 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Apr  6 17:59:10 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
btmagic(4): add Magic Trackpad support


To generate a diff of this commit:
cvs rdiff -u -r1.2064 -r1.2065 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.2064 src/doc/CHANGES:1.2065
--- src/doc/CHANGES:1.2064	Sat Apr  4 00:03:12 2015
+++ src/doc/CHANGES	Mon Apr  6 17:59:10 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2064 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2065 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -149,3 +149,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	tcpdump(8): Import 4.7.3. [christos 20150331]
 	wpa: Import wpa_supplicant and hostapd 2.4. [christos 20150401]
 	OpenSSH: Imported 6.8. [christos 20150403]
+	btmagic(4): add Magic Trackpad support [bouyer 20150406]



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 20:19:28 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf rpi.conf
Added Files:
src/distrib/utils/embedded/files: resize_disklabel

Log Message:
Add support for auto-growing the root partition. Enable it for rpi.img.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.20 -r1.21 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/resize_disklabel

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.54 src/distrib/utils/embedded/mkimage:1.55
--- src/distrib/utils/embedded/mkimage:1.54	Mon Apr  6 17:59:36 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 20:19:28 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.54 2015/04/06 17:59:36 jmcneill Exp $
+# $NetBSD: mkimage,v 1.55 2015/04/06 20:19:28 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -109,6 +109,7 @@ selected_sets=$sets
 dsets_p=false
 xsets_p=false
 minwrites=false
+resize=false
 rootdev=ld
 
 OPTIND=1

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.20 src/distrib/utils/embedded/conf/evbarm.conf:1.21
--- src/distrib/utils/embedded/conf/evbarm.conf:1.20	Thu Jan 29 14:54:06 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Mon Apr  6 20:19:28 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.20 2015/01/29 14:54:06 skrll Exp $
+# $NetBSD: evbarm.conf,v 1.21 2015/04/06 20:19:28 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -134,9 +134,25 @@ dhcpcd=YES
 ntpd=YES
 ntpd_flags=-g
 EOF
+
+	if $resize; then
+		cat  ${mnt}/etc/rc.conf  EOF
+resize_disklabel=YES
+resize_disklabel_disk=ld0
+resize_disklabel_part=a
+resize_root=YES
+resize_root_postcmd=/sbin/reboot -n
+EOF
+	fi
+
 	echo ./etc/rc.conf type=file uname=root gname=wheel mode=0644 \
 	 $tmp/selected_sets
 
+	mkdir ${mnt}/etc/rc.d
+	cp ${DIR}/files/resize_disklabel ${mnt}/etc/rc.d/resize_disklabel
+	echo ./etc/rc.d/resize_disklabel type=file uname=root gname=wheel mode=0555 \
+	 $tmp/selected_sets
+
 	if [ ! -f ${release}/dev/MAKEDEV ]; then
 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 12
 		exit 1

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.27 src/distrib/utils/embedded/conf/rpi.conf:1.28
--- src/distrib/utils/embedded/conf/rpi.conf:1.27	Fri Mar  6 11:11:55 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Mon Apr  6 20:19:28 2015
@@ -1,9 +1,10 @@
-# $NetBSD: rpi.conf,v 1.27 2015/03/06 11:11:55 skrll Exp $
+# $NetBSD: rpi.conf,v 1.28 2015/04/06 20:19:28 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
+resize=true
 
 . ${DIR}/conf/evbarm.conf
 

Added files:

Index: src/distrib/utils/embedded/files/resize_disklabel
diff -u /dev/null src/distrib/utils/embedded/files/resize_disklabel:1.1
--- /dev/null	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/files/resize_disklabel	Mon Apr  6 20:19:28 2015
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# $NetBSD: resize_disklabel,v 1.1 2015/04/06 20:19:28 jmcneill Exp $
+#
+
+# PROVIDE: resize_disklabel
+# REQUIRE: fsck_root
+# BEFORE: resize_root
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name=resize_disklabel
+rcvar=$name
+start_cmd=resize_disklabel_start
+stop_cmd=:
+
+get_rawpart()
+{
+	partno=$(/sbin/sysctl -n kern.rawpartition)
+	test $partno = 2  echo c || echo d
+}
+
+get_total_sectors()
+{
+	disk=$1
+	/sbin/drvctl -p $disk disk-info/geometry/sectors-per-unit
+}
+
+get_rawpart_sectors()
+{
+	disk=$1
+	rawpart=$2
+	/sbin/disklabel $disk | grep ^ $rawpart: | awk '{ print $2; }'
+}
+
+grow_disklabel()
+{
+	disk=$1
+	part=$2
+	rawpart=$(get_rawpart)
+
+	ts=$(get_total_sectors $disk)
+	rs=$(get_rawpart_sectors $disk $rawpart)
+
+	if [ $ts = $rs ]; then
+		return
+	fi
+
+	oldsize=$(($rs * 512 / 1024 / 1024))
+	newsize=$(($ts * 512 / 1024 / 1024))
+	echo Growing $disk disklabel (${oldsize}MB - ${newsize}MB)
+	printf A\ny\n$part\n\n\n\$\nc\n\n\n\$\nd\n\n\n\$\nW\ny\nQ\n | \
+	disklabel -i $disk /dev/null
+}
+
+resize_disklabel_start()
+{
+	if [ x${resize_disklabel_disk} = x ]; then
+		warn \${resize_disklabel_disk} is not set, not resizing disklabel
+		return
+	fi
+	if [ x${resize_disklabel_part} = x ]; then
+		warn \${resize_disklabel_part} is not set, not resizing disklabel
+		return
+	fi
+
+	grow_disklabel ${resize_disklabel_disk} ${resize_disklabel_part}
+}
+
+load_rc_config $name
+run_rc_command $1



CVS commit: [netbsd-7] src/doc

2015-04-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr  6 18:51:15 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
666, the number of the pullup ticket (666+1 as well)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.249 -r1.1.2.250 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.249 src/doc/CHANGES-7.0:1.1.2.250
--- src/doc/CHANGES-7.0:1.1.2.249	Mon Apr  6 02:03:15 2015
+++ src/doc/CHANGES-7.0	Mon Apr  6 18:51:14 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.249 2015/04/06 02:03:15 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.250 2015/04/06 18:51:14 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19516,3 +19516,19 @@ libexec/ld.elf_so/rtld.c			1.176
 	PR lib/49813: Release mutex on error, avoiding a deadlock.
 	[joerg, ticket #665]
 
+sys/dev/sysmon/sysmon_envsys.c			1.129
+sys/dev/sysmon/sysmon_envsys_events.c		1.114
+sys/dev/sysmon/sysmonvar.h			1.46
+
+	Avoid a deadlock where an active event holds sme_mtx, the
+	callout sme_events_check blocks on sme_mtx and callout
+	processing stops.
+	[hannken, ticket #666]
+
+distrib/utils/embedded/mkimage			1.54
+
+	Resizing of ffsv2 still doesn't work well, so use ffsv1 and 
+	explicitly set fsize=2048/bsize=16384, which gives a pretty
+	decent boost to resize_ffs performance.
+	[jmcneill, ticket #667]
+



CVS commit: [netbsd-7] src/sys/dev/sysmon

2015-04-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr  6 18:45:31 UTC 2015

Modified Files:
src/sys/dev/sysmon [netbsd-7]: sysmon_envsys.c sysmon_envsys_events.c
sysmonvar.h

Log Message:
Pull up following revision(s) (requested by hannken in ticket #666):
sys/dev/sysmon/sysmon_envsys.c: revision 1.129
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.114
sys/dev/sysmon/sysmonvar.h: revision 1.46
Add a counter of busy events and stop enqueueing more work if a device =
is busy.
Protect this counter with a new short time lock sme_work_mtx and
keep sme_mtx as long time lock.
Removes a deadlock where an active event holds sme_mtx, the callout
sme_events_check blocks on sme_mtx and callout processing stops.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.127.2.1 src/sys/dev/sysmon/sysmon_envsys.c
cvs rdiff -u -r1.110.4.1 -r1.110.4.2 \
src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -u -r1.44.12.1 -r1.44.12.2 src/sys/dev/sysmon/sysmonvar.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/sysmon/sysmon_envsys.c
diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.127 src/sys/dev/sysmon/sysmon_envsys.c:1.127.2.1
--- src/sys/dev/sysmon/sysmon_envsys.c:1.127	Sun Aug 10 16:44:36 2014
+++ src/sys/dev/sysmon/sysmon_envsys.c	Mon Apr  6 18:45:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_envsys.c,v 1.127 2014/08/10 16:44:36 tls Exp $	*/
+/*	$NetBSD: sysmon_envsys.c,v 1.127.2.1 2015/04/06 18:45:30 snj Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.127 2014/08/10 16:44:36 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.127.2.1 2015/04/06 18:45:30 snj Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -485,6 +485,7 @@ sysmon_envsys_create(void)
 	TAILQ_INIT(sme-sme_sensors_list);
 	LIST_INIT(sme-sme_events_list);
 	mutex_init(sme-sme_mtx, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sme-sme_work_mtx, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(sme-sme_condvar, sme_wait);
 
 	return sme;
@@ -508,6 +509,7 @@ sysmon_envsys_destroy(struct sysmon_envs
 		TAILQ_REMOVE(sme-sme_sensors_list, edata, sensors_head);
 	}
 	mutex_destroy(sme-sme_mtx);
+	mutex_destroy(sme-sme_work_mtx);
 	cv_destroy(sme-sme_condvar);
 	kmem_free(sme, sizeof(*sme));
 }

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.110.4.1 src/sys/dev/sysmon/sysmon_envsys_events.c:1.110.4.2
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.110.4.1	Mon Dec  1 11:38:42 2014
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Mon Apr  6 18:45:30 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.110.4.1 2014/12/01 11:38:42 martin Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.110.4.2 2015/04/06 18:45:30 snj Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.110.4.1 2014/12/01 11:38:42 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.110.4.2 2015/04/06 18:45:30 snj Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, $NetBSD: sysmon_envsy
 #include sys/mutex.h
 #include sys/kmem.h
 #include sys/callout.h
+#include sys/syslog.h
 
 #include dev/sysmon/sysmonvar.h
 #include dev/sysmon/sysmon_envsysvar.h
@@ -712,11 +713,23 @@ sme_events_check(void *arg)
 
 	KASSERT(sme != NULL);
 
+	mutex_enter(sme-sme_work_mtx);
+	if (sme-sme_busy  0) {
+		log(LOG_WARNING, %s: workqueue busy: updates stopped\n,
+		sme-sme_name);
+		mutex_exit(sme-sme_work_mtx);
+		return;
+	}
+	mutex_exit(sme-sme_work_mtx);
+
 	mutex_enter(sme-sme_mtx);
+	mutex_enter(sme-sme_work_mtx);
 	LIST_FOREACH(see, sme-sme_events_list, see_list) {
 		workqueue_enqueue(sme-sme_wq, see-see_wk, NULL);
 		see-see_edata-flags |= ENVSYS_FNEED_REFRESH;
+		sme-sme_busy++;
 	}
+	mutex_exit(sme-sme_work_mtx);
 	if (!sysmon_low_power)
 		sme_schedule_callout(sme);
 	mutex_exit(sme-sme_mtx);
@@ -796,6 +809,10 @@ sme_events_worker(struct work *wk, void 
 out:
 	see-see_flags = ~SEE_EVENT_WORKING;
 	cv_broadcast(sme-sme_condvar);
+	mutex_enter(sme-sme_work_mtx);
+	KASSERT(sme-sme_busy  0);
+	sme-sme_busy--;
+	mutex_exit(sme-sme_work_mtx);
 	mutex_exit(sme-sme_mtx);
 }
 

Index: src/sys/dev/sysmon/sysmonvar.h
diff -u src/sys/dev/sysmon/sysmonvar.h:1.44.12.1 src/sys/dev/sysmon/sysmonvar.h:1.44.12.2
--- src/sys/dev/sysmon/sysmonvar.h:1.44.12.1	Mon Dec  1 11:38:42 2014
+++ src/sys/dev/sysmon/sysmonvar.h	Mon Apr  6 18:45:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmonvar.h,v 1.44.12.1 2014/12/01 11:38:42 martin Exp $	*/
+/*	$NetBSD: sysmonvar.h,v 1.44.12.2 2015/04/06 18:45:30 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -207,7 +207,11 @@ struct sysmon_envsys {
 	/*
 	 * Locking/synchronization.
 	 */
+	int 

CVS commit: [netbsd-7] src/distrib/utils/embedded

2015-04-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr  6 18:47:54 UTC 2015

Modified Files:
src/distrib/utils/embedded [netbsd-7]: mkimage

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #667):
distrib/utils/embedded/mkimage: revision 1.54
resizing of ffsv2 still doesn't work well, so revert previous, and instead
explicitly set fsize=2048/bsize=16384, which gives a pretty decent boost
to resize_ffs performance on its own


To generate a diff of this commit:
cvs rdiff -u -r1.48.4.4 -r1.48.4.5 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.48.4.4 src/distrib/utils/embedded/mkimage:1.48.4.5
--- src/distrib/utils/embedded/mkimage:1.48.4.4	Mon Apr  6 01:59:36 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 18:47:54 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.48.4.4 2015/04/06 01:59:36 snj Exp $
+# $NetBSD: mkimage,v 1.48.4.5 2015/04/06 18:47:54 snj Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -178,7 +178,7 @@ if [ -z ${bootonly} ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
 	-O ${ffsoffset} \
-	-o v=2,d=4096 -b $((${extra}))m \
+	-o d=4096,f=2048,b=16384 -b $((${extra}))m \
 	-F $tmp/selected_sets ${image} ${release} ${mnt}
 fi
 



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 19:28:40 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: xhci.c

Log Message:
Cosmetic/Whitespace changes from Takahiro HAYASHI


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.17 -r1.28.2.18 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.17 src/sys/dev/usb/xhci.c:1.28.2.18
--- src/sys/dev/usb/xhci.c:1.28.2.17	Mon Apr  6 18:30:39 2015
+++ src/sys/dev/usb/xhci.c	Mon Apr  6 19:28:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.17 2015/04/06 18:30:39 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.18 2015/04/06 19:28:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.17 2015/04/06 18:30:39 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.28.2.18 2015/04/06 19:28:40 skrll Exp $);
 
 #include opt_usb.h
 
@@ -62,7 +62,7 @@ __KERNEL_RCSID(0, $NetBSD: xhci.c,v 1.2
 #ifdef USB_DEBUG
 #ifndef XHCI_DEBUG
 #define xhcidebug 0
-#else
+#else /* !XHCI_DEBUG */
 static int xhcidebug = 0;
 
 SYSCTL_SETUP(sysctl_hw_xhci_setup, sysctl hw.xhci setup)
@@ -92,7 +92,7 @@ fail:
 	aprint_error(%s: sysctl_createv failed (err = %d)\n, __func__, err);
 }
 
-#endif /* XHCI_DEBUG */
+#endif /* !XHCI_DEBUG */
 #endif /* USB_DEBUG */
 
 #define DPRINTFN(N,FMT,A,B,C,D) USBHIST_LOGN(xhcidebug,N,FMT,A,B,C,D)
@@ -1109,7 +1109,7 @@ xhci_set_dequeue(struct usbd_pipe *pipe)
 static usbd_status
 xhci_open(struct usbd_pipe *pipe)
 {
-	struct usbd_device *const dev = pipe-up_dev;
+	struct usbd_device * const dev = pipe-up_dev;
 	struct xhci_softc * const sc = dev-ud_bus-ub_hcpriv;
 	usb_endpoint_descriptor_t * const ed = pipe-up_endpoint-ue_edesc;
 	const uint8_t xfertype = UE_GET_XFERTYPE(ed-bmAttributes);
@@ -1168,7 +1168,7 @@ xhci_open(struct usbd_pipe *pipe)
 static void
 xhci_rhpsc(struct xhci_softc * const sc, u_int port)
 {
-	struct usbd_xfer *const xfer = sc-sc_intrxfer;
+	struct usbd_xfer * const xfer = sc-sc_intrxfer;
 	uint8_t *p;
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
@@ -1303,7 +1303,7 @@ xhci_handle_event(struct xhci_softc * co
 static void
 xhci_softintr(void *v)
 {
-	struct usbd_bus *const bus = v;
+	struct usbd_bus * const bus = v;
 	struct xhci_softc * const sc = bus-ub_hcpriv;
 	struct xhci_ring * const er = sc-sc_er;
 	struct xhci_trb *trb;
@@ -1983,7 +1983,8 @@ xhci_noop(struct usbd_pipe *pipe)
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
 }
 
-static int xhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req,
+static int
+xhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req,
 void *buf, int buflen)
 {
 	struct xhci_softc * const sc = bus-ub_hcpriv;
@@ -2666,7 +2667,7 @@ static void
 xhci_timeout(void *addr)
 {
 	struct xhci_xfer * const xx = addr;
-	struct usbd_xfer *const xfer = xx-xx_xfer;
+	struct usbd_xfer * const xfer = xx-xx_xfer;
 	struct xhci_softc * const sc = xfer-ux_pipe-up_dev-ud_bus-ub_hcpriv;
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
@@ -2684,7 +2685,7 @@ xhci_timeout(void *addr)
 static void
 xhci_timeout_task(void *addr)
 {
-	struct usbd_xfer *const xfer = addr;
+	struct usbd_xfer * const xfer = addr;
 	struct xhci_softc * const sc = xfer-ux_pipe-up_dev-ud_bus-ub_hcpriv;
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:20:52 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
initialize resize before pulling in board config


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.55 src/distrib/utils/embedded/mkimage:1.56
--- src/distrib/utils/embedded/mkimage:1.55	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 22:20:52 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.55 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: mkimage,v 1.56 2015/04/06 22:20:52 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -102,6 +102,8 @@ then
 	exit 1
 fi
 
+resize=false
+
 . ${DIR}/conf/${h}.conf
 release=/usr/obj/${MACHINE}/release
 
@@ -109,7 +111,6 @@ selected_sets=$sets
 dsets_p=false
 xsets_p=false
 minwrites=false
-resize=false
 rootdev=ld
 
 OPTIND=1



CVS commit: src/etc/rc.d

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:40:09 UTC 2015

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

Log Message:
add KEYWORD: interactive, honour resize_root_flags and resize_root_postcmd rc 
vars


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/resize_root

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/resize_root
diff -u src/etc/rc.d/resize_root:1.1 src/etc/rc.d/resize_root:1.2
--- src/etc/rc.d/resize_root:1.1	Mon Mar 30 10:58:37 2015
+++ src/etc/rc.d/resize_root	Mon Apr  6 22:40:09 2015
@@ -1,10 +1,11 @@
 #!/bin/sh
 #
-# $NetBSD: resize_root,v 1.1 2015/03/30 10:58:37 chopps Exp $
+# $NetBSD: resize_root,v 1.2 2015/04/06 22:40:09 jmcneill Exp $
 #
 
 # PROVIDE: resize_root
 # REQUIRE: fsck_root
+# KEYWORD: interactive
 
 $_rc_subr_loaded . /etc/rc.subr
 
@@ -81,10 +82,13 @@ resize_root_start()
 
 	if resize_ffs -c $rootdev; then
 		echo Resizing $rootmp
-		if ! resize_ffs -y $rootdev; then
+		if ! resize_ffs -p $resize_root_flags $rootdev; then
 		echo Error resizing root.
 		stop_boot
 		fi
+		if [ ! -z ${resize_root_postcmd} ]; then
+			${resize_root_postcmd}
+		fi
 	else
 		echo Not resizing $rootmp: already correct size
 	fi



CVS commit: src/distrib/utils/embedded/conf

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:44:46 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
show resize_ffs progress bar when resizing root partition


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.21 src/distrib/utils/embedded/conf/evbarm.conf:1.22
--- src/distrib/utils/embedded/conf/evbarm.conf:1.21	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Mon Apr  6 22:44:46 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.21 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.22 2015/04/06 22:44:46 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -141,6 +141,7 @@ resize_disklabel=YES
 resize_disklabel_disk=ld0
 resize_disklabel_part=a
 resize_root=YES
+resize_root_flags=-p
 resize_root_postcmd=/sbin/reboot -n
 EOF
 	fi



CVS commit: src/share/man/man4

2015-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr  6 21:10:31 UTC 2015

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

Log Message:
Grammar, whitespace; make AUTHORS section from HISTORY since it mostly cites
people.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/btmagic.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/btmagic.4
diff -u src/share/man/man4/btmagic.4:1.3 src/share/man/man4/btmagic.4:1.4
--- src/share/man/man4/btmagic.4:1.3	Mon Apr  6 17:57:51 2015
+++ src/share/man/man4/btmagic.4	Mon Apr  6 21:10:31 2015
@@ -1,4 +1,4 @@
-.\ $NetBSD: btmagic.4,v 1.3 2015/04/06 17:57:51 bouyer Exp $
+.\ $NetBSD: btmagic.4,v 1.4 2015/04/06 21:10:31 wiz Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -53,8 +53,8 @@ program.
 .Pp
 The Magic Mouse and Magic Trackpad use the standard
 .Tn USB
-Human Interface Device protocol to communicate, but does not provide a
-proper HID Descriptor, and requires specific initializations to enable
+Human Interface Device protocol to communicate, but do not provide a
+proper HID Descriptor, and require specific initializations to enable
 the proprietary touch reports.
 .Pp
 The Magic Mouse provides basic mouse functionality with two buttons,
@@ -75,10 +75,11 @@ The Magic Trackpad provides multi touch 
 The
 .Nm
 driver emulates 3 buttons by splitting the area at the bottom of the
-device if 3 equal zones and detect finger presence in one of these zones
-when the button is pressed. Pointer movement is reported for single-touch
+device in 3 equal zones and detects finger presence in one of these zones
+when the button is pressed.
+Pointer movement is reported for single-touch
 movements over the device, and scroll is reported for multi-touch movements.
-
+.Pp
 The trackpad has a base resolution of 1300dpi, which the driver scales
 by default to a less sensitive 650dpi, but this is adjustable with
 .Xr sysctl 8
@@ -121,7 +122,8 @@ during the pairing process.
 .Xr wsmouse 4 ,
 .Xr btdevctl 8 ,
 .Xr sysctl 8
-.Sh HISTORY
+.Sh AUTHORS
+.An -nosplit
 The
 .Nm
 driver was written by
@@ -130,7 +132,8 @@ with reference to the
 .Tn Linux
 driver written by
 .An Michael Poole .
-.An Manuel Bouyer added Magic Trackpad support, with reference to the
+.An Manuel Bouyer
+added Magic Trackpad support, with reference to the
 .Tn Linux
 driver written by
 .An Michael Poole



CVS commit: src/sbin/resize_ffs

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:44:04 UTC 2015

Modified Files:
src/sbin/resize_ffs: Makefile resize_ffs.8 resize_ffs.c

Log Message:
if the -p flag is specified, display a progress bar while growing the 
file-system


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/resize_ffs/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sbin/resize_ffs/resize_ffs.8
cvs rdiff -u -r1.43 -r1.44 src/sbin/resize_ffs/resize_ffs.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/resize_ffs/Makefile
diff -u src/sbin/resize_ffs/Makefile:1.4 src/sbin/resize_ffs/Makefile:1.5
--- src/sbin/resize_ffs/Makefile:1.4	Mon Aug 15 02:19:50 2011
+++ src/sbin/resize_ffs/Makefile	Mon Apr  6 22:44:04 2015
@@ -1,11 +1,14 @@
-#	$NetBSD: Makefile,v 1.4 2011/08/15 02:19:50 dholland Exp $
+#	$NetBSD: Makefile,v 1.5 2015/04/06 22:44:04 jmcneill Exp $
 
 .include bsd.own.mk
 
 PROG=resize_ffs
 MAN=resize_ffs.8
-SRCS=resize_ffs.c ffs_bswap.c
+SRCS=resize_ffs.c ffs_bswap.c progress.c
+
+CPPFLAGS+=-I${NETBSDSRCDIR}/sbin/fsck
 
 .PATH: ${NETBSDSRCDIR}/sys/ufs/ffs
+.PATH: ${NETBSDSRCDIR}/sbin/fsck
 
 .include bsd.prog.mk

Index: src/sbin/resize_ffs/resize_ffs.8
diff -u src/sbin/resize_ffs/resize_ffs.8:1.15 src/sbin/resize_ffs/resize_ffs.8:1.16
--- src/sbin/resize_ffs/resize_ffs.8:1.15	Sun Mar 29 19:42:15 2015
+++ src/sbin/resize_ffs/resize_ffs.8	Mon Apr  6 22:44:04 2015
@@ -1,4 +1,4 @@
-.\ $NetBSD: resize_ffs.8,v 1.15 2015/03/29 19:42:15 wiz Exp $
+.\ $NetBSD: resize_ffs.8,v 1.16 2015/04/06 22:44:04 jmcneill Exp $
 .\
 .\ As its sole author, I explicitly place this man page in the public
 .\ domain.  Anyone may use it in any way for any purpose (though I would
@@ -9,7 +9,7 @@
 .\  X  Against HTML   mo...@rodents.montreal.qc.ca
 .\ / \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
 .\
-.Dd January 4, 2011
+.Dd April 6, 2015
 .Dt RESIZE_FFS 8
 .Os
 .Sh NAME
@@ -17,7 +17,7 @@
 .Nd resize a file system on disk or in a file
 .Sh SYNOPSIS
 .Nm
-.Op Fl cvy
+.Op Fl cpvy
 .Op Fl s Ar size
 .Ar special
 .Sh DESCRIPTION
@@ -58,6 +58,8 @@ The options are as follows:
 .It Fl c
 Check to see if the new size would change the file system.
 No changes will be made to the file system.
+.It Fl p
+Display a progress meter during the resize process.
 .It Fl s
 Specify the file system size to which the file system should be
 resized.

Index: src/sbin/resize_ffs/resize_ffs.c
diff -u src/sbin/resize_ffs/resize_ffs.c:1.43 src/sbin/resize_ffs/resize_ffs.c:1.44
--- src/sbin/resize_ffs/resize_ffs.c:1.43	Mon Apr  6 13:33:42 2015
+++ src/sbin/resize_ffs/resize_ffs.c	Mon Apr  6 22:44:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_ffs.c,v 1.43 2015/04/06 13:33:42 mlelstv Exp $	*/
+/*	$NetBSD: resize_ffs.c,v 1.44 2015/04/06 22:44:04 jmcneill Exp $	*/
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: resize_ffs.c,v 1.43 2015/04/06 13:33:42 mlelstv Exp $);
+__RCSID($NetBSD: resize_ffs.c,v 1.44 2015/04/06 22:44:04 jmcneill Exp $);
 
 #include sys/disk.h
 #include sys/disklabel.h
@@ -59,12 +59,17 @@ __RCSID($NetBSD: resize_ffs.c,v 1.43 20
 #include strings.h
 #include unistd.h
 
+#include progress.h
+
 /* new size of file system, in sectors */
 static int64_t newsize;
 
 /* fd open onto disk device or file */
 static int fd;
 
+/* disk device or file path */
+char *special;
+
 /* must we break up big I/O operations - see checksmallio() */
 static int smallio;
 
@@ -153,6 +158,7 @@ static unsigned char *iflags;
 int is_ufs2 = 0;
 int needswap = 0;
 int verbose = 0;
+int progress = 0;
 
 static void usage(void) __dead;
 
@@ -1015,6 +1021,8 @@ grow(void)
 cgs);
 		for (i = oldsb-fs_ncg; i  newsb-fs_ncg; i++) {
 			cgs[i] = (struct cg *) cgp;
+			progress_bar(special, grow cg,
+			i - oldsb-fs_ncg, newsb-fs_ncg - oldsb-fs_ncg);
 			initcg(i);
 			cgp += cgblksz;
 		}
@@ -1043,6 +1051,8 @@ grow(void)
 	csum_fixup();
 	/* Make fs_dsize match the new reality. */
 	recompute_fs_dsize();
+
+	progress_done();
 }
 /*
  * Call (*fn)() for each inode, passing the inode and its inumber.  The
@@ -1990,6 +2000,8 @@ flush_cgs(void)
 	int i;
 
 	for (i = 0; i  newsb-fs_ncg; i++) {
+		progress_bar(special, flush cg,
+		i, newsb-fs_ncg - 1);
 		if (cgflags[i]  CGF_BLKMAPS) {
 			rescan_blkmaps(i);
 		}
@@ -2009,6 +2021,8 @@ flush_cgs(void)
 	if (needswap)
 		ffs_csum_swap(csums,csums,newsb-fs_cssize);
 	writeat(FFS_FSBTODB(newsb, newsb-fs_csaddr), csums, newsb-fs_cssize);
+
+	progress_done();
 }
 /*
  * Write the superblock, both to the main superblock and to each cg's
@@ -2038,8 +2052,12 @@ write_sbs(void)
 		ffs_sb_swap(newsb,newsb);
 	writeat(where /  DEV_BSIZE, newsb, SBLOCKSIZE);
 	for (i = 0; i  oldsb-fs_ncg; i++) {
+		

CVS commit: src/usr.bin/gzip

2015-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr  6 21:41:17 UTC 2015

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

Log Message:
Document xz decompression support better. From Joachim Henke on netbsd-docs.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/gzip/gzip.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/gzip/gzip.1
diff -u src/usr.bin/gzip/gzip.1:1.24 src/usr.bin/gzip/gzip.1:1.25
--- src/usr.bin/gzip/gzip.1:1.24	Tue Jan 13 02:37:20 2015
+++ src/usr.bin/gzip/gzip.1	Mon Apr  6 21:41:17 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: gzip.1,v 1.24 2015/01/13 02:37:20 mrg Exp $
+.\	$NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $
 .\
 .\ Copyright (c) 1997, 2003, 2004 Matthew R. Green
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd January 13, 2015
+.Dd April 6, 2015
 .Dt GZIP 1
 .Os
 .Sh NAME
@@ -92,9 +92,10 @@ options are enabled.
 This version of
 .Nm
 is also capable of decompressing files compressed using
-.Xr compress 1
+.Xr compress 1 ,
+.Xr bzip2 1 ,
 or
-.Xr bzip2 1 .
+.Xr xz 1 .
 .Sh OPTIONS
 The following options are available:
 .Bl -tag -width XXrXXXrecursiveX



CVS commit: src/sys/dev/hpc

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr  7 01:24:32 UTC 2015

Modified Files:
src/sys/dev/hpc: hpcfb.c

Log Message:
Add missing semicolon


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/hpc/hpcfb.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/hpc/hpcfb.c
diff -u src/sys/dev/hpc/hpcfb.c:1.59 src/sys/dev/hpc/hpcfb.c:1.60
--- src/sys/dev/hpc/hpcfb.c:1.59	Sat Apr  4 15:39:40 2015
+++ src/sys/dev/hpc/hpcfb.c	Tue Apr  7 01:24:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcfb.c,v 1.59 2015/04/04 15:39:40 christos Exp $	*/
+/*	$NetBSD: hpcfb.c,v 1.60 2015/04/07 01:24:32 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -43,7 +43,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hpcfb.c,v 1.59 2015/04/04 15:39:40 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: hpcfb.c,v 1.60 2015/04/07 01:24:32 ozaki-r Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_hpcfb.h
@@ -472,7 +472,7 @@ hpcfb_init(struct hpcfb_fbconf *fbconf,	
 	}
 
 	if (rasops_init(ri, HPCFB_MAX_ROW, HPCFB_MAX_COLUMN)) {
-		aprint_error_dev(dc-dc_sc-sc_dev, rasops_init() failed!)
+		aprint_error_dev(dc-dc_sc-sc_dev, rasops_init() failed!);
 		return -1;
 	}
 



CVS commit: src/sys/arch/arm

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr  7 03:19:25 UTC 2015

Modified Files:
src/sys/arch/arm/ep93xx: ep93xx_intr.c
src/sys/arch/arm/ixp12x0: ixp12x0_intr.c

Log Message:
Add missing #include arm/cpu.h


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/ep93xx/ep93xx_intr.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/ixp12x0/ixp12x0_intr.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/ep93xx/ep93xx_intr.c
diff -u src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.22 src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.23
--- src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.22	Wed Mar 26 08:51:59 2014
+++ src/sys/arch/arm/ep93xx/ep93xx_intr.c	Tue Apr  7 03:19:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.23 2015/04/07 03:19:24 ozaki-r Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ep93xx_intr.c,v 1.22 2014/03/26 08:51:59 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ep93xx_intr.c,v 1.23 2015/04/07 03:19:24 ozaki-r Exp $);
 
 /*
  * Interrupt support for the Cirrus Logic EP93XX
@@ -48,6 +48,7 @@ __KERNEL_RCSID(0, $NetBSD: ep93xx_intr.
 #include sys/intr.h
 
 #include arm/locore.h
+#include arm/cpu.h
 
 #include arm/ep93xx/ep93xxreg.h 
 #include arm/ep93xx/ep93xxvar.h 

Index: src/sys/arch/arm/ixp12x0/ixp12x0_intr.c
diff -u src/sys/arch/arm/ixp12x0/ixp12x0_intr.c:1.29 src/sys/arch/arm/ixp12x0/ixp12x0_intr.c:1.30
--- src/sys/arch/arm/ixp12x0/ixp12x0_intr.c:1.29	Wed Mar 26 08:52:00 2014
+++ src/sys/arch/arm/ixp12x0/ixp12x0_intr.c	Tue Apr  7 03:19:25 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ixp12x0_intr.c,v 1.29 2014/03/26 08:52:00 christos Exp $ */
+/* $NetBSD: ixp12x0_intr.c,v 1.30 2015/04/07 03:19:25 ozaki-r Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ixp12x0_intr.c,v 1.29 2014/03/26 08:52:00 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ixp12x0_intr.c,v 1.30 2015/04/07 03:19:25 ozaki-r Exp $);
 
 /*
  * Interrupt support for the Intel ixp12x0
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, $NetBSD: ixp12x0_intr
 #include sys/intr.h
 
 #include arm/locore.h
+#include arm/cpu.h
 
 #include arm/ixp12x0/ixp12x0reg.h 
 #include arm/ixp12x0/ixp12x0var.h 



CVS commit: src/sys/net

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr  7 04:36:19 UTC 2015

Modified Files:
src/sys/net: route.c

Log Message:
Clean up rtcache_setdst

We can assume sockaddr_copy never return NULL when we pass
non-NULL dst (1st argument).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/net/route.c

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

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.141 src/sys/net/route.c:1.142
--- src/sys/net/route.c:1.141	Mon Apr  6 08:39:06 2015
+++ src/sys/net/route.c	Tue Apr  7 04:36:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.141 2015/04/06 08:39:06 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.142 2015/04/07 04:36:19 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@
 #include opt_route.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: route.c,v 1.141 2015/04/06 08:39:06 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: route.c,v 1.142 2015/04/07 04:36:19 ozaki-r Exp $);
 
 #include sys/param.h
 #ifdef RTFLUSH_DEBUG
@@ -1468,15 +1468,16 @@ rtcache_setdst(struct route *ro, const s
 	KASSERT(sa != NULL);
 
 	rtcache_invariants(ro);
-	if (ro-ro_sa != NULL  ro-ro_sa-sa_family == sa-sa_family) {
-		rtcache_clear(ro);
-		if (sockaddr_copy(ro-ro_sa, ro-ro_sa-sa_len, sa) != NULL) {
-			rtcache_invariants(ro);
-			return 0;
+	if (ro-ro_sa != NULL) {
+		if (ro-ro_sa-sa_family == sa-sa_family) {
+			rtcache_clear(ro);
+			sockaddr_copy(ro-ro_sa, ro-ro_sa-sa_len, sa);
+			sockaddr_free(ro-ro_sa);
+		} else {
+			/* free ro_sa, wrong family */
+			rtcache_free(ro);
 		}
-		sockaddr_free(ro-ro_sa);
-	} else if (ro-ro_sa != NULL)
-		rtcache_free(ro);	/* free ro_sa, wrong family */
+	}
 
 	KASSERT(ro-_ro_rt == NULL);
 



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 07:09:00 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c

Log Message:
Use an anonymous union in struct ehci_pipe and rename the ctl member to
ctrl.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.46 -r1.234.2.47 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.46 src/sys/dev/usb/ehci.c:1.234.2.47
--- src/sys/dev/usb/ehci.c:1.234.2.46	Sat Mar 21 16:42:55 2015
+++ src/sys/dev/usb/ehci.c	Mon Apr  6 07:08:59 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.46 2015/03/21 16:42:55 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.47 2015/04/06 07:08:59 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.46 2015/03/21 16:42:55 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.47 2015/04/06 07:08:59 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -137,7 +137,7 @@ struct ehci_pipe {
 		/* Control pipe */
 		struct {
 			usb_dma_t reqdma;
-		} ctl;
+		} ctrl;
 		/* Interrupt pipe */
 		struct {
 			u_int length;
@@ -147,7 +147,7 @@ struct ehci_pipe {
 			u_int next_frame;
 			u_int cur_xfers;
 		} isoc;
-	} u;
+	};
 };
 
 Static usbd_status	ehci_open(struct usbd_pipe *);
@@ -1965,7 +1965,7 @@ ehci_open(struct usbd_pipe *pipe)
 	switch (xfertype) {
 	case UE_CONTROL:
 		err = usb_allocmem(sc-sc_bus, sizeof(usb_device_request_t),
-   0, epipe-u.ctl.reqdma);
+   0, epipe-ctrl.reqdma);
 #ifdef EHCI_DEBUG
 		if (err)
 			printf(ehci_open: usb_allocmem()=%d\n, err);
@@ -2019,8 +2019,8 @@ ehci_open(struct usbd_pipe *pipe)
 			err = USBD_INVAL;
 			goto bad;
 		}
-		epipe-u.isoc.next_frame = 0;
-		epipe-u.isoc.cur_xfers = 0;
+		epipe-isoc.next_frame = 0;
+		epipe-isoc.cur_xfers = 0;
 		break;
 	default:
 		USBHIST_LOG(ehcidebug, bad xfer type %d, xfertype, 0, 0, 0);
@@ -3470,7 +3470,7 @@ ehci_device_ctrl_done(struct usbd_xfer *
 	if (xfer-ux_status != USBD_NOMEM  ehci_active_intr_list(ex)) {
 		ehci_del_intr_list(sc, ex);	/* remove from active list */
 		ehci_free_sqtd_chain(sc, ex-ex_sqtdstart, NULL);
-		usb_syncmem(epipe-u.ctl.reqdma, 0, sizeof(*req),
+		usb_syncmem(epipe-ctrl.reqdma, 0, sizeof(*req),
 		BUS_DMASYNC_POSTWRITE);
 		if (len)
 			usb_syncmem(xfer-ux_dmabuf, 0, len,
@@ -3577,8 +3577,8 @@ ehci_device_request(struct usbd_xfer *xf
 		next = stat;
 	}
 
-	memcpy(KERNADDR(epipe-u.ctl.reqdma, 0), req, sizeof(*req));
-	usb_syncmem(epipe-u.ctl.reqdma, 0, sizeof(*req), BUS_DMASYNC_PREWRITE);
+	memcpy(KERNADDR(epipe-ctrl.reqdma, 0), req, sizeof(*req));
+	usb_syncmem(epipe-ctrl.reqdma, 0, sizeof(*req), BUS_DMASYNC_PREWRITE);
 
 	/* Clear toggle */
 	setup-qtd.qtd_status = htole32(
@@ -3588,7 +3588,7 @@ ehci_device_request(struct usbd_xfer *xf
 	EHCI_QTD_SET_TOGGLE(0) |
 	EHCI_QTD_SET_BYTES(sizeof(*req))
 	);
-	setup-qtd.qtd_buffer[0] = htole32(DMAADDR(epipe-u.ctl.reqdma, 0));
+	setup-qtd.qtd_buffer[0] = htole32(DMAADDR(epipe-ctrl.reqdma, 0));
 	setup-qtd.qtd_buffer_hi[0] = 0;
 	setup-nextqtd = next;
 	setup-qtd.qtd_next = setup-qtd.qtd_altnext = htole32(next-physaddr);
@@ -3914,7 +3914,7 @@ ehci_device_intr_start(struct usbd_xfer 
 	isread = UE_GET_DIR(endpt) == UE_DIR_IN;
 	sqh = epipe-sqh;
 
-	epipe-u.intr.length = len;
+	epipe-intr.length = len;
 
 	err = ehci_alloc_sqtd_chain(epipe, sc, len, isread, xfer, data,
 	dataend);
@@ -4016,7 +4016,7 @@ ehci_device_intr_done(struct usbd_xfer *
 	if (xfer-ux_pipe-up_repeat) {
 		ehci_free_sqtd_chain(sc, exfer-ex_sqtdstart, NULL);
 
-		len = epipe-u.intr.length;
+		len = epipe-intr.length;
 		xfer-ux_length = len;
 		endpt = epipe-pipe.up_endpoint-ue_edesc-bEndpointAddress;
 		isread = UE_GET_DIR(endpt) == UE_DIR_IN;
@@ -4273,8 +4273,8 @@ ehci_device_fs_isoc_start(struct usbd_xf
 	mutex_enter(sc-sc_lock);
 
 	/* Start inserting frames */
-	if (epipe-u.isoc.cur_xfers  0) {
-		frindex = epipe-u.isoc.next_frame;
+	if (epipe-isoc.cur_xfers  0) {
+		frindex = epipe-isoc.next_frame;
 	} else {
 		frindex = EOREAD4(sc, EHCI_FRINDEX);
 		frindex = frindex  3; /* Erase microframe index */
@@ -4332,8 +4332,8 @@ ehci_device_fs_isoc_start(struct usbd_xf
 		sitd = sitd-xfer_next;
 	}
 
-	epipe-u.isoc.cur_xfers++;
-	epipe-u.isoc.next_frame = frindex;
+	epipe-isoc.cur_xfers++;
+	epipe-isoc.next_frame = frindex;
 
 	exfer-ex_sitdstart = start;
 	exfer-ex_sitdend = stop;
@@ -4381,7 +4381,7 @@ ehci_device_fs_isoc_done(struct usbd_xfe
 
 	KASSERT(mutex_owned(sc-sc_lock));
 
-	epipe-u.isoc.cur_xfers--;
+	epipe-isoc.cur_xfers--;
 	if (xfer-ux_status != USBD_NOMEM  ehci_active_intr_list(exfer)) {
 		ehci_del_intr_list(sc, exfer);
 		ehci_rem_free_sitd_chain(sc, exfer);
@@ -4601,8 +4601,8 @@ ehci_device_isoc_start(struct usbd_xfer 
 	

CVS commit: src/sys/dev/pci

2015-04-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr  6 07:38:17 UTC 2015

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

Log Message:
Make sure to halt (not just stop) the bge_tick callout during detach.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.280 src/sys/dev/pci/if_bge.c:1.281
--- src/sys/dev/pci/if_bge.c:1.280	Tue Feb 17 23:07:56 2015
+++ src/sys/dev/pci/if_bge.c	Mon Apr  6 07:38:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.280 2015/02/17 23:07:56 enami Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.281 2015/04/06 07:38:17 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.280 2015/02/17 23:07:56 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.281 2015/04/06 07:38:17 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -5749,7 +5749,10 @@ bge_stop(struct ifnet *ifp, int disable)
 {
 	struct bge_softc *sc = ifp-if_softc;
 
-	callout_stop(sc-bge_timeout);
+	if (disable)
+		callout_halt(sc-bge_timeout, NULL);
+	else
+		callout_stop(sc-bge_timeout);
 
 	/* Disable host interrupts. */
 	BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR);



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

2015-04-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr  6 10:49:13 UTC 2015

Modified Files:
src/sys/arch/playstation2/conf: Makefile.playstation2.inc

Log Message:
Force gcc to pass -msoft-float to the assembler (to make newer binutils
happy)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/sys/arch/playstation2/conf/Makefile.playstation2.inc

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/playstation2/conf/Makefile.playstation2.inc
diff -u src/sys/arch/playstation2/conf/Makefile.playstation2.inc:1.8 src/sys/arch/playstation2/conf/Makefile.playstation2.inc:1.9
--- src/sys/arch/playstation2/conf/Makefile.playstation2.inc:1.8	Wed Jul  2 13:27:14 2014
+++ src/sys/arch/playstation2/conf/Makefile.playstation2.inc	Mon Apr  6 10:49:13 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.playstation2.inc,v 1.8 2014/07/02 13:27:14 martin Exp $
+#	$NetBSD: Makefile.playstation2.inc,v 1.9 2015/04/06 10:49:13 martin Exp $
 
 .if !defined(EXTERNAL_TOOLCHAIN) || ${EXTERNAL_TOOLCHAIN}==
 .error please do not run make directly, use sh ../../conf/build.playstation2.sh instead
@@ -21,5 +21,5 @@ SIZE=${PREFIX}/bin/${PLATFORM}-size
 STRIP=${PREFIX}/bin/${PLATFORM}-strip
 
 # Playstation2 uses 128 bit access, which currently requires n32 ABI
-CFLAGS+= -mabi=n32 -march=r5900 -fno-pic -msoft-float
+CFLAGS+= -mabi=n32 -march=r5900 -fno-pic -msoft-float -Wa,-msoft-float
 AFLAGS+= -mabi=n32 -march=r5900 -fno-pic -msoft-float



CVS commit: src/sys/fs/udf

2015-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr  6 08:39:23 UTC 2015

Modified Files:
src/sys/fs/udf: udf.h udf_subr.c udf_vfsops.c udf_vnops.c

Log Message:
Change udf to vcache, keyed on udf_node-loc.loc.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/fs/udf/udf.h
cvs rdiff -u -r1.128 -r1.129 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.67 -r1.68 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.99 -r1.100 src/sys/fs/udf/udf_vnops.c

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

Modified files:

Index: src/sys/fs/udf/udf.h
diff -u src/sys/fs/udf/udf.h:1.47 src/sys/fs/udf/udf.h:1.48
--- src/sys/fs/udf/udf.h:1.47	Wed Sep 17 19:47:05 2014
+++ src/sys/fs/udf/udf.h	Mon Apr  6 08:39:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.h,v 1.47 2014/09/17 19:47:05 reinoud Exp $ */
+/* $NetBSD: udf.h,v 1.48 2015/04/06 08:39:23 hannken Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -94,6 +94,7 @@ extern int udf_verbose;
 #define DPRINTFIF(name, cond, arg) {}
 #endif
 
+VFS_PROTOS(udf);
 
 /* constants to identify what kind of identifier we are dealing with */
 #define UDF_REGID_DOMAIN		 1
@@ -339,7 +340,6 @@ struct udf_mount {
 
 	/* rb tree for lookup icb to udf_node and sorted list for sync */
 	kmutex_t	ihash_lock;
-	kmutex_t	get_node_lock;
 	struct rb_tree	udf_node_tree;
 
 	/* syncing */

Index: src/sys/fs/udf/udf_subr.c
diff -u src/sys/fs/udf/udf_subr.c:1.128 src/sys/fs/udf/udf_subr.c:1.129
--- src/sys/fs/udf/udf_subr.c:1.128	Sat Feb  7 04:18:03 2015
+++ src/sys/fs/udf/udf_subr.c	Mon Apr  6 08:39:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.128 2015/02/07 04:18:03 christos Exp $ */
+/* $NetBSD: udf_subr.c,v 1.129 2015/04/06 08:39:23 hannken Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__KERNEL_RCSID(0, $NetBSD: udf_subr.c,v 1.128 2015/02/07 04:18:03 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: udf_subr.c,v 1.129 2015/04/06 08:39:23 hannken Exp $);
 #endif /* not lint */
 
 
@@ -3444,31 +3444,6 @@ udf_init_nodes_tree(struct udf_mount *um
 }
 
 
-static struct udf_node *
-udf_node_lookup(struct udf_mount *ump, struct long_ad *icbptr)
-{
-	struct udf_node *udf_node;
-	struct vnode *vp;
-
-loop:
-	mutex_enter(ump-ihash_lock);
-
-	udf_node = rb_tree_find_node(ump-udf_node_tree, icbptr);
-	if (udf_node) {
-		vp = udf_node-vnode;
-		assert(vp);
-		mutex_enter(vp-v_interlock);
-		mutex_exit(ump-ihash_lock);
-		if (vget(vp, LK_EXCLUSIVE))
-			goto loop;
-		return udf_node;
-	}
-	mutex_exit(ump-ihash_lock);
-
-	return NULL;
-}
-
-
 static void
 udf_register_node(struct udf_node *udf_node)
 {
@@ -5279,44 +5254,33 @@ error_out:
  */
 
 int
-udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
-	 struct udf_node **udf_noderes)
+udf_loadvnode(struct mount *mp, struct vnode *vp,
+ const void *key, size_t key_len, const void **new_key)
 {
 	union dscrptr   *dscr;
+	struct udf_mount *ump;
 	struct udf_node *udf_node;
-	struct vnode*nvp;
-	struct long_ad   icb_loc, next_icb_loc, last_fe_icb_loc;
+	struct long_ad node_icb_loc, icb_loc, next_icb_loc, last_fe_icb_loc;
 	uint64_t file_size;
 	uint32_t lb_size, sector, dummy;
 	int udf_file_type, dscr_type, strat, strat4096, needs_indirect;
 	int slot, eof, error;
 	int num_indir_followed = 0;
 
-	DPRINTF(NODE, (udf_get_node called\n));
-	*udf_noderes = udf_node = NULL;
-
-	/* lock to disallow simultanious creation of same udf_node */
-	mutex_enter(ump-get_node_lock);
-
-	DPRINTF(NODE, (\tlookup in hash table\n));
-	/* lookup in hash table */
-	assert(ump);
-	assert(node_icb_loc);
-	udf_node = udf_node_lookup(ump, node_icb_loc);
-	if (udf_node) {
-		DPRINTF(NODE, (\tgot it from the hash!\n));
-		/* vnode is returned locked */
-		*udf_noderes = udf_node;
-		mutex_exit(ump-get_node_lock);
-		return 0;
-	}
+	DPRINTF(NODE, (udf_loadvnode called\n));
+	udf_node = NULL;
+	ump = VFSTOUDF(mp);
+
+	KASSERT(key_len == sizeof(node_icb_loc.loc));
+	memset(node_icb_loc, 0, sizeof(node_icb_loc));
+	node_icb_loc.len = ump-logical_vol-lb_size;
+	memcpy(node_icb_loc.loc, key, key_len);
 
 	/* garbage check: translate udf_node_icb_loc to sectornr */
-	error = udf_translate_vtop(ump, node_icb_loc, sector, dummy);
+	error = udf_translate_vtop(ump, node_icb_loc, sector, dummy);
 	if (error) {
 		DPRINTF(NODE, (\tcan't translate icb address!\n));
 		/* no use, this will fail anyway */
-		mutex_exit(ump-get_node_lock);
 		return EINVAL;
 	}
 
@@ -5324,33 +5288,18 @@ udf_get_node(struct udf_mount *ump, stru
 	udf_node = pool_get(udf_node_pool, PR_WAITOK);
 	memset(udf_node, 0, sizeof(struct udf_node));
 
-	DPRINTF(NODE, (\tget new vnode\n));
-	/* give it a vnode */
-	error = getnewvnode(VT_UDF, ump-vfs_mountp, udf_vnodeop_p, NULL, nvp);
-	if (error) {
-		pool_put(udf_node_pool, udf_node);
-		mutex_exit(ump-get_node_lock);
-		return error;
-	}
-
-	/* always return locked vnode */
-	if 

CVS commit: src/sys/fs/udf

2015-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr  6 08:38:25 UTC 2015

Modified Files:
src/sys/fs/udf: udf_vnops.c

Log Message:
Move the removal of unlinked nodes from udf_inactive() to udf_reclaim().


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/fs/udf/udf_vnops.c

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

Modified files:

Index: src/sys/fs/udf/udf_vnops.c
diff -u src/sys/fs/udf/udf_vnops.c:1.98 src/sys/fs/udf/udf_vnops.c:1.99
--- src/sys/fs/udf/udf_vnops.c:1.98	Sat Apr  4 12:34:45 2015
+++ src/sys/fs/udf/udf_vnops.c	Mon Apr  6 08:38:25 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.98 2015/04/04 12:34:45 riastradh Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.99 2015/04/06 08:38:25 hannken Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__KERNEL_RCSID(0, $NetBSD: udf_vnops.c,v 1.98 2015/04/04 12:34:45 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: udf_vnops.c,v 1.99 2015/04/06 08:38:25 hannken Exp $);
 #endif /* not lint */
 
 
@@ -97,9 +97,7 @@ udf_inactive(void *v)
 	}
 
 	/*
-	 * Optionally flush metadata to disc. If the file has not been
-	 * referenced anymore in a directory we ought to free up the resources
-	 * on disc if applicable.
+	 * Optionally flush metadata to disc.
 	 */
 	if (udf_node-fe) {
 		refcnt = udf_rw16(udf_node-fe-link_cnt);
@@ -116,10 +114,7 @@ udf_inactive(void *v)
 
 	*ap-a_recycle = false;
 	if ((refcnt == 0)  ((vp-v_vflag  VV_SYSTEM) == 0)) {
-	 	/* remove this file's allocation */
-		DPRINTF(NODE, (udf_inactive deleting unlinked file\n));
 		*ap-a_recycle = true;
-		udf_delete_node(udf_node);
 		VOP_UNLOCK(vp);
 		return 0;
 	}
@@ -144,6 +139,7 @@ udf_reclaim(void *v)
 	} */ *ap = v;
 	struct vnode *vp = ap-a_vp;
 	struct udf_node *udf_node = VTOI(vp);
+	int refcnt;
 
 	DPRINTF(NODE, (udf_reclaim called for node %p\n, udf_node));
 	if (prtactive  vp-v_usecount  1)
@@ -154,6 +150,23 @@ udf_reclaim(void *v)
 		return 0;
 	}
 
+	/*
+	 * If the file has not been referenced anymore in a directory
+	 * we ought to free up the resources on disc if applicable.
+	 */
+	if (udf_node-fe) {
+		refcnt = udf_rw16(udf_node-fe-link_cnt);
+	} else {
+		assert(udf_node-efe);
+		refcnt = udf_rw16(udf_node-efe-link_cnt);
+	}
+
+	if ((refcnt == 0)  ((vp-v_vflag  VV_SYSTEM) == 0)) {
+	 	/* remove this file's allocation */
+		DPRINTF(NODE, (udf_inactive deleting unlinked file\n));
+		udf_delete_node(udf_node);
+	}
+
 	/* update note for closure */
 	udf_update(vp, NULL, NULL, NULL, UPDATE_CLOSE);
 



CVS commit: src/sys/net

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr  6 08:39:06 UTC 2015

Modified Files:
src/sys/net: route.c route.h

Log Message:
Make rt_maskedcopy static


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/sys/net/route.c
cvs rdiff -u -r1.88 -r1.89 src/sys/net/route.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/net/route.c
diff -u src/sys/net/route.c:1.140 src/sys/net/route.c:1.141
--- src/sys/net/route.c:1.140	Mon Apr  6 06:20:27 2015
+++ src/sys/net/route.c	Mon Apr  6 08:39:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.140 2015/04/06 06:20:27 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.141 2015/04/06 08:39:06 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@
 #include opt_route.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: route.c,v 1.140 2015/04/06 06:20:27 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: route.c,v 1.141 2015/04/06 08:39:06 ozaki-r Exp $);
 
 #include sys/param.h
 #ifdef RTFLUSH_DEBUG
@@ -145,6 +145,9 @@ static int rtdeletemsg(struct rtentry *)
 static int rtflushclone1(struct rtentry *, void *);
 static void rtflushclone(sa_family_t family, struct rtentry *);
 
+static void rt_maskedcopy(const struct sockaddr *,
+struct sockaddr *, const struct sockaddr *);
+
 #ifdef RTFLUSH_DEBUG
 static void sysctl_net_rtcache_setup(struct sysctllog **);
 static void
@@ -872,7 +875,7 @@ rt_setgate(struct rtentry *rt, const str
 	return 0;
 }
 
-void
+static void
 rt_maskedcopy(const struct sockaddr *src, struct sockaddr *dst,
 	const struct sockaddr *netmask)
 {

Index: src/sys/net/route.h
diff -u src/sys/net/route.h:1.88 src/sys/net/route.h:1.89
--- src/sys/net/route.h:1.88	Mon Mar 23 18:33:17 2015
+++ src/sys/net/route.h	Mon Apr  6 08:39:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.h,v 1.88 2015/03/23 18:33:17 roy Exp $	*/
+/*	$NetBSD: route.h,v 1.89 2015/04/06 08:39:06 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -368,8 +368,6 @@ void	 rt_missmsg(int, const struct rt_ad
 struct mbuf *rt_msg1(int, struct rt_addrinfo *, void *, int);
 void	 rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *);
 
-void	 rt_maskedcopy(const struct sockaddr *,
-	struct sockaddr *, const struct sockaddr *);
 int	 rt_setgate(struct rtentry *, const struct sockaddr *);
 int  rt_timer_add(struct rtentry *,
  void(*)(struct rtentry *, struct rttimer *),



CVS commit: src/libexec/ld.elf_so

2015-04-06 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Apr  6 09:34:15 UTC 2015

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
Fix membars around rtld internal mutex.

This fixes the most of lockups i observed with Open vSwitch
on NetBSD/amd64.  (most of because it still occasionally
locks up because of other problems.  see PR/49816)


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.176 src/libexec/ld.elf_so/rtld.c:1.177
--- src/libexec/ld.elf_so/rtld.c:1.176	Sat Apr  4 18:51:57 2015
+++ src/libexec/ld.elf_so/rtld.c	Mon Apr  6 09:34:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.176 2015/04/04 18:51:57 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.177 2015/04/06 09:34:15 yamt Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.176 2015/04/04 18:51:57 joerg Exp $);
+__RCSID($NetBSD: rtld.c,v 1.177 2015/04/06 09:34:15 yamt Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -1544,6 +1544,7 @@ _rtld_shared_enter(void)
 			/* Yes, so increment use counter */
 			if (atomic_cas_uint(_rtld_mutex, cur, cur + 1) != cur)
 continue;
+			membar_enter();
 			return;
 		}
 		/*
@@ -1561,6 +1562,7 @@ _rtld_shared_enter(void)
 		/*
 		 * Check for race against _rtld_exclusive_exit before sleeping.
 		 */
+		membar_sync();
 		if ((_rtld_mutex  RTLD_EXCLUSIVE_MASK) ||
 		_rtld_waiter_exclusive)
 			_lwp_park(CLOCK_REALTIME, 0, NULL, 0,
@@ -1588,12 +1590,12 @@ _rtld_shared_exit(void)
 	 * Wakeup LWPs waiting for an exclusive lock if this is the last
 	 * LWP on the shared lock.
 	 */
+	membar_exit();
 	if (atomic_dec_uint_nv(_rtld_mutex))
 		return;
+	membar_sync();
 	if ((waiter = _rtld_waiter_exclusive) != 0)
 		_lwp_unpark(waiter, __UNVOLATILE(_rtld_mutex));
-
-	membar_exit();
 }
 
 void
@@ -1608,12 +1610,13 @@ _rtld_exclusive_enter(sigset_t *mask)
 	sigdelset(blockmask, SIGTRAP);	/* Allow the debugger */
 	sigprocmask(SIG_BLOCK, blockmask, mask);
 
-	membar_enter();
-
 	for (;;) {
-		if (atomic_cas_uint(_rtld_mutex, 0, locked_value) == 0)
+		if (atomic_cas_uint(_rtld_mutex, 0, locked_value) == 0) {
+			membar_enter();
 			break;
+		}
 		waiter = atomic_swap_uint(_rtld_waiter_exclusive, self);
+		membar_sync();
 		cur = _rtld_mutex;
 		if (cur == locked_value) {
 			_rtld_error(dead lock detected);
@@ -1633,13 +1636,14 @@ _rtld_exclusive_exit(sigset_t *mask)
 {
 	lwpid_t waiter;
 
+	membar_exit();
 	_rtld_mutex = 0;
+	membar_sync();
 	if ((waiter = _rtld_waiter_exclusive) != 0)
 		_lwp_unpark(waiter, __UNVOLATILE(_rtld_mutex));
 
 	if ((waiter = _rtld_waiter_shared) != 0)
 		_lwp_unpark(waiter, __UNVOLATILE(_rtld_mutex));
 
-	membar_exit();
 	sigprocmask(SIG_SETMASK, mask, NULL);
 }



CVS commit: src/sys/net

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr  6 09:45:58 UTC 2015

Modified Files:
src/sys/net: route.h

Log Message:
Classify and sort prototype declarations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/net/route.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/net/route.h
diff -u src/sys/net/route.h:1.89 src/sys/net/route.h:1.90
--- src/sys/net/route.h:1.89	Mon Apr  6 08:39:06 2015
+++ src/sys/net/route.h	Mon Apr  6 09:45:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.h,v 1.89 2015/04/06 08:39:06 ozaki-r Exp $	*/
+/*	$NetBSD: route.h,v 1.90 2015/04/06 09:45:58 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -360,47 +360,48 @@ extern	struct	rtstat	rtstat;
 struct socket;
 struct dom_rtlist;
 
-void	 rt_init(void);
-void	 rt_ifannouncemsg(struct ifnet *, int);
-void	 rt_ieee80211msg(struct ifnet *, int, void *, size_t);
-void	 rt_ifmsg(struct ifnet *);
-void	 rt_missmsg(int, const struct rt_addrinfo *, int, int);
-struct mbuf *rt_msg1(int, struct rt_addrinfo *, void *, int);
-void	 rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *);
-
-int	 rt_setgate(struct rtentry *, const struct sockaddr *);
-int  rt_timer_add(struct rtentry *,
- void(*)(struct rtentry *, struct rttimer *),
-	 struct rttimer_queue *);
-void	 rt_timer_init(void);
+void	rt_init(void);
+
+int	rt_timer_add(struct rtentry *,
+	void(*)(struct rtentry *, struct rttimer *),
+	struct rttimer_queue *);
+unsigned long
+	rt_timer_count(struct rttimer_queue *);
+void	rt_timer_init(void);
+void	rt_timer_queue_change(struct rttimer_queue *, long);
 struct rttimer_queue *
-	 rt_timer_queue_create(u_int);
-void	 rt_timer_queue_change(struct rttimer_queue *, long);
-void	 rt_timer_queue_remove_all(struct rttimer_queue *, int);
-void	 rt_timer_queue_destroy(struct rttimer_queue *, int);
-void	 rt_timer_remove_all(struct rtentry *, int);
-unsigned long	rt_timer_count(struct rttimer_queue *);
-void	 rt_timer_timer(void *);
-void	 rtflushall(int);
+	rt_timer_queue_create(u_int);
+void	rt_timer_queue_destroy(struct rttimer_queue *, int);
+void	rt_timer_queue_remove_all(struct rttimer_queue *, int);
+void	rt_timer_remove_all(struct rtentry *, int);
+void	rt_timer_timer(void *);
+
+void	rt_newmsg(int, struct rtentry *);
 struct rtentry *
-	 rtalloc1(const struct sockaddr *, int);
-void	 rtfree(struct rtentry *);
-int	 rt_getifa(struct rt_addrinfo *);
-void	 rt_newmsg(int, struct rtentry *);
-int	 rtinit(struct ifaddr *, int, int);
-void	 rtredirect(const struct sockaddr *, const struct sockaddr *,
+	rtalloc1(const struct sockaddr *, int);
+void	rtflushall(int);
+void	rtfree(struct rtentry *);
+int	rtinit(struct ifaddr *, int, int);
+void	rtredirect(const struct sockaddr *, const struct sockaddr *,
 	const struct sockaddr *, int, const struct sockaddr *,
 	struct rtentry **);
-int	 rtrequest(int, const struct sockaddr *,
+int	rtrequest(int, const struct sockaddr *,
 	const struct sockaddr *, const struct sockaddr *, int,
 	struct rtentry **);
-int	 rtrequest1(int, struct rt_addrinfo *, struct rtentry **);
+int	rtrequest1(int, struct rt_addrinfo *, struct rtentry **);
 
-struct ifaddr	*rt_get_ifa(struct rtentry *);
+int	rt_ifa_addlocal(struct ifaddr *);
+int	rt_ifa_remlocal(struct ifaddr *, struct ifaddr *);
+struct ifaddr *
+	rt_get_ifa(struct rtentry *);
+int	rt_getifa(struct rt_addrinfo *);
 void	rt_replace_ifa(struct rtentry *, struct ifaddr *);
+int	rt_setgate(struct rtentry *, const struct sockaddr *);
 
-const struct sockaddr *rt_settag(struct rtentry *, const struct sockaddr *);
-struct sockaddr *rt_gettag(struct rtentry *);
+const struct sockaddr *
+	rt_settag(struct rtentry *, const struct sockaddr *);
+struct sockaddr *
+	rt_gettag(struct rtentry *);
 
 static inline void
 rt_destroy(struct rtentry *rt)
@@ -428,17 +429,20 @@ out:
 	return rt-_rt_key;
 }
 
-struct rtentry *rtcache_init(struct route *);
-struct rtentry *rtcache_init_noclone(struct route *);
-void	rtcache_copy(struct route *, const struct route *);
-void rtcache_invalidate(struct dom_rtlist *);
-
-struct rtentry *rtcache_lookup2(struct route *, const struct sockaddr *, int,
-int *);
 void	rtcache_clear(struct route *);
-struct rtentry *rtcache_update(struct route *, int);
+void	rtcache_copy(struct route *, const struct route *);
 void	rtcache_free(struct route *);
+struct rtentry *
+	rtcache_init(struct route *);
+struct rtentry *
+	rtcache_init_noclone(struct route *);
+void	rtcache_invalidate(struct dom_rtlist *);
+struct rtentry *
+	rtcache_lookup2(struct route *, const struct sockaddr *, int,
+	int *);
 int	rtcache_setdst(struct route *, const struct sockaddr *);
+struct rtentry *
+	rtcache_update(struct route *, int);
 
 static inline void
 rtcache_invariants(const struct route *ro)
@@ -494,20 +498,31 @@ rtcache_validate(const struct route 

CVS commit: src/sys/net

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr  6 06:26:21 UTC 2015

Modified Files:
src/sys/net: rtsock.c

Log Message:
Add hint comments for big ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/net/rtsock.c

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

Modified files:

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.167 src/sys/net/rtsock.c:1.168
--- src/sys/net/rtsock.c:1.167	Fri Apr  3 20:01:07 2015
+++ src/sys/net/rtsock.c	Mon Apr  6 06:26:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.167 2015/04/03 20:01:07 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.168 2015/04/06 06:26:21 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.167 2015/04/03 20:01:07 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.168 2015/04/06 06:26:21 ozaki-r Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_inet.h
@@ -107,7 +107,7 @@ __KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1
 #define	DOMAINNAME	oroute
 CTASSERT(sizeof(struct ifa_xmsghdr) == 20);
 DOMAIN_DEFINE(compat_50_routedomain); /* forward declare and add to link set */
-#else
+#else /* COMPAT_RTSOCK */
 #define	RTM_XVERSION	RTM_VERSION
 #define	RT_XADVANCE(a,b) RT_ADVANCE(a,b)
 #define	RT_XROUNDUP(n)	RT_ROUNDUP(n)
@@ -125,7 +125,7 @@ CTASSERT(sizeof(struct ifa_xmsghdr) == 2
 DOMAIN_DEFINE(routedomain); /* forward declare and add to link set */
 #undef COMPAT_50
 #undef COMPAT_14
-#endif
+#endif /* COMPAT_RTSOCK */
 
 #ifndef COMPATCALL
 #define	COMPATCALL(name, args)	do { } while (/*CONSTCOND*/ 0)



CVS commit: src/sys/net

2015-04-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Apr  6 06:16:30 UTC 2015

Modified Files:
src/sys/net: route.c

Log Message:
Remove unnecessary inclusions


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/net/route.c

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

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.138 src/sys/net/route.c:1.139
--- src/sys/net/route.c:1.138	Fri Apr  3 05:44:13 2015
+++ src/sys/net/route.c	Mon Apr  6 06:16:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.138 2015/04/03 05:44:13 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.139 2015/04/06 06:16:30 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -94,10 +94,9 @@
 #include opt_route.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: route.c,v 1.138 2015/04/03 05:44:13 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: route.c,v 1.139 2015/04/06 06:16:30 ozaki-r Exp $);
 
 #include sys/param.h
-#include sys/kmem.h
 #include sys/sysctl.h
 #include sys/systm.h
 #include sys/callout.h
@@ -115,7 +114,6 @@ __KERNEL_RCSID(0, $NetBSD: route.c,v 1.
 #include net/if.h
 #include net/if_dl.h
 #include net/route.h
-#include net/raw_cb.h
 
 #include netinet/in.h
 #include netinet/in_var.h



CVS commit: [nick-nhusb] src/sys/dev/usb

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 08:58:44 UTC 2015

Modified Files:
src/sys/dev/usb [nick-nhusb]: ehci.c ehcivar.h ohci.c uhci.c

Log Message:
Use anonymous unions in various structs and rename the ctl/iso members of
the pipe structs to ctrl/isoc.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.47 -r1.234.2.48 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.42.14.12 -r1.42.14.13 src/sys/dev/usb/ehcivar.h
cvs rdiff -u -r1.254.2.20 -r1.254.2.21 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.264.4.32 -r1.264.4.33 src/sys/dev/usb/uhci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.47 src/sys/dev/usb/ehci.c:1.234.2.48
--- src/sys/dev/usb/ehci.c:1.234.2.47	Mon Apr  6 07:08:59 2015
+++ src/sys/dev/usb/ehci.c	Mon Apr  6 08:58:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.47 2015/04/06 07:08:59 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.48 2015/04/06 08:58:43 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.47 2015/04/06 07:08:59 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.234.2.48 2015/04/06 08:58:43 skrll Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -1824,7 +1824,7 @@ ehci_dump_sitd(struct ehci_soft_itd *itd
 	USBHIST_FUNC(); USBHIST_CALLED(ehcidebug);
 
 	USBHIST_LOG(ehcidebug, SITD %p next = %p prev = %p,
-	itd, itd-u.frame_list.next, itd-u.frame_list.prev, 0);
+	itd, itd-frame_list.next, itd-frame_list.prev, 0);
 	USBHIST_LOG(ehcidebug, xfernext=%p physaddr=%X slot=%d,
 	itd-xfer_next, itd-physaddr, itd-slot, 0);
 }
@@ -2173,18 +2173,18 @@ ehci_rem_free_itd_chain(ehci_softc_t *sc
 		panic(ehci isoc xfer being freed, but with no itd chain\n);
 
 	for (itd = exfer-ex_itdstart; itd != NULL; itd = itd-xfer_next) {
-		prev = itd-u.frame_list.prev;
+		prev = itd-frame_list.prev;
 		/* Unlink itd from hardware chain, or frame array */
 		if (prev == NULL) { /* We're at the table head */
-			sc-sc_softitds[itd-slot] = itd-u.frame_list.next;
+			sc-sc_softitds[itd-slot] = itd-frame_list.next;
 			sc-sc_flist[itd-slot] = itd-itd.itd_next;
 			usb_syncmem(sc-sc_fldma,
 			sizeof(ehci_link_t) * itd-slot,
 			sizeof(ehci_link_t),
 			BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
-			if (itd-u.frame_list.next != NULL)
-itd-u.frame_list.next-u.frame_list.prev = NULL;
+			if (itd-frame_list.next != NULL)
+itd-frame_list.next-frame_list.prev = NULL;
 		} else {
 			/* XXX this part is untested... */
 			prev-itd.itd_next = itd-itd.itd_next;
@@ -2192,9 +2192,9 @@ ehci_rem_free_itd_chain(ehci_softc_t *sc
 			itd-offs + offsetof(ehci_itd_t, itd_next),
 			sizeof(itd-itd.itd_next), BUS_DMASYNC_PREWRITE);
 
-			prev-u.frame_list.next = itd-u.frame_list.next;
-			if (itd-u.frame_list.next != NULL)
-itd-u.frame_list.next-u.frame_list.prev = prev;
+			prev-frame_list.next = itd-frame_list.next;
+			if (itd-frame_list.next != NULL)
+itd-frame_list.next-frame_list.prev = prev;
 		}
 	}
 
@@ -2221,18 +2221,18 @@ ehci_rem_free_sitd_chain(ehci_softc_t *s
 		panic(ehci isoc xfer being freed, but with no sitd chain\n);
 
 	for (sitd = exfer-ex_sitdstart; sitd != NULL; sitd = sitd-xfer_next) {
-		prev = sitd-u.frame_list.prev;
+		prev = sitd-frame_list.prev;
 		/* Unlink sitd from hardware chain, or frame array */
 		if (prev == NULL) { /* We're at the table head */
-			sc-sc_softsitds[sitd-slot] = sitd-u.frame_list.next;
+			sc-sc_softsitds[sitd-slot] = sitd-frame_list.next;
 			sc-sc_flist[sitd-slot] = sitd-sitd.sitd_next;
 			usb_syncmem(sc-sc_fldma,
 			sizeof(ehci_link_t) * sitd-slot,
 			sizeof(ehci_link_t),
 			BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
-			if (sitd-u.frame_list.next != NULL)
-sitd-u.frame_list.next-u.frame_list.prev = NULL;
+			if (sitd-frame_list.next != NULL)
+sitd-frame_list.next-frame_list.prev = NULL;
 		} else {
 			/* XXX this part is untested... */
 			prev-sitd.sitd_next = sitd-sitd.sitd_next;
@@ -2240,9 +2240,9 @@ ehci_rem_free_sitd_chain(ehci_softc_t *s
 			sitd-offs + offsetof(ehci_sitd_t, sitd_next),
 			sizeof(sitd-sitd.sitd_next), BUS_DMASYNC_PREWRITE);
 
-			prev-u.frame_list.next = sitd-u.frame_list.next;
-			if (sitd-u.frame_list.next != NULL)
-sitd-u.frame_list.next-u.frame_list.prev = prev;
+			prev-frame_list.next = sitd-frame_list.next;
+			if (sitd-frame_list.next != NULL)
+sitd-frame_list.next-frame_list.prev = prev;
 		}
 	}
 
@@ -2944,7 +2944,7 @@ ehci_alloc_itd(ehci_softc_t *sc)
 	previndex = (frindex != 0) ? frindex - 1 : sc-sc_flsize;
 
 	freeitd = NULL;
-	LIST_FOREACH(itd, sc-sc_freeitds, u.free_list) {
+	LIST_FOREACH(itd, sc-sc_freeitds, free_list) {
 		if (itd == NULL)
 			break;
 		if (itd-slot != frindex  itd-slot != previndex) 

CVS commit: src/sbin/resize_ffs

2015-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr  6 12:38:21 UTC 2015

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

Log Message:
Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sbin/resize_ffs/resize_ffs.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/resize_ffs/resize_ffs.c
diff -u src/sbin/resize_ffs/resize_ffs.c:1.41 src/sbin/resize_ffs/resize_ffs.c:1.42
--- src/sbin/resize_ffs/resize_ffs.c:1.41	Sun Mar 29 19:33:55 2015
+++ src/sbin/resize_ffs/resize_ffs.c	Mon Apr  6 12:38:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_ffs.c,v 1.41 2015/03/29 19:33:55 chopps Exp $	*/
+/*	$NetBSD: resize_ffs.c,v 1.42 2015/04/06 12:38:21 mlelstv Exp $	*/
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: resize_ffs.c,v 1.41 2015/03/29 19:33:55 chopps Exp $);
+__RCSID($NetBSD: resize_ffs.c,v 1.42 2015/04/06 12:38:21 mlelstv Exp $);
 
 #include sys/disk.h
 #include sys/disklabel.h
@@ -959,9 +959,13 @@ grow(void)
 	 * minimal, at most the pre-sb data area. */
 	if (cgdmin(newsb, newsb-fs_ncg - 1)  newsb-fs_size) {
 		newsb-fs_ncg--;
-		newsb-fs_old_ncyl = newsb-fs_ncg * newsb-fs_old_cpg;
-		newsb-fs_size = (newsb-fs_old_ncyl * newsb-fs_old_spc)
-		/ NSPF(newsb);
+		if (is_ufs2)
+			newsb-fs_size = newsb-fs_ncg * newsb-fs_fpg;
+		else {
+			newsb-fs_old_ncyl = newsb-fs_ncg * newsb-fs_old_cpg;
+			newsb-fs_size = (newsb-fs_old_ncyl *
+newsb-fs_old_spc) / NSPF(newsb);
+		}
 		printf(Warning: last cylinder group is too small;\n);
 		printf(dropping it.  New size = %lu.\n,
 		(unsigned long int) FFS_FSBTODB(newsb, newsb-fs_size));
@@ -1699,17 +1703,18 @@ shrink(void)
 		newsb-fs_old_spc);
 		newsb-fs_ncg = howmany(newsb-fs_old_ncyl, newsb-fs_old_cpg);
 	}
+
 	/* Does the (new) last cg end before the end of its inode area?  See
 	 * the similar code in grow() for more on this. */
 	if (cgdmin(newsb, newsb-fs_ncg - 1)  newsb-fs_size) {
 		newsb-fs_ncg--;
-		if (is_ufs2 == 0) {
+		if (is_ufs2)
+			newsb-fs_size = newsb-fs_ncg * newsb-fs_fpg;
+		else {
 			newsb-fs_old_ncyl = newsb-fs_ncg * newsb-fs_old_cpg;
 			newsb-fs_size = (newsb-fs_old_ncyl *
 			newsb-fs_old_spc) / NSPF(newsb);
-		} else
-			newsb-fs_size = newsb-fs_ncg * newsb-fs_fpg;
-
+		}
 		printf(Warning: last cylinder group is too small;\n);
 		printf(dropping it.  New size = %lu.\n,
 		(unsigned long int) FFS_FSBTODB(newsb, newsb-fs_size));



CVS commit: src/sbin/resize_ffs

2015-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr  6 13:33:42 UTC 2015

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

Log Message:
factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/resize_ffs/resize_ffs.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/resize_ffs/resize_ffs.c
diff -u src/sbin/resize_ffs/resize_ffs.c:1.42 src/sbin/resize_ffs/resize_ffs.c:1.43
--- src/sbin/resize_ffs/resize_ffs.c:1.42	Mon Apr  6 12:38:21 2015
+++ src/sbin/resize_ffs/resize_ffs.c	Mon Apr  6 13:33:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_ffs.c,v 1.42 2015/04/06 12:38:21 mlelstv Exp $	*/
+/*	$NetBSD: resize_ffs.c,v 1.43 2015/04/06 13:33:42 mlelstv Exp $	*/
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: resize_ffs.c,v 1.42 2015/04/06 12:38:21 mlelstv Exp $);
+__RCSID($NetBSD: resize_ffs.c,v 1.43 2015/04/06 13:33:42 mlelstv Exp $);
 
 #include sys/disk.h
 #include sys/disklabel.h
@@ -914,35 +914,17 @@ timestamp(void)
 	time(t);
 	return (t);
 }
+
 /*
- * Grow the file system.
+ * Calculate new filesystem geometry
+ *  return 0 if geometry actually changed
  */
-static void
-grow(void)
+static int
+makegeometry(int chatter)
 {
-	int i;
 
-	/* Update the timestamp. */
-	newsb-fs_time = timestamp();
-	/* Allocate and clear the new-inode area, in case we add any cgs. */
-	zinodes = alloconce(newsb-fs_ipg * sizeof(*zinodes), zeroed inodes);
-	memset(zinodes, 0, newsb-fs_ipg * sizeof(*zinodes));
 	/* Update the size. */
 	newsb-fs_size = FFS_DBTOFSB(newsb, newsize);
-	/* Did we actually not grow?  (This can happen if newsize is less than
-	 * a frag larger than the old size - unlikely, but no excuse to
-	 * misbehave if it happens.) */
-	if (newsb-fs_size == oldsb-fs_size) {
-		printf(New fs size %PRIu64 = old fs size %PRIu64
-		, not growing.\n, newsb-fs_size, oldsb-fs_size);
-		return;
-	}
-	/* Check that the new last sector (frag, actually) is writable.  Since
-	 * it's at least one frag larger than it used to be, we know we aren't
-	 * overwriting anything important by this.  (The choice of sbbuf as
-	 * what to write is irrelevant; it's just something handy that's known
-	 * to be at least one frag in size.) */
-	writeat(FFS_FSBTODB(newsb,newsb-fs_size - 1), sbbuf, newsb-fs_fsize);
 	if (is_ufs2)
 		newsb-fs_ncg = howmany(newsb-fs_size, newsb-fs_fpg);
 	else {
@@ -966,10 +948,55 @@ grow(void)
 			newsb-fs_size = (newsb-fs_old_ncyl *
 newsb-fs_old_spc) / NSPF(newsb);
 		}
-		printf(Warning: last cylinder group is too small;\n);
-		printf(dropping it.  New size = %lu.\n,
-		(unsigned long int) FFS_FSBTODB(newsb, newsb-fs_size));
+		if (chatter || verbose) {
+			printf(Warning: last cylinder group is too small;\n);
+			printf(dropping it.  New size = %lu.\n,
+			(unsigned long int) FFS_FSBTODB(newsb, newsb-fs_size));
+		}
+	}
+
+	/* Did we actually not grow?  (This can happen if newsize is less than
+	 * a frag larger than the old size - unlikely, but no excuse to
+	 * misbehave if it happens.) */
+	if (newsb-fs_size == oldsb-fs_size)
+		return 1;
+
+	return 0;
+}
+
+
+/*
+ * Grow the file system.
+ */
+static void
+grow(void)
+{
+	int i;
+
+	if (makegeometry(1)) {
+		printf(New fs size %PRIu64 = old fs size %PRIu64
+		, not growing.\n, newsb-fs_size, oldsb-fs_size);
+		return;
 	}
+
+	if (verbose) {
+		printf(Growing fs from %PRIu64 blocks to %PRIu64
+		 blocks.\n, oldsb-fs_size, newsb-fs_size);
+	}
+
+	/* Update the timestamp. */
+	newsb-fs_time = timestamp();
+	/* Allocate and clear the new-inode area, in case we add any cgs. */
+	zinodes = alloconce(newsb-fs_ipg * sizeof(*zinodes), zeroed inodes);
+	memset(zinodes, 0, newsb-fs_ipg * sizeof(*zinodes));
+	
+	/* Check that the new last sector (frag, actually) is writable.  Since
+	 * it's at least one frag larger than it used to be, we know we aren't
+	 * overwriting anything important by this.  (The choice of sbbuf as
+	 * what to write is irrelevant; it's just something handy that's known
+	 * to be at least one frag in size.) */
+	writeat(FFS_FSBTODB(newsb,newsb-fs_size - 1), sbbuf, newsb-fs_fsize);
+
 	/* Find out how big the csum area is, and realloc csums if bigger. */
 	newsb-fs_cssize = ffs_fragroundup(newsb,
 	newsb-fs_ncg * sizeof(struct csum));
@@ -1690,39 +1717,28 @@ shrink(void)
 {
 	int i;
 
-	/* Load the inodes off disk - we'll need 'em. */
-	loadinodes();
-	/* Update the timestamp. */
-	newsb-fs_time = timestamp();
-	/* Update the size figures. */
-	newsb-fs_size = FFS_DBTOFSB(newsb, newsize);
-	if (is_ufs2)
-		newsb-fs_ncg = howmany(newsb-fs_size, newsb-fs_fpg);
-	else {
-		newsb-fs_old_ncyl = howmany(newsb-fs_size * NSPF(newsb),
-		

CVS commit: src

2015-04-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr  6 14:18:09 UTC 2015

Modified Files:
src/distrib/evbmips/instkernel/instkernel: Makefile
src/etc/etc.evbmips: Makefile.inc
Added Files:
src/sys/arch/evbmips/conf: INSTALL_CI20

Log Message:
Add CI20 install kernel and build that and the normal image as kernel set.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/evbmips/instkernel/instkernel/Makefile
cvs rdiff -u -r1.18 -r1.19 src/etc/etc.evbmips/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/INSTALL_CI20

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

Modified files:

Index: src/distrib/evbmips/instkernel/instkernel/Makefile
diff -u src/distrib/evbmips/instkernel/instkernel/Makefile:1.4 src/distrib/evbmips/instkernel/instkernel/Makefile:1.5
--- src/distrib/evbmips/instkernel/instkernel/Makefile:1.4	Mon Aug 29 18:32:18 2011
+++ src/distrib/evbmips/instkernel/instkernel/Makefile	Mon Apr  6 14:18:09 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/08/29 18:32:18 bouyer Exp $
+#	$NetBSD: Makefile,v 1.5 2015/04/06 14:18:09 joerg Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -8,7 +8,8 @@ RAMDISK=		${RAMDISKDIR}/ramdisk.fs
 
 .if ${MACHINE_ARCH} == mipsel
 # Little endian platforms.
-MDSETTARGETS=		INSTALL_OMSAL400	${RAMDISK}	-
+MDSETTARGETS=		INSTALL_CI20		${RAMDISK}	-
+MDSETTARGETS+=		INSTALL_OMSAL400	${RAMDISK}	-
 MDSETTARGETS+=		INSTALL_MALTA		${RAMDISK}	-
 
 .elif ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el

Index: src/etc/etc.evbmips/Makefile.inc
diff -u src/etc/etc.evbmips/Makefile.inc:1.18 src/etc/etc.evbmips/Makefile.inc:1.19
--- src/etc/etc.evbmips/Makefile.inc:1.18	Mon Aug 29 18:32:18 2011
+++ src/etc/etc.evbmips/Makefile.inc	Mon Apr  6 14:18:08 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2011/08/29 18:32:18 bouyer Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2015/04/06 14:18:08 joerg Exp $
 #
 #	etc.evbmips/Makefile.inc -- evbmips-specific etc Makefile targets
 #
@@ -9,9 +9,9 @@
 KERNEL_SUFFIXES=	srec
 
 .if ${MACHINE_ARCH} == mipsel
-KERNEL_SETS=		ALCHEMY CPMBR1400 DBAU1500 DBAU1550 GDIUM
+KERNEL_SETS=		ALCHEMY CI20 CPMBR1400 DBAU1500 DBAU1550 GDIUM
 KERNEL_SETS+=		MALTA MTX-1 OMSAL400
-BUILD_KERNELS=		INSTALL_OMSAL400 INSTALL_MALTA
+BUILD_KERNELS=		INSTALL_CI20 INSTALL_OMSAL400 INSTALL_MALTA
 
 KERNEL_SETS+=		P4032 P5064 P6032
 

Added files:

Index: src/sys/arch/evbmips/conf/INSTALL_CI20
diff -u /dev/null src/sys/arch/evbmips/conf/INSTALL_CI20:1.1
--- /dev/null	Mon Apr  6 14:18:09 2015
+++ src/sys/arch/evbmips/conf/INSTALL_CI20	Mon Apr  6 14:18:09 2015
@@ -0,0 +1,14 @@
+# $NetBSD: INSTALL_CI20,v 1.1 2015/04/06 14:18:09 joerg Exp $
+
+include		arch/evbmips/conf/CI20
+
+#ident 		INSTALL_CI20-$Revision: 1.1 $
+
+# Enable the hooks used for initializing the root memory-disk.
+# The ramdisk size must be kept in sync manually with the size of
+# the `ramdisk' image (which is built in distrib/evbmips/ramdisk/ramdisk).
+pseudo-device	md# memory disk device
+options 	MEMORY_DISK_HOOKS
+options 	MEMORY_DISK_IS_ROOT		# force root on memory disk
+options 	MEMORY_DISK_SERVER=0		# no userspace memory disk
+options 	MEMORY_DISK_ROOT_SIZE=12288	# size of memory disk, in blocks



CVS commit: src/sys/dev

2015-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr  6 12:02:08 UTC 2015

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

Log Message:
Make DIOCKLABEL work. Set default to keep the disklabel after close to
not change current behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.241 src/sys/dev/vnd.c:1.242
--- src/sys/dev/vnd.c:1.241	Wed Jan 28 16:27:43 2015
+++ src/sys/dev/vnd.c	Mon Apr  6 12:02:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.241 2015/01/28 16:27:43 bouyer Exp $	*/
+/*	$NetBSD: vnd.c,v 1.242 2015/04/06 12:02:08 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.241 2015/01/28 16:27:43 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.242 2015/04/06 12:02:08 mlelstv Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_vnd.h
@@ -332,6 +332,9 @@ vndopen(dev_t dev, int flags, int mode, 
 		sc = vnd_spawn(unit);
 		if (sc == NULL)
 			return ENOMEM;
+
+		/* compatibility, keep disklabel after close */
+		sc-sc_flags = VNF_KLABEL;
 	}
 
 	if ((error = vndlock(sc)) != 0)
@@ -434,6 +437,12 @@ vndclose(dev_t dev, int flags, int mode,
 	sc-sc_dkdev.dk_openmask =
 	sc-sc_dkdev.dk_copenmask | sc-sc_dkdev.dk_bopenmask;
 
+	/* are we last opener ? */
+	if (sc-sc_dkdev.dk_openmask == 0) {
+		if ((sc-sc_flags  VNF_KLABEL) == 0)
+			sc-sc_flags = ~VNF_VLABEL;
+	}
+
 	vndunlock(sc);
 
 	if ((sc-sc_flags  VNF_INITED) == 0) {
@@ -1696,7 +1705,7 @@ vndclear(struct vnd_softc *vnd, int mymi
 	}
 #endif /* VND_COMPRESSION */
 	vnd-sc_flags =
-	~(VNF_INITED | VNF_READONLY | VNF_VLABEL
+	~(VNF_INITED | VNF_READONLY | VNF_KLABEL | VNF_VLABEL
 	  | VNF_VUNCONF | VNF_COMP | VNF_CLEARING);
 	if (vp == NULL)
 		panic(vndclear: null vp);



CVS commit: [nick-nhusb] src/sys/dev/pci

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 12:17:30 UTC 2015

Modified Files:
src/sys/dev/pci [nick-nhusb]: xhci_pci.c

Log Message:
Remove useless break;


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/sys/dev/pci/xhci_pci.c

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

Modified files:

Index: src/sys/dev/pci/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.4.2.1 src/sys/dev/pci/xhci_pci.c:1.4.2.2
--- src/sys/dev/pci/xhci_pci.c:1.4.2.1	Wed Dec  3 12:52:07 2014
+++ src/sys/dev/pci/xhci_pci.c	Mon Apr  6 12:17:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.4.2.1 2014/12/03 12:52:07 skrll Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.4.2.2 2015/04/06 12:17:30 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xhci_pci.c,v 1.4.2.1 2014/12/03 12:52:07 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: xhci_pci.c,v 1.4.2.2 2015/04/06 12:17:30 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -117,7 +117,6 @@ xhci_pci_attach(device_t parent, device_
 	default:
 		aprint_error_dev(self, BAR not 64 or 32-bit MMIO\n);
 		return;
-		break;
 	}
 
 	psc-sc_pc = pc;



CVS commit: [nick-nhusb] src/sys/arch/arm/omap

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 12:15:32 UTC 2015

Modified Files:
src/sys/arch/arm/omap [nick-nhusb]: omap3_ehci.c

Log Message:
ehci_init returns int not usb_status_t


To generate a diff of this commit:
cvs rdiff -u -r1.10.6.2 -r1.10.6.3 src/sys/arch/arm/omap/omap3_ehci.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/omap/omap3_ehci.c
diff -u src/sys/arch/arm/omap/omap3_ehci.c:1.10.6.2 src/sys/arch/arm/omap/omap3_ehci.c:1.10.6.3
--- src/sys/arch/arm/omap/omap3_ehci.c:1.10.6.2	Wed Dec  3 12:52:05 2014
+++ src/sys/arch/arm/omap/omap3_ehci.c	Mon Apr  6 12:15:32 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.10.6.2 2014/12/03 12:52:05 skrll Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.10.6.3 2015/04/06 12:15:32 skrll Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 Jared D. McNeill jmcne...@invisible.ca
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap3_ehci.c,v 1.10.6.2 2014/12/03 12:52:05 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap3_ehci.c,v 1.10.6.3 2015/04/06 12:15:32 skrll Exp $);
 
 #include locators.h
 
@@ -332,7 +332,7 @@ omap3_ehci_attach1(device_t self)
 	omap3_ehci_find_companions(sc);
 
 	err = ehci_init(sc-sc);
-	if (err != USBD_NORMAL_COMPLETION) {
+	if (err) {
 		aprint_error_dev(self, init failed, error = %d\n, err);
 		return;
 	}



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

2015-04-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr  6 14:12:28 UTC 2015

Modified Files:
src/sys/arch/evbmips/conf: CI20

Log Message:
Allow local overrides in a CI20.local file


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbmips/conf/CI20

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/evbmips/conf/CI20
diff -u src/sys/arch/evbmips/conf/CI20:1.12 src/sys/arch/evbmips/conf/CI20:1.13
--- src/sys/arch/evbmips/conf/CI20:1.12	Sat Apr  4 12:32:34 2015
+++ src/sys/arch/evbmips/conf/CI20	Mon Apr  6 14:12:28 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: CI20,v 1.12 2015/04/04 12:32:34 macallan Exp $
+#	$NetBSD: CI20,v 1.13 2015/04/06 14:12:28 martin Exp $
 #
 # MIPS Creator CI20
 #
@@ -7,7 +7,7 @@ include 	arch/evbmips/conf/std.ingenic
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		CI20-$Revision: 1.12 $
+#ident 		CI20-$Revision: 1.13 $
 
 maxusers	32
 
@@ -262,3 +262,7 @@ pseudo-device	ksyms# /dev/ksyms
 
 # A pseudo device needed for Coda		# also needs CODA (above)
 #pseudo-device	vcoda# coda minicache - venus comm.
+
+
+cinclude 	arch/evbmips/conf/CI20.local
+



CVS commit: [nick-nhusb] src/sys/arch/powerpc/booke/dev

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 12:14:22 UTC 2015

Modified Files:
src/sys/arch/powerpc/booke/dev [nick-nhusb]: pq3ehci.c

Log Message:
ehci_init return int not usb_status_t


To generate a diff of this commit:
cvs rdiff -u -r1.5.16.2 -r1.5.16.3 src/sys/arch/powerpc/booke/dev/pq3ehci.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3ehci.c
diff -u src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.5.16.2 src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.5.16.3
--- src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.5.16.2	Wed Dec  3 12:52:06 2014
+++ src/sys/arch/powerpc/booke/dev/pq3ehci.c	Mon Apr  6 12:14:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3ehci.c,v 1.5.16.2 2014/12/03 12:52:06 skrll Exp $	*/
+/*	$NetBSD: pq3ehci.c,v 1.5.16.3 2015/04/06 12:14:22 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pq3ehci.c,v 1.5.16.2 2014/12/03 12:52:06 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pq3ehci.c,v 1.5.16.3 2015/04/06 12:14:22 skrll Exp $);
 
 #include opt_usb.h
 
@@ -141,7 +141,7 @@ pq3ehci_attach(device_t parent, device_t
 	EOWRITE4(sc-sc, EHCI_USBINTR, 0);
 
 	error = ehci_init(sc-sc);
-	if (error != USBD_NORMAL_COMPLETION) {
+	if (error) {
 		aprint_error_dev(self, init failed, error=%d\n, error);
 		goto fail;
 	}



CVS commit: [nick-nhusb] src/sys

2015-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  6 15:18:33 UTC 2015

Modified Files:
src/sys/arch/acorn32/include [nick-nhusb]: vmparam.h
src/sys/arch/acorn32/mainbus [nick-nhusb]: fd.c
src/sys/arch/alpha/alpha [nick-nhusb]: linux_syscall.c osf1_syscall.c
trap.c
src/sys/arch/alpha/conf [nick-nhusb]: GENERIC
src/sys/arch/alpha/include [nick-nhusb]: types.h
src/sys/arch/amd64/amd64 [nick-nhusb]: linux32_syscall.c
linux_syscall.c netbsd32_machdep.c netbsd32_syscall.c trap.c
src/sys/arch/amd64/conf [nick-nhusb]: ALL GENERIC XEN3_DOM0 files.amd64
src/sys/arch/amd64/include [nick-nhusb]: pmap.h
src/sys/arch/amiga/amiga [nick-nhusb]: gayle.c trap.c
src/sys/arch/amiga/conf [nick-nhusb]: files.amiga
src/sys/arch/amiga/dev [nick-nhusb]: fd.c gayle_pcmcia.c sbic.c
src/sys/arch/amiga/stand/bootblock/txlt [nick-nhusb]: Makefile txlt.l
src/sys/arch/arc/jazz [nick-nhusb]: fd.c
src/sys/arch/arm/allwinner [nick-nhusb]: awin_board.c awin_cnt.c
awin_com.c awin_debe.c awin_dma.c awin_dma.h awin_dma_a31.c
awin_eth.c awin_fb.c awin_gige.c awin_gpio.c awin_intr.h awin_io.c
awin_ir.c awin_mmc.c awin_p2wi.c awin_reg.h awin_space.c awin_twi.c
awin_usb.c awin_var.h awin_wdt.c files.awin
src/sys/arch/arm/arm [nick-nhusb]: bootconfig.c cpu_in_cksum.S
cpufunc.c cpufunc_asm_pj4b.S db_trace.c disassem.c linux_syscall.c
sig_machdep.c
src/sys/arch/arm/arm32 [nick-nhusb]: arm32_boot.c arm32_reboot.c
arm32_tlb.c bus_dma.c cortex_pmc.c cpu.c cpuswitch.S db_machdep.c
fault.c genassym.cf pmap.c sys_machdep.c vm_machdep.c
src/sys/arch/arm/broadcom [nick-nhusb]: bcm2835_bsc.c bcm2835_emmc.c
bcm2835_intr.c bcm2835_obio.c bcm2835_space.c bcm2835_tmr.c
bcm2835_vcaudio.c bcm2835reg.h bcm2835var.h bcm53xx_pax.c
bcmgen_space.c files.bcm2835
src/sys/arch/arm/conf [nick-nhusb]: files.arm majors.arm32 std.arm
src/sys/arch/arm/cortex [nick-nhusb]: a9_mpsubr.S a9tmr.c a9tmr_var.h
a9wdt.c armperiph.c gic.c gtmr.c gtmr_var.h mpcore_var.h pl310.c
src/sys/arch/arm/ep93xx [nick-nhusb]: ep93xx_intr.c
src/sys/arch/arm/imx [nick-nhusb]: files.imx23 files.imx51 files.imx6
if_enet.c imx23_apbdma.c imx23_apbdmareg.h imx23_apbdmavar.h
imx23_clkctrl.c imx23_clkctrlvar.h imx23_rtcreg.h imx51_i2c.c
imx51reg.h imx6_board.c imx6_ccm.c imx6_ccmreg.h imx6_ccmvar.h
imx6_i2c.c imx6_reg.h imxi2c.c imxi2cvar.h
src/sys/arch/arm/include [nick-nhusb]: bootconfig.h cpu.h fenv.h lock.h
locore.h mcontext.h mutex.h profile.h rwlock.h sysarch.h vfpreg.h
src/sys/arch/arm/include/arm32 [nick-nhusb]: param.h pmap.h vmparam.h
src/sys/arch/arm/omap [nick-nhusb]: if_cpsw.c if_cpswreg.h omap3_sdhc.c
src/sys/arch/arm/pic [nick-nhusb]: pic.c pic_splfuncs.c
src/sys/arch/arm/samsung [nick-nhusb]: exynos5_reg.h exynos_gpio.c
exynos_i2c.c exynos_smc.S exynos_soc.c exynos_space.c
src/sys/arch/arm/vfp [nick-nhusb]: vfp_init.c
src/sys/arch/arm/xscale [nick-nhusb]: pxa2x0_dmac.c
src/sys/arch/atari/atari [nick-nhusb]: trap.c
src/sys/arch/atari/dev [nick-nhusb]: fd.c hdfd.c nvram.c
src/sys/arch/bebox/stand/boot [nick-nhusb]: fd.c sd.c siop.c vreset.c
wd.c
src/sys/arch/cats/include [nick-nhusb]: vmparam.h
src/sys/arch/cesfic/cesfic [nick-nhusb]: trap.c
src/sys/arch/cesfic/conf [nick-nhusb]: Makefile.cesfic
src/sys/arch/cobalt/stand/boot [nick-nhusb]: wd.c
src/sys/arch/dreamcast/dev/maple [nick-nhusb]: mmemcard.c
src/sys/arch/emips/ebus [nick-nhusb]: ace_ebus.c flash_ebus.c
src/sys/arch/epoc32/include [nick-nhusb]: vmparam.h
src/sys/arch/evbarm [nick-nhusb]: Makefile
src/sys/arch/evbarm/awin [nick-nhusb]: awin_machdep.c awin_start.S
platform.h
src/sys/arch/evbarm/conf [nick-nhusb]: BEAGLEBONE CUBIEBOARD
HUMMINGBIRD_A31 IMX23_OLINUXINO INTEGRATOR_CP MINI2440 OMAP5EVM
PANDABOARD README.evbarm RPI RPI_INSTALL files.evbarm
files.imx23_olinuxino files.integrator mk.rpi std.nitrogen6
std.odroid std.rpi
src/sys/arch/evbarm/ifpga [nick-nhusb]: ifpga_intr.c ifpgareg.h
src/sys/arch/evbarm/imx23_olinuxino [nick-nhusb]:
imx23_olinuxino_machdep.c imx23_olinuxino_start.S
src/sys/arch/evbarm/include [nick-nhusb]: vmparam.h
src/sys/arch/evbarm/ixdp425 [nick-nhusb]: ixdp425_machdep.c
src/sys/arch/evbarm/nitrogen6 [nick-nhusb]: nitrogen6_machdep.c
src/sys/arch/evbarm/nslu2 [nick-nhusb]: nslu2_machdep.c
src/sys/arch/evbarm/rpi [nick-nhusb]: genassym.cf rpi.h rpi_machdep.c
rpi_start.S

CVS commit: src/lib/libc/time

2015-04-06 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Mon Apr  6 14:38:22 UTC 2015

Modified Files:
src/lib/libc/time: strptime.3 strptime.c

Log Message:
Add UTC as a synonym for GMT (%Z).  [from FreeBSD]


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/time/strptime.3
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/time/strptime.c

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

Modified files:

Index: src/lib/libc/time/strptime.3
diff -u src/lib/libc/time/strptime.3:1.30 src/lib/libc/time/strptime.3:1.31
--- src/lib/libc/time/strptime.3:1.30	Fri Apr  3 15:52:50 2015
+++ src/lib/libc/time/strptime.3	Mon Apr  6 14:38:22 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: strptime.3,v 1.30 2015/04/03 15:52:50 ginsbach Exp $
+.\	$NetBSD: strptime.3,v 1.31 2015/04/06 14:38:22 ginsbach Exp $
 .\
 .\ Copyright (c) 1997, 1998, 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -26,7 +26,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April  3, 2015
+.Dd April  6, 2015
 .Dt STRPTIME 3
 .Os
 .Sh NAME
@@ -335,8 +335,10 @@ The
 .Cm \%Z
 format specifier only accepts time zone
 abbreviations of the local time zone,
-or the value
-.Dq GMT .
+or the values
+.Dq GMT
+or
+.Dq UTC .
 This limitation is caused by the ambiguity
 of overloaded time zone abbreviations,
 for example EST is both Eastern Standard

Index: src/lib/libc/time/strptime.c
diff -u src/lib/libc/time/strptime.c:1.38 src/lib/libc/time/strptime.c:1.39
--- src/lib/libc/time/strptime.c:1.38	Fri May 17 12:55:57 2013
+++ src/lib/libc/time/strptime.c	Mon Apr  6 14:38:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: strptime.c,v 1.38 2013/05/17 12:55:57 joerg Exp $	*/
+/*	$NetBSD: strptime.c,v 1.39 2015/04/06 14:38:22 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: strptime.c,v 1.38 2013/05/17 12:55:57 joerg Exp $);
+__RCSID($NetBSD: strptime.c,v 1.39 2015/04/06 14:38:22 ginsbach Exp $);
 #endif
 
 #include namespace.h
@@ -357,7 +357,8 @@ literal:
 
 		case 'Z':
 			tzset();
-			if (strncmp((const char *)bp, gmt, 3) == 0) {
+			if (strncmp((const char *)bp, gmt, 3) == 0 ||
+			strncmp((const char *)bp, utc, 3) == 0) {
 tm-tm_isdst = 0;
 #ifdef TM_GMTOFF
 tm-TM_GMTOFF = 0;



CVS commit: src/etc/rc.d

2015-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr  6 15:07:50 UTC 2015

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

Log Message:
Parse config file like ifconfig.if(5).
First word is always the module name, followed by options.
Load modules right after root filesystem is checked and before it
becomes writable.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/modules

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/modules
diff -u src/etc/rc.d/modules:1.1 src/etc/rc.d/modules:1.2
--- src/etc/rc.d/modules:1.1	Sat Mar 21 19:10:43 2015
+++ src/etc/rc.d/modules	Mon Apr  6 15:07:50 2015
@@ -1,10 +1,11 @@
 #!/bin/sh
 #
-# $NetBSD: modules,v 1.1 2015/03/21 19:10:43 jmcneill Exp $
+# $NetBSD: modules,v 1.2 2015/04/06 15:07:50 mlelstv Exp $
 #
 
 # PROVIDE: modules
-# BEFORE:  securelevel
+# REQUIRE: fsck_root
+# BEFORE: root
 
 $_rc_subr_loaded . /etc/rc.subr
 
@@ -17,12 +18,19 @@ modules_start()
 {
 	if [ -f /etc/modules.conf ]; then
 		echo Loading modules.
-		cat /etc/modules.conf |
-		while read -r args; do
-			args=${args%%#*}		# strip comments
-			test -z $args  continue
-			/sbin/modload $args
-		done
+		while read name args; do
+			case $name in
+			''|#*)
+;;
+			*)
+(
+	set -o noglob
+	eval set -- $args
+	modload $@ $name
+)
+;;
+			esac
+		done  /etc/modules.conf
 	fi
 }
 



CVS commit: src/external/historical/nawk/bin

2015-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr  6 14:36:41 UTC 2015

Modified Files:
src/external/historical/nawk/bin: awk.1

Log Message:
Fix important typo, from Joachim Henke on netbsd-docs.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/historical/nawk/bin/awk.1

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

Modified files:

Index: src/external/historical/nawk/bin/awk.1
diff -u src/external/historical/nawk/bin/awk.1:1.3 src/external/historical/nawk/bin/awk.1:1.4
--- src/external/historical/nawk/bin/awk.1:1.3	Sun Mar 23 01:29:12 2014
+++ src/external/historical/nawk/bin/awk.1	Mon Apr  6 14:36:41 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: awk.1,v 1.3 2014/03/23 01:29:12 dholland Exp $
+.\	$NetBSD: awk.1,v 1.4 2015/04/06 14:36:41 wiz Exp $
 .\
 .\ Copyright (C) Lucent Technologies 1997
 .\ All Rights Reserved
@@ -22,7 +22,7 @@
 .\ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 .\ THIS SOFTWARE.
 .\
-.Dd May 25, 2008
+.Dd April 6, 2015
 .Dt AWK 1
 .Os
 .Sh NAME
@@ -485,7 +485,7 @@ for the first occurrence of the regular 
 in the target string
 .Ar t .
 If
-.Ar s
+.Ar t
 is not given,
 .Va $0
 is used.