CVS commit: othersrc/external/bsd/iscsi/sys/dev/iscsi

2011-06-11 Thread Jeff Rizzo
Module Name:othersrc
Committed By:   riz
Date:   Sat Jun 11 06:49:25 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sys/dev/iscsi: iscsi_ioctl.c iscsi_main.c
iscsi_rcv.c iscsi_send.c iscsi_text.c iscsi_utils.c

Log Message:
In debugging code: Use %p for pointers, %zu for size_t.  Don't cast
pointers to int.  Makes debug code compile on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c
cvs rdiff -u -r1.3 -r1.4 \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_send.c \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_text.c \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_utils.c

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

Modified files:

Index: othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c
diff -u othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.4 othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.5
--- othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c:1.4	Thu Jun  9 22:08:19 2011
+++ othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_ioctl.c	Sat Jun 11 06:49:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_ioctl.c,v 1.4 2011/06/09 22:08:19 riz Exp $	*/
+/*	$NetBSD: iscsi_ioctl.c,v 1.5 2011/06/11 06:49:24 riz Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -623,8 +623,8 @@
 		par-status = ISCSI_STATUS_INVALID_SOCKET;
 		return rc;
 	}
-	DEBC(connection, 1, (get_socket: par_sock=%d, fdesc=%x\n,
-			par-socket, (int)connection-sock));
+	DEBC(connection, 1, (get_socket: par_sock=%d, fdesc=%p\n,
+			par-socket, connection-sock));
 
 	connection-threadobj = p;
 	connection-login_par = par;
@@ -652,7 +652,7 @@
 		 * thread to wake up
 		 */
 		DEBC(connection, 1,
-			(Closing Socket %x\n, (int)connection-sock));
+			(Closing Socket %p\n, connection-sock));
 #if __NetBSD_Version__  5
 		mutex_enter(connection-sock-f_lock);
 		connection-sock-f_count += 1;
@@ -1196,7 +1196,7 @@
 	void *databuf = par-req.databuf;
 	session_t *session;
 
-	DEB(9, (ISCSI: io_command, SID=%d, lun=%qx\n, par-session_id, par-lun));
+	DEB(9, (ISCSI: io_command, SID=%d, lun=% PRIu64 \n, par-session_id, par-lun));
 	if ((session = find_session(par-session_id)) == NULL) {
 		DEBOUT((Session %d not found\n, par-session_id));
 		par-status = ISCSI_STATUS_INVALID_SESSION_ID;
@@ -1274,8 +1274,8 @@
 		return;
 	}
 
-	DEB(9, (ISCSI: send_targets, rsp_size=%d; Saved list: %x\n,
-			par-response_size, (int) session-target_list));
+	DEB(9, (ISCSI: send_targets, rsp_size=%d; Saved list: %p\n,
+			par-response_size, session-target_list));
 
 	if (session-target_list == NULL) {
 		rc = send_send_targets(session, par-key);
Index: othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c
diff -u othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.4 othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.5
--- othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.4	Thu Jun  9 22:08:19 2011
+++ othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c	Sat Jun 11 06:49:24 2011
@@ -143,8 +143,8 @@
 iscsiattach(device_t parent, device_t self, void *aux)
 {
 
-	DEBOUT((ISCSI: iscsiattach, parent=%x, self=%x, aux=%x\n, (int)parent,
-			(int) self, (int) aux));
+	DEBOUT((ISCSI: iscsi_attach, parent=%p, self=%p, aux=%p\n, parent,
+			self, aux));
 	sc = (iscsi_softc_t *) device_private(self);
 	sc-sc_dev = self;
 	if (kthread_create(PRI_NONE, 0, NULL, iscsi_cleanup_thread,
@@ -433,7 +433,7 @@
 			break;
 		}
 
-		DEB(99, (Calling scsipi_done (%x), err = %d\n, (int) xs, xs-error));
+		DEB(99, (Calling scsipi_done (%p), err = %d\n, xs, xs-error));
 		scsipi_done(xs);
 		DEB(99, (scsipi_done returned\n));
 	}

Index: othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c
diff -u othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c:1.2 othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c:1.3
--- othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c:1.2	Thu Jun  9 22:08:19 2011
+++ othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_rcv.c	Sat Jun 11 06:49:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_rcv.c,v 1.2 2011/06/09 22:08:19 riz Exp $	*/
+/*	$NetBSD: iscsi_rcv.c,v 1.3 2011/06/11 06:49:24 riz Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -57,12 +57,12 @@
 	size_t resid = u-uio_resid;
 #endif
 
-	DEBC(conn, 99, (soo_read req: %d\n, resid));
+	DEBC(conn, 99, (soo_read req: %zu\n, resid));
 
 	ret = soreceive(so, NULL, u, NULL, NULL, flags);
 
 	if (ret || (flags != MSG_DONTWAIT  u-uio_resid)) {
-		DEBC(conn, 1, (Read failed (ret: %d, req: %d, out: %d)\n, ret, resid,
+		DEBC(conn, 1, (Read failed (ret: %d, req: %zu, out: %zu)\n, ret, resid,
 u-uio_resid));
 		handle_connection_error(conn, ISCSI_STATUS_SOCKET_ERROR,
 		

CVS commit: othersrc/external/bsd/iscsi/sys/dev/iscsi

2011-06-11 Thread Jeff Rizzo
Module Name:othersrc
Committed By:   riz
Date:   Sat Jun 11 06:51:58 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sys/dev/iscsi: iscsi_main.c

Log Message:
Add iscsiattach(int), to be called when configured statically into a kernel.
Rename old iscsiattach-iscsi_attach, also iscsi_match and iscsi_detach,
and adjust their invocation.

iscsi now works when configured statically into a kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c

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

Modified files:

Index: othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c
diff -u othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.5 othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.6
--- othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c:1.5	Sat Jun 11 06:49:24 2011
+++ othersrc/external/bsd/iscsi/sys/dev/iscsi/iscsi_main.c	Sat Jun 11 06:51:58 2011
@@ -32,11 +32,14 @@
 
 #include sys/systm.h
 #include sys/buf.h
+#include sys/kmem.h
 #include sys/socketvar.h
 
 
 /*- Global Variables */
 
+extern struct cfdriver iscsi_cd;
+
 #if defined(ISCSI_DEBUG)
 int debug_level = ISCSI_DEBUG;
 #endif
@@ -70,13 +73,14 @@
System interface: autoconf and device structures
 */
 
-void iscsiattach(device_t parent, device_t self, void *aux);
-int iscsimatch(device_t, cfdata_t, void *);
-int iscsidetatch(device_t, int);
+void iscsiattach(int);
+void iscsi_attach(device_t parent, device_t self, void *aux);
+int iscsi_match(device_t, cfdata_t, void *);
+int iscsi_detach(device_t, int);
 
 
-CFATTACH_DECL_NEW(iscsi, sizeof(struct iscsi_softc), iscsimatch, iscsiattach,
-			  iscsidetach, NULL);
+CFATTACH_DECL_NEW(iscsi, sizeof(struct iscsi_softc), iscsi_match, iscsi_attach,
+			  iscsi_detach, NULL);
 
 
 int iscsiopen(dev_t, int, int, PTHREADOBJ);
@@ -128,19 +132,54 @@
  */
 
 int
-iscsimatch(device_t self, cfdata_t cfdata, void *arg)
+iscsi_match(device_t self, cfdata_t cfdata, void *arg)
 {
 	return 1;
 }
 
-
 /*
  * iscsiattach:
- *One-time inits go here. Not much for now, probably even less later.
+ *Only called when statically configured into a kernel
  */
+void
+iscsiattach(int n)
+{
+	int err;
+	cfdata_t cf;
+
+	err = config_cfattach_attach(iscsi_cd.cd_name, iscsi_ca);
+	if (err) {
+		aprint_error(%s: couldn't register cfattach: %d\n,
+		iscsi_cd.cd_name, err);
+		config_cfdriver_detach(iscsi_cd);
+		return;
+	}
 
+	if (n  1)
+		aprint_error(%s: only one device supported\n,
+		iscsi_cd.cd_name);
+
+	cf = kmem_alloc(sizeof(struct cfdata), KM_NOSLEEP);
+	if (cf == NULL) {
+		aprint_error(%s: couldn't allocate cfdata\n,
+		iscsi_cd.cd_name);
+		return;
+	}
+	cf-cf_name = iscsi_cd.cd_name;
+	cf-cf_atname = iscsi_cd.cd_name;
+	cf-cf_unit = 0;
+	cf-cf_fstate = FSTATE_NOTFOUND;
+
+	(void)config_attach_pseudo(cf);
+	return;
+}
+
+/*
+ * iscsi_attach:
+ *One-time inits go here. Not much for now, probably even less later.
+ */
 void
-iscsiattach(device_t parent, device_t self, void *aux)
+iscsi_attach(device_t parent, device_t self, void *aux)
 {
 
 	DEBOUT((ISCSI: iscsi_attach, parent=%p, self=%p, aux=%p\n, parent,
@@ -151,6 +190,8 @@
 	NULL, cleanproc, Cleanup) != 0) {
 		panic(Can't create cleanup thread!);
 	}
+	aprint_normal(%s: attached.  major = %d\n, iscsi_cd.cd_name,
+	cdevsw_lookup_major(iscsi_cdevsw));
 }
 
 /*
@@ -158,7 +199,7 @@
  *Cleanup.
  */
 int
-iscsidetach(device_t self, int flags)
+iscsi_detach(device_t self, int flags)
 {
 
 	DEBOUT((ISCSI: detach\n));



CVS commit: src/distrib/utils/sysinst/arch

2011-06-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 11 11:43:23 UTC 2011

Modified Files:
src/distrib/utils/sysinst/arch/hpcarm: md.c
src/distrib/utils/sysinst/arch/zaurus: md.c

Log Message:
MBR magic exists at the beginning of 'a' partition, BPB is cleared.
Avoid to detect msdosfs incorrectly at boot time.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/sysinst/arch/zaurus/md.c

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

Modified files:

Index: src/distrib/utils/sysinst/arch/hpcarm/md.c
diff -u src/distrib/utils/sysinst/arch/hpcarm/md.c:1.10 src/distrib/utils/sysinst/arch/hpcarm/md.c:1.11
--- src/distrib/utils/sysinst/arch/hpcarm/md.c:1.10	Mon Apr  4 08:30:29 2011
+++ src/distrib/utils/sysinst/arch/hpcarm/md.c	Sat Jun 11 11:43:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.10 2011/04/04 08:30:29 mbalmer Exp $ */
+/*	$NetBSD: md.c,v 1.11 2011/06/11 11:43:23 nonaka Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -148,6 +148,38 @@
 int
 md_post_newfs(void)
 {
+	struct mbr_sector pbr;
+	char adevname[STRSIZE];
+	ssize_t sz;
+	int fd = -1;
+
+	snprintf(adevname, sizeof(adevname), /dev/r%sa, diskdev);
+	fd = open(adevname, O_RDWR);
+	if (fd  0)
+		goto out;
+
+	/* Read partition boot record */
+	sz = pread(fd, pbr, sizeof(pbr), 0);
+	if (sz != sizeof(pbr))
+		goto out;
+
+	/* Check magic number */
+	if (pbr.mbr_magic != le16toh(MBR_MAGIC))
+		goto out;
+
+#define	OSNAME	NetBSD60
+	/* Update oemname */
+	memcpy(pbr.mbr_oemname, OSNAME, sizeof(OSNAME) - 1);
+
+	/* Clear BPB */
+	memset(pbr.mbr_bpb, 0, sizeof(pbr.mbr_bpb));
+
+	/* write-backed new patition boot record */
+	(void)pwrite(fd, pbr, sizeof(pbr), 0);
+
+out:
+	if (fd = 0)
+		close(fd);
 	return 0;
 }
 

Index: src/distrib/utils/sysinst/arch/zaurus/md.c
diff -u src/distrib/utils/sysinst/arch/zaurus/md.c:1.7 src/distrib/utils/sysinst/arch/zaurus/md.c:1.8
--- src/distrib/utils/sysinst/arch/zaurus/md.c:1.7	Mon Apr  4 08:30:46 2011
+++ src/distrib/utils/sysinst/arch/zaurus/md.c	Sat Jun 11 11:43:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7 2011/04/04 08:30:46 mbalmer Exp $	*/
+/*	$NetBSD: md.c,v 1.8 2011/06/11 11:43:23 nonaka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -111,6 +111,38 @@
 int
 md_post_newfs(void)
 {
+	struct mbr_sector pbr;
+	char adevname[STRSIZE];
+	ssize_t sz;
+	int fd = -1;
+
+	snprintf(adevname, sizeof(adevname), /dev/r%sa, diskdev);
+	fd = open(adevname, O_RDWR);
+	if (fd  0)
+		goto out;
+
+	/* Read partition boot record */
+	sz = pread(fd, pbr, sizeof(pbr), 0);
+	if (sz != sizeof(pbr))
+		goto out;
+
+	/* Check magic number */
+	if (pbr.mbr_magic != le16toh(MBR_MAGIC))
+		goto out;
+
+#define	OSNAME	NetBSD60
+	/* Update oemname */
+	memcpy(pbr.mbr_oemname, OSNAME, sizeof(OSNAME) - 1);
+
+	/* Clear BPB */
+	memset(pbr.mbr_bpb, 0, sizeof(pbr.mbr_bpb));
+
+	/* write-backed new patition boot record */
+	(void)pwrite(fd, pbr, sizeof(pbr), 0);
+
+out:
+	if (fd = 0)
+		close(fd);
 	return 0;
 }
 



CVS commit: src/sys/dev/usb

2011-06-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 11 13:50:06 UTC 2011

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

Log Message:
Added LCD-8000UD-DVI entry.


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

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.580 src/sys/dev/usb/usbdevs:1.581
--- src/sys/dev/usb/usbdevs:1.580	Wed Jun  1 13:57:55 2011
+++ src/sys/dev/usb/usbdevs	Sat Jun 11 13:50:06 2011
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.580 2011/06/01 13:57:55 njoly Exp $
+$NetBSD: usbdevs,v 1.581 2011/06/11 13:50:06 nonaka Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1126,6 +1126,7 @@
 product DISPLAYLINK HPDOCK	0x01d4	HP USB Docking
 product DISPLAYLINK M01061	0x01e2	Lenovo DVI
 product DISPLAYLINK SWDVI	0x024c	SUNWEIT DVI
+product DISPLAYLINK LCD8000UD_DVI	0x02b8	LCD-8000UD-DVI
 product DISPLAYLINK LDEWX015U	0x02e3	Logitec LDE-WX015U
 product DISPLAYLINK UM7X0	0x401a	nanovision MiMo
 



CVS commit: src/sys/dev/usb

2011-06-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 11 13:51:45 UTC 2011

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

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.573 -r1.574 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.574 -r1.575 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.573 src/sys/dev/usb/usbdevs.h:1.574
--- src/sys/dev/usb/usbdevs.h:1.573	Wed Jun  1 13:58:51 2011
+++ src/sys/dev/usb/usbdevs.h	Sat Jun 11 13:51:45 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.573 2011/06/01 13:58:51 njoly Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.574 2011/06/11 13:51:45 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.579 2011/03/10 00:11:59 scw Exp
+ *	NetBSD: usbdevs,v 1.581 2011/06/11 13:50:06 nonaka Exp
  */
 
 /*
@@ -1133,6 +1133,7 @@
 #define	USB_PRODUCT_DISPLAYLINK_HPDOCK	0x01d4		/* HP USB Docking */
 #define	USB_PRODUCT_DISPLAYLINK_M01061	0x01e2		/* Lenovo DVI */
 #define	USB_PRODUCT_DISPLAYLINK_SWDVI	0x024c		/* SUNWEIT DVI */
+#define	USB_PRODUCT_DISPLAYLINK_LCD8000UD_DVI	0x02b8		/* LCD-8000UD-DVI */
 #define	USB_PRODUCT_DISPLAYLINK_LDEWX015U	0x02e3		/* Logitec LDE-WX015U */
 #define	USB_PRODUCT_DISPLAYLINK_UM7X0	0x401a		/* nanovision MiMo */
 

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.574 src/sys/dev/usb/usbdevs_data.h:1.575
--- src/sys/dev/usb/usbdevs_data.h:1.574	Wed Jun  1 13:58:51 2011
+++ src/sys/dev/usb/usbdevs_data.h	Sat Jun 11 13:51:45 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.574 2011/06/01 13:58:51 njoly Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.575 2011/06/11 13:51:45 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.579 2011/03/10 00:11:59 scw Exp
+ *	NetBSD: usbdevs,v 1.581 2011/06/11 13:50:06 nonaka Exp
  */
 
 /*
@@ -3567,6 +3567,10 @@
 	SUNWEIT DVI,
 	},
 	{
+	USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LCD8000UD_DVI,
+	LCD-8000UD-DVI,
+	},
+	{
 	USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LDEWX015U,
 	Logitec LDE-WX015U,
 	},
@@ -8419,4 +8423,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1602;
+const int usb_nproducts = 1603;



CVS commit: src/sys/dev/usb

2011-06-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 11 13:52:46 UTC 2011

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

Log Message:
Added LCD-8000UD-DVI entry.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/udl.c

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

Modified files:

Index: src/sys/dev/usb/udl.c
diff -u src/sys/dev/usb/udl.c:1.3 src/sys/dev/usb/udl.c:1.4
--- src/sys/dev/usb/udl.c:1.3	Sun Apr 11 13:57:22 2010
+++ src/sys/dev/usb/udl.c	Sat Jun 11 13:52:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: udl.c,v 1.3 2010/04/11 13:57:22 drochner Exp $	*/
+/*	$NetBSD: udl.c,v 1.4 2011/06/11 13:52:46 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2009 FUKAUMI Naoki.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: udl.c,v 1.3 2010/04/11 13:57:22 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: udl.c,v 1.4 2011/06/11 13:52:46 nonaka Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -314,6 +314,7 @@
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_HPDOCK },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_M01061 },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_SWDVI },
+	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LCD8000UD_DVI },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LDEWX015U },
 	{ USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_UM7X0 }
 };



CVS commit: src/bin/sh

2011-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 14:37:36 UTC 2011

Modified Files:
src/bin/sh: sh.1

Log Message:
document OLDPWD and cd -


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.99 src/bin/sh/sh.1:1.100
--- src/bin/sh/sh.1:1.99	Wed Jun  2 22:05:02 2010
+++ src/bin/sh/sh.1	Sat Jun 11 10:37:36 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: sh.1,v 1.99 2010/06/03 02:05:02 dholland Exp $
+.\	$NetBSD: sh.1,v 1.100 2011/06/11 14:37:36 christos Exp $
 .\ Copyright (c) 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
 .\
@@ -31,7 +31,7 @@
 .\
 .\	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\
-.Dd June 2, 2010
+.Dd June 11, 2011
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1234,6 +1234,13 @@
 .Ar directory
 in the current directory name with
 .Ar replace .
+If
+.Ar directory
+is
+.Sq - ,
+then she current working directory is changed to the previous current
+working directory as set in
+.Ev OLDPWD .
 Otherwise if an entry for
 .Ev CDPATH
 appears in the environment of the
@@ -1254,14 +1261,18 @@
 .Fl P
 option instructs the shell to update
 .Ev PWD
-with the specified directory and change to that directory.
+with the specified physical directory path and change to that directory.
 This is the default.
 .Pp
+When the directory changes, the variable
+.Ev OLDPWD
+is set to the working directory before the change.
+.Pp
 Some shells also support a
 .Fl L
 option, which instructs the shell to update
 .Ev PWD
-with incorrect information and to change the current directory
+with the logical path and to change the current directory
 accordingly.
 This is not supported.
 .Pp
@@ -1479,7 +1490,7 @@
 	\e?)	echo $USAGE; exit 1;;
 	esac
 done
-shift `expr $OPTIND - 1`
+shift $(expr $OPTIND - 1)
 .Ed
 .Pp
 This code will accept any of the following as equivalent:
@@ -1671,7 +1682,8 @@
 may be null, which cause the specified signals to be ignored.
 With
 .Ar action
-omitted or set to `-' the specified signals are set to their default action.
+omitted or set to 
+.Sq - the specified signals are set to their default action.
 When the shell forks off a subshell, it resets trapped (but not ignored)
 signals to the default action.
 On non-interactive shells, the



CVS commit: src/sys/dev/hpc

2011-06-11 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun 11 16:34:36 UTC 2011

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

Log Message:
split device_t/softc.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/hpc/hpckbd.c

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

Modified files:

Index: src/sys/dev/hpc/hpckbd.c
diff -u src/sys/dev/hpc/hpckbd.c:1.28 src/sys/dev/hpc/hpckbd.c:1.29
--- src/sys/dev/hpc/hpckbd.c:1.28	Tue May 12 14:22:39 2009
+++ src/sys/dev/hpc/hpckbd.c	Sat Jun 11 16:34:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpckbd.c,v 1.28 2009/05/12 14:22:39 cegger Exp $ */
+/*	$NetBSD: hpckbd.c,v 1.29 2011/06/11 16:34:36 nonaka Exp $ */
 
 /*-
  * Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hpckbd.c,v 1.28 2009/05/12 14:22:39 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: hpckbd.c,v 1.29 2011/06/11 16:34:36 nonaka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,7 +87,7 @@
 };
 
 struct hpckbd_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 	struct hpckbd_core	*sc_core;
 	struct hpckbd_core	sc_coredata;
 };
@@ -104,7 +104,7 @@
 int	__hpckbd_input(void *, int, int);
 void	__hpckbd_input_hook(void *);
 
-CFATTACH_DECL(hpckbd, sizeof(struct hpckbd_softc),
+CFATTACH_DECL_NEW(hpckbd, sizeof(struct hpckbd_softc),
 hpckbd_match, hpckbd_attach, NULL, NULL);
 
 /* wskbd accessopts */
@@ -139,8 +139,7 @@
 };
 
 int
-hpckbd_match(device_t parent,
-	 cfdata_t cf, void *aux)
+hpckbd_match(device_t parent, cfdata_t cf, void *aux)
 {
 	return (1);
 }
@@ -153,6 +152,8 @@
 	struct hpckbd_ic_if *ic = haa-haa_ic;
 	struct wskbddev_attach_args wa;
 
+	sc-sc_dev = self;
+
 	/*
 	 * Initialize core if it isn't console
 	 */



CVS commit: src/crypto/external/bsd/openssl/dist/crypto

2011-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 16:54:58 UTC 2011

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/bf: bftest.c
src/crypto/external/bsd/openssl/dist/crypto/bn: bntest.c divtest.c
src/crypto/external/bsd/openssl/dist/crypto/cast: casttest.c
src/crypto/external/bsd/openssl/dist/crypto/conf: test.c
src/crypto/external/bsd/openssl/dist/crypto/des: destest.c
src/crypto/external/bsd/openssl/dist/crypto/ec: ectest.c
src/crypto/external/bsd/openssl/dist/crypto/engine: enginetest.c
src/crypto/external/bsd/openssl/dist/crypto/hmac: hmactest.c
src/crypto/external/bsd/openssl/dist/crypto/md2: md2test.c
src/crypto/external/bsd/openssl/dist/crypto/md4: md4test.c
src/crypto/external/bsd/openssl/dist/crypto/md5: md5test.c
src/crypto/external/bsd/openssl/dist/crypto/ripemd: rmdtest.c
src/crypto/external/bsd/openssl/dist/crypto/sha: sha1test.c shatest.c
src/crypto/external/bsd/openssl/dist/crypto/threads: mttest.c
src/crypto/external/bsd/openssl/dist/crypto/x509v3: tabtest.c

Log Message:
format fixes, prototype fixes, const fixes


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/cast/casttest.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/conf/test.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/des/destest.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/ec/ectest.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/engine/enginetest.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/hmac/hmactest.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/md2/md2test.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/md4/md4test.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/md5/md5test.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/ripemd/rmdtest.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/sha/sha1test.c \
src/crypto/external/bsd/openssl/dist/crypto/sha/shatest.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/threads/mttest.c
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/dist/crypto/x509v3/tabtest.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c:1.1.1.1 src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c:1.1.1.1	Sun Jul 19 19:02:59 2009
+++ src/crypto/external/bsd/openssl/dist/crypto/bf/bftest.c	Sat Jun 11 12:54:56 2011
@@ -79,7 +79,7 @@
 #include openssl/ebcdic.h
 #endif
 
-static char *bf_key[2]={
+static const char *bf_key[2]={
 	abcdefghijklmnopqrstuvwxyz,
 	Who is John Galt?
 	};
@@ -371,7 +371,7 @@
 #ifdef CHARSET_EBCDIC
 		ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n]));
 #endif
-		BF_set_key(key,strlen(bf_key[n]),(unsigned char *)bf_key[n]);
+		BF_set_key(key,strlen(bf_key[n]), (const unsigned char *)bf_key[n]);
 
 		data[0]=bf_plain[n][0];
 		data[1]=bf_plain[n][1];

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c:1.1.1.2	Sat Dec 26 18:31:43 2009
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bntest.c	Sat Jun 11 12:54:56 2011
@@ -127,7 +127,7 @@
 
 static const char rnd_seed[] = string to make the random number generator think it has entropy;
 
-static void message(BIO *out, char *m)
+static void message(BIO *out, const char *m)
 	{
 	fprintf(stderr, test %s\n, m);
 	BIO_puts(out, print \test );

Index: src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c:1.3 src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c:1.4
--- src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c:1.3	Sun May 15 19:43:56 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/divtest.c	Sat Jun 11 12:54:56 2011
@@ -8,7 +8,7 @@
 return (x[0] + 2*x[1]);
 }
 
-static void bug(char *m, BIGNUM *a, BIGNUM *b)
+static void bug(const char *m, BIGNUM *a, BIGNUM *b)
 {
 printf(%s!\na=,m);
 BN_print_fp(stdout, a);

Index: 

CVS commit: src/external/bsd/atf

2011-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 18:03:57 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: defs.h.in tc.h
src/external/bsd/atf/lib/libatf-c: Makefile

Log Message:
turn on printf warnings for all the printf-like atf functions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c/defs.h.in
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/lib/libatf-c/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/bsd/atf/dist/atf-c/defs.h.in
diff -u src/external/bsd/atf/dist/atf-c/defs.h.in:1.1.1.1 src/external/bsd/atf/dist/atf-c/defs.h.in:1.2
--- src/external/bsd/atf/dist/atf-c/defs.h.in:1.1.1.1	Mon Jan 19 02:11:51 2009
+++ src/external/bsd/atf/dist/atf-c/defs.h.in	Sat Jun 11 14:03:57 2011
@@ -31,5 +31,6 @@
 #define ATF_C_DEFS_H
 
 #define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@
+#define ATF_DEFS_ATTRIBUTE_PRINTF(a,b) @ATTRIBUTE_PRINTF(a,b)@
 
 #endif /* !defined(ATF_C_DEFS_H) */

Index: src/external/bsd/atf/dist/atf-c/tc.h
diff -u src/external/bsd/atf/dist/atf-c/tc.h:1.1.1.7 src/external/bsd/atf/dist/atf-c/tc.h:1.2
--- src/external/bsd/atf/dist/atf-c/tc.h:1.1.1.7	Sun Nov  7 12:43:22 2010
+++ src/external/bsd/atf/dist/atf-c/tc.h	Sat Jun 11 14:03:57 2011
@@ -103,22 +103,35 @@
 atf_error_t atf_tc_cleanup(const atf_tc_t *);
 
 /* To be run from test case bodies only. */
-void atf_tc_fail(const char *, ...) ATF_DEFS_ATTRIBUTE_NORETURN;
-void atf_tc_fail_nonfatal(const char *, ...);
-void atf_tc_pass(void) ATF_DEFS_ATTRIBUTE_NORETURN;
+void atf_tc_fail(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
+ATF_DEFS_ATTRIBUTE_NORETURN;
+void atf_tc_fail_nonfatal(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+void atf_tc_pass(void)
+ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_require_prog(const char *);
-void atf_tc_skip(const char *, ...) ATF_DEFS_ATTRIBUTE_NORETURN;
+void atf_tc_skip(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
+ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_expect_pass(void);
-void atf_tc_expect_fail(const char *, ...);
-void atf_tc_expect_exit(const int, const char *, ...);
-void atf_tc_expect_signal(const int, const char *, ...);
-void atf_tc_expect_death(const char *, ...);
-void atf_tc_expect_timeout(const char *, ...);
+void atf_tc_expect_fail(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+void atf_tc_expect_exit(const int, const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
+void atf_tc_expect_signal(const int, const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
+void atf_tc_expect_death(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+void atf_tc_expect_timeout(const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
 
 /* To be run from test case bodies only; internal to macros.h. */
-void atf_tc_fail_check(const char *, const size_t, const char *, ...);
+void atf_tc_fail_check(const char *, const size_t, const char *, ...)
+ATF_DEFS_ATTRIBUTE_PRINTF(3, 4);
 void atf_tc_fail_requirement(const char *, const size_t, const char *, ...)
- ATF_DEFS_ATTRIBUTE_NORETURN;
+ATF_DEFS_ATTRIBUTE_PRINTF(3, 4)
+ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_check_errno(const char *, const size_t, const int,
 const char *, const bool);
 void atf_tc_require_errno(const char *, const size_t, const int,

Index: src/external/bsd/atf/lib/libatf-c/Makefile
diff -u src/external/bsd/atf/lib/libatf-c/Makefile:1.10 src/external/bsd/atf/lib/libatf-c/Makefile:1.11
--- src/external/bsd/atf/lib/libatf-c/Makefile:1.10	Thu Mar 31 12:45:44 2011
+++ src/external/bsd/atf/lib/libatf-c/Makefile	Sat Jun 11 14:03:57 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2011/03/31 16:45:44 jmmv Exp $
+# $NetBSD: Makefile,v 1.11 2011/06/11 18:03:57 christos Exp $
 
 NOLINT=		# defined
 
@@ -75,8 +75,9 @@
 CLEANFILES+=	defs.h
 
 defs.h: defs.h.in
-	${TOOL_SED} -e \
-	's,@ATTRIBUTE_NORETURN@,__attribute__((__noreturn__)),g' \
+	${TOOL_SED} \
+	-e 's|@ATTRIBUTE_NORETURN@|__attribute__((__noreturn__))|g' \
+	-e 's|@ATTRIBUTE_PRINTF(a,b)@|__attribute__((__format__(__printf__,a,b)))|g' \
 	 ${.ALLSRC}  ${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 



CVS commit: src/sys/net80211

2011-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 12 00:07:19 UTC 2011

Modified Files:
src/sys/net80211: ieee80211_acl.c ieee80211_ioctl.c ieee80211_ioctl.h

Log Message:
Change i_len in ieee80211req to be unsigned and fix other signed/unsigned
issues. From Dan Rosenberg (drosenberg at vsecurity dot com).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/net80211/ieee80211_acl.c
cvs rdiff -u -r1.55 -r1.56 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.19 -r1.20 src/sys/net80211/ieee80211_ioctl.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/net80211/ieee80211_acl.c
diff -u src/sys/net80211/ieee80211_acl.c:1.8 src/sys/net80211/ieee80211_acl.c:1.9
--- src/sys/net80211/ieee80211_acl.c:1.8	Wed Dec 17 15:51:37 2008
+++ src/sys/net80211/ieee80211_acl.c	Sat Jun 11 20:07:19 2011
@@ -34,7 +34,7 @@
 __FBSDID($FreeBSD: src/sys/net80211/ieee80211_acl.c,v 1.4 2005/08/13 17:31:48 sam Exp $);
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, $NetBSD: ieee80211_acl.c,v 1.8 2008/12/17 20:51:37 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ieee80211_acl.c,v 1.9 2011/06/12 00:07:19 christos Exp $);
 #endif
 
 /*
@@ -79,7 +79,7 @@
 struct aclstate {
 	acl_lock_t		as_lock;
 	int			as_policy;
-	int			as_nacls;
+	uint32_t		as_nacls;
 	TAILQ_HEAD(, acl)	as_list;	/* list of all ACL's */
 	LIST_HEAD(, acl)	as_hash[ACL_HASHSIZE];
 	struct ieee80211com	*as_ic;
@@ -281,7 +281,8 @@
 	struct aclstate *as = ic-ic_as;
 	struct acl *acl;
 	struct ieee80211req_maclist *ap;
-	int error, space, i;
+	int error;
+	uint32_t i, space;
 
 	switch (ireq-i_val) {
 	case IEEE80211_MACCMD_POLICY:

Index: src/sys/net80211/ieee80211_ioctl.c
diff -u src/sys/net80211/ieee80211_ioctl.c:1.55 src/sys/net80211/ieee80211_ioctl.c:1.56
--- src/sys/net80211/ieee80211_ioctl.c:1.55	Sat Apr  2 04:11:32 2011
+++ src/sys/net80211/ieee80211_ioctl.c	Sat Jun 11 20:07:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_ioctl.c,v 1.55 2011/04/02 08:11:32 mbalmer Exp $	*/
+/*	$NetBSD: ieee80211_ioctl.c,v 1.56 2011/06/12 00:07:19 christos Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID($FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $);
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, $NetBSD: ieee80211_ioctl.c,v 1.55 2011/04/02 08:11:32 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ieee80211_ioctl.c,v 1.56 2011/06/12 00:07:19 christos Exp $);
 #endif
 
 /*
@@ -932,9 +932,8 @@
 {
 	size_t len = ireq-i_len;
 
-	if (sizeof(ic-ic_chan_active)  len) {
+	if (len  sizeof(ic-ic_chan_active))
 		len = sizeof(ic-ic_chan_active);
-	}
 	return copyout(ic-ic_chan_active, ireq-i_data, len);
 }
 
@@ -942,7 +941,8 @@
 ieee80211_ioctl_getchaninfo(struct ieee80211com *ic, struct ieee80211req *ireq)
 {
 	struct ieee80211req_chaninfo *chans;
-	int i, space, error;
+	uint32_t i, space;
+	int error;
 
 	/*
 	 * Since channel 0 is not available for DS, channel 1
@@ -1004,7 +1004,7 @@
 {
 	struct ieee80211_node *ni;
 	u_int8_t macaddr[IEEE80211_ADDR_LEN];
-	const int off = __offsetof(struct ieee80211req_sta_stats, is_stats);
+	const size_t off = __offsetof(struct ieee80211req_sta_stats, is_stats);
 	int error;
 
 	if (ireq-i_len  off)
@@ -1075,7 +1075,8 @@
 	struct ieee80211req_scan_result *sr = u.res;
 	struct ieee80211_node_table *nt;
 	struct ieee80211_node *ni;
-	int error, space;
+	int error;
+	uint32_t space;
 	u_int8_t *p, *cp;
 
 	p = ireq-i_data;

Index: src/sys/net80211/ieee80211_ioctl.h
diff -u src/sys/net80211/ieee80211_ioctl.h:1.19 src/sys/net80211/ieee80211_ioctl.h:1.20
--- src/sys/net80211/ieee80211_ioctl.h:1.19	Mon Jul 28 13:54:02 2008
+++ src/sys/net80211/ieee80211_ioctl.h	Sat Jun 11 20:07:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_ioctl.h,v 1.19 2008/07/28 17:54:02 christos Exp $	*/
+/*	$NetBSD: ieee80211_ioctl.h,v 1.20 2011/06/12 00:07:19 christos Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -413,7 +413,7 @@
 	char		i_name[IFNAMSIZ];	/* if_name, e.g. wi0 */
 	u_int16_t	i_type;			/* req type */
 	int16_t		i_val;			/* Index or simple value */
-	int16_t		i_len;			/* Index or simple value */
+	u_int16_t	i_len;			/* Index or simple value */
 	void		*i_data;		/* Extra data */
 };
 



CVS commit: [rmind-uvmplock] src/sys

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 00:24:32 UTC 2011

Modified Files:
src/sys/arch/acorn26/acorn26 [rmind-uvmplock]: fpu.c
src/sys/arch/acorn26/ioc [rmind-uvmplock]: arckbd.c ioeb.c ioebvar.h
latches.c ssn.c
src/sys/arch/acorn32/acorn32 [rmind-uvmplock]: autoconf.c
src/sys/arch/acorn32/conf [rmind-uvmplock]: EB7500ATX
src/sys/arch/acorn32/eb7500atx [rmind-uvmplock]: rsbus.c
src/sys/arch/acorn32/include [rmind-uvmplock]: podulebus_machdep.h
src/sys/arch/acorn32/mainbus [rmind-uvmplock]: com_pioc.c fd.c
lpt_pioc.c pioc.c wdc_pioc.c
src/sys/arch/acorn32/podulebus [rmind-uvmplock]: amps.c asc.c cosc.c
csc.c if_ie.c netslot.c podulebus.c ptsc.c
src/sys/arch/algor/dev [rmind-uvmplock]: mainbus.c
src/sys/arch/alpha/alpha [rmind-uvmplock]: compat_13_machdep.c
compat_16_machdep.c core_machdep.c cpu.c fp_complete.c genassym.cf
ipifuncs.c locore.s machdep.c process_machdep.c trap.c vm_machdep.c
src/sys/arch/alpha/include [rmind-uvmplock]: alpha.h intr.h pcb.h
proc.h types.h
src/sys/arch/alpha/isa [rmind-uvmplock]: isa_machdep.c
src/sys/arch/alpha/pci [rmind-uvmplock]: ttwoga.c
src/sys/arch/alpha/tc [rmind-uvmplock]: ioasic.c tcasic.c
src/sys/arch/alpha/tlsb [rmind-uvmplock]: tlsb.c
src/sys/arch/amd64/conf [rmind-uvmplock]: Makefile.amd64
src/sys/arch/amiga/amiga [rmind-uvmplock]: autoconf.c
src/sys/arch/amiga/dev [rmind-uvmplock]: a2kbbc.c a34kbbc.c clock.c
fd.c grf.c gvpbus.c kbd.c msc.c toccata.c zbus.c
src/sys/arch/amigappc/amigappc [rmind-uvmplock]: cpu.c mainbus.c
src/sys/arch/arm/at91 [rmind-uvmplock]: at91aic.c
src/sys/arch/arm/mainbus [rmind-uvmplock]: cpu_mainbus.c mainbus.c
src/sys/arch/arm/marvell [rmind-uvmplock]: mvsoctmr.c
src/sys/arch/arm/ofw [rmind-uvmplock]: ofwgencfg_machdep.c
src/sys/arch/arm/xscale [rmind-uvmplock]: pxa2x0.c pxa2x0_ac97.c
pxa2x0_dmac.c pxa2x0_gpio.c pxa2x0_intr.c pxa2x0_udc.c
src/sys/arch/atari/atari [rmind-uvmplock]: autoconf.c
src/sys/arch/atari/dev [rmind-uvmplock]: atari5380.c clock.c grf.c
grfvar.h hdfd.c ite.c ite_cc.c ite_et.c itevar.h kbd.c ncr5380.c
ncr5380reg.h nvram.c nvramvar.h
src/sys/arch/atari/isa [rmind-uvmplock]: isa_machdep.c
src/sys/arch/atari/pci [rmind-uvmplock]: pci_machdep.c
src/sys/arch/atari/vme [rmind-uvmplock]: et4000.c leo.c vme.c
vme_machdep.c vmevar.h
src/sys/arch/bebox/bebox [rmind-uvmplock]: cpu.c mainbus.c pic_bebox.c
src/sys/arch/cats/pci [rmind-uvmplock]: pcib.c
src/sys/arch/cesfic/cesfic [rmind-uvmplock]: autoconf.c
src/sys/arch/emips/emips [rmind-uvmplock]: mainbus.c
src/sys/arch/evbarm/adi_brh [rmind-uvmplock]: obio.c
src/sys/arch/evbarm/conf [rmind-uvmplock]: SHEEVAPLUG TWINTAIL
src/sys/arch/evbarm/hdl_g [rmind-uvmplock]: obio.c
src/sys/arch/evbarm/iq80310 [rmind-uvmplock]: obio.c
src/sys/arch/evbarm/iq80321 [rmind-uvmplock]: obio.c
src/sys/arch/evbarm/ixm1200 [rmind-uvmplock]: nappi_nppb.c
src/sys/arch/evbmips/conf [rmind-uvmplock]: files.gdium
src/sys/arch/evbmips/gdium [rmind-uvmplock]: gdium_dma.c gdium_intr.c
machdep.c
src/sys/arch/evbmips/malta/dev [rmind-uvmplock]: gt.c mainbus.c
src/sys/arch/evbmips/malta/pci [rmind-uvmplock]: pchb.c
src/sys/arch/evbppc/conf [rmind-uvmplock]: INSTALL_OPENBLOCKS266
INSTALL_PMPPC INSTALL_WALNUT MPC8536DS MPC8548CDS P2020DS P2020RDB
RB800 WALNUT std.mpc85xx
src/sys/arch/evbppc/ev64260 [rmind-uvmplock]: mainbus.c
src/sys/arch/evbppc/explora/dev [rmind-uvmplock]: elb.c
src/sys/arch/evbppc/mpc85xx [rmind-uvmplock]: machdep.c mpc85xx_start.S
src/sys/arch/evbppc/pmppc [rmind-uvmplock]: mainbus.c
src/sys/arch/evbppc/pmppc/dev [rmind-uvmplock]: cpc_mainbus.c
src/sys/arch/evbppc/virtex/dev [rmind-uvmplock]: xcvbus.c
src/sys/arch/evbppc/walnut/dev [rmind-uvmplock]: pbus.c
src/sys/arch/evbppc/walnut/pci [rmind-uvmplock]: pchb.c
src/sys/arch/hp700/gsc [rmind-uvmplock]: if_ie_gsc.c
src/sys/arch/hpcmips/tx [rmind-uvmplock]: txioman.c
src/sys/arch/hpcsh/dev/hd64465 [rmind-uvmplock]: hd64465.c
src/sys/arch/i386/conf [rmind-uvmplock]: Makefile.i386
src/sys/arch/i386/i386 [rmind-uvmplock]: machdep.c
src/sys/arch/i386/include [rmind-uvmplock]: frame.h
src/sys/arch/i386/isa [rmind-uvmplock]: npx.c
src/sys/arch/i386/pci [rmind-uvmplock]: pci_intr_fixup.c viapcib.c
src/sys/arch/i386/pnpbios [rmind-uvmplock]: wss_pnpbios.c ym_pnpbios.c
src/sys/arch/i386/stand/boot [rmind-uvmplock]: Makefile.boot
src/sys/arch/i386/stand/lib 

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

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 01:28:29 UTC 2011

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

Log Message:
Set iospace and virtual_end address properly.
Fixes TLB miss panic during device attach on emips.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/sys/arch/mips/mips/pmap.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.201 src/sys/arch/mips/mips/pmap.c:1.202
--- src/sys/arch/mips/mips/pmap.c:1.201	Sat May  7 14:37:46 2011
+++ src/sys/arch/mips/mips/pmap.c	Sun Jun 12 01:28:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.201 2011/05/07 14:37:46 tsutsui Exp $	*/
+/*	$NetBSD: pmap.c,v 1.202 2011/06/12 01:28:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.201 2011/05/07 14:37:46 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.202 2011/06/12 01:28:29 tsutsui Exp $);
 
 /*
  *	Manages physical address maps.
@@ -555,12 +555,12 @@
 
 #ifndef _LP64
 	/* Need space for I/O (not in K1SEG) ? */
-	mips_virtual_end += iospace_size;
 
 	if (mips_virtual_end  VM_MAX_KERNEL_ADDRESS) {
 		mips_virtual_end = VM_MAX_KERNEL_ADDRESS;
 		Sysmapsize =
-		(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NBPG;
+		(VM_MAX_KERNEL_ADDRESS -
+		 (VM_MIN_KERNEL_ADDRESS + iospace_size)) / NBPG;
 	}
 
 	if (iospace_size) {



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

2011-06-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 12 01:29:58 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: kobj_machdep.c

Log Message:
sparc relative reloctions are busted here; copy the sparc64 style
which seems to make things work fine, and also seems to follow what
ld.elf_so does.

this makes modules work in my limited testing.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/sparc/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/kobj_machdep.c
diff -u src/sys/arch/sparc/sparc/kobj_machdep.c:1.2 src/sys/arch/sparc/sparc/kobj_machdep.c:1.3
--- src/sys/arch/sparc/sparc/kobj_machdep.c:1.2	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/kobj_machdep.c	Sun Jun 12 01:29:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.2 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.3 2011/06/12 01:29:58 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -160,7 +160,7 @@
 		addr = kobj_sym_lookup(ko, symidx);
 		if (addr == 0)
 			return -1;
-		value += (Elf_Word)(relocbase + addr);
+		value += addr;
 	}
 
 	if (RELOC_PC_RELATIVE(type)) {



CVS commit: src/doc

2011-06-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 12 01:45:00 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
note that sparc MODULAR works and is enabled now.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1554 src/doc/CHANGES:1.1555
--- src/doc/CHANGES:1.1554	Wed Jun  8 22:33:35 2011
+++ src/doc/CHANGES	Sun Jun 12 01:45:00 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1554 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1555 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1020,3 +1020,4 @@
 	ktrace(1): Add a new trace point to list all open file descriptors
 		after exec(3). [alnsn 20110601]
 	alpha: Converted Alpha to use PCU to manage FPU. [matt 20110607]
+	sparc: enable options MODULAR in the GENERIC* kernels.  [mrg 20110611]



CVS commit: [rmind-uvmplock] src/sys/uvm

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 02:32:29 UTC 2011

Modified Files:
src/sys/uvm [rmind-uvmplock]: uvm_init.c

Log Message:
Do not call uvm_loan_init() twice.


To generate a diff of this commit:
cvs rdiff -u -r1.36.4.3 -r1.36.4.4 src/sys/uvm/uvm_init.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_init.c
diff -u src/sys/uvm/uvm_init.c:1.36.4.3 src/sys/uvm/uvm_init.c:1.36.4.4
--- src/sys/uvm/uvm_init.c:1.36.4.3	Tue May 31 03:05:14 2011
+++ src/sys/uvm/uvm_init.c	Sun Jun 12 02:32:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_init.c,v 1.36.4.3 2011/05/31 03:05:14 rmind Exp $	*/
+/*	$NetBSD: uvm_init.c,v 1.36.4.4 2011/06/12 02:32:29 rmind Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_init.c,v 1.36.4.3 2011/05/31 03:05:14 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_init.c,v 1.36.4.4 2011/06/12 02:32:29 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -169,11 +169,6 @@
 	uvm_emap_sysinit();
 
 	/*
-	 * Init the uvm_loan() facility.
-	 */
-	uvm_loan_init();
-
-	/*
 	 * the VM system is now up!  now that kmem is up we can resize the
 	 * obj,off = page hash table for general use and enable paging
 	 * of kernel objects.



CVS commit: [rmind-uvmplock] src/sys/rump/librump/rumpkern

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 02:39:37 UTC 2011

Modified Files:
src/sys/rump/librump/rumpkern [rmind-uvmplock]: vm.c

Log Message:
Sync RUMP's uvm_pagealloc_strat() and processpage() with branch changes.


To generate a diff of this commit:
cvs rdiff -u -r1.70.4.5 -r1.70.4.6 src/sys/rump/librump/rumpkern/vm.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/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.70.4.5 src/sys/rump/librump/rumpkern/vm.c:1.70.4.6
--- src/sys/rump/librump/rumpkern/vm.c:1.70.4.5	Thu Apr 21 01:42:17 2011
+++ src/sys/rump/librump/rumpkern/vm.c	Sun Jun 12 02:39:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.70.4.5 2011/04/21 01:42:17 rmind Exp $	*/
+/*	$NetBSD: vm.c,v 1.70.4.6 2011/06/12 02:39:37 rmind Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.70.4.5 2011/04/21 01:42:17 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.70.4.6 2011/06/12 02:39:37 rmind Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -173,7 +173,7 @@
 {
 	struct vm_page *pg;
 
-	KASSERT(uobj  mutex_owned(uobj-vmobjlock));
+	KASSERT(uobj  mutex_owned(uobj-vmobjlock));
 	KASSERT(anon == NULL);
 
 	pg = pool_cache_get(pagecache, PR_NOWAIT);
@@ -569,7 +569,7 @@
 	int i;
 
 	KASSERT(npgs  0);
-	KASSERT(mutex_owned(pgs[0]-uobject-vmobjlock));
+	KASSERT(mutex_owned(pgs[0]-uobject-vmobjlock));
 
 	for (i = 0; i  npgs; i++) {
 		pg = pgs[i];
@@ -952,23 +952,23 @@
 	struct uvm_object *uobj;
 
 	uobj = pg-uobject;
-	if (mutex_tryenter(uobj-vmobjlock)) {
+	if (mutex_tryenter(uobj-vmobjlock)) {
 		if ((pg-flags  PG_BUSY) == 0) {
 			mutex_exit(uvm_pageqlock);
 			uobj-pgops-pgo_put(uobj, pg-offset,
 			pg-offset + PAGE_SIZE,
 			PGO_CLEANIT|PGO_FREE);
-			KASSERT(!mutex_owned(uobj-vmobjlock));
+			KASSERT(!mutex_owned(uobj-vmobjlock));
 			return true;
 		} else {
-			mutex_exit(uobj-vmobjlock);
+			mutex_exit(uobj-vmobjlock);
 		}
 	} else if (*lockrunning == false  ncpu  1) {
 		CPU_INFO_ITERATOR cii;
 		struct cpu_info *ci;
 		struct lwp *l;
 
-		l = mutex_owner(uobj-vmobjlock);
+		l = mutex_owner(uobj-vmobjlock);
 		for (CPU_INFO_FOREACH(cii, ci)) {
 			if (ci-ci_curlwp == l) {
 *lockrunning = true;



CVS commit: [rmind-uvmplock] src/sys/rump/librump/rumpvfs

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 03:06:00 UTC 2011

Modified Files:
src/sys/rump/librump/rumpvfs [rmind-uvmplock]: rumpfs.c vm_vfs.c

Log Message:
Sync RUMP's rump_etfs_remove() and uvm_aio_aiodone() with branch changes.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.6 -r1.37.2.7 src/sys/rump/librump/rumpvfs/rumpfs.c
cvs rdiff -u -r1.15.4.4 -r1.15.4.5 src/sys/rump/librump/rumpvfs/vm_vfs.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/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.37.2.6 src/sys/rump/librump/rumpvfs/rumpfs.c:1.37.2.7
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.37.2.6	Thu May 19 03:43:04 2011
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Sun Jun 12 03:06:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.37.2.6 2011/05/19 03:43:04 rmind Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.37.2.7 2011/06/12 03:06:00 rmind Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.37.2.6 2011/05/19 03:43:04 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: rumpfs.c,v 1.37.2.7 2011/06/12 03:06:00 rmind Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -489,7 +489,7 @@
 
 		mutex_enter(reclock);
 		if ((vp = et-et_rn-rn_vp) != NULL)
-			mutex_enter(vp-v_interlock);
+			mutex_enter(vp-v_interlock);
 		mutex_exit(reclock);
 		if (vp  vget(vp, 0) == 0)
 			vgone(vp);

Index: src/sys/rump/librump/rumpvfs/vm_vfs.c
diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.15.4.4 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.15.4.5
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.15.4.4	Thu Apr 21 01:42:18 2011
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c	Sun Jun 12 03:06:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_vfs.c,v 1.15.4.4 2011/04/21 01:42:18 rmind Exp $	*/
+/*	$NetBSD: vm_vfs.c,v 1.15.4.5 2011/06/12 03:06:00 rmind Exp $	*/
 
 /*
  * Copyright (c) 2008-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_vfs.c,v 1.15.4.4 2011/04/21 01:42:18 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_vfs.c,v 1.15.4.5 2011/06/12 03:06:00 rmind Exp $);
 
 #include sys/param.h
 
@@ -69,11 +69,11 @@
 	uobj = pgs[0]-uobject;
 	KASSERT(uobj);
 
-	mutex_enter(uobj-vmobjlock);
+	mutex_enter(uobj-vmobjlock);
 	mutex_enter(uvm_pageqlock);
 	uvm_page_unbusy(pgs, npages);
 	mutex_exit(uvm_pageqlock);
-	mutex_exit(uobj-vmobjlock);
+	mutex_exit(uobj-vmobjlock);
 
 	uvm_pageout_done(pageout);
 



CVS commit: src/sys/arch/emips/emips

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 03:14:03 UTC 2011

Modified Files:
src/sys/arch/emips/emips: autoconf.c

Log Message:
- misc KNF
- use device_xname(), device_unit(), and device_class()


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/autoconf.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/emips/emips/autoconf.c
diff -u src/sys/arch/emips/emips/autoconf.c:1.3 src/sys/arch/emips/emips/autoconf.c:1.4
--- src/sys/arch/emips/emips/autoconf.c:1.3	Tue Feb 22 08:20:20 2011
+++ src/sys/arch/emips/emips/autoconf.c	Sun Jun 12 03:14:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -60,6 +60,7 @@
 void
 cpu_configure(void)
 {
+
 	/* Kick off autoconfiguration. */
 	(void)splhigh();
 
@@ -80,56 +81,63 @@
 /*
  * Look at the string 'cp' and decode the boot device.
  * Boot names are something like '0/ace(0,0)/netbsd' or 'tftp()/nfsnetbsd'
- * meaning: [BusNumber/]ControllerName([DiskNumber,PartitionNumber])/kernelname
+ * meaning:
+ *  [BusNumber/]ControllerName([DiskNumber,PartitionNumber])/kernelname
  */
 void
 makebootdev(char *cp)
 {
-int i;
-static char booted_controller_name[8];
+	int i;
+	static char booted_controller_name[8];
 
 	booted_device = NULL;
 	booted_bus = booted_unit = booted_partition = 0;
 	booted_controller = NULL;
 
-if (*cp = '0'  *cp = '9') {
-booted_bus = *cp++ - '0';
-if (*cp == '/') cp++;
-}
+	if (*cp = '0'  *cp = '9') {
+	booted_bus = *cp++ - '0';
+		if (*cp == '/')
+			cp++;
+	}
 
 	if (strncmp(cp, tftp(, 5) == 0) {
 		booted_controller = BOOTP;
 		goto out;
 	}
 
-/* Stash away the controller name and use it later
- */
-for (i = 0; i  7  *cp  *cp != '('; i++)
-booted_controller_name[i] = *cp++;
-booted_controller_name[7] = 0; /* sanity */
-
-if (*cp == '(') cp++;
-if (*cp = '0'  *cp = '9') 
-booted_unit = *cp++ - '0';
-
-if (*cp == ',') cp++;
-if (*cp = '0'  *cp = '9')
-booted_partition = *cp - '0';
-booted_controller = booted_controller_name;
+	/*
+	 * Stash away the controller name and use it later
+	 */
+	for (i = 0; i  7  *cp  *cp != '('; i++)
+		booted_controller_name[i] = *cp++;
+	booted_controller_name[7] = 0; /* sanity */
+
+	if (*cp == '(')
+		cp++;
+	if (*cp = '0'  *cp = '9') 
+		booted_unit = *cp++ - '0';
+
+	if (*cp == ',')
+		cp++;
+	if (*cp = '0'  *cp = '9')
+		booted_partition = *cp - '0';
+	booted_controller = booted_controller_name;
 
  out:
 #if DEBUG
-printf(bootdev: %d/%s(%d,%d)\n,booted_bus,booted_controller,booted_unit,booted_partition);
+	printf(bootdev: %d/%s(%d,%d)\n,
+	booted_bus, booted_controller, booted_unit, booted_partition);
 #endif
-return;
+	return;
 }
 
 void
 cpu_rootconf(void)
 {
+
 	printf(boot device: %s part%d\n,
-	booted_device ? booted_device-dv_xname : unknown,
-   booted_partition);
+	booted_device ? device_xname(booted_device) : unknown,
+	booted_partition);
 
 	setroot(booted_device, booted_partition);
 }
@@ -138,18 +146,18 @@
  * Try to determine the boot device.
  */
 void
-device_register(struct device *dev,
-void *aux)
+device_register(device_t dev, void *aux)
 {
 	static int found, initted, netboot;
-	static struct device *ebusdev;
-	struct device *parent = device_parent(dev);
+	static device_t ebusdev;
+	device_t parent = device_parent(dev);
 
 	if (found)
 		return;
 
 #if 0
-printf(\n[device_register(%s,%d) class %d]\n, dev-dv_xname, dev-dv_unit, dev-dv_class);
+	printf(\n[device_register(%s,%d) class %d]\n,
+	device_xname(dev), device_unit(dev), device_class(dev));
 #endif
 
 	if (!initted) {
@@ -161,7 +169,7 @@
 	 * Remember the EBUS
 	 */
 	if (device_is_a(dev, ebus)) {
-ebusdev = dev;
+		ebusdev = dev;
 		return;
 	}
 
@@ -170,9 +178,9 @@
 	 */
 	if (netboot) {
 
-/* Only one Ethernet interface (on ebus). */
-		if ((parent == ebusdev)
-		 device_is_a(dev, enic)) {
+		/* Only one Ethernet interface (on ebus). */
+		if ((parent == ebusdev) 
+		device_is_a(dev, enic)) {
 			booted_device = dev;
 			found = 1;
 			return;
@@ -186,15 +194,15 @@
 			return;
 		}
 
-/* The NIC might be found after the disk, so bail out here */
-return;
+		/* The NIC might be found after the disk, so bail out here */
+		return;
 	}
 
-/* BUGBUG How would I get to the bus */
-if (device_is_a(dev,booted_controller)  (dev-dv_unit == booted_unit)) {
-booted_device 

CVS commit: src/sys/arch/emips

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 03:21:21 UTC 2011

Modified Files:
src/sys/arch/emips/emips: autoconf.c interrupt.c machdep.c mainbus.c
src/sys/arch/emips/include: intr.h

Log Message:
No need to initialize interrupt evcnt(9) so earlier, so remove phase arg
from intr_init() and initialize all stuff in cpu_configure(9) as other ports
rather than in mach_init() and mbattach().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/emips/autoconf.c \
src/sys/arch/emips/emips/machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/interrupt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/mainbus.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/intr.h

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

Modified files:

Index: src/sys/arch/emips/emips/autoconf.c
diff -u src/sys/arch/emips/emips/autoconf.c:1.4 src/sys/arch/emips/emips/autoconf.c:1.5
--- src/sys/arch/emips/emips/autoconf.c:1.4	Sun Jun 12 03:14:03 2011
+++ src/sys/arch/emips/emips/autoconf.c	Sun Jun 12 03:21:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -64,6 +64,9 @@
 	/* Kick off autoconfiguration. */
 	(void)splhigh();
 
+	/* Interrupt initialization. */
+	intr_init();
+
 	evcnt_attach_static(emips_clock_evcnt);
 	evcnt_attach_static(emips_fpu_evcnt);
 	evcnt_attach_static(emips_memerr_evcnt);
Index: src/sys/arch/emips/emips/machdep.c
diff -u src/sys/arch/emips/emips/machdep.c:1.4 src/sys/arch/emips/emips/machdep.c:1.5
--- src/sys/arch/emips/emips/machdep.c:1.4	Tue Feb 22 08:20:20 2011
+++ src/sys/arch/emips/emips/machdep.c	Sun Jun 12 03:21:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $);
 
 #include opt_ddb.h
 
@@ -288,9 +288,6 @@
 	/* Machine specific initialization. */
 	(*sysinit[systype].init)();
 
-	/* Interrupt initialization, phase 0 */
-	intr_init(0);
-
 	/* Find out how much memory is available. */
 	physmem = (*platform.memsize)(kernend);
 

Index: src/sys/arch/emips/emips/interrupt.c
diff -u src/sys/arch/emips/emips/interrupt.c:1.3 src/sys/arch/emips/emips/interrupt.c:1.4
--- src/sys/arch/emips/emips/interrupt.c:1.3	Thu Mar 10 17:22:51 2011
+++ src/sys/arch/emips/emips/interrupt.c	Sun Jun 12 03:21:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -67,33 +67,28 @@
 };
 
 void
-intr_init(int phase)
+intr_init(void)
 {
 	int i;
 
-	if (phase == 0) {
-		for (i = 0; i  MAX_DEV_NCOOKIES; i++) {
-			evcnt_attach_dynamic(intrtab[i].ih_count,
-			EVCNT_TYPE_INTR, NULL, emips, intrnames[i]);
-		}
-		return;
+	for (i = 0; i  MAX_DEV_NCOOKIES; i++) {
+		evcnt_attach_dynamic(intrtab[i].ih_count,
+		EVCNT_TYPE_INTR, NULL, emips, intrnames[i]);
 	}
 
-	if (phase == 1) {
-		/* I am trying to make this standard so its here. Bah. */
-		struct tlbmask tlb;
+	/* I am trying to make this standard so its here. Bah. */
+	struct tlbmask tlb;
 
-/* This is ugly but efficient. Sigh. */
+	/* This is ugly but efficient. Sigh. */
 #define TheAic ((struct _Aic *)INTERRUPT_CONTROLLER_DEFAULT_ADDRESS)
 
-		tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS;
-		tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02;
-		tlb_write_indexed(4, tlb);
-
-		tlb.tlb_hi = TIMER_DEFAULT_ADDRESS;
-		tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02;
-		tlb_write_indexed(5, tlb);
-	}
+	tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS;
+	tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02;
+	tlb_write_indexed(4, tlb);
+
+	tlb.tlb_hi = TIMER_DEFAULT_ADDRESS;
+	tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02;
+	tlb_write_indexed(5, tlb);
 }
 
 /*

Index: src/sys/arch/emips/emips/mainbus.c
diff -u src/sys/arch/emips/emips/mainbus.c:1.2 src/sys/arch/emips/emips/mainbus.c:1.3
--- src/sys/arch/emips/emips/mainbus.c:1.2	Sun Jun  5 

CVS commit: src/sys/dev/usb

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 03:26:20 UTC 2011

Modified Files:
src/sys/dev/usb: ubsa.c usb_mem.c

Log Message:
Fix the build of ALL kernel (hi matt@).


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/usb/ubsa.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/usb_mem.c

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

Modified files:

Index: src/sys/dev/usb/ubsa.c
diff -u src/sys/dev/usb/ubsa.c:1.26 src/sys/dev/usb/ubsa.c:1.27
--- src/sys/dev/usb/ubsa.c:1.26	Wed Nov  3 22:34:23 2010
+++ src/sys/dev/usb/ubsa.c	Sun Jun 12 03:26:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa.c,v 1.26 2010/11/03 22:34:23 dyoung Exp $	*/
+/*	$NetBSD: ubsa.c,v 1.27 2011/06/12 03:26:20 rmind Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa.c,v 1.26 2010/11/03 22:34:23 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa.c,v 1.27 2011/06/12 03:26:20 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -90,7 +90,7 @@
 #include dev/usb/ubsavar.h
 
 #ifdef UBSA_DEBUG
-Static int	ubsadebug = 0;
+int		ubsadebug = 0;
 #ifdef __FreeBSD__
 SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, USB ubsa);
 SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RW,

Index: src/sys/dev/usb/usb_mem.c
diff -u src/sys/dev/usb/usb_mem.c:1.48 src/sys/dev/usb/usb_mem.c:1.49
--- src/sys/dev/usb/usb_mem.c:1.48	Thu Jun  9 19:08:32 2011
+++ src/sys/dev/usb/usb_mem.c	Sun Jun 12 03:26:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_mem.c,v 1.48 2011/06/09 19:08:32 matt Exp $	*/
+/*	$NetBSD: usb_mem.c,v 1.49 2011/06/12 03:26:20 rmind Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb_mem.c,v 1.48 2011/06/09 19:08:32 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb_mem.c,v 1.49 2011/06/12 03:26:20 rmind Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_usb.h
@@ -130,7 +130,7 @@
 			splx(s);
 			*dmap = b;
 			DPRINTFN(6,(usb_block_allocmem: free list size=%zu\n,
-			p-size));
+			b-size));
 			return (USBD_NORMAL_COMPLETION);
 		}
 	}
@@ -208,7 +208,7 @@
 #endif
 
 #ifdef DEBUG
-Static bool
+static bool
 usb_valid_block_p(usb_dma_block_t *b, struct usb_dma_block_qh *qh)
 {
 	usb_dma_block_t *xb;



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 03:29:34 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: flash_ebus.c icap_ebus.c

Log Message:
Fix printf formats in DEBUG case.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/flash_ebus.c \
src/sys/arch/emips/ebus/icap_ebus.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/emips/ebus/flash_ebus.c
diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.1 src/sys/arch/emips/ebus/flash_ebus.c:1.2
--- src/sys/arch/emips/ebus/flash_ebus.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/flash_ebus.c	Sun Jun 12 03:29:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $);
 
 /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device
  * Extended to include the Intel JS28F256P30T95.
@@ -1209,7 +1209,7 @@
 error = ioaccess((vaddr_t)sc-sc_sector,
  secstart + sc-sc_base,
  secsize);   
-DBGME(DEBUG_FUNCS,printf(%s: mapped %p %zx - %lx %d\n,
+DBGME(DEBUG_FUNCS,printf(%s: mapped %p %zx - %zx %d\n,
 	device_xname(sc-sc_dev),
 	sc-sc_sector, secsize, secstart + sc-sc_base,error));
 if (error) return error;
@@ -1306,7 +1306,7 @@
 /* Rest of code lifted with mods from the dev\ata\wd.c driver
  */
 
-/*	$NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */
+/*	$NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -1870,7 +1870,7 @@
 	struct eflash_softc *sc;
 	int part, error;
 
-	DEBUG_PRINT((eflashopen %zx\n, dev), DEBUG_FUNCS);
+	DEBUG_PRINT((eflashopen % PRIx64 \n, dev), DEBUG_FUNCS);
 	sc = device_lookup_private(eflash_cd, EFLASHUNIT(dev));
 	if (sc == NULL)
 		return (ENXIO);
@@ -1945,7 +1945,7 @@
 	struct eflash_softc *sc = device_lookup_private(eflash_cd, EFLASHUNIT(dev));
 	int part = EFLASHPART(dev);
 
-	DEBUG_PRINT((eflashclose %zx\n, dev), DEBUG_FUNCS);
+	DEBUG_PRINT((eflashclose % PRIx64 \n, dev), DEBUG_FUNCS);
 
 	mutex_enter(sc-sc_dk.dk_openlock);
 
Index: src/sys/arch/emips/ebus/icap_ebus.c
diff -u src/sys/arch/emips/ebus/icap_ebus.c:1.1 src/sys/arch/emips/ebus/icap_ebus.c:1.2
--- src/sys/arch/emips/ebus/icap_ebus.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/icap_ebus.c	Sun Jun 12 03:29:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: icap_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: icap_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: icap_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: icap_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -234,7 +234,7 @@
 	/* Do we know you.  */
 	sc = device_lookup_private(icap_cd, minor(bp-b_dev));
 	if (sc == NULL) {
-		DEBUG_PRINT((icapstrategy: nodev %x\n,bp-b_dev),
+		DEBUG_PRINT((icapstrategy: nodev % PRIx64 \n,bp-b_dev),
 		DEBUG_ERRORS);
 		bp-b_error = ENXIO;
 		biodone(bp);
@@ -335,7 +335,7 @@
 
 /* Ship it
  */
-DEBUG_PRINT((icapship %lx %d\n,phys,count), DEBUG_XFERS);
+DEBUG_PRINT((icapship % PRIxPADDR  %d\n,phys,count), DEBUG_XFERS);
 sc-sc_dp-SizeAndFlags = fl | count;
 sc-sc_dp-BufferAddressHi32 = 0; /* BUGBUG 64bit */
 sc-sc_dp-BufferAddressLo32 = phys; /* this pushes the fifo */



CVS commit: src/sys/arch/evbppc

2011-06-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 12 03:42:42 UTC 2011

Modified Files:
src/sys/arch/evbppc/evbppc: evbppc_machdep.c
src/sys/arch/evbppc/explora: machdep.c
src/sys/arch/evbppc/include: cpu.h
src/sys/arch/evbppc/mpc85xx: machdep.c
src/sys/arch/evbppc/obs405: obs200_machdep.c obs266_machdep.c
obs600_machdep.c
src/sys/arch/evbppc/virtex: machdep.c
src/sys/arch/evbppc/walnut: machdep.c

Log Message:
for booke and ibm4xx evbppc systems, set module_machine to to either
powerpc-ibm4xx or powerpc-booke.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbppc/evbppc/evbppc_machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbppc/explora/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/include/cpu.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbppc/mpc85xx/machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbppc/obs405/obs200_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbppc/obs405/obs266_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/obs405/obs600_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbppc/virtex/machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbppc/walnut/machdep.c

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

Modified files:

Index: src/sys/arch/evbppc/evbppc/evbppc_machdep.c
diff -u src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.9 src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.10
--- src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.9	Sat Nov  7 07:27:43 2009
+++ src/sys/arch/evbppc/evbppc/evbppc_machdep.c	Sun Jun 12 03:42:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evbppc_machdep.c,v 1.9 2009/11/07 07:27:43 cegger Exp $	*/
+/*	$NetBSD: evbppc_machdep.c,v 1.10 2011/06/12 03:42:41 mrg Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evbppc_machdep.c,v 1.9 2009/11/07 07:27:43 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: evbppc_machdep.c,v 1.10 2011/06/12 03:42:41 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -80,6 +80,12 @@
 #include machine/bus.h
 #include machine/pmap.h
 
+/*
+ * ibm4xx/booke kernels need to set module_machine to this for modules to work.
+ */
+char module_machine_ibm4xx[] = powerpc-ibm4xx;
+char module_machine_booke[] = powerpc-booke;
+
 int fake_mapiodev = 1;
 
 /*

Index: src/sys/arch/evbppc/explora/machdep.c
diff -u src/sys/arch/evbppc/explora/machdep.c:1.32 src/sys/arch/evbppc/explora/machdep.c:1.33
--- src/sys/arch/evbppc/explora/machdep.c:1.32	Fri Jan 14 02:06:25 2011
+++ src/sys/arch/evbppc/explora/machdep.c	Sun Jun 12 03:42:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.32 2011/01/14 02:06:25 rmind Exp $	*/
+/*	$NetBSD: machdep.c,v 1.33 2011/06/12 03:42:41 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.32 2011/01/14 02:06:25 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.33 2011/06/12 03:42:41 mrg Exp $);
 
 #include opt_explora.h
 #include opt_modular.h
@@ -46,6 +46,7 @@
 #include sys/reboot.h
 #include sys/ksyms.h
 #include sys/device.h
+#include sys/module.h
 
 #include uvm/uvm_extern.h
 
@@ -344,6 +345,11 @@
 	prop_object_release(pn);
 
 	intr_init();
+	
+	/*
+	 * Look for the ibm4xx modules in the right place.
+	 */
+	module_machine = module_machine_ibm4xx;
 }
 
 int

Index: src/sys/arch/evbppc/include/cpu.h
diff -u src/sys/arch/evbppc/include/cpu.h:1.4 src/sys/arch/evbppc/include/cpu.h:1.5
--- src/sys/arch/evbppc/include/cpu.h:1.4	Sun Dec 11 12:17:12 2005
+++ src/sys/arch/evbppc/include/cpu.h	Sun Jun 12 03:42:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.4 2005/12/11 12:17:12 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.5 2011/06/12 03:42:41 mrg Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -57,4 +57,7 @@
 #include powerpc/cpu.h
 #endif
 
+extern char module_machine_booke[];
+extern char module_machine_ibm4xx[];
+
 #endif	/* _MACHINE_CPU_H_ */

Index: src/sys/arch/evbppc/mpc85xx/machdep.c
diff -u src/sys/arch/evbppc/mpc85xx/machdep.c:1.7 src/sys/arch/evbppc/mpc85xx/machdep.c:1.8
--- src/sys/arch/evbppc/mpc85xx/machdep.c:1.7	Sun Jun  5 16:52:23 2011
+++ src/sys/arch/evbppc/mpc85xx/machdep.c	Sun Jun 12 03:42:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.7 2011/06/05 16:52:23 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.8 2011/06/12 03:42:41 mrg Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,6 +60,7 @@
 #include sys/bus.h
 #include sys/extent.h
 #include sys/malloc.h
+#include sys/module.h
 
 #include uvm/uvm_extern.h
 
@@ -927,6 +928,11 @@
 #endif
 
 		printf( initppc done!\n);
+
+	/*
+	 * Look for the Book-E modules in the right place.
+	 */
+	module_machine = module_machine_booke;
 }
 
 #ifdef MPC8548

Index: src/sys/arch/evbppc/obs405/obs200_machdep.c
diff -u 

CVS commit: src/doc

2011-06-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 12 03:50:42 UTC 2011

Modified Files:
src/doc: BRANCHES CHANGES

Log Message:
Note rmind-uvmplock branch merge.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/doc/BRANCHES
cvs rdiff -u -r1.1555 -r1.1556 src/doc/CHANGES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.308 src/doc/BRANCHES:1.309
--- src/doc/BRANCHES:1.308	Thu Jun  2 22:15:22 2011
+++ src/doc/BRANCHES	Sun Jun 12 03:50:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.308 2011/06/02 22:15:22 cherry Exp $
+#	$NetBSD: BRANCHES,v 1.309 2011/06/12 03:50:42 rmind Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -495,29 +495,6 @@
 		allowing multiple conflicting packages and versions to co-exist
 		within the same tree
 
-Branch:		rmind-uvmplock
-Description:	Reorganize locking in UVM and improve x86 pmap(9)
-Status:		Active
-Start Date:	15 March 2010
-End Date:	
-Base Tag:	rmind-uvmplock-base
-Maintainer:	Mindaugas Rasiukevicius rm...@netbsd.org
-Scope:		Kernel
-Notes:		Goals:
-
-		- Reorganize locking in UVM and serialize pmap(9) operations
-		  on same page(s).  New lock order: [vmpage-lock] - pmap-lock.
-		  Based on the patch from ad@.
-		- Simplify locking in pmap(9) modules by removing P-V locking.
-		- Use mutex_obj(9) on vmobjlock (and thus vnode_t::v_interlock)
-		  to share locks among UVM objects where necessary.
-		- Rewrite and optimize x86 TLB shootdown code.
-		- Unify /dev/mem et al in MI code and provide required locking.
-
-		Future work:
-
-		- Optimize pmap_remove() with tracking in struct vm_map_entry.
-
 Branch:		rpaulo-netinet-merge-pcb
 Description:	merge in6pcb with inpcb
 Status:		Dormant
@@ -1079,6 +1056,29 @@
 Notes:		Only the first item in the description was finished
 		in this branch.
 
+Branch:		rmind-uvmplock
+Description:	Reorganize locking in UVM and improve x86 pmap(9)
+Status:		Terminated; merged to -current
+Start Date:	15 March 2010
+End Date:	12 June 2011
+Base Tag:	rmind-uvmplock-base
+Maintainer:	Mindaugas Rasiukevicius rm...@netbsd.org
+Scope:		Kernel
+Notes:		Goals:
+
+		- Reorganize locking in UVM and serialize pmap(9) operations
+		  on same page(s).  New lock order: [vmpage-lock] - pmap-lock.
+		  Based on the patch from ad@.
+		- Simplify locking in pmap(9) modules by removing P-V locking.
+		- Use mutex_obj(9) on vmobjlock (and thus vnode_t::v_interlock)
+		  to share locks among UVM objects where necessary.
+		- Rewrite and optimize x86 TLB shootdown code.
+		- Unify /dev/mem et al in MI code and provide required locking.
+
+		Future work:
+
+		- Optimize pmap_remove() with tracking in struct vm_map_entry.
+
 Branch:		sommerfeld_i386mp_1
 Description:	Multiprocessor support for i386 using Intel MP BIOS.
 Status:		Terminated; merged to -current

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1555 src/doc/CHANGES:1.1556
--- src/doc/CHANGES:1.1555	Sun Jun 12 01:45:00 2011
+++ src/doc/CHANGES	Sun Jun 12 03:50:42 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1555 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1556 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1021,3 +1021,4 @@
 		after exec(3). [alnsn 20110601]
 	alpha: Converted Alpha to use PCU to manage FPU. [matt 20110607]
 	sparc: enable options MODULAR in the GENERIC* kernels.  [mrg 20110611]
+	kernel: Merge of the rmind-uvmplock branch. [rmind 20110612]



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 03:52:13 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: ebus.c ebus_emips.c

Log Message:
- ANSIfy, KNF, remove __P()
- use device_t and cfdata_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/ebus.c \
src/sys/arch/emips/ebus/ebus_emips.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/emips/ebus/ebus.c
diff -u src/sys/arch/emips/ebus/ebus.c:1.1 src/sys/arch/emips/ebus/ebus.c:1.2
--- src/sys/arch/emips/ebus/ebus.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/ebus.c	Sun Jun 12 03:52:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: ebus.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: ebus.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -44,13 +44,11 @@
 #include locators.h
 
 void
-ebusattach(parent, self, aux)
-	struct device *parent, *self;
-	void *aux;
+ebusattach(device_t parent, device_t self, void *aux)
 {
 	struct ebus_dev_attach_args *ida = aux;
 	struct ebus_attach_args *ia;
-void *addr;
+	void *addr;
 	int i;
 	int locs[EBUSCF_NLOCS];
 
@@ -65,38 +63,38 @@
 		ia = ida-ida_devs[i];
 
 #if 0 // DEBUG
-printf(PROBING %s %d@%x i=%d\n, ia-ia_name, ia-ia_basz, ia-ia_paddr, ia-ia_cookie);
+		printf(PROBING %s %d@%x i=%d\n,
+		ia-ia_name, ia-ia_basz, ia-ia_paddr, ia-ia_cookie);
 #endif
 		if (ia-ia_basz != 0) {
-addr = (void *) mips_map_physmem(ia-ia_paddr, ia-ia_basz);
-if (addr == NULL){
-printf(Failed to map %s: phys %x size %d\n,
-   ia-ia_name, ia-ia_paddr, ia-ia_basz);
-continue;
-}
-ia-ia_vaddr = addr;
+			addr = (void *)mips_map_physmem(ia-ia_paddr,
+			ia-ia_basz);
+			if (addr == NULL) {
+printf(Failed to map %s: phys %x size %d\n,
+ia-ia_name, ia-ia_paddr, ia-ia_basz);
+continue;
+			}
+			ia-ia_vaddr = addr;
 #if 0 // DEBUG
-printf(MAPPED at %p\n, ia-ia_vaddr);
+			printf(MAPPED at %p\n, ia-ia_vaddr);
 #endif
-}
-
+		}
 
 		locs[EBUSCF_ADDR] = ia-ia_paddr;
 
 		if (NULL == config_found_sm_loc(self, ebus, locs, ia,
-ebusprint, config_stdsubmatch)) {
-/* do we need to say anything? */
-if (ia-ia_basz != 0) {
-mips_unmap_physmem((vaddr_t)ia-ia_vaddr, ia-ia_basz);
-}
-}
+		ebusprint, config_stdsubmatch)) {
+			/* do we need to say anything? */
+			if (ia-ia_basz != 0) {
+mips_unmap_physmem((vaddr_t)ia-ia_vaddr,
+ia-ia_basz);
+			}
+		}
 	}
 }
 
 int
-ebusprint(aux, pnp)
-	void *aux;
-	const char *pnp;
+ebusprint(void *aux, const char *pnp)
 {
 	struct ebus_attach_args *ia = aux;
 
@@ -105,16 +103,13 @@
 
 	aprint_normal( addr 0x%x, ia-ia_paddr);
 
-	return (UNCONF);
+	return UNCONF;
 }
 
 void
-ebus_intr_establish(dev, cookie, level, handler, arg)
-	struct device *dev;
-	void *cookie;
-	int level;
-	int (*handler) (void *, void *);
-	void *arg;
+ebus_intr_establish(device_t dev, void *cookie, int level,
+int (*handler)(void *, void *), void *arg)
 {
+
 	(*platform.intr_establish)(dev, cookie, level, handler, arg);
 }
Index: src/sys/arch/emips/ebus/ebus_emips.c
diff -u src/sys/arch/emips/ebus/ebus_emips.c:1.1 src/sys/arch/emips/ebus/ebus_emips.c:1.2
--- src/sys/arch/emips/ebus/ebus_emips.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/ebus_emips.c	Sun Jun 12 03:52:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebus_emips.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: ebus_emips.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $);
 
 #include opt_xilinx_ml40x.h
 #include opt_xs_bee3.h
@@ -48,8 +48,8 @@
 #include machine/emipsreg.h
 #include emips/emips/emipstype.h
 
-static int	ebus_emips_match __P((struct device *, struct cfdata *, void *));
-static void	ebus_emips_attach __P((struct device *, struct device *, void *));
+static int	ebus_emips_match(device_t, cfdata_t, void *);
+static void	ebus_emips_attach(device_t, device_t, void *);
 
 CFATTACH_DECL(ebus_emips, sizeof(struct ebus_softc),
 ebus_emips_match, ebus_emips_attach, NULL, NULL);
@@ -57,18 +57,18 @@
 #if defined(XILINX_ML40x) || defined(XS_BEE3)
 struct ebus_attach_args 

CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 03:57:09 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: ebusvar.h

Log Message:
- KNF, remove arg names in prototype decls
- use device_t and cfdata_t
- use uint32_t rather than u_int32_t (XXX should be paddr_t here?)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/ebusvar.h

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

Modified files:

Index: src/sys/arch/emips/ebus/ebusvar.h
diff -u src/sys/arch/emips/ebus/ebusvar.h:1.1 src/sys/arch/emips/ebus/ebusvar.h:1.2
--- src/sys/arch/emips/ebus/ebusvar.h:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/ebusvar.h	Sun Jun 12 03:57:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebusvar.h,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: ebusvar.h,v 1.2 2011/06/12 03:57:09 tsutsui Exp $	*/
 
 #ifndef _EMIPS_EBUS_EBUSVAR_H_
 #define _EMIPS_EBUS_EBUSVAR_H_
@@ -26,16 +26,17 @@
  * Arguments used to attach devices to an ebus
  */
 struct ebus_attach_args {
-	const char *ia_name; /* device name */
-	int	ia_cookie;   /* device cookie */
-	u_int32_t   ia_paddr;/* device address (PHYSICAL) */
-void   *ia_vaddr;/* device address (VIRTUAL) */
-	int	ia_basz; /* device size (for min regset at probe, else 0) */
+	const char *ia_name;	/* device name */
+	int ia_cookie;		/* device cookie */
+	uint32_t ia_paddr;	/* device address (PHYSICAL) */
+	void *ia_vaddr;		/* device address (VIRTUAL) */
+	int ia_basz;		/* device size
+   (for min regset at probe, else 0) */
 };
 
-void	ebusattach (struct device *, struct device *, void *);
-int	ebusprint (void *, const char *);
-void	ebus_intr_establish (struct device *, void * cookie, int level,
-	int (*handler)(void *, void *), void *arg);
+void	ebusattach(device_t , device_t , void *);
+int	ebusprint(void *, const char *);
+void	ebus_intr_establish(device_t , void *, int,
+	int (*)(void *, void *), void *);
 
 #endif	/* !_EMIPS_EBUS_EBUSVAR_H_ */



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:00:33 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: ebus_emips.c ebusvar.h

Log Message:
Remove unused ebus_softc and use CFATTACH_DECL_NEW().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/ebus_emips.c \
src/sys/arch/emips/ebus/ebusvar.h

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

Modified files:

Index: src/sys/arch/emips/ebus/ebus_emips.c
diff -u src/sys/arch/emips/ebus/ebus_emips.c:1.2 src/sys/arch/emips/ebus/ebus_emips.c:1.3
--- src/sys/arch/emips/ebus/ebus_emips.c:1.2	Sun Jun 12 03:52:13 2011
+++ src/sys/arch/emips/ebus/ebus_emips.c	Sun Jun 12 04:00:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $	*/
+/*	$NetBSD: ebus_emips.c,v 1.3 2011/06/12 04:00:33 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: ebus_emips.c,v 1.3 2011/06/12 04:00:33 tsutsui Exp $);
 
 #include opt_xilinx_ml40x.h
 #include opt_xs_bee3.h
@@ -51,7 +51,7 @@
 static int	ebus_emips_match(device_t, cfdata_t, void *);
 static void	ebus_emips_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(ebus_emips, sizeof(struct ebus_softc),
+CFATTACH_DECL_NEW(ebus_emips, 0,
 ebus_emips_match, ebus_emips_attach, NULL, NULL);
 
 #if defined(XILINX_ML40x) || defined(XS_BEE3)
Index: src/sys/arch/emips/ebus/ebusvar.h
diff -u src/sys/arch/emips/ebus/ebusvar.h:1.2 src/sys/arch/emips/ebus/ebusvar.h:1.3
--- src/sys/arch/emips/ebus/ebusvar.h:1.2	Sun Jun 12 03:57:09 2011
+++ src/sys/arch/emips/ebus/ebusvar.h	Sun Jun 12 04:00:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebusvar.h,v 1.2 2011/06/12 03:57:09 tsutsui Exp $	*/
+/*	$NetBSD: ebusvar.h,v 1.3 2011/06/12 04:00:33 tsutsui Exp $	*/
 
 #ifndef _EMIPS_EBUS_EBUSVAR_H_
 #define _EMIPS_EBUS_EBUSVAR_H_
@@ -7,10 +7,6 @@
 
 struct ebus_attach_args;
 
-struct ebus_softc {
-	struct device	sc_dev;
-};
-
 /*
  * Arguments used to attach an ebus device to its parent
  */



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:17:30 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: clock_ebus.c

Log Message:
- misc KNF
- use device_t and cfdata_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c
diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.1 src/sys/arch/emips/ebus/clock_ebus.c:1.2
--- src/sys/arch/emips/ebus/clock_ebus.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/clock_ebus.c	Sun Jun 12 04:17:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -51,62 +51,67 @@
 struct eclock_softc {
 	struct device sc_dev;
 	struct _Tc *sc_dp;
-uint32_t reload;
-struct timecounter sc_tc;
+	uint32_t reload;
+	struct timecounter sc_tc;
 #ifdef __HAVE_GENERIC_TODR
-struct todr_chip_handle sc_todr;
+	struct todr_chip_handle sc_todr;
 #endif
 };
 
-static int	eclock_ebus_match (struct device *, struct cfdata *, void *);
-static void	eclock_ebus_attach (struct device *, struct device *, void *);
+static int	eclock_ebus_match(device_t, cfdata_t, void *);
+static void	eclock_ebus_attach(device_t, device_t, void *);
 
 CFATTACH_DECL(eclock_ebus, sizeof (struct eclock_softc),
 eclock_ebus_match, eclock_ebus_attach, NULL, NULL);
 
-   void	eclock_init(struct device *);
-static void	__eclock_init(struct device *);
-static int	eclock_gettime(struct todr_chip_handle *,
-   struct timeval *);
-static int	eclock_settime(struct todr_chip_handle *,
-   struct timeval *);
-static int  eclock_ebus_intr(void *cookie, void *f);
-static u_int eclock_counter(struct timecounter *tc);
+void	eclock_init(device_t);
 
-struct device *clockdev = NULL; /* BUGBUG resolve the gap between cpu_initclocks() and eclock_init(x) */
+static void	__eclock_init(device_t);
+static int	eclock_gettime(struct todr_chip_handle *, struct timeval *);
+static int	eclock_settime(struct todr_chip_handle *, struct timeval *);
+static int	eclock_ebus_intr(void *, void *);
+static u_int	eclock_counter(struct timecounter *);
+
+/* BUGBUG resolve the gap between cpu_initclocks() and eclock_init(x) */
+device_t clockdev = NULL;
 
 void
-eclock_init(struct device *dev)
+eclock_init(device_t dev)
 {
-if (dev == NULL)
-dev = clockdev;
-if (dev == NULL)
-panic(eclock_init);
-__eclock_init(dev);
+
+	if (dev == NULL)
+		dev = clockdev;
+	if (dev == NULL)
+		panic(eclock_init);
+	__eclock_init(dev);
 }
 
 static void
-__eclock_init(struct device *dev)
+__eclock_init(device_t dev)
 {
 	struct eclock_softc *sc = (struct eclock_softc *)dev;
-struct _Tc *tc = sc-sc_dp;
-uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */
+	struct _Tc *tc = sc-sc_dp;
+	uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */
 
-/* Compute reload according to whatever value passed in, Warn if fractional */
-if (hz  1) {
-uint32_t r = reload / hz;
-if ((r * hz) != reload)
-printf(%s: %d Hz clock will cause roundoffs with 10MHz xtal (%d)\n,
-   sc-sc_dev.dv_xname, hz, reload - (r * hz));
+	/*
+	 * Compute reload according to whatever value passed in,
+	 * Warn if fractional
+	 */
+	if (hz  1) {
+		uint32_t r = reload / hz;
+		if ((r * hz) != reload)
+			printf(%s: %d Hz clock will cause roundoffs
+			 with 10MHz xtal (%d)\n,
+			sc-sc_dev.dv_xname, hz, reload - (r * hz));
 		reload = r;
 	}
 
-sc-reload = reload;
+	sc-reload = reload;
 
-/* Start the counter */
-tc-DownCounterHigh = 0;
-tc-DownCounter = sc-reload;
-tc-Control = TCCT_ENABLE | TCCT_INT_ENABLE;
+	/* Start the counter */
+	tc-DownCounterHigh = 0;
+	tc-DownCounter = sc-reload;
+	tc-Control = TCCT_ENABLE | TCCT_INT_ENABLE;
 }
 
 /*
@@ -120,48 +125,61 @@
 static int
 eclock_gettime(struct todr_chip_handle *todr, struct timeval *tv)
 {
-	struct eclock_softc *sc = (struct eclock_softc *) todr-cookie;
-struct _Tc *tc = sc-sc_dp;
-uint64_t free;
-int s;
-
-/* 32bit processor, guard against interrupts in the middle of reading this 64bit entity
- * BUGBUG Should read it twice to guard against rollover too.
- */
+	struct eclock_softc *sc = todr-cookie;
+	struct _Tc *tc = sc-sc_dp;
+	uint64_t free;
+	int s;
+
+	/*
+	 * 32bit processor, guard against interrupts in the middle 

CVS commit: src/sys/arch/evbppc

2011-06-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 12 04:20:18 UTC 2011

Modified Files:
src/sys/arch/evbppc/evbppc: evbppc_machdep.c
src/sys/arch/evbppc/mpc85xx: machdep.c

Log Message:
move module_machine_booke into the booke machdep.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbppc/evbppc/evbppc_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbppc/mpc85xx/machdep.c

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

Modified files:

Index: src/sys/arch/evbppc/evbppc/evbppc_machdep.c
diff -u src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.10 src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.11
--- src/sys/arch/evbppc/evbppc/evbppc_machdep.c:1.10	Sun Jun 12 03:42:41 2011
+++ src/sys/arch/evbppc/evbppc/evbppc_machdep.c	Sun Jun 12 04:20:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evbppc_machdep.c,v 1.10 2011/06/12 03:42:41 mrg Exp $	*/
+/*	$NetBSD: evbppc_machdep.c,v 1.11 2011/06/12 04:20:18 mrg Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evbppc_machdep.c,v 1.10 2011/06/12 03:42:41 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: evbppc_machdep.c,v 1.11 2011/06/12 04:20:18 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -81,10 +81,9 @@
 #include machine/pmap.h
 
 /*
- * ibm4xx/booke kernels need to set module_machine to this for modules to work.
+ * ibm4xx kernels need to set module_machine to this for modules to work.
  */
 char module_machine_ibm4xx[] = powerpc-ibm4xx;
-char module_machine_booke[] = powerpc-booke;
 
 int fake_mapiodev = 1;
 

Index: src/sys/arch/evbppc/mpc85xx/machdep.c
diff -u src/sys/arch/evbppc/mpc85xx/machdep.c:1.8 src/sys/arch/evbppc/mpc85xx/machdep.c:1.9
--- src/sys/arch/evbppc/mpc85xx/machdep.c:1.8	Sun Jun 12 03:42:41 2011
+++ src/sys/arch/evbppc/mpc85xx/machdep.c	Sun Jun 12 04:20:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.8 2011/06/12 03:42:41 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.9 2011/06/12 04:20:18 mrg Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -93,6 +93,11 @@
 #include evbppc/mpc85xx/pixisreg.h
 #endif
 
+/*
+ * booke kernels need to set module_machine to this for modules to work.
+ */
+char module_machine_booke[] = powerpc-booke;
+
 void	initppc(vaddr_t, vaddr_t);
 
 #define	MEMREGIONS	4



CVS commit: src/sys/arch/emips

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:22:18 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: clock_ebus.c
src/sys/arch/emips/include: types.h

Log Message:
Remove __HAVE_GENERIC_TODR, which has been mandatory since 2008.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/clock_ebus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/include/types.h

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

Modified files:

Index: src/sys/arch/emips/ebus/clock_ebus.c
diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.2 src/sys/arch/emips/ebus/clock_ebus.c:1.3
--- src/sys/arch/emips/ebus/clock_ebus.c:1.2	Sun Jun 12 04:17:30 2011
+++ src/sys/arch/emips/ebus/clock_ebus.c	Sun Jun 12 04:22:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $	*/
+/*	$NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -53,9 +53,7 @@
 	struct _Tc *sc_dp;
 	uint32_t reload;
 	struct timecounter sc_tc;
-#ifdef __HAVE_GENERIC_TODR
 	struct todr_chip_handle sc_todr;
-#endif
 };
 
 static int	eclock_ebus_match(device_t, cfdata_t, void *);
@@ -333,14 +331,12 @@
 	sc-sc_dev-dv_xname, intr);
 #endif
 
-#ifdef __HAVE_GENERIC_TODR
 	clockdev = self;
 	memset(sc-sc_todr,0,sizeof sc-sc_todr);
 	sc-sc_todr.cookie = sc;
 	sc-sc_todr.todr_gettime = eclock_gettime;
 	sc-sc_todr.todr_settime = eclock_settime;
 	todr_attach(sc-sc_todr);
-#endif
 
 	tc_init(sc-sc_tc);
 }

Index: src/sys/arch/emips/include/types.h
diff -u src/sys/arch/emips/include/types.h:1.1 src/sys/arch/emips/include/types.h:1.2
--- src/sys/arch/emips/include/types.h:1.1	Wed Jan 26 01:18:52 2011
+++ src/sys/arch/emips/include/types.h	Sun Jun 12 04:22:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.1 2011/01/26 01:18:52 pooka Exp $	*/
+/*	$NetBSD: types.h,v 1.2 2011/06/12 04:22:18 tsutsui Exp $	*/
 
 #include mips/types.h
 
@@ -6,8 +6,6 @@
 #define	__HAVE_GENERIC_SOFT_INTERRUPTS
 /* We'll use the FreeRunning counter everywhere */
 #define __HAVE_TIMECOUNTER
-/* ..and that's good enough for a 58k year TODR as well */
-#define __HAVE_GENERIC_TODR
 
 /* MIPS specific options */
 #define	__HAVE_BOOTINFO_H



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:33:30 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: clock_ebus.c

Log Message:
- don't truncate tv_sec to uint32_t in eclock_settime()
  (I guess this has no longer been critical since timecounter(9) support)
- add prefix to reload member in softc


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c
diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.3 src/sys/arch/emips/ebus/clock_ebus.c:1.4
--- src/sys/arch/emips/ebus/clock_ebus.c:1.3	Sun Jun 12 04:22:18 2011
+++ src/sys/arch/emips/ebus/clock_ebus.c	Sun Jun 12 04:33:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $	*/
+/*	$NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -51,7 +51,7 @@
 struct eclock_softc {
 	struct device sc_dev;
 	struct _Tc *sc_dp;
-	uint32_t reload;
+	uint32_t sc_reload;
 	struct timecounter sc_tc;
 	struct todr_chip_handle sc_todr;
 };
@@ -89,7 +89,7 @@
 {
 	struct eclock_softc *sc = (struct eclock_softc *)dev;
 	struct _Tc *tc = sc-sc_dp;
-	uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */
+	uint32_t reload = 10 * 100; /* 1sec in 100ns units (10MHz clock) */
 
 	/*
 	 * Compute reload according to whatever value passed in,
@@ -104,11 +104,11 @@
 		reload = r;
 	}
 
-	sc-reload = reload;
+	sc-sc_reload = reload;
 
 	/* Start the counter */
 	tc-DownCounterHigh = 0;
-	tc-DownCounter = sc-reload;
+	tc-DownCounter = sc-sc_reload;
 	tc-Control = TCCT_ENABLE | TCCT_INT_ENABLE;
 }
 
@@ -188,18 +188,18 @@
 {
 	struct eclock_softc *sc = todr-cookie;
 	struct _Tc *tc = sc-sc_dp;
-	uint64_t free;
-	uint32_t su, uu;
+	uint64_t free, su;
+	uint32_t uu;
 	int s;
 
 	/* Careful with what we do here, else the compilerbugs hit hard */
 	s = splhigh();
 
-	su = (uint32_t)tv-tv_sec;	/* 0(tv) */
-	uu = (uint32_t)tv-tv_usec;	/* 4(tv) */
+	su = (uint64_t)tv-tv_sec;	/* 0(tv) */
+	uu = (uint32_t)tv-tv_usec;	/* 8(tv) */
 
 
-	free  = 10 * 1000 * 1000 * (uint64_t)su;
+	free  = su * 10 * 1000 * 1000;
 	free += uu * 10;
 
 	tc-FreeRunning = free;
@@ -264,7 +264,7 @@
 
 	x = tc-Control;
 	tc-DownCounterHigh = 0;
-	tc-DownCounter = sc-reload;
+	tc-DownCounter = sc-sc_reload;
 
 	hardclock(cf);
 	emips_clock_evcnt.ev_count++;



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:40:44 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: clock_ebus.c

Log Message:
More KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c
diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.4 src/sys/arch/emips/ebus/clock_ebus.c:1.5
--- src/sys/arch/emips/ebus/clock_ebus.c:1.4	Sun Jun 12 04:33:29 2011
+++ src/sys/arch/emips/ebus/clock_ebus.c	Sun Jun 12 04:40:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $	*/
+/*	$NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -309,7 +309,7 @@
 	sc-sc_tc.tc_get_timecount = eclock_counter;
 	sc-sc_tc.tc_poll_pps = 0;
 	sc-sc_tc.tc_counter_mask = 0x;
-	sc-sc_tc.tc_frequency = 10*1000*1000; /* 10 MHz */
+	sc-sc_tc.tc_frequency = 10 * 1000 * 1000; /* 10 MHz */
 	sc-sc_tc.tc_name = eclock; /* BUGBUG is it unique per instance?? */
 	sc-sc_tc.tc_quality = 2000; /* uhu? */
 	sc-sc_tc.tc_priv = sc;
@@ -332,7 +332,7 @@
 #endif
 
 	clockdev = self;
-	memset(sc-sc_todr,0,sizeof sc-sc_todr);
+	memset(sc-sc_todr, 0, sizeof sc-sc_todr);
 	sc-sc_todr.cookie = sc;
 	sc-sc_todr.todr_gettime = eclock_gettime;
 	sc-sc_todr.todr_settime = eclock_settime;



CVS commit: src/external/cddl/osnet/sys/sys

2011-06-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun 12 04:43:11 UTC 2011

Modified Files:
src/external/cddl/osnet/sys/sys: vnode.h

Log Message:
v_interlock is now a pointer to kmutex_t, use it as one.
fixes many of the 5.99.53 build issues in zfs, but not all of them.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/sys/sys/vnode.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/vnode.h
diff -u src/external/cddl/osnet/sys/sys/vnode.h:1.8 src/external/cddl/osnet/sys/sys/vnode.h:1.9
--- src/external/cddl/osnet/sys/sys/vnode.h:1.8	Fri Jan 21 12:24:24 2011
+++ src/external/cddl/osnet/sys/sys/vnode.h	Sun Jun 12 04:43:11 2011
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: vnode.h,v 1.8 2011/01/21 12:24:24 pooka Exp $	*/
+/*	$NetBSD: vnode.h,v 1.9 2011/06/12 04:43:11 mrg Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -298,8 +298,8 @@
 #define	VN_URELE(v)	vput(v)
 #define	VN_SET_VFS_TYPE_DEV(vp, vfs, type, flag)	(0)
 
-#define VI_LOCK(vp) mutex_enter((vp)-v_interlock)
-#define VI_UNLOCK(vp)   mutex_exit((vp)-v_interlock)
+#define VI_LOCK(vp) mutex_enter((vp)-v_interlock)
+#define VI_UNLOCK(vp)   mutex_exit((vp)-v_interlock)
 
 #define	VOP_REALVP(vp, vpp, ct)	(*(vpp) = (vp), 0)
 
@@ -654,7 +654,7 @@
 		nbflag |= PGO_CLEANIT;
 	}
 
-	mutex_enter(vp-v_interlock);
+	mutex_enter(vp-v_interlock);
 	return VOP_PUTPAGES(vp, off, len, nbflag);
 }
 #define	VOP_PUTPAGE(vp, off, len, flag, cr, ct)	zfs_vop_putpage((vp), (off), (len), (flag))



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 04:44:27 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: clock_ebus.c

Log Message:
Split device_t/softc.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c
diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.5 src/sys/arch/emips/ebus/clock_ebus.c:1.6
--- src/sys/arch/emips/ebus/clock_ebus.c:1.5	Sun Jun 12 04:40:44 2011
+++ src/sys/arch/emips/ebus/clock_ebus.c	Sun Jun 12 04:44:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $	*/
+/*	$NetBSD: clock_ebus.c,v 1.6 2011/06/12 04:44:27 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock_ebus.c,v 1.6 2011/06/12 04:44:27 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -49,7 +49,7 @@
  * Device softc
  */
 struct eclock_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	struct _Tc *sc_dp;
 	uint32_t sc_reload;
 	struct timecounter sc_tc;
@@ -59,7 +59,7 @@
 static int	eclock_ebus_match(device_t, cfdata_t, void *);
 static void	eclock_ebus_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(eclock_ebus, sizeof (struct eclock_softc),
+CFATTACH_DECL_NEW(eclock_ebus, sizeof (struct eclock_softc),
 eclock_ebus_match, eclock_ebus_attach, NULL, NULL);
 
 void	eclock_init(device_t);
@@ -87,7 +87,7 @@
 static void
 __eclock_init(device_t dev)
 {
-	struct eclock_softc *sc = (struct eclock_softc *)dev;
+	struct eclock_softc *sc = device_private(dev);
 	struct _Tc *tc = sc-sc_dp;
 	uint32_t reload = 10 * 100; /* 1sec in 100ns units (10MHz clock) */
 
@@ -100,7 +100,7 @@
 		if ((r * hz) != reload)
 			printf(%s: %d Hz clock will cause roundoffs
 			 with 10MHz xtal (%d)\n,
-			sc-sc_dev.dv_xname, hz, reload - (r * hz));
+			device_xname(sc-sc_dev), hz, reload - (r * hz));
 		reload = r;
 	}
 
@@ -300,9 +300,10 @@
 static void
 eclock_ebus_attach(device_t parent, device_t self, void *aux)
 {
+	struct eclock_softc *sc = device_private(self);
 	struct ebus_attach_args *ia = aux;
-	struct eclock_softc *sc = (struct eclock_softc *)self;
 
+	sc-sc_dev = self;
 	sc-sc_dp = (struct _Tc *)ia-ia_vaddr;
 
 	/* NB: We are chopping our 64bit free-running down to 32bits */
@@ -328,7 +329,7 @@
 
 #ifdef EVCNT_COUNTERS
 	evcnt_attach_dynamic(clock_intr_evcnt, EVCNT_TYPE_INTR, NULL,
-	sc-sc_dev-dv_xname, intr);
+	device_xname(self), intr);
 #endif
 
 	clockdev = self;



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:06:23 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: dz_ebus.c

Log Message:
Misc KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c
diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.2 src/sys/arch/emips/ebus/dz_ebus.c:1.3
--- src/sys/arch/emips/ebus/dz_ebus.c:1.2	Sun Apr 24 16:26:55 2011
+++ src/sys/arch/emips/ebus/dz_ebus.c	Sun Jun 12 05:06:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $	*/
+/*	$NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $);
 
 #include opt_ddb.h
 
@@ -58,13 +58,15 @@
 
 #include emips/ebus/ebusvar.h
 #include emips/emips/cons.h
-//#include emips/emips/machdep.h
+#if 0
+#include emips/emips/machdep.h
+#endif
 
 #include ioconf.h /* for dz_cd */
 
-#define DZ_C2I(c)	((c)3)	/* convert controller # to index */
-#define DZ_I2C(c)	((c)3)	/* convert minor to controller # */
-#define DZ_PORT(u)	((u)07)	/* extract the port # */
+#define DZ_C2I(c)	((c)  3)	/* convert controller # to index */
+#define DZ_I2C(c)	((c)  3)	/* convert minor to controller # */
+#define DZ_PORT(u)	((u)  07)	/* extract the port # */
 
 struct	dz_softc {
 	struct	device	sc_dev;		/* Autoconf blaha */
@@ -80,7 +82,7 @@
 	struct dz_linestate {
 		struct	dz_softc *dz_sc;	/* backpointer to softc */
 		int		dz_line;	/* channel number */
-		struct	tty *	dz_tty;		/* what we work on */
+		struct	tty	*dz_tty;	/* what we work on */
 	} sc_dz;
 };
 
@@ -118,7 +120,7 @@
 {
 	struct tty *tp;
 	int unit, line;
-	struct	dz_softc *sc;
+	struct dz_softc *sc;
 	int s, error = 0;
 
 	unit = DZ_I2C(minor(dev));
@@ -133,10 +135,10 @@
 
 	tp = sc-sc_dz.dz_tty;
 	if (tp == NULL)
-		return (ENODEV);
-	tp-t_oproc   = dzstart;
-	tp-t_param   = dzparam;
-	tp-t_dev = dev;
+		return ENODEV;
+	tp-t_oproc = dzstart;
+	tp-t_param = dzparam;
+	tp-t_dev   = dev;
 
 	if (kauth_authorize_device_tty(l-l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
@@ -150,34 +152,34 @@
 			tp-t_lflag = TTYDEF_LFLAG;
 			tp-t_ispeed = tp-t_ospeed = TTYDEF_SPEED;
 		}
-		(void) dzparam(tp, tp-t_termios);
+		(void)dzparam(tp, tp-t_termios);
 		ttsetwater(tp);
 	}
-/* we have no modem control but..*/
+	/* we have no modem control but..*/
 	if (dzmctl(sc, line, TIOCM_DTR, DMBIS)  TIOCM_CD)
-tp-t_state |= TS_CARR_ON;
-	s = spltty();
-	while (!(flag  O_NONBLOCK)  !(tp-t_cflag  CLOCAL) 
-	   !(tp-t_state  TS_CARR_ON)) {
-		tp-t_wopen++;
-		error = ttysleep(tp, tp-t_rawcv, true, 0);
-		tp-t_wopen--;
-		if (error)
-			break;
-	}
-	(void) splx(s);
+		tp-t_state |= TS_CARR_ON;
+		s = spltty();
+		while (!(flag  O_NONBLOCK)  !(tp-t_cflag  CLOCAL) 
+		!(tp-t_state  TS_CARR_ON)) {
+			tp-t_wopen++;
+			error = ttysleep(tp, tp-t_rawcv, true, 0);
+			tp-t_wopen--;
+			if (error)
+break;
+		}
+	(void)splx(s);
 	if (error)
-		return (error);
-	return ((*tp-t_linesw-l_open)(dev, tp));
+		return error;
+	return (*tp-t_linesw-l_open)(dev, tp);
 }
+
 int
 dzclose(dev_t dev, int flag, int mode, struct lwp *l)
 {
-	struct	dz_softc *sc;
+	struct dz_softc *sc;
 	struct tty *tp;
 	int unit, line;
 
-
 	unit = DZ_I2C(minor(dev));
 	line = DZ_PORT(minor(dev));
 	sc = (void *)dz_cd.cd_devs[unit];
@@ -187,36 +189,37 @@
 	(*tp-t_linesw-l_close)(tp, flag);
 
 	/* Make sure a BREAK state is not left enabled. */
-	(void) dzmctl(sc, line, TIOCM_BRK, DMBIC);
+	(void)dzmctl(sc, line, TIOCM_BRK, DMBIC);
 
 	/* Do a hangup if so required. */
 	if ((tp-t_cflag  HUPCL) || tp-t_wopen || !(tp-t_state  TS_ISOPEN))
 		(void) dzmctl(sc, line, 0, DMSET);
 
-	return (ttyclose(tp));
+	return ttyclose(tp);
 }
+
 int
 dzread(dev_t dev, struct uio *uio, int flag)
 {
 	struct tty *tp;
-	struct	dz_softc *sc;
+	struct dz_softc *sc;
 
 	sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
 
 	tp = sc-sc_dz.dz_tty;
-	return ((*tp-t_linesw-l_read)(tp, uio, flag));
+	return (*tp-t_linesw-l_read)(tp, uio, flag);
 }
 
 int
 dzwrite(dev_t dev, struct uio *uio, int flag)
 {
 	struct tty *tp;
-	struct	dz_softc *sc;
+	struct dz_softc *sc;
 
 	sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
 
 	tp = sc-sc_dz.dz_tty;
-	return ((*tp-t_linesw-l_write)(tp, uio, flag));
+	return (*tp-t_linesw-l_write)(tp, uio, flag);
 }
 
 /*ARGSUSED*/
@@ -235,56 +238,57 @@
 
 	error = (*tp-t_linesw-l_ioctl)(tp, cmd, data, flag, l);
 	if (error = 0)
-		return (error);
+		return error;
 
 	error = ttioctl(tp, cmd, data, flag, l);
 	if (error = 0)
-		return (error);
+		return error;
 
 	switch (cmd) {
 
 	case TIOCSBRK:
-		(void) 

CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:20:54 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: dz_ebus.c

Log Message:
Split device_t/softc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c
diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.3 src/sys/arch/emips/ebus/dz_ebus.c:1.4
--- src/sys/arch/emips/ebus/dz_ebus.c:1.3	Sun Jun 12 05:06:23 2011
+++ src/sys/arch/emips/ebus/dz_ebus.c	Sun Jun 12 05:20:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $	*/
+/*	$NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $);
 
 #include opt_ddb.h
 
@@ -69,7 +69,7 @@
 #define DZ_PORT(u)	((u)  07)	/* extract the port # */
 
 struct	dz_softc {
-	struct	device	sc_dev;		/* Autoconf blaha */
+	device_t	sc_dev;		/* Autoconf blaha */
 	struct	evcnt	sc_rintrcnt;	/* recevive interrupt counts */
 	struct	evcnt	sc_tintrcnt;	/* transmit interrupt counts */
 	struct	_Usart	*sc_dr;		/* reg pointers */
@@ -124,12 +124,11 @@
 	int s, error = 0;
 
 	unit = DZ_I2C(minor(dev));
-	line = DZ_PORT(minor(dev));
-	if (unit = dz_cd.cd_ndevs ||  dz_cd.cd_devs[unit] == NULL)
-		return (ENXIO);
-
-	sc = (void *)dz_cd.cd_devs[unit];
+	sc = device_lookup_private(dz_cd, unit);
+	if (sc == NULL)
+		return ENXIO;
 
+	line = DZ_PORT(minor(dev));
 	if (line  0) /* FIXME fo rmore than one line */
 		return ENXIO;
 
@@ -181,8 +180,8 @@
 	int unit, line;
 
 	unit = DZ_I2C(minor(dev));
+	sc = device_lookup_private(dz_cd, unit);
 	line = DZ_PORT(minor(dev));
-	sc = (void *)dz_cd.cd_devs[unit];
 
 	tp = sc-sc_dz.dz_tty;
 
@@ -204,7 +203,7 @@
 	struct tty *tp;
 	struct dz_softc *sc;
 
-	sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
+	sc = device_lookup_private(dz_cd, DZ_I2C(minor(dev)));
 
 	tp = sc-sc_dz.dz_tty;
 	return (*tp-t_linesw-l_read)(tp, uio, flag);
@@ -216,7 +215,7 @@
 	struct tty *tp;
 	struct dz_softc *sc;
 
-	sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
+	sc = device_lookup_private(dz_cd, DZ_I2C(minor(dev)));
 
 	tp = sc-sc_dz.dz_tty;
 	return (*tp-t_linesw-l_write)(tp, uio, flag);
@@ -233,7 +232,7 @@
 
 	unit = DZ_I2C(minor(dev));
 	line = 0;
-	sc = (void *)dz_cd.cd_devs[unit];
+	sc = device_lookup_private(dz_cd, unit);
 	tp = sc-sc_dz.dz_tty;
 
 	error = (*tp-t_linesw-l_ioctl)(tp, cmd, data, flag, l);
@@ -297,8 +296,11 @@
 struct tty *
 dztty(dev_t dev)
 {
-	struct dz_softc *sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
-	struct tty *tp = sc-sc_dz.dz_tty;
+	struct dz_softc *sc;
+	struct tty *tp;
+
+	sc = device_lookup_private(dz_cd, DZ_I2C(minor(dev)));
+	tp = sc-sc_dz.dz_tty;
 
 	return tp;
 }
@@ -309,7 +311,7 @@
 	struct dz_softc *sc;
 	struct tty *tp;
 
-	sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))];
+	sc = device_lookup_private(dz_cd, DZ_I2C(minor(dev)));
 
 	tp = sc-sc_dz.dz_tty;
 	return (*tp-t_linesw-l_poll)(tp, events, l);
@@ -323,7 +325,7 @@
 	int unit, s;
 
 	unit = DZ_I2C(minor(tp-t_dev));
-	sc = (void *)dz_cd.cd_devs[unit];
+	sc = device_lookup_private(dz_cd, unit);
 
 	s = spltty();
 	if (tp-t_state  (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) {
@@ -384,7 +386,7 @@
 
 	unit = DZ_I2C(minor(tp-t_dev));
 	line = DZ_PORT(minor(tp-t_dev));
-	sc = (void *)dz_cd.cd_devs[unit];
+	sc = device_lookup_private(dz_cd, unit);
 
 	/* check requested parameters */
 	if (t-c_ispeed != t-c_ospeed)
@@ -537,7 +539,7 @@
 
 	if (csr  USI_OVRE) {
 		log(LOG_WARNING, %s: silo overflow, line %d\n,
-		sc-sc_dev.dv_xname, 0);
+		device_xname(sc-sc_dev), 0);
 	}
 
 	if (csr  USI_FRAME)
@@ -604,7 +606,7 @@
 
 static int	dz_ebus_getmajor(void);
 
-CFATTACH_DECL(dz_ebus, sizeof(struct dz_softc),
+CFATTACH_DECL_NEW(dz_ebus, sizeof(struct dz_softc),
 dz_ebus_match, dz_ebus_attach, NULL, NULL);
 
 struct consdev dz_ebus_consdev = {
@@ -642,9 +644,10 @@
 	struct ebus_attach_args *iba;
 	struct dz_softc *sc;
 
+	sc = device_private(self);
 	iba = aux;
-	sc = (struct dz_softc *)self;
 
+	sc-sc_dev = self;
 	sc-sc_dr = (struct _Usart *)iba-ia_vaddr;
 #if DEBUG
 	printf( virt=%p , (void *)sc-sc_dr);
@@ -664,9 +667,9 @@
 	sc-sc_dz.dz_tty = tty_alloc();
 
 	evcnt_attach_dynamic(sc-sc_rintrcnt, EVCNT_TYPE_INTR, NULL,
-	sc-sc_dev.dv_xname, rintr);
+	device_xname(self), rintr);
 	evcnt_attach_dynamic(sc-sc_tintrcnt, EVCNT_TYPE_INTR, NULL,
-	sc-sc_dev.dv_xname, tintr);
+	device_xname(self), tintr);
 
 	/* Initialize hw regs */
 #if 0



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:22:30 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: dz_ebus.c

Log Message:
More nits.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c
diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.4 src/sys/arch/emips/ebus/dz_ebus.c:1.5
--- src/sys/arch/emips/ebus/dz_ebus.c:1.4	Sun Jun 12 05:20:54 2011
+++ src/sys/arch/emips/ebus/dz_ebus.c	Sun Jun 12 05:22:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $	*/
+/*	$NetBSD: dz_ebus.c,v 1.5 2011/06/12 05:22:30 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dz_ebus.c,v 1.5 2011/06/12 05:22:30 tsutsui Exp $);
 
 #include opt_ddb.h
 
@@ -129,7 +129,7 @@
 		return ENXIO;
 
 	line = DZ_PORT(minor(dev));
-	if (line  0) /* FIXME fo rmore than one line */
+	if (line  0) /* FIXME for more than one line */
 		return ENXIO;
 
 	tp = sc-sc_dz.dz_tty;
@@ -192,7 +192,7 @@
 
 	/* Do a hangup if so required. */
 	if ((tp-t_cflag  HUPCL) || tp-t_wopen || !(tp-t_state  TS_ISOPEN))
-		(void) dzmctl(sc, line, 0, DMSET);
+		(void)dzmctl(sc, line, 0, DMSET);
 
 	return ttyclose(tp);
 }



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:27:57 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: gpio_ebus.c

Log Message:
- misc KNF
- use device_t and cfdata_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/gpio_ebus.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/emips/ebus/gpio_ebus.c
diff -u src/sys/arch/emips/ebus/gpio_ebus.c:1.1 src/sys/arch/emips/ebus/gpio_ebus.c:1.2
--- src/sys/arch/emips/ebus/gpio_ebus.c:1.1	Wed Jan 26 01:18:50 2011
+++ src/sys/arch/emips/ebus/gpio_ebus.c	Sun Jun 12 05:27:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpio_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $	*/
+/*	$NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: gpio_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -52,11 +52,11 @@
 	struct device sc_dev;
 	struct _Pio *sc_dp;
 	struct gpio_chipset_tag	sc_gpio_gc;
-	gpio_pin_t		sc_gpio_pins[GPIO_NPINS];
+	gpio_pin_t sc_gpio_pins[GPIO_NPINS];
 };
 
-static int	epio_ebus_match (struct device *, struct cfdata *, void *);
-static void	epio_ebus_attach (struct device *, struct device *, void *);
+static int	epio_ebus_match(device_t, cfdata_t, void *);
+static void	epio_ebus_attach(device_t, device_t, void *);
 
 CFATTACH_DECL(epio, sizeof (struct epio_softc),
 epio_ebus_match, epio_ebus_attach, NULL, NULL);
@@ -66,47 +66,49 @@
 static void	epio_pin_ctl(void *, int, int);
 
 static int
-epio_ebus_match(struct device *parent, struct cfdata *match, void *aux)
+epio_ebus_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct ebus_attach_args *ia = aux;
-struct _Pio *f = (struct _Pio *)ia-ia_vaddr;
+	struct _Pio *f = (struct _Pio *)ia-ia_vaddr;
 
 	if (strcmp(gpio, ia-ia_name) != 0)
-		return (0);
-if ((f == NULL) ||
-(f-Tag != PMTTAG_GPIO))
-		return (0);
+		return 0;
+	if ((f == NULL) ||
+		(f-Tag != PMTTAG_GPIO))
+		return 0;
 
-	return (1);
+	return 1;
 }
 
 static void
-epio_ebus_attach(struct device *parent, struct device *self, void *aux)
+epio_ebus_attach(device_t parent, device_t self, void *aux)
 {
-	struct ebus_attach_args *ia =aux;
 	struct epio_softc *sc = (struct epio_softc *)self;
+	struct ebus_attach_args *ia =aux;
 	struct gpiobus_attach_args gba;
-int i;
+	int i;
 	uint32_t data;
 
-	sc-sc_dp = (struct _Pio*)ia-ia_vaddr;
+	sc-sc_dp = (struct _Pio *)ia-ia_vaddr;
 	data = sc-sc_dp-PinData;
 
 #if DEBUG
-printf( virt=%p data=%zx, (void*)sc-sc_dp, data);
+	printf( virt=%p data=%zx, (void*)sc-sc_dp, data);
 #endif
 	printf(: GPIO controller\n);
 
 	/* BUGBUG Initialize pins properly */
 	for (i = 0 ; i  GPIO_NPINS ; i++) {
 		sc-sc_gpio_pins[i].pin_num = i;
-		sc-sc_gpio_pins[i].pin_caps = GPIO_PIN_INOUT
-		| GPIO_PIN_OPENDRAIN
-		| GPIO_PIN_TRISTATE;
+		sc-sc_gpio_pins[i].pin_caps =
+		GPIO_PIN_INOUT |
+		GPIO_PIN_OPENDRAIN |
+		GPIO_PIN_TRISTATE;
 
 		/* current defaults */
 		sc-sc_gpio_pins[i].pin_flags = GPIO_PIN_INOUT;
-		sc-sc_gpio_pins[i].pin_state = (data  (1  i)) ? GPIO_PIN_HIGH : GPIO_PIN_LOW;
+		sc-sc_gpio_pins[i].pin_state =
+		(data  (1  i)) ? GPIO_PIN_HIGH : GPIO_PIN_LOW;
 		sc-sc_gpio_pins[i].pin_mapped = 0;
 	}
 
@@ -121,7 +123,7 @@
 	gba.gba_npins = GPIO_NPINS;
 
 	/* Attach GPIO framework */
-	(void) config_found(sc-sc_dev, gba, gpiobus_print);
+	(void)config_found(sc-sc_dev, gba, gpiobus_print);
 }
 
 static int
@@ -143,11 +145,11 @@
 	int p;
 
 	p = pin % GPIO_NPINS;
-data = 1  p;
-if (value)
-sc-sc_dp-PinData = data;
-else
-sc-sc_dp-ClearData = data;
+	data = 1  p;
+	if (value)
+		sc-sc_dp-PinData = data;
+	else
+		sc-sc_dp-ClearData = data;
 }
 
 static void
@@ -158,17 +160,17 @@
 	int p;
 
 	p = pin % GPIO_NPINS;
-data = (1  p);
+	data = (1  p);
 
 	if (flags  GPIO_PIN_INOUT) {
-sc-sc_dp-Direction = data;
+		sc-sc_dp-Direction = data;
 	}
 
 	if (flags  GPIO_PIN_TRISTATE) {
-sc-sc_dp-OutDisable = data;
+		sc-sc_dp-OutDisable = data;
 	}
 
 	if (flags  GPIO_PIN_OPENDRAIN) {
-sc-sc_dp-Enable = data;
+		sc-sc_dp-Enable = data;
 	}
 }



CVS commit: src/sys/arch/powerpc/booke/dev

2011-06-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 12 05:29:13 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3ehci.c

Log Message:
Make sure to enable the USB interface.


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

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3ehci.c
diff -u src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.3 src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.4
--- src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.3	Wed Feb 16 18:46:37 2011
+++ src/sys/arch/powerpc/booke/dev/pq3ehci.c	Sun Jun 12 05:29:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3ehci.c,v 1.3 2011/02/16 18:46:37 matt Exp $	*/
+/*	$NetBSD: pq3ehci.c,v 1.4 2011/06/12 05:29:13 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pq3ehci.c,v 1.3 2011/02/16 18:46:37 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pq3ehci.c,v 1.4 2011/06/12 05:29:13 matt Exp $);
+
+#include opt_usb.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -119,6 +121,7 @@
 	 */
 	cpu_write_4(cnl-cnl_addr + USB_SNOOP1,
 	SNOOP_2GB - __builtin_clz(curcpu()-ci_softc-cpu_highmem * 2 - 1));
+	cpu_write_4(cnl-cnl_addr + USB_CONTROL, USB_EN);
 
 	sc-sc_ih = intr_establish(cnl-cnl_intrs[0], IPL_USB, IST_ONCHIP,
 	ehci_intr, sc);



CVS commit: src/sys/dev/flash

2011-06-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 12 05:29:42 UTC 2011

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

Log Message:
Use %# instead of 0x%


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/flash/flash.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/flash/flash.c
diff -u src/sys/dev/flash/flash.c:1.4 src/sys/dev/flash/flash.c:1.5
--- src/sys/dev/flash/flash.c:1.4	Tue Apr 26 17:42:20 2011
+++ src/sys/dev/flash/flash.c	Sun Jun 12 05:29:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flash.c,v 1.4 2011/04/26 17:42:20 ahoka Exp $	*/
+/*	$NetBSD: flash.c,v 1.5 2011/06/12 05:29:42 matt Exp $	*/
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: flash.c,v 1.4 2011/04/26 17:42:20 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: flash.c,v 1.5 2011/06/12 05:29:42 matt Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -168,7 +168,7 @@
 	}
 
 	aprint_normal_dev(sc-sc_dev,
-	size: 0x%jx, offset: 0x%jx,
+	size: %#jx, offset: %#jx,
 	(uintmax_t )sc-flash_if-partition.part_size,
 	(uintmax_t )sc-flash_if-partition.part_offset);
 



CVS commit: src/sys/arch/emips/ebus

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:31:14 UTC 2011

Modified Files:
src/sys/arch/emips/ebus: gpio_ebus.c

Log Message:
Split device_t/softc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/gpio_ebus.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/emips/ebus/gpio_ebus.c
diff -u src/sys/arch/emips/ebus/gpio_ebus.c:1.2 src/sys/arch/emips/ebus/gpio_ebus.c:1.3
--- src/sys/arch/emips/ebus/gpio_ebus.c:1.2	Sun Jun 12 05:27:56 2011
+++ src/sys/arch/emips/ebus/gpio_ebus.c	Sun Jun 12 05:31:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $	*/
+/*	$NetBSD: gpio_ebus.c,v 1.3 2011/06/12 05:31:14 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: gpio_ebus.c,v 1.3 2011/06/12 05:31:14 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -49,7 +49,7 @@
 #define GPIO_NPINS 32
 
 struct epio_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	struct _Pio *sc_dp;
 	struct gpio_chipset_tag	sc_gpio_gc;
 	gpio_pin_t sc_gpio_pins[GPIO_NPINS];
@@ -58,7 +58,7 @@
 static int	epio_ebus_match(device_t, cfdata_t, void *);
 static void	epio_ebus_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(epio, sizeof (struct epio_softc),
+CFATTACH_DECL_NEW(epio, sizeof (struct epio_softc),
 epio_ebus_match, epio_ebus_attach, NULL, NULL);
 
 static int	epio_pin_read(void *, int);
@@ -83,12 +83,13 @@
 static void
 epio_ebus_attach(device_t parent, device_t self, void *aux)
 {
-	struct epio_softc *sc = (struct epio_softc *)self;
+	struct epio_softc *sc = device_private(self);
 	struct ebus_attach_args *ia =aux;
 	struct gpiobus_attach_args gba;
 	int i;
 	uint32_t data;
 
+	sc-sc_dev = self;
 	sc-sc_dp = (struct _Pio *)ia-ia_vaddr;
 	data = sc-sc_dp-PinData;
 
@@ -123,7 +124,7 @@
 	gba.gba_npins = GPIO_NPINS;
 
 	/* Attach GPIO framework */
-	(void)config_found(sc-sc_dev, gba, gpiobus_print);
+	(void)config_found(self, gba, gpiobus_print);
 }
 
 static int



CVS commit: src/sys

2011-06-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 12 05:32:38 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c trap.c
src/sys/common/pmap/tlb: pmap.c pmap.h

Log Message:
For debugging, use UVMHIST to create kernel histories pmaphist and
pmapexechist.  This replaces the old pmapdebug/PDB stuff.
In ddb, you can just use kernhist_dump(pmaphist) to view the history
or vmstat -H from userland.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/booke_pmap.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/common/pmap/tlb/pmap.c
cvs rdiff -u -r1.3 -r1.4 src/sys/common/pmap/tlb/pmap.h

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

Modified files:

Index: src/sys/arch/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.4 src/sys/arch/powerpc/booke/booke_pmap.c:1.5
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.4	Sun Jun  5 16:52:24 2011
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Sun Jun 12 05:32:38 2011
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.4 2011/06/05 16:52:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: booke_pmap.c,v 1.5 2011/06/12 05:32:38 matt Exp $);
 
 #include sys/param.h
 #include sys/kcore.h
@@ -263,8 +263,9 @@
 void
 pmap_zero_page(paddr_t pa)
 {
-//	printf(%s(%#lx): calling dcache_zero_page(%#lx)\n, __func__, pa, pa);
 	dcache_zero_page(pa);
+
+	KASSERT(!VM_PAGE_MD_EXECPAGE_P(PHYS_TO_VM_PAGE(pa)));
 }
 
 void
@@ -289,6 +290,8 @@
 			  r28, r29, r30, r31);
 		}
 	}
+
+	KASSERT(!VM_PAGE_MD_EXECPAGE_P(PHYS_TO_VM_PAGE(dst - PAGE_SIZE)));
 }
 
 void

Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.7 src/sys/arch/powerpc/booke/trap.c:1.8
--- src/sys/arch/powerpc/booke/trap.c:1.7	Sun Jun  5 16:52:24 2011
+++ src/sys/arch/powerpc/booke/trap.c	Sun Jun 12 05:32:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.7 2011/06/05 16:52:24 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.8 2011/06/12 05:32:38 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.7 2011/06/05 16:52:24 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: trap.c,v 1.8 2011/06/12 05:32:38 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -287,11 +287,20 @@
 	KASSERT(ptep != NULL);
 	pt_entry_t pte = *ptep;
 
+	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmapexechist);
+
 	if ((pte  PTE_UNSYNCED) == PTE_UNSYNCED) {
 		const paddr_t pa = pte_to_paddr(pte);
 		struct vm_page * const pg = PHYS_TO_VM_PAGE(pa);
 		KASSERT(pg);
 
+		UVMHIST_LOG(pmapexechist,
+		srr0=%#x pg=%p (pa %#PRIxPADDR): %s, 
+		tf-tf_srr0, pg, pa, 
+		(VM_PAGE_MD_EXECPAGE_P(pg)
+			? no syncicache (already execpage)
+			: performed syncicache (now execpage)));
+
 		if (!VM_PAGE_MD_EXECPAGE_P(pg)) {
 			ci-ci_softc-cpu_ev_exec_trap_sync.ev_count++;
 			dcache_wb_page(pa);
@@ -301,10 +310,12 @@
 		pte = ~PTE_UNSYNCED;
 		pte |= PTE_xX;
 		*ptep = pte;
+
 		pmap_tlb_update_addr(faultmap-pmap, trunc_page(faultva),
 		pte, 0);
 		kpreempt_enable();
-		return false;
+		UVMHIST_LOG(pmapexechist, - 0, 0,0,0,0);
+		return 0;
 	}
 	kpreempt_enable();
 
@@ -323,6 +334,7 @@
 		ksi-ksi_code = SEGV_ACCERR;
 		ksi-ksi_addr = (void *)tf-tf_srr0; /* not truncated */
 	}
+	UVMHIST_LOG(pmapexechist, - %d, rv, 0,0,0);
 	return rv;
 }
 
@@ -442,6 +454,12 @@
 	if (!usertrap_p(tf))
 		return rv;
 
+	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmapexechist);
+
+	UVMHIST_LOG(pmapexechist,  srr0/1=%#x/%#x esr=%#x pte=%#x, 
+	tf-tf_srr0, tf-tf_srr1, tf-tf_esr,
+	*trap_pte_lookup(tf, trunc_page(tf-tf_srr0), PSL_IS));
+
 	ci-ci_ev_pgm.ev_count++;
 
 	if (tf-tf_esr  ESR_PTR) {

Index: src/sys/common/pmap/tlb/pmap.c
diff -u src/sys/common/pmap/tlb/pmap.c:1.4 src/sys/common/pmap/tlb/pmap.c:1.5
--- src/sys/common/pmap/tlb/pmap.c:1.4	Sun Jun  5 16:52:27 2011
+++ src/sys/common/pmap/tlb/pmap.c	Sun Jun 12 05:32:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.4 2011/06/05 16:52:27 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.5 2011/06/12 05:32:38 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.4 2011/06/05 16:52:27 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.5 2011/06/12 05:32:38 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -189,21 +189,6 @@
 PMAP_COUNTER(protect, protects);
 PMAP_COUNTER(page_protect, page_protects);
 
-#define PDB_FOLLOW	0x0001
-#define PDB_INIT	0x0002
-#define PDB_ENTER	0x0004
-#define PDB_REMOVE	0x0008
-#define PDB_CREATE	0x0010
-#define PDB_PTPAGE	0x0020
-#define PDB_PVENTRY	0x0040
-#define PDB_BITS	0x0080
-#define PDB_PROTECT	0x0200
-#define PDB_TLBPID	0x0400
-#define PDB_PARANOIA	0x2000
-#define PDB_WIRING	0x4000
-#define 

CVS commit: src/sys/arch/powerpc/booke/dev

2011-06-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 12 05:37:55 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Make sure initialize the ATTR registers.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3etsec.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.3 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.4
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.3	Wed Mar 16 05:31:03 2011
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Sun Jun 12 05:37:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.3 2011/03/16 05:31:03 matt Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.4 2011/06/12 05:37:54 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -588,6 +588,9 @@
 
 	aprint_normal(\n);
 
+	etsec_write(sc, ATTR, ATTR_DEFAULT);
+	etsec_write(sc, ATTRELI, ATTRELI_DEFAULT);
+
 	sc-sc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SOFTNET);
 
 	callout_init(sc-sc_mii_callout, CALLOUT_MPSAFE);
@@ -1458,6 +1461,7 @@
 		if (consumer == rxq-rxq_producer) {
 			rxq-rxq_consumer = consumer;
 			rxq-rxq_inuse -= rxconsumed;
+			KASSERT(rxq-rxq_inuse == 0);
 			return;
 		}
 		pq3etsec_rxq_desc_postsync(sc, rxq, consumer, 1);



CVS commit: src

2011-06-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 12 05:39:57 UTC 2011

Modified Files:
src/distrib/emips/instkernel: Makefile
Removed Files:
src/sys/arch/emips/conf: Makefile.emips.inc

Log Message:
No reason to create ECOFF kernels for a modern port which have a native
bootloader.  (blindly copied from pmax?)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/emips/instkernel/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/emips/conf/Makefile.emips.inc

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

Modified files:

Index: src/distrib/emips/instkernel/Makefile
diff -u src/distrib/emips/instkernel/Makefile:1.1 src/distrib/emips/instkernel/Makefile:1.2
--- src/distrib/emips/instkernel/Makefile:1.1	Wed Jan 26 01:18:44 2011
+++ src/distrib/emips/instkernel/Makefile	Sun Jun 12 05:39:57 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/01/26 01:18:44 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2011/06/12 05:39:57 tsutsui Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -20,9 +20,6 @@
 MDSETTARGETS=		RAMDISK ${RAMDISK} netbsd-INSTALL
 MDSET_RELEASEDIR=	binary/kernel
 
-MDSET_SUFFIXES.netbsd-INSTALL=	ecoff create-ecoff
-create-ecoff=			${ELF2ECOFF} ${.TARGET:R} ${.TARGET}
-
 IMAGE_RELEASEDIR=	installation/diskimage
 
 .include ${DISTRIBDIR}/common/Makefile.image



CVS commit: src/lib/libc/arch/alpha/gen

2011-06-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jun 12 05:44:36 UTC 2011

Modified Files:
src/lib/libc/arch/alpha/gen: __setjmp14.S flt_rounds.c fpgetround.c
fpsetround.c

Log Message:
Use excb before and after the mt_fpcr/mf_fpcr instructions as specified
in the alpha ARM 4.7.8.1 (Accessing the FPCR):

Because Alpha floating-point hardware can overlap the execution of
a number of floating-point instructions, accessing the FPCR must
be synchronized with other floating-point instructions. An EXCB
instruction must be issued both prior to and after accessing the
FPCR to ensure that the FPCR access is synchronized with the
execution of previous and subsequent floating-point instructions;
otherwise synchronization is not ensured.

Use unions to convert between double and uint64_t to avoid casting.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/alpha/gen/__setjmp14.S
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/alpha/gen/flt_rounds.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/alpha/gen/fpgetround.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/alpha/gen/fpsetround.c

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

Modified files:

Index: src/lib/libc/arch/alpha/gen/__setjmp14.S
diff -u src/lib/libc/arch/alpha/gen/__setjmp14.S:1.4 src/lib/libc/arch/alpha/gen/__setjmp14.S:1.5
--- src/lib/libc/arch/alpha/gen/__setjmp14.S:1.4	Sun Mar 21 18:04:27 2004
+++ src/lib/libc/arch/alpha/gen/__setjmp14.S	Sun Jun 12 05:44:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: __setjmp14.S,v 1.4 2004/03/21 18:04:27 matt Exp $ */
+/* $NetBSD: __setjmp14.S,v 1.5 2011/06/12 05:44:36 matt Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -96,7 +96,9 @@
 	stt	fs5, (7*8 + SC_FPREGS)(a0)
 	stt	fs6, (8*8 + SC_FPREGS)(a0)
 	stt	fs7, (9*8 + SC_FPREGS)(a0)
+	excb	/* required 4.7.8.1 Alpha ARM */
 	mf_fpcr	ft0/* get FP control reg */
+	excb	/* required 4.7.8.1 Alpha ARM */
 	stt	ft0, SC_FPCR(a0)		/* and store it in sc_fpcr */
 	stq	zero, SC_FP_CONTROL(a0)		/* FP software control XXX */
 	stq	zero, (SC_RESERVED + 0*8)(a0)	/* sc_reserved[0] */

Index: src/lib/libc/arch/alpha/gen/flt_rounds.c
diff -u src/lib/libc/arch/alpha/gen/flt_rounds.c:1.8 src/lib/libc/arch/alpha/gen/flt_rounds.c:1.9
--- src/lib/libc/arch/alpha/gen/flt_rounds.c:1.8	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/alpha/gen/flt_rounds.c	Sun Jun 12 05:44:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: flt_rounds.c,v 1.8 2005/12/24 23:10:08 perry Exp $ */
+/* $NetBSD: flt_rounds.c,v 1.9 2011/06/12 05:44:36 matt Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -36,29 +36,33 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: flt_rounds.c,v 1.8 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: flt_rounds.c,v 1.9 2011/06/12 05:44:36 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include sys/types.h
+#include machine/ieeefp.h
 #include machine/float.h
 
-static const int map[] = {
-	0,	/* round to zero */
-	3,	/* round to negative infinity */
-	1,	/* round to nearest */
-	2	/* round to positive infinity */
-};
+/*
+ * These come from float.h defintion
+ */
+#define	FLT_ROUND_MAP \
+	( (0  (FP_RZ*2))	/* round to zero */			\
+	| (1  (FP_RN*2))	/* round to nearest */			\
+	| (3  (FP_RM*2))	/* round to negative infinity */	\
+	| (2  (FP_RP*2)))	/* round to positive infinity */
 
 int
-__flt_rounds()
+__flt_rounds(void)
 {
-	double fpcrval;
-	u_int64_t old;
+	union {
+		double d;
+		uint64_t u64;
+	} fpcrval;
+	uint64_t old;
 
-	__asm(trapb);
-	__asm(mf_fpcr %0 : =f (fpcrval));
-	__asm(trapb);
-	old = *(u_int64_t *)(void *)fpcrval;
+	__asm(excb; mf_fpcr %0; excb : =f (fpcrval.d));
+	old = (fpcrval.u64  58)  3;
 
-	return map[(old  58)  0x3];
+	return (FLT_ROUND_MAP  (old  1))  3;
 }

Index: src/lib/libc/arch/alpha/gen/fpgetround.c
diff -u src/lib/libc/arch/alpha/gen/fpgetround.c:1.9 src/lib/libc/arch/alpha/gen/fpgetround.c:1.10
--- src/lib/libc/arch/alpha/gen/fpgetround.c:1.9	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/alpha/gen/fpgetround.c	Sun Jun 12 05:44:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: fpgetround.c,v 1.9 2005/12/24 23:10:08 perry Exp $ */
+/* $NetBSD: fpgetround.c,v 1.10 2011/06/12 05:44:36 matt Exp $ */
 
 /*
  * Copyright (c) 1995 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: fpgetround.c,v 1.9 2005/12/24 23:10:08 perry Exp $);
+__RCSID($NetBSD: fpgetround.c,v 1.10 2011/06/12 05:44:36 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -49,13 +49,14 @@
 #endif
 
 fp_rnd
-fpgetround()
+fpgetround(void)
 {
-	double fpcrval;
-	u_int64_t old;
+	union {
+		double d;
+		uint64_t u64;
+	} fpcrval;
 
-	__asm(mf_fpcr %0 : =f (fpcrval));
-	old = *(u_int64_t *)(void *)fpcrval;
+	__asm(excb; mf_fpcr %0; excb : =f (fpcrval.d));
 
-