CVS commit: src/tests/fs/puffs

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Aug 27 05:34:46 UTC 2010

Modified Files:
src/tests/fs/puffs: t_basic.c

Log Message:
Now that atf issue #53 has been fixed, remove the
child-must-dies-before-parent kludge.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/puffs/t_basic.c

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/puffs/t_basic.c
diff -u src/tests/fs/puffs/t_basic.c:1.7 src/tests/fs/puffs/t_basic.c:1.8
--- src/tests/fs/puffs/t_basic.c:1.7	Fri Jul 30 16:15:06 2010
+++ src/tests/fs/puffs/t_basic.c	Fri Aug 27 05:34:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.7 2010/07/30 16:15:06 pooka Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.8 2010/08/27 05:34:46 pooka Exp $	*/
 
 #include 
 #include 
@@ -131,14 +131,6 @@
 	if (rump_sys_unmount("/mp", 0) == -1)
 		atf_tc_fail_errno("unmount");
 #endif
-
-	/*
-	 * XXX2: due to atf issue #53, we must make sure the child dies
-	 * before we exit.
-	 */
-	signal(SIGCHLD, SIG_IGN);
-	if (kill(pargs->pta_childpid, SIGTERM) == -1)
-		atf_tc_fail_errno("kill");
 }
 
 ATF_TC(root_fifo);



CVS commit: src

2010-08-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Aug 27 03:05:26 UTC 2010

Modified Files:
src/share/man/man4: acpicpu.4
src/sys/dev/acpi: acpi_cpu.c acpi_cpu.h

Log Message:
Fix PR kern/43765 from Scott Ellis.

Note that the solution is not optimal. If ichlpcib(4) provides SpeedStep
support, possible I/O resource conflicts may occur with acpicpu(4). Ideally,
as noted for instance in Windows design documents, ichlpcib(4) should never
expose SpeedStep when ACPI is being used. The probability for potential race
conditions is however very small, being limited to few P4-era machines and
being dependent on user actions.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/acpicpu.4
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/acpi/acpi_cpu.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/acpi/acpi_cpu.h

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

Modified files:

Index: src/share/man/man4/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.15 src/share/man/man4/acpicpu.4:1.16
--- src/share/man/man4/acpicpu.4:1.15	Tue Aug 24 07:27:59 2010
+++ src/share/man/man4/acpicpu.4	Fri Aug 27 03:05:26 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpicpu.4,v 1.15 2010/08/24 07:27:59 jruoho Exp $
+.\" $NetBSD: acpicpu.4,v 1.16 2010/08/27 03:05:26 jruoho Exp $
 .\"
 .\" Coyright (c) 2010 Jukka Ruohonen 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 24, 2010
+.Dd August 27, 2010
 .Dt ACPICPU 4
 .Os
 .Sh NAME
@@ -284,13 +284,18 @@
 driver conflicts with the following kernel configuration
 .Xr options 4 :
 .Dv ENHANCED_SPEEDSTEP ,
-.Dv INTEL_ONDEMAND_CLOCKMOD ,
-.Dv POWERNOW_K7 ,
+.Dv POWERNOW_K8 ,
 and
-.Dv POWERNOW_K8 .
+.Dv INTEL_ONDEMAND_CLOCKMOD .
 These options must be disabled if
 .Nm
 is used.
+Furthermore, in the unlikely case where both
+.Nm
+and
+.Xr ichlpcib 4
+provides support for P-states,
+either one but not both may be used.
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr acpitz 4 ,

Index: src/sys/dev/acpi/acpi_cpu.c
diff -u src/sys/dev/acpi/acpi_cpu.c:1.21 src/sys/dev/acpi/acpi_cpu.c:1.22
--- src/sys/dev/acpi/acpi_cpu.c:1.21	Fri Aug 27 02:44:05 2010
+++ src/sys/dev/acpi/acpi_cpu.c	Fri Aug 27 03:05:26 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.22 2010/08/27 03:05:26 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.22 2010/08/27 03:05:26 jruoho Exp $");
 
 #include 
 #include 
@@ -115,9 +115,7 @@
 
 	sc->sc_dev = self;
 	sc->sc_cold = true;
-	sc->sc_mapped = false;
 	sc->sc_passive = false;
-	sc->sc_iot = aa->aa_iot;
 	sc->sc_node = aa->aa_node;
 	sc->sc_cpuid = acpicpu_id(sc->sc_object.ao_procid);
 
@@ -141,20 +139,6 @@
 
 	mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
 
-	/*
-	 * We should claim the bus space. However, we do this only
-	 * to announce that the space is in use. As is noted in
-	 * ichlpcib(4), we can continue our I/O without bus_space(9).
-	 */
-	if (sc->sc_object.ao_pblklen == 6 && sc->sc_object.ao_pblkaddr != 0) {
-
-		rv = bus_space_map(sc->sc_iot, sc->sc_object.ao_pblkaddr,
-		sc->sc_object.ao_pblklen, 0, &sc->sc_ioh);
-
-		if (rv == 0)
-			sc->sc_mapped = true;
-	}
-
 	acpicpu_cstate_attach(self);
 	acpicpu_pstate_attach(self);
 	acpicpu_tstate_attach(self);
@@ -168,7 +152,6 @@
 acpicpu_detach(device_t self, int flags)
 {
 	struct acpicpu_softc *sc = device_private(self);
-	const bus_addr_t addr = sc->sc_object.ao_pblkaddr;
 	static ONCE_DECL(once_detach);
 	int rv = 0;
 
@@ -198,9 +181,6 @@
 	if (rv != 0)
 		return rv;
 
-	if (sc->sc_mapped != false)
-		bus_space_unmap(sc->sc_iot, sc->sc_ioh, addr);
-
 	mutex_destroy(&sc->sc_mtx);
 
 	return 0;

Index: src/sys/dev/acpi/acpi_cpu.h
diff -u src/sys/dev/acpi/acpi_cpu.h:1.24 src/sys/dev/acpi/acpi_cpu.h:1.25
--- src/sys/dev/acpi/acpi_cpu.h:1.24	Tue Aug 24 07:27:59 2010
+++ src/sys/dev/acpi/acpi_cpu.h	Fri Aug 27 03:05:26 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.24 2010/08/24 07:27:59 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.25 2010/08/27 03:05:26 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen 
@@ -201,14 +201,10 @@
 	uint32_t		 sc_tstate_min;
 
 	kmutex_t		 sc_mtx;
-	bus_space_tag_t		 sc_iot;
-	bus_space_handle_t	 sc_ioh;
-
 	uint32_t		 sc_cap;
 	uint32_t		 sc_flags;
 	cpuid_t			 sc_cpuid;
 	bool			 sc_cold;
-	bool			 sc_mapped;
 	bool			 sc_passive;
 };
 



CVS commit: src/sys/dev/acpi

2010-08-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Aug 27 02:44:05 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_cpu.c acpireg.h

Log Message:
>From jmcneill@: fix and rework the obscure _OSC evaluation.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/acpi_cpu.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/acpi/acpireg.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/acpi/acpi_cpu.c
diff -u src/sys/dev/acpi/acpi_cpu.c:1.20 src/sys/dev/acpi/acpi_cpu.c:1.21
--- src/sys/dev/acpi/acpi_cpu.c:1.20	Thu Aug 19 05:09:53 2010
+++ src/sys/dev/acpi/acpi_cpu.c	Fri Aug 27 02:44:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.20 2010/08/19 05:09:53 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.20 2010/08/19 05:09:53 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $");
 
 #include 
 #include 
@@ -57,10 +57,9 @@
 static int		  acpicpu_object(ACPI_HANDLE, struct acpicpu_object *);
 static cpuid_t		  acpicpu_id(uint32_t);
 static uint32_t		  acpicpu_cap(struct acpicpu_softc *);
-static ACPI_OBJECT	 *acpicpu_cap_init(void);
-static ACPI_STATUS	  acpicpu_cap_pdc(ACPI_HANDLE);
-static ACPI_STATUS	  acpicpu_cap_osc(ACPI_HANDLE, uint32_t *);
-static const char	 *acpicpu_cap_oscerr(uint32_t);
+static ACPI_STATUS	  acpicpu_cap_pdc(struct acpicpu_softc *, uint32_t);
+static ACPI_STATUS	  acpicpu_cap_osc(struct acpicpu_softc *,
+	  uint32_t, uint32_t *);
 static void		  acpicpu_notify(ACPI_HANDLE, uint32_t, void *);
 static bool		  acpicpu_suspend(device_t, const pmf_qual_t *);
 static bool		  acpicpu_resume(device_t, const pmf_qual_t *);
@@ -132,6 +131,9 @@
 		return;
 	}
 
+	aprint_naive("\n");
+	aprint_normal(": ACPI CPU\n");
+
 	acpicpu_sc[sc->sc_cpuid] = sc;
 
 	sc->sc_cap = acpicpu_cap(sc);
@@ -139,9 +141,6 @@
 
 	mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
 
-	aprint_naive("\n");
-	aprint_normal(": ACPI CPU\n");
-
 	/*
 	 * We should claim the bus space. However, we do this only
 	 * to announce that the space is in use. As is noted in
@@ -334,150 +333,171 @@
 static uint32_t
 acpicpu_cap(struct acpicpu_softc *sc)
 {
-	uint32_t cap[3] = { 0 };
+	uint32_t flags, cap = 0;
+	const char *str;
 	ACPI_STATUS rv;
-	int err;
 
 	/*
-	 * Set machine-dependent processor capabilities.
-	 *
-	 * The _PDC was deprecated in ACPI 3.0 in favor of the _OSC,
-	 * but firmware may expect that we evaluate it nevertheless.
+	 * Query and set machine-dependent capabilities.
+	 * Note that the Intel-specific _PDC method was
+	 * deprecated in the ACPI 3.0 in favor of _OSC.
 	 */
-	rv = acpicpu_cap_pdc(sc->sc_node->ad_handle);
+	flags = acpicpu_md_cap();
+	rv = acpicpu_cap_osc(sc, flags, &cap);
 
-	if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND)
-		aprint_error_dev(sc->sc_dev, "failed to evaluate _PDC: "
-		"%s\n", AcpiFormatException(rv));
+	if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND) {
+		str = "_OSC";
+		goto fail;
+	}
 
-	rv = acpicpu_cap_osc(sc->sc_node->ad_handle, cap);
+	rv = acpicpu_cap_pdc(sc, flags);
 
-	if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND)
-		aprint_error_dev(sc->sc_dev, "failed to evaluate _OSC: "
-		"%s\n", AcpiFormatException(rv));
+	if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND) {
+		str = "_PDC";
+		goto fail;
+	}
 
-	if (ACPI_SUCCESS(rv)) {
+	if (cap == 0)
+		cap = flags;
 
-		err = cap[0] & ~__BIT(0);
+	return cap;
 
-		if (err != 0) {
-			aprint_error_dev(sc->sc_dev, "errors in "
-			"_OSC: %s\n", acpicpu_cap_oscerr(err));
-			cap[2] = 0;
-		}
-	}
+fail:
+	aprint_error_dev(sc->sc_dev, "failed to evaluate "
+	"%s: %s\n", str, AcpiFormatException(rv));
 
-	return cap[2];
+	return 0;
 }
 
-static ACPI_OBJECT *
-acpicpu_cap_init(void)
+static ACPI_STATUS
+acpicpu_cap_pdc(struct acpicpu_softc *sc, uint32_t flags)
 {
-	static uint32_t cap[3];
-	static ACPI_OBJECT obj;
+	ACPI_OBJECT_LIST arg;
+	ACPI_OBJECT obj;
+	uint32_t cap[3];
+
+	arg.Count = 1;
+	arg.Pointer = &obj;
 
 	cap[0] = ACPICPU_PDC_REVID;
 	cap[1] = 1;
-	cap[2] = acpicpu_md_cap();
+	cap[2] = flags;
 
 	obj.Type = ACPI_TYPE_BUFFER;
 	obj.Buffer.Length = sizeof(cap);
-	obj.Buffer.Pointer = (uint8_t *)cap;
+	obj.Buffer.Pointer = (void *)cap;
 
-	return &obj;
+	return AcpiEvaluateObject(sc->sc_node->ad_handle, "_PDC", &arg, NULL);
 }
 
 static ACPI_STATUS
-acpicpu_cap_pdc(ACPI_HANDLE hdl)
+acpicpu_cap_osc(struct acpicpu_softc *sc, uint32_t flags, uint32_t *val)
 {
-	ACPI_OBJECT_LIST arg_list;
-
-	arg_list.Count = 1;
-	arg_list.Pointer = acpicpu_cap_init();
-
-	return AcpiEvaluateObject(hdl, "_PDC", &arg_list, NULL);
-}
-
-static ACPI_STATUS
-acpicpu_cap_osc(ACPI_HANDLE hdl, uint32_t *val)
-{
-	ACPI_OBJECT_LIST arg_list;
-	ACPI_OBJECT *cap, *obj;
-	ACPI_OBJECT arg[4];
+	ACPI_OBJECT_L

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

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 22:48:37 UTC 2010

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

Log Message:
update a bit


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/librump/rumpkern/rump.3

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.3
diff -u src/sys/rump/librump/rumpkern/rump.3:1.8 src/sys/rump/librump/rumpkern/rump.3:1.9
--- src/sys/rump/librump/rumpkern/rump.3:1.8	Tue May 11 09:45:59 2010
+++ src/sys/rump/librump/rumpkern/rump.3	Thu Aug 26 22:48:36 2010
@@ -1,6 +1,6 @@
-.\" $NetBSD: rump.3,v 1.8 2010/05/11 09:45:59 pooka Exp $
+.\" $NetBSD: rump.3,v 1.9 2010/08/26 22:48:36 pooka Exp $
 .\"
-.\" Copyright (c) 2008 Antti Kantee.  All rights reserved.
+.\" Copyright (c) 2008-2010 Antti Kantee.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,90 +23,122 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 25, 2009
+.Dd August 26, 2010
 .Dt RUMP 3
 .Os
 .Sh NAME
 .Nm rump
-.Nd rump kernel
+.Nd The Rump Anykernel
 .Sh LIBRARY
 rump Library (librump, \-lrump)
 .Sh SYNOPSIS
 .In rump/rump.h
 .In rump/rump_syscalls.h
-.In rump/rumpvnode_if.h
 .Sh DESCRIPTION
 .Nm
-emulates portions of the kernel in order to be able to run kernel code
-from a userspace application.
-For most parts kernel code is directly used, but in some cases such as
-with vm and device drivers a reimplementation suitable for userspace
-is provided.
-All of the routines in
-.Nm
-have been compiled in the kernel namespace with
-.Dv \-D_KERNEL .
-.Pp
-Although
-.Nm
-includes many kernel routines directly, userspace applications should
-not attempt to include
-.Nx
-system headers and call kernel functions directly.
-Instead,
-.Nm
-routines should be called.
-In case applications attempt to include
-.In sys
-headers from the
-.Nx
-tree, collisions will result on other platforms.
-.Pp
-Three classes of routines are provided by
-.Nm :
-.Bl -tag -width XXX -offset indent
-.It Native
-These routines have been handwritten for
-.Nm
-operation.
-Some are useful purely for
-.Nm ,
-while others are merely interfaces to existing kernel routines.
-An example of the former is
-.Fn rump_fakeblk_register ,
-while an example of the latter class is
-.Fn rump_vfs_unmount .
-.Pp
-The routines available in this class can be found from the header
-.In rump.h .
-.It System Calls
-It is possible to execute certain system calls from
-.Nm .
-However, contrary to real system calls, the kernel is never entered,
-but the system call backend code compiled into
-.Nm
-is merely called as a direct function call.
+is part of the realization of a flexible anykernel architecture for
+.Nx .
+An anykernel architecture enables using kernel code in a number of
+different kernel models.
+These models include, but are not limited to, the original monolithic
+kernel, a microkernel server, or an exokernel style application
+library.
+.Nm
+itself makes it possible to run unmodified kernel components in a regular
+userspace process.
+Most of the time "unmodified" means unmodified source code, but some
+architectures can also execute unmodified kernel module binaries
+in userspace.
+Examples of different use models are running file system drivers
+as userspace servers (see
+.Xr p2k 3 )
+and being able to write standalone applications which understand
+file system images.
+.Pp
+Regardless of the kernel model used, a rump kernel is a fullfledged
+kernel with its own virtual namespaces,
+including a file system hierarchy, CPUs, TCP/UDP
+ports, device driver attachments and file descriptors.
+This means that any modification to the system state on the host
+running the rump kernel will not show up in the rump kernel and
+vice versa.
+A rump kernel may also be significantly more lightweight that the
+host, and might not include include for example file system support
+at all.
 .Pp
-The autogenerated list of system calls currently available in
-.Nm
-can be found from the header
-.In rump_syscalls.h .
-.It Vnode Interface
-To sort out namespace collisions for
-.Pf non- Nx
-platforms, the whole
-vnode interface set is provided under a special namespace.
-The operation is the same as in the kernel, but the interface names
-begin with the prefix RUMP_VOP.
-.Pp
-This class of routines is available from the autogenerated header
-.In rumpvnode_if.h .
+A rump kernel is bootstrapped by calling
+.Fn rump_init .
+Before bootstrapping the kernel, it is possible to control its
+functionality by setting various environment variables:
+.Bl -tag -width RUMP_MEMLIMITXX
+.It Dv RUMP_NCPU
+If set, indicates the number of virtual CPUs configured into a
+rump kernel.
+The default is the number of host CPUs.
+The numb

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2010-08-26 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug 26 20:09:33 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c rmixl_pcie.c
rmixl_pcix.c

Log Message:
Fix non-DEBUG/DIAGNOSTIC builds of RMI mips64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/sys/arch/mips/rmi/rmixl_intr.c
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/arch/mips/rmi/rmixl_pcie.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixl_pcix.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_intr.c
diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.22 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.23
--- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.22	Thu Jun 10 00:41:43 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.c	Thu Aug 26 20:09:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.c,v 1.1.2.22 2010/06/10 00:41:43 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.c,v 1.1.2.23 2010/08/26 20:09:33 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.1.2.22 2010/06/10 00:41:43 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.1.2.23 2010/08/26 20:09:33 rmind Exp $");
 
 #include "opt_ddb.h"
 #define	__INTR_PRIVATE
@@ -373,7 +373,7 @@
 static int rmixl_ipi_intr(void *);
 #endif
 
-#if defined(IOINTR_DEBUG) || defined(DIAGNOSTIC)
+#if defined(DIAGNOSTIC) || defined(IOINTR_DEBUG) || defined(DDB)
 int  rmixl_intrhand_print_subr(int);
 int  rmixl_intrhand_print(void);
 int  rmixl_irt_print(void);

Index: src/sys/arch/mips/rmi/rmixl_pcie.c
diff -u src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.14 src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.15
--- src/sys/arch/mips/rmi/rmixl_pcie.c:1.1.2.14	Sat May  8 18:08:34 2010
+++ src/sys/arch/mips/rmi/rmixl_pcie.c	Thu Aug 26 20:09:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcie.c,v 1.1.2.14 2010/05/08 18:08:34 matt Exp $	*/
+/*	$NetBSD: rmixl_pcie.c,v 1.1.2.15 2010/08/26 20:09:33 rmind Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.1.2.14 2010/05/08 18:08:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.1.2.15 2010/08/26 20:09:33 rmind Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -1222,7 +1222,7 @@
 	u_int link, bitno, irq;
 	uint32_t r;
 	rmixl_pcie_link_intr_t *lip;
-	rmixl_pcie_link_dispatch_t *dip;
+	rmixl_pcie_link_dispatch_t *dip = NULL;
 	uint32_t bit;
 	u_int offset;
 	int s;

Index: src/sys/arch/mips/rmi/rmixl_pcix.c
diff -u src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.5 src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.6
--- src/sys/arch/mips/rmi/rmixl_pcix.c:1.1.2.5	Sat Apr 17 07:34:08 2010
+++ src/sys/arch/mips/rmi/rmixl_pcix.c	Thu Aug 26 20:09:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_pcix.c,v 1.1.2.5 2010/04/17 07:34:08 cliff Exp $	*/
+/*	$NetBSD: rmixl_pcix.c,v 1.1.2.6 2010/08/26 20:09:33 rmind Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.1.2.5 2010/04/17 07:34:08 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_pcix.c,v 1.1.2.6 2010/08/26 20:09:33 rmind Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -263,7 +263,7 @@
 
 static int rmixl_pcix_found;
 
-#if defined(DIAGNOSTIC) || defined(DEBUG) || defined(DDB)
+#ifdef DIAGNOSTIC
 static rmixl_pcix_softc_t *rmixl_pcix_sc;
 #endif
 



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

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 19:56:08 UTC 2010

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

Log Message:
print one line of dmesg per cpu present


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.181 src/sys/rump/librump/rumpkern/rump.c:1.182
--- src/sys/rump/librump/rumpkern/rump.c:1.181	Mon Aug 23 14:00:40 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Thu Aug 26 19:56:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.181 2010/08/23 14:00:40 pgoyette Exp $	*/
+/*	$NetBSD: rump.c,v 1.182 2010/08/26 19:56:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.181 2010/08/23 14:00:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.182 2010/08/26 19:56:07 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -336,6 +336,8 @@
 		pool_cache_cpu_init(ci);
 		selsysinit(ci);
 		percpu_init_cpu(ci);
+
+		aprint_verbose("cpu%d at thinair0: rump virtual cpu\n", i);
 	}
 
 	sysctl_init();



CVS commit: src/tests/fs/vfs

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 18:06:44 UTC 2010

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
chdir() once per process is enough, no need to do it for every
thread (and doing so would cause occasional failures when some
thread would cd out of the test mountpoint while another thread
was still running in there).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/vfs/t_renamerace.c

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/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.10 src/tests/fs/vfs/t_renamerace.c:1.11
--- src/tests/fs/vfs/t_renamerace.c:1.10	Thu Aug 26 15:07:16 2010
+++ src/tests/fs/vfs/t_renamerace.c	Thu Aug 26 18:06:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.10 2010/08/26 15:07:16 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.11 2010/08/26 18:06:44 pooka Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -32,7 +32,6 @@
 	int fd;
 
 	rump_pub_lwp_alloc_and_switch(0, 10);
-	rump_sys_chdir(arg);
 
 	while (!quittingtime) {
 		fd = rump_sys_open("rename.test1",
@@ -43,8 +42,6 @@
 		rump_sys_close(fd);
 	}
 
-	rump_sys_chdir("/");
-
 	return NULL;
 }
 
@@ -53,7 +50,6 @@
 {
 
 	rump_pub_lwp_alloc_and_switch(0, 10);
-	rump_sys_chdir(arg);
 
 	while (!quittingtime) {
 		if (rump_sys_mkdir("rename.test1", 0777) == -1)
@@ -61,8 +57,6 @@
 		rump_sys_rmdir("rename.test1");
 	}
 
-	rump_sys_chdir("/");
-
 	return NULL;
 }
 
@@ -71,14 +65,11 @@
 {
 
 	rump_pub_lwp_alloc_and_switch(0, 11);
-	rump_sys_chdir(arg);
 
 	while (!quittingtime) {
 		rump_sys_rename("rename.test1", "rename.test2");
 	}
 
-	rump_sys_chdir("/");
-
 	return NULL;
 }
 
@@ -95,11 +86,12 @@
 	if (FSTYPE_MSDOS(tc))
 		atf_tc_skip("test fails in some setups, reason unknown");
 
+	RL(rump_sys_chdir(mp));
 	for (i = 0; i < NWRK; i++)
-		pthread_create(&pt1[i], NULL, w1, __UNCONST(mp));
+		pthread_create(&pt1[i], NULL, w1, NULL);
 
 	for (i = 0; i < NWRK; i++)
-		pthread_create(&pt2[i], NULL, w2, __UNCONST(mp));
+		pthread_create(&pt2[i], NULL, w2, NULL);
 
 	sleep(5);
 	quittingtime = 1;
@@ -108,6 +100,7 @@
 		pthread_join(pt1[i], NULL);
 	for (i = 0; i < NWRK; i++)
 		pthread_join(pt2[i], NULL);
+	RL(rump_sys_chdir("/"));
 
 	/*
 	 * XXX: does not always fail on LFS, especially for unicpu
@@ -130,14 +123,16 @@
 	FSTYPE_MSDOS(tc))
 		atf_tc_expect_signal(-1, "PR kern/43626");
 
-	pthread_create(&pt1, NULL, w1_dirs, __UNCONST(mp));
-	pthread_create(&pt2, NULL, w2, __UNCONST(mp));
+	RL(rump_sys_chdir(mp));
+	pthread_create(&pt1, NULL, w1_dirs, NULL);
+	pthread_create(&pt2, NULL, w2, NULL);
 
 	sleep(5);
 	quittingtime = 1;
 
 	pthread_join(pt1, NULL);
 	pthread_join(pt2, NULL);
+	RL(rump_sys_chdir("/"));
 
 	/*
 	 * Doesn't always trigger when run on a slow backend



CVS commit: src/tests/net/icmp

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 17:24:15 UTC 2010

Modified Files:
src/tests/net/icmp: t_ping.c

Log Message:
setsockopt() wants int instead of size_t.  Should fix this on LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/net/icmp/t_ping.c

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

Modified files:

Index: src/tests/net/icmp/t_ping.c
diff -u src/tests/net/icmp/t_ping.c:1.7 src/tests/net/icmp/t_ping.c:1.8
--- src/tests/net/icmp/t_ping.c:1.7	Mon Aug 23 10:49:27 2010
+++ src/tests/net/icmp/t_ping.c	Thu Aug 26 17:24:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ping.c,v 1.7 2010/08/23 10:49:27 pooka Exp $	*/
+/*	$NetBSD: t_ping.c,v 1.8 2010/08/26 17:24:14 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: t_ping.c,v 1.7 2010/08/23 10:49:27 pooka Exp $");
+__RCSID("$NetBSD: t_ping.c,v 1.8 2010/08/26 17:24:14 pooka Exp $");
 #endif /* not lint */
 
 #include 
@@ -129,7 +129,7 @@
 }
 
 static int
-doping(const char *target, int loops, size_t pktsize)
+doping(const char *target, int loops, int pktsize)
 {
 	char sndbuf[IP_MAXPACKET - sizeof(struct ip)];
 	char recvbuf[IP_MAXPACKET];



CVS commit: src/share/man/man3

2010-08-26 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 26 16:42:28 UTC 2010

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

Log Message:
Apparently, you have to #include , too, for MAX().


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3/bits.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/bits.3
diff -u src/share/man/man3/bits.3:1.7 src/share/man/man3/bits.3:1.8
--- src/share/man/man3/bits.3:1.7	Mon Mar 22 12:39:22 2010
+++ src/share/man/man3/bits.3	Thu Aug 26 16:42:28 2010
@@ -1,6 +1,6 @@
-.\"	$NetBSD: bits.3,v 1.7 2010/03/22 12:39:22 jruoho Exp $
+.\"	$NetBSD: bits.3,v 1.8 2010/08/26 16:42:28 dyoung Exp $
 .\"
-.\" Copyright (c) 2006 David Young.  All rights reserved.
+.\" Copyright (c) 2006, 2010 David Young.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or
 .\" without modification, are permitted provided that the following
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 9, 2006
+.Dd August 26, 2010
 .Dt BITS 3
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Nm __SHIFTOUT_MASK
 .Nd "macros for preparing bitmasks and operating on bit fields"
 .Sh SYNOPSIS
+.In sys/param.h
 .In sys/cdefs.h
 .Ft uint32_t
 .Fn __BIT "n"



CVS commit: src/external

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 16:33:09 UTC 2010

Modified Files:
src/external: README

Log Message:
describe new historical license.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/README

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

Modified files:

Index: src/external/README
diff -u src/external/README:1.9 src/external/README:1.10
--- src/external/README:1.9	Sat May  1 15:51:33 2010
+++ src/external/README	Thu Aug 26 12:33:09 2010
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.9 2010/05/01 19:51:33 christos Exp $
+$NetBSD: README,v 1.10 2010/08/26 16:33:09 christos Exp $
 
 Organization of Sources:
 
@@ -59,6 +59,9 @@
 	gpl3		GNU Public License, version 3.
 			http://www.opensource.org/licenses/gpl-3.0.html
 
+	historical	Lucent's old license:
+			http://www.opensource.org/licenses/historical.php
+			
 	ibm-public	IBM's public license:
 			http://www.opensource.org/licenses/ibmpl.php
 



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

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 16:21:26 UTC 2010

Modified Files:
src/external/historical/nawk/bin: Makefile

Log Message:
Install in /usr/bin


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

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

Modified files:

Index: src/external/historical/nawk/bin/Makefile
diff -u src/external/historical/nawk/bin/Makefile:1.1 src/external/historical/nawk/bin/Makefile:1.2
--- src/external/historical/nawk/bin/Makefile:1.1	Thu Aug 26 10:57:16 2010
+++ src/external/historical/nawk/bin/Makefile	Thu Aug 26 12:21:25 2010
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile,v 1.1 2010/08/26 14:57:16 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/26 16:21:25 christos Exp $
 
 WARNS?= 4
 
 .include 
 
+BINDIR?= /usr/bin
 DIST=	${.CURDIR}/../dist
 .PATH:	${DIST}
 



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

2010-08-26 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Aug 26 15:28:31 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-c++: io.cpp io.hpp io_test.cpp
src/external/bsd/atf/dist/atf-run: test-program.cpp

Log Message:
Partially pull up the following revisions that address ticket #53:

996f9c26e07a86607f373c8f0243d57329c11543
ef98529abaf16e40a2e684496bf3da8f9ff0d09c

These prevent atf-run from stalling/crashing when a subprocess of a test
case stays around after the test case itself exits.

Reported, and verified working, by po...@.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/atf/dist/atf-c++/io.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c++/io.hpp
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c++/io_test.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/test-program.cpp

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

Modified files:

Index: src/external/bsd/atf/dist/atf-c++/io.cpp
diff -u src/external/bsd/atf/dist/atf-c++/io.cpp:1.1.1.3 src/external/bsd/atf/dist/atf-c++/io.cpp:1.2
--- src/external/bsd/atf/dist/atf-c++/io.cpp:1.1.1.3	Sat Jul  3 08:04:50 2010
+++ src/external/bsd/atf/dist/atf-c++/io.cpp	Thu Aug 26 15:28:31 2010
@@ -368,7 +368,8 @@
 }
 
 void
-impl::std_muxer::read(unbuffered_istream& out, unbuffered_istream& err)
+impl::std_muxer::read(unbuffered_istream& out, unbuffered_istream& err,
+  const bool& terminate)
 {
 struct pollfd fds[2];
 fds[0].fd = out.get_fh().get();
@@ -379,8 +380,15 @@
 do {
 fds[0].revents = 0;
 fds[1].revents = 0;
-if (::poll(fds, 2, -1) == -1)
-break;
+
+int ret;
+while ((ret = ::poll(fds, 2, 250)) <= 0) {
+if (terminate || ret == -1) {
+fds[0].events = 0;
+fds[1].events = 0;
+break;
+}
+}
 
 if (fds[0].revents & POLLIN) {
 std::string line;
@@ -388,7 +396,7 @@
 got_stdout_line(line);
 else
 fds[0].events &= ~POLLIN;
-} else if (fds[0].revents & POLLHUP)
+} else if (fds[0].revents & POLLERR || fds[0].revents & POLLHUP)
 fds[0].events &= ~POLLIN;
 
 if (fds[1].revents & POLLIN) {
@@ -397,7 +405,7 @@
 got_stderr_line(line);
 else
 fds[1].events &= ~POLLIN;
-} else if (fds[1].revents & POLLHUP)
+} else if (fds[1].revents & POLLERR || fds[1].revents & POLLHUP)
 fds[1].events &= ~POLLIN;
 } while (fds[0].events & POLLIN || fds[1].events & POLLIN);
 

Index: src/external/bsd/atf/dist/atf-c++/io.hpp
diff -u src/external/bsd/atf/dist/atf-c++/io.hpp:1.1.1.2 src/external/bsd/atf/dist/atf-c++/io.hpp:1.2
--- src/external/bsd/atf/dist/atf-c++/io.hpp:1.1.1.2	Sat May  8 08:05:21 2010
+++ src/external/bsd/atf/dist/atf-c++/io.hpp	Thu Aug 26 15:28:31 2010
@@ -578,7 +578,7 @@
 std_muxer(void);
 virtual ~std_muxer(void);
 
-void read(unbuffered_istream&, unbuffered_istream&);
+void read(unbuffered_istream&, unbuffered_istream&, const bool&);
 };
 
 // 

Index: src/external/bsd/atf/dist/atf-c++/io_test.cpp
diff -u src/external/bsd/atf/dist/atf-c++/io_test.cpp:1.1.1.1 src/external/bsd/atf/dist/atf-c++/io_test.cpp:1.2
--- src/external/bsd/atf/dist/atf-c++/io_test.cpp:1.1.1.1	Sat Jul  3 08:04:51 2010
+++ src/external/bsd/atf/dist/atf-c++/io_test.cpp	Thu Aug 26 15:28:31 2010
@@ -502,7 +502,8 @@
 atf::io::unbuffered_istream errs(errfh);
 
 test_std_muxer m;
-m.read(outs, errs);
+bool terminate = false;
+m.read(outs, errs, terminate);
 ATF_CHECK(m.m_eof);
 ATF_CHECK(m.m_stdout_lines.empty());
 ATF_CHECK(m.m_stderr_lines.empty());
@@ -530,7 +531,8 @@
 atf::io::unbuffered_istream errs(errfh);
 
 test_std_muxer m;
-m.read(outs, errs);
+bool terminate = false;
+m.read(outs, errs, terminate);
 ATF_CHECK(m.m_eof);
 ATF_CHECK_EQUAL(3, m.m_stdout_lines.size());
 ATF_CHECK_EQUAL("stdout line 1", m.m_stdout_lines[0]);

Index: src/external/bsd/atf/dist/atf-run/test-program.cpp
diff -u src/external/bsd/atf/dist/atf-run/test-program.cpp:1.3 src/external/bsd/atf/dist/atf-run/test-program.cpp:1.4
--- src/external/bsd/atf/dist/atf-run/test-program.cpp:1.3	Sat Jul  3 08:11:26 2010
+++ src/external/bsd/atf/dist/atf-run/test-program.cpp	Thu Aug 26 15:28:31 2010
@@ -646,6 +646,18 @@
 return detail::parse_test_case_result(line);
 }
 
+namespace {
+
+static bool sigchld_received;
+
+static void
+sigchld_handler(const int signo)
+{
+sigchld_received = true;
+}
+
+} // anonymous namespace
+
 std::pair< std::string, atf::process::status >
 impl::run_test_case(const atf::fs::path& executable,
 const std::string& test_case_name,

CVS commit: src/tests/fs

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 15:07:16 UTC 2010

Modified Files:
src/tests/fs/common: fstest_nfs.c
src/tests/fs/vfs: t_renamerace.c

Log Message:
Put the workaround for PR kern/43799 into the common nfs unmount routine.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_nfs.c
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/vfs/t_renamerace.c

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/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.3 src/tests/fs/common/fstest_nfs.c:1.4
--- src/tests/fs/common/fstest_nfs.c:1.3	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/fstest_nfs.c	Thu Aug 26 15:07:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.3 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.4 2010/08/26 15:07:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -196,11 +196,26 @@
 nfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
 	struct nfstestargs *args = theargs;
-	int status;
+	int status, i, sverrno;
 
-	if (rump_sys_unmount(path, flags) == -1) {
-		return errno;
+	/*
+	 * NFS handles sillyrenames in an workqueue.  Some of them might
+	 * be still in the queue even if all user activity has ceased.
+	 * We try to unmount for 2 seconds to give them a chance
+	 * to flush out.
+	 *
+	 * PR kern/43799
+	 */
+	for (i = 0; i < 20; i++) {
+		if ((status = rump_sys_unmount(path, flags)) == 0)
+			break;
+		sverrno = errno;
+		if (sverrno != EBUSY)
+			break;
+		usleep(10);
 	}
+	if (status == -1)
+		return sverrno;
 
 	/*
 	 * It's highly expected that the child will die next, so we

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.9 src/tests/fs/vfs/t_renamerace.c:1.10
--- src/tests/fs/vfs/t_renamerace.c:1.9	Wed Aug 25 18:11:20 2010
+++ src/tests/fs/vfs/t_renamerace.c	Thu Aug 26 15:07:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.9 2010/08/25 18:11:20 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.10 2010/08/26 15:07:16 pooka Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -115,14 +115,6 @@
 	 */
 	if (FSTYPE_LFS(tc))
 		abort();
-
-	/*
-	 * NFS sillyrename is broken and may linger on in the file system.
-	 * This sleep lets them finish so we don't get transient unmount
-	 * failures.
-	 */
-	if (FSTYPE_NFS(tc))
-		sleep(1);
 }
 
 static void



CVS commit: src/doc

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 15:01:08 UTC 2010

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention new nawk


To generate a diff of this commit:
cvs rdiff -u -r1.775 -r1.776 src/doc/3RDPARTY
cvs rdiff -u -r1.1431 -r1.1432 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.775 src/doc/3RDPARTY:1.776
--- src/doc/3RDPARTY:1.775	Sun Aug  8 09:42:44 2010
+++ src/doc/3RDPARTY	Thu Aug 26 11:01:07 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.775 2010/08/08 13:42:44 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.776 2010/08/26 15:01:07 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -665,8 +665,8 @@
 Delete the otherOS directory before importing.
 
 Package:	nawk
-Version:	2007-05-01
-Current Vers:	2007-10-23
+Version:	2010-05-23
+Current Vers:	2010-05-23
 Maintainer:	Brian Kernighan 
 Archive Site:	http://www.cs.princeton.edu/~bwk/btl.mirror/
 Home Page:	http://www.cs.princeton.edu/~bwk/btl.mirror/
@@ -675,8 +675,8 @@
 License:	BSD-like
 Notes:
 Build maketab from nawk sources and generate proctab.c.
-Remove buildwin.bat, mac.code, missing95.c, ytab.[ch], ytab?.bak, then import
-to src/dist/nawk.
+Remove buildwin.bat, missing95.c, ytab.[ch], ytab?.bak, vcvars.bat makefile.win
+then import to src/external/historical/nawk/dist.
 
 Package:	ndbootd
 Version:	0.5

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1431 src/doc/CHANGES:1.1432
--- src/doc/CHANGES:1.1431	Thu Aug 26 09:21:50 2010
+++ src/doc/CHANGES	Thu Aug 26 11:01:07 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1431 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1432 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -710,3 +710,5 @@
 		[jruoho 20100815]
 	network: Added NPF - a new packet filter. [rmind 20100822]
 	tests: Convert the libdes tests to ATF.  [jmmv 20100825]
+	awk: upgrade to 20100523 [christos 20100826]
+



CVS commit: src/dist/wpa

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 14:59:20 UTC 2010

Removed Files:
src/dist/wpa: COPYING NetBSD-upgrade README
src/dist/wpa/hostapd: .gitignore ChangeLog Makefile README accounting.c
accounting.h ap.h ap_list.c ap_list.h beacon.c beacon.h config.c
config.h ctrl_iface.c ctrl_iface.h defconfig developer.txt driver.h
driver_bsd.c driver_hostap.c driver_madwifi.c driver_nl80211.c
driver_prism54.c driver_test.c driver_wired.c drivers.c
eap_testing.txt eapol_sm.c eapol_sm.h hostap_common.h hostapd.8
hostapd.accept hostapd.c hostapd.conf hostapd.deny hostapd.eap_user
hostapd.h hostapd.radius_clients hostapd.sim_db hostapd.vlan
hostapd.wpa_psk hostapd_cli.1 hostapd_cli.c hw_features.c
hw_features.h iapp.c iapp.h ieee802_11.c ieee802_11.h
ieee802_11_auth.c ieee802_11_auth.h ieee802_11h.c ieee802_11h.h
ieee802_1x.c ieee802_1x.h mlme.c mlme.h nt_password_hash.c
peerkey.c pmksa_cache.c pmksa_cache.h preauth.c preauth.h prism54.h
priv_netlink.h radiotap.c radiotap.h radiotap_iter.h reconfig.c
sta_info.c sta_info.h vlan_init.c vlan_init.h wired.conf wme.c
wme.h wpa.c wpa.h wpa_auth_i.h wpa_auth_ie.c wpa_auth_ie.h wpa_ft.c
src/dist/wpa/hostapd/doc: .gitignore code_structure.doxygen
ctrl_iface.doxygen doxygen.fast doxygen.full driver_wrapper.doxygen
eap.doxygen hostapd.fig kerneldoc2doxygen.pl mainpage.doxygen
porting.doxygen
src/dist/wpa/hostapd/logwatch: README hostapd hostapd.conf
src/dist/wpa/patches: openssl-0.9.8-tls-extensions.patch
openssl-0.9.8d-tls-extensions.patch
openssl-0.9.8e-tls-extensions.patch
openssl-0.9.8g-tls-extensions.patch
openssl-0.9.8h-tls-extensions.patch
openssl-0.9.9-session-ticket.patch
src/dist/wpa/src: Makefile
src/dist/wpa/src/common: .gitignore Makefile defs.h eapol_common.h
ieee802_11_defs.h privsep_commands.h version.h wireless_copy.h
wpa_common.c wpa_common.h wpa_ctrl.c wpa_ctrl.h
src/dist/wpa/src/crypto: .gitignore Makefile aes.c aes.h aes_wrap.c
aes_wrap.h crypto.h crypto_cryptoapi.c crypto_gnutls.c
crypto_internal.c crypto_libtomcrypt.c crypto_none.c
crypto_openssl.c des.c dh_groups.c dh_groups.h md4.c md5.c md5.h
ms_funcs.c ms_funcs.h rc4.c rc4.h sha1.c sha1.h sha256.c sha256.h
tls.h tls_gnutls.c tls_internal.c tls_none.c tls_openssl.c
tls_schannel.c
src/dist/wpa/src/drivers: .gitignore Apple80211.h Makefile
MobileApple80211.c MobileApple80211.h driver.h driver_atmel.c
driver_broadcom.c driver_bsd.c driver_hostap.c driver_hostap.h
driver_iphone.m driver_ipw.c driver_madwifi.c driver_ndis.c
driver_ndis.h driver_ndis_.c driver_ndiswrapper.c driver_nl80211.c
driver_osx.m driver_prism54.c driver_privsep.c driver_ps3.c
driver_ralink.c driver_ralink.h driver_test.c driver_wext.c
driver_wext.h driver_wired.c drivers.c ndis_events.c priv_netlink.h
scan_helpers.c
src/dist/wpa/src/eap_common: .gitignore Makefile chap.c chap.h
eap_common.c eap_common.h eap_defs.h eap_fast_common.c
eap_fast_common.h eap_gpsk_common.c eap_gpsk_common.h
eap_ikev2_common.c eap_ikev2_common.h eap_pax_common.c
eap_pax_common.h eap_peap_common.c eap_peap_common.h
eap_psk_common.c eap_psk_common.h eap_sake_common.c
eap_sake_common.h eap_sim_common.c eap_sim_common.h
eap_tlv_common.h eap_ttls.h ikev2_common.c ikev2_common.h
src/dist/wpa/src/eap_peer: .gitignore Makefile eap.c eap.h eap_aka.c
eap_config.h eap_fast.c eap_fast_pac.c eap_fast_pac.h eap_gpsk.c
eap_gtc.c eap_i.h eap_ikev2.c eap_leap.c eap_md5.c eap_methods.c
eap_methods.h eap_mschapv2.c eap_otp.c eap_pax.c eap_peap.c
eap_psk.c eap_sake.c eap_sim.c eap_tls.c eap_tls_common.c
eap_tls_common.h eap_tnc.c eap_ttls.c eap_vendor_test.c ikev2.c
ikev2.h mschapv2.c mschapv2.h tncc.c tncc.h
src/dist/wpa/src/eap_server: .gitignore Makefile eap.c eap.h eap_aka.c
eap_fast.c eap_gpsk.c eap_gtc.c eap_i.h eap_identity.c eap_ikev2.c
eap_md5.c eap_methods.c eap_methods.h eap_mschapv2.c eap_pax.c
eap_peap.c eap_psk.c eap_sake.c eap_sim.c eap_sim_db.c eap_sim_db.h
eap_tls.c eap_tls_common.c eap_tls_common.h eap_tnc.c eap_ttls.c
eap_vendor_test.c ikev2.c ikev2.h tncs.c tncs.h
src/dist/wpa/src/eapol_supp: .gitignore Makefile eapol_supp_sm.c
eapol_supp_sm.h
src/dist/wpa/src/hlr_auc_gw: .gitignore Makefile hlr_auc_gw.c
hlr_auc_gw.milenage_d

CVS commit: src/usr.sbin/wpa

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 14:58:30 UTC 2010

Removed Files:
src/usr.sbin/wpa: Makefile Makefile.inc
src/usr.sbin/wpa/hostapd: Makefile hostapd.8 hostapd.conf.5
src/usr.sbin/wpa/hostapd_cli: Makefile hostapd_cli.8
src/usr.sbin/wpa/wpa_cli: Makefile wpa_cli.8
src/usr.sbin/wpa/wpa_passphrase: Makefile wpa_passphrase.8
src/usr.sbin/wpa/wpa_supplicant: Makefile wpa_supplicant.8
wpa_supplicant.conf.5

Log Message:
bye old wpa.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/usr.sbin/wpa/Makefile
cvs rdiff -u -r1.8 -r0 src/usr.sbin/wpa/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/usr.sbin/wpa/hostapd/Makefile \
src/usr.sbin/wpa/hostapd/hostapd.conf.5
cvs rdiff -u -r1.2 -r0 src/usr.sbin/wpa/hostapd/hostapd.8
cvs rdiff -u -r1.2 -r0 src/usr.sbin/wpa/hostapd_cli/Makefile
cvs rdiff -u -r1.1 -r0 src/usr.sbin/wpa/hostapd_cli/hostapd_cli.8
cvs rdiff -u -r1.9 -r0 src/usr.sbin/wpa/wpa_cli/Makefile
cvs rdiff -u -r1.2 -r0 src/usr.sbin/wpa/wpa_cli/wpa_cli.8
cvs rdiff -u -r1.5 -r0 src/usr.sbin/wpa/wpa_passphrase/Makefile
cvs rdiff -u -r1.4 -r0 src/usr.sbin/wpa/wpa_passphrase/wpa_passphrase.8
cvs rdiff -u -r1.12 -r0 src/usr.sbin/wpa/wpa_supplicant/Makefile
cvs rdiff -u -r1.7 -r0 src/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8
cvs rdiff -u -r1.4 -r0 src/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5

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



CVS commit: src/usr.bin

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 14:57:47 UTC 2010

Modified Files:
src/usr.bin: Makefile

Log Message:
Unglue awk.


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/usr.bin/Makefile

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/Makefile
diff -u src/usr.bin/Makefile:1.189 src/usr.bin/Makefile:1.190
--- src/usr.bin/Makefile:1.189	Fri Jun 18 23:50:30 2010
+++ src/usr.bin/Makefile	Thu Aug 26 10:57:47 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.189 2010/06/19 03:50:30 mrg Exp $
+#	$NetBSD: Makefile,v 1.190 2010/08/26 14:57:47 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include 
 
-SUBDIR= apply apropos asa at audio awk \
+SUBDIR= apply apropos asa at audio \
 	banner basename biff bthset btkey btpin \
 	bzip2 bzip2recover cal calendar cap_mkdb cdplay \
 	checknr chflags chpass cksum cmp col colcrt colrm \



CVS commit: src/external

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 14:57:16 UTC 2010

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

Log Message:
awk glue


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/Makefile
cvs rdiff -u -r0 -r1.1 src/external/historical/Makefile
cvs rdiff -u -r0 -r1.1 src/external/historical/nawk/Makefile
cvs rdiff -u -r0 -r1.1 src/external/historical/nawk/bin/Makefile \
src/external/historical/nawk/bin/TODO \
src/external/historical/nawk/bin/awk.1

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

Modified files:

Index: src/external/Makefile
diff -u src/external/Makefile:1.8 src/external/Makefile:1.9
--- src/external/Makefile:1.8	Mon Oct  5 18:44:26 2009
+++ src/external/Makefile	Thu Aug 26 10:57:15 2010
@@ -1,7 +1,8 @@
-#	$NetBSD: Makefile,v 1.8 2009/10/05 22:44:26 haad Exp $
+#	$NetBSD: Makefile,v 1.9 2010/08/26 14:57:15 christos Exp $
 
 SUBDIR+= lib .WAIT
 
-SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3 ibm-public intel-public cddl
+SUBDIR+= apache2 bsd intel-fw-eula intel-fw-public gpl2 gpl3 historical
+SUBDIR+= ibm-public intel-public cddl
 
 .include 

Added files:

Index: src/external/historical/Makefile
diff -u /dev/null src/external/historical/Makefile:1.1
--- /dev/null	Thu Aug 26 10:57:16 2010
+++ src/external/historical/Makefile	Thu Aug 26 10:57:15 2010
@@ -0,0 +1,7 @@
+#	$NetBSD: Makefile,v 1.1 2010/08/26 14:57:15 christos Exp $
+
+.include 
+
+SUBDIR+= nawk
+
+.include 

Index: src/external/historical/nawk/Makefile
diff -u /dev/null src/external/historical/nawk/Makefile:1.1
--- /dev/null	Thu Aug 26 10:57:16 2010
+++ src/external/historical/nawk/Makefile	Thu Aug 26 10:57:16 2010
@@ -0,0 +1,5 @@
+#	$NetBSD: Makefile,v 1.1 2010/08/26 14:57:16 christos Exp $
+
+SUBDIR+= bin
+
+.include 

Index: src/external/historical/nawk/bin/Makefile
diff -u /dev/null src/external/historical/nawk/bin/Makefile:1.1
--- /dev/null	Thu Aug 26 10:57:16 2010
+++ src/external/historical/nawk/bin/Makefile	Thu Aug 26 10:57:16 2010
@@ -0,0 +1,36 @@
+#	$NetBSD: Makefile,v 1.1 2010/08/26 14:57:16 christos Exp $
+
+WARNS?= 4
+
+.include 
+
+DIST=	${.CURDIR}/../dist
+.PATH:	${DIST}
+
+PROG=	awk
+SRCS=	awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c
+CPPFLAGS+=	-I${DIST} -I.
+LDADD+=	-lm
+.if !defined(HOSTPROG)
+DPADD+=	${LIBM}
+.endif
+YHEADER=	yes
+.if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)
+COPTS+=	-Wno-pointer-sign
+.endif
+
+# info file originally from GNU awk 3.1.3, adjusted for nawk slightly
+.PATH:	${NETBSDSRCDIR}/gnu/dist/gawk
+TEXINFO=awk.info
+
+# During the tools build (from src/tools/awk/Makefile),
+# src/tools/Makefile.host changes .CURDIR back and forth between
+# src/tools/awk and src/usr.bin/awk.  For some unknown reason, including
+# bsd.info.mk here leads to the obj dir being created at the wrong time,
+# while .CURDIR is src/usr.bin/awk.  Work around the problem by not
+# including bsd.info.mk when MKINFO=no.
+.if ${MKINFO} != "no"
+.include 
+.endif
+
+.include 
Index: src/external/historical/nawk/bin/TODO
diff -u /dev/null src/external/historical/nawk/bin/TODO:1.1
--- /dev/null	Thu Aug 26 10:57:16 2010
+++ src/external/historical/nawk/bin/TODO	Thu Aug 26 10:57:16 2010
@@ -0,0 +1,22 @@
+$NetBSD: TODO,v 1.1 2010/08/26 14:57:16 christos Exp $
+
+Besides general regression testing to ensure everything still works
+with nawk instead of gawk, following GNU awk extensions should be implemented
+or handled somehow (the list is probably incomplete, please add entries 
+if anything is missing):
+
+* String functions: gensub() (partly done, finish backref. support)
+* (done) Time functions: strftime(), systime()
+* --posix flag, which would switch off nawk extensions over POSIX awk (?)
+* special file names: /dev/pid, /dev/ppid, /dev/pgrpid, /dev/user,
+	/dev/stdin, /dev/stdout, /dev/stderr, /dev/fd/X
+* special variables: ARGIND, ERRNO, FIELDWIDTHS, IGNORECASE, RT
+
+Also, the manpage should be improved to be generally more helpful
+and document extensions over what POSIX says about awk.
+
+Other misc:
+* run.c: don't limit files[] to FOPEN_MAX (which is ridiculously low),
+  make the limit the current process open file limit
+* nawk doesn't permit empty RE, like
+// { do_something; }
Index: src/external/historical/nawk/bin/awk.1
diff -u /dev/null src/external/historical/nawk/bin/awk.1:1.1
--- /dev/null	Thu Aug 26 10:57:16 2010
+++ src/external/historical/nawk/bin/awk.1	Thu Aug 26 10:57:16 2010
@@ -0,0 +1,732 @@
+.\"	$NetBSD: awk.1,v 1.1 2010/08/26 14:57:16 christos Exp $
+.\"
+.\" Copyright (C) Lucent Technologies 1997
+.\" All Rights Reserved
+.\"
+.\" Permission to use, copy, modify, and distribute this software and
+.\" its documentation for any purpose and without 

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

2010-08-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 26 14:53:18 UTC 2010

Update of /cvsroot/src/external/historical/nawk/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv10406

Log Message:
imprort latest nawk

Status:

Vendor Tag: NAWK
Release Tags:   NAWK20100523

N src/external/historical/nawk/dist/awkgram.y
N src/external/historical/nawk/dist/README
N src/external/historical/nawk/dist/FIXES
N src/external/historical/nawk/dist/awk.h
N src/external/historical/nawk/dist/proto.h
N src/external/historical/nawk/dist/maketab.c
N src/external/historical/nawk/dist/lex.c
N src/external/historical/nawk/dist/b.c
N src/external/historical/nawk/dist/main.c
N src/external/historical/nawk/dist/proctab.c
N src/external/historical/nawk/dist/parse.c
N src/external/historical/nawk/dist/lib.c
N src/external/historical/nawk/dist/run.c
N src/external/historical/nawk/dist/tran.c
N src/external/historical/nawk/dist/makefile
N src/external/historical/nawk/dist/awk.1

No conflicts created by this import



CVS commit: src/external/bsd/atf/dist/tests/atf/atf-report

2010-08-26 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Aug 26 14:35:54 UTC 2010

Removed Files:
src/external/bsd/atf/dist/tests/atf/atf-report: h_xfail.cpp

Log Message:
Remove obsolete file.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 \
src/external/bsd/atf/dist/tests/atf/atf-report/h_xfail.cpp

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



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2010-08-26 Thread VANHULLEBUS Yvan
Module Name:src
Committed By:   vanhu
Date:   Thu Aug 26 13:31:56 UTC 2010

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: remoteconf.c

Log Message:
fix by Sergio.Gelato (at) astro.su.se: duplicate some dynamic values in 
duprmconf()


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.19 src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.20
--- src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c:1.19	Tue Jun 22 09:41:33 2010
+++ src/crypto/dist/ipsec-tools/src/racoon/remoteconf.c	Thu Aug 26 13:31:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: remoteconf.c,v 1.19 2010/06/22 09:41:33 vanhu Exp $	*/
+/*	$NetBSD: remoteconf.c,v 1.20 2010/08/26 13:31:55 vanhu Exp $	*/
 
 /* Id: remoteconf.c,v 1.38 2006/05/06 15:52:44 manubsd Exp */
 
@@ -555,6 +555,24 @@
 	new->idvl_p = genlist_init();
 	genlist_foreach(rmconf->idvl_p, dupidvl, new->idvl_p);
 
+/* duplicate strings */ 
+	if (new->mycertfile != NULL) { 
+		new->mycertfile = racoon_strdup(new->mycertfile); 
+		STRDUP_FATAL(new->mycertfile); 
+	} 
+	if (new->myprivfile != NULL) { 
+		new->myprivfile = racoon_strdup(new->myprivfile); 
+		STRDUP_FATAL(new->myprivfile); 
+	} 
+	if (new->peerscertfile != NULL) { 
+		new->peerscertfile = racoon_strdup(new->peerscertfile); 
+		STRDUP_FATAL(new->peerscertfile); 
+	} 
+	if (new->cacertfile != NULL) { 
+new->cacertfile = racoon_strdup(new->cacertfile); 
+		STRDUP_FATAL(new->cacertfile); 
+	} 
+
 	return new;
 }
 



CVS commit: src

2010-08-26 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Aug 26 13:29:02 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c perfuse_if.h perfuse_priv.h subr.c
src/usr.sbin/perfused: debug.c perfused.8 perfused.c

Log Message:
- open the file before doing fsync: glusterfs wants that.

- Automatically call fsync on close for files. If we just close, fsync
will come later and we will have to reopen

- Add a PND_DIRTY flag to keep track of files that really need a sync.
perfuse_node_fsync only calls the FUSE fsync method if there are data
to push.

- Add a PND_OPEN flag to keep track of open files. Checking non NULL
fh is not enough, as some filesystems will always set fh to 0.

- Add a sync diagnostic flag, to watch fsync and dirty flag activity.
Make the fh diagnostic flag more verbose

- Send the fh in setattr (it was hardcoded to 0)

I am now able to build libperfuse in a glusterfs mounted filesystem. Yeah!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libperfuse/ops.c \
src/lib/libperfuse/perfuse_if.h src/lib/libperfuse/perfuse_priv.h \
src/lib/libperfuse/subr.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/perfused/debug.c \
src/usr.sbin/perfused/perfused.8 src/usr.sbin/perfused/perfused.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.1 src/lib/libperfuse/ops.c:1.2
--- src/lib/libperfuse/ops.c:1.1	Wed Aug 25 07:16:00 2010
+++ src/lib/libperfuse/ops.c	Thu Aug 26 13:29:01 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.1 2010/08/25 07:16:00 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.2 2010/08/26 13:29:01 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -824,7 +824,6 @@
 		if (error != 0)	
 			return error;
 
-
 		return 0;
 	}
 
@@ -960,9 +959,14 @@
 	 * so that we can reuse it later
 	 */
 	perfuse_new_fh((puffs_cookie_t)pn, foo->fh);
+
 #ifdef PERFUSE_DEBUG
 	if (perfuse_diagflags & PDF_FH)
-		DPRINTF("%s: fh = %lld\n", __func__, foo->fh);
+		DPRINTF("%s: opc = %p, file = \"%s\", "
+			"ino = %lld, fh = 0x%llx\n",
+			__func__, (void *)opc, 
+			(char *)PNPATH((struct puffs_node *)opc),
+			PERFUSE_NODE_DATA(opc)->pnd_ino, foo->fh);
 #endif
 out:
 	ps->ps_destroy_msg(pm);
@@ -982,17 +986,47 @@
 	perfuse_msg_t *pm;
 	int op;
 	uint64_t fh;
+	struct perfuse_node_data *pnd;
 	struct fuse_release_in *fri;
 	struct puffs_node *pn;
 	int error;
 	
 	ps = puffs_getspecific(pu);
-
 	pn = (struct puffs_node *)opc;
+	pnd = PERFUSE_NODE_DATA(pn);
 
-	if ((fh = perfuse_get_fh((puffs_cookie_t)pn)) == FUSE_UNKNOWN_FH)
+	if (puffs_pn_getvap(pn)->va_type == VDIR)
+		op = FUSE_RELEASEDIR;
+	else
+		op = FUSE_RELEASE;
+
+	if (!(pnd->pnd_flags & PND_OPEN))
 		return EBADF;
 
+	fh = perfuse_get_fh(opc);
+
+	/*
+	 * Sync before close for files
+	 * XXX no pcr argument to pass
+	 */
+	if ((op == FUSE_RELEASE) && (pnd->pnd_flags & PND_DIRTY)) {
+#ifdef PERFUSE_DEBUG
+		if (perfuse_diagflags & PDF_SYNC)
+			DPRINTF("%s: SYNC opc = %p, file = \"%s\"\n", 
+__func__, (void*)opc, (char *)PNPATH(pn));
+#endif
+		if ((error = perfuse_node_fsync(pu, opc, NULL, 0, 0, 0)) != 0)
+			return error;
+
+		pnd->pnd_flags &= ~PND_DIRTY;
+
+#ifdef PERFUSE_DEBUG
+		if (perfuse_diagflags & PDF_SYNC)
+			DPRINTF("%s: CLEAR opc = %p, file = \"%s\"\n", 
+__func__, (void*)opc, (char *)PNPATH((pn)));
+#endif
+	}
+
 	/*
 	 * Destroy the filehandle before sending the 
 	 * request to the FUSE filesystem, otherwise 
@@ -1004,14 +1038,10 @@
 
 #ifdef PERFUSE_DEBUG
 	if (perfuse_diagflags & PDF_FH)
-		DPRINTF("%s: fh = %lld\n", __func__, fh);
+		DPRINTF("%s: opc = %p, ino = %lld, fh = 0x%llx\n",
+			__func__, (void *)opc, pnd->pnd_ino, fh);
 #endif
 
-	if (puffs_pn_getvap(pn)->va_type == VDIR)
-		op = FUSE_RELEASEDIR;
-	else
-		op = FUSE_RELEASE;
-
 	/*
 	 * release_flags may be set to FUSE_RELEASE_FLUSH
 	 * to flush locks. lock_owner must be set in that case
@@ -1024,12 +1054,18 @@
 	fri->lock_owner = PERFUSE_NODE_DATA(pn)->pnd_lock_owner;
 	fri->flags = (fri->lock_owner != 0) ? FUSE_RELEASE_FLUSH : 0;
 
+#ifdef PERFUSE_DEBUG
+	if (perfuse_diagflags & PDF_FH)
+		DPRINTF("%s: opc = %p, ino = %lld, fh = 0x%llx\n",
+			 __func__, (void *)opc, pnd->pnd_ino, fri->fh);
+#endif
+
 	if ((error = XCHG_MSG(ps, pu, pm, NO_PAYLOAD_REPLY_LEN)) != 0)
 		goto out;
 
 out:
 	if (error != 0)
-		DWARNX("%s: freed fh = %lld but filesystem returned error = %d",
+		DWARNX("%s: freed fh = 0x%llx but filesystem returned error = %d",
 		   __func__, fh, error);
 
 	ps->ps_destroy_msg(pm);
@@ -1077,8 +1113,14 @@
 		fgi = GET_INPAYLOAD(ps, pm, fuse_getattr_in);
 		fgi->getattr_flags = 0; 
 		fgi->dummy = 0;
-		fgi->fh = 0;
+		fgi->fh = perfuse_get_fh(opc);
 
+#ifdef PERFUSE_DEBUG
+		if (perfuse_diagflags & PDF_FH)
+			DPRINTF("%s: opc = %p, ino = %lld, fh = 0x%llx\n",
+__func__, (void *)opc,
+PERFUSE_NODE_DATA(opc)->pnd_ino, fgi->fh);

CVS commit: src/doc

2010-08-26 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Aug 26 13:21:51 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
Note the conversion of the libdes tests to atf.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1430 src/doc/CHANGES:1.1431
--- src/doc/CHANGES:1.1430	Wed Aug 25 14:57:26 2010
+++ src/doc/CHANGES	Thu Aug 26 13:21:50 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1430 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1431 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -709,3 +709,4 @@
 	acpicpu(4): add a driver for ACPI-based processor functionality.
 		[jruoho 20100815]
 	network: Added NPF - a new packet filter. [rmind 20100822]
+	tests: Convert the libdes tests to ATF.  [jmmv 20100825]



CVS commit: src/sys/dev/ieee1394

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 12:48:19 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwdev.c

Log Message:
don't call tsleep() with any mutexes hold


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/fwdev.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/ieee1394/fwdev.c
diff -u src/sys/dev/ieee1394/fwdev.c:1.23 src/sys/dev/ieee1394/fwdev.c:1.24
--- src/sys/dev/ieee1394/fwdev.c:1.23	Mon Aug 16 06:05:07 2010
+++ src/sys/dev/ieee1394/fwdev.c	Thu Aug 26 12:48:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $	*/
+/*	$NetBSD: fwdev.c,v 1.24 2010/08/26 12:48:19 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.24 2010/08/26 12:48:19 cegger Exp $");
 
 #include 
 #include 
@@ -803,12 +803,18 @@
 	int err = 0;
 
 	mutex_enter(&d->fc->fc_mtx);
-	while ((xfer = STAILQ_FIRST(&d->rq)) == NULL && err == 0)
-		err = tsleep(&d->rq, FWPRI, "fwra", 0);
 
-	if (err != 0) {
-		mutex_exit(&d->fc->fc_mtx);
-		return err;
+	for (;;) {
+		xfer = STAILQ_FIRST(&d->rq);
+		if (xfer == NULL && err == 0) {
+			mutex_exit(&d->fc->fc_mtx);
+			err = tsleep(&d->rq, FWPRI, "fwra", 0);
+			if (err != 0)
+return err;
+			mutex_enter(&d->fc->fc_mtx);
+			continue;
+		}
+		break;
 	}
 
 	STAILQ_REMOVE_HEAD(&d->rq, link);



CVS commit: src/sys/dev/pci

2010-08-26 Thread Tom Spindler
Module Name:src
Committed By:   dogcow
Date:   Thu Aug 26 10:21:56 UTC 2010

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add several Broadcom BCM43xx devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1048 -r1.1049 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1048 src/sys/dev/pci/pcidevs:1.1049
--- src/sys/dev/pci/pcidevs:1.1048	Sun Aug  1 18:45:24 2010
+++ src/sys/dev/pci/pcidevs	Thu Aug 26 10:21:56 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1048 2010/08/01 18:45:24 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1049 2010/08/26 10:21:56 dogcow Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1567,6 +1567,8 @@
 product BROADCOM BCM4307	0x4307	BCM4307
 product BROADCOM BCM4311	0x4311	BCM4311
 product BROADCOM BCM4312	0x4312	BCM4312
+product BROADCOM BCM4313	0x4313	BCM4313
+product BROADCOM BCM4315	0x4315	BCM4315
 product BROADCOM BCM4318	0x4318	BCM4318 AirForce One 54g
 product BROADCOM BCM4319	0x4319	BCM4319
 product BROADCOM BCM4306	0x4320	BCM4306
@@ -1575,6 +1577,11 @@
 product BROADCOM BCM4309	0x4324	BCM4309
 product BROADCOM BCM43XG	0x4325	BCM43XG
 product BROADCOM BCM4328	0x4328	BCM4328 802.11a/b/g/n
+product BROADCOM BCM4329	0x4329	BCM4329 802.11b/g/n
+product BROADCOM BCM432A	0x432a	BCM432A 802.11
+product BROADCOM BCM432B	0x432b	BCM432B 802.11a/b/g/n
+product BROADCOM BCM432C	0x432c	BCM432C 802.11b/g/n
+product BROADCOM BCM432D	0x432d	BCM432D 802.11
 product BROADCOM BCM4401	0x4401	BCM4401 10/100 Ethernet
 product BROADCOM 5801		0x5801	5801 Security Processor
 product BROADCOM 5802		0x5802	5802 Security Processor



CVS commit: [uebayasi-xip] src/sys/arch/xen/x86

2010-08-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Aug 26 09:43:45 UTC 2010

Modified Files:
src/sys/arch/xen/x86 [uebayasi-xip]: cpu.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.40.2.2 -r1.40.2.3 src/sys/arch/xen/x86/cpu.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/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.40.2.2 src/sys/arch/xen/x86/cpu.c:1.40.2.3
--- src/sys/arch/xen/x86/cpu.c:1.40.2.2	Tue Aug 17 06:45:35 2010
+++ src/sys/arch/xen/x86/cpu.c	Thu Aug 26 09:43:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.40.2.2 2010/08/17 06:45:35 uebayasi Exp $	*/
+/*	$NetBSD: cpu.c,v 1.40.2.3 2010/08/26 09:43:45 uebayasi Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.40.2.2 2010/08/17 06:45:35 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.40.2.3 2010/08/26 09:43:45 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -87,6 +87,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/dev/ieee1394

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 08:56:16 UTC 2010

Modified Files:
src/sys/dev/ieee1394: firewire.c

Log Message:
fix crash when detaching/re-attaching a cable where three firewire devices are 
on the bus.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ieee1394/firewire.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/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.36 src/sys/dev/ieee1394/firewire.c:1.37
--- src/sys/dev/ieee1394/firewire.c:1.36	Sat Aug 14 18:28:59 2010
+++ src/sys/dev/ieee1394/firewire.c	Thu Aug 26 08:56:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $	*/
+/*	$NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $");
 
 #include 
 #include 
@@ -2053,6 +2053,10 @@
 			SLIST_FOREACH(devlist, &sc->devlist, link)
 if (devlist->fwdev == fwdev)
 	break;
+
+			if (devlist == NULL)
+continue;
+
 			if (devlist->fwdev != fwdev)
 panic("already detached");
 



CVS commit: src/tests/fs/common

2010-08-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 26 08:19:18 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
include some necessary headers to fix build


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/tests/fs/common/h_fsmacros.h

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/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.19 src/tests/fs/common/h_fsmacros.h:1.20
--- src/tests/fs/common/h_fsmacros.h:1.19	Wed Aug 25 18:16:06 2010
+++ src/tests/fs/common/h_fsmacros.h	Thu Aug 26 08:19:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.19 2010/08/25 18:16:06 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.20 2010/08/26 08:19:18 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -38,6 +38,10 @@
 #include 
 #include 
 
+#include 
+
+#include "../../h_macros.h"
+
 #define FSPROTOS(_fs_)			\
 int _fs_##_fstest_newfs(const atf_tc_t *, void **, const char *,	\
 			off_t, void *);	\



CVS commit: src/sys/dev/ieee1394

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 07:36:53 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwcrom.c iec13213.h

Log Message:
- print expected crc when it does not match
- add and print secondary text leaf. This prints the model name of my webcam.
- add csr keys that are printed as 'unknown' otherwise


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ieee1394/fwcrom.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ieee1394/iec13213.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/ieee1394/fwcrom.c
diff -u src/sys/dev/ieee1394/fwcrom.c:1.12 src/sys/dev/ieee1394/fwcrom.c:1.13
--- src/sys/dev/ieee1394/fwcrom.c:1.12	Sat Apr 24 21:34:29 2010
+++ src/sys/dev/ieee1394/fwcrom.c	Thu Aug 26 07:36:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcrom.c,v 1.12 2010/04/24 21:34:29 cegger Exp $	*/
+/*	$NetBSD: fwcrom.c,v 1.13 2010/08/26 07:36:53 cegger Exp $	*/
 /*-
  * Copyright (c) 2002-2003
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwcrom.c,v 1.12 2010/04/24 21:34:29 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwcrom.c,v 1.13 2010/08/26 07:36:53 cegger Exp $");
 
 #include 
 #ifdef _KERNEL
@@ -178,10 +178,16 @@
 		return;
 
 	reg = crom_get(cc);
-	if (reg->key != CROM_TEXTLEAF ||
-	(char *)(reg + reg->val) > CROM_END(cc)) {
-		strncpy(buf, nullstr, len);
-		return;
+	switch (reg->key) {
+	case CROM_TEXTLEAF:
+	case CROM_TEXTLEAF2:
+		break;
+	default:
+		if ((char *)(reg + reg->val) > CROM_END(cc)) {
+			strncpy(buf, nullstr, len);
+			return;
+		}
+		break;
 	}
 	textleaf = (struct csrtext *)(reg + reg->val);
 
@@ -288,7 +294,7 @@
 	switch (reg->key & CSRTYPE_MASK) {
 	case CSRTYPE_I:
 #if 0
-		len -= snprintf(buf, len, "%d", reg->val);
+		len -= snprintf(buf, len, "0x%x", reg->val);
 		buf += strlen(buf);
 #else
 		*buf = '\0';
@@ -304,33 +310,43 @@
 	case CSRTYPE_D:
 		dir = (struct csrdirectory *) (reg + reg->val);
 		crc = crom_crc((uint32_t *)dir->entry, dir->crc_len);
-		len -= snprintf(buf, len, "len=%d crc=0x%04x(%s) ",
-		dir->crc_len, dir->crc, (crc == dir->crc) ? "OK" : "NG");
+		len -= snprintf(buf, len, "len=%d crc=0x%04x ",
+		dir->crc_len, crc);
+		buf += strlen(buf);
+
+		if (crc == dir->crc)
+			len -= snprintf(buf, len, "(OK) ");
+		else
+			len -= snprintf(buf, len, "(NG, 0x%x) ",
+			dir->crc);
 		buf += strlen(buf);
 	}
 	switch (reg->key) {
-	case 0x03:
+	case CSRKEY_VENDOR: /* 0x03 */
 		desc = "module_vendor_ID";
 		break;
-	case 0x04:
+	case CSRKEY_HW: /* 0x04 */
 		desc = "hardware_version";
 		break;
-	case 0x0c:
+	case CSRKEY_NCAP: /* 0x0c */
 		desc = "node_capabilities";
 		break;
-	case 0x12:
+	case CSRKEY_SPEC: /* 0x12 */
 		desc = "unit_spec_ID";
 		break;
-	case 0x13:
+	case CSRKEY_VER: /* 0x13 */
 		desc = "unit_sw_version";
 		crom_desc_specver(0, reg->val, buf, len);
 		break;
-	case 0x14:
+	case CSRKEY_DINFO: /* 0x14 */
 		desc = "logical_unit_number";
 		break;
-	case 0x17:
+	case CSRKEY_MODEL: /* 0x17 */
 		desc = "model_ID";
 		break;
+	case CSRKEY_REV: /* 0x21 */
+		desc = "revision_ID";
+		break;
 	case 0x38:
 		desc = "command_set_spec_ID";
 		break;
@@ -349,13 +365,20 @@
 	case 0x3d:
 		desc = "reconnect_timeout";
 		break;
+	case 0x40:
+		desc = "command_regs_base";
+		break;
 	case 0x54:
 		desc = "management_agent";
 		break;
-	case 0x81:
+	case CROM_TEXTLEAF: /* 0x81 */
+	case CROM_TEXTLEAF2: /* 0x82 */
 		desc = "text_leaf";
 		crom_parse_text(cc, buf + strlen(buf), len);
 		break;
+	case CROM_NODEID: /* 0x8d */
+		desc = "node_unique_ID";
+		break;
 	case 0xd1:
 		desc = "unit_directory";
 		break;

Index: src/sys/dev/ieee1394/iec13213.h
diff -u src/sys/dev/ieee1394/iec13213.h:1.4 src/sys/dev/ieee1394/iec13213.h:1.5
--- src/sys/dev/ieee1394/iec13213.h:1.4	Mon Mar 29 03:05:28 2010
+++ src/sys/dev/ieee1394/iec13213.h	Thu Aug 26 07:36:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: iec13213.h,v 1.4 2010/03/29 03:05:28 kiyohara Exp $	*/
+/*	$NetBSD: iec13213.h,v 1.5 2010/08/26 07:36:53 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -105,8 +105,10 @@
 
 #define CROM_UDIR	(CSRTYPE_D | CSRKEY_UNIT)  /* 0x81 Unit directory */
 #define CROM_TEXTLEAF	(CSRTYPE_L | CSRKEY_DESC)  /* 0x81 Text leaf */
+#define CROM_TEXTLEAF2	(CSRTYPE_L | CSRKEY_BDINFO)/* 0x82 Text leaf2 */
 #define CROM_LUN	(CSRTYPE_I | CSRKEY_DINFO) /* 0x14 Logical unit num. */
 #define CROM_MGM	(CSRTYPE_C | CSRKEY_DINFO) /* 0x54 Management agent */
+#define CROM_NODEID	0x8d /* only valid for IEEE 1394-1995 digital camera */
 
 #define CSRVAL_VENDOR_PRIVATE	0xacde48
 #define CSRVAL_1394TA	0x00a02d



CVS commit: src/usr.sbin/fwctl

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 07:04:05 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwcontrol.c

Log Message:
show crom:
Print calculated crc. When crc does not match then print expected crc.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/fwctl/fwcontrol.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/fwctl/fwcontrol.c
diff -u src/usr.sbin/fwctl/fwcontrol.c:1.9 src/usr.sbin/fwctl/fwcontrol.c:1.10
--- src/usr.sbin/fwctl/fwcontrol.c:1.9	Tue Aug 24 08:41:24 2010
+++ src/usr.sbin/fwctl/fwcontrol.c	Thu Aug 26 07:04:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $	*/
+/*	$NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $	*/
 /*
  * Copyright (C) 2002
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 #include 
 //__FBSDID("$FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $");
-__RCSID("$NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $");
+__RCSID("$NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $");
 
 #include 
 #include 
@@ -401,6 +401,15 @@
 }
 
 static void
+show_crc(uint16_t crc, uint16_t good_crc)
+{
+	if (crc == good_crc)
+		printf("(OK)\n");
+	else
+		printf("(NG, 0x%x)\n", good_crc);
+}
+
+static void
 show_crom(uint32_t *crom_buf)
 {
 	int i;
@@ -422,16 +431,13 @@
 	if (hdr->info_len == 1) {
 		/* minimum ROM */
 		reg = (struct csrreg *)hdr;
-		printf("verndor ID: 0x%06x\n",  reg->val);
+		printf("vendor ID: 0x%06x\n", reg->val);
 		return;
 	}
-	printf("info_len=%d crc_len=%d crc=0x%04x",
-		hdr->info_len, hdr->crc_len, hdr->crc);
 	crc = crom_crc(crom_buf+1, hdr->crc_len);
-	if (crc == hdr->crc)
-		printf("(OK)\n");
-	else
-		printf("(NG)\n");
+	printf("info_len=%d crc_len=%d crc=0x%04x ",
+		hdr->info_len, hdr->crc_len, crc);
+	show_crc(crc, hdr->crc);
 	parse_bus_info_block(crom_buf+1);
 
 	crom_init_context(&cc, crom_buf);
@@ -440,13 +446,10 @@
 		printf("no root directory - giving up\n");
 		return;
 	}
-	printf("root_directory: len=0x%04x(%d) crc=0x%04x",
-			dir->crc_len, dir->crc_len, dir->crc);
 	crc = crom_crc((uint32_t *)&dir->entry[0], dir->crc_len);
-	if (crc == dir->crc)
-		printf("(OK)\n");
-	else
-		printf("(NG)\n");
+	printf("root_directory: len=0x%04x(%d) crc=0x%04x ",
+			dir->crc_len, dir->crc_len, crc);
+	show_crc(crc, dir->crc);
 	if (dir->crc_len < 1)
 		return;
 	while (cc.depth >= 0) {