CVS commit: src/tests/fs

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 09:45:06 UTC 2010

Modified Files:
src/tests/fs: Makefile
Added Files:
src/tests/fs/lfs: Atffile Makefile t_pr.c

Log Message:
add test for PR kern/43503


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/lfs/Atffile src/tests/fs/lfs/Makefile \
src/tests/fs/lfs/t_pr.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/Makefile
diff -u src/tests/fs/Makefile:1.10 src/tests/fs/Makefile:1.11
--- src/tests/fs/Makefile:1.10	Mon Jun 14 14:51:41 2010
+++ src/tests/fs/Makefile	Mon Jun 28 09:45:06 2010
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.10 2010/06/14 14:51:41 pooka Exp $
+# $NetBSD: Makefile,v 1.11 2010/06/28 09:45:06 pooka Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/fs
 
-SUBDIR+=	ffs kernfs msdosfs nullfs ptyfs puffs tmpfs umapfs union
+SUBDIR+=	ffs kernfs lfs msdosfs nullfs ptyfs puffs tmpfs umapfs union
 
 FILES= h_funcs.subr
 FILESDIR= ${TESTSDIR}

Added files:

Index: src/tests/fs/lfs/Atffile
diff -u /dev/null src/tests/fs/lfs/Atffile:1.1
--- /dev/null	Mon Jun 28 09:45:06 2010
+++ src/tests/fs/lfs/Atffile	Mon Jun 28 09:45:06 2010
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version=1
+X-NetBSD-Id: $NetBSD: Atffile,v 1.1 2010/06/28 09:45:06 pooka Exp $
+
+prop: test-suite = NetBSD
+
+tp-glob: t_*
Index: src/tests/fs/lfs/Makefile
diff -u /dev/null src/tests/fs/lfs/Makefile:1.1
--- /dev/null	Mon Jun 28 09:45:06 2010
+++ src/tests/fs/lfs/Makefile	Mon Jun 28 09:45:06 2010
@@ -0,0 +1,13 @@
+#	$NetBSD: Makefile,v 1.1 2010/06/28 09:45:06 pooka Exp $
+#
+
+TESTSDIR=	${TESTSBASE}/fs/lfs
+WARNS=		4
+
+TESTS_C=	t_pr
+
+LDADD+=-lrumpfs_lfs -lrumpfs_ffs# fs drivers
+LDADD+=-lrumpdev_disk -lrumpdev	# disk device
+LDADD+=-lrumpvfs -lrump -lrumpuser -lpthread			# base
+
+.include bsd.test.mk
Index: src/tests/fs/lfs/t_pr.c
diff -u /dev/null src/tests/fs/lfs/t_pr.c:1.1
--- /dev/null	Mon Jun 28 09:45:06 2010
+++ src/tests/fs/lfs/t_pr.c	Mon Jun 28 09:45:06 2010
@@ -0,0 +1,61 @@
+/*	$NetBSD: t_pr.c,v 1.1 2010/06/28 09:45:06 pooka Exp $	*/
+
+#include sys/types.h
+#include sys/mount.h
+
+#include atf-c.h
+#include errno.h
+#include fcntl.h
+#include limits.h
+#include stdio.h
+#include stdlib.h
+#include unistd.h
+#include string.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include ufs/ufs/ufsmount.h
+
+#include ../../h_macros.h
+
+ATF_TC(mknod);
+ATF_TC_HEAD(mknod, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, mknod(2) hangs on LFS (PR kern/43503));
+	atf_tc_set_md_var(tc, timeout, 1);
+	atf_tc_set_md_var(tc, use.fs, true);
+	//atf_tc_set_md_var(tc, xfail, PR kern/43503);
+}
+
+#define IMGNAME disk.img
+#define FAKEBLK /dev/blk
+ATF_TC_BODY(mknod, tc)
+{
+	struct ufs_args args;
+
+	/* hmm, maybe i should fix newfs_lfs instead? */
+	if (system(newfs_lfs -D -F -s 1 ./ IMGNAME) == -1)
+		atf_tc_fail_errno(newfs failed);
+
+	memset(args, 0, sizeof(args));
+	args.fspec = __UNCONST(FAKEBLK);
+
+	rump_init();
+	if (rump_sys_mkdir(/mp, 0777) == -1)
+		atf_tc_fail_errno(cannot create mountpoint);
+	rump_pub_etfs_register(FAKEBLK, IMGNAME, RUMP_ETFS_BLK);
+	if (rump_sys_mount(MOUNT_LFS, /mp, 0, args, sizeof(args)) == -1)
+		atf_tc_fail_errno(rump_sys_mount failed);
+
+	if (rump_sys_mknod(/mp/node, S_IFCHR | 0777, 0) == -1)
+		atf_tc_fail_errno(mknod failed);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, mknod);
+	return 0;
+}



CVS commit: src/etc/mtree

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 09:45:47 UTC 2010

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
tests/lfs


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.24 src/etc/mtree/NetBSD.dist.base:1.25
--- src/etc/mtree/NetBSD.dist.base:1.24	Wed Jun 16 19:30:11 2010
+++ src/etc/mtree/NetBSD.dist.base	Mon Jun 28 09:45:47 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.24 2010/06/16 19:30:11 pooka Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.25 2010/06/28 09:45:47 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -202,6 +202,7 @@
 ./usr/libdata/debug/usr/tests/fs
 ./usr/libdata/debug/usr/tests/fs/ffs
 ./usr/libdata/debug/usr/tests/fs/kernfs
+./usr/libdata/debug/usr/tests/fs/lfs
 ./usr/libdata/debug/usr/tests/fs/msdosfs
 ./usr/libdata/debug/usr/tests/fs/nullfs
 ./usr/libdata/debug/usr/tests/fs/ptyfs
@@ -1101,6 +1102,7 @@
 ./usr/tests/fs
 ./usr/tests/fs/ffs
 ./usr/tests/fs/kernfs
+./usr/tests/fs/lfs
 ./usr/tests/fs/msdosfs
 ./usr/tests/fs/nullfs
 ./usr/tests/fs/ptyfs



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

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 09:46:27 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
+test


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.89 src/distrib/sets/lists/tests/mi:1.90
--- src/distrib/sets/lists/tests/mi:1.89	Sat Jun 19 19:09:52 2010
+++ src/distrib/sets/lists/tests/mi	Mon Jun 28 09:46:27 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.89 2010/06/19 19:09:52 pooka Exp $
+# $NetBSD: mi,v 1.90 2010/06/28 09:46:27 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -134,6 +134,8 @@
 ./usr/libdata/debug/usr/tests/fs/ffs/t_snapshot.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/kernfs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/kernfs/t_basic.debug			tests-fs-debug		debug,atf
+./usr/libdata/debug/usr/tests/fs/lfs	tests-fs-debug
+./usr/libdata/debug/usr/tests/fs/lfs/t_pr.debugtests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/msdosfstests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/msdosfs/t_snapshot.debug		tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nullfs	tests-fs-debug
@@ -715,6 +717,9 @@
 ./usr/tests/fs/kernfstests-fs-tests
 ./usr/tests/fs/kernfs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/kernfs/t_basic			tests-fs-tests		atf
+./usr/tests/fs/lfstests-fs-tests
+./usr/tests/fs/lfs/Atffile			tests-fs-tests		atf
+./usr/tests/fs/lfs/t_prtests-fs-tests		atf
 ./usr/tests/fs/msdosfstests-fs-tests
 ./usr/tests/fs/msdosfs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/msdosfs/t_snapshot		tests-fs-tests		atf



CVS commit: src/sys/arch/hpcsh

2010-06-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jun 28 11:18:45 UTC 2010

Modified Files:
src/sys/arch/hpcsh/hpcsh: bus_space.c
src/sys/arch/hpcsh/include: bus.h

Log Message:
Fix always free.  It call, if memory was allocated.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hpcsh/hpcsh/bus_space.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hpcsh/include/bus.h

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

Modified files:

Index: src/sys/arch/hpcsh/hpcsh/bus_space.c
diff -u src/sys/arch/hpcsh/hpcsh/bus_space.c:1.15 src/sys/arch/hpcsh/hpcsh/bus_space.c:1.16
--- src/sys/arch/hpcsh/hpcsh/bus_space.c:1.15	Mon Apr 28 20:23:22 2008
+++ src/sys/arch/hpcsh/hpcsh/bus_space.c	Mon Jun 28 11:18:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.15 2008/04/28 20:23:22 martin Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.15 2008/04/28 20:23:22 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.16 2010/06/28 11:18:44 kiyohara Exp $);
 
 #include debug_hpcsh.h
 
@@ -138,11 +138,13 @@
 bus_space_create(struct hpcsh_bus_space *hbs, const char *name,
 		 bus_addr_t addr, bus_size_t size)
 {
-	if (hbs == NULL)
-		hbs = malloc(sizeof(*hbs), M_DEVBUF, M_NOWAIT);
-	KASSERT(hbs);
 
-	memset(hbs, 0, sizeof(*hbs));
+	if (hbs == NULL) {
+		hbs = malloc(sizeof(*hbs), M_DEVBUF, M_NOWAIT | M_ZERO);
+		hbs-hbs_flags = HBS_FLAGS_ALLOCATED;
+	} else
+		memset(hbs, 0, sizeof(*hbs));
+	KASSERT(hbs);
 
 	/* set default method */
 	*hbs = __default_bus_space;
@@ -172,7 +174,8 @@
 	if (ex != NULL)
 		extent_destroy(ex);
 
-	free(t, M_DEVBUF);
+	if (hbs-hbs_flags  HBS_FLAGS_ALLOCATED)
+		free(hbs, M_DEVBUF);
 }
 
 /* default bus_space tag */

Index: src/sys/arch/hpcsh/include/bus.h
diff -u src/sys/arch/hpcsh/include/bus.h:1.18 src/sys/arch/hpcsh/include/bus.h:1.19
--- src/sys/arch/hpcsh/include/bus.h:1.18	Sat Dec  5 16:29:12 2009
+++ src/sys/arch/hpcsh/include/bus.h	Mon Jun 28 11:18:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.18 2009/12/05 16:29:12 pooka Exp $	*/
+/*	$NetBSD: bus.h,v 1.19 2010/06/28 11:18:44 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -119,6 +119,9 @@
 	/* cookie */
 	void		*hbs_cookie;
 
+	int 		hbs_flags;
+#define HBS_FLAGS_ALLOCATED	(1  0)
+
 	/* mapping/unmapping */
 	int		(*hbs_map)(void *, bus_addr_t, bus_size_t,
 			int, bus_space_handle_t *);



CVS commit: src/sys/arch/ia64/ia64

2010-06-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jun 28 12:08:13 UTC 2010

Modified Files:
src/sys/arch/ia64/ia64: cpu.c machdep.c

Log Message:
Move identifycpu() into cpu.c.  Our cpu* says:
  cpu0 at mainbus0: ProcessorID 0, Id 0, Eid 0
  cpu0: McKinley (1000.00-MHz Itanium 2)
  cpu0: Origin GenuineIntel,  Revision 7
  cpu0: Features 0x1


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/ia64/cpu.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/ia64/ia64/machdep.c

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

Modified files:

Index: src/sys/arch/ia64/ia64/cpu.c
diff -u src/sys/arch/ia64/ia64/cpu.c:1.8 src/sys/arch/ia64/ia64/cpu.c:1.9
--- src/sys/arch/ia64/ia64/cpu.c:1.8	Mon May 17 11:46:19 2010
+++ src/sys/arch/ia64/ia64/cpu.c	Mon Jun 28 12:08:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.8 2010/05/17 11:46:19 kiyohara Exp $	*/
+/*	$NetBSD: cpu.c,v 1.9 2010/06/28 12:08:13 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.8 2010/05/17 11:46:19 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.9 2010/06/28 12:08:13 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -41,17 +41,23 @@
 #include dev/acpi/acpica.h
 #include dev/acpi/acpivar.h
 
+#define MHz	100L
+#define GHz	(1000L * MHz)
 
 struct cpu_info cpu_info_primary __aligned(CACHE_LINE_SIZE);
 
-static int cpu_match(device_t, cfdata_t, void *);
-static void cpu_attach(device_t, device_t, void *);
-
 struct cpu_softc {
 	device_t sc_dev;		/* device tree glue */
 	struct cpu_info *sc_info;	/* pointer to CPU info */
 };
 
+char cpu_model[64];
+
+static int cpu_match(device_t, cfdata_t, void *);
+static void cpu_attach(device_t, device_t, void *);
+
+static void identifycpu(struct cpu_softc *);
+
 CFATTACH_DECL_NEW(cpu, sizeof(struct cpu_softc),
 cpu_match, cpu_attach, NULL, NULL);
 
@@ -98,5 +104,79 @@
 	ci-ci_intrdepth = -1;			/* need ? */
 	ci-ci_dev = self;
 
+	identifycpu(sc);
+
 	return;
 }
+
+
+static void
+identifycpu(struct cpu_softc *sc)
+{
+	uint64_t vendor[3];
+	const char *family_name, *model_name;
+	uint64_t features, tmp;
+	int number, revision, model, family, archrev;
+	extern uint64_t processor_frequency;
+
+	/*
+	 * Assumes little-endian.
+	 */
+	vendor[0] = ia64_get_cpuid(0);
+	vendor[1] = ia64_get_cpuid(1);
+	vendor[2] = '\0';
+
+	tmp = ia64_get_cpuid(3);
+	number = (tmp  0)  0xff;
+	revision = (tmp  8)  0xff;
+	model = (tmp  16)  0xff;
+	family = (tmp  24)  0xff;
+	archrev = (tmp  32)  0xff;
+
+	family_name = model_name = unknown;
+	switch (family) {
+	case 0x07:
+		family_name = Itanium;
+		model_name = Merced;
+		break;
+	case 0x1f:
+		family_name = Itanium 2;
+		switch (model) {
+		case 0x00:
+			model_name = McKinley;
+			break;
+		case 0x01:
+			/*
+			 * Deerfield is a low-voltage variant based on the
+			 * Madison core. We need circumstantial evidence
+			 * (i.e. the clock frequency) to identify those.
+			 * Allow for roughly 1% error margin.
+			 */
+			tmp = processor_frequency  7;
+			if ((processor_frequency - tmp)  1*GHz 
+			(processor_frequency + tmp) = 1*GHz)
+model_name = Deerfield;
+			else
+model_name = Madison;
+			break;
+		case 0x02:
+			model_name = Madison II;
+			break;
+		}
+		break;
+	}
+	snprintf(cpu_model, sizeof(cpu_model), %s, model_name);
+
+	features = ia64_get_cpuid(4);
+
+	aprint_normal_dev(sc-sc_dev, %s (, model_name);
+	if (processor_frequency) {
+		aprint_normal(%ld.%02ld-MHz ,
+		(processor_frequency + 4999) / MHz,
+		((processor_frequency + 4999) / (MHz/100)) % 100);
+	}
+	aprint_normal(%s)\n, family_name);
+	aprint_normal_dev(sc-sc_dev, Origin \%s\,  Revision %d\n,
+	(char *)vendor, revision);
+	aprint_normal_dev(sc-sc_dev, Features 0x%x\n, (uint32_t)features);
+}

Index: src/sys/arch/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.23 src/sys/arch/ia64/ia64/machdep.c:1.24
--- src/sys/arch/ia64/ia64/machdep.c:1.23	Mon Feb  8 19:02:29 2010
+++ src/sys/arch/ia64/ia64/machdep.c	Mon Jun 28 12:08:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.23 2010/02/08 19:02:29 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.24 2010/06/28 12:08:13 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -133,10 +133,7 @@
 struct vm_map *phys_map = NULL;
 
 void *msgbufaddr;
-int	physmem;
-
-char	cpu_model[64];
-char	cpu_family[64];
+int physmem;
 
 vaddr_t kernstart, kernend;
 
@@ -159,78 +156,6 @@
 
 struct fpswa_iface *fpswa_iface;
 
-#define Mhz 100L
-#define Ghz (1000L*Mhz)
-
-static void
-identifycpu(void)
-{
-	uint64_t vendor[3];
-	const char *family_name, *model_name;
-	uint64_t features, tmp;
-	int number, revision, model, family, archrev;
-
-	/*
-	 * Assumes little-endian.
-	 */
-	vendor[0] = ia64_get_cpuid(0);
-	vendor[1] = ia64_get_cpuid(1);
-	vendor[2] = '\0';
-
-	tmp = ia64_get_cpuid(3);

CVS commit: src/sys/arch/ia64

2010-06-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Jun 28 12:14:08 UTC 2010

Modified Files:
src/sys/arch/ia64/include: pci_machdep.h
src/sys/arch/ia64/pci: pci_machdep.c

Log Message:
Implement pci_attach_hook/pci_bus_maxdevs/pci_make_tag/pci_decompose_tag/
pci_conf_read/pci_conf_write.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/include/pci_machdep.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/pci/pci_machdep.c

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

Modified files:

Index: src/sys/arch/ia64/include/pci_machdep.h
diff -u src/sys/arch/ia64/include/pci_machdep.h:1.1 src/sys/arch/ia64/include/pci_machdep.h:1.2
--- src/sys/arch/ia64/include/pci_machdep.h:1.1	Mon Jul 20 04:41:37 2009
+++ src/sys/arch/ia64/include/pci_machdep.h	Mon Jun 28 12:14:08 2010
@@ -1,8 +1,45 @@
-typedef int pci_chipset_tag_t;
+/*	$NetBSD: pci_machdep.h,v 1.2 2010/06/28 12:14:08 kiyohara Exp $	*/
+/*
+ * Copyright (c) 2010 KIYOHARA Takashi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _PCI_MACHDEP_H
+#define _PCI_MACHDEP_H
+
+struct pci_attach_args;
+struct pci_chipset_tag;
+
+typedef struct pci_chipset_tag *pci_chipset_tag_t;
 typedef int pci_intr_handle_t;
 typedef int pcitag_t;
 
-pcireg_t pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg);
-void pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t val);
+void pci_attach_hook(device_t, device_t, struct pcibus_attach_args *);
+int pci_bus_maxdevs(pci_chipset_tag_t, int);
+pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int);
+void pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *, int *);
+pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
+void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
 
-pcitag_t pci_make_tag(pci_chipset_tag_t pc, int bus, int device, int function);
+#endif

Index: src/sys/arch/ia64/pci/pci_machdep.c
diff -u src/sys/arch/ia64/pci/pci_machdep.c:1.1 src/sys/arch/ia64/pci/pci_machdep.c:1.2
--- src/sys/arch/ia64/pci/pci_machdep.c:1.1	Mon Jul 20 04:41:36 2009
+++ src/sys/arch/ia64/pci/pci_machdep.c	Mon Jun 28 12:14:08 2010
@@ -1,6 +1,6 @@
-/*	$NetBSD: pci_machdep.c,v 1.1 2009/07/20 04:41:36 kiyohara Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.2 2010/06/28 12:14:08 kiyohara Exp $	*/
 /*
- * Copyright (c) 2009 KIYOHARA Takashi
+ * Copyright (c) 2009, 2010 KIYOHARA Takashi
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,30 +25,71 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.1 2009/07/20 04:41:36 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.2 2010/06/28 12:14:08 kiyohara Exp $);
 
 #include machine/bus.h
+#include machine/sal.h
+
 #include dev/pci/pcivar.h
 #include dev/pci/pcireg.h
 #include dev/pci/pcidevs.h
 
 
+void
+pci_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba)
+{
+
+	/* Nothing */
+}
+
+int
+pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
+{
+
+	 return 32;	/* 32 device/bus */
+}
+
 pcitag_t
 pci_make_tag(pci_chipset_tag_t pc, int bus, int device, int function)
 {
-printf(%s: not yet\n, __func__);
-	return 0;
+
+#if DIAGNOSTIC
+	if (bus = 256 || device = 32 || function = 8)
+		panic(%s: bad request, __func__);
+#endif
+
+	return (bus  16) | (device  11) | (function  8);
+}
+
+void
+pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, int *bp, int *dp, int *fp)
+{
+
+	if (bp != NULL)
+		*bp = (tag  16)  0xff;
+	if (dp != NULL)
+		*dp = (tag  11)  0x1f;
+	if (fp != NULL)
+		*fp = (tag  8)  0x07;
 }
 
 pcireg_t
 pci_conf_read(pci_chipset_tag_t pc, pcitag_t 

CVS commit: src/sys/net

2010-06-28 Thread Mihai Chelaru
Module Name:src
Committed By:   kefren
Date:   Mon Jun 28 17:26:11 UTC 2010

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

Log Message:
we need to set rt_ifp even if ifa is the same. Fixes the case when one
changes route to a different ifp but wants to keep the same ifa


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/net/rtsock.c

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

Modified files:

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.129 src/sys/net/rtsock.c:1.130
--- src/sys/net/rtsock.c:1.129	Sat Jun 26 14:24:28 2010
+++ src/sys/net/rtsock.c	Mon Jun 28 17:26:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.129 2010/06/26 14:24:28 kefren Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.130 2010/06/28 17:26:11 kefren Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.129 2010/06/26 14:24:28 kefren Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.130 2010/06/28 17:26:11 kefren Exp $);
 
 #include opt_inet.h
 #include opt_mpls.h
@@ -444,6 +444,8 @@
 	rt-rt_ifp = ifp;
 }
 			}
+			if (ifp  rt-rt_ifp != ifp)
+rt-rt_ifp = ifp;
 			rt_setmetrics(rtm-rtm_inits, rtm-rtm_rmx,
 			rt-rt_rmx);
 			if (rt-rt_ifa  rt-rt_ifa-ifa_rtrequest)



CVS commit: src/doc

2010-06-28 Thread Mihai Chelaru
Module Name:src
Committed By:   kefren
Date:   Mon Jun 28 17:29:38 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
mention MPLS support
XXX: I have to write down mpls man page


To generate a diff of this commit:
cvs rdiff -u -r1.1408 -r1.1409 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.1408 src/doc/CHANGES:1.1409
--- src/doc/CHANGES:1.1408	Thu Jun 24 16:15:22 2010
+++ src/doc/CHANGES	Mon Jun 28 17:29:38 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1408 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1409 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -638,3 +638,5 @@
 		[jmcneill 20100618]
 	httpd(8): Import bozohttpd-20100621. [mrg 20100621]
 	hp700: Add support for uturn(4) based machines. [skrll 20100624]
+	network: Add mpls(4) - MultiProtocol Label Switching support
+		[kefren 20100626]



CVS commit: src/sys/dev/pad

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 17:45:08 UTC 2010

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

Log Message:
Don't print spammy message if read is interrupted (ctrl-c)
while waiting for data.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.14 src/sys/dev/pad/pad.c:1.15
--- src/sys/dev/pad/pad.c:1.14	Sat May  1 23:40:21 2010
+++ src/sys/dev/pad/pad.c	Mon Jun 28 17:45:08 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.14 2010/05/01 23:40:21 pooka Exp $ */
+/* $NetBSD: pad.c,v 1.15 2010/06/28 17:45:08 pooka Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pad.c,v 1.14 2010/05/01 23:40:21 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: pad.c,v 1.15 2010/06/28 17:45:08 pooka Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -359,8 +359,10 @@
 			hz/100);
 			if (err != 0  err != EWOULDBLOCK) {
 mutex_exit(sc-sc_mutex);
-aprint_error_dev(sc-sc_dev,
-cv_timedwait_sig returned %d\n, err);
+if (err != ERESTART)
+	aprint_error_dev(sc-sc_dev,
+	cv_timedwait_sig returned %d\n,
+	err);
 return EINTR;
 			}
 			intr = sc-sc_intr;



CVS commit: src/share/man/man4

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 17:48:54 UTC 2010

Modified Files:
src/share/man/man4: u3g.4

Log Message:
When importing a FreeBSD man page it's advisable to change the
synopsis to match our config grammar ...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/u3g.4

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/u3g.4
diff -u src/share/man/man4/u3g.4:1.2 src/share/man/man4/u3g.4:1.3
--- src/share/man/man4/u3g.4:1.2	Mon Oct 13 08:33:04 2008
+++ src/share/man/man4/u3g.4	Mon Jun 28 17:48:54 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: u3g.4,v 1.2 2008/10/13 08:33:04 wiz Exp $
+.\ $NetBSD: u3g.4,v 1.3 2010/06/28 17:48:54 pooka Exp $
 .\
 .\ Copyright (c) 2008 AnyWi Technologies
 .\ All rights reserved.
@@ -17,7 +17,7 @@
 .\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
-.Dd October 7, 2008
+.Dd June 28, 2010
 .Dt U3G 4
 .Os
 .Sh NAME
@@ -28,8 +28,9 @@
 place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
-.Cd device u3g
-.Cd device ucom
+.Cd u3ginit* at uhub? port ?
+.Cd u3g* at uhub? port ?
+.Cd ucom* at u3g?
 .Ed
 .\.Pp
 .\Alternatively, to load the driver as a



CVS commit: src/tests/kernel

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 19:04:00 UTC 2010

Modified Files:
src/tests/kernel: Atffile Makefile
Added Files:
src/tests/kernel/tty: Atffile Makefile t_pr.c

Log Message:
xfail test for kernel panicky in PR kern/40688


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/kernel/Atffile
cvs rdiff -u -r1.4 -r1.5 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/tty/Atffile \
src/tests/kernel/tty/Makefile src/tests/kernel/tty/t_pr.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/kernel/Atffile
diff -u src/tests/kernel/Atffile:1.2 src/tests/kernel/Atffile:1.3
--- src/tests/kernel/Atffile:1.2	Fri Feb 27 07:32:33 2009
+++ src/tests/kernel/Atffile	Mon Jun 28 19:03:59 2010
@@ -1,9 +1,10 @@
 Content-Type: application/X-atf-atffile; version=1
-X-NetBSD-Id: $NetBSD: Atffile,v 1.2 2009/02/27 07:32:33 jmmv Exp $
+X-NetBSD-Id: $NetBSD: Atffile,v 1.3 2010/06/28 19:03:59 pooka Exp $
 
 prop: test-suite = NetBSD
 
 tp: kqueue
+tp: tty
 
 tp: t_extent
 tp: t_lock

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.4 src/tests/kernel/Makefile:1.5
--- src/tests/kernel/Makefile:1.4	Fri May 21 16:47:45 2010
+++ src/tests/kernel/Makefile	Mon Jun 28 19:03:59 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2010/05/21 16:47:45 pooka Exp $
+# $NetBSD: Makefile,v 1.5 2010/06/28 19:03:59 pooka Exp $
 
 NOMAN=		# defined
 
@@ -6,7 +6,7 @@
 
 TESTSDIR=	${TESTSBASE}/kernel
 
-SUBDIR=		kqueue
+SUBDIR=		kqueue tty
 
 TESTS_C=	t_lock
 TESTS_C+=	t_lwpctl

Added files:

Index: src/tests/kernel/tty/Atffile
diff -u /dev/null src/tests/kernel/tty/Atffile:1.1
--- /dev/null	Mon Jun 28 19:04:00 2010
+++ src/tests/kernel/tty/Atffile	Mon Jun 28 19:04:00 2010
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version=1
+X-NetBSD-Id: $NetBSD: Atffile,v 1.1 2010/06/28 19:04:00 pooka Exp $
+
+prop: test-suite = NetBSD
+
+tp: t_pr
Index: src/tests/kernel/tty/Makefile
diff -u /dev/null src/tests/kernel/tty/Makefile:1.1
--- /dev/null	Mon Jun 28 19:04:00 2010
+++ src/tests/kernel/tty/Makefile	Mon Jun 28 19:04:00 2010
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 2010/06/28 19:04:00 pooka Exp $
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/kernel/tty
+
+TESTS_C=	t_pr
+
+LDADD+=		-lrumpkern_tty -lrumpvfs -lrump -lrumpuser -lpthread
+
+.include bsd.test.mk
Index: src/tests/kernel/tty/t_pr.c
diff -u /dev/null src/tests/kernel/tty/t_pr.c:1.1
--- /dev/null	Mon Jun 28 19:04:00 2010
+++ src/tests/kernel/tty/t_pr.c	Mon Jun 28 19:04:00 2010
@@ -0,0 +1,41 @@
+/*	$NetBSD: t_pr.c,v 1.1 2010/06/28 19:04:00 pooka Exp $	*/
+
+#include sys/types.h
+#include sys/ioctl.h
+#include sys/tty.h
+
+#include atf-c.h
+#include fcntl.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+ATF_TC(ptyioctl);
+ATF_TC_HEAD(ptyioctl, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, ioctl on pty);
+	atf_tc_set_md_var(tc, xfail, PR kern/40688);
+}
+
+ATF_TC_BODY(ptyioctl, tc)
+{
+	struct termios tio;
+	int fd;
+
+	rump_init();
+	fd = rump_sys_open(/dev/ptyp1, O_RDWR);
+	if (fd == -1)
+		err(1, open);
+
+	/* boom, dies with null deref under ptcwakeup() */
+	rump_sys_ioctl(fd, TIOCGETA, tio);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, ptyioctl);
+
+	return atf_no_error();
+}



CVS commit: src/etc/mtree

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 19:05:54 UTC 2010

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
more mtree fun for everyone with testdirs


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.25 src/etc/mtree/NetBSD.dist.base:1.26
--- src/etc/mtree/NetBSD.dist.base:1.25	Mon Jun 28 09:45:47 2010
+++ src/etc/mtree/NetBSD.dist.base	Mon Jun 28 19:05:54 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.25 2010/06/28 09:45:47 pooka Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.26 2010/06/28 19:05:54 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -215,6 +215,7 @@
 ./usr/libdata/debug/usr/tests/kernel/kqueue
 ./usr/libdata/debug/usr/tests/kernel/kqueue/read
 ./usr/libdata/debug/usr/tests/kernel/kqueue/write
+./usr/libdata/debug/usr/tests/kernel/tty
 ./usr/libdata/debug/usr/tests/lib
 ./usr/libdata/debug/usr/tests/lib/libc
 ./usr/libdata/debug/usr/tests/lib/libc/hash
@@ -1119,6 +1120,7 @@
 ./usr/tests/kernel/kqueue
 ./usr/tests/kernel/kqueue/read
 ./usr/tests/kernel/kqueue/write
+./usr/tests/kernel/tty
 ./usr/tests/lib
 ./usr/tests/lib/libc
 ./usr/tests/lib/libc/hash



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

2010-06-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jun 28 19:08:53 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
test if i have mastered the setlists for adding tests


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.90 src/distrib/sets/lists/tests/mi:1.91
--- src/distrib/sets/lists/tests/mi:1.90	Mon Jun 28 09:46:27 2010
+++ src/distrib/sets/lists/tests/mi	Mon Jun 28 19:08:53 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.90 2010/06/28 09:46:27 pooka Exp $
+# $NetBSD: mi,v 1.91 2010/06/28 19:08:53 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -181,6 +181,8 @@
 ./usr/libdata/debug/usr/tests/kernel/t_time.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_ucontext.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_writev.debug			tests-kernel-tests	debug,atf
+./usr/libdata/debug/usr/tests/kernel/ttytests-kernel-tests
+./usr/libdata/debug/usr/tests/kernel/tty/t_pr.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/lib	tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc	tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/hashtests-lib-debug
@@ -1106,6 +1108,9 @@
 ./usr/tests/kernel/t_ucontext			tests-kernel-tests		atf
 ./usr/tests/kernel/t_umount			tests-kernel-tests		atf
 ./usr/tests/kernel/t_writev			tests-kernel-tests		atf
+./usr/tests/kernel/ttytests-kernel-tests
+./usr/tests/kernel/tty/Atffile			tests-kernel-tests		atf
+./usr/tests/kernel/tty/t_pr			tests-kernel-tests		atf
 ./usr/tests/lib	tests-lib-tests
 ./usr/tests/lib/Atffiletests-lib-tests		atf
 ./usr/tests/lib/libctests-lib-tests



CVS commit: src/sys/fs/tmpfs

2010-06-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Jun 28 19:32:43 UTC 2010

Modified Files:
src/sys/fs/tmpfs: tmpfs_mem.c

Log Message:
tmpfs_bytes_max: use MIN() rather than min(), which returns int.
Spotted by Wolfgang Solfrank.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/tmpfs/tmpfs_mem.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_mem.c
diff -u src/sys/fs/tmpfs/tmpfs_mem.c:1.1 src/sys/fs/tmpfs/tmpfs_mem.c:1.2
--- src/sys/fs/tmpfs/tmpfs_mem.c:1.1	Tue Jun 22 18:32:07 2010
+++ src/sys/fs/tmpfs/tmpfs_mem.c	Mon Jun 28 19:32:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_mem.c,v 1.1 2010/06/22 18:32:07 rmind Exp $	*/
+/*	$NetBSD: tmpfs_mem.c,v 1.2 2010/06/28 19:32:43 rmind Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_mem.c,v 1.1 2010/06/22 18:32:07 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_mem.c,v 1.2 2010/06/28 19:32:43 rmind Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -110,7 +110,7 @@
 		freepages -= TMPFS_PAGES_RESERVED;
 	}
 	avail_mem = round_page(mp-tm_bytes_used) + (freepages  PAGE_SHIFT);
-	return min(mp-tm_mem_limit, avail_mem);
+	return MIN(mp-tm_mem_limit, avail_mem);
 }
 
 size_t
@@ -123,9 +123,10 @@
 bool
 tmpfs_mem_incr(struct tmpfs_mount *mp, size_t sz)
 {
-	const uint64_t lim = tmpfs_bytes_max(mp);
+	uint64_t lim;
 
 	mutex_enter(mp-tm_acc_lock);
+	lim = tmpfs_bytes_max(mp);
 	if (mp-tm_bytes_used + sz = lim) {
 		mutex_exit(mp-tm_acc_lock);
 		return false;



CVS commit: src/lib/libc

2010-06-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jun 28 21:58:02 UTC 2010

Modified Files:
src/lib/libc/misc: initfini.c
src/lib/libc/stdlib: exit.c

Log Message:
Ensure that initfini.c is referenced by exit.c. The start up code has to
reference the latter as a return of main() results in a call to exit(3),
so this ensures that the libc constructors are run for statically linked
programs. Fixes PR 37454.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/misc/initfini.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/exit.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/misc/initfini.c
diff -u src/lib/libc/misc/initfini.c:1.5 src/lib/libc/misc/initfini.c:1.6
--- src/lib/libc/misc/initfini.c:1.5	Mon Apr 28 20:23:00 2008
+++ src/lib/libc/misc/initfini.c	Mon Jun 28 21:58:02 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: initfini.c,v 1.5 2008/04/28 20:23:00 martin Exp $	 */
+/* 	$NetBSD: initfini.c,v 1.6 2010/06/28 21:58:02 joerg Exp $	 */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,13 +30,13 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: initfini.c,v 1.5 2008/04/28 20:23:00 martin Exp $);
+__RCSID($NetBSD: initfini.c,v 1.6 2010/06/28 21:58:02 joerg Exp $);
 
 #ifdef _LIBC
 #include namespace.h
 #endif
 
-static void	__libc_init(void) __attribute__((__constructor__, __used__));
+void	__libc_init(void) __attribute__((__constructor__, __used__));
 
 void	__guard_setup(void);
 void	__libc_thr_init(void);
@@ -44,7 +44,7 @@
 void	__libc_atexit_init(void);
 
 /* LINTED used */
-static void
+void
 __libc_init(void)
 {
 

Index: src/lib/libc/stdlib/exit.c
diff -u src/lib/libc/stdlib/exit.c:1.11 src/lib/libc/stdlib/exit.c:1.12
--- src/lib/libc/stdlib/exit.c:1.11	Tue Oct 30 17:19:59 2007
+++ src/lib/libc/stdlib/exit.c	Mon Jun 28 21:58:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: exit.c,v 1.11 2007/10/30 17:19:59 skrll Exp $	*/
+/*	$NetBSD: exit.c,v 1.12 2010/06/28 21:58:02 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)exit.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: exit.c,v 1.11 2007/10/30 17:19:59 skrll Exp $);
+__RCSID($NetBSD: exit.c,v 1.12 2010/06/28 21:58:02 joerg Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,14 +45,18 @@
 #include atexit.h
 #endif
 
+extern void __libc_init(void);
+#ifndef __lint
+static void (*force_ref)(void) __used = __libc_init;
+#endif
+
 void (*__cleanup) __P((void));
 
 /*
  * Exit, flushing stdio buffers if necessary.
  */
 void
-exit(status)
-	int status;
+exit(int status)
 {
 
 #ifdef _LIBC



CVS commit: src/sys/dev/usb

2010-06-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 29 04:02:07 UTC 2010

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

Log Message:
 Do not process the abnormality system procedure, when Run/Stop=0 and
HCHalted=1 - this is normal. Fixes a bug that system hangs at boot time
when a USB mass storage is connected via UHCI. This problem was observed
on Intel D410PT and was fixed by Katsumi Yamada.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/dev/usb/uhci.c

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

Modified files:

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.232 src/sys/dev/usb/uhci.c:1.233
--- src/sys/dev/usb/uhci.c:1.232	Wed Feb 24 22:38:09 2010
+++ src/sys/dev/usb/uhci.c	Tue Jun 29 04:02:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.232 2010/02/24 22:38:09 dyoung Exp $	*/
+/*	$NetBSD: uhci.c,v 1.233 2010/06/29 04:02:07 msaitoh Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.232 2010/02/24 22:38:09 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.233 2010/06/29 04:02:07 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1328,7 +1328,9 @@
 		printf(%s: host controller process error\n,
 		   device_xname(sc-sc_dev));
 	}
-	if (status  UHCI_STS_HCH) {
+
+	/* When HCHalted=1 and Run/Stop=0 , it is normal */
+	if ((status  UHCI_STS_HCH)  (UREAD2(sc, UHCI_CMD)  UHCI_CMD_RS)) {
 		/* no acknowledge needed */
 		if (!sc-sc_dying) {
 			printf(%s: host controller halted\n,



CVS commit: src/distrib/sets/lists

2010-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jun 29 04:16:25 UTC 2010

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/distrib/sets/lists/comp: md.amd64

Log Message:
mark some missing libiscsi files as iscsi so that MKISCSI=no works.
reported by director direc...@ktinos.info on port-amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.68 -r1.69 src/distrib/sets/lists/comp/md.amd64

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

Modified files:

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.90 src/distrib/sets/lists/base/md.amd64:1.91
--- src/distrib/sets/lists/base/md.amd64:1.90	Mon Jun  7 13:52:29 2010
+++ src/distrib/sets/lists/base/md.amd64	Tue Jun 29 04:16:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.90 2010/06/07 13:52:29 tnozaki Exp $
+# $NetBSD: md.amd64,v 1.91 2010/06/29 04:16:25 mrg Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -108,8 +108,8 @@
 ./usr/lib/i386/libisccc.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/i386/libisccfg.so.5			base-compat-shlib	compat,pic
 ./usr/lib/i386/libisccfg.so.5.1			base-compat-shlib	compat,pic
-./usr/lib/i386/libiscsi.so.2			base-compat-shlib	compat,pic
-./usr/lib/i386/libiscsi.so.2.0			base-compat-shlib	compat,pic
+./usr/lib/i386/libiscsi.so.2			base-compat-shlib	compat,pic,iscsi
+./usr/lib/i386/libiscsi.so.2.0			base-compat-shlib	compat,pic,iscsi
 ./usr/lib/i386/libkadm5clnt.so.12		base-compat-shlib	compat,pic,kerberos
 ./usr/lib/i386/libkadm5clnt.so.12.0		base-compat-shlib	compat,pic,kerberos
 ./usr/lib/i386/libkadm5srv.so.13		base-compat-shlib	compat,pic,kerberos

Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.68 src/distrib/sets/lists/comp/md.amd64:1.69
--- src/distrib/sets/lists/comp/md.amd64:1.68	Mon Jun  7 13:52:29 2010
+++ src/distrib/sets/lists/comp/md.amd64	Tue Jun 29 04:16:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.68 2010/06/07 13:52:29 tnozaki Exp $
+# $NetBSD: md.amd64,v 1.69 2010/06/29 04:16:25 mrg Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -530,11 +530,11 @@
 ./usr/lib/i386/libisccfg_g.a			comp-c-proflib		compat,debuglib
 ./usr/lib/i386/libisccfg_p.a			comp-c-proflib		compat,profile
 ./usr/lib/i386/libisccfg_pic.a			comp-c-piclib		compat,pic
-./usr/lib/i386/libiscsi.a			comp-c-lib		compat
-./usr/lib/i386/libiscsi.so			base-sys-shlib		compat,pic
-./usr/lib/i386/libiscsi_g.a			base-sys-shlib		compat,debuglib
-./usr/lib/i386/libiscsi_p.a			comp-c-proflib		compat,profile
-./usr/lib/i386/libiscsi_pic.a			comp-c-piclib		compat,pic
+./usr/lib/i386/libiscsi.a			comp-c-lib		compat,iscsi
+./usr/lib/i386/libiscsi.so			base-sys-shlib		compat,pic,iscsi
+./usr/lib/i386/libiscsi_g.a			base-sys-shlib		compat,debuglib,iscsi
+./usr/lib/i386/libiscsi_p.a			comp-c-proflib		compat,profile,iscsi
+./usr/lib/i386/libiscsi_pic.a			comp-c-piclib		compat,pic,iscsi
 ./usr/lib/i386/libkadm5clnt.a			comp-c-lib		compat,kerberos
 ./usr/lib/i386/libkadm5clnt.so			comp-sys-shlib		compat,pic,kerberos
 ./usr/lib/i386/libkadm5clnt_g.a			comp-c-proflib		compat,debuglib,kerberos
@@ -869,7 +869,7 @@
 ./usr/libdata/debug/usr/lib/i386/libisc.so.5.1.debug	comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/i386/libisccc.so.5.1.debug	comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/i386/libisccfg.so.5.1.debug	comp-compat-shlib	compat,pic,debug
-./usr/libdata/debug/usr/lib/i386/libiscsi.so.2.0.debug	comp-compat-shlib	compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/libiscsi.so.2.0.debug	comp-compat-shlib	compat,pic,debug,iscsi
 ./usr/libdata/debug/usr/lib/i386/libkadm5clnt.so.12.0.debug	comp-compat-shlib	compat,pic,kerberos,debug
 ./usr/libdata/debug/usr/lib/i386/libkadm5srv.so.13.0.debug	comp-compat-shlib	compat,pic,kerberos,debug
 ./usr/libdata/debug/usr/lib/i386/libkafs.so.11.0.debug	comp-compat-shlib	compat,pic,kerberos,debug



CVS commit: src/sys/dev/ic

2010-06-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jun 29 04:42:30 UTC 2010

Modified Files:
src/sys/dev/ic: spdmem.c

Log Message:
Fix logic error in detecting length of DDR3 SPD covered by CRC check.

Reported by Jonathan Gray in private email - thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/spdmem.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/ic/spdmem.c
diff -u src/sys/dev/ic/spdmem.c:1.1 src/sys/dev/ic/spdmem.c:1.2
--- src/sys/dev/ic/spdmem.c:1.1	Wed Mar 24 00:31:41 2010
+++ src/sys/dev/ic/spdmem.c	Tue Jun 29 04:42:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.1 2010/03/24 00:31:41 pgoyette Exp $ */
+/* $NetBSD: spdmem.c,v 1.2 2010/06/29 04:42:30 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.1 2010/03/24 00:31:41 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.2 2010/06/29 04:42:30 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -177,7 +177,7 @@
 	/* For DDR3 and FBDIMM, verify the CRC */
 	else if (spd_type = SPDMEM_MEMTYPE_DDR3SDRAM) {
 		spd_len = (sc-sc_read)(sc, 0);
-		if (spd_len  SPDMEM_SPDCRC_116)
+		if (spd_len  SPDMEM_SPDCRC_116)
 			spd_crc_cover = 116;
 		else
 			spd_crc_cover = 125;



CVS commit: src/distrib/sets/lists

2010-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jun 29 04:43:45 UTC 2010

Modified Files:
src/distrib/sets/lists/base: md.sparc64
src/distrib/sets/lists/comp: md.sparc64

Log Message:
fix MKISCSI=no, MKLDAP=no and MKKERBEROS=no builds.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.58 -r1.59 src/distrib/sets/lists/comp/md.sparc64

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

Modified files:

Index: src/distrib/sets/lists/base/md.sparc64
diff -u src/distrib/sets/lists/base/md.sparc64:1.84 src/distrib/sets/lists/base/md.sparc64:1.85
--- src/distrib/sets/lists/base/md.sparc64:1.84	Mon Jun  7 13:52:29 2010
+++ src/distrib/sets/lists/base/md.sparc64	Tue Jun 29 04:43:45 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.84 2010/06/07 13:52:29 tnozaki Exp $
+# $NetBSD: md.sparc64,v 1.85 2010/06/29 04:43:45 mrg Exp $
 ./libexec/ld.elf_so-sparc			base-sysutil-bin	compat,pic
 ./sbin/edlabel	base-sysutil-root	obsolete
 ./usr/bin/fdformatbase-util-bin
@@ -50,8 +50,8 @@
 ./usr/lib/sparc/i18n/libmapper_std.so.5.0	base-i18n-shlib		compat,pic
 ./usr/lib/sparc/i18n/libmapper_zone.so.5	base-i18n-shlib		compat,pic
 ./usr/lib/sparc/i18n/libmapper_zone.so.5.0	base-i18n-shlib		compat,pic
-./usr/lib/sparc/libasn1.so.8			base-compat-shlib	compat,pic
-./usr/lib/sparc/libasn1.so.8.0			base-compat-shlib	compat,pic
+./usr/lib/sparc/libasn1.so.8			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libasn1.so.8.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/sparc/libbfd.so.11			base-compat-shlib	compat,pic,binutils
 ./usr/lib/sparc/libbfd.so.11.0			base-compat-shlib	compat,pic,binutils
 ./usr/lib/sparc/libbind9.so.5			base-compat-shlib	compat,pic
@@ -64,8 +64,8 @@
 ./usr/lib/sparc/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libc.so.12			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libc.so.12.173			base-compat-shlib	compat,pic
-./usr/lib/sparc/libcom_err.so.6			base-compat-shlib	compat,pic
-./usr/lib/sparc/libcom_err.so.6.0		base-compat-shlib	compat,pic
+./usr/lib/sparc/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libcom_err.so.6.0		base-compat-shlib	compat,pic,kerberos
 ./usr/lib/sparc/libcrypt.so.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libcrypt.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libcrypto.so.6			base-compat-shlib	compat,pic
@@ -86,14 +86,14 @@
 ./usr/lib/sparc/libgcc_s.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libgnumalloc.so.1		base-compat-shlib	compat,pic
 ./usr/lib/sparc/libgnumalloc.so.1.0		base-compat-shlib	compat,pic
-./usr/lib/sparc/libgssapi.so.9			base-compat-shlib	compat,pic
-./usr/lib/sparc/libgssapi.so.9.0		base-compat-shlib	compat,pic
-./usr/lib/sparc/libhdb.so.13			base-compat-shlib	compat,pic
-./usr/lib/sparc/libhdb.so.13.0			base-compat-shlib	compat,pic
-./usr/lib/sparc/libheimntlm.so.3		base-compat-shlib	compat,pic
-./usr/lib/sparc/libheimntlm.so.3.0		base-compat-shlib	compat,pic
-./usr/lib/sparc/libhx509.so.4			base-compat-shlib	compat,pic
-./usr/lib/sparc/libhx509.so.4.0			base-compat-shlib	compat,pic
+./usr/lib/sparc/libgssapi.so.9			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libgssapi.so.9.0		base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libhdb.so.13			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libhdb.so.13.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libheimntlm.so.3		base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libheimntlm.so.3.0		base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libhx509.so.4			base-compat-shlib	compat,pic,kerberos
+./usr/lib/sparc/libhx509.so.4.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/sparc/libintl.so.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libintl.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libipsec.so.3			base-compat-shlib	compat,pic
@@ -104,24 +104,24 @@
 ./usr/lib/sparc/libisccc.so.5.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libisccfg.so.5			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libisccfg.so.5.1		base-compat-shlib	compat,pic
-./usr/lib/sparc/libiscsi.so.2			base-compat-shlib	compat,pic
-./usr/lib/sparc/libiscsi.so.2.0			base-compat-shlib	compat,pic
-./usr/lib/sparc/libkadm5clnt.so.12		base-compat-shlib	compat,pic
-./usr/lib/sparc/libkadm5clnt.so.12.0		base-compat-shlib	compat,pic
-./usr/lib/sparc/libkadm5srv.so.13		base-compat-shlib	compat,pic
-./usr/lib/sparc/libkadm5srv.so.13.0		base-compat-shlib	compat,pic
-./usr/lib/sparc/libkafs.so.11			base-compat-shlib	compat,pic
-./usr/lib/sparc/libkafs.so.11.0			base-compat-shlib	compat,pic
-./usr/lib/sparc/libkrb5.so.24			base-compat-shlib	compat,pic
-./usr/lib/sparc/libkrb5.so.24.0			base-compat-shlib	compat,pic
+./usr/lib/sparc/libiscsi.so.2			base-compat-shlib	compat,pic,iscsi
+./usr/lib/sparc/libiscsi.so.2.0			base-compat-shlib	compat,pic,iscsi

CVS commit: src/distrib/sets

2010-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jun 29 05:51:53 UTC 2010

Modified Files:
src/distrib/sets: Makefile

Log Message:
export PIGZ=${TOOL_PIGZ} (not yet used.)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/distrib/sets/Makefile

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

Modified files:

Index: src/distrib/sets/Makefile
diff -u src/distrib/sets/Makefile:1.78 src/distrib/sets/Makefile:1.79
--- src/distrib/sets/Makefile:1.78	Tue Dec 15 06:18:07 2009
+++ src/distrib/sets/Makefile	Tue Jun 29 05:51:53 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.78 2009/12/15 06:18:07 uebayasi Exp $
+#	$NetBSD: Makefile,v 1.79 2010/06/29 05:51:53 mrg Exp $
 
 # The `all' target must appear before bsd.own.mk is pulled in.
 all:
@@ -19,6 +19,7 @@
 		MKTEMP=${TOOL_MKTEMP:Q} \
 		MTREE=${TOOL_MTREE:Q} \
 		PAX=${TOOL_PAX:Q} \
+		PIGZ=${TOOL_PIGZ:Q} \
 		PKG_CREATE=${TOOL_PKG_CREATE:Q} \
 		SED=${TOOL_SED:Q} \
 		TSORT=${TSORT:Q}