CVS commit: src

2009-11-27 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Fri Nov 27 08:35:05 UTC 2009

Modified Files:
src/doc: CHANGES
src/share/man/man4: ums.4
src/sys/dev/usb: ums.c

Log Message:
Add support for USB HID devices that report absolute coordinates instead
of relative movement data, i.e. touchpanels.  Please note that calibration
must be done outside the wsons(4) driver for now.


To generate a diff of this commit:
cvs rdiff -u -r1.1320 -r1.1321 src/doc/CHANGES
cvs rdiff -u -r1.8 -r1.9 src/share/man/man4/ums.4
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/usb/ums.c

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.1320 src/doc/CHANGES:1.1321
--- src/doc/CHANGES:1.1320	Thu Nov 26 13:26:23 2009
+++ src/doc/CHANGES	Fri Nov 27 08:35:05 2009
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1320 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1321 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -485,3 +485,4 @@
 	rump: Load rump virtual kernel symbol table at boot.  This enables
 		the use of the kernel linker in a rump kernel.
 		[pooka 20091126]
+	ums(4): Added touchpanel support. [mbalmer 20091127]

Index: src/share/man/man4/ums.4
diff -u src/share/man/man4/ums.4:1.8 src/share/man/man4/ums.4:1.9
--- src/share/man/man4/ums.4:1.8	Wed Apr 30 13:10:54 2008
+++ src/share/man/man4/ums.4	Fri Nov 27 08:35:05 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: ums.4,v 1.8 2008/04/30 13:10:54 martin Exp $
+.\ $NetBSD: ums.4,v 1.9 2009/11/27 08:35:05 mbalmer Exp $
 .\
 .\ Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,20 +27,20 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 12, 1998
+.Dd November 27, 2009
 .Dt UMS 4
 .Os
 .Sh NAME
 .Nm ums
-.Nd USB mouse support
+.Nd USB mouse and touchpanel support
 .Sh SYNOPSIS
 .Cd ums* at uhidev? reportid ?
 .Cd wsmouse* at ums?
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for USB mice.
-Access to the mouse is through the
+driver provides support for USB mice and touchpanels.
+Access to the movement data is through the
 .Xr wscons 4
 driver.
 .Sh SEE ALSO
@@ -53,3 +53,5 @@
 driver
 appeared in
 .Nx 1.4 .
+Touchpanel support was added in
+.Nx 5.1 .

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.76 src/sys/dev/usb/ums.c:1.77
--- src/sys/dev/usb/ums.c:1.76	Thu Nov 12 19:58:27 2009
+++ src/sys/dev/usb/ums.c	Fri Nov 27 08:35:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.76 2009/11/12 19:58:27 dyoung Exp $	*/
+/*	$NetBSD: ums.c,v 1.77 2009/11/27 08:35:05 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.76 2009/11/12 19:58:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.77 2009/11/27 08:35:05 mbalmer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -95,6 +95,7 @@
 #define UMS_SPUR_BUT_UP	0x02	/* spurious button up events */
 #define UMS_REVZ	0x04	/* Z-axis is reversed */
 #define UMS_W		0x08	/* w direction/tilt available */
+#define UMS_ABS		0x10	/* absolute position, touchpanel */
 
 	int nbuttons;
 
@@ -105,7 +106,6 @@
 };
 
 #define MOUSE_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)
-#define MOUSE_FLAGS (HIO_RELATIVE)
 
 Static void ums_intr(struct uhidev *addr, void *ibuf, u_int len);
 
@@ -180,7 +180,13 @@
 		   USBDEVNAME(sc-sc_hdev.sc_dev));
 		USB_ATTACH_ERROR_RETURN;
 	}
-	if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+	switch (flags  MOUSE_FLAGS_MASK) {
+	case 0:
+		sc-flags |= UMS_ABS;
+		break;
+	case HIO_RELATIVE:
+		break;
+	default:
 		aprint_error(\n%s: X report 0x%04x not supported\n,
 		   USBDEVNAME(sc-sc_hdev.sc_dev), flags);
 		USB_ATTACH_ERROR_RETURN;
@@ -192,7 +198,13 @@
 		   USBDEVNAME(sc-sc_hdev.sc_dev));
 		USB_ATTACH_ERROR_RETURN;
 	}
-	if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+	switch (flags  MOUSE_FLAGS_MASK) {
+	case 0:
+		sc-flags |= UMS_ABS;
+		break;
+	case HIO_RELATIVE:
+		break;
+	default:
 		aprint_error(\n%s: Y report 0x%04x not supported\n,
 		   USBDEVNAME(sc-sc_hdev.sc_dev), flags);
 		USB_ATTACH_ERROR_RETURN;
@@ -209,7 +221,7 @@
 
 	zloc = sc-sc_loc_z;
 	if (hl) {
-		if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+		if ((flags  MOUSE_FLAGS_MASK) != HIO_RELATIVE) {
 			aprint_verbose(\n%s: Wheel report 0x%04x not 
 			supported\n, USBDEVNAME(sc-sc_hdev.sc_dev),
 			flags);
@@ -247,7 +259,7 @@
 	}
 
 	if (hl) {
-		if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+		if ((flags  MOUSE_FLAGS_MASK) != HIO_RELATIVE) {
 			aprint_verbose(\n%s: Z report 0x%04x not supported\n,
 			   USBDEVNAME(sc-sc_hdev.sc_dev), flags);
 			zloc-size = 0;	/* Bad Z coord, ignore it */
@@ -362,15 +374,21 @@
 	struct ums_softc *sc = (struct ums_softc *)addr;
 	int dx, dy, dz, dw

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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 08:54:13 UTC 2009

Modified Files:
src/sys/dev/usb [netbsd-5]: uhidev.c ums.c usbdevs

Log Message:
Pull up the following revisions(s) (requested by rafal in ticket #1162):
sys/dev/usb/uhidev.c:   revision 1.44
sys/dev/usb/ums.c:  revision 1.75
sys/dev/usb/usbdevs:revision 1.536

Fix kern/41737. Add quirks to make MS Wireless Laser Mouse 6000 work.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/dev/usb/uhidev.c
cvs rdiff -u -r1.73 -r1.73.8.1 src/sys/dev/usb/ums.c
cvs rdiff -u -r1.519.4.2 -r1.519.4.3 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/uhidev.c
diff -u src/sys/dev/usb/uhidev.c:1.42 src/sys/dev/usb/uhidev.c:1.42.8.1
--- src/sys/dev/usb/uhidev.c:1.42	Mon May 26 19:01:51 2008
+++ src/sys/dev/usb/uhidev.c	Fri Nov 27 08:54:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhidev.c,v 1.42 2008/05/26 19:01:51 drochner Exp $	*/
+/*	$NetBSD: uhidev.c,v 1.42.8.1 2009/11/27 08:54:13 sborrill Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhidev.c,v 1.42 2008/05/26 19:01:51 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhidev.c,v 1.42.8.1 2009/11/27 08:54:13 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -105,7 +105,7 @@
 	struct uhidev_attach_arg uha;
 	device_t dev;
 	struct uhidev *csc;
-	int size, nrepid, repid, repsz;
+	int maxinpktsize, size, nrepid, repid, repsz;
 	int *repsizes;
 	int i;
 	void *desc;
@@ -137,6 +137,7 @@
 		(void)usbd_set_protocol(iface, 1);
 #endif
 
+	maxinpktsize = 0;
 	sc-sc_iep_addr = sc-sc_oep_addr = -1;
 	for (i = 0; i  id-bNumEndpoints; i++) {
 		ed = usbd_interface2endpoint_descriptor(iface, i);
@@ -158,6 +159,7 @@
 
 		if (UE_GET_DIR(ed-bEndpointAddress) == UE_DIR_IN 
 		(ed-bmAttributes  UE_XFERTYPE) == UE_INTERRUPT) {
+			maxinpktsize = UGETW(ed-wMaxPacketSize);
 			sc-sc_iep_addr = ed-bEndpointAddress;
 		} else if (UE_GET_DIR(ed-bEndpointAddress) == UE_DIR_OUT 
 		(ed-bmAttributes  UE_XFERTYPE) == UE_INTERRUPT) {
@@ -262,8 +264,10 @@
 		aprint_error_dev(self, no memory\n);
 		USB_ATTACH_ERROR_RETURN;
 	}
+
+	/* Just request max packet size for the interrupt pipe */
+	sc-sc_isize = maxinpktsize;
 	sc-sc_nrepid = nrepid;
-	sc-sc_isize = 0;
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc-sc_udev,
 			   USBDEV(sc-sc_dev));
@@ -272,12 +276,8 @@
 		repsz = hid_report_size(desc, size, hid_input, repid);
 		DPRINTF((uhidev_match: repid=%d, repsz=%d\n, repid, repsz));
 		repsizes[repid] = repsz;
-		if (repsz  0) {
-			if (repsz  sc-sc_isize)
-sc-sc_isize = repsz;
-		}
 	}
-	sc-sc_isize += nrepid != 1;	/* space for report ID */
+
 	DPRINTF((uhidev_attach: isize=%d\n, sc-sc_isize));
 
 	uha.parent = sc;
@@ -475,7 +475,7 @@
 		rep, scd, scd ? scd-sc_state : 0));
 	if (!(scd-sc_state  UHIDEV_OPEN))
 		return;
-	if (scd-sc_in_rep_size != cc) {
+	if (scd-sc_in_rep_size  cc) {
 		printf(%s: bad input length %d != %d\n,
 		   USBDEVNAME(sc-sc_dev), scd-sc_in_rep_size, cc);
 		return;

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.73 src/sys/dev/usb/ums.c:1.73.8.1
--- src/sys/dev/usb/ums.c:1.73	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ums.c	Fri Nov 27 08:54:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.73 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ums.c,v 1.73.8.1 2009/11/27 08:54:13 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.73 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.73.8.1 2009/11/27 08:54:13 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -95,6 +95,7 @@
 #define UMS_Z		0x01	/* z direction available */
 #define UMS_SPUR_BUT_UP	0x02	/* spurious button up events */
 #define UMS_REVZ	0x04	/* Z-axis is reversed */
+#define UMS_W		0x08	/* w direction/tilt available */
 
 	int nbuttons;
 
@@ -152,7 +153,8 @@
 	int size;
 	void *desc;
 	u_int32_t flags, quirks;
-	int i, wheel;
+	int i, hl;
+	struct hid_location *zloc;
 	struct hid_location loc_btn;
 
 	aprint_naive(\n);
@@ -198,10 +200,16 @@
 	}
 
 	/* Try the wheel first as the Z activator since it's tradition. */
-	wheel = hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP,
-		  HUG_WHEEL),
-			   uha-reportid, hid_input, sc-sc_loc_z, flags);
-	if (wheel) {
+	hl = hid_locate(desc, 
+			size, 
+			HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL), 
+			uha-reportid, 
+			hid_input, 
+			sc-sc_loc_z, 
+			flags);
+
+	zloc = sc-sc_loc_z;
+	if (hl) {
 		if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
 			aprint_verbose(\n%s: Wheel report 0x%04x not 
 			supported\n, USBDEVNAME(sc-sc_hdev.sc_dev),
@@ -211,33 +219,59 @@
 			sc-flags |= UMS_Z;
 			/* Wheels need the Z 

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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 08:54:35 UTC 2009

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.2 -r1.515.4.3 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.2 -r1.516.4.3 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.515.4.2 src/sys/dev/usb/usbdevs.h:1.515.4.3
--- src/sys/dev/usb/usbdevs.h:1.515.4.2	Sat Oct 10 20:35:19 2009
+++ src/sys/dev/usb/usbdevs.h	Fri Nov 27 08:54:35 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.2 2009/10/10 20:35:19 sborrill Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.3 2009/11/27 08:54:35 sborrill Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.2 2009/10/10 20:34:45 sborrill Exp
+ *	NetBSD: usbdevs,v 1.519.4.3 2009/11/27 08:54:13 sborrill Exp
  */
 
 /*
@@ -1550,6 +1550,7 @@
 #define	USB_PRODUCT_MICROSOFT_XBOX_CONTROLLER_S10	0x0285		/* Xbox Controller S (1.0) */
 #define	USB_PRODUCT_MICROSOFT_XBOX_CONTROLLER_HUB	0x0288		/* Xbox Controller Hub */
 #define	USB_PRODUCT_MICROSOFT_XBOX_CONTROLLER_S12	0x0289		/* Xbox Controller S (1.2) */
+#define	USB_PRODUCT_MICROSOFT_24GHZ_XCVR	0x071f		/* 2.4GHz Transceiver V2.0 */
 
 /* Microtech products */
 #define	USB_PRODUCT_MICROTECH_SCSIDB25	0x0004		/* USB-SCSI-DB25 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.2 src/sys/dev/usb/usbdevs_data.h:1.516.4.3
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.2	Sat Oct 10 20:35:20 2009
+++ src/sys/dev/usb/usbdevs_data.h	Fri Nov 27 08:54:35 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.2 2009/10/10 20:35:20 sborrill Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.3 2009/11/27 08:54:35 sborrill Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.2 2009/10/10 20:34:45 sborrill Exp
+ *	NetBSD: usbdevs,v 1.519.4.3 2009/11/27 08:54:13 sborrill Exp
  */
 
 /*
@@ -4583,6 +4583,10 @@
 	Xbox Controller S (1.2),
 	},
 	{
+	USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_24GHZ_XCVR,
+	2.4GHz Transceiver V2.0,
+	},
+	{
 	USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_SCSIDB25,
 	USB-SCSI-DB25,
 	},
@@ -6827,4 +6831,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1242;
+const int usb_nproducts = 1243;



CVS commit: [netbsd-5] src/doc

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 08:55:38 UTC 2009

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

Log Message:
Rafal ticket 1162


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.142 -r1.1.2.143 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.142 src/doc/CHANGES-5.1:1.1.2.143
--- src/doc/CHANGES-5.1:1.1.2.142	Mon Nov 23 03:21:04 2009
+++ src/doc/CHANGES-5.1	Fri Nov 27 08:55:38 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.142 2009/11/23 03:21:04 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.143 2009/11/27 08:55:38 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -14864,3 +14864,10 @@
 	  instead of being always being requested.
 	[roy, ticket #1099]
 
+sys/dev/usb/uhidev.c1.44
+sys/dev/usb/ums.c1.75
+sys/dev/usb/usbdevs1.536
+
+	Fix kern/41737. Add quirks to make MS Wireless Laser Mouse 6000 work.
+	[rafal, ticket #1162]
+



CVS commit: [netbsd-5] src/sbin/newfs_msdos

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 08:59:43 UTC 2009

Modified Files:
src/sbin/newfs_msdos [netbsd-5]: newfs_msdos.c

Log Message:
Pull up the following revisions(s) (requested by tsutsui in ticket #1163):
sbin/newfs_msdos/newfs_msdos.c: revision 1.30

Make fs size detection get proper size rather than disk size.
Without this, newfs_msdos(8) assumes the target fs size is
whole disk size, so newfs_msdos(8) will fail or create wrong fs.


To generate a diff of this commit:
cvs rdiff -u -r1.27.2.2 -r1.27.2.3 src/sbin/newfs_msdos/newfs_msdos.c

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

Modified files:

Index: src/sbin/newfs_msdos/newfs_msdos.c
diff -u src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.2 src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.3
--- src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.2	Mon Feb  2 20:52:42 2009
+++ src/sbin/newfs_msdos/newfs_msdos.c	Fri Nov 27 08:59:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_msdos.c,v 1.27.2.2 2009/02/02 20:52:42 snj Exp $	*/
+/*	$NetBSD: newfs_msdos.c,v 1.27.2.3 2009/11/27 08:59:43 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: newfs_msdos.c,v 1.27.2.2 2009/02/02 20:52:42 snj Exp $);
+__RCSID($NetBSD: newfs_msdos.c,v 1.27.2.3 2009/11/27 08:59:43 sborrill Exp $);
 #endif
 #endif /* not lint */
 
@@ -800,7 +800,7 @@
 	if (!bpb-hds)
 	bpb-hds = ckgeom(fname, geo.dg_ntracks, drive heads);
 	if (!bpb-bsec)
-	bpb-bsec = geo.dg_secperunit;
+	bpb-bsec = dkw.dkw_size;
 }
 }
 



CVS commit: [netbsd-5] src/doc

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:00:06 UTC 2009

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

Log Message:
Ticket 1163


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.143 -r1.1.2.144 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.143 src/doc/CHANGES-5.1:1.1.2.144
--- src/doc/CHANGES-5.1:1.1.2.143	Fri Nov 27 08:55:38 2009
+++ src/doc/CHANGES-5.1	Fri Nov 27 09:00:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.143 2009/11/27 08:55:38 sborrill Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.144 2009/11/27 09:00:06 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -14871,3 +14871,10 @@
 	Fix kern/41737. Add quirks to make MS Wireless Laser Mouse 6000 work.
 	[rafal, ticket #1162]
 
+sbin/newfs_msdos/newfs_msdos.c			1.30
+
+	Make fs size detection get proper size rather than disk size.
+	Without this, newfs_msdos(8) assumes the target fs size is
+	whole disk size, so newfs_msdos(8) will fail or create wrong fs.
+	[tsutsui, ticket #1163]
+



CVS commit: [netbsd-5-0] src/sbin/newfs_msdos

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:02:15 UTC 2009

Modified Files:
src/sbin/newfs_msdos [netbsd-5-0]: newfs_msdos.c

Log Message:
Pull up the following revisions(s) (requested by tsutsui in ticket #1163):
sbin/newfs_msdos/newfs_msdos.c: revision 1.30

Make fs size detection get proper size rather than disk size.
Without this, newfs_msdos(8) assumes the target fs size is
whole disk size, so newfs_msdos(8) will fail or create wrong fs.


To generate a diff of this commit:
cvs rdiff -u -r1.27.2.2 -r1.27.2.2.2.1 src/sbin/newfs_msdos/newfs_msdos.c

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

Modified files:

Index: src/sbin/newfs_msdos/newfs_msdos.c
diff -u src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.2 src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.2.2.1
--- src/sbin/newfs_msdos/newfs_msdos.c:1.27.2.2	Mon Feb  2 20:52:42 2009
+++ src/sbin/newfs_msdos/newfs_msdos.c	Fri Nov 27 09:02:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_msdos.c,v 1.27.2.2 2009/02/02 20:52:42 snj Exp $	*/
+/*	$NetBSD: newfs_msdos.c,v 1.27.2.2.2.1 2009/11/27 09:02:15 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: newfs_msdos.c,v 1.27.2.2 2009/02/02 20:52:42 snj Exp $);
+__RCSID($NetBSD: newfs_msdos.c,v 1.27.2.2.2.1 2009/11/27 09:02:15 sborrill Exp $);
 #endif
 #endif /* not lint */
 
@@ -800,7 +800,7 @@
 	if (!bpb-hds)
 	bpb-hds = ckgeom(fname, geo.dg_ntracks, drive heads);
 	if (!bpb-bsec)
-	bpb-bsec = geo.dg_secperunit;
+	bpb-bsec = dkw.dkw_size;
 }
 }
 



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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:04:12 UTC 2009

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

Log Message:
Ticket 1163


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-5.0.2

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

Modified files:

Index: src/doc/CHANGES-5.0.2
diff -u src/doc/CHANGES-5.0.2:1.1.2.27 src/doc/CHANGES-5.0.2:1.1.2.28
--- src/doc/CHANGES-5.0.2:1.1.2.27	Sat Nov 21 20:07:02 2009
+++ src/doc/CHANGES-5.0.2	Fri Nov 27 09:04:12 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.2,v 1.1.2.27 2009/11/21 20:07:02 snj Exp $
+# $NetBSD: CHANGES-5.0.2,v 1.1.2.28 2009/11/27 09:04:12 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0.1 release to the NetBSD 5.0.2
 release:
@@ -452,3 +452,10 @@
 	ar_tha() can return NULL; treat this as an error.
 	[christos, ticket #1156]
 
+sbin/newfs_msdos/newfs_msdos.c			1.30
+
+	Make fs size detection get proper size rather than disk size.
+	Without this, newfs_msdos(8) assumes the target fs size is
+	whole disk size, so newfs_msdos(8) will fail or create wrong fs.
+	[tsutsui, ticket #1163]
+



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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:15:27 UTC 2009

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

Log Message:
Pull up the following revisions(s) (requested by dsl in ticket #1141):
sys/kern/tty_subr.c:revision 1.38

Fix clrbits() so that it doesn't mask no bits out of the byte after the
range (when the last bit to be cleared is the msb of a byte).
Fixes PR/42312.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/kern/tty_subr.c

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

Modified files:

Index: src/sys/kern/tty_subr.c
diff -u src/sys/kern/tty_subr.c:1.34 src/sys/kern/tty_subr.c:1.34.4.1
--- src/sys/kern/tty_subr.c:1.34	Wed Jul 16 18:27:49 2008
+++ src/sys/kern/tty_subr.c	Fri Nov 27 09:15:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $	*/
+/*	$NetBSD: tty_subr.c,v 1.34.4.1 2009/11/27 09:15:27 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994 Theo de Raadt
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: tty_subr.c,v 1.34.4.1 2009/11/27 09:15:27 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -316,10 +316,11 @@
 		return;
 	}
 
+	len--;
 	sby = off / NBBY;
 	sbi = off % NBBY;
 	eby = (off+len) / NBBY;
-	ebi = (off+len) % NBBY;
+	ebi = (off+len) % NBBY + 1;
 	if (sby == eby) {
 		mask = ((1  (ebi - sbi)) - 1)  sbi;
 		cp[sby] = ~mask;



CVS commit: [netbsd-5] src/doc

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:16:06 UTC 2009

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

Log Message:
Ticket 1141


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.144 src/doc/CHANGES-5.1:1.1.2.145
--- src/doc/CHANGES-5.1:1.1.2.144	Fri Nov 27 09:00:06 2009
+++ src/doc/CHANGES-5.1	Fri Nov 27 09:16:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.144 2009/11/27 09:00:06 sborrill Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.145 2009/11/27 09:16:06 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -14878,3 +14878,10 @@
 	whole disk size, so newfs_msdos(8) will fail or create wrong fs.
 	[tsutsui, ticket #1163]
 
+sys/kern/tty_subr.c1.38
+
+	Fix clrbits() so that it doesn't mask no bits out of the byte after
+	the range (when the last bit to be cleared is the msb of a byte).
+	Fixes PR/42312.
+	[dsl, ticket #1141]
+



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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:19:13 UTC 2009

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

Log Message:
Pull up the following revisions(s) (requested by dsl in ticket #1141):
sys/kern/tty_subr.c:revision 1.38

Fix clrbits() so that it doesn't mask no bits out of the byte after the
range (when the last bit to be cleared is the msb of a byte).
Fixes PR/42312.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.8.1 src/sys/kern/tty_subr.c

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

Modified files:

Index: src/sys/kern/tty_subr.c
diff -u src/sys/kern/tty_subr.c:1.34 src/sys/kern/tty_subr.c:1.34.8.1
--- src/sys/kern/tty_subr.c:1.34	Wed Jul 16 18:27:49 2008
+++ src/sys/kern/tty_subr.c	Fri Nov 27 09:19:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $	*/
+/*	$NetBSD: tty_subr.c,v 1.34.8.1 2009/11/27 09:19:13 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994 Theo de Raadt
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: tty_subr.c,v 1.34.8.1 2009/11/27 09:19:13 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -316,10 +316,11 @@
 		return;
 	}
 
+	len--;
 	sby = off / NBBY;
 	sbi = off % NBBY;
 	eby = (off+len) / NBBY;
-	ebi = (off+len) % NBBY;
+	ebi = (off+len) % NBBY + 1;
 	if (sby == eby) {
 		mask = ((1  (ebi - sbi)) - 1)  sbi;
 		cp[sby] = ~mask;



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

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:19:36 UTC 2009

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

Log Message:
Ticket 1141


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/doc/CHANGES-5.0.2

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

Modified files:

Index: src/doc/CHANGES-5.0.2
diff -u src/doc/CHANGES-5.0.2:1.1.2.28 src/doc/CHANGES-5.0.2:1.1.2.29
--- src/doc/CHANGES-5.0.2:1.1.2.28	Fri Nov 27 09:04:12 2009
+++ src/doc/CHANGES-5.0.2	Fri Nov 27 09:19:36 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.2,v 1.1.2.28 2009/11/27 09:04:12 sborrill Exp $
+# $NetBSD: CHANGES-5.0.2,v 1.1.2.29 2009/11/27 09:19:36 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0.1 release to the NetBSD 5.0.2
 release:
@@ -459,3 +459,10 @@
 	whole disk size, so newfs_msdos(8) will fail or create wrong fs.
 	[tsutsui, ticket #1163]
 
+sys/kern/tty_subr.c1.38
+
+	Fix clrbits() so that it doesn't mask no bits out of the byte after
+	the range (when the last bit to be cleared is the msb of a byte).
+	Fixes PR/42312.
+	[dsl, ticket #1141]
+



CVS commit: [netbsd-5] src

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:49:42 UTC 2009

Modified Files:
src/doc [netbsd-5]: CHANGES
src/share/man/man4 [netbsd-5]: ums.4
src/sys/dev/usb [netbsd-5]: ums.c

Log Message:
Pull up the following revisions(s) (requested by mbalmer in ticket #1164):
doc/CHANGES:revision 1.1320 via patch
share/man/man4/ums.4:   revision 1.9
sys/dev/usb/ums.c:  revision 1.77

Add support for USB HID devices that report absolute coordinates instead
of relative movement data, e.g. touchpanels.  Please note that calibration
must be done outside the wscons(4) driver for now.


To generate a diff of this commit:
cvs rdiff -u -r1.1142.2.9 -r1.1142.2.10 src/doc/CHANGES
cvs rdiff -u -r1.8 -r1.8.4.1 src/share/man/man4/ums.4
cvs rdiff -u -r1.73.8.1 -r1.73.8.2 src/sys/dev/usb/ums.c

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.1142.2.9 src/doc/CHANGES:1.1142.2.10
--- src/doc/CHANGES:1.1142.2.9	Sat Sep 26 19:52:08 2009
+++ src/doc/CHANGES	Fri Nov 27 09:49:41 2009
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1142.2.9 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1142.2.10 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1164,3 +1164,4 @@
 	dhcpcd(8): Import dhcpcd-5.0.1 [roy 20090510]
 	hdaudio(4): New standards-compliant Intel High Definition Audio driver
 		written to replace azalia(4). [sborrill 20090906]
+	ums(4):	Add touchpanel support. [mbalmer 20091127]

Index: src/share/man/man4/ums.4
diff -u src/share/man/man4/ums.4:1.8 src/share/man/man4/ums.4:1.8.4.1
--- src/share/man/man4/ums.4:1.8	Wed Apr 30 13:10:54 2008
+++ src/share/man/man4/ums.4	Fri Nov 27 09:49:42 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: ums.4,v 1.8 2008/04/30 13:10:54 martin Exp $
+.\ $NetBSD: ums.4,v 1.8.4.1 2009/11/27 09:49:42 sborrill Exp $
 .\
 .\ Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,20 +27,20 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 12, 1998
+.Dd November 27, 2009
 .Dt UMS 4
 .Os
 .Sh NAME
 .Nm ums
-.Nd USB mouse support
+.Nd USB mouse and touchpanel support
 .Sh SYNOPSIS
 .Cd ums* at uhidev? reportid ?
 .Cd wsmouse* at ums?
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for USB mice.
-Access to the mouse is through the
+driver provides support for USB mice and touchpanels.
+Access to the movement data is through the
 .Xr wscons 4
 driver.
 .Sh SEE ALSO
@@ -53,3 +53,5 @@
 driver
 appeared in
 .Nx 1.4 .
+Touchpanel support was added in
+.Nx 5.1 .

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.73.8.1 src/sys/dev/usb/ums.c:1.73.8.2
--- src/sys/dev/usb/ums.c:1.73.8.1	Fri Nov 27 08:54:13 2009
+++ src/sys/dev/usb/ums.c	Fri Nov 27 09:49:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.73.8.1 2009/11/27 08:54:13 sborrill Exp $	*/
+/*	$NetBSD: ums.c,v 1.73.8.2 2009/11/27 09:49:42 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.73.8.1 2009/11/27 08:54:13 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ums.c,v 1.73.8.2 2009/11/27 09:49:42 sborrill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -96,6 +96,7 @@
 #define UMS_SPUR_BUT_UP	0x02	/* spurious button up events */
 #define UMS_REVZ	0x04	/* Z-axis is reversed */
 #define UMS_W		0x08	/* w direction/tilt available */
+#define UMS_ABS		0x10	/* absolute position, touchpanel */
 
 	int nbuttons;
 
@@ -106,7 +107,6 @@
 };
 
 #define MOUSE_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)
-#define MOUSE_FLAGS (HIO_RELATIVE)
 
 Static void ums_intr(struct uhidev *addr, void *ibuf, u_int len);
 
@@ -181,7 +181,13 @@
 		   USBDEVNAME(sc-sc_hdev.sc_dev));
 		USB_ATTACH_ERROR_RETURN;
 	}
-	if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+	switch (flags  MOUSE_FLAGS_MASK) {
+	case 0:
+		sc-flags |= UMS_ABS;
+		break;
+	case HIO_RELATIVE:
+		break;
+	default:
 		aprint_error(\n%s: X report 0x%04x not supported\n,
 		   USBDEVNAME(sc-sc_hdev.sc_dev), flags);
 		USB_ATTACH_ERROR_RETURN;
@@ -193,7 +199,13 @@
 		   USBDEVNAME(sc-sc_hdev.sc_dev));
 		USB_ATTACH_ERROR_RETURN;
 	}
-	if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+	switch (flags  MOUSE_FLAGS_MASK) {
+	case 0:
+		sc-flags |= UMS_ABS;
+		break;
+	case HIO_RELATIVE:
+		break;
+	default:
 		aprint_error(\n%s: Y report 0x%04x not supported\n,
 		   USBDEVNAME(sc-sc_hdev.sc_dev), flags);
 		USB_ATTACH_ERROR_RETURN;
@@ -210,7 +222,7 @@
 
 	zloc = sc-sc_loc_z;
 	if (hl) {
-		if ((flags  MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
+		if ((flags  MOUSE_FLAGS_MASK) != HIO_RELATIVE) {
 			aprint_verbose(\n%s: Wheel report 0x%04x not 
 			supported\n, USBDEVNAME(sc-sc_hdev.sc_dev),
 			flags);
@@ -248,7

CVS commit: [netbsd-5] src/doc

2009-11-27 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 27 09:50:04 UTC 2009

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

Log Message:
Ticket 1164


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.145 src/doc/CHANGES-5.1:1.1.2.146
--- src/doc/CHANGES-5.1:1.1.2.145	Fri Nov 27 09:16:06 2009
+++ src/doc/CHANGES-5.1	Fri Nov 27 09:50:03 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.145 2009/11/27 09:16:06 sborrill Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.146 2009/11/27 09:50:03 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -14885,3 +14885,13 @@
 	Fixes PR/42312.
 	[dsl, ticket #1141]
 
+doc/CHANGES	1.320 via patch
+share/man/man4/ums.41.9
+sys/dev/usb/ums.c1.77
+
+	Add support for USB HID devices that report absolute coordinates
+	instead of relative movement data, e.g. touchpanels.  Please
+	note that calibration must be done outside the wscons(4) driver
+	for now.
+	[mbalmer, ticket #1164]
+



CVS commit: src/distrib/macppc/floppies/ramdisk

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 10:23:16 UTC 2009

Modified Files:
src/distrib/macppc/floppies/ramdisk: list

Log Message:
Remove unnecessary and never used usr/mdec/mbr from install ramdisk.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/macppc/floppies/ramdisk/list

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

Modified files:

Index: src/distrib/macppc/floppies/ramdisk/list
diff -u src/distrib/macppc/floppies/ramdisk/list:1.34 src/distrib/macppc/floppies/ramdisk/list:1.35
--- src/distrib/macppc/floppies/ramdisk/list:1.34	Sun Sep 20 23:19:54 2009
+++ src/distrib/macppc/floppies/ramdisk/list	Fri Nov 27 10:23:16 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.34 2009/09/20 23:19:54 abs Exp $
+#	$NetBSD: list,v 1.35 2009/11/27 10:23:16 tsutsui Exp $
 
 SRCDIRS	bin sbin usr.bin usr.sbin
 
@@ -72,7 +72,6 @@
 LIBS	libhack.o -ledit -lutil -lcurses -ltermcap -lrmt -ll -lm -lz -lprop
 
 COPY	${DESTDIR}/usr/mdec/bootxx	usr/mdec/bootxx
-COPY	${DESTDIR}/usr/mdec/mbr		usr/mdec/mbr
 COPY	${DESTDIR}/usr/mdec/ofwboot	usr/mdec/ofwboot
 
 # various files that we need in /etc for the install



CVS commit: src/sys/arch/sgimips/mace

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:04:18 UTC 2009

Modified Files:
src/sys/arch/sgimips/mace: if_mec.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/sgimips/mace/if_mec.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/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.39 src/sys/arch/sgimips/mace/if_mec.c:1.40
--- src/sys/arch/sgimips/mace/if_mec.c:1.39	Wed Sep  2 17:22:53 2009
+++ src/sys/arch/sgimips/mace/if_mec.c	Fri Nov 27 11:04:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.40 2009/11/27 11:04:18 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.40 2009/11/27 11:04:18 tsutsui Exp $);
 
 #include opt_ddb.h
 #include bpfilter.h
@@ -1714,7 +1714,7 @@
 		}
 
 		/*
-		 * If 802.1Q VLAN MTU is enabled, ignore the bad packet errror.
+		 * If 802.1Q VLAN MTU is enabled, ignore the bad packet error.
 		 */
 		if ((sc-sc_ethercom.ec_capenable  ETHERCAP_VLAN_MTU) != 0)
 			rxstat = ~MEC_RXSTAT_BADPACKET;



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

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:05:45 UTC 2009

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

Log Message:
Move some devices where they should belong to.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/arch/sparc/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.216 src/sys/arch/sparc/conf/GENERIC:1.217
--- src/sys/arch/sparc/conf/GENERIC:1.216	Sun Sep 27 13:27:44 2009
+++ src/sys/arch/sparc/conf/GENERIC	Fri Nov 27 11:05:45 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.216 2009/09/27 13:27:44 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.217 2009/11/27 11:05:45 tsutsui Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.216 $
+#ident 		GENERIC-$Revision: 1.217 $
 
 maxusers	32
 
@@ -484,14 +484,6 @@
 #atabus* at ata?
 #wd*	at atabus? drive ? flags 0x
 
-## PCMCIA wavelan card
-#wi*	at pcmcia? function ?		# Lucent WaveLan IEEE (802.11)
-
-#
-# accept filters
-pseudo-device   accf_data		# dataready accept filter
-pseudo-device   accf_http		# httpready accept filter
-
 ## A disk-like interface to files.  Can be used to create floppy, CD,
 ## miniroot images, etc.
 
@@ -576,6 +568,9 @@
 #ne*	at pcmcia?
 #sm*	at pcmcia?
 
+## PCMCIA wavelan card
+#wi*	at pcmcia? function ?		# Lucent WaveLan IEEE (802.11)
+
 # MII/PHY support
 exphy*	at mii? phy ?			# 3Com internal PHYs
 icsphy*	at mii? phy ?			# Integrated Circuit Systems ICS189x
@@ -633,6 +628,10 @@
 #options 	BRIDGE_IPF		# bridge uses IP/IPv6 pfil hooks too
 pseudo-device	agr			# IEEE 802.3ad link aggregation
 
+## accept filters
+pseudo-device   accf_data		# dataready accept filter
+pseudo-device   accf_http		# httpready accept filter
+
  Audio and video devices
 
 ## /dev/audio support (`audioamd' plus `audio')



CVS commit: src/sys/arch/sparc/stand/ofwboot

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:14:23 UTC 2009

Modified Files:
src/sys/arch/sparc/stand/ofwboot: Makefile

Log Message:
Add src/common/include to -Ipath for proplib(3) so that build works
even without installed DESTDIR.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc/stand/ofwboot/Makefile

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

Modified files:

Index: src/sys/arch/sparc/stand/ofwboot/Makefile
diff -u src/sys/arch/sparc/stand/ofwboot/Makefile:1.21 src/sys/arch/sparc/stand/ofwboot/Makefile:1.22
--- src/sys/arch/sparc/stand/ofwboot/Makefile:1.21	Wed Oct 17 19:57:16 2007
+++ src/sys/arch/sparc/stand/ofwboot/Makefile	Fri Nov 27 11:14:23 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2007/10/17 19:57:16 garbled Exp $
+#	$NetBSD: Makefile,v 1.22 2009/11/27 11:14:23 tsutsui Exp $
 
 CURDIR=	${.CURDIR}
 S=	${CURDIR}/../../../..
@@ -49,6 +49,7 @@
 ENTRY=		_start
 
 CPPFLAGS+=	-I${CURDIR}/../../.. -I${CURDIR}/../../../.. -I${CURDIR} -I.
+CPPFLAGS+=	-I${CURDIR}/../../../../../common/include
 CPPFLAGS+=	-DRELOC=0x${RELOC}
 
 #



CVS commit: src/sys/ufs/ext2fs

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:16:54 UTC 2009

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h ext2fs_dinode.h

Log Message:
Add definitions for more reserved inodes.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.21 -r1.22 src/sys/ufs/ext2fs/ext2fs_dinode.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/ufs/ext2fs/ext2fs.h
diff -u src/sys/ufs/ext2fs/ext2fs.h:1.28 src/sys/ufs/ext2fs/ext2fs.h:1.29
--- src/sys/ufs/ext2fs/ext2fs.h:1.28	Mon Oct 19 18:41:17 2009
+++ src/sys/ufs/ext2fs/ext2fs.h	Fri Nov 27 11:16:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.h,v 1.28 2009/10/19 18:41:17 bouyer Exp $	*/
+/*	$NetBSD: ext2fs.h,v 1.29 2009/11/27 11:16:54 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -198,6 +198,7 @@
 
 /* compatible/incompatible features */
 #define EXT2F_COMPAT_PREALLOC		0x0001
+#define EXT2F_COMPAT_HASJOURNAL		0x0004
 #define EXT2F_COMPAT_RESIZE		0x0010
 
 #define EXT2F_ROCOMPAT_SPARSESUPER	0x0001

Index: src/sys/ufs/ext2fs/ext2fs_dinode.h
diff -u src/sys/ufs/ext2fs/ext2fs_dinode.h:1.21 src/sys/ufs/ext2fs/ext2fs_dinode.h:1.22
--- src/sys/ufs/ext2fs/ext2fs_dinode.h:1.21	Mon Oct 19 18:41:17 2009
+++ src/sys/ufs/ext2fs/ext2fs_dinode.h	Fri Nov 27 11:16:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_dinode.h,v 1.21 2009/10/19 18:41:17 bouyer Exp $	*/
+/*	$NetBSD: ext2fs_dinode.h,v 1.22 2009/11/27 11:16:54 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1989, 1993
@@ -75,9 +75,15 @@
  * the root inode is 2.
  * Inode 3 to 10 are reserved in ext2fs.
  */
-#define	EXT2_ROOTINO	((ino_t)2)
-#define	EXT2_RESIZEINO	((ino_t)7)
-#define	EXT2_FIRSTINO	((ino_t)11)
+#define	EXT2_BADBLKINO		((ino_t)1)
+#define	EXT2_ROOTINO		((ino_t)2)
+#define	EXT2_ACLIDXINO		((ino_t)3)
+#define	EXT2_ACLDATAINO		((ino_t)4)
+#define	EXT2_BOOTLOADERINO	((ino_t)5)
+#define	EXT2_UNDELDIRINO	((ino_t)6)
+#define	EXT2_RESIZEINO		((ino_t)7)
+#define	EXT2_JOURNALINO		((ino_t)8)
+#define	EXT2_FIRSTINO		((ino_t)11)
 
 /*
  * A dinode contains all the meta-data associated with a UFS file.



CVS commit: src/sys/kern

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:23:51 UTC 2009

Modified Files:
src/sys/kern: subr_disk.c

Log Message:
u_short - uint16_t, some KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/subr_disk.c

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

Modified files:

Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.97 src/sys/kern/subr_disk.c:1.98
--- src/sys/kern/subr_disk.c:1.97	Wed May 20 03:26:21 2009
+++ src/sys/kern/subr_disk.c	Fri Nov 27 11:23:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk.c,v 1.97 2009/05/20 03:26:21 dyoung Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.98 2009/11/27 11:23:50 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_disk.c,v 1.97 2009/05/20 03:26:21 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_disk.c,v 1.98 2009/11/27 11:23:50 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -85,20 +85,21 @@
 u_int
 dkcksum(struct disklabel *lp)
 {
+
 	return dkcksum_sized(lp, lp-d_npartitions);
 }
 
 u_int
 dkcksum_sized(struct disklabel *lp, size_t npartitions)
 {
-	u_short *start, *end;
-	u_short sum = 0;
+	uint16_t *start, *end;
+	uint16_t sum = 0;
 
-	start = (u_short *)lp;
-	end = (u_short *)lp-d_partitions[npartitions];
+	start = (uint16_t *)lp;
+	end = (uint16_t *)lp-d_partitions[npartitions];
 	while (start  end)
 		sum ^= *start++;
-	return (sum);
+	return sum;
 }
 
 /*



CVS commit: src/share/mk

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 11:44:36 UTC 2009

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

Log Message:
If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.242 -r1.243 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.298 src/share/mk/bsd.lib.mk:1.299
--- src/share/mk/bsd.lib.mk:1.298	Fri Apr 10 16:16:12 2009
+++ src/share/mk/bsd.lib.mk	Fri Nov 27 11:44:36 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.298 2009/04/10 16:16:12 apb Exp $
+#	$NetBSD: bsd.lib.mk,v 1.299 2009/11/27 11:44:36 tsutsui Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include bsd.init.mk
@@ -72,9 +72,13 @@
 
 # Use purely kernel private headers in rump builds
 .if !defined(RUMPKERNEL)
+.if empty(CPPFLAGS:M-nostdinc)
 CPPFLAGS+=	${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
+.endif
+.if empty(CXXFLAGS:M-nostdinc++)
 CXXFLAGS+=	${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
 .endif
+.endif
 
 .if !defined(SHLIB_MAJOR)  exists(${SHLIB_VERSION_FILE})		# {
 SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.242 src/share/mk/bsd.prog.mk:1.243
--- src/share/mk/bsd.prog.mk:1.242	Tue May 12 18:07:54 2009
+++ src/share/mk/bsd.prog.mk	Fri Nov 27 11:44:36 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.242 2009/05/12 18:07:54 plunky Exp $
+#	$NetBSD: bsd.prog.mk,v 1.243 2009/11/27 11:44:36 tsutsui Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -53,8 +53,12 @@
 .endif
 
 # Default values
+.if empty(CPPFLAGS:M-nostdinc)
 CPPFLAGS+=	${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
+.endif
+.if empty(CXXFLAGS:M-nostdinc++)
 CXXFLAGS+=	${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
+.endif
 CFLAGS+=	${COPTS}
 OBJCFLAGS+=	${OBJCOPTS}
 MKDEP_SUFFIXES?=	.o .ln



CVS commit: src/sys/uvm

2009-11-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Nov 27 12:25:10 UTC 2009

Modified Files:
src/sys/uvm: uvm_unix.c

Log Message:
Make break(2) reject high adresses that wrap to 0 after page rounding.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/uvm/uvm_unix.c

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

Modified files:

Index: src/sys/uvm/uvm_unix.c
diff -u src/sys/uvm/uvm_unix.c:1.41 src/sys/uvm/uvm_unix.c:1.42
--- src/sys/uvm/uvm_unix.c:1.41	Wed Mar  4 21:52:38 2009
+++ src/sys/uvm/uvm_unix.c	Fri Nov 27 12:25:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_unix.c,v 1.41 2009/03/04 21:52:38 christos Exp $	*/
+/*	$NetBSD: uvm_unix.c,v 1.42 2009/11/27 12:25:10 njoly Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_unix.c,v 1.41 2009/03/04 21:52:38 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_unix.c,v 1.42 2009/11/27 12:25:10 njoly Exp $);
 
 #include opt_pax.h
 
@@ -86,7 +86,8 @@
 	mutex_enter(p-p_auxlock);
 	old = (vaddr_t)vm-vm_daddr;
 	new = round_page((vaddr_t)SCARG(uap, nsize));
-	if ((new - old)  p-p_rlimit[RLIMIT_DATA].rlim_cur  new  old) {
+	if (new == 0 ||
+	((new - old)  p-p_rlimit[RLIMIT_DATA].rlim_cur  new  old)) {
 		mutex_exit(p-p_auxlock);
 		return (ENOMEM);
 	}



CVS commit: src/external/bsd/byacc/dist

2009-11-27 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Nov 27 12:37:19 UTC 2009

Modified Files:
src/external/bsd/byacc/dist: skeleton.c

Log Message:
The expression (yyvs != 0) is always true and not a necessary test
in the first place since realloc(NULL, size) is equivalent to
malloc(size).  Write code straightforward while i'm here.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/skeleton.c

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

Modified files:

Index: src/external/bsd/byacc/dist/skeleton.c
diff -u src/external/bsd/byacc/dist/skeleton.c:1.5 src/external/bsd/byacc/dist/skeleton.c:1.6
--- src/external/bsd/byacc/dist/skeleton.c:1.5	Thu Oct 29 21:03:59 2009
+++ src/external/bsd/byacc/dist/skeleton.c	Fri Nov 27 12:37:19 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: skeleton.c,v 1.5 2009/10/29 21:03:59 christos Exp $	*/
+/*	$NetBSD: skeleton.c,v 1.6 2009/11/27 12:37:19 enami Exp $	*/
 /* Id: skeleton.c,v 1.19 2008/12/24 14:52:28 tom Exp */
 
 #include defs.h
 
 #include sys/cdefs.h
-__RCSID($NetBSD: skeleton.c,v 1.5 2009/10/29 21:03:59 christos Exp $);
+__RCSID($NetBSD: skeleton.c,v 1.6 2009/11/27 12:37:19 enami Exp $);
 
 /*  The definition of yysccsid in the banner should be replaced with	*/
 /*  a #pragma ident directive if the target C compiler supports		*/
@@ -115,17 +115,13 @@
 newsize = YYMAXDEPTH;,
 ,
 i = *yyssp - *yyss;,
-newss = (*yyss != 0),
-  ? (short *)realloc(*yyss, newsize * sizeof(*newss)),
-  : (short *)malloc(newsize * sizeof(*newss));,
+newss = (short *)realloc(*yyss, newsize * sizeof(*newss));,
 if (newss == 0),
 return -1;,
 ,
 *yyss  = newss;,
 *yyssp = newss + i;,
-newvs = (yyvs != 0),
-  ? (YYSTYPE *)realloc(*yyvs, newsize * sizeof(*newvs)),
-  : (YYSTYPE *)malloc(newsize * sizeof(*newvs));,
+newvs = (YYSTYPE *)realloc(*yyvs, newsize * sizeof(*newvs));,
 if (newvs == 0),
 return -1;,
 ,
@@ -171,12 +167,10 @@
 yystate = 0;,
 ,
 yystacksize = 0;,
-yyvs = NULL;,
-yyss = NULL;,
+yyvs = yyvsp = NULL;,
+yyss = yyssp = NULL;,
 if (yygrowstack(yyss, yyssp, yysslim, yyvs, yyvsp, yystacksize)),
 goto yyoverflow;,
-yyssp = yyss;,
-yyvsp = yyvs;,
 yystate = 0;,
 *yyssp = 0;,
 ,



CVS commit: src/sys/rump/librump/rumpkern

2009-11-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 27 13:45:15 UTC 2009

Modified Files:
src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c rump.c

Log Message:
Now that Makefile.rump was changed and everything gets built in
update builds too, flip the allocator define to prefer the kernel
pool/kmem instead of malloc(3).  Use malloc(3) only if
RUMP_USE_UNREAL_ALLOCATORS is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/memalloc.c
cvs rdiff -u -r1.140 -r1.141 src/sys/rump/librump/rumpkern/rump.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/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.64 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.65
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.64	Thu Nov 26 17:24:52 2009
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Fri Nov 27 13:45:15 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.64 2009/11/26 17:24:52 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.65 2009/11/27 13:45:15 pooka Exp $
 #
 
 .include ${RUMPTOP}/Makefile.rump
@@ -57,10 +57,12 @@
 # sys/dev
 SRCS+=	clock_subr.c
 
-# Comment these if you want to use malloc(3) directly instead of
-# the kernel allocators.  It's a few percent faster, but doesn't
-# emulate all kernel corner cases as well.
-CPPFLAGS+=	-DRUMP_USE_REAL_ALLOCATORS
+# Flip the comment to the other line if you want to use malloc(3)
+# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
+# Libc malloc is a few percent faster, but doesn't emulate all kernel
+# corner cases as well (not to mention if you want to debug the
+# allocators themselves).
+#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
 SRCS+=		subr_kmem.c subr_pool.c subr_vmem.c
 
 # no shlib_version because this is automatically in sync with lib/librump

Index: src/sys/rump/librump/rumpkern/memalloc.c
diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.1 src/sys/rump/librump/rumpkern/memalloc.c:1.2
--- src/sys/rump/librump/rumpkern/memalloc.c:1.1	Wed Nov  4 20:38:58 2009
+++ src/sys/rump/librump/rumpkern/memalloc.c	Fri Nov 27 13:45:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: memalloc.c,v 1.1 2009/11/04 20:38:58 pooka Exp $	*/
+/*	$NetBSD: memalloc.c,v 1.2 2009/11/27 13:45:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -32,6 +32,7 @@
 #include sys/kmem.h
 #include sys/malloc.h
 #include sys/pool.h
+#include sys/vmem.h
 
 #include rump/rumpuser.h
 
@@ -94,7 +95,7 @@
  * Kmem
  */
 
-#ifndef RUMP_USE_REAL_ALLOCATORS
+#ifdef RUMP_USE_UNREAL_ALLOCATORS
 void
 kmem_init()
 {
@@ -310,4 +311,11 @@
 
 	return pool_put(pp, item);
 }
-#endif /* RUMP_USE_REAL_ALLOCATORS */
+
+void
+vmem_rehash_start()
+{
+
+	return;
+}
+#endif /* RUMP_USE_UNREAL_ALLOCATORS */

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.140 src/sys/rump/librump/rumpkern/rump.c:1.141
--- src/sys/rump/librump/rumpkern/rump.c:1.140	Thu Nov 26 20:58:51 2009
+++ src/sys/rump/librump/rumpkern/rump.c	Fri Nov 27 13:45:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.140 2009/11/26 20:58:51 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.140 2009/11/26 20:58:51 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -313,10 +313,8 @@
 
 	lwp0.l_fd = proc0.p_fd = fd_init(rump_filedesc0);
 
-#ifdef RUMP_USE_REAL_ALLOCATORS
 	if (rump_threads)
 		vmem_rehash_start();
-#endif
 
 	rump_unschedule();
 



CVS commit: src

2009-11-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 27 13:50:29 UTC 2009

Modified Files:
src/share/mk: bsd.klinks.mk
src/sys/arch/amd64/include: Makefile.inc

Log Message:
Move -mcmodel=kernel CFLAGS from bsd.klinks.mk to amd64/include/Makefile.inc
to avoid having the kernel toolchain flags split over a billion different
files.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/mk/bsd.klinks.mk
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/include/Makefile.inc

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

Modified files:

Index: src/share/mk/bsd.klinks.mk
diff -u src/share/mk/bsd.klinks.mk:1.5 src/share/mk/bsd.klinks.mk:1.6
--- src/share/mk/bsd.klinks.mk:1.5	Sun Mar 15 05:57:54 2009
+++ src/share/mk/bsd.klinks.mk	Fri Nov 27 13:50:29 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.klinks.mk,v 1.5 2009/03/15 05:57:54 tsutsui Exp $
+#	$NetBSD: bsd.klinks.mk,v 1.6 2009/11/27 13:50:29 pooka Exp $
 #
 
 .include bsd.own.mk
@@ -23,9 +23,6 @@
 CLEANFILES+=	x86
 .elif ${MACHINE} == amd64
 CLEANFILES+=	x86
-.if !defined(RUMPKERNEL)
-CFLAGS+=	-mcmodel=kernel
-.endif
 .endif
 
 .if defined(XEN_BUILD) || ${MACHINE} == xen

Index: src/sys/arch/amd64/include/Makefile.inc
diff -u src/sys/arch/amd64/include/Makefile.inc:1.2 src/sys/arch/amd64/include/Makefile.inc:1.3
--- src/sys/arch/amd64/include/Makefile.inc:1.2	Wed Nov 25 17:08:08 2009
+++ src/sys/arch/amd64/include/Makefile.inc	Fri Nov 27 13:50:29 2009
@@ -1,4 +1,10 @@
-# $NetBSD: Makefile.inc,v 1.2 2009/11/25 17:08:08 tron Exp $
+# $NetBSD: Makefile.inc,v 1.3 2009/11/27 13:50:29 pooka Exp $
 
 CFLAGS+=	-mno-red-zone
+
+# this should really be !(RUMPKERNEL  PIC)
+.if !defined(RUMPKERNEL)
+CFLAGS+=	-mcmodel=kernel
+.endif
+
 USE_SSP?=	yes



CVS commit: xsrc/external/mit/xf86-input-ws

2009-11-27 Thread Marc Balmer
Module Name:xsrc
Committed By:   mbalmer
Date:   Fri Nov 27 14:17:20 UTC 2009

Update of /cvsroot/xsrc/external/mit/xf86-input-ws
In directory ivanova.netbsd.org:/tmp/cvs-serv3021

Log Message:
initial import of xf86-input-ws, from OpenBSD

Status:

Vendor Tag: mbalmer
Release Tags:   xf86-input-ws-1-2-9

N xsrc/external/mit/xf86-input-ws/include/config.h
N xsrc/external/mit/xf86-input-ws/dist/Makefile.am
N xsrc/external/mit/xf86-input-ws/dist/Makefile.bsd-wrapper
N xsrc/external/mit/xf86-input-ws/dist/Makefile.in
N xsrc/external/mit/xf86-input-ws/dist/aclocal.m4
N xsrc/external/mit/xf86-input-ws/dist/autogen.sh
N xsrc/external/mit/xf86-input-ws/dist/config.guess
N xsrc/external/mit/xf86-input-ws/dist/config.h.in
N xsrc/external/mit/xf86-input-ws/dist/config.sub
N xsrc/external/mit/xf86-input-ws/dist/configure
N xsrc/external/mit/xf86-input-ws/dist/configure.ac
N xsrc/external/mit/xf86-input-ws/dist/depcomp
N xsrc/external/mit/xf86-input-ws/dist/install-sh
N xsrc/external/mit/xf86-input-ws/dist/ltmain.sh
N xsrc/external/mit/xf86-input-ws/dist/missing
N xsrc/external/mit/xf86-input-ws/dist/include/Makefile.am
N xsrc/external/mit/xf86-input-ws/dist/include/Makefile.in
N xsrc/external/mit/xf86-input-ws/dist/include/ws-properties.h
N xsrc/external/mit/xf86-input-ws/dist/man/Makefile.am
N xsrc/external/mit/xf86-input-ws/dist/man/Makefile.in
N xsrc/external/mit/xf86-input-ws/dist/man/ws.man
N xsrc/external/mit/xf86-input-ws/dist/src/Makefile.am
N xsrc/external/mit/xf86-input-ws/dist/src/Makefile.in
N xsrc/external/mit/xf86-input-ws/dist/src/ws.c
N xsrc/external/mit/xf86-input-ws/dist/src/emumb.c
N xsrc/external/mit/xf86-input-ws/dist/src/ws.h

No conflicts created by this import



CVS commit: src/external/gpl3/binutils/usr.bin/ld

2009-11-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 27 14:39:39 UTC 2009

Modified Files:
src/external/gpl3/binutils/usr.bin/ld: Makefile

Log Message:
Fix typo and hopefully the dependency problem that manifests itself with
compile problems around lang_insert_orphan.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/usr.bin/ld/Makefile

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

Modified files:

Index: src/external/gpl3/binutils/usr.bin/ld/Makefile
diff -u src/external/gpl3/binutils/usr.bin/ld/Makefile:1.5 src/external/gpl3/binutils/usr.bin/ld/Makefile:1.6
--- src/external/gpl3/binutils/usr.bin/ld/Makefile:1.5	Tue Nov 10 14:47:52 2009
+++ src/external/gpl3/binutils/usr.bin/ld/Makefile	Fri Nov 27 14:39:39 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2009/11/10 14:47:52 skrll Exp $
+#	$NetBSD: Makefile,v 1.6 2009/11/27 14:39:39 skrll Exp $
 
 .include bsd.own.mk
 
@@ -59,9 +59,9 @@
 	${_MKTARGET_CREATE}
 	(srcdir=${DIST}/ld EMULATION_NAME=$f . ${:M*.sh}  \
 		if [ x$$TEMPLATE_NAME != x ]; then \
-			temp_emul=$$TEMPLATE_NAME.em; \
+			temp_name=$$TEMPLATE_NAME.em; \
 		else \
-			temp_emul=; \
+			temp_name=; \
 		fi; \
 		if [ x$$SCRIPT_NAME != x ]; then \
 			script=$$SCRIPT_NAME.sc; \



CVS commit: src/sys

2009-11-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 27 16:43:51 UTC 2009

Modified Files:
src/sys/kern: init_main.c vfs_subr.c
src/sys/rump/librump/rumpvfs: rump_vfs.c rumpfs.c

Log Message:
Move rootfs-related init from init_main() to vfs_mountroot().
Reduces code re-written in rump.


To generate a diff of this commit:
cvs rdiff -u -r1.410 -r1.411 src/sys/kern/init_main.c
cvs rdiff -u -r1.390 -r1.391 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.30 -r1.31 src/sys/rump/librump/rumpvfs/rumpfs.c

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

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.410 src/sys/kern/init_main.c:1.411
--- src/sys/kern/init_main.c:1.410	Sun Nov 15 02:37:13 2009
+++ src/sys/kern/init_main.c	Fri Nov 27 16:43:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.410 2009/11/15 02:37:13 elad Exp $	*/
+/*	$NetBSD: init_main.c,v 1.411 2009/11/27 16:43:51 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.410 2009/11/15 02:37:13 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.411 2009/11/27 16:43:51 pooka Exp $);
 
 #include opt_ddb.h
 #include opt_ipsec.h
@@ -253,7 +253,6 @@
 
 extern struct proc proc0;
 extern struct lwp lwp0;
-extern struct cwdinfo cwdi0;
 extern time_t rootfstime;
 
 #ifndef curlwp
@@ -632,30 +631,6 @@
 	 */
 	inittodr(rootfstime);
 
-	CIRCLEQ_FIRST(mountlist)-mnt_flag |= MNT_ROOTFS;
-	CIRCLEQ_FIRST(mountlist)-mnt_op-vfs_refcount++;
-
-	/*
-	 * Get the vnode for '/'.  Set filedesc0.fd_fd.fd_cdir to
-	 * reference it.
-	 */
-	error = VFS_ROOT(CIRCLEQ_FIRST(mountlist), rootvnode);
-	if (error)
-		panic(cannot find root vnode, error=%d, error);
-	cwdi0.cwdi_cdir = rootvnode;
-	VREF(cwdi0.cwdi_cdir);
-	VOP_UNLOCK(rootvnode, 0);
-	cwdi0.cwdi_rdir = NULL;
-
-	/*
-	 * Now that root is mounted, we can fixup initproc's CWD
-	 * info.  All other processes are kthreads, which merely
-	 * share proc0's CWD info.
-	 */
-	initproc-p_cwdi-cwdi_cdir = rootvnode;
-	VREF(initproc-p_cwdi-cwdi_cdir);
-	initproc-p_cwdi-cwdi_rdir = NULL;
-
 	/*
 	 * Now can look at time, having had a chance to verify the time
 	 * from the file system.  Reset l-l_rtime as it may have been

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.390 src/sys/kern/vfs_subr.c:1.391
--- src/sys/kern/vfs_subr.c:1.390	Thu Nov 26 20:52:19 2009
+++ src/sys/kern/vfs_subr.c	Fri Nov 27 16:43:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.390 2009/11/26 20:52:19 pooka Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.391 2009/11/27 16:43:51 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.390 2009/11/26 20:52:19 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.391 2009/11/27 16:43:51 pooka Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -2567,6 +2567,33 @@
 		VOP_CLOSE(rootvp, FREAD, FSCRED);
 		vrele(rootvp);
 	}
+	if (error == 0) {
+		extern struct cwdinfo cwdi0;
+
+		CIRCLEQ_FIRST(mountlist)-mnt_flag |= MNT_ROOTFS;
+		CIRCLEQ_FIRST(mountlist)-mnt_op-vfs_refcount++;
+
+		/*
+		 * Get the vnode for '/'.  Set cwdi0.cwdi_cdir to
+		 * reference it.
+		 */
+		error = VFS_ROOT(CIRCLEQ_FIRST(mountlist), rootvnode);
+		if (error)
+			panic(cannot find root vnode, error=%d, error);
+		cwdi0.cwdi_cdir = rootvnode;
+		VREF(cwdi0.cwdi_cdir);
+		VOP_UNLOCK(rootvnode, 0);
+		cwdi0.cwdi_rdir = NULL;
+
+		/*
+		 * Now that root is mounted, we can fixup initproc's CWD
+		 * info.  All other processes are kthreads, which merely
+		 * share proc0's CWD info.
+		 */
+		initproc-p_cwdi-cwdi_cdir = rootvnode;
+		VREF(initproc-p_cwdi-cwdi_cdir);
+		initproc-p_cwdi-cwdi_rdir = NULL;
+	}
 	return (error);
 }
 

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.36 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.37
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.36	Thu Nov 26 21:04:42 2009
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Fri Nov 27 16:43:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.36 2009/11/26 21:04:42 pooka Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.37 2009/11/27 16:43:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.36 2009/11/26 21:04:42 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.37 2009/11/27 16:43:51 pooka Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -113,6 +113,11 @@
 	rootfstype = ROOT_FSTYPE_ANY;
 	root_device = RUMP_VFSROOTDEV;
 
+	/* bootstrap cwdi (rest done in vfs_mountroot() */
+	rw_init(cwdi0.cwdi_lock);
+	proc0.p_cwdi = cwdi0;
+	proc0.p_cwdi = cwdinit();

CVS commit: src

2009-11-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov 27 15:37:32 UTC 2009

Modified Files:
src/distrib/sets/lists/base: md.macppc
src/sbin/fdisk: Makefile
Removed Files:
src/sbin/fdisk/mbr: Makefile mbr_macppc.S

Log Message:
Remove fdisk/mbr for macppc which was blindly pulled from OpenBSD.
It just fakes MBR partition map which contains 1MB FAT16B partition
and ~1GB OpenBSD partition, and we can always create necessary
MBR partitions for OpenFirmware by the fdisk(8) command itself.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/base/md.macppc
cvs rdiff -u -r1.40 -r1.41 src/sbin/fdisk/Makefile
cvs rdiff -u -r1.20 -r0 src/sbin/fdisk/mbr/Makefile
cvs rdiff -u -r1.1 -r0 src/sbin/fdisk/mbr/mbr_macppc.S

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

Modified files:

Index: src/distrib/sets/lists/base/md.macppc
diff -u src/distrib/sets/lists/base/md.macppc:1.27 src/distrib/sets/lists/base/md.macppc:1.28
--- src/distrib/sets/lists/base/md.macppc:1.27	Sat Nov 29 17:57:34 2008
+++ src/distrib/sets/lists/base/md.macppc	Fri Nov 27 15:37:32 2009
@@ -1,8 +1,8 @@
-# $NetBSD: md.macppc,v 1.27 2008/11/29 17:57:34 tsutsui Exp $
+# $NetBSD: md.macppc,v 1.28 2009/11/27 15:37:32 tsutsui Exp $
 ./sbin/pdisk	base-sysutil-root
 ./usr/mdec/bootxxbase-sysutil-bin
 ./usr/mdec/installbootbase-obsolete		obsolete
-./usr/mdec/mbr	base-sysutil-bin
+./usr/mdec/mbr	base-obsolete		obsolete
 ./usr/mdec/ofwbootbase-sysutil-bin
 ./usr/mdec/ofwboot.elfbase-sysutil-bin
 ./usr/mdec/ofwboot.xcfbase-sysutil-bin

Index: src/sbin/fdisk/Makefile
diff -u src/sbin/fdisk/Makefile:1.40 src/sbin/fdisk/Makefile:1.41
--- src/sbin/fdisk/Makefile:1.40	Mon Jun  1 19:57:33 2009
+++ src/sbin/fdisk/Makefile	Fri Nov 27 15:37:32 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.40 2009/06/01 19:57:33 christos Exp $
+#	$NetBSD: Makefile,v 1.41 2009/11/27 15:37:32 tsutsui Exp $
 
 PROG=	fdisk 
 SRCS=	fdisk.c
@@ -16,8 +16,6 @@
 .include bsd.prog.mk
 
 .if (${HOSTPROG:U} == )
-SUBDIR=	mbr
 DPADD+=	${LIBUTIL} ${LIBZ}
 LDADD+=	-lutil -lz
-.include bsd.subdir.mk
 .endif



CVS commit: src/sys/fs/hfs

2009-11-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 27 15:58:39 UTC 2009

Modified Files:
src/sys/fs/hfs: libhfs.c

Log Message:
Don't spam if mount fails due to invalid file system.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/fs/hfs/libhfs.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/hfs/libhfs.c
diff -u src/sys/fs/hfs/libhfs.c:1.8 src/sys/fs/hfs/libhfs.c:1.9
--- src/sys/fs/hfs/libhfs.c:1.8	Tue Jul 14 21:12:18 2009
+++ src/sys/fs/hfs/libhfs.c	Fri Nov 27 15:58:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libhfs.c,v 1.8 2009/07/14 21:12:18 apb Exp $	*/
+/*	$NetBSD: libhfs.c,v 1.9 2009/11/27 15:58:39 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: libhfs.c,v 1.8 2009/07/14 21:12:18 apb Exp $);
+__KERNEL_RCSID(0, $NetBSD: libhfs.c,v 1.9 2009/11/27 15:58:39 pooka Exp $);
 
 #include libhfs.h
 
@@ -226,7 +226,9 @@
 			break;
 			
 		default:
-			HFS_LIBERR(unrecognized volume format);
+			/* HFS_LIBERR(unrecognized volume format); */
+			goto error;
+			break;
 	}
 
 



CVS commit: src/sys/rump/librump/rumpkern

2009-11-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 27 17:55:04 UTC 2009

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Remove no longer necessary vfs weak symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/rump/librump/rumpkern/rump.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/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.141 src/sys/rump/librump/rumpkern/rump.c:1.142
--- src/sys/rump/librump/rumpkern/rump.c:1.141	Fri Nov 27 13:45:15 2009
+++ src/sys/rump/librump/rumpkern/rump.c	Fri Nov 27 17:55:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.142 2009/11/27 17:55:04 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.142 2009/11/27 17:55:04 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -133,11 +133,6 @@
 
 void rump__unavailable_vfs_panic(void);
 void rump__unavailable_vfs_panic() {panic(vfs component not available);}
-__weak_alias(vn_open,rump__unavailable_vfs_panic);
-__weak_alias(vn_rdwr,rump__unavailable_vfs_panic);
-__weak_alias(vn_stat,rump__unavailable_vfs_panic);
-__weak_alias(vn_close,rump__unavailable_vfs_panic);
-__weak_alias(namei,rump__unavailable_vfs_panic);
 __weak_alias(usermount_common_policy,rump__unavailable_vfs_panic);
 
 static void



CVS commit: src/external/gpl2/xcvs/dist/src

2009-11-27 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Fri Nov 27 18:38:29 UTC 2009

Modified Files:
src/external/gpl2/xcvs/dist/src: zlib.c

Log Message:
Fix compressed server accesses.
According to http://cvs.savannah.gnu.org/viewvc/ccvs/src/?root=cvs
this was broken between revs 1.29 and 1.32 for a perion of 4 months
about 4 years ago.
Not sure at all why/how we have the broken version.
Our old code, the latest gnu code and this fix all differ slightly,
but have the same effect.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/zlib.c

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

Modified files:

Index: src/external/gpl2/xcvs/dist/src/zlib.c
diff -u src/external/gpl2/xcvs/dist/src/zlib.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/zlib.c:1.2
--- src/external/gpl2/xcvs/dist/src/zlib.c:1.1.1.1	Tue Apr  7 22:10:29 2009
+++ src/external/gpl2/xcvs/dist/src/zlib.c	Fri Nov 27 18:38:29 2009
@@ -229,7 +229,7 @@
 	   would fetch all the available bytes, and at least one byte.  */
 
 	status = (*cb-buf-input) (cb-buf-closure, bd-text,
-need, BUFFER_DATA_SIZE, nread);
+need  0, BUFFER_DATA_SIZE, nread);
 
 	if (status == -2)
 	/* Don't try to recover from memory allcoation errors.  */



CVS commit: src/sys/arch/hppa/hppa

2009-11-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 27 20:32:10 UTC 2009

Modified Files:
src/sys/arch/hppa/hppa: trap.c

Log Message:
Fix DEBUG build.  Hi rmind.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hppa/hppa/trap.c

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

Modified files:

Index: src/sys/arch/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.62 src/sys/arch/hppa/hppa/trap.c:1.63
--- src/sys/arch/hppa/hppa/trap.c:1.62	Fri Nov 27 03:23:09 2009
+++ src/sys/arch/hppa/hppa/trap.c	Fri Nov 27 20:32:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.62 2009/11/27 03:23:09 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.63 2009/11/27 20:32:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.62 2009/11/27 03:23:09 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.63 2009/11/27 20:32:10 skrll Exp $);
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -428,6 +428,8 @@
 	if (tf-tf_iisq_head == HPPA_SID_KERNEL) {
 		vaddr_t minsp, maxsp, uv;
 
+		uv = uvm_lwp_getuarea(l);
+
 		/*
 		 * If the trap happened in the gateway
 		 * page, we take the easy way out and 



CVS commit: src/sys/dev/isa

2009-11-27 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Fri Nov 27 20:56:29 UTC 2009

Modified Files:
src/sys/dev/isa: if_ntwoc_isa.c

Log Message:
Add patch from PR/11805


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/isa/if_ntwoc_isa.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/isa/if_ntwoc_isa.c
diff -u src/sys/dev/isa/if_ntwoc_isa.c:1.21 src/sys/dev/isa/if_ntwoc_isa.c:1.22
--- src/sys/dev/isa/if_ntwoc_isa.c:1.21	Tue May 12 09:10:15 2009
+++ src/sys/dev/isa/if_ntwoc_isa.c	Fri Nov 27 20:56:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ntwoc_isa.c,v 1.21 2009/05/12 09:10:15 cegger Exp $	*/
+/*	$NetBSD: if_ntwoc_isa.c,v 1.22 2009/11/27 20:56:28 dsl Exp $	*/
 /*
  * Copyright (c) 1999 Christian E. Hopps
  * Copyright (c) 1996 John Hay.
@@ -29,11 +29,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: if_ntwoc_isa.c,v 1.21 2009/05/12 09:10:15 cegger Exp $
+ * $Id: if_ntwoc_isa.c,v 1.22 2009/11/27 20:56:28 dsl Exp $
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ntwoc_isa.c,v 1.21 2009/05/12 09:10:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ntwoc_isa.c,v 1.22 2009/11/27 20:56:28 dsl Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -705,6 +705,9 @@
 	mcr = bus_space_read_1(sc-sc_sca.sc_iot, sc-sc_sca.sc_ioh, NTWOC_MCR);
 	mcr |= (NTWOC_MCR_DTR0 | NTWOC_MCR_DTR1);
 	bus_space_write_1(sc-sc_sca.sc_iot, sc-sc_sca.sc_ioh, NTWOC_MCR, mcr);
+
+	/* turn off the card */
+	bus_space_write_1(sc-sc_sca.sc_iot, sc-sc_sca.sc_ioh, NTWOC_PCR, 0);
 }
 
 static void



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

2009-11-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Nov 27 22:31:29 UTC 2009

Modified Files:
src/sys/arch/sparc64/dev: pci_machdep.c psycho.c schizo.c

Log Message:
clean up some debug messages a little bit.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sparc64/dev/pci_machdep.c
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/sparc64/dev/psycho.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/schizo.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/sparc64/dev/pci_machdep.c
diff -u src/sys/arch/sparc64/dev/pci_machdep.c:1.62 src/sys/arch/sparc64/dev/pci_machdep.c:1.63
--- src/sys/arch/sparc64/dev/pci_machdep.c:1.62	Wed Dec 10 12:53:49 2008
+++ src/sys/arch/sparc64/dev/pci_machdep.c	Fri Nov 27 22:31:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.62 2008/12/10 12:53:49 nakayama Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.63 2009/11/27 22:31:29 mrg Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.62 2008/12/10 12:53:49 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.63 2009/11/27 22:31:29 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -421,9 +421,8 @@
 {
 	static char str[16];
 
-	DPRINTF(SPDB_INTR, (pci_intr_string: ih %u, ih));
 	sprintf(str, ivec %x, ih);
-	DPRINTF(SPDB_INTR, (; returning %s\n, str));
+	DPRINTF(SPDB_INTR, (pci_intr_string: returning %s\n, str));
 
 	return (str);
 }

Index: src/sys/arch/sparc64/dev/psycho.c
diff -u src/sys/arch/sparc64/dev/psycho.c:1.95 src/sys/arch/sparc64/dev/psycho.c:1.96
--- src/sys/arch/sparc64/dev/psycho.c:1.95	Tue Dec 16 22:35:26 2008
+++ src/sys/arch/sparc64/dev/psycho.c	Fri Nov 27 22:31:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: psycho.c,v 1.95 2008/12/16 22:35:26 christos Exp $	*/
+/*	$NetBSD: psycho.c,v 1.96 2009/11/27 22:31:29 mrg Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: psycho.c,v 1.95 2008/12/16 22:35:26 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: psycho.c,v 1.96 2009/11/27 22:31:29 mrg Exp $);
 
 #include opt_ddb.h
 
@@ -1396,7 +1396,7 @@
 	void *cookie;
 	struct psycho_pbm *pp = (struct psycho_pbm *)pc-cookie;
 
-	DPRINTF(PDB_INTR, (pci_intr_establish: ih %lu; level %d, (u_long)ih, level));
+	DPRINTF(PDB_INTR, (%s: ih %lx; level %d, __func__, (u_long)ih, level));
 	cookie = bus_intr_establish(pp-pp_memt, ih, level, func, arg);
 
 	DPRINTF(PDB_INTR, (; returning handle %p\n, cookie));

Index: src/sys/arch/sparc64/dev/schizo.c
diff -u src/sys/arch/sparc64/dev/schizo.c:1.8 src/sys/arch/sparc64/dev/schizo.c:1.9
--- src/sys/arch/sparc64/dev/schizo.c:1.8	Tue Dec 16 22:35:26 2008
+++ src/sys/arch/sparc64/dev/schizo.c	Fri Nov 27 22:31:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: schizo.c,v 1.8 2008/12/16 22:35:26 christos Exp $	*/
+/*	$NetBSD: schizo.c,v 1.9 2009/11/27 22:31:29 mrg Exp $	*/
 /*	$OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $	*/
 
 /*
@@ -776,7 +776,7 @@
 	void *cookie;
 	struct schizo_pbm *pbm = (struct schizo_pbm *)pc-cookie;
 
-	DPRINTF(SDB_INTR, (pci_intr_establish: ih %lu; level %d, (u_long)ih, level));
+	DPRINTF(SDB_INTR, (%s: ih %lx; level %d, __func__, (u_long)ih, level));
 	cookie = bus_intr_establish(pbm-sp_memt, ih, level, func, arg);
 
 	DPRINTF(SDB_INTR, (; returning handle %p\n, cookie));



CVS commit: src/sys/arch/x68k/usr.bin/rtcalarm

2009-11-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Nov 28 02:56:14 UTC 2009

Modified Files:
src/sys/arch/x68k/usr.bin/rtcalarm: rtcalarm.c

Log Message:
Modernize and clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c

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

Modified files:

Index: src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c
diff -u src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c:1.9 src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c:1.10
--- src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c:1.9	Sat Mar 14 21:04:17 2009
+++ src/sys/arch/x68k/usr.bin/rtcalarm/rtcalarm.c	Sat Nov 28 02:56:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtcalarm.c,v 1.9 2009/03/14 21:04:17 dsl Exp $	*/
+/*	$NetBSD: rtcalarm.c,v 1.10 2009/11/28 02:56:14 isaki Exp $	*/
 /*
  * Copyright (c) 1995 MINOURA Makoto.
  * All rights reserved.
@@ -44,24 +44,19 @@
 #include sys/ioctl.h
 #include machine/powioctl.h
 
-char   *prog;
-
 static void usage(void) __attribute__((__noreturn__));
-static void myperror(const char *, int) __attribute__((__noreturn__));
-
 static void showinfo(void);
-static char*numstr(unsigned int);
+static char *numstr(unsigned int);
 static void showontime(unsigned int);
-
 static void disablealarm(void);
-
 static void setinfo(int, char **);
 static int strnum(const char *, int);
 
+static char *devicefile = /dev/pow0;	/* default path */
+
 int
 main(int argc, char *argv[])
 {
-	prog = argv[0];
 
 	if (argc == 1)
 		showinfo();
@@ -76,37 +71,26 @@
 static void
 usage(void)
 {
-	fprintf(stderr, Usage: %s [[-w day-of-the-week] [-d day-of-the-month]\n, prog);
-	fprintf(stderr, [-m minites] [-s seconds] [-c channel] HH:MM]\n);
+	fprintf(stderr,
+		Usage: %s [[-w day-of-the-week] [-d day-of-the-month]\n 
+		[-m minites] [-s seconds] [-c channel] HH:MM]\n,
+		getprogname());
 
 	exit(1);
 }
 
 static void
-myperror(const char *str, int fd)
-{
-	fprintf(stderr, %s: %s: %s\n, prog, str, strerror(errno));
-
-	if (fd = 0)
-		close(fd);
-
-	exit(1);
-}
-
-
-
-static void
 showinfo(void)
 {
 	struct x68k_alarminfo alarminfo;
 	int fd;
 
-	fd = open(/dev/pow0, O_RDONLY);
+	fd = open(devicefile, O_RDONLY);
 	if (fd  0)
-		myperror(Opening /dev/pow0, -1);
+		err(Opening %s, devicefile);
 
 	if (ioctl(fd, POWIOCGALARMINFO, alarminfo)  0)
-		myperror(powiocgalarminfo, fd);
+		err(POWIOCGALARMINFO);
 	close(fd);
 
 	if (alarminfo.al_enable) {
@@ -119,6 +103,7 @@
 			printf(TV mode.\n);
 		else
 			printf(Computer mode. ADDR=%8.8x\n, alarminfo.al_dowhat);
+
 		if (alarminfo.al_offtime == 0)
 			printf(Never shut down automatically.\n);
 		else
@@ -130,7 +115,7 @@
 	}
 }
 
-static char*
+static char *
 numstr(unsigned int num)
 {
 	static char buffer[4];
@@ -150,8 +135,7 @@
 	return buffer;
 }
 
-const char *weekname[] =
-{
+const char * const weekname[] = {
 	Sunday,
 	Monday,
 	Tuesday,
@@ -164,6 +148,7 @@
 static void
 showontime(unsigned int ontime)
 {
+
 	printf(At %s:, numstr((ontime  0xff00)  8));
 	printf(%s , numstr(ontime  0x00ff));
 
@@ -176,15 +161,15 @@
 			else
 printf(on every %s, \n,
  weekname[(ontime  0x0f00)  24]);
-		} else
+		} else {
 			printf(on %sth in every month, \n,
 			   numstr((ontime  0x00ff)  16));
-	} else
+		}
+	} else {
 		printf(everyday.\n);
+	}
 }
 
-
-
 static void
 disablealarm(void)
 {
@@ -193,16 +178,14 @@
 
 	alarminfo.al_enable = 0;
 
-	fd = open(/dev/pow0, O_WRONLY);
+	fd = open(devicefile, O_WRONLY);
 	if (fd  0)
-		myperror(Opening /dev/pow0, -1);
+		err(Opening %s, devicefile);
 	if (ioctl(fd, POWIOCSALARMINFO, alarminfo)  0)
-		myperror(powiocsalarminfo, fd);
+		err(POWIOCSALARMINFO);
 	close(fd);
 }
 
-
-
 static void
 setinfo(int argc, char **argv)
 {
@@ -212,12 +195,10 @@
 	int day = 0xff;
 	int offtime = 0;
 	int dowhat = 0;
-	extern char*optarg;
-	extern int  optind;
 	int fd;
 	struct x68k_alarminfo alarminfo;
 
-	while ((ch = getopt(argc, argv, w:d:m:s:c:)) != -1)
+	while ((ch = getopt(argc, argv, w:d:m:s:c:)) != -1) {
 		switch (ch) {
 		case 'w':	/* day of the week */
 			if ((week = strnum(optarg, 1))  0)
@@ -239,6 +220,7 @@
 usage();
 			break;
 		}
+	}
 	if (optind != argc - 1)
 		usage();
 
@@ -256,11 +238,11 @@
 	alarminfo.al_dowhat = dowhat;
 	alarminfo.al_offtime = offtime * 60;
 
-	fd = open(/dev/pow0, O_WRONLY);
+	fd = open(devicefile, O_WRONLY);
 	if (fd  0)
-		myperror(Opening /dev/pow0, -1);
+		err(Opening %s, devicefile);
 	if (ioctl(fd, POWIOCSALARMINFO, alarminfo)  0)
-		myperror(powiocsalarminfo, fd);
+		err(POWIOCSALARMINFO);
 	close(fd);
 }
 



CVS commit: src/sys/net

2009-11-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Nov 28 02:58:22 UTC 2009

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

Log Message:
white space - tab.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/net/if_ethersubr.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/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.173 src/sys/net/if_ethersubr.c:1.174
--- src/sys/net/if_ethersubr.c:1.173	Fri Nov 20 02:14:56 2009
+++ src/sys/net/if_ethersubr.c	Sat Nov 28 02:58:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.173 2009/11/20 02:14:56 christos Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.174 2009/11/28 02:58:21 isaki Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ethersubr.c,v 1.173 2009/11/20 02:14:56 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ethersubr.c,v 1.174 2009/11/28 02:58:21 isaki Exp $);
 
 #include opt_inet.h
 #include opt_atalk.h
@@ -283,7 +283,7 @@
 #ifdef INET
 	case AF_INET:
 		if (m-m_flags  M_BCAST)
-	(void)memcpy(edst, etherbroadcastaddr, sizeof(edst));
+			(void)memcpy(edst, etherbroadcastaddr, sizeof(edst));
 		else if (m-m_flags  M_MCAST)
 			ETHER_MAP_IP_MULTICAST(satocsin(dst)-sin_addr, edst);
 		else if (!arpresolve(ifp, rt, m, dst, edst))
@@ -297,7 +297,7 @@
 	case AF_ARP:
 		ah = mtod(m, struct arphdr *);
 		if (m-m_flags  M_BCAST)
-	(void)memcpy(edst, etherbroadcastaddr, sizeof(edst));
+			(void)memcpy(edst, etherbroadcastaddr, sizeof(edst));
 		else {
 			void *tha = ar_tha(ah);
 
@@ -898,14 +898,14 @@
 			break;
 #endif
 #ifdef NETATALK
-	case ETHERTYPE_ATALK:
-	schednetisr(NETISR_ATALK);
-	inq = atintrq1;
-	break;
-	case ETHERTYPE_AARP:
+		case ETHERTYPE_ATALK:
+			schednetisr(NETISR_ATALK);
+			inq = atintrq1;
+			break;
+		case ETHERTYPE_AARP:
 			/* probably this should be done with a NETISR as well */
-	aarpinput(ifp, m); /* XXX */
-	return;
+			arpinput(ifp, m); /* XXX */
+			return;
 #endif /* NETATALK */
 		default:
 			m_freem(m);



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

2009-11-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Nov 28 03:10:09 UTC 2009

Modified Files:
src/sys/arch/x68k/dev: if_ne_intio.c if_ne_neptune.c

Log Message:
Correct return value of ne_*_match().
It's attach priority, not ne2000 model.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/dev/if_ne_intio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x68k/dev/if_ne_neptune.c

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

Modified files:

Index: src/sys/arch/x68k/dev/if_ne_intio.c
diff -u src/sys/arch/x68k/dev/if_ne_intio.c:1.13 src/sys/arch/x68k/dev/if_ne_intio.c:1.14
--- src/sys/arch/x68k/dev/if_ne_intio.c:1.13	Sun Jan 18 04:48:53 2009
+++ src/sys/arch/x68k/dev/if_ne_intio.c	Sat Nov 28 03:10:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_intio.c,v 1.13 2009/01/18 04:48:53 isaki Exp $	*/
+/*	$NetBSD: if_ne_intio.c,v 1.14 2009/11/28 03:10:09 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ne_intio.c,v 1.13 2009/01/18 04:48:53 isaki Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ne_intio.c,v 1.14 2009/11/28 03:10:09 isaki Exp $);
 
 #include opt_inet.h
 #include opt_ns.h
@@ -136,7 +136,7 @@
 
  out:
 	bus_space_unmap(iot, ioh, NE2000_NPORTS);
-	return rv;
+	return (rv != 0) ? 1 : 0;
 }
 
 static void

Index: src/sys/arch/x68k/dev/if_ne_neptune.c
diff -u src/sys/arch/x68k/dev/if_ne_neptune.c:1.17 src/sys/arch/x68k/dev/if_ne_neptune.c:1.18
--- src/sys/arch/x68k/dev/if_ne_neptune.c:1.17	Sun Jan 18 04:48:53 2009
+++ src/sys/arch/x68k/dev/if_ne_neptune.c	Sat Nov 28 03:10:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_neptune.c,v 1.17 2009/01/18 04:48:53 isaki Exp $	*/
+/*	$NetBSD: if_ne_neptune.c,v 1.18 2009/11/28 03:10:09 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ne_neptune.c,v 1.17 2009/01/18 04:48:53 isaki Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ne_neptune.c,v 1.18 2009/11/28 03:10:09 isaki Exp $);
 
 #include opt_inet.h
 #include opt_ns.h
@@ -122,7 +122,7 @@
 
  out:
 	bus_space_unmap(nict, nich, NE2000_NPORTS);
-	return (rv);
+	return (rv != 0) ? 1 : 0;
 }
 
 void



CVS commit: src/usr.bin/comm

2009-11-27 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Sat Nov 28 03:56:38 UTC 2009

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

Log Message:
Don't include newlines when comparing to prevent errors when lines have
characters that sort lower such as tabs.

This is a temporary fix to allow pullups to existing, supported versions
of NetBSD.  I will follow up with a version for current using the new
getline function.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/comm/comm.c

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

Modified files:

Index: src/usr.bin/comm/comm.c
diff -u src/usr.bin/comm/comm.c:1.17 src/usr.bin/comm/comm.c:1.18
--- src/usr.bin/comm/comm.c:1.17	Sat Apr 11 12:18:45 2009
+++ src/usr.bin/comm/comm.c	Sat Nov 28 03:56:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: comm.c,v 1.17 2009/04/11 12:18:45 lukem Exp $	*/
+/*	$NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)comm.c	8.4 (Berkeley) 5/4/95;
 #endif
-__RCSID($NetBSD: comm.c,v 1.17 2009/04/11 12:18:45 lukem Exp $);
+__RCSID($NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -60,6 +60,7 @@
 FILE   *file(const char *);
 void	show(FILE *, const char *, char *);
 void	usage(void);
+char   *getnextln(char *buf, FILE *);
 
 int
 main(int argc, char **argv)
@@ -116,9 +117,9 @@
 	for (read1 = read2 = 1;;) {
 		/* read next line, check for EOF */
 		if (read1)
-			file1done = !fgets(line1, MAXLINELEN, fp1);
+			file1done = !getnextln(line1, fp1);
 		if (read2)
-			file2done = !fgets(line2, MAXLINELEN, fp2);
+			file2done = !getnextln(line2, fp2);
 
 		/* if one file done, display the rest of the other file */
 		if (file1done) {
@@ -136,7 +137,7 @@
 		if (!(comp = compare(line1, line2))) {
 			read1 = read2 = 1;
 			if (col3)
-if (printf(%s%s, col3, line1)  0)
+if (printf(%s%s\n, col3, line1)  0)
 	break;
 			continue;
 		}
@@ -146,13 +147,13 @@
 			read1 = 1;
 			read2 = 0;
 			if (col1)
-if (printf(%s%s, col1, line1)  0)
+if (printf(%s%s\n, col1, line1)  0)
 	break;
 		} else {
 			read1 = 0;
 			read2 = 1;
 			if (col2)
-if (printf(%s%s, col2, line2)  0)
+if (printf(%s%s\n, col2, line2)  0)
 	break;
 		}
 	}
@@ -166,7 +167,7 @@
 void
 show(FILE *fp, const char *offset, char *buf)
 {
-	while (printf(%s%s, offset, buf) = 0  fgets(buf, MAXLINELEN, fp))
+	while (printf(%s%s\n, offset, buf) = 0  getnextln(buf, fp))
 		;
 }
 
@@ -189,3 +190,24 @@
 	(void)fprintf(stderr, usage: comm [-123f] file1 file2\n);
 	exit(1);
 }
+
+char *
+getnextln(char *buf, FILE *fp)
+{
+	size_t i = 0;
+	int c;
+
+	while ((c = fgetc(fp)) != '\n'  c != EOF) {
+		buf[i++] = c;
+
+		if (i = MAXLINELEN)
+			i--; /* consumes extra characters till newline */
+	}
+
+	if (c == EOF  !i)
+		return NULL;
+
+	buf[i] = 0;
+	return buf;
+}
+



CVS commit: src

2009-11-27 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Nov 28 04:14:27 UTC 2009

Modified Files:
src/share/man/man4/man4.sparc64: lom.4
src/sys/arch/sparc64/dev: lom.c

Log Message:
Add support for monitoring Fault LED and Alarms status.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.sparc64/lom.4
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/dev/lom.c

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/man4.sparc64/lom.4
diff -u src/share/man/man4/man4.sparc64/lom.4:1.2 src/share/man/man4/man4.sparc64/lom.4:1.3
--- src/share/man/man4/man4.sparc64/lom.4:1.2	Fri Oct  2 17:48:39 2009
+++ src/share/man/man4/man4.sparc64/lom.4	Sat Nov 28 04:14:27 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: lom.4,v 1.2 2009/10/02 17:48:39 wiz Exp $
+.\ $NetBSD: lom.4,v 1.3 2009/11/28 04:14:27 nakayama Exp $
 .\ $OpenBSD: lom.4,v 1.4 2009/09/23 22:08:07 kettenis Exp $
 .\
 .\ Copyright (c) 2009 Mark Kettenis kette...@openbsd.org
@@ -15,7 +15,7 @@
 .\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
-.Dd October 2, 2009
+.Dd November 28, 2009
 .Dt LOM 4 sparc64
 .Os
 .Sh NAME
@@ -29,8 +29,8 @@
 driver provides support for the LOMlite lights out management module
 found on Sun Netra t1 systems and the LOMlite2 module found on Sun
 Fire V100/V120 and Sun Netra T1/X1 systems.
-Temperature readings, PSU status and fan status provided by the LOM
-are made available through the
+Fault LED and alarms status, temperature readings, PSU status and
+fan status provided by the LOM are made available through the
 .Xr envstat 8
 interface.
 The integrated watchdog timer can be configured through the

Index: src/sys/arch/sparc64/dev/lom.c
diff -u src/sys/arch/sparc64/dev/lom.c:1.2 src/sys/arch/sparc64/dev/lom.c:1.3
--- src/sys/arch/sparc64/dev/lom.c:1.2	Mon Nov 16 13:11:51 2009
+++ src/sys/arch/sparc64/dev/lom.c	Sat Nov 28 04:14:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lom.c,v 1.2 2009/11/16 13:11:51 nakayama Exp $	*/
+/*	$NetBSD: lom.c,v 1.3 2009/11/28 04:14:27 nakayama Exp $	*/
 /*	$OpenBSD: lom.c,v 1.19 2009/11/10 22:26:48 kettenis Exp $	*/
 /*
  * Copyright (c) 2009 Mark Kettenis
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lom.c,v 1.2 2009/11/16 13:11:51 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: lom.c,v 1.3 2009/11/28 04:14:27 nakayama Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -83,6 +83,10 @@
 #define LOM_IDX_LED1		0x25
 
 #define LOM_IDX_ALARM		0x30
+#define  LOM_ALARM_1		0x01
+#define  LOM_ALARM_2		0x02
+#define  LOM_ALARM_3		0x04
+#define  LOM_ALARM_FAULT	0xf0
 #define LOM_IDX_WDOG_CTL	0x31
 #define  LOM_WDOG_ENABLE	0x01
 #define  LOM_WDOG_RESET		0x02
@@ -131,6 +135,7 @@
 #define LOM_IDX5_FAN_NAME_START		0x40
 #define LOM_IDX5_FAN_NAME_END		0xff
 
+#define LOM_MAX_ALARM	4
 #define LOM_MAX_FAN	4
 #define LOM_MAX_PSU	3
 #define LOM_MAX_TEMP	8
@@ -153,10 +158,12 @@
 	int			sc_space;
 
 	struct sysmon_envsys	*sc_sme;
+	envsys_data_t		sc_alarm[LOM_MAX_ALARM];
 	envsys_data_t		sc_fan[LOM_MAX_FAN];
 	envsys_data_t		sc_psu[LOM_MAX_PSU];
 	envsys_data_t		sc_temp[LOM_MAX_TEMP];
 
+	int			sc_num_alarm;
 	int			sc_num_fan;
 	int			sc_num_psu;
 	int			sc_num_temp;
@@ -290,6 +297,7 @@
 		IPL_BIO, lom2_intr, sc);
 	}
 
+	sc-sc_num_alarm = LOM_MAX_ALARM;
 	sc-sc_num_fan = min((config  5)  0x7, LOM_MAX_FAN);
 	sc-sc_num_psu = min((config  3)  0x3, LOM_MAX_PSU);
 	sc-sc_num_temp = min((config2  4)  0xf, LOM_MAX_TEMP);
@@ -309,6 +317,16 @@
 
 	/* Initialize sensor data. */
 	sc-sc_sme = sysmon_envsys_create();
+	for (i = 0; i  sc-sc_num_alarm; i++) {
+		sc-sc_alarm[i].units = ENVSYS_INDICATOR;
+		snprintf(sc-sc_alarm[i].desc, sizeof(sc-sc_alarm[i].desc),
+		i == 0 ? Fault LED : Alarm%d, i);
+		if (sysmon_envsys_sensor_attach(sc-sc_sme, sc-sc_alarm[i])) {
+			sysmon_envsys_destroy(sc-sc_sme);
+			aprint_error_dev(self, can't attach alarm sensor\n);
+			return;
+		}
+	}
 	for (i = 0; i  sc-sc_num_fan; i++) {
 		sc-sc_fan[i].units = ENVSYS_SFANRPM;
 		snprintf(sc-sc_fan[i].desc, sizeof(sc-sc_fan[i].desc),
@@ -900,6 +918,27 @@
 	uint8_t val;
 	int i;
 
+	if (lom_read(sc, LOM_IDX_ALARM, val)) {
+		for (i = 0; i  sc-sc_num_alarm; i++)
+			sc-sc_alarm[i].state = ENVSYS_SINVALID;
+	} else {
+		/* Fault LED */
+		if ((val  LOM_ALARM_FAULT) == LOM_ALARM_FAULT)
+			sc-sc_alarm[0].value_cur = 0;
+		else
+			sc-sc_alarm[0].value_cur = 1;
+		sc-sc_alarm[0].state = ENVSYS_SVALID;
+
+		/* Alarms */
+		for (i = 1; i  sc-sc_num_alarm; i++) {
+			if ((val  (LOM_ALARM_1  (i - 1))) == 0)
+sc-sc_alarm[i].value_cur = 0;
+			else
+sc-sc_alarm[i].value_cur = 1;
+			sc-sc_alarm[i].state = ENVSYS_SVALID;
+		}
+	}
+
 	for (i = 0; i  sc-sc_num_fan; i++) {
 		if (lom_read(sc, LOM_IDX_FAN1 + i, val)) {
 			sc-sc_fan[i].state = ENVSYS_SINVALID;