CVS commit: src/bin/ps

2011-02-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Feb 13 08:34:01 UTC 2011

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

Log Message:
fix typo, from Randolf Richardson in PR 44559


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/bin/ps/ps.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/ps/ps.1
diff -u src/bin/ps/ps.1:1.93 src/bin/ps/ps.1:1.94
--- src/bin/ps/ps.1:1.93	Fri May 14 17:37:06 2010
+++ src/bin/ps/ps.1	Sun Feb 13 08:34:00 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: ps.1,v 1.93 2010/05/14 17:37:06 joerg Exp $
+.\	$NetBSD: ps.1,v 1.94 2011/02/13 08:34:00 dholland Exp $
 .\
 .\ Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -217,7 +217,7 @@
 .It Fl t
 Display information about processes attached to the specified terminal
 device.
-Use an question mark
+Use a question mark
 .Pq Dq \?
 for processes not attached to a
 terminal device and a minus sign



CVS commit: othersrc/usr.sbin/aund

2011-02-13 Thread Ben Harris
Module Name:othersrc
Committed By:   bjh21
Date:   Sun Feb 13 10:14:17 UTC 2011

Modified Files:
othersrc/usr.sbin/aund: README
Removed Files:
othersrc/usr.sbin/aund: Makefile aun.h aund.c aund.conf conf_lex.l
extern.h fileserver.c fileserver.h fs_cli.c fs_error.c fs_errors.h
fs_examine.c fs_fileio.c fs_filetype.c fs_handle.c fs_misc.c
fs_nametrans.c fs_proto.h fs_util.c printserver.c printserver.h

Log Message:
I'm now maintaining aund separately from NetBSD, so it's no longer
appropriate for it to live in othersrc.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 othersrc/usr.sbin/aund/Makefile \
othersrc/usr.sbin/aund/fs_examine.c othersrc/usr.sbin/aund/fs_fileio.c \
othersrc/usr.sbin/aund/fs_util.c
cvs rdiff -u -r1.1 -r1.2 othersrc/usr.sbin/aund/README
cvs rdiff -u -r1.1 -r0 othersrc/usr.sbin/aund/aun.h \
othersrc/usr.sbin/aund/aund.conf othersrc/usr.sbin/aund/extern.h \
othersrc/usr.sbin/aund/fileserver.h othersrc/usr.sbin/aund/fs_error.c \
othersrc/usr.sbin/aund/fs_errors.h othersrc/usr.sbin/aund/fs_filetype.c \
othersrc/usr.sbin/aund/fs_nametrans.c \
othersrc/usr.sbin/aund/printserver.c othersrc/usr.sbin/aund/printserver.h
cvs rdiff -u -r1.5 -r0 othersrc/usr.sbin/aund/aund.c
cvs rdiff -u -r1.3 -r0 othersrc/usr.sbin/aund/conf_lex.l \
othersrc/usr.sbin/aund/fs_cli.c othersrc/usr.sbin/aund/fs_handle.c \
othersrc/usr.sbin/aund/fs_misc.c othersrc/usr.sbin/aund/fs_proto.h
cvs rdiff -u -r1.4 -r0 othersrc/usr.sbin/aund/fileserver.c

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

Modified files:

Index: othersrc/usr.sbin/aund/README
diff -u othersrc/usr.sbin/aund/README:1.1 othersrc/usr.sbin/aund/README:1.2
--- othersrc/usr.sbin/aund/README:1.1	Wed Feb  7 01:20:54 2001
+++ othersrc/usr.sbin/aund/README	Sun Feb 13 10:14:17 2011
@@ -1,22 +1,5 @@
-$NetBSD: README,v 1.1 2001/02/07 01:20:54 bjh21 Exp $
+$NetBSD: README,v 1.2 2011/02/13 10:14:17 bjh21 Exp $
 
-This is a pile of programs to allow a NetBSD system to act as a very basic
-AUN (Acorn Universal Networking) fileserver.  This release is intended to
-be just about good enough to get a NetBSD/arm26 system booting from it.
-
-Hints:
-
-copy aund.conf to /etc
-edit /etc/aund.conf, notably the urd line.
-populate the URD with !ArmBoot,feb, ,ffb and netbsd.
-# ifconfig fxp0 alias 1.0.128.254
-$ aund
-*Configure FileSystem Net
-*Configure Boot
-*Configure BootNet on
-*Configure FS 254
-
-If you have problems using aund to boot NetBSD/arm26, talk to
-port-ar...@netbsd.org.  For all other stuff relating to aund, try
-bj...@netbsd.org.  Note, though, that support effort available for this
-code is minimal.
+Aund is a package to allow a Unix system to act as a file server for old
+Acorn machines.  It used to be here, but it now has a life outside NetBSD,
+at http://bjh21.me.uk/aund.



CVS commit: src/sys/dev/pci

2011-02-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Feb 13 11:00:58 UTC 2011

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

Log Message:
Determine BAR type with pci_mapreg_probe() instead of pci_mapreg_type(),
to skip unimplemented BARs.
Do not probe non-BAR registers (like subsystem id). This fixes potential
panics in pci_mem_find().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/genfb_pci.c

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

Modified files:

Index: src/sys/dev/pci/genfb_pci.c
diff -u src/sys/dev/pci/genfb_pci.c:1.30 src/sys/dev/pci/genfb_pci.c:1.31
--- src/sys/dev/pci/genfb_pci.c:1.30	Thu Feb 10 11:35:20 2011
+++ src/sys/dev/pci/genfb_pci.c	Sun Feb 13 11:00:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb_pci.c,v 1.30 2011/02/10 11:35:20 jmcneill Exp $ */
+/*	$NetBSD: genfb_pci.c,v 1.31 2011/02/13 11:00:58 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfb_pci.c,v 1.30 2011/02/10 11:35:20 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfb_pci.c,v 1.31 2011/02/13 11:00:58 phx Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -145,7 +145,16 @@
 	bar = PCI_MAPREG_START;
 	while (bar = PCI_MAPREG_ROM) {
 
-		type = pci_mapreg_type(sc-sc_pc, sc-sc_pcitag, bar);
+		sc-sc_bars[(bar - PCI_MAPREG_START)  2] = rom =
+		pci_conf_read(sc-sc_pc, sc-sc_pcitag, bar);
+
+		if ((bar = PCI_MAPREG_END  bar  PCI_MAPREG_ROM) ||
+		pci_mapreg_probe(sc-sc_pc, sc-sc_pcitag, bar, type)
+		== 0) {
+			/* skip unimplemented and non-BAR registers */
+			bar += 4;
+			continue;
+		}
 		if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_MEM || 
 		PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_ROM) {
 			pci_mapreg_info(sc-sc_pc, sc-sc_pcitag, bar, type,
@@ -154,13 +163,10 @@
 			sc-sc_ranges[idx].flags);
 			idx++;
 		}
-		sc-sc_bars[(bar - PCI_MAPREG_START)  2] = rom =
-		pci_conf_read(sc-sc_pc, sc-sc_pcitag, bar);
 		if ((bar == PCI_MAPREG_ROM)  (rom != 0)) {
 			pci_conf_write(sc-sc_pc, sc-sc_pcitag, bar, rom |
 			PCI_MAPREG_ROM_ENABLE);
 		}
-
 		if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_MEM 
 		PCI_MAPREG_MEM_TYPE(type) == PCI_MAPREG_MEM_TYPE_64BIT)
 			bar += 8;



CVS commit: src/sys/dev/pci

2011-02-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Feb 13 11:20:12 UTC 2011

Modified Files:
src/sys/dev/pci: piixpm.c piixpmreg.h

Log Message:
The ServerWorks CSB5 smbus controller often times out and hangs until reboot.

Increase the delay between setting the command register and reading the
status register.  Reset the smbus controller if it has timed out.

Tested on an IBM eServer x335.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/piixpmreg.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/pci/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.34 src/sys/dev/pci/piixpm.c:1.35
--- src/sys/dev/pci/piixpm.c:1.34	Thu Feb 10 13:52:36 2011
+++ src/sys/dev/pci/piixpm.c	Sun Feb 13 11:20:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.34 2011/02/10 13:52:36 hannken Exp $ */
+/* $NetBSD: piixpm.c,v 1.35 2011/02/13 11:20:12 hannken Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.34 2011/02/10 13:52:36 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.35 2011/02/13 11:20:12 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -49,6 +49,9 @@
 #define DPRINTF(x)
 #endif
 
+#define PIIXPM_IS_CSB5(id) \
+	(PCI_VENDOR((id)) == PCI_VENDOR_SERVERWORKS  \
+	PCI_PRODUCT((id)) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -65,6 +68,7 @@
 
 	pci_chipset_tag_t	sc_pc;
 	pcitag_t		sc_pcitag;
+	pcireg_t		sc_id;
 
 	struct i2c_controller	sc_i2c_tag;
 	krwlock_t		sc_i2c_rwlock;
@@ -85,6 +89,7 @@
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_acquire_bus(void *, int);
 static void	piixpm_i2c_release_bus(void *, int);
 static int	piixpm_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
@@ -144,6 +149,7 @@
 	const char *intrstr = NULL;
 
 	sc-sc_dev = self;
+	sc-sc_id = pa-pa_id;
 	sc-sc_pc = pa-pa_pc;
 	sc-sc_pcitag = pa-pa_tag;
 
@@ -266,6 +272,27 @@
 	return true;
 }
 
+static void
+piixpm_csb5_reset(void *arg)
+{
+	struct piixpm_softc *sc = arg;
+	pcireg_t base, hostc, pmbase;
+
+	base = pci_conf_read(sc-sc_pc, sc-sc_pcitag, PIIX_SMB_BASE);
+	hostc = pci_conf_read(sc-sc_pc, sc-sc_pcitag, PIIX_SMB_HOSTC);
+
+	pmbase = pci_conf_read(sc-sc_pc, sc-sc_pcitag, PIIX_PM_BASE);
+	pmbase |= PIIX_PM_BASE_CSB5_RESET;
+	pci_conf_write(sc-sc_pc, sc-sc_pcitag, PIIX_PM_BASE, pmbase);
+	pmbase = ~PIIX_PM_BASE_CSB5_RESET;
+	pci_conf_write(sc-sc_pc, sc-sc_pcitag, PIIX_PM_BASE, pmbase);
+
+	pci_conf_write(sc-sc_pc, sc-sc_pcitag, PIIX_SMB_BASE, base);
+	pci_conf_write(sc-sc_pc, sc-sc_pcitag, PIIX_SMB_HOSTC, hostc);
+
+	(void) tsleep(sc, PRIBIO, csb5reset, hz/2);
+}
+
 static int
 piixpm_i2c_acquire_bus(void *cookie, int flags)
 {
@@ -372,7 +399,10 @@
 
 	if (flags  I2C_F_POLL) {
 		/* Poll for completion */
-		DELAY(PIIXPM_DELAY);
+		if (PIIXPM_IS_CSB5(sc-sc_id))
+			DELAY(2*PIIXPM_DELAY);
+		else
+			DELAY(PIIXPM_DELAY);
 		for (retries = 1000; retries  0; retries--) {
 			st = bus_space_read_1(sc-sc_smb_iot, sc-sc_smb_ioh,
 			PIIX_SMB_HS);
@@ -406,6 +436,11 @@
 	if ((st  PIIX_SMB_HS_FAILED) == 0)
 		aprint_error_dev(sc-sc_dev, transaction abort failed, status 0x%x\n, st);
 	bus_space_write_1(sc-sc_smb_iot, sc-sc_smb_ioh, PIIX_SMB_HS, st);
+	/*
+	 * CSB5 needs hard reset to unlock the smbus after timeout.
+	 */
+	if (PIIXPM_IS_CSB5(sc-sc_id))
+		piixpm_csb5_reset(sc);
 	return (1);
 }
 

Index: src/sys/dev/pci/piixpmreg.h
diff -u src/sys/dev/pci/piixpmreg.h:1.4 src/sys/dev/pci/piixpmreg.h:1.5
--- src/sys/dev/pci/piixpmreg.h:1.4	Mon Jun 26 17:33:40 2006
+++ src/sys/dev/pci/piixpmreg.h	Sun Feb 13 11:20:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpmreg.h,v 1.4 2006/06/26 17:33:40 drochner Exp $ */
+/* $NetBSD: piixpmreg.h,v 1.5 2011/02/13 11:20:12 hannken Exp $ */
 /*	$OpenBSD: piixreg.h,v 1.3 2006/01/03 22:39:03 grange Exp $	*/
 
 /*
@@ -30,6 +30,7 @@
 
 /* PCI configuration registers */
 #define PIIX_PM_BASE	0x40		/* Power management base address */
+#define PIIX_PM_BASE_CSB5_RESET	0x10		/* CSB5 PM reset */
 #define PIIX_DEVACTA	0x54		/* Device activity A (function 3) */
 #define PIIX_DEVACTB	0x58		/* Device activity B (function 3) */
 #define PIIX_PMREGMISC	0x80		/* Misc. Power management */



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

2011-02-13 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sun Feb 13 11:54:24 UTC 2011

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

Log Message:
Don't enable the powerfail interrupt on Netra X1 since it may hang.

Discussed on port-sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/sparc64/dev/psycho.c

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

Modified files:

Index: src/sys/arch/sparc64/dev/psycho.c
diff -u src/sys/arch/sparc64/dev/psycho.c:1.101 src/sys/arch/sparc64/dev/psycho.c:1.102
--- src/sys/arch/sparc64/dev/psycho.c:1.101	Sat Jul 10 10:07:40 2010
+++ src/sys/arch/sparc64/dev/psycho.c	Sun Feb 13 11:54:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psycho.c,v 1.101 2010/07/10 10:07:40 nakayama Exp $	*/
+/*	$NetBSD: psycho.c,v 1.102 2011/02/13 11:54:24 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: psycho.c,v 1.101 2010/07/10 10:07:40 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: psycho.c,v 1.102 2011/02/13 11:54:24 nakayama Exp $);
 
 #include opt_ddb.h
 
@@ -299,6 +299,7 @@
 	int psycho_br[2], n, i;
 	bus_space_handle_t pci_ctl;
 	char *model = prom_getpropstring(ma-ma_node, model);
+	extern char machine_model[];
 
 	aprint_normal(\n);
 
@@ -527,10 +528,15 @@
 		psycho_set_intr(sc, 15, psycho_bus_a,
 			sc-sc_regs-pciaerr_int_map,
 			sc-sc_regs-pciaerr_clr_int);
-		psycho_set_intr(sc, 15, psycho_powerfail,
-			sc-sc_regs-power_int_map,
-			sc-sc_regs-power_clr_int);
-		psycho_register_power_button(sc);
+		/*
+		 * Netra X1 may hang when the powerfail interrupt is enabled.
+		 */
+		if (strcmp(machine_model, SUNW,UltraAX-i2) != 0) {
+			psycho_set_intr(sc, 15, psycho_powerfail,
+sc-sc_regs-power_int_map,
+sc-sc_regs-power_clr_int);
+			psycho_register_power_button(sc);
+		}
 		if (sc-sc_mode != PSYCHO_MODE_SABRE) {
 			/* sabre doesn't have these interrupts */
 			psycho_set_intr(sc, 15, psycho_bus_b,



CVS commit: src/tests/util/mtree

2011-02-13 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Feb 13 12:47:27 UTC 2011

Modified Files:
src/tests/util/mtree: t_mtree.sh

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/util/mtree/t_mtree.sh

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

Modified files:

Index: src/tests/util/mtree/t_mtree.sh
diff -u src/tests/util/mtree/t_mtree.sh:1.6 src/tests/util/mtree/t_mtree.sh:1.7
--- src/tests/util/mtree/t_mtree.sh:1.6	Sun Nov  7 17:51:24 2010
+++ src/tests/util/mtree/t_mtree.sh	Sun Feb 13 12:47:27 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.6 2010/11/07 17:51:24 jmmv Exp $
+# $NetBSD: t_mtree.sh,v 1.7 2011/02/13 12:47:27 uebayasi Exp $
 #
 # Copyright (c) 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -25,7 +25,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-# Postprocess mtreee output, canonicalising portions that
+# Postprocess mtree output, canonicalising portions that
 # are expected to differ from one run to another.
 h_postprocess()
 {



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

2011-02-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Feb 13 14:28:29 UTC 2011

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

Log Message:
Add options PXA2X0_LCD_WRITETHROUGH that improves console speed.
Tested on SL-C1000.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/zaurus/conf/GENERIC

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

Modified files:

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.32 src/sys/arch/zaurus/conf/GENERIC:1.33
--- src/sys/arch/zaurus/conf/GENERIC:1.32	Sun Feb 13 05:36:34 2011
+++ src/sys/arch/zaurus/conf/GENERIC	Sun Feb 13 14:28:29 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.32 2011/02/13 05:36:34 nonaka Exp $
+#	$NetBSD: GENERIC,v 1.33 2011/02/13 14:28:29 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -204,6 +204,7 @@
 
 # LCD
 lcd0 at pxaip?
+options 	PXA2X0_LCD_WRITETHROUGH
 wsdisplay* at lcd? console ?
 
 # Audio



CVS commit: src/share/man/man3

2011-02-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Feb 13 16:01:40 UTC 2011

Modified Files:
src/share/man/man3: dlfcn.3

Log Message:
Explain Cannot dlopen non-loadable /usr/lib/libpthread.so.1.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man3/dlfcn.3

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

Modified files:

Index: src/share/man/man3/dlfcn.3
diff -u src/share/man/man3/dlfcn.3:1.30 src/share/man/man3/dlfcn.3:1.31
--- src/share/man/man3/dlfcn.3:1.30	Fri Dec 24 13:00:24 2010
+++ src/share/man/man3/dlfcn.3	Sun Feb 13 16:01:39 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: dlfcn.3,v 1.30 2010/12/24 13:00:24 wiz Exp $
+.\	$NetBSD: dlfcn.3,v 1.31 2011/02/13 16:01:39 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 24, 2010
+.Dd February 13, 2011
 .Dt DLFCN 3
 .Os
 .Sh NAME
@@ -325,6 +325,12 @@
 a second time, immediately following a prior invocation, will result in
 .Dv NULL
 being returned.
+.Sh ERRORS
+The error
+.Dq Cannot dlopen non-loadable /usr/lib/libpthread.so.1
+is generated when a program
+.Fn dlopen Ns No s
+a module that needs libpthread but isn't linked against it itself.
 .Sh SEE ALSO
 .Xr ld 1 ,
 .Xr rtld 1 ,



CVS commit: src/sys/dev/pci

2011-02-13 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Feb 13 16:21:05 UTC 2011

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

Log Message:
Turn on detachment for ixpide(4).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixpide.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/ixpide.c
diff -u src/sys/dev/pci/ixpide.c:1.17 src/sys/dev/pci/ixpide.c:1.18
--- src/sys/dev/pci/ixpide.c:1.17	Fri Nov  5 18:07:24 2010
+++ src/sys/dev/pci/ixpide.c	Sun Feb 13 16:21:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixpide.c,v 1.17 2010/11/05 18:07:24 jakllsch Exp $	*/
+/*	$NetBSD: ixpide.c,v 1.18 2011/02/13 16:21:05 jakllsch Exp $	*/
 
 /*
  *  Copyright (c) 2004 The NetBSD Foundation.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ixpide.c,v 1.17 2010/11/05 18:07:24 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: ixpide.c,v 1.18 2011/02/13 16:21:05 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -47,7 +47,7 @@
 static void	ixp_setup_channel(struct ata_channel *);
 
 CFATTACH_DECL_NEW(ixpide, sizeof(struct pciide_softc),
-ixpide_match, ixpide_attach, NULL, NULL);
+ixpide_match, ixpide_attach, pciide_detach, NULL);
 
 static const char ixpdesc[] = ATI Technologies IXP IDE Controller;
 



CVS commit: src/share/man/man9

2011-02-13 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Feb 13 16:50:16 UTC 2011

Modified Files:
src/share/man/man9: module.9

Log Message:
Notify that the file system has to be mounted first before modules can
be loaded from it.

ok pgoyette@


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/module.9

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

Modified files:

Index: src/share/man/man9/module.9
diff -u src/share/man/man9/module.9:1.26 src/share/man/man9/module.9:1.27
--- src/share/man/man9/module.9:1.26	Sun Jan  9 05:05:10 2011
+++ src/share/man/man9/module.9	Sun Feb 13 16:50:16 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: module.9,v 1.26 2011/01/09 05:05:10 jnemeth Exp $
+.\	$NetBSD: module.9,v 1.27 2011/02/13 16:50:16 jym Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd January 8, 2011
+.Dd February 13, 2011
 .Dt MODULE 9
 .Os
 .Sh NAME
@@ -175,7 +175,8 @@
 .Fa name
 is not found, the list of modules prepared by the boot loader is searched.
 If the named module is still not found, an attempt is made to locate the
-module within the file system.
+module within the file system, provided it has been mounted by the
+initialization code.
 .Pp
 The
 .Fa flags



CVS commit: src/sys/arch/x86/x86

2011-02-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Feb 13 17:47:57 UTC 2011

Modified Files:
src/sys/arch/x86/x86: viac7temp.c

Log Message:
don't pass a NULL ci to xc_unicast


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/viac7temp.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/x86/x86/viac7temp.c
diff -u src/sys/arch/x86/x86/viac7temp.c:1.2 src/sys/arch/x86/x86/viac7temp.c:1.3
--- src/sys/arch/x86/x86/viac7temp.c:1.2	Sun Mar 14 18:04:29 2010
+++ src/sys/arch/x86/x86/viac7temp.c	Sun Feb 13 17:47:56 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: viac7temp.c,v 1.2 2010/03/14 18:04:29 pgoyette Exp $ */
+/* $NetBSD: viac7temp.c,v 1.3 2011/02/13 17:47:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: viac7temp.c,v 1.2 2010/03/14 18:04:29 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: viac7temp.c,v 1.3 2011/02/13 17:47:56 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -57,6 +57,7 @@
 
 	sc = kmem_zalloc(sizeof(struct viac7temp_softc), KM_SLEEP);
 
+	sc-sc_ci = ci;
 	sc-sc_sensor.units = ENVSYS_STEMP;
 	sc-sc_sensor.flags = ENVSYS_FMONLIMITS;
 	strlcpy(sc-sc_sensor.desc, temperature,



CVS commit: src/sys/dev/pci/hdaudio

2011-02-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Feb 13 17:49:12 UTC 2011

Modified Files:
src/sys/dev/pci/hdaudio: hdaudio.c hdaudiovar.h

Log Message:
switch back to polling rirb, this will have to be revisited


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/hdaudio/hdaudio.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/hdaudio/hdaudiovar.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/pci/hdaudio/hdaudio.c
diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.10 src/sys/dev/pci/hdaudio/hdaudio.c:1.11
--- src/sys/dev/pci/hdaudio/hdaudio.c:1.10	Sat Feb 12 15:15:34 2011
+++ src/sys/dev/pci/hdaudio/hdaudio.c	Sun Feb 13 17:49:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.10 2011/02/12 15:15:34 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.11 2011/02/13 17:49:12 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -30,13 +30,12 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdaudio.c,v 1.10 2011/02/12 15:15:34 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio.c,v 1.11 2011/02/13 17:49:12 jmcneill Exp $);
 
 #include sys/types.h
 #include sys/param.h
 #include sys/systm.h
 #include sys/device.h
-#include sys/kernel.h
 #include sys/conf.h
 #include sys/bus.h
 #include sys/kmem.h
@@ -265,8 +264,8 @@
 	}
 }
 
-static void
-hdaudio_rirb_dequeue(struct hdaudio_softc *sc)
+static uint32_t
+hdaudio_rirb_dequeue(struct hdaudio_softc *sc, bool unsol)
 {
 	uint16_t rirbwp;
 	uint64_t *rirb = DMA_KERNADDR(sc-sc_rirb);
@@ -278,14 +277,17 @@
 
 		rirbwp = hda_read2(sc, HDAUDIO_MMIO_RIRBWP);
 		while (--retry  0  (rirbwp  0xff) == sc-sc_rirbrp) {
+			if (unsol) {
+/* don't wait for more unsol events */
+hda_trace(sc, unsol: rirb empty\n);
+return 0x;
+			}
 			hda_delay(10);
 			rirbwp = hda_read2(sc, HDAUDIO_MMIO_RIRBWP);
 		}
 		if (retry == 0) {
-			if (sc-sc_rirbpoll)
-hda_error(sc, RIRB timeout [poll]\n);
-			sc-sc_rirbdata = 0x;
-			return;
+			hda_error(sc, RIRB timeout\n);
+			return 0x;
 		}
 
 		sc-sc_rirbrp++;
@@ -298,7 +300,8 @@
 		bus_dmamap_sync(sc-sc_dmat, sc-sc_rirb.dma_map, 0,
 		sc-sc_rirb.dma_size, BUS_DMASYNC_PREREAD);
 
-		hda_trace(sc, rirb: response %08X %08X\n,
+		hda_trace(sc, %s: response %08X %08X\n,
+		unsol ? unsol : cmd  ,
 		entry.resp, entry.resp_ex);
 
 		if (RIRB_UNSOL(entry)) {
@@ -306,8 +309,7 @@
 			continue;
 		}
 
-		sc-sc_rirbdata = entry.resp;
-		return;
+		return entry.resp;
 	}
 }
 
@@ -316,28 +318,16 @@
 uint32_t param)
 {
 	struct hdaudio_softc *sc = co-co_host;
-	int error;
+	uint32_t result;
 
 	mutex_enter(sc-sc_corb_mtx);
+	hda_trace(sc, cmd  : request %08X %08X (%02X)\n,
+	control, param, nid);
 	hdaudio_corb_enqueue(sc, co-co_addr, nid, control, param);
-	if (sc-sc_rirbpoll) {
-		hdaudio_rirb_dequeue(sc);
-	} else {
-		error = cv_timedwait_sig(sc-sc_corb_cv, sc-sc_corb_mtx, hz);
-		switch (error) {
-		case EWOULDBLOCK:
-			hda_error(sc, cmd: %02X %02X (%02X) RIRB timeout\n,
-			control, param, nid);
-			break;
-		case EINTR:
-			hda_trace(sc, cmd: %02X %02X (%02X) RIRB cancelled\n,
-			control, param, nid);
-			break;
-		}
-	}
+	result = hdaudio_rirb_dequeue(sc, false);
 	mutex_exit(sc-sc_corb_mtx);
 
-	return sc-sc_rirbdata;
+	return result;
 }
 
 static int
@@ -642,13 +632,11 @@
 	hda_read4(sc, HDAUDIO_MMIO_INTSTS));
 	hda_write4(sc, HDAUDIO_MMIO_INTCTL,
 	HDAUDIO_INTCTL_GIE | HDAUDIO_INTCTL_CIE);
-	sc-sc_rirbpoll = false;
 }
 
 static void
 hdaudio_intr_disable(struct hdaudio_softc *sc)
 {
-	sc-sc_rirbpoll = true;
 	hda_write4(sc, HDAUDIO_MMIO_INTCTL, 0);
 }
 
@@ -792,8 +780,6 @@
 	sc-sc_dev = dev;
 	mutex_init(sc-sc_corb_mtx, MUTEX_DEFAULT, IPL_AUDIO);
 	mutex_init(sc-sc_stream_mtx, MUTEX_DEFAULT, IPL_AUDIO);
-	cv_init(sc-sc_corb_cv, hdacodec);
-	sc-sc_rirbpoll = true;
 
 	hdaudio_init(sc);
 
@@ -885,7 +871,6 @@
 
 	mutex_destroy(sc-sc_corb_mtx);
 	mutex_destroy(sc-sc_stream_mtx);
-	cv_destroy(sc-sc_corb_cv);
 
 	hdaudio_dma_free(sc, sc-sc_corb);
 	hdaudio_dma_free(sc, sc-sc_rirb);
@@ -982,8 +967,7 @@
 		rirbsts = hda_read1(sc, HDAUDIO_MMIO_RIRBSTS);
 		if (rirbsts  HDAUDIO_RIRBSTS_RINTFL) {
 			mutex_enter(sc-sc_corb_mtx);
-			hdaudio_rirb_dequeue(sc);
-			cv_signal(sc-sc_corb_cv);
+			hdaudio_rirb_dequeue(sc, true);
 			mutex_exit(sc-sc_corb_mtx);
 		}
 		if (rirbsts  (HDAUDIO_RIRBSTS_RIRBOIS|HDAUDIO_RIRBSTS_RINTFL))

Index: src/sys/dev/pci/hdaudio/hdaudiovar.h
diff -u src/sys/dev/pci/hdaudio/hdaudiovar.h:1.8 src/sys/dev/pci/hdaudio/hdaudiovar.h:1.9
--- src/sys/dev/pci/hdaudio/hdaudiovar.h:1.8	Sat Feb 12 15:15:34 2011
+++ src/sys/dev/pci/hdaudio/hdaudiovar.h	Sun Feb 13 17:49:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudiovar.h,v 1.8 2011/02/12 15:15:34 jmcneill Exp $ */
+/* $NetBSD: hdaudiovar.h,v 1.9 2011/02/13 17:49:12 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence 

CVS commit: xsrc/external/mit/xf86-video-openchrome/dist/src

2011-02-13 Thread Jared D. McNeill
Module Name:xsrc
Committed By:   jmcneill
Date:   Sun Feb 13 20:06:20 UTC 2011

Modified Files:
xsrc/external/mit/xf86-video-openchrome/dist/src: via_memcpy.c

Log Message:
Remove a couple '#ifdef linux's to let the driver use optimized memcpy
functions on NetBSD for video copy. Gives nearly 2x performance on my
test system (previously kernel memcpy was always used):

CHROME(0): Benchmarking video copy.  Less time is better.
CHROME(0): Timed   libc YUV420 copy... 3000272. Throughput: 315.6 MiB/s.
CHROME(0): Timed kernel YUV420 copy... 3024946. Throughput: 313.0 MiB/s.
CHROME(0): TimedSSE YUV420 copy... 1591352. Throughput: 595.0 MiB/s.
CHROME(0): TimedMMX YUV420 copy... 2566279. Throughput: 369.0 MiB/s.
CHROME(0): Ditching 3DNow! YUV420 copy. Not supported by CPU.
CHROME(0): Timed   MMX2 YUV420 copy... 1696662. Throughput: 558.1 MiB/s.
CHROME(0): Using SSE YUV42X copy for video.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c
diff -u xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c:1.1.1.1 xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c:1.2
--- xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c:1.1.1.1	Thu May 27 07:31:58 2010
+++ xsrc/external/mit/xf86-video-openchrome/dist/src/via_memcpy.c	Sun Feb 13 20:06:19 2011
@@ -311,8 +311,6 @@
 }
 
 
-#if !defined(__i386__) || (defined(linux)  defined(__i386__))
-
 static void
 libc_YUV42X(unsigned char *dst, const unsigned char *src,
 int dstPitch, int w, int h, int yuv422)
@@ -350,8 +348,6 @@
 }
 }
 }
-#endif
-
 
 #ifdef __i386__
 
@@ -417,7 +413,6 @@
 }
 }
 
-#ifdef linux
 PREFETCH_FUNC(sse, SSE, SSE,, FENCE)
 PREFETCH_FUNC(mmxext, MMXEXT, SSE, EMMS, FENCEMMS)
 PREFETCH_FUNC(now, MMX, NOW, FEMMS, FEMMS)
@@ -517,7 +512,6 @@
 }
 return 0;
 }
-#endif /* linux */
 
 /*
  * Benchmark the video copy routines and choose the fastest.
@@ -527,7 +521,6 @@
 {
 ScrnInfoPtr pScrn = xf86Screens[pScreen-myNum];
 
-#ifdef linux
 char buf[BSIZ];
 unsigned char *buf1, *buf2, *buf3;
 char *tmpBuf, *endBuf;
@@ -649,11 +642,6 @@
Using %s YUV42X copy for %s.\n,
mcFunctions[bestSoFar].mName, copyType);
 return mcFunctions[bestSoFar].mFunc;
-#else
-xf86DrvMsg(pScrn-scrnIndex, X_INFO,
-   Using Linux kernel memcpy for video.\n);
-return kernel_YUV42X;
-#endif /* linux */
 }
 
 #else



CVS commit: src/usr.sbin/postinstall

2011-02-13 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sun Feb 13 20:17:26 UTC 2011

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Add npf to the list of startup scripts that get checked.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/usr.sbin/postinstall/postinstall

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/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.112 src/usr.sbin/postinstall/postinstall:1.113
--- src/usr.sbin/postinstall/postinstall:1.112	Fri Dec 17 22:56:22 2010
+++ src/usr.sbin/postinstall/postinstall	Sun Feb 13 20:17:26 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.112 2010/12/17 22:56:22 njoly Exp $
+# $NetBSD: postinstall,v 1.113 2011/02/13 20:17:26 tron Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1065,7 +1065,8 @@
 		ldconfig local lpd lvm\
 		mdnsd mixerctl mopd motd mountall mountcritlocal \
 		mountcritremote mountd moused mrouted \
-		named ndbootd network newsyslog nfsd nfslocking ntpd ntpdate \
+		named ndbootd network newsyslog nfsd nfslocking npf \
+		ntpd ntpdate \
 		perusertmp pf pf_boot pflogd postfix powerd ppp pwcheck \
 		quota \
 		racoon rpcbind raidframe raidframeparity rarpd rbootd rndctl \



CVS commit: src/usr.sbin/postinstall

2011-02-13 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sun Feb 13 20:25:35 UTC 2011

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Install etc/gpio.conf if it is missing.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/usr.sbin/postinstall/postinstall

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/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.113 src/usr.sbin/postinstall/postinstall:1.114
--- src/usr.sbin/postinstall/postinstall:1.113	Sun Feb 13 20:17:26 2011
+++ src/usr.sbin/postinstall/postinstall	Sun Feb 13 20:25:35 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.113 2011/02/13 20:17:26 tron Exp $
+# $NetBSD: postinstall,v 1.114 2011/02/13 20:25:35 tron Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -819,6 +819,23 @@
 }
 
 #
+#	gpio
+#
+additem gpio gpio configuration is up to date
+do_gpio()
+{
+	[ -n $1 ] || err 3 USAGE: do_gpio fix|check
+	op=$1
+	failed=0
+
+	populate_dir $op true ${SRC_DIR}/etc ${DEST_DIR}/etc 644 \
+		gpio.conf
+	failed=$(( ${failed} + $? ))
+
+	return ${failed}
+}
+
+#
 #	hosts
 #
 additem hosts /etc/hosts being up to date



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

2011-02-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Feb 13 20:37:27 UTC 2011

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

Log Message:
uvideo works, so include it


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/sandpoint/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sandpoint/conf/GENERIC
diff -u src/sys/arch/sandpoint/conf/GENERIC:1.53 src/sys/arch/sandpoint/conf/GENERIC:1.54
--- src/sys/arch/sandpoint/conf/GENERIC:1.53	Mon Feb  7 12:51:18 2011
+++ src/sys/arch/sandpoint/conf/GENERIC	Sun Feb 13 20:37:26 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.53 2011/02/07 12:51:18 nisimura Exp $
+# $NetBSD: GENERIC,v 1.54 2011/02/13 20:37:26 phx Exp $
 #
 # machine description file for GENERIC NAS
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.53 $
+#ident 		GENERIC-$Revision: 1.54 $
 
 maxusers	32
 
@@ -210,6 +210,10 @@
 uthum*	at uhidev? reportid ?# TEMPerHUM sensors
 uhid*	at uhidev? reportid ?# USB Generic HID
 
+# USB video
+uvideo* at uhub?			# USB Video Class capture devices
+video*	at videobus?
+
 # USB printer
 ulpt*	at uhub? port ? configuration ? interface ?	# USB Printer
 



CVS commit: src/sys/arch/sandpoint

2011-02-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Feb 13 20:39:11 UTC 2011

Modified Files:
src/sys/arch/sandpoint: README.NAS

Log Message:
Added a note that only the Rev.B is supported for D-Link DSM-G600.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sandpoint/README.NAS

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/sandpoint/README.NAS
diff -u src/sys/arch/sandpoint/README.NAS:1.15 src/sys/arch/sandpoint/README.NAS:1.16
--- src/sys/arch/sandpoint/README.NAS:1.15	Sat Feb 12 03:25:37 2011
+++ src/sys/arch/sandpoint/README.NAS	Sun Feb 13 20:39:11 2011
@@ -1,4 +1,4 @@
-$NetBSD: README.NAS,v 1.15 2011/02/12 03:25:37 nisimura Exp $
+$NetBSD: README.NAS,v 1.16 2011/02/13 20:39:11 phx Exp $
 
  MPC8241/8245 NAS products 
 
@@ -27,7 +27,7 @@
 
 			 Not yet recognized, research in progress 
 re.15	satalink.13 	QNAP TS-201, LevelOne FNS-5000B
-stge.15	acardide.16	D-Link DSM-G600
+stge.15	acardide.16	D-Link DSM-G600 (Rev.B only!)
 re.15	iteide.16	Netronix NH-230, Allnet ALL6250, Encore ENNHD-1000,
 			Planex NAS-01G
 re.15	satalink.16	Netronix NH-231, Allnet ALL6260, Longshine LCS-8311,



CVS commit: [bouyer-quota2] src/tests/fs/ffs

2011-02-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Feb 13 20:58:28 UTC 2011

Modified Files:
src/tests/fs/ffs [bouyer-quota2]: h_quota2_tests.c t_miscquota.sh

Log Message:
Add a test checking that an unlinked file cleaned by the log replay keeps
quotas up to date.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/tests/fs/ffs/h_quota2_tests.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/fs/ffs/t_miscquota.sh

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

Modified files:

Index: src/tests/fs/ffs/h_quota2_tests.c
diff -u src/tests/fs/ffs/h_quota2_tests.c:1.1.2.4 src/tests/fs/ffs/h_quota2_tests.c:1.1.2.5
--- src/tests/fs/ffs/h_quota2_tests.c:1.1.2.4	Sat Feb 12 21:49:08 2011
+++ src/tests/fs/ffs/h_quota2_tests.c	Sun Feb 13 20:58:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_quota2_tests.c,v 1.1.2.4 2011/02/12 21:49:08 bouyer Exp $	*/
+/*	$NetBSD: h_quota2_tests.c,v 1.1.2.5 2011/02/13 20:58:28 bouyer Exp $	*/
 
 /*
  * rump server for advanced quota tests
@@ -35,6 +35,7 @@
 	int fd;
 	int error;
 	rump_sys_chown(., TEST_NONROOT_ID, TEST_NONROOT_ID);
+	rump_sys_chmod(., 0777);
 	if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
 		error = errno;
 		perror(rump_sys_setegid);
@@ -67,6 +68,7 @@
 	int fd;
 	int error;
 	rump_sys_chown(., TEST_NONROOT_ID, TEST_NONROOT_ID);
+	rump_sys_chmod(., 0777);
 	if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
 		error = errno;
 		perror(rump_sys_setegid);
@@ -115,6 +117,7 @@
 	int error;
 	int i;
 	rump_sys_chown(., TEST_NONROOT_ID, TEST_NONROOT_ID);
+	rump_sys_chmod(., 0777);
 	if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
 		error = errno;
 		perror(rump_sys_setegid);
@@ -151,6 +154,7 @@
 	int error;
 	int i;
 	rump_sys_chown(., TEST_NONROOT_ID, TEST_NONROOT_ID);
+	rump_sys_chmod(., 0777);
 	if (rump_sys_setegid(TEST_NONROOT_ID) != 0) {
 		error = errno;
 		perror(rump_sys_setegid);
@@ -204,6 +208,8 @@
 	 * take an internal snapshot of the filesystem, and create a new
 	 * file with some data
 	 */
+	rump_sys_chown(., 0, 0);
+	rump_sys_chmod(., 0777);
 
 	for (i =0; testopts  i  strlen(testopts); i++) {
 		switch(testopts[i]) {
@@ -233,8 +239,10 @@
 	fss.fss_csize = 0;
 	if (rump_sys_ioctl(fssfd, FSSIOCSET, fss) == -1)
 		err(1, create snapshot);
-	if (unl)
-		rump_sys_unlink(FSTEST_MNTNAME /le_snap);
+	if (unl) {
+		if (rump_sys_unlink(FSTEST_MNTNAME /le_snap) == -1)
+			err(1, unlink snapshot);
+	}
 
 	/* now create some extra files */
 
@@ -253,6 +261,63 @@
 	return 0;
 }
 
+static int
+quota_test5(const char *testopts)
+{
+	static char buf[512];
+	int fd;
+	int remount = 0;
+	int unlnk = 0;
+	int log = 0;
+	unsigned int i;
+
+	for (i =0; testopts  i  strlen(testopts); i++) {
+		switch(testopts[i]) {
+		case 'L':
+			log++;
+			break;
+		case 'R':
+			remount++;
+			break;
+		case 'U':
+			unlnk++;
+			break;
+		default:
+			errx(1, test4: unknown option %c, testopts[i]);
+		}
+	}
+	if (remount) {
+		struct ufs_args uargs;
+		uargs.fspec = __UNCONST(/diskdev);
+		/* remount the fs read/write */
+		if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME,
+		MNT_UPDATE | (log ? MNT_LOG : 0),
+		uargs, sizeof(uargs)) == -1)
+			err(1, mount ffs rw %s, FSTEST_MNTNAME);
+	}
+
+	if (unlnk) {
+		/*
+		 * open and unlink a file
+		 */
+
+		fd = rump_sys_open(unlinked_file,
+		O_EXCL| O_CREAT | O_RDWR, 0644);
+		if (fd  0)
+			err(1, create %s, unlinked_file);
+		sprintf(buf, test unlinked_file);
+		rump_sys_write(fd, buf, strlen(buf));
+		if (rump_sys_unlink(unlinked_file) == -1)
+			err(1, unlink unlinked_file);
+		if (rump_sys_fsync(fd) == -1) 
+			err(1, fsync unlinked_file);
+		rump_sys_reboot(RUMP_RB_NOSYNC, NULL);
+		errx(1, reboot failed);
+		return 1;
+	}
+	return 0;
+}
+
 struct quota_test {
 	int (*func)(const char *);
 	const char *desc;
@@ -264,6 +329,7 @@
 	{ quota_test2, create file up to hard limit},
 	{ quota_test3, create file beyond the soft limit after grace time},
 	{ quota_test4, take a snapshot and add some data},
+	{ quota_test5, open and unlink a file},
 };
 
 static void
@@ -307,16 +373,19 @@
 	const char *filename;
 	const char *serverurl;
 	const char *topts = NULL;
-	int log = 0;
+	int mntopts = 0;
 	int ch;
 
-	while ((ch = getopt(argc, argv, blo:)) != -1) {
+	while ((ch = getopt(argc, argv, blo:r)) != -1) {
 		switch(ch) {
 		case 'b':
 			background = 1;
 			break;
 		case 'l':
-			log = 1;
+			mntopts |= MNT_LOG;
+			break;
+		case 'r':
+			mntopts |= MNT_RDONLY;
 			break;
 		case 'o':
 			topts = optarg;
@@ -356,14 +425,12 @@
 		err(1, mount point create);
 	rump_pub_etfs_register(/diskdev, filename, RUMP_ETFS_BLK);
 	uargs.fspec = __UNCONST(/diskdev);
-	if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, (log) ? MNT_LOG : 0,
+	if (rump_sys_mount(MOUNT_FFS, FSTEST_MNTNAME, mntopts,
 	uargs, sizeof(uargs)) == -1)
 		die(mount ffs, errno);
 
 	if (rump_sys_chdir(FSTEST_MNTNAME) == -1)
 		err(1, cd %s, FSTEST_MNTNAME);
-	rump_sys_chown(., 0, 0);
-	

CVS commit: src/usr.bin/make

2011-02-13 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Feb 13 21:22:41 UTC 2011

Modified Files:
src/usr.bin/make: meta.c

Log Message:
When making a target that involves creating itermediate dirs,
realpath() will fail until after those dirs exist.
Try to ensure the same meta file name is used regardless.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.7 src/usr.bin/make/meta.c:1.8
--- src/usr.bin/make/meta.c:1.7	Tue Feb  8 05:29:13 2011
+++ src/usr.bin/make/meta.c	Sun Feb 13 21:22:41 2011
@@ -169,6 +169,49 @@
 }
 #endif
 
+/*
+ * when realpath() fails,
+ * we use this, to clean up ./ and ../
+ */
+static void
+eat_dots(char *buf, size_t bufsz, int dots)
+{
+char *cp;
+char *cp2;
+const char *eat;
+size_t eatlen;
+
+switch (dots) {
+case 1:
+	eat = /./;
+	eatlen = 2;
+	break;
+case 2:
+	eat = /../;
+	eatlen = 3;
+	break;
+default:
+	return;
+}
+
+do {
+	cp = strstr(buf, eat);
+	if (cp) {
+	cp2 = cp + eatlen;
+	if (dots == 2  cp  buf) {
+		do {
+		cp--;
+		} while (cp  buf  *cp != '/');
+	}
+	if (*cp == '/') {
+		strlcpy(cp, cp2, bufsz - (cp - buf));
+	} else {
+		return;			/* can't happen? */
+	}
+	}
+} while (cp);
+}
+
 static char *
 meta_name(struct GNode *gn, char *mname, size_t mnamelen,
 	  const char *dname,
@@ -188,6 +231,9 @@
 if (!tname)
 	tname = Var_Value(TARGET, gn, p[i++]);
 
+if (realpath(dname, cwd))
+	dname = cwd;
+
 /*
  * Weed out relative paths from the target file name.
  * We have to be careful though since if target is a
@@ -204,10 +250,23 @@
 		strlcpy(rp, cp, sizeof(buf) - (rp - buf));
 	}
 	tname = buf;
+	} else {
+	/*
+	 * We likely have a directory which is about to be made.
+	 * We pretend realpath() succeeded, to have a chance
+	 * of generating the same meta file name that we will
+	 * next time through.
+	 */
+	if (tname[0] == '/') {
+		strlcpy(buf, tname, sizeof(buf));
+	} else {
+		snprintf(buf, sizeof(buf), %s/%s, cwd, tname);
+	}
+	eat_dots(buf, sizeof(buf), 1);	/* ./ */
+	eat_dots(buf, sizeof(buf), 2);	/* ../ */
+	tname = buf;
 	}
 }
-if (realpath(dname, cwd))
-	dname = cwd;
 /* on some systems dirname may modify its arg */
 tp = bmake_strdup(tname);
 if (strcmp(dname, dirname(tp)) == 0)
@@ -425,6 +484,11 @@
 fname = meta_name(gn, pbm-meta_fname, sizeof(pbm-meta_fname),
 		  dname, tname);
 
+#ifdef DEBUG_META_MODE
+if (DEBUG(META))
+	fprintf(debug_file, meta_create: %s\n, fname);
+#endif
+
 if ((mf.fp = fopen(fname, w)) == NULL)
 	err(1, Could not open meta file '%s', fname);
 
@@ -733,6 +797,11 @@
 
 meta_name(gn, fname, sizeof(fname), NULL, NULL);
 
+#ifdef DEBUG_META_MODE
+if (DEBUG(META))
+	fprintf(debug_file, meta_oodate: %s\n, fname);
+#endif
+
 if ((fp = fopen(fname, r)) != NULL) {
 	static char *buf = NULL;
 	static size_t bufsz;



CVS commit: src/usr.bin/make

2011-02-13 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Feb 13 21:24:43 UTC 2011

Modified Files:
src/usr.bin/make: cond.c main.c

Log Message:
Mark unused args.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/make/cond.c
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/main.c

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.60 src/usr.bin/make/cond.c:1.61
--- src/usr.bin/make/cond.c:1.60	Fri Nov  6 19:44:06 2009
+++ src/usr.bin/make/cond.c	Sun Feb 13 21:24:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.60 2009/11/06 19:44:06 dsl Exp $	*/
+/*	$NetBSD: cond.c,v 1.61 2011/02/13 21:24:42 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: cond.c,v 1.60 2009/11/06 19:44:06 dsl Exp $;
+static char rcsid[] = $NetBSD: cond.c,v 1.61 2011/02/13 21:24:42 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)cond.c	8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: cond.c,v 1.60 2009/11/06 19:44:06 dsl Exp $);
+__RCSID($NetBSD: cond.c,v 1.61 2011/02/13 21:24:42 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -327,7 +327,7 @@
  *---
  */
 static Boolean
-CondDoDefined(int argLen, const char *arg)
+CondDoDefined(int argLen __unused, const char *arg)
 {
 char*p1;
 Boolean result;
@@ -376,7 +376,7 @@
  *---
  */
 static Boolean
-CondDoMake(int argLen, const char *arg)
+CondDoMake(int argLen __unused, const char *arg)
 {
 return Lst_Find(create, arg, CondStrMatch) != NULL;
 }
@@ -395,7 +395,7 @@
  *---
  */
 static Boolean
-CondDoExists(int argLen, const char *arg)
+CondDoExists(int argLen __unused, const char *arg)
 {
 Boolean result;
 char*path;
@@ -428,7 +428,7 @@
  *---
  */
 static Boolean
-CondDoTarget(int argLen, const char *arg)
+CondDoTarget(int argLen __unused, const char *arg)
 {
 GNode   *gn;
 
@@ -452,7 +452,7 @@
  *---
  */
 static Boolean
-CondDoCommands(int argLen, const char *arg)
+CondDoCommands(int argLen __unused, const char *arg)
 {
 GNode   *gn;
 
@@ -790,7 +790,7 @@
 }
 
 static int
-get_mpt_arg(char **linePtr, char **argPtr, const char *func)
+get_mpt_arg(char **linePtr, char **argPtr, const char *func __unused)
 {
 /*
  * Use Var_Parse to parse the spec in parens and return
@@ -831,7 +831,7 @@
 }
 
 static Boolean
-CondDoEmpty(int arglen, const char *arg)
+CondDoEmpty(int arglen, const char *arg __unused)
 {
 return arglen == 1;
 }

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.194 src/usr.bin/make/main.c:1.195
--- src/usr.bin/make/main.c:1.194	Sat Dec 25 20:34:08 2010
+++ src/usr.bin/make/main.c	Sun Feb 13 21:24:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.194 2010/12/25 20:34:08 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: main.c,v 1.194 2010/12/25 20:34:08 dholland Exp $;
+static char rcsid[] = $NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.3 (Berkeley) 3/19/94;
 #else
-__RCSID($NetBSD: main.c,v 1.194 2010/12/25 20:34:08 dholland Exp $);
+__RCSID($NetBSD: main.c,v 1.195 2011/02/13 21:24:43 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -706,7 +706,7 @@
 #ifdef SIGINFO
 /*ARGSUSED*/
 static void
-siginfo(int signo)
+siginfo(int signo __unused)
 {
 	char dir[MAXPATHLEN];
 	char str[2 * MAXPATHLEN];



CVS commit: src/lib/libc/time

2011-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 13 23:58:40 UTC 2011

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

Log Message:
Don't forget to set errno. Pointed out by yamt.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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/localtime.c
diff -u src/lib/libc/time/localtime.c:1.54 src/lib/libc/time/localtime.c:1.55
--- src/lib/libc/time/localtime.c:1.54	Sat Jan 15 10:42:10 2011
+++ src/lib/libc/time/localtime.c	Sun Feb 13 18:58:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.54 2011/01/15 15:42:10 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.55 2011/02/13 23:58:40 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.54 2011/01/15 15:42:10 christos Exp $);
+__RCSID($NetBSD: localtime.c,v 1.55 2011/02/13 23:58:40 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1477,7 +1477,12 @@
 struct tm *
 gmtime(const time_t *const timep)
 {
-	return gmtsub(NULL, timep, 0L, tm);
+	struct tm *tmp = gmtsub(NULL, timep, 0L, tm);
+
+	if (tmp == NULL)
+		errno = EOVERFLOW;
+
+	return tmp;
 }
 
 /*
@@ -1487,7 +1492,12 @@
 struct tm *
 gmtime_r(const time_t * const timep, struct tm *tmp)
 {
-	return gmtsub(NULL, timep, 0L, tmp);
+	tmp = gmtsub(NULL, timep, 0L, tmp);
+
+	if (tmp == NULL)
+		errno = EOVERFLOW;
+
+	return tmp;
 }
 
 #ifdef STD_INSPIRED
@@ -1495,13 +1505,23 @@
 struct tm *
 offtime(const time_t *const timep, long offset)
 {
-	return gmtsub(NULL, timep, offset, tm);
+	struct tm *tmp = gmtsub(NULL, timep, offset, tm);
+
+	if (tmp == NULL)
+		errno = EOVERFLOW;
+
+	return tmp;
 }
 
 struct tm *
 offtime_r(const time_t *timep, long offset, struct tm *tmp)
 {
-	return gmtsub(NULL, timep, offset, tmp);
+	tmp = gmtsub(NULL, timep, offset, tmp);
+
+	if (tmp == NULL)
+		errno = EOVERFLOW;
+
+	return tmp;
 }
 
 #endif /* defined STD_INSPIRED */



CVS commit: src/usr.sbin/iostat

2011-02-13 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Feb 14 02:42:26 UTC 2011

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

Log Message:
Put space after comma and around binary operator.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/iostat/iostat.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/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.57 src/usr.sbin/iostat/iostat.c:1.58
--- src/usr.sbin/iostat/iostat.c:1.57	Sun Jan  9 03:35:23 2011
+++ src/usr.sbin/iostat/iostat.c	Mon Feb 14 02:42:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.57 2011/01/09 03:35:23 jakllsch Exp $	*/
+/*	$NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)iostat.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: iostat.c,v 1.57 2011/01/09 03:35:23 jakllsch Exp $);
+__RCSID($NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -327,7 +327,7 @@
 		else
 			mbps = 0.0;
 		(void)printf( %5.*f,
-		MAX(0,3-(int)floor(log10(fabs(fmax(1.0,mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
 
 	/* average transfers per second. */
 		(void)printf( %4.0f,
@@ -345,7 +345,7 @@
 			mbps = 0;
 		mbps /= etime;
 		(void)printf( %5.*f ,
-		MAX(0,3-(int)floor(log10(fabs(fmax(1.0,mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
 	}
 }
 



CVS commit: src/usr.sbin/iostat

2011-02-13 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Feb 14 02:43:37 UTC 2011

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

Log Message:
A number greater than or equal to 1.0 is a positive number.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/iostat/iostat.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/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.58 src/usr.sbin/iostat/iostat.c:1.59
--- src/usr.sbin/iostat/iostat.c:1.58	Mon Feb 14 02:42:26 2011
+++ src/usr.sbin/iostat/iostat.c	Mon Feb 14 02:43:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $	*/
+/*	$NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)iostat.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $);
+__RCSID($NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -327,7 +327,7 @@
 		else
 			mbps = 0.0;
 		(void)printf( %5.*f,
-		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fmax(1.0, mbps, mbps);
 
 	/* average transfers per second. */
 		(void)printf( %4.0f,
@@ -345,7 +345,7 @@
 			mbps = 0;
 		mbps /= etime;
 		(void)printf( %5.*f ,
-		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fmax(1.0, mbps, mbps);
 	}
 }
 



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

2011-02-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 14 03:18:11 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: cpu.c cpuvar.h db_interface.c

Log Message:
add a mach xcall command to dump info about each cpus xpmsg{} values.

while here, move the prototype for cpu_debug_dump() to cpuvar.h and
avoid the copy in db_interface.c.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/sparc/sparc/db_interface.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/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.228 src/sys/arch/sparc/sparc/cpu.c:1.229
--- src/sys/arch/sparc/sparc/cpu.c:1.228	Fri Feb  4 09:23:00 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Mon Feb 14 03:18:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.229 2011/02/14 03:18:10 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.229 2011/02/14 03:18:10 mrg Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -80,6 +80,7 @@
 #include machine/pmap.h
 
 #if defined(MULTIPROCESSOR)  defined(DDB)
+#include ddb/db_output.h
 #include machine/db_machdep.h
 #endif
 
@@ -2165,8 +2166,6 @@
 
 #include ioconf.h
 
-void cpu_debug_dump(void);
-
 /*
  * Dump CPU information from ddb.
  */
@@ -2189,4 +2188,35 @@
 		ci-curpcb);
 	}
 }
+
+#if defined(MULTIPROCESSOR)
+/*
+ * Dump CPU xcall from ddb.
+ */
+void
+cpu_xcall_dump(void)
+{
+	struct cpu_info *ci;
+	CPU_INFO_ITERATOR cii;
+
+	db_printf(%-4s %-10s %-10s %-10s %-10s %-10s 
+		%-4s %-4s %-4s\n,
+	  CPU#, FUNC, TRAP, ARG0, ARG1, ARG2,
+	TAG, RECV, COMPL);
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		db_printf(%-4d %-10p %-10p 0x%-8x 0x%-8x 0x%-8x 
+			%-4d %-4d %-4d\n,
+		ci-ci_cpuid,
+		ci-msg.u.xpmsg_func.func,
+		ci-msg.u.xpmsg_func.trap,
+		ci-msg.u.xpmsg_func.arg0,
+		ci-msg.u.xpmsg_func.arg1,
+		ci-msg.u.xpmsg_func.arg2,
+		ci-msg.tag,
+		ci-msg.received,
+		ci-msg.complete);
+	}
+}
+#endif
+
 #endif

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.86 src/sys/arch/sparc/sparc/cpuvar.h:1.87
--- src/sys/arch/sparc/sparc/cpuvar.h:1.86	Thu Jan 27 06:24:59 2011
+++ src/sys/arch/sparc/sparc/cpuvar.h	Mon Feb 14 03:18:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.86 2011/01/27 06:24:59 mrg Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.87 2011/02/14 03:18:10 mrg Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -496,5 +496,12 @@
 
 #define cpuinfo	(*(struct cpu_info *)CPUINFO_VA)
 
+#if defined(DDB) || defined(MULTIPROCESSOR)
+/*
+ * These are called by ddb mach functions.
+ */
+void cpu_debug_dump(void);
+void cpu_xcall_dump(void);
+#endif
 
 #endif	/* _sparc_cpuvar_h */

Index: src/sys/arch/sparc/sparc/db_interface.c
diff -u src/sys/arch/sparc/sparc/db_interface.c:1.87 src/sys/arch/sparc/sparc/db_interface.c:1.88
--- src/sys/arch/sparc/sparc/db_interface.c:1.87	Sat Nov  6 11:46:02 2010
+++ src/sys/arch/sparc/sparc/db_interface.c	Mon Feb 14 03:18:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.87 2010/11/06 11:46:02 uebayasi Exp $ */
+/*	$NetBSD: db_interface.c,v 1.88 2011/02/14 03:18:11 mrg Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.87 2010/11/06 11:46:02 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.88 2011/02/14 03:18:11 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -201,6 +201,7 @@
 void db_uvmhistdump(db_expr_t, bool, db_expr_t, const char *);
 #ifdef MULTIPROCESSOR
 void db_cpu_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_xcall_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif
 void db_page_cmd(db_expr_t, bool, db_expr_t, const char *);
 
@@ -447,7 +448,6 @@
 }
 
 #if defined(MULTIPROCESSOR)
-extern void cpu_debug_dump(void); /* XXX */
 
 void
 db_cpu_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
@@ -482,6 +482,12 @@
 	ddb_cpuinfo = ci;
 }
 
+void
+db_xcall_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
+{
+	cpu_xcall_dump();
+}
+
 #endif /* MULTIPROCESSOR */
 
 const struct db_command db_machine_command_table[] = {
@@ -500,6 +506,8 @@
 #ifdef MULTIPROCESSOR
 	{ DDB_ADD_CMD(cpu,	db_cpu_cmd,	0,
 	  switch to another cpu's registers, cpu-no, NULL) },
+	{ DDB_ADD_CMD(xcall,	db_xcall_cmd,	0,
+	  show xcall information on all cpus, NULL, NULL) },
 #endif
 	{ DDB_ADD_CMD(NULL, NULL,   0,	NULL,NULL,NULL) }
 };



CVS commit: src/sys/arch/sandpoint/stand/altboot

2011-02-13 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Mon Feb 14 06:21:29 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c globals.h pci.c

Log Message:
- add preliminary Netronics NH230 and NH231 supports.
- assign PCI configuration register 0x3c with IDSEL value by PCI framework,
  eliminating most of pcifixup() logic in simple NASes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/stand/altboot/globals.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/pci.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.4 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.5
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.4	Thu Feb 10 13:38:08 2011
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Mon Feb 14 06:21:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.4 2011/02/10 13:38:08 nisimura Exp $ */
+/* $NetBSD: brdsetup.c,v 1.5 2011/02/14 06:21:29 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -54,6 +54,7 @@
 BRD_DECL(qnap);
 BRD_DECL(iomega);
 BRD_DECL(dlink);
+BRD_DECL(nhnas);
 
 static struct brdprop brdlist[] = {
 {
@@ -62,21 +63,21 @@
 	BRD_SANDPOINTX3,
 	0,
 	com, 0x3f8, 115200,
-	motsetup, motbrdfix, motpcifix },
+	motsetup, motbrdfix, motpcifix, NULL },
 {
 	encpp1,
 	EnCore PP1,
 	BRD_ENCOREPP1,
 	0,
 	com, 0x3f8, 115200,
-	encsetup, encbrdfix, encpcifix },
+	encsetup, encbrdfix, encpcifix, NULL },
 {
 	kurobox,
 	KuroBox,
 	BRD_KUROBOX,
 	32768000,
 	eumb, 0x4600, 57600,
-	kurosetup, kurobrdfix, kuropcifix },
+	kurosetup, kurobrdfix, NULL, NULL },
 {
 	synology,
 	Synology DS,
@@ -84,35 +85,42 @@
 	33164691,	/* from Synology/Linux source */
 	/* 33168000,		XXX better precision? */
 	eumb, 0x4500, 115200,
-	synosetup, synobrdfix, synopcifix, synoreset },
+	NULL, synobrdfix, NULL, synoreset },
 {
 	qnap,
 	QNAP TS-101,
 	BRD_QNAPTS101,
 	0,
 	eumb, 0x4500, 115200,
-	NULL, NULL, qnappcifix },
+	NULL, qnapbrdfix, NULL, NULL },
 {
 	iomega,
 	IOMEGA StorCenter,
 	BRD_STORCENTER,
 	0,
 	eumb, 0x4500, 115200,
-	NULL, iomegabrdfix, iomegapcifix },
+	NULL, iomegabrdfix, NULL, NULL },
 {
 	dlink,
 	D-Link DSM-G600,
 	BRD_DLINKDSM,
 	0,
 	eumb, 0x4500, 9600,
-	NULL, dlinkbrdfix, dlinkpcifix },
+	NULL, dlinkbrdfix, NULL, NULL },
+{
+	nhnas,
+	Netronics NH230/231,
+	BRD_NH230NAS,
+	0,
+	eumb, 0x4500, 9600,
+	NULL, nhnasbrdfix, NULL, NULL },
 {
 	unknown,
 	Unknown board,
 	BRD_UNKNOWN,
 	0,
 	eumb, 0x4500, 115200,
-	NULL, NULL, NULL }, /* must be the last */
+	NULL, NULL, NULL, NULL }, /* must be the last */
 };
 
 static struct brdprop *brdprop;
@@ -169,7 +177,7 @@
 	char *consname;
 	int consport;
 	uint32_t extclk;
-	unsigned pchb, pcib, val;
+	unsigned pchb, pcib, dev11, dev13, dev15, dev16, val;
 	extern struct btinfo_memory bi_mem;
 	extern struct btinfo_console bi_cons;
 	extern struct btinfo_clock bi_clk;
@@ -190,33 +198,44 @@
 	extclk = EXT_CLK_FREQ;	/* usually 33MHz */
 	busclock = 0;
 
+	dev11 = pcimaketag(0, 11, 0);
+	dev13 = pcimaketag(0, 13, 0);
+	dev15 = pcimaketag(0, 15, 0);
+	dev16 = pcimaketag(0, 16, 0);
+
 	if (pcifinddev(0x10ad, 0x0565, pcib) == 0) {
+		/* WinBond 553 southbridge at dev 11 */
 		brdtype = BRD_SANDPOINTX3;
 	}
 	else if (pcifinddev(0x1106, 0x0686, pcib) == 0) {
+		/* VIA 686B southbridge at dev 22 */
 		brdtype = BRD_ENCOREPP1;
 	}
-	else if ((pcicfgread(pcimaketag(0, 11, 0), PCI_CLASS_REG)  16) ==
-	PCI_CLASS_ETH) {
-		/* tlp (ADMtek AN985) or re (RealTek 8169S) at dev 11 */
+	else if ((pcicfgread(dev11, PCI_CLASS_REG)  16) == PCI_CLASS_ETH) {
+		/* ADMtek AN985 (tlp) or RealTek 8169S (re) at dev 11 */
 		brdtype = BRD_KUROBOX;
 	}
-	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 15, 0), PCI_ID_REG)) ==
-	0x11ab) {/* PCI_VENDOR_MARVELL */
+	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x11ab) {
+		/* SKnet/Marvell (sk) at dev 15 */
 		brdtype = BRD_SYNOLOGY;
 	}
-	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 15, 0), PCI_ID_REG)) ==
-	0x8086) {/* PCI_VENDOR_INTEL */
+	else if (PCI_VENDOR(pcicfgread(dev15, PCI_ID_REG)) == 0x8086) {
+		/* Intel (wm) at dev 15 */
 		brdtype = BRD_QNAPTS101;
 	}
-	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 13, 0), PCI_ID_REG)) ==
-	0x1106) {/* PCI_VENDOR_VIA */
+	else if (PCI_VENDOR(pcicfgread(dev13, PCI_ID_REG)) == 0x1106) {
+		/* VIA 6410 (viaide) at dev 13 */
 		brdtype = BRD_STORCENTER;
 	}
-	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 16, 0), PCI_ID_REG)) ==
-	0x1191) {/* PCI_VENDOR_ACARD */
+	else if (PCI_VENDOR(pcicfgread(dev16, PCI_ID_REG)) == 0x1191) {
+		/* ACARD ATP865 (acardide) at dev 16 */
 		brdtype = BRD_DLINKDSM;
 	}
+	else if (PCI_VENDOR(pcicfgread(dev16,