CVS commit: src/sys/ddb

2010-02-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Tue Feb  2 09:04:14 UTC 2010

Modified Files:
src/sys/ddb: db_user.h db_write_cmd.c

Log Message:
Include ctype.h in the central place which deals with building the
kernel debugger as a userland program.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/ddb/db_user.h
cvs rdiff -u -r1.25 -r1.26 src/sys/ddb/db_write_cmd.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/ddb/db_user.h
diff -u src/sys/ddb/db_user.h:1.1 src/sys/ddb/db_user.h:1.2
--- src/sys/ddb/db_user.h:1.1	Sat Mar  7 22:02:17 2009
+++ src/sys/ddb/db_user.h	Tue Feb  2 09:04:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_user.h,v 1.1 2009/03/07 22:02:17 ad Exp $	*/
+/*	$NetBSD: db_user.h,v 1.2 2010/02/02 09:04:14 tron Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 
 #include uvm/uvm_extern.h
 
+#include ctype.h
 #include stdio.h
 #include string.h
 #include stdbool.h

Index: src/sys/ddb/db_write_cmd.c
diff -u src/sys/ddb/db_write_cmd.c:1.25 src/sys/ddb/db_write_cmd.c:1.26
--- src/sys/ddb/db_write_cmd.c:1.25	Mon Feb  1 09:56:58 2010
+++ src/sys/ddb/db_write_cmd.c	Tue Feb  2 09:04:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_write_cmd.c,v 1.25 2010/02/01 09:56:58 tron Exp $	*/
+/*	$NetBSD: db_write_cmd.c,v 1.26 2010/02/02 09:04:14 tron Exp $	*/
 
 /*
  * Mach Operating System
@@ -30,17 +30,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_write_cmd.c,v 1.25 2010/02/01 09:56:58 tron Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_write_cmd.c,v 1.26 2010/02/02 09:04:14 tron Exp $);
 
 #include sys/param.h
 #include sys/proc.h
 
 #include ddb/ddb.h
 
-#ifndef _KERNEL
-#include ctype.h
-#endif
-
 /*
  * Write to file.
  */



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

2010-02-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Feb  2 12:47:51 UTC 2010

Modified Files:
src/sys/arch/amigappc/conf: files.amigappc

Log Message:
Include majors.amigappc instead of majors.amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amigappc/conf/files.amigappc

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/amigappc/conf/files.amigappc
diff -u src/sys/arch/amigappc/conf/files.amigappc:1.20 src/sys/arch/amigappc/conf/files.amigappc:1.21
--- src/sys/arch/amigappc/conf/files.amigappc:1.20	Tue Jul 21 09:49:15 2009
+++ src/sys/arch/amigappc/conf/files.amigappc	Tue Feb  2 12:47:51 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amigappc,v 1.20 2009/07/21 09:49:15 phx Exp $
+#	$NetBSD: files.amigappc,v 1.21 2010/02/02 12:47:51 phx Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -54,7 +54,7 @@
 define	amibus_ww
 file	arch/amiga/amiga/amiga_bus_simple_2word.c
 
-define amibus_wb
+define	amibus_wb
 file	arch/amiga/amiga/amiga_bus_simple_1word.c
 
 define	amibus_b16
@@ -429,4 +429,4 @@
 # OSS audio driver compatibility
 #include compat/ossaudio/files.ossaudio
 
-include arch/amiga/conf/majors.amiga
+include arch/amigappc/conf/majors.amigappc



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

2010-02-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Feb  2 14:13:16 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: md.amigappc

Log Message:
Make ./build release work with new amigappc port.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/comp/md.amigappc

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

Modified files:

Index: src/distrib/sets/lists/comp/md.amigappc
diff -u src/distrib/sets/lists/comp/md.amigappc:1.4 src/distrib/sets/lists/comp/md.amigappc:1.5
--- src/distrib/sets/lists/comp/md.amigappc:1.4	Tue Sep 12 02:36:37 2006
+++ src/distrib/sets/lists/comp/md.amigappc	Tue Feb  2 14:13:16 2010
@@ -1,28 +1,26 @@
-# $NetBSD: md.amigappc,v 1.4 2006/09/12 02:36:37 simonb Exp $
+# $NetBSD: md.amigappc,v 1.5 2010/02/02 14:13:16 phx Exp $
 ./usr/include/ieeefp.hcomp-c-include
 ./usr/include/amigappccomp-c-include
 ./usr/include/amigappc/_G_config.h		comp-obsolete		obsolete
 ./usr/include/amigappc/ansi.h			comp-c-include
 ./usr/include/amigappc/aout_machdep.h		comp-c-include
 ./usr/include/amigappc/asm.h			comp-c-include
-#XXX./usr/include/amigappc/atomic.h		comp-c-include
+./usr/include/amigappc/atomic.h			comp-c-include
 #XXX./usr/include/amigappc/autoconf.h		comp-c-include
 ./usr/include/amigappc/bat.h			comp-obsolete		obsolete
-#./usr/include/amigappc/bus.h			comp-c-include
+#XXX./usr/include/amigappc/bus.h			comp-c-include
 ./usr/include/amigappc/bswap.h			comp-c-include
 ./usr/include/amigappc/bus.h			comp-obsolete		obsolete
 ./usr/include/amigappc/cdefs.h			comp-c-include
 ./usr/include/amigappc/cpu.h			comp-c-include
-./usr/include/amigappc/cpufunc.h		comp-c-include
 ./usr/include/amigappc/db_machdep.h		comp-obsolete		obsolete
 ./usr/include/amigappc/disklabel.h		comp-c-include
 ./usr/include/amigappc/elf_machdep.h		comp-c-include
 ./usr/include/amigappc/endian.h			comp-c-include
 ./usr/include/amigappc/endian_machdep.h		comp-c-include
 ./usr/include/amigappc/float.h			comp-c-include
-#XXX./usr/include/amigappc/fpu.h		comp-c-include
+./usr/include/amigappc/fpu.h			comp-c-include
 ./usr/include/amigappc/frame.h			comp-c-include
-#XXX./usr/include/amigappc/grfioctl.h		comp-c-include
 ./usr/include/amigappc/ieee.h			comp-c-include
 ./usr/include/amigappc/ieeefp.h			comp-c-include
 ./usr/include/amigappc/int_const.h		comp-c-include
@@ -33,15 +31,12 @@
 ./usr/include/amigappc/intr.h			comp-c-include
 ./usr/include/amigappc/ipkdb.h			comp-obsolete		obsolete
 ./usr/include/amigappc/kcore.h			comp-c-include
-#XXX./usr/include/amigappc/keyboard.h		comp-c-include
 ./usr/include/amigappc/limits.h			comp-c-include
 ./usr/include/amigappc/lock.h			comp-c-include
 ./usr/include/amigappc/machine_type.h		comp-obsolete		obsolete
 ./usr/include/amigappc/math.h			comp-c-include
 ./usr/include/amigappc/mcontext.h		comp-c-include
-###  this should not be here!
-./usr/include/amigappc/mtpr.h			comp-c-include
-###
+./usr/include/amigappc/mutex.h			comp-c-include
 ./usr/include/amigappc/param.h			comp-c-include
 ./usr/include/amigappc/pcb.h			comp-c-include
 ./usr/include/amigappc/pio.h			comp-obsolete		obsolete
@@ -55,9 +50,10 @@
 ./usr/include/amigappc/ptrace.h			comp-c-include
 ./usr/include/amigappc/reg.h			comp-c-include
 ./usr/include/amigappc/reloc.h			comp-c-include
+./usr/include/amigappc/rwlock.h			comp-c-include
 ./usr/include/amigappc/setjmp.h			comp-c-include
 ./usr/include/amigappc/signal.h			comp-c-include
-#XXX./usr/include/amigappc/spr.h		comp-c-include
+./usr/include/amigappc/spr.h			comp-c-include
 ./usr/include/amigappc/stdarg.h			comp-c-include
 ./usr/include/amigappc/trap.h			comp-c-include
 ./usr/include/amigappc/types.h			comp-c-include



CVS commit: src/sys/dev/pci

2010-02-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Feb  2 14:57:45 UTC 2010

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

Log Message:
Add missing parentheses, found by cppcheck and reported by
Henning Petersen in PR 42718.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/dev/pci/if_de.c

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

Modified files:

Index: src/sys/dev/pci/if_de.c
diff -u src/sys/dev/pci/if_de.c:1.135 src/sys/dev/pci/if_de.c:1.136
--- src/sys/dev/pci/if_de.c:1.135	Tue Jan 19 22:07:00 2010
+++ src/sys/dev/pci/if_de.c	Tue Feb  2 14:57:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_de.c,v 1.135 2010/01/19 22:07:00 pooka Exp $	*/
+/*	$NetBSD: if_de.c,v 1.136 2010/02/02 14:57:45 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1994-1997 Matt Thomas (m...@3am-software.com)
@@ -37,7 +37,7 @@
  *   board which support 21040, 21041, or 21140 (mostly).
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_de.c,v 1.135 2010/01/19 22:07:00 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_de.c,v 1.136 2010/02/02 14:57:45 wiz Exp $);
 
 #define	TULIP_HDR_DATA
 
@@ -3760,7 +3760,7 @@
 #if defined(__NetBSD__)
 		(*ifp-if_input)(ifp, ms);
 #else
-		m_adj(ms, sizeof(struct ether_header);
+		m_adj(ms, sizeof(struct ether_header));
 		ether_input(ifp, eh, ms);
 #endif /* __NetBSD__ */
 #else
@@ -3774,7 +3774,7 @@
 #if defined(__NetBSD__)
 		(*ifp-if_input)(ifp, m0);
 #else
-		m_adj(m0, sizeof(struct ether_header);
+		m_adj(m0, sizeof(struct ether_header));
 		ether_input(ifp, eh, m0);
 #endif /* __NetBSD__ */
 		m0 = ms;



CVS commit: src/sys/dev/qbus

2010-02-02 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Feb  2 14:58:46 UTC 2010

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
Fix incomplete line (deleto?), found by cppcheck and reported by
Henning Petersen in PR 42719.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/qbus/if_il.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/qbus/if_il.c
diff -u src/sys/dev/qbus/if_il.c:1.24 src/sys/dev/qbus/if_il.c:1.25
--- src/sys/dev/qbus/if_il.c:1.24	Tue May 12 14:43:33 2009
+++ src/sys/dev/qbus/if_il.c	Tue Feb  2 14:58:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $	*/
+/*	$NetBSD: if_il.c,v 1.25 2010/02/02 14:58:46 wiz Exp $	*/
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.25 2010/02/02 14:58:46 wiz Exp $);
 
 #include opt_inet.h
 
@@ -444,7 +444,8 @@
 		char bits[64];
 
 		snprintb(bits, sizeof(bits), IL_BITS, IL_RCSR(IL_CSR));
-		aprint_error_dev(sc-sc_dev, stray xmit interrupt, csr=%s\n,
+		aprint_error_dev(sc-sc_dev,
+ stray xmit interrupt, csr=%s\n, bits);
 		return;
 	}
 



CVS commit: src/sys/dev/wscons

2010-02-02 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Feb  2 16:18:29 UTC 2010

Modified Files:
src/sys/dev/wscons: wsdisplay.c wsemulconf.c wsemulvar.h

Log Message:
add hooks to allow terminal emulations to be installed by LKMs
(these are not available in early bootstrap, so this is not an
option for the system's default emulation)


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/dev/wscons/wsdisplay.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/wscons/wsemulconf.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/wscons/wsemulvar.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/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.128 src/sys/dev/wscons/wsdisplay.c:1.129
--- src/sys/dev/wscons/wsdisplay.c:1.128	Thu Jan 28 22:36:19 2010
+++ src/sys/dev/wscons/wsdisplay.c	Tue Feb  2 16:18:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.128 2010/01/28 22:36:19 drochner Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsdisplay.c,v 1.128 2010/01/28 22:36:19 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $);
 
 #include opt_wsdisplay_compat.h
 #include opt_wsmsgattrs.h
@@ -311,9 +311,11 @@
 		tty_detach(scr-scr_tty);
 		ttyfree(scr-scr_tty);
 	}
-	if (WSSCREEN_HAS_EMULATOR(scr))
+	if (WSSCREEN_HAS_EMULATOR(scr)) {
 		(*scr-scr_dconf-wsemul-detach)(scr-scr_dconf-wsemulcookie,
 		  ccol, crow);
+		wsemul_drop(scr-scr_dconf-wsemul);
+	}
 	free(scr-scr_dconf, M_DEVBUF);
 	free(scr, M_DEVBUF);
 }

Index: src/sys/dev/wscons/wsemulconf.c
diff -u src/sys/dev/wscons/wsemulconf.c:1.7 src/sys/dev/wscons/wsemulconf.c:1.8
--- src/sys/dev/wscons/wsemulconf.c:1.7	Sun Dec 11 12:24:12 2005
+++ src/sys/dev/wscons/wsemulconf.c	Tue Feb  2 16:18:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemulconf.c,v 1.7 2005/12/11 12:24:12 christos Exp $ */
+/* $NetBSD: wsemulconf.c,v 1.8 2010/02/02 16:18:29 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,10 +31,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsemulconf.c,v 1.7 2005/12/11 12:24:12 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsemulconf.c,v 1.8 2010/02/02 16:18:29 drochner Exp $);
 
 #include sys/param.h
 #include sys/systm.h
+#include sys/malloc.h
 
 #include dev/wscons/wsconsio.h
 #include dev/wscons/wsdisplayvar.h
@@ -42,6 +43,13 @@
 #include dev/wscons/wsemulvar.h		/* pulls in opt_wsemul.h */
 #include dev/wscons/wscons_callbacks.h
 
+struct wsemulentry {
+	const struct wsemul_ops *ops;
+	int usecnt;
+	LIST_ENTRY(wsemulentry) next;
+};
+static LIST_HEAD(, wsemulentry) wsemuls = LIST_HEAD_INITIALIZER(wsemuls);
+
 static const struct wsemul_ops *wsemul_conf[] = {
 #ifdef WSEMUL_SUN
 	wsemul_sun_ops,
@@ -59,6 +67,7 @@
 wsemul_pick(const char *name)
 {
 	const struct wsemul_ops **ops;
+	struct wsemulentry *wep;
 
 	if (name == NULL) {
 		/* default */
@@ -69,9 +78,55 @@
 #endif
 	}
 
+	LIST_FOREACH(wep, wsemuls, next)
+		if (!strcmp(name, wep-ops-name)) {
+			wep-usecnt++;
+			return wep-ops;
+		}
+
 	for (ops = wsemul_conf[0]; *ops != NULL; ops++)
 		if (strcmp(name, (*ops)-name) == 0)
 			break;
 
 	return (*ops);
 }
+
+void
+wsemul_drop(const struct wsemul_ops *ops)
+{
+	struct wsemulentry *wep;
+
+	LIST_FOREACH(wep, wsemuls, next)
+		if (ops == wep-ops) {
+			wep-usecnt--;
+			return;
+		}
+}
+
+int
+wsemul_add(const struct wsemul_ops *ops)
+{
+	struct wsemulentry *wep;
+
+	wep = malloc(sizeof (struct wsemulentry), M_DEVBUF, M_WAITOK);
+	wep-ops = ops;
+	wep-usecnt = 0;
+	LIST_INSERT_HEAD(wsemuls, wep, next);
+	return 0;
+}
+
+int
+wsemul_remove(const struct wsemul_ops *ops)
+{
+	struct wsemulentry *wep;
+
+	LIST_FOREACH(wep, wsemuls, next) {
+		if (ops == wep-ops) {
+			if (wep-usecnt)
+return EBUSY;
+			LIST_REMOVE(wep, next);
+			return 0;
+		}
+	}
+	return ENOENT;
+}

Index: src/sys/dev/wscons/wsemulvar.h
diff -u src/sys/dev/wscons/wsemulvar.h:1.14 src/sys/dev/wscons/wsemulvar.h:1.15
--- src/sys/dev/wscons/wsemulvar.h:1.14	Tue Mar 25 00:49:20 2008
+++ src/sys/dev/wscons/wsemulvar.h	Tue Feb  2 16:18:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemulvar.h,v 1.14 2008/03/25 00:49:20 cube Exp $ */
+/* $NetBSD: wsemulvar.h,v 1.15 2010/02/02 16:18:29 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -69,6 +69,9 @@
 #endif
 
 const struct wsemul_ops *wsemul_pick(const char *);
+void wsemul_drop(const struct wsemul_ops *);
+int wsemul_add(const struct wsemul_ops *);
+int wsemul_remove(const struct wsemul_ops *);
 
 /*
  * Callbacks from the emulation code to the display interface driver.



CVS commit: src/usr.sbin/usbdevs

2010-02-02 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Feb  2 16:25:31 UTC 2010

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
The structure returned by USB_DEVICEINFO has the vendor/device strings
UTF-8 encoded now. We can't simply print this to a terminal, so
convert it to the current codeset first.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/usbdevs/usbdevs.c

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

Modified files:

Index: src/usr.sbin/usbdevs/usbdevs.c
diff -u src/usr.sbin/usbdevs/usbdevs.c:1.25 src/usr.sbin/usbdevs/usbdevs.c:1.26
--- src/usr.sbin/usbdevs/usbdevs.c:1.25	Mon Apr 28 20:24:17 2008
+++ src/usr.sbin/usbdevs/usbdevs.c	Tue Feb  2 16:25:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs.c,v 1.25 2008/04/28 20:24:17 martin Exp $	*/
+/*	$NetBSD: usbdevs.c,v 1.26 2010/02/02 16:25:30 drochner Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,6 +37,9 @@
 #include unistd.h
 #include err.h
 #include errno.h
+#include locale.h
+#include langinfo.h
+#include iconv.h
 #include dev/usb/usb.h
 
 #define USBDEV /dev/usb
@@ -61,6 +64,34 @@
 
 char done[USB_MAX_DEVICES];
 int indent;
+#define MAXLEN USB_MAX_ENCODED_STRING_LEN /* assume can't grow over UTF-8 */
+char vendor[MAXLEN], product[MAXLEN], serial[MAXLEN];
+
+static void
+u2t(const char *utf8str, char *termstr)
+{
+	static iconv_t ic;
+	static int iconv_inited = 0;
+	size_t insz, outsz, icres;
+
+	if (!iconv_inited) {
+		setlocale(LC_ALL, );
+		ic = iconv_open(nl_langinfo(CODESET), UTF-8);
+		if (ic == (iconv_t)-1)
+			ic = iconv_open(ASCII, UTF-8); /* g.c.d. */
+		iconv_inited = 1;
+	}
+	if (ic != (iconv_t)-1) {
+		insz = strlen(utf8str);
+		outsz = MAXLEN - 1;
+		icres = iconv(ic, utf8str, insz, termstr, outsz);
+		if (icres != (size_t)-1) {
+			*termstr = '\0';
+			return;
+		}
+	}
+	strcpy(termstr, (invalid));
+}
 
 void
 usbdev(int f, int a, int rec)
@@ -93,14 +124,17 @@
 		else
 			printf(unconfigured, );
 	}
+	u2t(di.udi_product, product);
+	u2t(di.udi_vendor, vendor);
+	u2t(di.udi_serial, serial);
 	if (verbose) {
 		printf(%s(0x%04x), %s(0x%04x), rev %s,
-		   di.udi_product, di.udi_productNo,
-		   di.udi_vendor, di.udi_vendorNo, di.udi_release);
+		   product, di.udi_productNo,
+		   vendor, di.udi_vendorNo, di.udi_release);
 		if (di.udi_serial[0])
-			printf(, serial %s, di.udi_serial);
+			printf(, serial %s, serial);
 	} else
-		printf(%s, %s, di.udi_product, di.udi_vendor);
+		printf(%s, %s, product, vendor);
 	printf(\n);
 	if (showdevs) {
 		for (i = 0; i  USB_MAX_DEVNAMES; i++)



CVS commit: src/sys/dev/wscons

2010-02-02 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Feb  2 16:54:40 UTC 2010

Modified Files:
src/sys/dev/wscons: wsdisplay.c wsdisplayvar.h

Log Message:
give up some silly macros which were only used ~once, and reduce
dependency on locators.h
makes the code more LKM frienly


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/wscons/wsdisplay.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/wscons/wsdisplayvar.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/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.129 src/sys/dev/wscons/wsdisplay.c:1.130
--- src/sys/dev/wscons/wsdisplay.c:1.129	Tue Feb  2 16:18:29 2010
+++ src/sys/dev/wscons/wsdisplay.c	Tue Feb  2 16:54:40 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.130 2010/02/02 16:54:40 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsdisplay.c,v 1.129 2010/02/02 16:18:29 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsdisplay.c,v 1.130 2010/02/02 16:54:40 drochner Exp $);
 
 #include opt_wsdisplay_compat.h
 #include opt_wsmsgattrs.h
@@ -66,6 +66,8 @@
 #include dev/wscons/wscons_callbacks.h
 #include dev/cons.h
 
+#include locators.h
+
 struct wsscreen_internal {
 	const struct wsdisplay_emulops *emulops;
 	void	*emulcookie;
@@ -524,13 +526,13 @@
 {
 	struct wsemuldisplaydev_attach_args *ap = aux;
 
-	if (match-wsemuldisplaydevcf_console !=
-	WSEMULDISPLAYDEVCF_CONSOLE_UNK) {
+	if (match-cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] !=
+	WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT) {
 		/*
 		 * If console-ness of device specified, either match
 		 * exactly (at high priority), or fail.
 		 */
-		if (match-wsemuldisplaydevcf_console != 0 
+		if (match-cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] != 0 
 		ap-console != 0)
 			return (10);
 		else
@@ -554,8 +556,8 @@
 		ap-console = 0;
 
 	wsdisplay_common_attach(sc, ap-console,
-	 device_cfdata(self)-wsemuldisplaydevcf_kbdmux, ap-scrdata,
-	 ap-accessops, ap-accesscookie);
+	 device_cfdata(self)-cf_loc[WSEMULDISPLAYDEVCF_KBDMUX],
+	 ap-scrdata, ap-accessops, ap-accesscookie);
 
 	if (ap-console) {
 		int maj;
@@ -605,7 +607,7 @@
 	sc-sc_dev = self;
 
 	wsdisplay_common_attach(sc, 0,
-	device_cfdata(self)-wsemuldisplaydevcf_kbdmux, NULL,
+	device_cfdata(self)-cf_loc[WSDISPLAYDEVCF_KBDMUX], NULL,
 	ap-accessops, ap-accesscookie);
 }
 

Index: src/sys/dev/wscons/wsdisplayvar.h
diff -u src/sys/dev/wscons/wsdisplayvar.h:1.47 src/sys/dev/wscons/wsdisplayvar.h:1.48
--- src/sys/dev/wscons/wsdisplayvar.h:1.47	Tue Mar 25 00:49:20 2008
+++ src/sys/dev/wscons/wsdisplayvar.h	Tue Feb  2 16:54:40 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplayvar.h,v 1.47 2008/03/25 00:49:20 cube Exp $ */
+/* $NetBSD: wsdisplayvar.h,v 1.48 2010/02/02 16:54:40 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -149,13 +149,6 @@
 	void	*accesscookie;/* access cookie */
 };
 
-#include locators.h
-
-#define	wsemuldisplaydevcf_console	cf_loc[WSEMULDISPLAYDEVCF_CONSOLE]	/* spec'd as console? */
-#define	WSEMULDISPLAYDEVCF_CONSOLE_UNK	(WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT)
-#define	wsemuldisplaydevcf_kbdmux	cf_loc[WSEMULDISPLAYDEVCF_KBDMUX]
-#define	wsdisplaydevcf_kbdmux		cf_loc[WSDISPLAYDEVCF_KBDMUX]
-
 struct wscons_syncops {
 	int (*detach)(void *, int, void (*)(void *, int, int), void *);
 	int (*attach)(void *, int, void (*)(void *, int, int), void *);



CVS commit: src/sys/uvm

2010-02-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Feb  2 17:40:43 UTC 2010

Modified Files:
src/sys/uvm: uvm_fault.c uvm_loan.c uvm_loan.h

Log Message:
Don't pass an unnecessary reference to uvm_loanbreak_anon().

Requested by rm...@.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.75 -r1.76 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.15 -r1.16 src/sys/uvm/uvm_loan.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/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.154 src/sys/uvm/uvm_fault.c:1.155
--- src/sys/uvm/uvm_fault.c:1.154	Tue Feb  2 06:52:59 2010
+++ src/sys/uvm/uvm_fault.c	Tue Feb  2 17:40:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.154 2010/02/02 06:52:59 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.155 2010/02/02 17:40:43 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.154 2010/02/02 06:52:59 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.155 2010/02/02 17:40:43 uebayasi Exp $);
 
 #include opt_uvmhist.h
 
@@ -1493,12 +1493,15 @@
 
 		/* 1 case is already ok */
 		if (anon-an_ref == 1) {
-			error = uvm_loanbreak_anon(anon, ruobj);
+			error = uvm_loanbreak_anon(anon, *ruobj);
 			if (error != 0) {
 uvmfault_unlockall(ufi, amap, *ruobj, anon);
 uvm_wait(flt_noram2);
 return ERESTART;
 			}
+			/* if we were a loan reciever uobj is gone */
+			if (*ruobj)
+*ruobj = NULL;
 		}
 	}
 	return error;

Index: src/sys/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.75 src/sys/uvm/uvm_loan.c:1.76
--- src/sys/uvm/uvm_loan.c:1.75	Tue Feb  2 06:06:02 2010
+++ src/sys/uvm/uvm_loan.c	Tue Feb  2 17:40:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.75 2010/02/02 06:06:02 uebayasi Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.76 2010/02/02 17:40:43 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.75 2010/02/02 06:06:02 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.76 2010/02/02 17:40:43 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1184,7 +1184,7 @@
 }
 
 int
-uvm_loanbreak_anon(struct vm_anon *anon, struct uvm_object **ruobj)
+uvm_loanbreak_anon(struct vm_anon *anon, struct uvm_object *uobj)
 {
 	struct vm_page *pg;
 
@@ -1209,7 +1209,7 @@
 	/* in case we owned */
 	anon-an_page-pqflags = ~PQ_ANON;
 
-	if (*ruobj) {
+	if (uobj) {
 		/* if we were receiver of loan */
 		anon-an_page-loan_count--;
 	} else {
@@ -1220,9 +1220,8 @@
 		uvm_pagedequeue(anon-an_page);
 	}
 
-	if (*ruobj) {
-		mutex_exit((*ruobj)-vmobjlock);
-		*ruobj = NULL;
+	if (uobj) {
+		mutex_exit(uobj-vmobjlock);
 	}
 
 	/* install new page in anon */

Index: src/sys/uvm/uvm_loan.h
diff -u src/sys/uvm/uvm_loan.h:1.15 src/sys/uvm/uvm_loan.h:1.16
--- src/sys/uvm/uvm_loan.h:1.15	Tue Feb  2 06:06:02 2010
+++ src/sys/uvm/uvm_loan.h	Tue Feb  2 17:40:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.h,v 1.15 2010/02/02 06:06:02 uebayasi Exp $	*/
+/*	$NetBSD: uvm_loan.h,v 1.16 2010/02/02 17:40:43 uebayasi Exp $	*/
 
 /*
  *
@@ -56,7 +56,7 @@
 int uvm_loanuobjpages(struct uvm_object *, voff_t, int,
 struct vm_page **);
 struct vm_page *uvm_loanbreak(struct vm_page *);
-int uvm_loanbreak_anon(struct vm_anon *, struct uvm_object **);
+int uvm_loanbreak_anon(struct vm_anon *, struct uvm_object *);
 
 #endif /* _KERNEL */
 



CVS commit: src/sys/uvm

2010-02-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Feb  2 18:49:23 UTC 2010

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

Log Message:
uobj-pgops-pgo_get doing PGO_SYNCIO returns a uobjpage whose uobj backpointer
refers to another uobj used to call pgo_get.  Revert the wrong assertion
I made.  My bad.

(This and pgo_get's possible ERESTART return value check is the only 2 
behavioral
changes I made.)

Reported by drochner@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/uvm/uvm_fault.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_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.155 src/sys/uvm/uvm_fault.c:1.156
--- src/sys/uvm/uvm_fault.c:1.155	Tue Feb  2 17:40:43 2010
+++ src/sys/uvm/uvm_fault.c	Tue Feb  2 18:49:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.155 2010/02/02 17:40:43 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.156 2010/02/02 18:49:23 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.155 2010/02/02 17:40:43 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.156 2010/02/02 18:49:23 uebayasi Exp $);
 
 #include opt_uvmhist.h
 
@@ -725,10 +725,10 @@
 struct vm_anon **);
 static int uvm_fault_lower_generic1(
 struct uvm_faultinfo *, struct uvm_faultctx *,
-struct vm_page *);
+struct uvm_object *, struct vm_page *);
 static int uvm_fault_lower_generic2(
 struct uvm_faultinfo *, struct uvm_faultctx *,
-struct vm_page *);
+struct uvm_object *, struct vm_page *);
 
 int
 uvm_fault_internal(struct vm_map *orig_map, vaddr_t vaddr,
@@ -1206,7 +1206,7 @@
 	} else {
 		uvm_fault_lower_generic_lookup(ufi, flt, pages);
 	}
-	return uvm_fault_lower_generic1(ufi, flt, pages[flt-centeridx]);
+	return uvm_fault_lower_generic1(ufi, flt, uobj, pages[flt-centeridx]);
 }
 
 static int
@@ -1322,11 +1322,10 @@
 static int
 uvm_fault_lower_generic1(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page *uobjpage)
+	struct uvm_object *uobj, struct vm_page *uobjpage)
 {
 #ifdef DIAGNOSTIC
 	struct vm_amap *amap = ufi-entry-aref.ar_amap;
-	struct uvm_object *uobj = ufi-entry-object.uvm_obj;
 #endif
 
 	/* locked: maps(read), amap(if there), uobj(if !null), uobjpage(if !null) */
@@ -1353,7 +1352,7 @@
 	 * redirect case 2: if we are not shadowed, go to case 2.
 	 */
 
-	return uvm_fault_lower_generic2(ufi, flt, uobjpage);
+	return uvm_fault_lower_generic2(ufi, flt, uobj, uobjpage);
 }
 
 static int
@@ -1685,19 +1684,19 @@
 static int
 uvm_fault_lower_generic_io(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page **ruobjpage);
+	struct uvm_object **ruobj, struct vm_page **ruobjpage);
 static int
 uvm_fault_lower_generic3(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page *uobjpage, bool promote);
+	struct uvm_object *uobj, struct vm_page *uobjpage, bool promote);
 static int
 uvm_fault_lower_generic_direct(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page *uobjpage);
+	struct uvm_object *uobj, struct vm_page *uobjpage);
 static int
 uvm_fault_lower_generic_promote(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page *uobjpage);
+	struct uvm_object *uobj, struct vm_page *uobjpage);
 static int
 uvm_fault_lower_generic_enter(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
@@ -1712,12 +1711,11 @@
 static int
 uvm_fault_lower_generic2(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page *uobjpage)
+	struct uvm_object *uobj, struct vm_page *uobjpage)
 {
 #ifdef DIAGNOSTIC
 	struct vm_amap * const amap = ufi-entry-aref.ar_amap;
 #endif
-	struct uvm_object * const uobj = ufi-entry-object.uvm_obj;
 	bool promote;
 	int error;
 
@@ -1763,20 +1761,20 @@
 		/* update rusage counters */
 		curlwp-l_ru.ru_minflt++;
 	} else {
-		error = uvm_fault_lower_generic_io(ufi, flt, uobjpage);
+		error = uvm_fault_lower_generic_io(ufi, flt, uobj, uobjpage);
 		if (error != 0)
 			return error;
 	}
-	return uvm_fault_lower_generic3(ufi, flt, uobjpage, promote);
+	return uvm_fault_lower_generic3(ufi, flt, uobj, uobjpage, promote);
 }
 
 static int
 uvm_fault_lower_generic_io(
 	struct uvm_faultinfo *ufi, struct uvm_faultctx *flt,
-	struct vm_page **ruobjpage)
+	struct uvm_object **ruobj, struct vm_page **ruobjpage)
 {
 	struct vm_amap * const amap = ufi-entry-aref.ar_amap;
-	struct uvm_object * const uobj = ufi-entry-object.uvm_obj;
+	struct uvm_object *uobj = *ruobj;
 	struct vm_page *uobjpage;
 	bool locked;
 	int gotpages;
@@ -1838,7 +1836,10 @@
 	locked = uvmfault_relock(ufi);
 	if (locked  amap)
 		amap_lock(amap);
-	KASSERT(uobj == uobjpage-uobject);
+
+	/* might be changed */
+	uobj = uobjpage-uobject;
+
 	mutex_enter(uobj-vmobjlock);
 
 	/* locked(locked): maps(read), amap(if !null), uobj, uobjpage */
@@ -1888,6 +1889,7 @@
 
 	/* locked: 

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

2010-02-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Feb  2 19:03:31 UTC 2010

Modified Files:
src/sys/arch/amiga/dev: com_supio.c gvpio.c hyper.c ioblix_zbus.c
zbusvar.h

Log Message:
Fix compilation warnings and errors with amigappc.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amiga/dev/com_supio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amiga/dev/gvpio.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amiga/dev/hyper.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/dev/ioblix_zbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/dev/zbusvar.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/amiga/dev/com_supio.c
diff -u src/sys/arch/amiga/dev/com_supio.c:1.27 src/sys/arch/amiga/dev/com_supio.c:1.28
--- src/sys/arch/amiga/dev/com_supio.c:1.27	Mon Nov 23 00:11:43 2009
+++ src/sys/arch/amiga/dev/com_supio.c	Tue Feb  2 19:03:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: com_supio.c,v 1.27 2009/11/23 00:11:43 rmind Exp $ */
+/*	$NetBSD: com_supio.c,v 1.28 2010/02/02 19:03:31 phx Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: com_supio.c,v 1.27 2009/11/23 00:11:43 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: com_supio.c,v 1.28 2010/02/02 19:03:31 phx Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -118,7 +118,9 @@
 	bus_space_tag_t iot;
 	bus_space_handle_t ioh;
 	struct supio_attach_args *supa = aux;
+#ifdef __m68k__
 	u_int16_t needpsl;
+#endif
 
 	csc-sc_dev = self;
 
@@ -137,6 +139,7 @@
 
 	com_attach_subr(csc);
 
+#ifdef __m68k__
 	/* XXX this should be really in the interrupt stuff */
 	needpsl = PSL_S | (supa-supio_ipl  8);
 
@@ -145,6 +148,7 @@
 		from 0x%x to 0x%x\n, ipl2spl_table[IPL_SERIAL], needpsl);
 		ipl2spl_table[IPL_SERIAL] = needpsl;
 	}
+#endif
 	sc-sc_isr.isr_intr = comintr;
 	sc-sc_isr.isr_arg = csc;
 	sc-sc_isr.isr_ipl = supa-supio_ipl;

Index: src/sys/arch/amiga/dev/gvpio.c
diff -u src/sys/arch/amiga/dev/gvpio.c:1.17 src/sys/arch/amiga/dev/gvpio.c:1.18
--- src/sys/arch/amiga/dev/gvpio.c:1.17	Mon Nov  9 15:35:27 2009
+++ src/sys/arch/amiga/dev/gvpio.c	Tue Feb  2 19:03:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gvpio.c,v 1.17 2009/11/09 15:35:27 is Exp $ */
+/*	$NetBSD: gvpio.c,v 1.18 2010/02/02 19:03:31 phx Exp $ */
 
 /*
  * Copyright (c) 1997 Ignatios Souvatzis
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gvpio.c,v 1.17 2009/11/09 15:35:27 is Exp $);
+__KERNEL_RCSID(0, $NetBSD: gvpio.c,v 1.18 2010/02/02 19:03:31 phx Exp $);
 
 /*
  * GVP I/O Extender
@@ -102,7 +102,9 @@
 	struct gvpbus_args *gap;
 	struct supio_attach_args supa;
 	volatile void *gbase;
+#ifdef __m68k__
 	u_int16_t needpsl;
+#endif
 
 	giosc = (struct gvpio_softc *)self;
 	gap = auxp;
@@ -134,6 +136,7 @@
 		++giosd;
 	}
 	if (giosc-sc_comhdls.lh_first) {
+#ifdef __m68k__
 		/* XXX this should be really in the interrupt stuff */
 		needpsl = PSL_S|PSL_IPL6;
 		if (ipl2spl_table[IPL_SERIAL]  needpsl) {
@@ -143,6 +146,7 @@
 			needpsl);
 			ipl2spl_table[IPL_SERIAL] = needpsl;
 		}
+#endif
 		giosc-sc_comisr.isr_intr = gvp_com_intr;
 		giosc-sc_comisr.isr_arg = giosc;
 		giosc-sc_comisr.isr_ipl = 6;

Index: src/sys/arch/amiga/dev/hyper.c
diff -u src/sys/arch/amiga/dev/hyper.c:1.19 src/sys/arch/amiga/dev/hyper.c:1.20
--- src/sys/arch/amiga/dev/hyper.c:1.19	Mon Apr 28 20:23:12 2008
+++ src/sys/arch/amiga/dev/hyper.c	Tue Feb  2 19:03:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyper.c,v 1.19 2008/04/28 20:23:12 martin Exp $ */
+/*	$NetBSD: hyper.c,v 1.20 2010/02/02 19:03:31 phx Exp $ */
 
 /*-
  * Copyright (c) 1997,1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hyper.c,v 1.19 2008/04/28 20:23:12 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: hyper.c,v 1.20 2010/02/02 19:03:31 phx Exp $);
 
 /*
  * zbus HyperCom driver
@@ -38,8 +38,8 @@
 
 #include sys/types.h
 
-#include sys/conf.h
 #include sys/device.h
+#include sys/conf.h
 #include sys/systm.h
 #include sys/param.h
 

Index: src/sys/arch/amiga/dev/ioblix_zbus.c
diff -u src/sys/arch/amiga/dev/ioblix_zbus.c:1.14 src/sys/arch/amiga/dev/ioblix_zbus.c:1.15
--- src/sys/arch/amiga/dev/ioblix_zbus.c:1.14	Mon Apr 28 20:23:12 2008
+++ src/sys/arch/amiga/dev/ioblix_zbus.c	Tue Feb  2 19:03:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioblix_zbus.c,v 1.14 2008/04/28 20:23:12 martin Exp $ */
+/*	$NetBSD: ioblix_zbus.c,v 1.15 2010/02/02 19:03:31 phx Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,15 +30,15 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ioblix_zbus.c,v 1.14 2008/04/28 20:23:12 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ioblix_zbus.c,v 1.15 2010/02/02 19:03:31 phx Exp $);
 
 /* IOBlix Zorro driver */
 /* XXX to be done: we need to probe the com clock speed! */
 
 #include sys/types.h
 
-#include sys/conf.h
 #include 

CVS commit: src/lib/libc/time

2010-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb  2 19:04:38 UTC 2010

Modified Files:
src/lib/libc/time: ctime.3 localtime.c

Log Message:
According to TOG:
- asctime{,_r}, ctime{,_r} may return NULL; document that, and avoid coredumps.
- gmtime{,_r}, localtime{,_r} may return NULL and set EOVERFLOW, document and
  set errno.
- when mktime returns (time_t)-1, make it set EOVERFLOW and document it.

XXX: Should be pulled up to 5.x


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.45 -r1.46 src/lib/libc/time/localtime.c

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

Modified files:

Index: src/lib/libc/time/ctime.3
diff -u src/lib/libc/time/ctime.3:1.29 src/lib/libc/time/ctime.3:1.30
--- src/lib/libc/time/ctime.3:1.29	Fri Jan  8 12:16:56 2010
+++ src/lib/libc/time/ctime.3	Tue Feb  2 14:04:37 2010
@@ -1,5 +1,5 @@
-.\	$NetBSD: ctime.3,v 1.29 2010/01/08 17:16:56 joerg Exp $
-.Dd March 31, 2001
+.\	$NetBSD: ctime.3,v 1.30 2010/02/02 19:04:37 christos Exp $
+.Dd February 2, 2010
 .Dt CTIME 3
 .Os
 .Sh NAME
@@ -154,7 +154,8 @@
 are determined.
 .Fn mktime
 returns the specified calendar time; if the calendar time cannot be
-represented, it returns -1.
+represented, it returns 
+.Va (time_t)-1 .
 .Pp
 .Fn difftime
 returns the difference between two calendar times,
@@ -195,6 +196,60 @@
 is the offset (in seconds) of the time represented
 from UTC, with positive values indicating east
 of the Prime Meridian.
+.Sh RETURN VALUES
+On success the
+.Nm asctime 
+and
+.Nm ctime
+functions return a pointer to a static character buffer, and the
+.Nm asctime_r 
+and
+.Nm ctime_r
+function return a pointer to the user-supplied buffer.
+On failure they all return
+.Dv NULL
+and no errors are defined for them.
+On success the
+.Nm gmtime ,
+and
+.Nm localtime
+functions return a pointer to a statically allocated
+.Va struct tm
+whereas the
+.Nm gmtime_r 
+and
+.Nm localtime_r
+functions return a pointer to the user-supplied
+.Va struct tm .
+On failure they all return
+.Dv NULL
+and the global variable
+.Va errno
+is set to indicate the error.
+The
+.Nm mktime
+function returns the specified time since the Epoch as a
+.Va time_t
+type value. If the time cannot be represented, then
+.Nm mktime
+returns
+.Va (time_t)-1
+setting the global variable
+.Va errno
+to indicate the error.
+.Sh ERRORS
+The
+.Nm gmtime_r ,
+.Nm localtime_r ,
+.Nm gmtime ,
+.Nm localtime ,
+and
+.Nm mktime
+will fail when:
+.Bl -tag -width Er
+.It Bq Er EOVERFLOW
+The result cannot be represented.
+.El
 .Sh FILES
 .Bl -tag -width /usr/share/zoneinfo/posixrules -compact
 .It Pa /etc/localtime

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.45 src/lib/libc/time/localtime.c:1.46
--- src/lib/libc/time/localtime.c:1.45	Thu Dec 31 17:49:16 2009
+++ src/lib/libc/time/localtime.c	Tue Feb  2 14:04:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.45 2009/12/31 22:49:16 mlelstv Exp $	*/
+/*	$NetBSD: localtime.c,v 1.46 2010/02/02 19:04:37 christos Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = @(#)localtime.c	8.9;
 #else
-__RCSID($NetBSD: localtime.c,v 1.45 2009/12/31 22:49:16 mlelstv Exp $);
+__RCSID($NetBSD: localtime.c,v 1.46 2010/02/02 19:04:37 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -708,17 +708,23 @@
 	register char	c;
 	register int	num;
 
-	if (strp == NULL || !is_digit(c = *strp))
+	if (strp == NULL || !is_digit(c = *strp)) {
+		errno = EINVAL;
 		return NULL;
+	}
 	num = 0;
 	do {
 		num = num * 10 + (c - '0');
-		if (num  max)
+		if (num  max) {
+			errno = EOVERFLOW;
 			return NULL;	/* illegal value */
+		}
 		c = *++strp;
 	} while (is_digit(c));
-	if (num  min)
+	if (num  min) {
+		errno = EINVAL;
 		return NULL;		/* illegal value */
+	}
 	*nump = num;
 	return strp;
 }
@@ -1343,8 +1349,10 @@
 newt += seconds;
 			else	newt -= seconds;
 			if (newt  sp-ats[0] ||
-newt  sp-ats[sp-timecnt - 1])
+newt  sp-ats[sp-timecnt - 1]) {
+	errno = EOVERFLOW;
 	return NULL;	/* cannot happen */
+			}
 			result = localsub(newt, offset, tmp);
 			if (result == tmp) {
 register time_t	newy;
@@ -1354,8 +1362,10 @@
 	newy -= (time_t)icycles * YEARSPERREPEAT;
 else	newy += (time_t)icycles * YEARSPERREPEAT;
 tmp-tm_year = (int)newy;
-if (tmp-tm_year != newy)
+if (tmp-tm_year != newy) {
+	errno = EOVERFLOW;
 	return NULL;
+}
 			}
 			return result;
 	}
@@ -1579,13 +1589,17 @@
 
 		tdelta = tdays / DAYSPERLYEAR;
 		idelta = (int) tdelta;
-		if (tdelta - idelta = 1 || idelta - tdelta = 1)
+		if (tdelta - idelta = 1 || idelta - tdelta = 1) {
+			errno = EOVERFLOW;
 			return NULL;
+		}
 		if (idelta == 0)
 			idelta = (tdays  0) ? -1 : 1;
 		newy = y;
-		if (increment_overflow(newy, idelta))
+		if (increment_overflow(newy, idelta)) {
+			

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

2010-02-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Feb  2 19:07:06 UTC 2010

Modified Files:
src/sys/arch/amigappc/conf: files.amigappc

Log Message:
IOBlix files were missing.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amigappc/conf/files.amigappc

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/amigappc/conf/files.amigappc
diff -u src/sys/arch/amigappc/conf/files.amigappc:1.21 src/sys/arch/amigappc/conf/files.amigappc:1.22
--- src/sys/arch/amigappc/conf/files.amigappc:1.21	Tue Feb  2 12:47:51 2010
+++ src/sys/arch/amigappc/conf/files.amigappc	Tue Feb  2 19:07:05 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amigappc,v 1.21 2010/02/02 12:47:51 phx Exp $
+#	$NetBSD: files.amigappc,v 1.22 2010/02/02 19:07:05 phx Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16			# NOTE THAT AMIGA IS SPECIAL!
@@ -267,6 +267,11 @@
 attach	hyper at zbus
 file	arch/amiga/dev/hyper.c		hyper
 
+# IOBlix
+device	iobl: supio, amibus_b16
+attach	iobl at zbus with iobl_zbus
+file	arch/amiga/dev/ioblix_zbus.c	iobl_zbus
+
 attach	com at supio with com_supio
 file	arch/amiga/dev/com_supio.c	com_supio
 



CVS commit: src/sys/arch/amigappc/amigappc

2010-02-02 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Tue Feb  2 19:15:33 UTC 2010

Modified Files:
src/sys/arch/amigappc/amigappc: autoconf.c machdep.c p5reg.h
pic_amiga.c

Log Message:
Rewrote the amiga PIC from scratch. Interrupts are based on IPL 1-6 now
and no longer on IRQ 0-13.
Fixed interrupt levels in amigappc_install_handlers() (IPL_SOFTxxx was very
bad!).
Compilation with all (most?) amiga devices was tested and fixed.
Some smaller fixes.
Status:
  With Cybervision64 and A3000 SBIC SCSI (with DMA disabled) the system
  reaches multiuser!
Lots of problems left...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amigappc/amigappc/autoconf.c \
src/sys/arch/amigappc/amigappc/p5reg.h \
src/sys/arch/amigappc/amigappc/pic_amiga.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/amigappc/amigappc/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/amigappc/amigappc/autoconf.c
diff -u src/sys/arch/amigappc/amigappc/autoconf.c:1.1 src/sys/arch/amigappc/amigappc/autoconf.c:1.2
--- src/sys/arch/amigappc/amigappc/autoconf.c:1.1	Tue Jul 21 09:49:15 2009
+++ src/sys/arch/amigappc/amigappc/autoconf.c	Tue Feb  2 19:15:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1 2009/07/21 09:49:15 phx Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.2 2010/02/02 19:15:33 phx Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.1 2009/07/21 09:49:15 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.2 2010/02/02 19:15:33 phx Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,7 +66,6 @@
 	 */
 	amiga_realconfig = 1;
 	custom.intena = INTF_INTEN;
-	printf(spl was %d\n,splhigh()); /* XXX */
 
 	if (config_rootfound(mainbus, NULL) == NULL)
 		panic(configure: mainbus not configured);
@@ -75,8 +74,8 @@
 	printf(survived autoconf, going to enable interrupts\n);
 #endif
 
-	custom.intena = INTF_SETCLR | INTF_INTEN;
 	genppc_cpu_configure();
+	custom.intena = INTF_SETCLR | INTF_INTEN;
 
 #ifdef DEBUG_KERNEL_START
 	printf(survived configure...\n);
Index: src/sys/arch/amigappc/amigappc/p5reg.h
diff -u src/sys/arch/amigappc/amigappc/p5reg.h:1.1 src/sys/arch/amigappc/amigappc/p5reg.h:1.2
--- src/sys/arch/amigappc/amigappc/p5reg.h:1.1	Tue Jul 21 09:49:15 2009
+++ src/sys/arch/amigappc/amigappc/p5reg.h	Tue Feb  2 19:15:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: p5reg.h,v 1.1 2009/07/21 09:49:15 phx Exp $ */
+/*	$NetBSD: p5reg.h,v 1.2 2010/02/02 19:15:33 phx Exp $ */
 
 /*
  * Copyright (C) 2000 Adam Ciarcinski.
@@ -85,6 +85,8 @@
 #define	P5_PPC_IPL1	0x02
 #define	P5_PPC_IPL0	0x01
 
+#define P5_IPL_MASK	0x07
+
 /* INT_LVL */
 #define	P5_LVL7		0x40
 #define	P5_LVL6		0x20
@@ -98,13 +100,13 @@
 #define P5read(reg, val)		\
 	do {\
 		(val) = *(volatile unsigned char *)(P5BASE + (reg));	\
-		__asm volatile(sync);	\
+		__asm volatile(eieio);	\
 	} while (0);
 
 #define P5write(reg, val)		\
 	do {\
 		*(volatile unsigned char *)(P5BASE + (reg)) = (val);	\
-		__asm volatile(sync);	\
+		__asm volatile(eieio);	\
 	} while (0);
 
 #endif /* _P5REG_H_ */
Index: src/sys/arch/amigappc/amigappc/pic_amiga.c
diff -u src/sys/arch/amigappc/amigappc/pic_amiga.c:1.1 src/sys/arch/amigappc/amigappc/pic_amiga.c:1.2
--- src/sys/arch/amigappc/amigappc/pic_amiga.c:1.1	Tue Jul 21 09:49:15 2009
+++ src/sys/arch/amigappc/amigappc/pic_amiga.c	Tue Feb  2 19:15:33 2010
@@ -1,7 +1,7 @@
-/* $NetBSD: pic_amiga.c,v 1.1 2009/07/21 09:49:15 phx Exp $ */
+/* $NetBSD: pic_amiga.c,v 1.2 2010/02/02 19:15:33 phx Exp $ */
 
 /*-
- * Copyright (c) 2008,2009 Frank Wille.
+ * Copyright (c) 2008,2009,2010 Frank Wille.
  * All rights reserved.
  *
  * Written by Frank Wille for The NetBSD Project.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pic_amiga.c,v 1.1 2009/07/21 09:49:15 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: pic_amiga.c,v 1.2 2010/02/02 19:15:33 phx Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -47,11 +47,16 @@
 static void amiga_ack_irq(struct pic_ops *, int);
 struct pic_ops *setup_amiga_intr(void); 
 
-#define NIRQ 15
+/*
+ * Number of amigappc hardware interrupts, based on 68000 IPL mask.
+ * In reality 6, because level 0 means no interrupt and level 7 (NMI)
+ * should not happen.
+ */
+#define MAXIPL 7
 
 struct amiga_ops {
 	struct pic_ops pic;
-	int prev_level[NIRQ];
+	int disablemask;
 };
 
 struct pic_ops *
@@ -64,7 +69,7 @@
 	KASSERT(amipic != NULL);
 	pic = amipic-pic;
 
-	pic-pic_numintrs = NIRQ;
+	pic-pic_numintrs = MAXIPL;
 	pic-pic_cookie = (void *)NULL;
 	pic-pic_enable_irq = amiga_enable_irq;
 	pic-pic_reenable_irq = amiga_enable_irq;
@@ -73,66 +78,78 @@
 	pic-pic_ack_irq = amiga_ack_irq;
 	pic-pic_establish_irq = dummy_pic_establish_intr;
 	strcpy(pic-pic_name, amiga);
-	memset(amipic-prev_level, 0, NIRQ * sizeof(int));
+
+	/* Set 

CVS commit: [netbsd-5] src/external/bsd/fetch/dist/libfetch

2010-02-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb  3 00:25:24 UTC 2010

Modified Files:
src/external/bsd/fetch/dist/libfetch [netbsd-5]: common.c common.h
errlist.sh fetch.3 fetch.c fetch.cat3 fetch.h file.c ftp.c
ftp.errors http.c http.errors

Log Message:
Apply patch (requested by joerg in ticket #1294):
Update libfetch to 2.30.
Changes:
libfetch-2.25:
- address a number of lint warnings
- fix strict-alignment issues for GCC 4.4
- fix a bug in the line reading optimisation
- do not reuse a FTP connection if there is an active transfer on it

libfetch-2.26:
- Add support to aggressively cache directory listenings, useful for
  HTTP
- Avoid leaking memory in error cases. From Xavier from Arch Linux.

libfetch-2.30:
- Revamped connection cache, allowing more than one active session
- HTTP keep-alive support


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.2 \
src/external/bsd/fetch/dist/libfetch/common.c \
src/external/bsd/fetch/dist/libfetch/common.h \
src/external/bsd/fetch/dist/libfetch/errlist.sh \
src/external/bsd/fetch/dist/libfetch/fetch.h \
src/external/bsd/fetch/dist/libfetch/file.c \
src/external/bsd/fetch/dist/libfetch/ftp.errors \
src/external/bsd/fetch/dist/libfetch/http.c \
src/external/bsd/fetch/dist/libfetch/http.errors
cvs rdiff -u -r1.1.1.3.2.1 -r1.1.1.3.2.2 \
src/external/bsd/fetch/dist/libfetch/fetch.3 \
src/external/bsd/fetch/dist/libfetch/fetch.c \
src/external/bsd/fetch/dist/libfetch/ftp.c
cvs rdiff -u -r1.1.1.2.2.1 -r1.1.1.2.2.2 \
src/external/bsd/fetch/dist/libfetch/fetch.cat3

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/fetch/dist/libfetch/common.c
diff -u src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.4.1 src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.4.2
--- src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.2.4.1	Sat May 30 16:01:24 2009
+++ src/external/bsd/fetch/dist/libfetch/common.c	Wed Feb  3 00:25:23 2010
@@ -1,7 +1,7 @@
-/*	$NetBSD: common.c,v 1.1.1.2.4.1 2009/05/30 16:01:24 snj Exp $	*/
+/*	$NetBSD: common.c,v 1.1.1.2.4.2 2010/02/03 00:25:23 snj Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
- * Copyright (c) 2008 Joerg Sonnenberger jo...@netbsd.org
+ * Copyright (c) 2008, 2010 Joerg Sonnenberger jo...@netbsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -62,12 +62,13 @@
 #include string.h
 #include unistd.h
 
+#ifndef MSG_NOSIGNAL
+#include signal.h
+#endif
+
 #include fetch.h
 #include common.h
 
-#define DECONST(x,y) ((x)(uintptr_t)(y))
-
-
 /*** Local data **/
 
 /*
@@ -83,10 +84,6 @@
 	{ -1,		FETCH_UNKNOWN,	Unknown resolver error }
 };
 
-/* End-of-Line */
-static const char ENDL[2] = \r\n;
-
-
 /*** Error-reporting functions ***/
 
 /*
@@ -234,22 +231,10 @@
 	/* allocate and fill connection structure */
 	if ((conn = calloc(1, sizeof(*conn))) == NULL)
 		return (NULL);
+	conn-cache_url = NULL;
 	conn-next_buf = NULL;
 	conn-next_len = 0;
 	conn-sd = sd;
-	++conn-ref;
-	return (conn);
-}
-
-
-/*
- * Bump a connection's reference count.
- */
-conn_t *
-fetch_ref(conn_t *conn)
-{
-
-	++conn-ref;
 	return (conn);
 }
 
@@ -261,17 +246,17 @@
 fetch_bind(int sd, int af, const char *addr)
 {
 	struct addrinfo hints, *res, *res0;
-	int error;
 
 	memset(hints, 0, sizeof(hints));
 	hints.ai_family = af;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	if ((error = getaddrinfo(addr, NULL, hints, res0)) != 0)
+	if (getaddrinfo(addr, NULL, hints, res0))
 		return (-1);
-	for (res = res0; res; res = res-ai_next)
+	for (res = res0; res; res = res-ai_next) {
 		if (bind(sd, res-ai_addr, res-ai_addrlen) == 0)
 			return (0);
+	}
 	return (-1);
 }
 
@@ -280,7 +265,7 @@
  * Establish a TCP connection to the specified port on the specified host.
  */
 conn_t *
-fetch_connect(const char *host, int port, int af, int verbose)
+fetch_connect(struct url *url, int af, int verbose)
 {
 	conn_t *conn;
 	char pbuf[10];
@@ -289,22 +274,22 @@
 	int sd, error;
 
 	if (verbose)
-		fetch_info(looking up %s, host);
+		fetch_info(looking up %s, url-host);
 
 	/* look up host name and set up socket address structure */
-	snprintf(pbuf, sizeof(pbuf), %d, port);
+	snprintf(pbuf, sizeof(pbuf), %d, url-port);
 	memset(hints, 0, sizeof(hints));
 	hints.ai_family = af;
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = 0;
-	if ((error = getaddrinfo(host, pbuf, hints, res0)) != 0) {
+	if ((error = getaddrinfo(url-host, pbuf, hints, res0)) != 0) {
 		netdb_seterr(error);
 		return (NULL);
 	}
 	bindaddr = getenv(FETCH_BIND_ADDRESS);
 
 	if (verbose)
-		fetch_info(connecting to %s:%d, host, port);
+		fetch_info(connecting to %s:%d, url-host, url-port);
 
 	/* try to