CVS commit: src/sys/dev/acpi

2011-01-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jan 10 09:07:28 UTC 2011

Modified Files:
src/sys/dev/acpi: acpi_display.c

Log Message:
Small clean-up in the match and attach functions. Namely, use the attach
args instead of referencing the global softc. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/acpi_display.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/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.7 src/sys/dev/acpi/acpi_display.c:1.8
--- src/sys/dev/acpi/acpi_display.c:1.7	Sun Nov  7 16:36:26 2010
+++ src/sys/dev/acpi/acpi_display.c	Mon Jan 10 09:07:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.7 2010/11/07 16:36:26 gsutre Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.8 2011/01/10 09:07:27 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.7 2010/11/07 16:36:26 gsutre Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.8 2011/01/10 09:07:27 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -394,40 +394,46 @@
 {
 	struct acpi_attach_args *aa = aux;
 	struct acpi_devnode *ad = aa-aa_node;
-	struct acpi_softc *sc = device_private(ad-ad_root);
 	struct acpi_pci_info *ap;
-	pcitag_t tag;
 	pcireg_t id, class;
+	pcitag_t tag;
 
-	/*
-	 * We match ACPI devices that correspond to PCI display controllers.
-	 */
 	if (ad-ad_type != ACPI_TYPE_DEVICE)
 		return 0;
 
 	ap = ad-ad_pciinfo;
-	if ((ap == NULL) ||
-	!(ap-ap_flags  ACPI_PCI_INFO_DEVICE) ||
-	(ap-ap_function == 0x))
+
+	if (ap == NULL)
+		return 0;
+
+	if ((ap-ap_flags  ACPI_PCI_INFO_DEVICE) == 0)
 		return 0;
 
-	KASSERT(ap-ap_bus  256  ap-ap_device  32  ap-ap_function  8);
+	if (ap-ap_function == 0x)
+		return 0;
+
+	KASSERT(ap-ap_bus  256);
+	KASSERT(ap-ap_device  32);
+	KASSERT(ap-ap_function  8);
 
-	tag = pci_make_tag(sc-sc_pc, ap-ap_bus, ap-ap_device,
-	ap-ap_function);
+	/*
+	 * Check that the PCI device is present, verify
+	 * the class of the PCI device, and finally see
+	 * if the ACPI device is capable of something.
+	 */
+	tag = pci_make_tag(aa-aa_pc, ap-ap_bus,
+	ap-ap_device, ap-ap_function);
 
-	/* Check that the PCI device is present. */
-	id = pci_conf_read(sc-sc_pc, tag, PCI_ID_REG);
-	if (PCI_VENDOR(id) == PCI_VENDOR_INVALID ||
-	PCI_VENDOR(id) == 0)
+	id = pci_conf_read(aa-aa_pc, tag, PCI_ID_REG);
+
+	if (PCI_VENDOR(id) == PCI_VENDOR_INVALID || PCI_VENDOR(id) == 0)
 		return 0;
 
-	/* Check the class of the PCI device. */
-	class = pci_conf_read(sc-sc_pc, tag, PCI_CLASS_REG);
+	class = pci_conf_read(aa-aa_pc, tag, PCI_CLASS_REG);
+
 	if (PCI_CLASS(class) != PCI_CLASS_DISPLAY)
 		return 0;
 
-	/* We match if the display adapter is capable of something... */
 	if (acpidisp_vga_capabilities(ad) == 0)
 		return 0;
 
@@ -444,50 +450,50 @@
 	aprint_naive(: ACPI Display Adapter\n);
 	aprint_normal(: ACPI Display Adapter\n);
 
-	asc-sc_dev = self;
 	asc-sc_node = ad;
+	asc-sc_dev = self;
 	asc-sc_log = NULL;
+
 	mutex_init(asc-sc_mtx, MUTEX_DEFAULT, IPL_NONE);
+
 	asc-sc_caps = acpidisp_vga_capabilities(ad);
 	asc-sc_policy = acpidisp_default_bios_policy;
 	asc-sc_odinfo = NULL;
 
 	acpidisp_vga_print_capabilities(self, asc-sc_caps);
 
-	/* Enumerate connected output devices. */
+	/*
+	 * Enumerate connected output devices, attach
+	 * output display devices, and bind the attached
+	 * output devices to the enumerated ones.
+	 */
 	asc-sc_odinfo = acpidisp_init_odinfo(asc);
 
-	/* Attach (via autoconf(9)) ACPI display output devices. */
 	acpidisp_vga_scan_outdevs(asc);
 
-	/* Bind the attached output devices to the enumerated ones. */
 	if (asc-sc_odinfo != NULL) {
 		acpidisp_vga_bind_outdevs(asc);
 		acpidisp_print_odinfo(self, asc-sc_odinfo);
 	}
 
-	/* Install ACPI notify handler. */
-	(void)acpi_register_notify(asc-sc_node, acpidisp_vga_notify_handler);
-
 	/*
 	 * Set BIOS automatic switch policy.
 	 *
-	 * Many laptops do not support output device switching with the methods
-	 * specified in the ACPI extensions for display adapters.  Therefore, we
-	 * leave the BIOS output switch policy on ``auto'' instead of setting it
-	 * to ``normal''.
+	 * Many laptops do not support output device switching with
+	 * the methods specified in the ACPI extensions for display
+	 * adapters. Therefore, we leave the BIOS output switch policy
+	 * on auto instead of setting it to normal.
 	 */
 	asc-sc_policy.fmt.output = ACPI_DISP_POLICY_OUTPUT_AUTO;
 	asc-sc_policy.fmt.brightness = ACPI_DISP_POLICY_BRIGHTNESS_NORMAL;
+
 	if (acpidisp_set_policy(asc, asc-sc_policy.raw))
 		asc-sc_policy = acpidisp_default_bios_policy;
 
-	/* Setup sysctl. */
 	acpidisp_vga_sysctl_setup(asc);
 
-	/* Power management. */
-	if (!pmf_device_register(self, NULL, acpidisp_vga_resume))
-		

CVS commit: src

2011-01-10 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Jan 10 11:11:04 UTC 2011

Modified Files:
src/sys/miscfs/genfs: layer_extern.h layer_vnops.c
src/sys/miscfs/nullfs: null_vnops.c
src/sys/miscfs/overlay: overlay_vnops.c
src/sys/miscfs/umapfs: umap_vnops.c
src/tests/fs/ptyfs: t_nullpts.c

Log Message:
Add layer_revoke() that adjusts the lower vnode use count to be at least as
high as the upper vnode count before passing down the VOP_REVOKE().

This way vclean() check for active (vp-v_usecount  1) vnodes gets it right.

Should fix PR kern/43456.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/miscfs/genfs/layer_extern.h
cvs rdiff -u -r1.44 -r1.45 src/sys/miscfs/genfs/layer_vnops.c
cvs rdiff -u -r1.36 -r1.37 src/sys/miscfs/nullfs/null_vnops.c
cvs rdiff -u -r1.17 -r1.18 src/sys/miscfs/overlay/overlay_vnops.c
cvs rdiff -u -r1.50 -r1.51 src/sys/miscfs/umapfs/umap_vnops.c
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/ptyfs/t_nullpts.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/miscfs/genfs/layer_extern.h
diff -u src/sys/miscfs/genfs/layer_extern.h:1.26 src/sys/miscfs/genfs/layer_extern.h:1.27
--- src/sys/miscfs/genfs/layer_extern.h:1.26	Fri Jul  2 08:09:51 2010
+++ src/sys/miscfs/genfs/layer_extern.h	Mon Jan 10 11:11:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: layer_extern.h,v 1.26 2010/07/02 08:09:51 hannken Exp $	*/
+/*	$NetBSD: layer_extern.h,v 1.27 2011/01/10 11:11:03 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics  Space Administration
@@ -113,6 +113,7 @@
 int	layer_open(void *);
 int	layer_remove(void *);
 int	layer_rename(void *);
+int	layer_revoke(void *);
 int	layer_rmdir(void *);
 int	layer_getpages(void *);
 int	layer_putpages(void *);

Index: src/sys/miscfs/genfs/layer_vnops.c
diff -u src/sys/miscfs/genfs/layer_vnops.c:1.44 src/sys/miscfs/genfs/layer_vnops.c:1.45
--- src/sys/miscfs/genfs/layer_vnops.c:1.44	Sun Jan  2 10:38:02 2011
+++ src/sys/miscfs/genfs/layer_vnops.c	Mon Jan 10 11:11:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: layer_vnops.c,v 1.44 2011/01/02 10:38:02 hannken Exp $	*/
+/*	$NetBSD: layer_vnops.c,v 1.45 2011/01/10 11:11:03 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics  Space Administration
@@ -170,7 +170,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: layer_vnops.c,v 1.44 2011/01/02 10:38:02 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: layer_vnops.c,v 1.45 2011/01/10 11:11:03 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -650,6 +650,32 @@
 }
 
 int
+layer_revoke(void *v)
+{
+struct vop_revoke_args /* {
+		struct vnode *a_vp;
+		int a_flags;
+	} */ *ap = v;
+	struct vnode *vp = ap-a_vp;
+	struct vnode *lvp = LAYERVPTOLOWERVP(vp);
+	int i, n, error;
+
+	/*
+	 * We will most likely end up in vclean which uses the v_usecount
+	 * to determine if a vnode is active.  So we have to adjust the
+	 * lower vp's usecount to be at least as high as our usecount.
+	 */
+	n = vp-v_usecount - lvp-v_usecount;
+	for (i = 0; i  n; i++)
+		vref(lvp);
+	error = LAYERFS_DO_BYPASS(vp, ap);
+	for (i = 0; i  n; i++)
+		vrele(lvp);
+
+	return error;
+}
+
+int
 layer_reclaim(void *v)
 {
 	struct vop_reclaim_args /* {

Index: src/sys/miscfs/nullfs/null_vnops.c
diff -u src/sys/miscfs/nullfs/null_vnops.c:1.36 src/sys/miscfs/nullfs/null_vnops.c:1.37
--- src/sys/miscfs/nullfs/null_vnops.c:1.36	Fri Jul  2 08:09:51 2010
+++ src/sys/miscfs/nullfs/null_vnops.c	Mon Jan 10 11:11:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: null_vnops.c,v 1.36 2010/07/02 08:09:51 hannken Exp $	*/
+/*	$NetBSD: null_vnops.c,v 1.37 2011/01/10 11:11:03 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999 National Aeronautics  Space Administration
@@ -80,7 +80,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: null_vnops.c,v 1.36 2010/07/02 08:09:51 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: null_vnops.c,v 1.37 2011/01/10 11:11:03 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -109,6 +109,7 @@
 	{ vop_print_desc,	layer_print },
 	{ vop_remove_desc,	layer_remove },
 	{ vop_rename_desc,	layer_rename },
+	{ vop_revoke_desc,	layer_revoke },
 	{ vop_rmdir_desc,	layer_rmdir },
 
 	{ vop_open_desc,	layer_open },	/* mount option handling */

Index: src/sys/miscfs/overlay/overlay_vnops.c
diff -u src/sys/miscfs/overlay/overlay_vnops.c:1.17 src/sys/miscfs/overlay/overlay_vnops.c:1.18
--- src/sys/miscfs/overlay/overlay_vnops.c:1.17	Fri Jul  2 08:09:51 2010
+++ src/sys/miscfs/overlay/overlay_vnops.c	Mon Jan 10 11:11:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: overlay_vnops.c,v 1.17 2010/07/02 08:09:51 hannken Exp $	*/
+/*	$NetBSD: overlay_vnops.c,v 1.18 2011/01/10 11:11:03 hannken Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 National Aeronautics  Space Administration
@@ -67,7 +67,7 @@
  *
  * Ancestors:
  *	@(#)lofs_vnops.c	1.2 (Berkeley) 6/18/92
- *	$Id: overlay_vnops.c,v 1.17 2010/07/02 08:09:51 hannken Exp $
+ *	

CVS commit: src/sys/arch/xen/include

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 11:13:03 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
fix typo in ioctl definition


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/xenio.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/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.8 src/sys/arch/xen/include/xenio.h:1.9
--- src/sys/arch/xen/include/xenio.h:1.8	Wed Dec 15 14:45:47 2010
+++ src/sys/arch/xen/include/xenio.h	Mon Jan 10 11:13:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.8 2010/12/15 14:45:47 cegger Exp $	*/
+/*	$NetBSD: xenio.h,v 1.9 2011/01/10 11:13:03 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -112,7 +112,7 @@
 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
 _IOR('P', 5, int)
 #define IOCTL_PRIVCMD_MMAPBATCH_V2  \
-_IOW('P, 6, privcmd_mmapbatch_v2_t)
+_IOW('P', 6, privcmd_mmapbatch_v2_t)
 
 /* Interface to /dev/xenevt */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */



CVS commit: src/sys/dev/ic

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 11:18:15 UTC 2011

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

Log Message:
Don't call bus_dmamap_load(9) and bus_dmamap_sync(9) on command xfers
if (AT_READ|AT_WRITE) in ata_c-flags is set but ata_c-bcount is zero.
Someone actually tries to put such a command and it causes
DIAGNOSTIC panic in x86/bus_dma.c:_bus_dmamap_sync().
I think bus_dma(9) API itself may allow calls with mapsize==0
but there are many MD code that asserts offset=mapsize or len==0.

The problem is reported and fix is confirmed by Takuro KUBOTA
with XEN DOM0 kernel (which has options DIAGNOSTIC).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/ahcisata_core.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/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.30 src/sys/dev/ic/ahcisata_core.c:1.31
--- src/sys/dev/ic/ahcisata_core.c:1.30	Sat Nov 13 13:52:00 2010
+++ src/sys/dev/ic/ahcisata_core.c	Mon Jan 10 11:18:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.30 2010/11/13 13:52:00 uebayasi Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.31 2011/01/10 11:18:14 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.30 2010/11/13 13:52:00 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.31 2011/01/10 11:18:14 tsutsui Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -769,7 +769,8 @@
 	AHCIDEBUG_PRINT((%s port %d header %p\n, AHCINAME(sc),
 	chp-ch_channel, cmd_h), DEBUG_XFERS);
 	if (ahci_dma_setup(chp, slot,
-	(ata_c-flags  (AT_READ|AT_WRITE)) ? ata_c-data : NULL,
+	(ata_c-flags  (AT_READ|AT_WRITE)  ata_c-bcount  0) ?
+	ata_c-data : NULL,
 	ata_c-bcount,
 	(ata_c-flags  AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) {
 		ata_c-flags |= AT_DF;
@@ -904,7 +905,7 @@
 	/* this comamnd is not active any more */
 	achp-ahcic_cmds_active = ~(1  slot);
 
-	if (ata_c-flags  (AT_READ|AT_WRITE)) {
+	if (ata_c-flags  (AT_READ|AT_WRITE)  ata_c-bcount  0) {
 		bus_dmamap_sync(sc-sc_dmat, achp-ahcic_datad[slot], 0,
 		achp-ahcic_datad[slot]-dm_mapsize,
 		(ata_c-flags  AT_READ) ? BUS_DMASYNC_POSTREAD :



CVS commit: src/lib/librumpuser

2011-01-10 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 10 11:57:54 UTC 2011

Modified Files:
src/lib/librumpuser: rumpuser_sp.c sp_common.c

Log Message:
g/c code which is unused in the server


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/librumpuser/rumpuser_sp.c
cvs rdiff -u -r1.21 -r1.22 src/lib/librumpuser/sp_common.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/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.32 src/lib/librumpuser/rumpuser_sp.c:1.33
--- src/lib/librumpuser/rumpuser_sp.c:1.32	Sun Jan  9 14:10:03 2011
+++ src/lib/librumpuser/rumpuser_sp.c	Mon Jan 10 11:57:53 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_sp.c,v 1.32 2011/01/09 14:10:03 pooka Exp $	*/
+/*  $NetBSD: rumpuser_sp.c,v 1.33 2011/01/10 11:57:53 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_sp.c,v 1.32 2011/01/09 14:10:03 pooka Exp $);
+__RCSID($NetBSD: rumpuser_sp.c,v 1.33 2011/01/10 11:57:53 pooka Exp $);
 
 #include sys/types.h
 #include sys/atomic.h
@@ -99,68 +99,17 @@
 
 /*
  * This version is for the server.  It's optimized for multiple threads
- * and is *NOT* reentrant wrt to signals
+ * and is *NOT* reentrant wrt to signals.
  */
 static int
 waitresp(struct spclient *spc, struct respwait *rw)
 {
-	struct pollfd pfd;
 	int rv = 0;
 
 	sendunlockl(spc);
-
-	rw-rw_error = 0;
-	while (!rw-rw_done  rw-rw_error == 0
-	 spc-spc_state != SPCSTATE_DYING){
-		/* are we free to receive? */
-		if (spc-spc_istatus == SPCSTATUS_FREE) {
-			int gotresp;
-
-			spc-spc_istatus = SPCSTATUS_BUSY;
-			pthread_mutex_unlock(spc-spc_mtx);
-
-			pfd.fd = spc-spc_fd;
-			pfd.events = POLLIN;
-
-			for (gotresp = 0; !gotresp; ) {
-switch (readframe(spc)) {
-case 0:
-	poll(pfd, 1, INFTIM);
-	continue;
-case -1:
-	rv = errno;
-	spc-spc_state = SPCSTATE_DYING;
-	goto cleanup;
-default:
-	break;
-}
-
-switch (spc-spc_hdr.rsp_class) {
-case RUMPSP_RESP:
-case RUMPSP_ERROR:
-	kickwaiter(spc);
-	gotresp = spc-spc_hdr.rsp_reqno ==
-	rw-rw_reqno;
-	break;
-case RUMPSP_REQ:
-	handlereq(spc);
-	break;
-default:
-	/* panic */
-	break;
-}
-			}
- cleanup:
-			pthread_mutex_lock(spc-spc_mtx);
-			if (spc-spc_istatus == SPCSTATUS_WANTED)
-kickall(spc);
-			spc-spc_istatus = SPCSTATUS_FREE;
-		} else {
-			spc-spc_istatus = SPCSTATUS_WANTED;
-			pthread_cond_wait(rw-rw_cv, spc-spc_mtx);
-		}
+	while (!rw-rw_done  spc-spc_state != SPCSTATE_DYING) {
+		pthread_cond_wait(rw-rw_cv, spc-spc_mtx);
 	}
-
 	TAILQ_REMOVE(spc-spc_respwait, rw, rw_entries);
 	pthread_mutex_unlock(spc-spc_mtx);
 

Index: src/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.21 src/lib/librumpuser/sp_common.c:1.22
--- src/lib/librumpuser/sp_common.c:1.21	Sun Jan  9 14:10:03 2011
+++ src/lib/librumpuser/sp_common.c	Mon Jan 10 11:57:53 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.21 2011/01/09 14:10:03 pooka Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.22 2011/01/10 11:57:53 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -290,7 +290,7 @@
 {
 
 	rw-rw_data = NULL;
-	rw-rw_dlen = rw-rw_done = 0;
+	rw-rw_dlen = rw-rw_done = rw-rw_error = 0;
 	pthread_cond_init(rw-rw_cv, NULL);
 
 	pthread_mutex_lock(spc-spc_mtx);
@@ -315,7 +315,7 @@
 kickwaiter(struct spclient *spc)
 {
 	struct respwait *rw;
-	int error;
+	int error = 0;
 
 	pthread_mutex_lock(spc-spc_mtx);
 	TAILQ_FOREACH(rw, spc-spc_respwait, rw_entries) {
@@ -334,8 +334,6 @@
 	rw-rw_dlen = (size_t)(spc-spc_off - HDRSZ);
 	if (spc-spc_hdr.rsp_class == RUMPSP_ERROR) {
 		error = rw-rw_error = spc-spc_hdr.rsp_error;
-	} else {
-		error = rw-rw_error = 0;
 	}
 	pthread_cond_signal(rw-rw_cv);
 	pthread_mutex_unlock(spc-spc_mtx);



CVS commit: src/sys/dev/pci

2011-01-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 10 12:23:21 UTC 2011

Modified Files:
src/sys/dev/pci: pcireg.h ppb.c

Log Message:
ppb_fix_pcix changes:
- rename to ppb_fix_pcie
- support version PCI-E 2.0
- print version and device/port type information
- use constants from pcireg.h instead of magic numbers

changes:

  ppb2 at pci0 dev 21 function 0: vendor 0x15ad product 0x07a0 (rev. 0x01)
  ppb2: unsupported PCI Express version

to:

  ppb2 at pci0 dev 21 function 0: vendor 0x15ad product 0x07a0 (rev. 0x01)
  ppb2: PCI Express 2.0 Root Port of PCI-E Root Complex


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/pcireg.h
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/ppb.c

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

Modified files:

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.68 src/sys/dev/pci/pcireg.h:1.69
--- src/sys/dev/pci/pcireg.h:1.68	Sat Dec 11 18:17:39 2010
+++ src/sys/dev/pci/pcireg.h	Mon Jan 10 12:23:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.68 2010/12/11 18:17:39 matt Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.69 2011/01/10 12:23:21 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -604,6 +604,17 @@
  * PCI Express; access via capability pointer.
  */
 #define PCI_PCIE_XCAP		0x00
+#define	PCI_PCIE_XCAP_VER_MASK	0x000f
+#define	 PCI_PCIE_XCAP_VER_1_0		0x0001
+#define	 PCI_PCIE_XCAP_VER_2_0		0x0002
+#define	PCI_PCIE_XCAP_TYPE_MASK	0x00f0
+#define	 PCI_PCIE_XCAP_TYPE_PCIE_DEV	0x
+#define	 PCI_PCIE_XCAP_TYPE_PCI_DEV	0x0010
+#define	 PCI_PCIE_XCAP_TYPE_ROOT	0x0040
+#define	 PCI_PCIE_XCAP_TYPE_UP		0x0050
+#define	 PCI_PCIE_XCAP_TYPE_DOWN	0x0060
+#define	 PCI_PCIE_XCAP_TYPE_PCIE2PCI	0x0070
+#define	 PCI_PCIE_XCAP_TYPE_PCI2PCIE	0x0080
 #define PCI_PCIE_XCAP_SI	0x0100
 #define PCI_PCIE_DCAP		0x04
 #define PCI_PCIE_DCSR		0x08

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.43 src/sys/dev/pci/ppb.c:1.44
--- src/sys/dev/pci/ppb.c:1.43	Sat Dec 11 18:25:02 2010
+++ src/sys/dev/pci/ppb.c	Mon Jan 10 12:23:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.43 2010/12/11 18:25:02 matt Exp $	*/
+/*	$NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.43 2010/12/11 18:25:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -43,6 +43,10 @@
 #include dev/pci/ppbreg.h
 #include dev/pci/pcidevs.h
 
+#define	PCI_PCIE_SLCSR_NOTIFY_MASK	\
+	(PCI_PCIE_SLCSR_ABE | PCI_PCIE_SLCSR_PFE | PCI_PCIE_SLCSR_MSE |	\
+	 PCI_PCIE_SLCSR_PDE | PCI_PCIE_SLCSR_CCE | PCI_PCIE_SLCSR_HPE)
+
 struct ppb_softc {
 	device_t sc_dev;		/* generic device glue */
 	pci_chipset_tag_t sc_pc;	/* our PCI chipset... */
@@ -83,7 +87,7 @@
 }
 
 static void
-ppb_fix_pcix(device_t self)
+ppb_fix_pcie(device_t self)
 {
 	struct ppb_softc *sc = device_private(self);
 	pcireg_t reg;
@@ -93,15 +97,54 @@
 off, reg))
 		return; /* Not a PCIe device */
 
-	if ((reg  0x000f) != 0x0001) {
-		aprint_normal_dev(self, unsupported PCI Express version\n);
+	aprint_normal_dev(self, PCI Express );
+	switch (reg  PCI_PCIE_XCAP_VER_MASK) {
+	case PCI_PCIE_XCAP_VER_1_0:
+		aprint_normal(1.0);
+	case PCI_PCIE_XCAP_VER_2_0:
+		aprint_normal(2.0);
+		break;
+	default:
+		aprint_normal_dev(self, version unsupported (0x%x)\n,
+		(reg  PCI_PCIE_XCAP_VER_MASK)  16);
 		return;
 	}
-	reg = pci_conf_read(sc-sc_pc, sc-sc_tag, off + 0x18);
-	if (reg  0x003f) {
-		aprint_normal_dev(self, disabling notification events\n);
-		reg = ~0x003f;
-		pci_conf_write(sc-sc_pc, sc-sc_tag, off + 0x18, reg);
+	aprint_normal( );
+	switch (reg  PCI_PCIE_XCAP_TYPE_MASK) {
+	case PCI_PCIE_XCAP_TYPE_PCIE_DEV:
+		aprint_normal(PCI-E Endpoint device);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCI_DEV:
+		aprint_normal(Legacy PCI-E Endpoint device);
+		break;
+	case PCI_PCIE_XCAP_TYPE_ROOT:
+		aprint_normal(Root Port of PCI-E Root Complex);
+		break;
+	case PCI_PCIE_XCAP_TYPE_UP:
+		aprint_normal(Upstream Port of PCI-E Switch);
+		break;
+	case PCI_PCIE_XCAP_TYPE_DOWN:
+		aprint_normal(Downstream Port of PCI-E Switch);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCIE2PCI:
+		aprint_normal(PCI-E to PCI/PCI-X Bridge);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCI2PCIE:
+		aprint_normal(PCI/PCI-X to PCI-E Bridge);
+		break;
+	default:
+		aprint_normal(Device/Port Type 0x%x,
+		(reg  PCI_PCIE_XCAP_TYPE_MASK)  20);
+		break;
+	}
+	aprint_normal(\n);
+
+	reg = pci_conf_read(sc-sc_pc, sc-sc_tag, off + PCI_PCIE_SLCSR);
+	if (reg  PCI_PCIE_SLCSR_NOTIFY_MASK) {
+		aprint_debug_dev(self, disabling notification events\n);
+		reg = ~PCI_PCIE_SLCSR_NOTIFY_MASK;
+		pci_conf_write(sc-sc_pc, sc-sc_tag,
+		off + PCI_PCIE_SLCSR, 

CVS commit: src/sys/arch/sgimips

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 13:29:29 UTC 2011

Modified Files:
src/sys/arch/sgimips/hpc: if_sq.c
src/sys/arch/sgimips/ioc: if_le_oioc.c
src/sys/arch/sgimips/mace: if_mec.c

Log Message:
Use ether_aton_r() in sys/net/if_ethersubr.c instead of home grown copies.
Hint from r...@.  Tested on IP32 mec(4).


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sgimips/hpc/if_sq.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sgimips/ioc/if_le_oioc.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sgimips/mace/if_mec.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/sgimips/hpc/if_sq.c
diff -u src/sys/arch/sgimips/hpc/if_sq.c:1.36 src/sys/arch/sgimips/hpc/if_sq.c:1.37
--- src/sys/arch/sgimips/hpc/if_sq.c:1.36	Mon Apr  5 07:19:31 2010
+++ src/sys/arch/sgimips/hpc/if_sq.c	Mon Jan 10 13:29:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sq.c,v 1.36 2010/04/05 07:19:31 joerg Exp $	*/
+/*	$NetBSD: if_sq.c,v 1.37 2011/01/10 13:29:29 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 Rafal K. Boni
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_sq.c,v 1.36 2010/04/05 07:19:31 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_sq.c,v 1.37 2011/01/10 13:29:29 tsutsui Exp $);
 
 
 #include sys/param.h
@@ -118,8 +118,6 @@
 static void 	sq_dump_buffer(paddr_t addr, psize_t len);
 static void	sq_trace_dump(struct sq_softc *);
 
-static void	enaddr_aton(const char*, u_int8_t*);
-
 CFATTACH_DECL(sq, sizeof(struct sq_softc),
 sq_match, sq_attach, NULL, NULL);
 
@@ -282,7 +280,7 @@
 			printf(: unable to get MAC address!\n);
 			goto fail_6;
 		}
-		enaddr_aton(macaddr, sc-sc_enaddr);
+		ether_aton_r(sc-sc_enaddr, sizeof(sc-sc_enaddr), macaddr);
 	}
 
 	evcnt_attach_dynamic(sc-sq_intrcnt, EVCNT_TYPE_INTR, NULL,
@@ -1332,29 +1330,3 @@
 
 	printf(\n);
 }
-
-void
-enaddr_aton(const char* str, u_int8_t* eaddr)
-{
-	int i;
-	char c;
-
-	for (i = 0; i  ETHER_ADDR_LEN; i++) {
-		if (*str == ':')
-			str++;
-
-		c = *str++;
-		if (isdigit(c)) {
-			eaddr[i] = (c - '0');
-		} else if (isxdigit(c)) {
-			eaddr[i] = (toupper(c) + 10 - 'A');
-		}
-
-		c = *str++;
-		if (isdigit(c)) {
-			eaddr[i] = (eaddr[i]  4) | (c - '0');
-		} else if (isxdigit(c)) {
-			eaddr[i] = (eaddr[i]  4) | (toupper(c) + 10 - 'A');
-		}
-	}
-}

Index: src/sys/arch/sgimips/ioc/if_le_oioc.c
diff -u src/sys/arch/sgimips/ioc/if_le_oioc.c:1.2 src/sys/arch/sgimips/ioc/if_le_oioc.c:1.3
--- src/sys/arch/sgimips/ioc/if_le_oioc.c:1.2	Tue Jan 19 22:06:22 2010
+++ src/sys/arch/sgimips/ioc/if_le_oioc.c	Mon Jan 10 13:29:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le_oioc.c,v 1.2 2010/01/19 22:06:22 pooka Exp $	*/
+/*	$NetBSD: if_le_oioc.c,v 1.3 2011/01/10 13:29:29 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2009 Stephen M. Rumble
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_le_oioc.c,v 1.2 2010/01/19 22:06:22 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_le_oioc.c,v 1.3 2011/01/10 13:29:29 tsutsui Exp $);
 
 #include opt_inet.h
 
@@ -113,7 +113,6 @@
 
 static void	lewrcsr(struct lance_softc *, uint16_t, uint16_t);
 static uint16_t	lerdcsr(struct lance_softc *, uint16_t);  
-static void	enaddr_aton(const char *, u_int8_t *);
 
 static void
 lewrcsr(struct lance_softc *sc, uint16_t port, uint16_t val)
@@ -158,7 +157,7 @@
 	struct oioc_attach_args *oa = aux;
 	struct pglist mlist;
 	const char *enaddrstr;
-	char enaddr[6];
+	char enaddr[ETHER_ADDR_LEN];
 	char pbuf[9];
 	int i, error;
 
@@ -211,7 +210,7 @@
 	sc-sc_addr = 0;
 	sc-sc_conf3 = LE_C3_BSWP;
 
-	enaddr_aton(enaddrstr, enaddr);
+	ether_aton_r(enaddr, sizeof(enaddr), enaddrstr);
 	memcpy(sc-sc_enaddr, enaddr, sizeof(sc-sc_enaddr));
 
 	if (cpu_intr_establish(oa-oa_irq, IPL_NET, am7990_intr, sc) == NULL) {
@@ -248,30 +247,3 @@
 fail_0:
 	return;
 }
-
-/* stolen from sgimips/hpc/if_sq.c */
-static void
-enaddr_aton(const char *str, u_int8_t *eaddr)
-{
-	int i;
-	char c;
-
-	for (i = 0; i  ETHER_ADDR_LEN; i++) {
-		if (*str == ':')
-			str++;
-
-		c = *str++;
-		if (isdigit(c)) {
-			eaddr[i] = (c - '0');
-		} else if (isxdigit(c)) {
-			eaddr[i] = (toupper(c) + 10 - 'A');
-		}
-
-		c = *str++;
-		if (isdigit(c)) {
-			eaddr[i] = (eaddr[i]  4) | (c - '0');
-		} else if (isxdigit(c)) {
-			eaddr[i] = (eaddr[i]  4) | (toupper(c) + 10 - 'A');
-		}
-	}
-}

Index: src/sys/arch/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.43 src/sys/arch/sgimips/mace/if_mec.c:1.44
--- src/sys/arch/sgimips/mace/if_mec.c:1.43	Mon Apr  5 07:19:32 2010
+++ src/sys/arch/sgimips/mace/if_mec.c	Mon Jan 10 13:29:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.43 2010/04/05 07:19:32 joerg Exp $ */
+/* $NetBSD: if_mec.c,v 1.44 2011/01/10 13:29:29 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.43 

CVS commit: src/sys/arch/sandpoint

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 13:45:57 UTC 2011

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

Log Message:
Some new information and cleanup.


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

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

Modified files:

Index: src/sys/arch/sandpoint/README.NAS
diff -u src/sys/arch/sandpoint/README.NAS:1.7 src/sys/arch/sandpoint/README.NAS:1.8
--- src/sys/arch/sandpoint/README.NAS:1.7	Fri May 28 15:45:11 2010
+++ src/sys/arch/sandpoint/README.NAS	Mon Jan 10 13:45:57 2011
@@ -1,4 +1,4 @@
-$NetBSD: README.NAS,v 1.7 2010/05/28 15:45:11 phx Exp $
+$NetBSD: README.NAS,v 1.8 2011/01/10 13:45:57 phx Exp $
 
  MPC8241/8245 NAS products 
 
@@ -6,19 +6,29 @@
 
 NIC	IDE		machine description
 			--
+			 Board type BRD_KUROBOX 
 tlp.11	cmdide.12	classic KuroBox, LinkStation HD-HLAN(LS1)
 re.11	cmdide.12	KuroBox HG
-re.11	iteide.12	Gigabit LinkStation HD-HGLAN
+re.11	iteide.12	Gigabit LinkStation HD-HGLAN (also with cmdide)
 re.11	iteide.12/13	classic TeraStation HD-HTGL
 re.11	satalink.12/13	TeraStation Pro TS-TGL v1
+
+			 Board type BRD_SYNOLOGY 
 sk.15	iteide.13	Synology DS-106j, LinkStation LANxxxG
 sk.15	satalink.13	Synology DS-101g+/106e/106/106x/107e/107/207
 			DS-108j/109j/209j
 sk.15	satalink.12/13	Synology CS-406/RS-406/CS-406e/CS-407e
-wm.15	satalink.13 	QNAP TS-101/201
+
+			 Board type BRD_QNAPTS101 
+wm.15	satalink.13 	QNAP TS-100/101
+
+			 Not yet recognized, research in progress 
+re.15	satalink.13 	QNAP TS-201
 re.15	viaide.13	IOMEGA StorCenter
+ste.?	acardide.?	DLink DSM-G600
+
 
-- PCI line/pin and EPIC IRQ assignments
+PCI line/pin and EPIC IRQ assignments
 
 		PCI IDSEL	   EPIC IRQ
 Kurobox		11, 12, 13, 14	- 0, 1, 4, 3
@@ -31,6 +41,9 @@
 
 - *attention* Synology DS407 is a MPC8349E product.
 
+
+ e300 NAS products 
+
 Freescale MPC8349E-mITXE
 		PCI IDSEL 	   MPC8349 IRQ
   1st PCI	16		- 22
@@ -47,4 +60,3 @@
 [ research still in progress ]
 
 ---
-



CVS commit: src/sys/sys

2011-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 10 13:56:44 UTC 2011

Modified Files:
src/sys/sys: signal.h

Log Message:
namespace protect sigqueue and sigqueueinfo


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/sys/signal.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/sys/signal.h
diff -u src/sys/sys/signal.h:1.66 src/sys/sys/signal.h:1.67
--- src/sys/sys/signal.h:1.66	Sun Jan  9 23:38:37 2011
+++ src/sys/sys/signal.h	Mon Jan 10 08:56:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.66 2011/01/10 04:38:37 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.67 2011/01/10 13:56:44 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -235,7 +235,11 @@
  */
 __BEGIN_DECLS
 void	(*signal(int, void (*)(int)))(int);
+#if (_POSIX_C_SOURCE - 0) = 200112L || defined(_NETBSD_SOURCE)
 int	sigqueue(pid_t, int, const union sigval);
+#endif
+#if defined(_NETBSD_SOURCE)
 int	sigqueueinfo(pid_t, const siginfo_t *);
+#endif
 __END_DECLS
 #endif	/* !_SYS_SIGNAL_H_ */



CVS commit: src/tests/rump/rumpkern/h_client

2011-01-10 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 10 14:05:04 UTC 2011

Modified Files:
src/tests/rump/rumpkern/h_client: h_stresscli.c

Log Message:
Don't use printf in a signal handler.

XXX: it would be nice if the deadlock with malloc were a little
more obvious, especially since gdb doesn't provide any clues unless
you compile libpthread with -g


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/rump/rumpkern/h_client/h_stresscli.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/rump/rumpkern/h_client/h_stresscli.c
diff -u src/tests/rump/rumpkern/h_client/h_stresscli.c:1.2 src/tests/rump/rumpkern/h_client/h_stresscli.c:1.3
--- src/tests/rump/rumpkern/h_client/h_stresscli.c:1.2	Thu Jan  6 06:59:25 2011
+++ src/tests/rump/rumpkern/h_client/h_stresscli.c	Mon Jan 10 14:05:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_stresscli.c,v 1.2 2011/01/06 06:59:25 pooka Exp $	*/
+/*	$NetBSD: h_stresscli.c,v 1.3 2011/01/10 14:05:03 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/atomic.h
@@ -22,8 +22,6 @@
 signaali(int sig)
 {
 
-	membar_consumer();
-	printf(process did %d syscalls\n, syscalls);
 	_exit(0);
 }
 



CVS commit: src/sys/dev/pci

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 14:19:36 UTC 2011

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

Log Message:
add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/ppb.c

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

Modified files:

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.44 src/sys/dev/pci/ppb.c:1.45
--- src/sys/dev/pci/ppb.c:1.44	Mon Jan 10 12:23:21 2011
+++ src/sys/dev/pci/ppb.c	Mon Jan 10 14:19:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $	*/
+/*	$NetBSD: ppb.c,v 1.45 2011/01/10 14:19:36 cegger Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.45 2011/01/10 14:19:36 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -101,6 +101,7 @@
 	switch (reg  PCI_PCIE_XCAP_VER_MASK) {
 	case PCI_PCIE_XCAP_VER_1_0:
 		aprint_normal(1.0);
+		break;
 	case PCI_PCIE_XCAP_VER_2_0:
 		aprint_normal(2.0);
 		break;



CVS commit: src/sys/arch/pmax/stand/common

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 15:25:15 UTC 2011

Modified Files:
src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S
getchar.S printf.S

Log Message:
- specify .set noreorder to fill BDslots properly
- indent instructions in BDslots


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/pmax/stand/common/bootinit.S \
src/sys/arch/pmax/stand/common/bootread.S
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/stand/common/clear_cache.S \
src/sys/arch/pmax/stand/common/printf.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/pmax/stand/common/getchar.S

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/pmax/stand/common/bootinit.S
diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.5 src/sys/arch/pmax/stand/common/bootinit.S:1.6
--- src/sys/arch/pmax/stand/common/bootinit.S:1.5	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/stand/common/bootinit.S	Mon Jan 10 15:25:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinit.S,v 1.5 2008/04/28 20:23:31 martin Exp $	*/
+/*	$NetBSD: bootinit.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 #include mips/cpuregs.h
 #include machine/dec_prom.h
 
+	.set	noreorder
 LEAF(bootinit)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
 	lw	v0, 0x54(v0)	# offset for callv-_bootinit
 	nop
 	j	v0		# call PROM bootinit
-	nop
+	 nop
 END(bootinit)
Index: src/sys/arch/pmax/stand/common/bootread.S
diff -u src/sys/arch/pmax/stand/common/bootread.S:1.5 src/sys/arch/pmax/stand/common/bootread.S:1.6
--- src/sys/arch/pmax/stand/common/bootread.S:1.5	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/stand/common/bootread.S	Mon Jan 10 15:25:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootread.S,v 1.5 2008/04/28 20:23:31 martin Exp $	*/
+/*	$NetBSD: bootread.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 #include mips/cpuregs.h
 #include machine/dec_prom.h
 
+	.set	noreorder
 LEAF(bootread)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
 	lw	v0, 0x58(v0)	# offset for callv-_bootread
 	nop
 	j	v0		# call PROM bootread
-	nop
+	 nop
 END(bootread)

Index: src/sys/arch/pmax/stand/common/clear_cache.S
diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.6 src/sys/arch/pmax/stand/common/clear_cache.S:1.7
--- src/sys/arch/pmax/stand/common/clear_cache.S:1.6	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/stand/common/clear_cache.S	Mon Jan 10 15:25:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clear_cache.S,v 1.6 2008/04/28 20:23:31 martin Exp $	*/
+/*	$NetBSD: clear_cache.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 #include mips/cpuregs.h
 #include machine/dec_prom.h
 
+	.set	noreorder
 LEAF(clear_cache)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
 	lw	v0, 0x7c(v0)	# offset for callv-_clear_cache
 	nop
 	j	v0		# call PROM clear_cache
-	nop
+	 nop
 END(clear_cache)
Index: src/sys/arch/pmax/stand/common/printf.S
diff -u src/sys/arch/pmax/stand/common/printf.S:1.6 src/sys/arch/pmax/stand/common/printf.S:1.7
--- src/sys/arch/pmax/stand/common/printf.S:1.6	Mon Dec 14 00:46:11 2009
+++ src/sys/arch/pmax/stand/common/printf.S	Mon Jan 10 15:25:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: printf.S,v 1.6 2009/12/14 00:46:11 matt Exp $	*/
+/*	$NetBSD: printf.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,6 +33,7 @@
 #include mips/cpuregs.h
 #include machine/dec_prom.h
 
+	.set	noreorder
 LEAF(printf)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
 	lw	t9, 0x30(v0)	# offset for callv-_printf
@@ -56,6 +57,6 @@
 	 addu	sp, sp, 48
 #else
 	j	t9		# call PROM printf
-	nop
+	 nop
 #endif
 END(printf)

Index: src/sys/arch/pmax/stand/common/getchar.S
diff -u src/sys/arch/pmax/stand/common/getchar.S:1.2 src/sys/arch/pmax/stand/common/getchar.S:1.3
--- src/sys/arch/pmax/stand/common/getchar.S:1.2	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/stand/common/getchar.S	Mon Jan 10 15:25:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getchar.S,v 1.2 2008/04/28 20:23:31 martin Exp $	*/
+/*	$NetBSD: getchar.S,v 1.3 2011/01/10 15:25:15 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 #include mips/cpuregs.h
 #include machine/dec_prom.h
 
+	.set	noreorder
 LEAF(getchar)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
 	lw	v0, 0x24(v0)	# offset for callv-_getchar
 	nop
 	j	v0		# call PROM getchar
-	nop
+	 nop
 END(getchar)



CVS commit: src/sys/arch/pmax/stand/common

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 15:25:44 UTC 2011

Modified Files:
src/sys/arch/pmax/stand/common: start.S startprog.S

Log Message:
Indent instructions in BDslots.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/pmax/stand/common/start.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/startprog.S

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/pmax/stand/common/start.S
diff -u src/sys/arch/pmax/stand/common/start.S:1.20 src/sys/arch/pmax/stand/common/start.S:1.21
--- src/sys/arch/pmax/stand/common/start.S:1.20	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/stand/common/start.S	Mon Jan 10 15:25:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.20 2008/04/28 20:23:31 martin Exp $	*/
+/*	$NetBSD: start.S,v 1.21 2011/01/10 15:25:44 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -98,20 +98,20 @@
 	move	s0, a0# save argc
 	move	s1, a1# save argv
 	beq	a2, DEC_REX_MAGIC, 1f		# jump if boot from DS5000
-	move	s3, a3# BDslot: save call vector
+	 move	s3, a3# BDslot: save call vector
 	la	s3, _C_LABEL(callvec)		# init call vector
 1:
 	la	a0, _C_LABEL (edata)		# clear BSS
 	move	a1, zero
 	la	a2, _C_LABEL (end)
 	jal	_C_LABEL(memset)		# memset(edata, 0, end - edata)
-	subu	a2, a2, a0
+	 subu	a2, a2, a0
 	sw	s3, _C_LABEL(callv)		# save call vector
 	move	a0, s0# restore argc
 	jal	_C_LABEL(main)			# main(argc, argv)
-	move	a1, s1# restore argv
+	 move	a1, s1# restore argv
 	j	_C_LABEL(prom_restart)		# restart...
-	nop
+	 nop
 
 LEAF(prom_restart)
 XLEAF(_rtt)
@@ -119,37 +119,37 @@
 	lw	v0, 0x9C(v0)			/* halt */
 	move	a0, zero			/* Don't print anything. */
 	j	v0
-	move	a1, zero
+	 move	a1, zero
 END(prom_restart)
 
 LEAF(prom_open)
 	li	v0, DEC_PROM_OPEN
 	j	v0
-	nop
+	 nop
 END(prom_open)
 
 #ifndef LIBSA_NO_DEV_CLOSE
 LEAF(prom_close)
 	li	v0, DEC_PROM_CLOSE
 	j	v0
-	nop
+	 nop
 END(prom_close)
 #endif
 
 LEAF(prom_lseek)
 	li	v0, DEC_PROM_LSEEK
 	j	v0
-	nop
+	 nop
 END(prom_lseek)
 
 LEAF(prom_read)
 	li	v0, DEC_PROM_READ
 	j	v0
-	nop
+	 nop
 END(prom_read)
 
 LEAF(prom_write)
 	li	v0, DEC_PROM_WRITE
 	j	v0
-	nop
+	 nop
 END(prom_write)

Index: src/sys/arch/pmax/stand/common/startprog.S
diff -u src/sys/arch/pmax/stand/common/startprog.S:1.7 src/sys/arch/pmax/stand/common/startprog.S:1.8
--- src/sys/arch/pmax/stand/common/startprog.S:1.7	Fri Jan  7 14:50:27 2011
+++ src/sys/arch/pmax/stand/common/startprog.S	Mon Jan 10 15:25:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: startprog.S,v 1.7 2011/01/07 14:50:27 tsutsui Exp $	*/
+/*	$NetBSD: startprog.S,v 1.8 2011/01/10 15:25:44 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -64,9 +64,9 @@
 	sw	$8,16(sp)		# save on stack for O32
 	sw	$9,20(sp)		# save on stack for O32
 	jal	ra,t9
-	nop# BDslot
+	 nop# BDslot
 
 	lw	ra,CALLFRAME_RA(sp)	# should not get back here!
 	j	ra
-	addu	sp,sp,CALLFRAME_SIZ
+	 addu	sp,sp,CALLFRAME_SIZ
 END(startprog)



CVS commit: src

2011-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 10 16:42:37 UTC 2011

Modified Files:
src/lib/libc/sys: sigqueue.c
src/tests/lib/libc/sys: t_sigqueue.c

Log Message:
remove clauses 3/4


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/sys/sigqueue.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_sigqueue.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/sys/sigqueue.c
diff -u src/lib/libc/sys/sigqueue.c:1.1 src/lib/libc/sys/sigqueue.c:1.2
--- src/lib/libc/sys/sigqueue.c:1.1	Sun Jan  9 23:41:27 2011
+++ src/lib/libc/sys/sigqueue.c	Mon Jan 10 11:42:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: sigqueue.c,v 1.1 2011/01/10 04:41:27 christos Exp $ */
+/* $NetBSD: sigqueue.c,v 1.2 2011/01/10 16:42:36 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -37,7 +30,7 @@
  */
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: sigqueue.c,v 1.1 2011/01/10 04:41:27 christos Exp $);
+__RCSID($NetBSD: sigqueue.c,v 1.2 2011/01/10 16:42:36 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h

Index: src/tests/lib/libc/sys/t_sigqueue.c
diff -u src/tests/lib/libc/sys/t_sigqueue.c:1.2 src/tests/lib/libc/sys/t_sigqueue.c:1.3
--- src/tests/lib/libc/sys/t_sigqueue.c:1.2	Mon Jan 10 00:15:00 2011
+++ src/tests/lib/libc/sys/t_sigqueue.c	Mon Jan 10 11:42:37 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sigqueue.c,v 1.2 2011/01/10 05:15:00 christos Exp $ */
+/* $NetBSD: t_sigqueue.c,v 1.3 2011/01/10 16:42:37 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
  * 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.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -37,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_sigqueue.c,v 1.2 2011/01/10 05:15:00 christos Exp $);
+__RCSID($NetBSD: t_sigqueue.c,v 1.3 2011/01/10 16:42:37 christos Exp $);
 
 #include signal.h
 #include unistd.h



CVS commit: src/sys/arch/pmax/stand/common

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 16:43:30 UTC 2011

Modified Files:
src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S
getchar.S printf.S

Log Message:
Add hazard nops required by MIPS1 in noreorder case.
(Umm, is it easier to remove noreorder and all BDslot insns?)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootinit.S \
src/sys/arch/pmax/stand/common/bootread.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/clear_cache.S \
src/sys/arch/pmax/stand/common/printf.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/pmax/stand/common/getchar.S

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/pmax/stand/common/bootinit.S
diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.6 src/sys/arch/pmax/stand/common/bootinit.S:1.7
--- src/sys/arch/pmax/stand/common/bootinit.S:1.6	Mon Jan 10 15:25:15 2011
+++ src/sys/arch/pmax/stand/common/bootinit.S	Mon Jan 10 16:43:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinit.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $	*/
+/*	$NetBSD: bootinit.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 	.set	noreorder
 LEAF(bootinit)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
+	nop
 	lw	v0, 0x54(v0)	# offset for callv-_bootinit
 	nop
 	j	v0		# call PROM bootinit
Index: src/sys/arch/pmax/stand/common/bootread.S
diff -u src/sys/arch/pmax/stand/common/bootread.S:1.6 src/sys/arch/pmax/stand/common/bootread.S:1.7
--- src/sys/arch/pmax/stand/common/bootread.S:1.6	Mon Jan 10 15:25:15 2011
+++ src/sys/arch/pmax/stand/common/bootread.S	Mon Jan 10 16:43:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootread.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $	*/
+/*	$NetBSD: bootread.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 	.set	noreorder
 LEAF(bootread)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
+	nop
 	lw	v0, 0x58(v0)	# offset for callv-_bootread
 	nop
 	j	v0		# call PROM bootread

Index: src/sys/arch/pmax/stand/common/clear_cache.S
diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.7 src/sys/arch/pmax/stand/common/clear_cache.S:1.8
--- src/sys/arch/pmax/stand/common/clear_cache.S:1.7	Mon Jan 10 15:25:15 2011
+++ src/sys/arch/pmax/stand/common/clear_cache.S	Mon Jan 10 16:43:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clear_cache.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $	*/
+/*	$NetBSD: clear_cache.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 	.set	noreorder
 LEAF(clear_cache)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
+	nop
 	lw	v0, 0x7c(v0)	# offset for callv-_clear_cache
 	nop
 	j	v0		# call PROM clear_cache
Index: src/sys/arch/pmax/stand/common/printf.S
diff -u src/sys/arch/pmax/stand/common/printf.S:1.7 src/sys/arch/pmax/stand/common/printf.S:1.8
--- src/sys/arch/pmax/stand/common/printf.S:1.7	Mon Jan 10 15:25:15 2011
+++ src/sys/arch/pmax/stand/common/printf.S	Mon Jan 10 16:43:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: printf.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $	*/
+/*	$NetBSD: printf.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 	.set	noreorder
 LEAF(printf)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
+	nop
 	lw	t9, 0x30(v0)	# offset for callv-_printf
 	nop
 #ifdef __mips_n32

Index: src/sys/arch/pmax/stand/common/getchar.S
diff -u src/sys/arch/pmax/stand/common/getchar.S:1.3 src/sys/arch/pmax/stand/common/getchar.S:1.4
--- src/sys/arch/pmax/stand/common/getchar.S:1.3	Mon Jan 10 15:25:15 2011
+++ src/sys/arch/pmax/stand/common/getchar.S	Mon Jan 10 16:43:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getchar.S,v 1.3 2011/01/10 15:25:15 tsutsui Exp $	*/
+/*	$NetBSD: getchar.S,v 1.4 2011/01/10 16:43:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 	.set	noreorder
 LEAF(getchar)
 	lw	v0, _C_LABEL(callv)	# get pointer to call back vectors
+	nop
 	lw	v0, 0x24(v0)	# offset for callv-_getchar
 	nop
 	j	v0		# call PROM getchar



CVS commit: src/tests/lib/libc

2011-01-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Jan 10 16:54:03 UTC 2011

Modified Files:
src/tests/lib/libc: t_cerror.c

Log Message:
Do close fd 4 in cerror_64 testcase too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/t_cerror.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/lib/libc/t_cerror.c
diff -u src/tests/lib/libc/t_cerror.c:1.1 src/tests/lib/libc/t_cerror.c:1.2
--- src/tests/lib/libc/t_cerror.c:1.1	Fri Jan  7 02:47:40 2011
+++ src/tests/lib/libc/t_cerror.c	Mon Jan 10 16:54:02 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cerror.c,v 1.1 2011/01/07 02:47:40 pgoyette Exp $ */
+/* $NetBSD: t_cerror.c,v 1.2 2011/01/10 16:54:02 njoly Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #include sys/cdefs.h
 __COPYRIGHT(@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.);
-__RCSID($NetBSD: t_cerror.c,v 1.1 2011/01/07 02:47:40 pgoyette Exp $);
+__RCSID($NetBSD: t_cerror.c,v 1.2 2011/01/10 16:54:02 njoly Exp $);
 
 #include errno.h
 #include unistd.h
@@ -97,6 +97,9 @@
 }
 ATF_TC_BODY(cerror_64, tc)
 {
+	/* Make sure file desc 4 is closed. */
+	(void)close(4);
+
 	/* Check error and 64-bit return code.*/
 	errno = 0;
 	ATF_REQUIRE_EQ(lseek(4, (off_t) 0, SEEK_SET), (off_t) -1);



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

2011-01-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jan 10 16:59:09 UTC 2011

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

Log Message:
Bump iomem_ex_storage from 16 to 64. Based on analysis from joda@:

http://mail-index.netbsd.org/current-users/2010/10/01/msg014446.html

Discussed with mrg@ and jmcne...@.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/bus_space.c

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

Modified files:

Index: src/sys/arch/x86/x86/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.31 src/sys/arch/x86/x86/bus_space.c:1.32
--- src/sys/arch/x86/x86/bus_space.c:1.31	Tue Jul 27 13:54:19 2010
+++ src/sys/arch/x86/x86/bus_space.c	Mon Jan 10 16:59:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.31 2010/07/27 13:54:19 jakllsch Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.32 2011/01/10 16:59:09 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.31 2010/07/27 13:54:19 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.32 2011/01/10 16:59:09 jruoho Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -85,7 +85,7 @@
  * routines need access to them for bus address space allocation.
  */
 static	long ioport_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)];
-static	long iomem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)];
+static	long iomem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(64) / sizeof(long)];
 struct	extent *ioport_ex;
 struct	extent *iomem_ex;
 static	int ioport_malloc_safe;



CVS commit: src/sys/arch/pmax/stand/common

2011-01-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 10 17:01:17 UTC 2011

Modified Files:
src/sys/arch/pmax/stand/common: common.h if_prom.c start.S

Log Message:
- start.S
  add a hazard nop so that prom_restart() works properly on MIPS1
  (it seems broken since initial revision and had been restarted by fault?)

- common.h
  export prom_restart()

- if_prom.c
  use prom_restart() instead of a direct PROM call (that should be equivalent)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/pmax/stand/common/common.h \
src/sys/arch/pmax/stand/common/if_prom.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/pmax/stand/common/start.S

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/pmax/stand/common/common.h
diff -u src/sys/arch/pmax/stand/common/common.h:1.9 src/sys/arch/pmax/stand/common/common.h:1.10
--- src/sys/arch/pmax/stand/common/common.h:1.9	Sat Mar 14 14:46:04 2009
+++ src/sys/arch/pmax/stand/common/common.h	Mon Jan 10 17:01:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.9 2009/03/14 14:46:04 dsl Exp $	*/
+/*	$NetBSD: common.h,v 1.10 2011/01/10 17:01:17 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -45,6 +45,7 @@
 int prom_lseek(int, int, int);
 int prom_open(const char *, int);
 int prom_read(int, void *, int);
+void __dead prom_restart(void);
 int prom_write(int, void *, int);
 
 
Index: src/sys/arch/pmax/stand/common/if_prom.c
diff -u src/sys/arch/pmax/stand/common/if_prom.c:1.9 src/sys/arch/pmax/stand/common/if_prom.c:1.10
--- src/sys/arch/pmax/stand/common/if_prom.c:1.9	Sun Jan  9 16:55:13 2011
+++ src/sys/arch/pmax/stand/common/if_prom.c	Mon Jan 10 17:01:17 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_prom.c,v 1.9 2011/01/09 16:55:13 tsutsui Exp $ */
+/*  $NetBSD: if_prom.c,v 1.10 2011/01/10 17:01:17 tsutsui Exp $ */
 
 /* Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -141,7 +141,7 @@
 	if (enet == NULL) {
 		printf(No `enet' environment variable found.\n
 		Set MAC address to `enet' manually by setenv command.\n);
-		(*callv-_halt)((int *)0, 0);	/* XXX */
+		prom_restart();
 		/* NOTREACHED */
 	}
 

Index: src/sys/arch/pmax/stand/common/start.S
diff -u src/sys/arch/pmax/stand/common/start.S:1.21 src/sys/arch/pmax/stand/common/start.S:1.22
--- src/sys/arch/pmax/stand/common/start.S:1.21	Mon Jan 10 15:25:44 2011
+++ src/sys/arch/pmax/stand/common/start.S	Mon Jan 10 17:01:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.21 2011/01/10 15:25:44 tsutsui Exp $	*/
+/*	$NetBSD: start.S,v 1.22 2011/01/10 17:01:17 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -116,6 +116,7 @@
 LEAF(prom_restart)
 XLEAF(_rtt)
 	lw	v0, _C_LABEL (callv)
+	nop
 	lw	v0, 0x9C(v0)			/* halt */
 	move	a0, zero			/* Don't print anything. */
 	j	v0



CVS commit: src/sys/dev/acpi

2011-01-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jan 10 17:04:22 UTC 2011

Modified Files:
src/sys/dev/acpi: acpidevs

Log Message:
Add SMO1200 (yet another TPM chip). From ThinkPad x201i.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/acpi/acpidevs

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/acpidevs
diff -u src/sys/dev/acpi/acpidevs:1.32 src/sys/dev/acpi/acpidevs:1.33
--- src/sys/dev/acpi/acpidevs:1.32	Sun Jan  9 05:06:17 2011
+++ src/sys/dev/acpi/acpidevs	Mon Jan 10 17:04:22 2011
@@ -1,4 +1,4 @@
-# $NetBSD: acpidevs,v 1.32 2011/01/09 05:06:17 jruoho Exp $
+# $NetBSD: acpidevs,v 1.33 2011/01/10 17:04:22 jruoho Exp $
 #
 # Originally extracted from:
 
@@ -367,11 +367,12 @@
 BCM0101		Broadcom Trusted Platform Module
 BCM0102		Broadcom Trusted Platform Module
 ICO0102		Intel Trusted Platform Module
-INTC0102	Intel Trusted Platform Module
 IFX0102		Infineon Trusted Platform Module
+INTC0102	Intel Trusted Platform Module
 NSC1100		NSC Trusted Platform Module
 NSC1200		NSC Trusted Platform Module
 PNP0C31		Trusted Platform Module
+SMO1200		STMicroelectronics Trusted Platform Module
 # * ACPI 4.0 specific devices *
 ACPI0001	SMBus 1.0 Host Controller
 ACPI0002	Smart Battery Subsystem



CVS commit: src/sys/dev/acpi

2011-01-10 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jan 10 17:04:55 UTC 2011

Modified Files:
src/sys/dev/acpi: acpidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpidevs_data.h

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

Modified files:

Index: src/sys/dev/acpi/acpidevs_data.h
diff -u src/sys/dev/acpi/acpidevs_data.h:1.23 src/sys/dev/acpi/acpidevs_data.h:1.24
--- src/sys/dev/acpi/acpidevs_data.h:1.23	Sun Jan  9 04:59:00 2011
+++ src/sys/dev/acpi/acpidevs_data.h	Mon Jan 10 17:04:55 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: acpidevs_data.h,v 1.23 2011/01/09 04:59:00 jruoho Exp $	*/
+/*	$NetBSD: acpidevs_data.h,v 1.24 2011/01/10 17:04:55 jruoho Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	# NetBSD: acpidevs,v 1.31 2011/01/09 04:58:34 jruoho Exp
+ *	# NetBSD: acpidevs,v 1.33 2011/01/10 17:04:22 jruoho Exp
  */
 
 const struct { const char *pnp, *str; } acpi_knowndevs[] = {
@@ -1353,14 +1353,14 @@
 	Intel Trusted Platform Module,
 	},
 	{
-	INTC0102,
-	Intel Trusted Platform Module,
-	},
-	{
 	IFX0102,
 	Infineon Trusted Platform Module,
 	},
 	{
+	INTC0102,
+	Intel Trusted Platform Module,
+	},
+	{
 	NSC1100,
 	NSC Trusted Platform Module,
 	},
@@ -1373,6 +1373,10 @@
 	Trusted Platform Module,
 	},
 	{
+	SMO1200,
+	STMicroelectronics Trusted Platform Module,
+	},
+	{
 	ACPI0001,
 	SMBus 1.0 Host Controller,
 	},



CVS commit: src/usr.bin/mail

2011-01-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Jan 10 17:14:38 UTC 2011

Modified Files:
src/usr.bin/mail: sig.c

Log Message:
Rename sigqueue to sigq to avoid clashing with sigqueue(2).  Now this
builds again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/mail/sig.c

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

Modified files:

Index: src/usr.bin/mail/sig.c
diff -u src/usr.bin/mail/sig.c:1.1 src/usr.bin/mail/sig.c:1.2
--- src/usr.bin/mail/sig.c:1.1	Fri Apr 10 13:08:25 2009
+++ src/usr.bin/mail/sig.c	Mon Jan 10 17:14:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig.c,v 1.1 2009/04/10 13:08:25 christos Exp $	*/
+/*	$NetBSD: sig.c,v 1.2 2011/01/10 17:14:38 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: sig.c,v 1.1 2009/04/10 13:08:25 christos Exp $);
+__RCSID($NetBSD: sig.c,v 1.2 2011/01/10 17:14:38 dyoung Exp $);
 #endif /* not lint */
 
 #include assert.h
@@ -59,7 +59,7 @@
 static struct {
 	q_entry_t *qe_first;
 	q_entry_t **qe_last;
-} sigqueue = { NULL, sigqueue.qe_first };
+} sigq = { NULL, sigq.qe_first };
 #define SIGQUEUE_INIT(p)  do {\
 	(p)-qe_first = NULL;\
 	(p)-qe_last = ((p)-qe_first);\
@@ -104,7 +104,7 @@
 }
 
 /*
- * Attempt to post a signal to the sigqueue.
+ * Attempt to post a signal to the sigq.
  */
 static void
 sig_post(int signo)
@@ -116,13 +116,13 @@
 
 	e = alloc_entry(signo);
 	if (e != NULL) {
-		*sigqueue.qe_last = e;
-		sigqueue.qe_last = e-qe_next;
+		*sigq.qe_last = e;
+		sigq.qe_last = e-qe_next;
 	}
 }
 
 /*
- * Check the sigqueue for any pending signals.  If any are found,
+ * Check the sigq for any pending signals.  If any are found,
  * preform the required actions and remove them from the queue.
  */
 PUBLIC void
@@ -137,16 +137,16 @@
 	(void)sigfillset(nset);
 	(void)sigprocmask(SIG_SETMASK, nset, oset);
 
-	while ((e = sigqueue.qe_first) != NULL) {
+	while ((e = sigq.qe_first) != NULL) {
 		signo = e-qe_signo;
 		handler = e-qe_handler;
 
 		/*
 		 * Remove the entry from the queue and free it.
 		 */
-		sigqueue.qe_first = e-qe_next;
-		if (sigqueue.qe_first == NULL)
-			sigqueue.qe_last = sigqueue.qe_first;
+		sigq.qe_first = e-qe_next;
+		if (sigq.qe_first == NULL)
+			sigq.qe_last = sigq.qe_first;
 		free_entry(e);
 
 		if (handler == SIG_DFL || handler == SIG_IGN) {
@@ -323,7 +323,7 @@
 	 * XXX: This should be unnecessary.
 	 */
 	(void)memset(sigarray, 0, sizeof(sigarray));
-	SIGQUEUE_INIT(sigqueue);
+	SIGQUEUE_INIT(sigq);
 
 	/* Restore the signal mask. */
 	(void)sigprocmask(SIG_SETMASK, oset, NULL);



CVS commit: src/etc/mtree

2011-01-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Jan 10 17:17:36 UTC 2011

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

Log Message:
Add lib/libc/sys test dirs.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/etc/mtree/NetBSD.dist.tests

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.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.16 src/etc/mtree/NetBSD.dist.tests:1.17
--- src/etc/mtree/NetBSD.dist.tests:1.16	Sat Jan  8 18:11:21 2011
+++ src/etc/mtree/NetBSD.dist.tests	Mon Jan 10 17:17:36 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.16 2011/01/08 18:11:21 pgoyette Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.17 2011/01/10 17:17:36 njoly Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -56,6 +56,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/stdio
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib
 ./usr/libdata/debug/usr/tests/lib/libc/string
+./usr/libdata/debug/usr/tests/lib/libc/sys
 ./usr/libdata/debug/usr/tests/lib/libc/ttyio
 ./usr/libdata/debug/usr/tests/lib/libdes
 ./usr/libdata/debug/usr/tests/lib/libevent
@@ -158,6 +159,7 @@
 ./usr/tests/lib/libc/stdio
 ./usr/tests/lib/libc/stdlib
 ./usr/tests/lib/libc/string
+./usr/tests/lib/libc/sys
 ./usr/tests/lib/libc/ttyio
 ./usr/tests/lib/libdes
 ./usr/tests/lib/semaphore



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

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 18:35:50 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/netboot: brdsetup.c

Log Message:
Try to detect Iomega Storcenter board (untested).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sandpoint/stand/netboot/brdsetup.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/netboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.21 src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.22
--- src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.21	Sat Jun 26 21:45:49 2010
+++ src/sys/arch/sandpoint/stand/netboot/brdsetup.c	Mon Jan 10 18:35:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.21 2010/06/26 21:45:49 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.22 2011/01/10 18:35:49 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -200,6 +200,10 @@
 	0x8086) {/* PCI_VENDOR_INTEL */
 		brdtype = BRD_QNAPTS101;
 	}
+	else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 13, 0), PCI_ID_REG)) ==
+	0x1106) {/* PCI_VENDOR_VIA */
+		brdtype = BRD_STORCENTER;
+	}
 
 	brdprop = brd_lookup(brdtype);
 
@@ -261,6 +265,7 @@
 static void
 setup()
 {
+
 	if (brdprop-setup == NULL)
 		return;
 	(*brdprop-setup)(brdprop);
@@ -269,6 +274,7 @@
 static void
 brdfixup()
 {
+
 	if (brdprop-brdfix == NULL)
 		return;
 	(*brdprop-brdfix)(brdprop);
@@ -277,6 +283,7 @@
 void
 pcifixup()
 {
+
 	if (brdprop-pcifix == NULL)
 		return;
 	(*brdprop-pcifix)(brdprop);
@@ -285,6 +292,7 @@
 void
 encsetup(struct brdprop *brd)
 {
+
 #ifdef COSNAME
 	brd-consname = CONSNAME;
 #endif
@@ -358,6 +366,7 @@
 void
 motsetup(struct brdprop *brd)
 {
+
 #ifdef COSNAME
 	brd-consname = CONSNAME;
 #endif
@@ -372,6 +381,7 @@
 void
 motbrdfix(struct brdprop *brd)
 {
+
 /*
  * WinBond/Symphony Lab 83C553 with PC87308 SuperIO
  *
@@ -638,6 +648,7 @@
 void
 synosetup(struct brdprop *brd)
 {
+
 	/* nothing */
 }
 
@@ -723,6 +734,7 @@
 void
 _rtt(void)
 {
+
 	if (brdprop-reset != NULL)
 		(*brdprop-reset)();
 	else



CVS commit: src/tests/rump/rumpkern/h_client

2011-01-10 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 10 19:30:22 UTC 2011

Modified Files:
src/tests/rump/rumpkern/h_client: h_sigcli.c

Log Message:
check that we actually go into the signal handler


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/rump/rumpkern/h_client/h_sigcli.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/rump/rumpkern/h_client/h_sigcli.c
diff -u src/tests/rump/rumpkern/h_client/h_sigcli.c:1.1 src/tests/rump/rumpkern/h_client/h_sigcli.c:1.2
--- src/tests/rump/rumpkern/h_client/h_sigcli.c:1.1	Thu Jan  6 07:00:28 2011
+++ src/tests/rump/rumpkern/h_client/h_sigcli.c	Mon Jan 10 19:30:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_sigcli.c,v 1.1 2011/01/06 07:00:28 pooka Exp $	*/
+/*	$NetBSD: h_sigcli.c,v 1.2 2011/01/10 19:30:21 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/sysctl.h
@@ -15,6 +15,8 @@
 static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
 static char hostnamebuf[128];
 
+static volatile sig_atomic_t sigexecs;
+
 static void
 sighand(int sig)
 {
@@ -26,6 +28,7 @@
 		err(1, sighand sysctl);
 	if (strcmp(buf, hostnamebuf) != 0)
 		errx(1, sighandler hostname);
+	sigexecs++;
 }
 
 int
@@ -62,4 +65,8 @@
 		if (strcmp(buf, hostnamebuf) != 0)
 			errx(1, main hostname);
 	}
+
+	if (!sigexecs) {
+		printf(no signal handlers run.  test busted?\n);
+	}
 }



CVS commit: src/lib

2011-01-10 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 10 19:49:43 UTC 2011

Modified Files:
src/lib/librumpclient: rumpclient.c
src/lib/librumpuser: rumpuser_sp.c sp_common.c

Log Message:
A bunch of improvements:

* don't hold spc mutex while sending data
* use send() for the banner to avoid SIGPIPE in case a client
  connects and immediately goes away
* fix error path locking
* use kevent() instead of pollts() in the client.  Apparently that
  is the only sensible way for a library to support both multithreading
  and signal-reentrancy in a race-free manner.
  (can I catch all signals with one kevent instead of installing
  NSIG different ones??)
* mark client comm descriptor non-blocking so that clients have
  better signal-interruptibility (we now sleep in signal-accepting
  kevent() instead of signal-masked recvfrom())


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/librumpclient/rumpclient.c
cvs rdiff -u -r1.33 -r1.34 src/lib/librumpuser/rumpuser_sp.c
cvs rdiff -u -r1.22 -r1.23 src/lib/librumpuser/sp_common.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.14 src/lib/librumpclient/rumpclient.c:1.15
--- src/lib/librumpclient/rumpclient.c:1.14	Sun Jan  9 14:10:03 2011
+++ src/lib/librumpclient/rumpclient.c	Mon Jan 10 19:49:43 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.14 2011/01/09 14:10:03 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.15 2011/01/10 19:49:43 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -33,6 +33,7 @@
 __RCSID($NetBSD);
 
 #include sys/param.h
+#include sys/event.h
 #include sys/mman.h
 #include sys/socket.h
 
@@ -60,6 +61,7 @@
 int	(*host_socket)(int, int, int);
 int	(*host_close)(int);
 int	(*host_connect)(int, const struct sockaddr *, socklen_t);
+int	(*host_fcntl)(int, int, ...);
 int	(*host_poll)(struct pollfd *, nfds_t, int);
 int	(*host_pollts)(struct pollfd *, nfds_t, const struct timespec *,
 		  const sigset_t *);
@@ -74,28 +76,14 @@
 	.spc_fd = -1,
 };
 
-/*
- * This version of waitresp is optimized for single-threaded clients
- * and is required by signal-safe clientside rump syscalls.
- */
-
-static void
-releasercvlock(struct spclient *spc)
-{
-
-	pthread_mutex_lock(spc-spc_mtx);
-	if (spc-spc_istatus == SPCSTATUS_WANTED)
-		kickall(spc);
-	spc-spc_istatus = SPCSTATUS_FREE;
-}
-
+static int kq;
 static sigset_t fullset;
+
 static int
 waitresp(struct spclient *spc, struct respwait *rw, sigset_t *mask)
 {
-	struct pollfd pfd;
-	int rv = 0;
 
+	pthread_mutex_lock(spc-spc_mtx);
 	sendunlockl(spc);
 
 	rw-rw_error = 0;
@@ -103,32 +91,41 @@
 	 spc-spc_state != SPCSTATE_DYING){
 		/* are we free to receive? */
 		if (spc-spc_istatus == SPCSTATUS_FREE) {
+			struct kevent kev[8];
+			int gotresp, dosig, rv, i;
+
 			spc-spc_istatus = SPCSTATUS_BUSY;
 			pthread_mutex_unlock(spc-spc_mtx);
 
-			pfd.fd = spc-spc_fd;
-			pfd.events = POLLIN;
-
-			switch (readframe(spc)) {
-			case 0:
-releasercvlock(spc);
-pthread_mutex_unlock(spc-spc_mtx);
-host_pollts(pfd, 1, NULL, mask);
-pthread_mutex_lock(spc-spc_mtx);
-continue;
-			case -1:
-releasercvlock(spc);
-rv = errno;
-spc-spc_state = SPCSTATE_DYING;
-continue;
-			default:
-break;
-			}
+			dosig = 0;
+			for (gotresp = 0; !gotresp; ) {
+switch (readframe(spc)) {
+case 0:
+	rv = kevent(kq, NULL, 0,
+	kev, __arraycount(kev), NULL);
+	assert(rv  0);
+	for (i = 0; i  rv; i++) {
+		if (kev[i].filter
+		== EVFILT_SIGNAL)
+			dosig++;
+	}
+	if (dosig)
+		goto cleanup;
+
+	continue;
+case -1:
+	spc-spc_state = SPCSTATE_DYING;
+	goto cleanup;
+default:
+	break;
+}
 
-			switch (spc-spc_hdr.rsp_class) {
+switch (spc-spc_hdr.rsp_class) {
 case RUMPSP_RESP:
 case RUMPSP_ERROR:
 	kickwaiter(spc);
+	gotresp = spc-spc_hdr.rsp_reqno ==
+	rw-rw_reqno;
 	break;
 case RUMPSP_REQ:
 	handlereq(spc);
@@ -136,9 +133,22 @@
 default:
 	/* panic */
 	break;
+}
 			}
 
-			releasercvlock(spc);
+ cleanup:
+			pthread_mutex_lock(spc-spc_mtx);
+			if (spc-spc_istatus == SPCSTATUS_WANTED)
+kickall(spc);
+			spc-spc_istatus = SPCSTATUS_FREE;
+
+			/* take one for the team */
+			if (dosig) {
+pthread_mutex_unlock(spc-spc_mtx);
+pthread_sigmask(SIG_SETMASK, mask, NULL);
+pthread_sigmask(SIG_SETMASK, fullset, NULL);
+pthread_mutex_lock(spc-spc_mtx);
+			}
 		} else {
 			spc-spc_istatus = SPCSTATUS_WANTED;
 			pthread_cond_wait(rw-rw_cv, spc-spc_mtx);
@@ -148,8 +158,6 @@
 	pthread_mutex_unlock(spc-spc_mtx);
 	pthread_cond_destroy(rw-rw_cv);
 
-	if (rv)
-		return rv;
 	if (spc-spc_state == SPCSTATE_DYING)
 		return ENOTCONN;
 	return rw-rw_error;
@@ -385,8 +393,9 @@
 static int
 

CVS commit: src/tests/rump/rumpkern

2011-01-10 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jan 10 19:51:37 UTC 2011

Modified Files:
src/tests/rump/rumpkern: t_sp.sh
src/tests/rump/rumpkern/h_client: h_stresscli.c

Log Message:
Make sure stressclient worker threads complete their operation
instead of hanging.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/rump/rumpkern/t_sp.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/rump/rumpkern/h_client/h_stresscli.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/rump/rumpkern/t_sp.sh
diff -u src/tests/rump/rumpkern/t_sp.sh:1.5 src/tests/rump/rumpkern/t_sp.sh:1.6
--- src/tests/rump/rumpkern/t_sp.sh:1.5	Thu Jan  6 07:00:28 2011
+++ src/tests/rump/rumpkern/t_sp.sh	Mon Jan 10 19:51:37 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_sp.sh,v 1.5 2011/01/06 07:00:28 pooka Exp $
+#	$NetBSD: t_sp.sh,v 1.6 2011/01/10 19:51:37 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@
 
 	export RUMP_SERVER=unix://commsock
 	atf_check -s exit:0 rump_server ${RUMP_SERVER}
-	atf_check -s exit:0 $(atf_get_srcdir)/h_client/h_stresscli ${1}
+	atf_check -s exit:0 -e ignore $(atf_get_srcdir)/h_client/h_stresscli $1
 }
 
 fork()

Index: src/tests/rump/rumpkern/h_client/h_stresscli.c
diff -u src/tests/rump/rumpkern/h_client/h_stresscli.c:1.3 src/tests/rump/rumpkern/h_client/h_stresscli.c:1.4
--- src/tests/rump/rumpkern/h_client/h_stresscli.c:1.3	Mon Jan 10 14:05:03 2011
+++ src/tests/rump/rumpkern/h_client/h_stresscli.c	Mon Jan 10 19:51:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_stresscli.c,v 1.3 2011/01/10 14:05:03 pooka Exp $	*/
+/*	$NetBSD: h_stresscli.c,v 1.4 2011/01/10 19:51:37 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/atomic.h
@@ -17,12 +17,13 @@
 
 static unsigned int syscalls;
 static pid_t mypid;
+static volatile sig_atomic_t doquit;
 
 static void
 signaali(int sig)
 {
 
-	_exit(0);
+	doquit = 1;
 }
 
 static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
@@ -35,7 +36,7 @@
 	char buf[256];
 	size_t blen;
 
-	for (;;) {
+	while (!doquit) {
 		pid_t pidi;
 		blen = sizeof(buf);
 		if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib),
@@ -63,7 +64,7 @@
 int
 main(int argc, char *argv[])
 {
-	pthread_t pt;
+	pthread_t pt[NTHR-1];
 	pid_t clis[NCLI];
 	pid_t apid;
 	int ncli = 0;
@@ -94,10 +95,15 @@
 signal(SIGUSR1, signaali);
 
 for (j = 0; j  NTHR-1; j++)
-	if (pthread_create(pt, NULL,
+	if (pthread_create(pt[j], NULL,
 	client, NULL) != 0)
 		err(1, pthread create);
 client(NULL);
+for (j = 0; j  NTHR-1; j++)
+	pthread_join(pt[j], NULL);
+membar_consumer();
+fprintf(stderr, done %d\n, syscalls);
+exit(0);
 /* NOTREACHED */
 			default:
 ncli++;



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

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 20:13:47 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/netboot: globals.h siisata.c

Log Message:
Make disk-booting work on Synology by using a PIO ATA-read command (0x20)
instead of the DMA read command (0xc8). This should work for all platforms.
Included the soft-reset in the siisata driver.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sandpoint/stand/netboot/globals.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sandpoint/stand/netboot/siisata.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/netboot/globals.h
diff -u src/sys/arch/sandpoint/stand/netboot/globals.h:1.18 src/sys/arch/sandpoint/stand/netboot/globals.h:1.19
--- src/sys/arch/sandpoint/stand/netboot/globals.h:1.18	Sat Jun 26 21:45:49 2010
+++ src/sys/arch/sandpoint/stand/netboot/globals.h	Mon Jan 10 20:13:47 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.18 2010/06/26 21:45:49 phx Exp $ */
+/* $NetBSD: globals.h,v 1.19 2011/01/10 20:13:47 phx Exp $ */
 
 /* clock feed */
 #ifndef EXT_CLK_FREQ
@@ -135,24 +135,24 @@
 struct fs_ops *dsk_fsops(struct open_file *);
 
 /* status */
-#define ATA_STS_BUSY	0x80
-#define ATA_STS_DRDY	0x40
-#define ATA_STS_ERR 	0x01
+#define ATA_STS_BUSY		0x80
+#define ATA_STS_DRDY		0x40
+#define ATA_STS_ERR 		0x01
 /* command */
-#define ATA_CMD_IDENT	0xec
-#define ATA_CMD_READ	0xc8
-#define ATA_CMD_READ_EXT 0x24
-#define ATA_CMD_SETF	0xef
+#define ATA_CMD_IDENT		0xec
+#define ATA_CMD_READ		0x20
+#define ATA_CMD_READ_EXT	0x24
+#define ATA_CMD_SETF		0xef
 /* device */
-#define ATA_DEV_LBA	0xe0
-#define ATA_DEV_OBS	0x90
+#define ATA_DEV_LBA		0xe0
+#define ATA_DEV_OBS		0x90
 /* control */
-#define ATA_DREQ	0x08
-#define ATA_SRST	0x04
+#define ATA_DREQ		0x08
+#define ATA_SRST		0x04
 
-#define ATA_XFER	0x03
-#define XFER_PIO4	0x0c
-#define XFER_PIO0	0x08
+#define ATA_XFER		0x03
+#define XFER_PIO4		0x0c
+#define XFER_PIO0		0x08
 
 struct dvata_chan {
 	uint32_t cmd, ctl, alt, dma;

Index: src/sys/arch/sandpoint/stand/netboot/siisata.c
diff -u src/sys/arch/sandpoint/stand/netboot/siisata.c:1.13 src/sys/arch/sandpoint/stand/netboot/siisata.c:1.14
--- src/sys/arch/sandpoint/stand/netboot/siisata.c:1.13	Sun Aug  8 11:58:26 2010
+++ src/sys/arch/sandpoint/stand/netboot/siisata.c	Mon Jan 10 20:13:47 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.13 2010/08/08 11:58:26 phx Exp $ */
+/* $NetBSD: siisata.c,v 1.14 2011/01/10 20:13:47 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -83,11 +83,10 @@
 		l-chan[1].cmd = l-bar[2];
 		l-chan[1].ctl = l-chan[1].alt = l-bar[3] | 02;
 		l-chan[1].dma = l-bar[4] + 0x8;
-		/* assume BA5 access is possible */
 		nchan = 2;
 	}
 	else {
-		/* 3114 */
+		/* 3114 - assume BA5 access is possible XXX */
 		l-chan[0].cmd = l-bar[5] + 0x080;
 		l-chan[0].ctl = l-chan[0].alt = (l-bar[5] + 0x088) | 02;
 		l-chan[1].cmd = l-bar[5] + 0x0c0;
@@ -98,10 +97,16 @@
 		l-chan[3].ctl = l-chan[3].alt = (l-bar[5] + 0x2c8) | 02;
 		nchan = 4;
 	}
+
 	for (n = 0; n  nchan; n++) {
-		l-presense[n] = satapresense(l, n);
-		if (l-presense[n])
-			printf(port %d device present\n, n);
+		if (satapresense(l, n)) {
+			/* drive present, now check whether soft reset works */
+			if (perform_atareset(l, n)) {
+printf(port %d device present\n, n);
+l-presense[n] = 1;
+			}
+		} else
+			l-presense[n] = 0;
 	}
 	return l;
 }



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

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 20:14:52 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/netboot: devopen.c

Log Message:
Do not crash, but use netbsd as default file name when missing.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sandpoint/stand/netboot/devopen.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/netboot/devopen.c
diff -u src/sys/arch/sandpoint/stand/netboot/devopen.c:1.11 src/sys/arch/sandpoint/stand/netboot/devopen.c:1.12
--- src/sys/arch/sandpoint/stand/netboot/devopen.c:1.11	Sat Jun 26 21:45:49 2010
+++ src/sys/arch/sandpoint/stand/netboot/devopen.c	Mon Jan 10 20:14:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.11 2010/06/26 21:45:49 phx Exp $ */
+/* $NetBSD: devopen.c,v 1.12 2011/01/10 20:14:52 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -83,6 +83,8 @@
 	if (name[0] == 'w'  name[1] == 'd') {
 		parseunit(name[2], unit, part, file);
 		of-f_dev = devdsk;
+		if (*file == NULL || **file = ' ')
+			*file = netbsd;
 		if ((error = dsk_open(of, unit, part, *file)) != 0)
 			return error;
 		file_system[0] = *dsk_fsops(of);



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

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 20:16:42 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/netboot: main.c

Log Message:
Accept wd[N[p]]: (with N=disk and p=partition) for specifying a disk drive.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sandpoint/stand/netboot/main.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/netboot/main.c
diff -u src/sys/arch/sandpoint/stand/netboot/main.c:1.36 src/sys/arch/sandpoint/stand/netboot/main.c:1.37
--- src/sys/arch/sandpoint/stand/netboot/main.c:1.36	Sun Jan  9 22:59:40 2011
+++ src/sys/arch/sandpoint/stand/netboot/main.c	Mon Jan 10 20:16:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.36 2011/01/09 22:59:40 phx Exp $ */
+/* $NetBSD: main.c,v 1.37 2011/01/10 20:16:42 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -300,7 +300,7 @@
 	 * nfs:bootfile
 	 * tftp:
 	 * tftp:bootfile
-	 * wdN:bootfile
+	 * wd[N[P]]:bootfile
 	 *
 	 * net is a synonym of nfs.
 	 */
@@ -308,9 +308,14 @@
 		return 1;
 	if (strncmp(s, tftp:, 5) == 0)
 		return 1;
-	if (s[0] == 'w'  s[1] == 'd'
-	 s[2] = '0'  s[2] = '3'  s[3] == ':') {
-		return s[4] != '\0';
+	if (s[0] == 'w'  s[1] == 'd') {
+		s += 2;
+		if (*s != ':'  *s = '0'  *s = '3') {
+			++s;
+			if (*s != ':'  *s = 'a'  *s = 'p')
+++s;
+		}
+		return *s == ':';
 	}
 	return 0;
 }



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

2011-01-10 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Jan 10 20:18:19 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/netboot: dsk.c version

Log Message:
Try to increase compatibility with all controllers when reading the status.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/stand/netboot/dsk.c \
src/sys/arch/sandpoint/stand/netboot/version

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

Modified files:

Index: src/sys/arch/sandpoint/stand/netboot/dsk.c
diff -u src/sys/arch/sandpoint/stand/netboot/dsk.c:1.5 src/sys/arch/sandpoint/stand/netboot/dsk.c:1.6
--- src/sys/arch/sandpoint/stand/netboot/dsk.c:1.5	Sun Aug  8 11:58:26 2010
+++ src/sys/arch/sandpoint/stand/netboot/dsk.c	Mon Jan 10 20:18:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.5 2010/08/08 11:58:26 phx Exp $ */
+/* $NetBSD: dsk.c,v 1.6 2011/01/10 20:18:19 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -142,11 +142,23 @@
 	int sts;
 	const char *msg;
 
+	/*
+	 * For best compatibility it is recommended to wait 400ns and
+	 * read the alternate status byte four times before the status
+	 * is valid.
+	 */
+	delay(1);
+	(void)CSR_READ_1(chan-alt);
+	(void)CSR_READ_1(chan-alt);
+	(void)CSR_READ_1(chan-alt);
+	(void)CSR_READ_1(chan-alt);
+
 	sts = CSR_READ_1(chan-cmd + _STS);
 	while (milli--  0  sts != 0xff  (sts  ATA_STS_BUSY)) {
 		delay(1000);
 		sts = CSR_READ_1(chan-cmd + _STS);
 	}
+
 	msg = NULL;
 	if (sts == 0xff)
 		msg = returned 0xff;
@@ -157,7 +169,7 @@
 
 	if (err != NULL)
 		*err = msg;
-	return (msg == NULL);
+	return msg == NULL;
 }
 
 int
Index: src/sys/arch/sandpoint/stand/netboot/version
diff -u src/sys/arch/sandpoint/stand/netboot/version:1.5 src/sys/arch/sandpoint/stand/netboot/version:1.6
--- src/sys/arch/sandpoint/stand/netboot/version:1.5	Thu May 20 20:18:51 2010
+++ src/sys/arch/sandpoint/stand/netboot/version	Mon Jan 10 20:18:19 2011
@@ -3,3 +3,4 @@
 1.2	Synology-DS support, Marvell-Yukon driver, fixed aligned alloc
 1.3	allow to have boot options, brdsetup.c cleanup to make brdtype
 	maintainance more confortable
+1.4	load kernels from local disk



CVS commit: src/tools/compat

2011-01-10 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Mon Jan 10 20:38:35 UTC 2011

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
Define PRI[diouxX]8.  We previously did this only for
16- and 32-bit type, but now PRIu8 is needed for tools/disklabel.

Also define SCN[diouxX]{8,16,32}, the scanf counterparts
to the PRI[diouxX]{8,16,32} macros.

Tested via build.sh tools on a system whose native definitions
or the PRI* and SCN* mcros was disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/tools/compat/compat_defs.h

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

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.77 src/tools/compat/compat_defs.h:1.78
--- src/tools/compat/compat_defs.h:1.77	Thu Jan 14 21:38:19 2010
+++ src/tools/compat/compat_defs.h	Mon Jan 10 20:38:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.77 2010/01/14 21:38:19 christos Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.78 2011/01/10 20:38:35 apb Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -532,6 +532,53 @@
 
 /* inttypes.h */
 
+#if UCHAR_MAX == 0xffU			/* char is an 8-bit type */
+#ifndef PRId8
+#define PRId8 hhd
+#endif
+#ifndef PRIi8
+#define PRIi8 hhi
+#endif
+#ifndef PRIo8
+#define PRIo8 hho
+#endif
+#ifndef PRIu8
+#define PRIu8 hhu
+#endif
+#ifndef PRIx8
+#define PRIx8 hhx
+#endif
+#ifndef PRIX8
+#define PRIX8 hhX
+#endif
+#ifndef SCNd8
+#define SCNd8 hhd
+#endif
+#ifndef SCNi8
+#define SCNi8 hhi
+#endif
+#ifndef SCNo8
+#define SCNo8 hho
+#endif
+#ifndef SCNu8
+#define SCNu8 hhu
+#endif
+#ifndef SCNx8
+#define SCNx8 hhx
+#endif
+#ifndef SCNX8
+#define SCNX8 hhX
+#endif
+#endif	/* char is an 8-bit type */
+#if ! (defined(PRId8)  defined(PRIi8)  defined(PRIo8)  \
+	defined(PRIu8)  defined(PRIx8)  defined(PRIX8))
+#error Don't know how to define PRI[diouxX]8
+#endif
+#if ! (defined(SCNd8)  defined(SCNi8)  defined(SCNo8)  \
+	defined(SCNu8)  defined(SCNx8)  defined(SCNX8))
+#error Don't know how to define SCN[diouxX]8
+#endif
+
 #if USHRT_MAX == 0xU		/* short is a 16-bit type */
 #ifndef PRId16
 #define PRId16 hd
@@ -551,11 +598,33 @@
 #ifndef PRIX16
 #define PRIX16 hX
 #endif
+#ifndef SCNd16
+#define SCNd16 hd
+#endif
+#ifndef SCNi16
+#define SCNi16 hi
+#endif
+#ifndef SCNo16
+#define SCNo16 ho
+#endif
+#ifndef SCNu16
+#define SCNu16 hu
+#endif
+#ifndef SCNx16
+#define SCNx16 hx
+#endif
+#ifndef SCNX16
+#define SCNX16 hX
+#endif
 #endif	/* short is a 16-bit type */
 #if ! (defined(PRId16)  defined(PRIi16)  defined(PRIo16)  \
 	defined(PRIu16)  defined(PRIx16)  defined(PRIX16))
 #error Don't know how to define PRI[diouxX]16
 #endif
+#if ! (defined(SCNd16)  defined(SCNi16)  defined(SCNo16)  \
+	defined(SCNu16)  defined(SCNx16)  defined(SCNX16))
+#error Don't know how to define SCN[diouxX]16
+#endif
 
 #if UINT_MAX == 0xU		/* int is a 32-bit type */
 #ifndef PRId32
@@ -576,6 +645,24 @@
 #ifndef PRIX32
 #define PRIX32 X
 #endif
+#ifndef SCNd32
+#define SCNd32 d
+#endif
+#ifndef SCNi32
+#define SCNi32 i
+#endif
+#ifndef SCNo32
+#define SCNo32 o
+#endif
+#ifndef SCNu32
+#define SCNu32 u
+#endif
+#ifndef SCNx32
+#define SCNx32 x
+#endif
+#ifndef SCNX32
+#define SCNX32 X
+#endif
 #endif	/* int is a 32-bit type */
 #if ULONG_MAX == 0xU		/* long is a 32-bit type */
 #ifndef PRId32
@@ -596,11 +683,33 @@
 #ifndef PRIX32
 #define PRIX32 lX
 #endif
+#ifndef SCNd32
+#define SCNd32 ld
+#endif
+#ifndef SCNi32
+#define SCNi32 li
+#endif
+#ifndef SCNo32
+#define SCNo32 lo
+#endif
+#ifndef SCNu32
+#define SCNu32 lu
+#endif
+#ifndef SCNx32
+#define SCNx32 lx
+#endif
+#ifndef SCNX32
+#define SCNX32 lX
+#endif
 #endif	/* long is a 32-bit type */
 #if ! (defined(PRId32)  defined(PRIi32)  defined(PRIo32)  \
 	defined(PRIu32)  defined(PRIx32)  defined(PRIX32))
 #error Don't know how to define PRI[diouxX]32
 #endif
+#if ! (defined(SCNd32)  defined(SCNi32)  defined(SCNo32)  \
+	defined(SCNu32)  defined(SCNx32)  defined(SCNX32))
+#error Don't know how to define SCN[diouxX]32
+#endif
 
 #if ULONG_MAX == 0xU	/* long is a 64-bit type */
 #ifndef PRId64
@@ -621,6 +730,24 @@
 #ifndef PRIX64
 #define PRIX64 lX
 #endif
+#ifndef SCNd64
+#define SCNd64 ld
+#endif
+#ifndef SCNi64
+#define SCNi64 li
+#endif
+#ifndef SCNo64
+#define SCNo64 lo
+#endif
+#ifndef SCNu64
+#define SCNu64 lu
+#endif
+#ifndef SCNx64
+#define SCNx64 lx
+#endif
+#ifndef SCNX64
+#define SCNX64 lX
+#endif
 #endif	/* long is a 64-bit type */
 #if ULLONG_MAX == 0xU	/* long long is a 64-bit type */
 #ifndef PRId64
@@ -641,11 +768,33 @@
 #ifndef PRIX64
 #define PRIX64 llX
 #endif
+#ifndef SCNd64
+#define SCNd64 lld
+#endif
+#ifndef SCNi64
+#define SCNi64 lli
+#endif
+#ifndef SCNo64
+#define SCNo64 llo
+#endif
+#ifndef SCNu64
+#define SCNu64 llu
+#endif
+#ifndef SCNx64
+#define SCNx64 llx
+#endif
+#ifndef SCNX64
+#define SCNX64 llX
+#endif
 

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

2011-01-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Jan 10 21:26:38 UTC 2011

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

Log Message:
When we fail to read a block computing the matching hash,
it's nice to know what device and why.

Also, drop comment that hasn't been valid since 1.12.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/x86_autoconf.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.52 src/sys/arch/x86/x86/x86_autoconf.c:1.53
--- src/sys/arch/x86/x86/x86_autoconf.c:1.52	Sat Aug 21 17:27:20 2010
+++ src/sys/arch/x86/x86/x86_autoconf.c	Mon Jan 10 21:26:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.52 2010/08/21 17:27:20 jmcneill Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.53 2011/01/10 21:26:38 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.52 2010/08/21 17:27:20 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.53 2011/01/10 21:26:38 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -218,7 +218,6 @@
 #endif
 		if (is_valid_disk(dv)) {
 			n++;
-			/* XXXJRT why not just dv_xname?? */
 			snprintf(x86_alldisks-dl_nativedisks[n].ni_devname,
 			sizeof(x86_alldisks-dl_nativedisks[n].ni_devname),
 			%s, device_xname(dv));
@@ -299,8 +298,8 @@
 		sizeof(bf), blk * DEV_BSIZE, UIO_SYSSPACE,
 		0, NOCRED, NULL, NULL);
 		if (error) {
-			printf(findroot: unable to read block % PRIu64 \n,
-			blk);
+			printf(findroot: unable to read block % PRId64  
+			of dev %s (%d)\n, blk, device_xname(dv), error);
 			goto closeout;
 		}
 		MD5Update(ctx, bf, sizeof(bf));



CVS commit: src/lib/libpuffs

2011-01-10 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Jan 10 23:20:45 UTC 2011

Modified Files:
src/lib/libpuffs: callcontext.c

Log Message:
typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libpuffs/callcontext.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/libpuffs/callcontext.c
diff -u src/lib/libpuffs/callcontext.c:1.23 src/lib/libpuffs/callcontext.c:1.24
--- src/lib/libpuffs/callcontext.c:1.23	Mon Aug 11 16:23:37 2008
+++ src/lib/libpuffs/callcontext.c	Mon Jan 10 23:20:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: callcontext.c,v 1.23 2008/08/11 16:23:37 pooka Exp $	*/
+/*	$NetBSD: callcontext.c,v 1.24 2011/01/10 23:20:45 yamt Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: callcontext.c,v 1.23 2008/08/11 16:23:37 pooka Exp $);
+__RCSID($NetBSD: callcontext.c,v 1.24 2011/01/10 23:20:45 yamt Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -110,7 +110,7 @@
 	DPRINTF((puffs__cc_cont: pcc %p, mycc %p\n, pcc, mycc));
 
 	/*
-	 * XXX: race between setcontenxt() and recycle if
+	 * XXX: race between setcontext() and recycle if
 	 * we go multithreaded
 	 */
 	puffs__cc_destroy(mycc, 1);



CVS commit: src/sys/dev/pci

2011-01-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Jan 11 00:13:04 UTC 2011

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

Log Message:
Add Intel 82599 product IDs.


To generate a diff of this commit:
cvs rdiff -u -r1.1054 -r1.1055 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.1054 src/sys/dev/pci/pcidevs:1.1055
--- src/sys/dev/pci/pcidevs:1.1054	Thu Dec 16 07:02:07 2010
+++ src/sys/dev/pci/pcidevs	Tue Jan 11 00:13:03 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1054 2010/12/16 07:02:07 cegger Exp $
+$NetBSD: pcidevs,v 1.1055 2011/01/11 00:13:03 dyoung Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2354,6 +2354,11 @@
 product INTEL PRO_100_VM_5	0x103e	PRO/100 VM (MOB) Network Controller
 product INTEL PRO_WL_2100	0x1043	PRO/Wireless LAN 2100 3B Mini-PCI Adapter
 product INTEL 82597EX		0x1048	PRO/10GbE LR Server Adapter
+product INTEL 82599_KX4		0x10F7	82599 (KX/KX4) 10 GbE Controller
+product INTEL 82599_COMBO_BACKPLANE	0x10F8	82599 (combined backplane; KR/KX4/KX) 10 GbE Controller
+product INTEL 82599_CX4		0x10F9	82599 (CX4) 10 GbE Controller
+product INTEL 82599_SFP		0x10FB	82599 (SFI/SFP+) 10 GbE Controller
+product INTEL 82599_XAUI_LOM		0x10FC	82599 (XAUI/BX4) 10 GbE Controller
 product INTEL 82801H_M_AMT	0x1049	i82801H (M_AMT) LAN Controller
 product INTEL 82801H_AMT	0x104a	i82801H (AMT) LAN Controller
 product INTEL 82801H_LAN	0x104b	i82801H LAN Controller



CVS commit: src/sys/kern

2011-01-10 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Jan 11 00:36:03 UTC 2011

Modified Files:
src/sys/kern: Make.tags.inc

Log Message:
Don't compute tags over cxgb, its symbols clash too often with symbols
in other drivers and subsystems.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/Make.tags.inc

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

Modified files:

Index: src/sys/kern/Make.tags.inc
diff -u src/sys/kern/Make.tags.inc:1.22 src/sys/kern/Make.tags.inc:1.23
--- src/sys/kern/Make.tags.inc:1.22	Thu Nov  4 03:15:50 2010
+++ src/sys/kern/Make.tags.inc	Tue Jan 11 00:36:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Make.tags.inc,v 1.22 2010/11/04 03:15:50 dyoung Exp $
+#	$NetBSD: Make.tags.inc,v 1.23 2011/01/11 00:36:03 dyoung Exp $
 #
 #	from: @(#)Make.tags.inc	8.1 (Berkeley) 6/11/93
 
@@ -15,7 +15,7 @@
 # This promises to be easier to maintain, considering how often the directory
 # structure of the kernel sources has been changing recently.
 SYSDIR?= ${.CURDIR:H:H}
-FINDCOMM=	find -H ${SYSDIR} \( -path '*/dist/ipf' -o -name arch -o -name rump -o -name coda \) -prune -o -type f -name *.[ch] \( \! -name 'altq.h' \! -name 'nbcompat.h' \! -name 'pf_osfp.c' \! -name 'unichromereg.h' \! -name 'midway*' \! -name 'if_lmc.[ch]' \! -name 'aic79xxvar.h' \) -print | \
+FINDCOMM=	find -H ${SYSDIR} \( -path '*/dist/ipf' -o -name arch -o -name rump -o -name coda -o -name cxgb \) -prune -o -type f -name *.[ch] \( \! -name 'altq.h' \! -name 'nbcompat.h' \! -name 'pf_osfp.c' \! -name 'unichromereg.h' \! -name 'midway*' \! -name 'if_lmc.[ch]' \! -name 'aic79xxvar.h' \) -print | \
 sort -t / -u
 COMM!=	${FINDCOMM}
 .endif



CVS commit: src

2011-01-10 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Jan 11 00:45:05 UTC 2011

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: pciback.4 xbd.4 xbdback.4 xenbus.4 xennet.4 xpci.4
xvif.4

Log Message:
Add man pages for Xen devices:
pciback.4 xbd.4 xbdback.4 xenbus.4 xennet.4 xpci.4 xvif.4

Blessed by bouyer@


To generate a diff of this commit:
cvs rdiff -u -r1.1273 -r1.1274 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.542 -r1.543 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/pciback.4 src/share/man/man4/xbd.4 \
src/share/man/man4/xbdback.4 src/share/man/man4/xenbus.4 \
src/share/man/man4/xennet.4 src/share/man/man4/xpci.4 \
src/share/man/man4/xvif.4

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1273 src/distrib/sets/lists/man/mi:1.1274
--- src/distrib/sets/lists/man/mi:1.1273	Sun Jan  9 15:12:33 2011
+++ src/distrib/sets/lists/man/mi	Tue Jan 11 00:45:04 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1273 2011/01/09 15:12:33 jruoho Exp $
+# $NetBSD: mi,v 1.1274 2011/01/11 00:45:04 jym Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1323,6 +1323,7 @@
 ./usr/share/man/cat4/pcdisplay.0		man-sys-catman		.cat
 ./usr/share/man/cat4/pchb.0			man-sys-catman		.cat
 ./usr/share/man/cat4/pci.0			man-sys-catman		.cat
+./usr/share/man/cat4/pciback.0			man-sys-catman		.cat
 ./usr/share/man/cat4/pcic.0			man-sys-catman		.cat
 ./usr/share/man/cat4/pciide.0			man-sys-catman		.cat
 ./usr/share/man/cat4/pckbc.0			man-sys-catman		.cat
@@ -1765,8 +1766,14 @@
 ./usr/share/man/cat4/x86/fwhrng.0		man-sys-catman		.cat
 ./usr/share/man/cat4/x86/hpet.0			man-sys-catman		.cat
 ./usr/share/man/cat4/x86/ichlpcib.0		man-sys-catman		.cat
+./usr/share/man/cat4/xbd.0			man-sys-catman		.cat
+./usr/share/man/cat4/xbdback.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xbox.0			man-sys-catman		.cat
+./usr/share/man/cat4/xenbus.0			man-sys-catman		.cat
+./usr/share/man/cat4/xennet.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xge.0			man-sys-catman		.cat
+./usr/share/man/cat4/xpci.0			man-sys-catman		.cat
+./usr/share/man/cat4/xvif.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xirc.0			man-sys-catman		.cat
 ./usr/share/man/cat4/yds.0			man-sys-catman		.cat
@@ -4000,6 +4007,7 @@
 ./usr/share/man/html4/pcdisplay.html		man-sys-htmlman		html
 ./usr/share/man/html4/pchb.html			man-sys-htmlman		html
 ./usr/share/man/html4/pci.html			man-sys-htmlman		html
+./usr/share/man/html4/pciback.html		man-sys-htmlman		html
 ./usr/share/man/html4/pcic.html			man-sys-htmlman		html
 ./usr/share/man/html4/pciide.html		man-sys-htmlman		html
 ./usr/share/man/html4/pckbc.html		man-sys-htmlman		html
@@ -4412,8 +4420,14 @@
 ./usr/share/man/html4/x86/fwhrng.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/hpet.html		man-sys-htmlman		html
 ./usr/share/man/html4/x86/ichlpcib.html		man-sys-htmlman		html
+./usr/share/man/html4/xbd.html			man-sys-htmlman		html
+./usr/share/man/html4/xbdback.html		man-sys-htmlman		html
 ./usr/share/man/html4/xbox.html			man-sys-htmlman		html
+./usr/share/man/html4/xenbus.html		man-sys-htmlman		html
+./usr/share/man/html4/xennet.html		man-sys-htmlman		html
 ./usr/share/man/html4/xge.html			man-sys-htmlman		html
+./usr/share/man/html4/xpci.html			man-sys-htmlman		html
+./usr/share/man/html4/xvif.html			man-sys-htmlman		html
 ./usr/share/man/html4/xi.html			man-sys-htmlman		html
 ./usr/share/man/html4/xirc.html			man-sys-htmlman		html
 ./usr/share/man/html4/yds.html			man-sys-htmlman		html
@@ -6555,6 +6569,7 @@
 ./usr/share/man/man4/pcdisplay.4		man-sys-man		.man
 ./usr/share/man/man4/pchb.4			man-sys-man		.man
 ./usr/share/man/man4/pci.4			man-sys-man		.man
+./usr/share/man/man4/pciback.4			man-sys-man		.man
 ./usr/share/man/man4/pcic.4			man-sys-man		.man
 ./usr/share/man/man4/pciide.4			man-sys-man		.man
 ./usr/share/man/man4/pckbc.4			man-sys-man		.man
@@ -6997,8 +7012,14 @@
 ./usr/share/man/man4/x86/fwhrng.4		man-sys-man		.man
 ./usr/share/man/man4/x86/hpet.4			man-sys-man		.man
 ./usr/share/man/man4/x86/ichlpcib.4		man-sys-man		.man
+./usr/share/man/man4/xbd.4			man-sys-man		.man
+./usr/share/man/man4/xbdback.4			man-sys-man		.man
 ./usr/share/man/man4/xbox.4			man-sys-man		.man
+./usr/share/man/man4/xenbus.4			man-sys-man		.man
+./usr/share/man/man4/xennet.4			man-sys-man		.man
 ./usr/share/man/man4/xge.4			man-sys-man		.man
+./usr/share/man/man4/xpci.4			man-sys-man		.man
+./usr/share/man/man4/xvif.4			man-sys-man		.man
 ./usr/share/man/man4/xi.4			man-sys-man		.man
 ./usr/share/man/man4/xirc.4			man-sys-man		.man
 ./usr/share/man/man4/yds.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.542 

CVS commit: src/sys/dev/sbus

2011-01-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jan 11 00:49:50 UTC 2011

Modified Files:
src/sys/dev/sbus: dbri.c dbrivar.h

Log Message:
use config_finalize_register() instead of config_interrupts() to detect the
codec and attach audio. For some reason we run into a locking panic with
config_interrupts().
Tested on my SS20


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sbus/dbri.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/sbus/dbrivar.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/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.31 src/sys/dev/sbus/dbri.c:1.32
--- src/sys/dev/sbus/dbri.c:1.31	Wed Feb 24 22:38:08 2010
+++ src/sys/dev/sbus/dbri.c	Tue Jan 11 00:49:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.31 2010/02/24 22:38:08 dyoung Exp $	*/
+/*	$NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.31 2010/02/24 22:38:08 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.32 2011/01/11 00:49:50 macallan Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -96,7 +96,7 @@
 static void	dbri_attach_sbus(device_t, device_t, void *);
 static int	dbri_match_sbus(device_t, cfdata_t, void *);
 
-static void	dbri_config_interrupts(device_t);
+static int	dbri_config_interrupts(device_t);
 
 /* interrupt handler */
 static int	dbri_intr(void *);
@@ -378,7 +378,8 @@
 	sc-sc_refcount = 0;
 	sc-sc_playing = 0;
 	sc-sc_recording = 0;
-	config_interrupts(self, dbri_config_interrupts);
+	sc-sc_init_done = 0;
+	config_finalize_register(self, dbri_config_interrupts);
 
 	return;
 }
@@ -441,16 +442,21 @@
 	mmcodec_setgain(sc, 0);
 }
 
-static void
+static int
 dbri_config_interrupts(device_t dev)
 {
 	struct dbri_softc *sc = device_private(dev);
 
+	if (sc-sc_init_done != 0)
+		return 0;
+
+	sc-sc_init_done = 1;
+
 	dbri_init(sc);
 	if (mmcodec_init(sc) == -1) {
 		printf(%s: no codec detected, aborting\n,
 		device_xname(dev));
-		return;
+		return 0;
 	}
 
 	/* Attach ourselves to the high level audio interface */
@@ -458,7 +464,7 @@
 
 	/* power down until open() */
 	dbri_set_power(sc, 0);
-	return;
+	return 0;
 }
 
 static int

Index: src/sys/dev/sbus/dbrivar.h
diff -u src/sys/dev/sbus/dbrivar.h:1.11 src/sys/dev/sbus/dbrivar.h:1.12
--- src/sys/dev/sbus/dbrivar.h:1.11	Thu Sep 17 16:28:12 2009
+++ src/sys/dev/sbus/dbrivar.h	Tue Jan 11 00:49:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbrivar.h,v 1.11 2009/09/17 16:28:12 tsutsui Exp $	*/
+/*	$NetBSD: dbrivar.h,v 1.12 2011/01/11 00:49:50 macallan Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -124,6 +124,7 @@
 	bus_dma_segment_t sc_dmaseg;
 	
 	int		sc_have_powerctl;
+	int		sc_init_done;
 	int		sc_powerstate;	/* DBRI's powered up or not */
 	int		sc_pmgrstate;	/* PWR_RESUME etc. */
 	int		sc_burst;	/* DVMA burst size in effect */



CVS commit: src/tests/sbin/resize_ffs

2011-01-10 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Jan 11 00:50:02 UTC 2011

Modified Files:
src/tests/sbin/resize_ffs: t_grow.sh t_grow_swapped.sh

Log Message:
Copy a little less data in the ufs2, 4096-byte block test cases.
The file system was filling up instead of *almost* filling up, which
threw off the tests.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/sbin/resize_ffs/t_grow.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/resize_ffs/t_grow_swapped.sh

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

Modified files:

Index: src/tests/sbin/resize_ffs/t_grow.sh
diff -u src/tests/sbin/resize_ffs/t_grow.sh:1.7 src/tests/sbin/resize_ffs/t_grow.sh:1.8
--- src/tests/sbin/resize_ffs/t_grow.sh:1.7	Wed Jan  5 02:25:27 2011
+++ src/tests/sbin/resize_ffs/t_grow.sh	Tue Jan 11 00:50:02 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_grow.sh,v 1.7 2011/01/05 02:25:27 riz Exp $
+# $NetBSD: t_grow.sh,v 1.8 2011/01/11 00:50:02 riz Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -96,22 +96,22 @@
 test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29
 test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28
 test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25
-test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 41
+test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40
 test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42
 test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43
 test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42
 test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38
-test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 55
+test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53
 test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56
 test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58
 test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56
 test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51
-test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 82
+test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80
 test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84
 test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87
 test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83
 test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76
-test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 109
+test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107
 test_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111
 test_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115
 test_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111

Index: src/tests/sbin/resize_ffs/t_grow_swapped.sh
diff -u src/tests/sbin/resize_ffs/t_grow_swapped.sh:1.1 src/tests/sbin/resize_ffs/t_grow_swapped.sh:1.2
--- src/tests/sbin/resize_ffs/t_grow_swapped.sh:1.1	Wed Jan  5 02:25:27 2011
+++ src/tests/sbin/resize_ffs/t_grow_swapped.sh	Tue Jan 11 00:50:02 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_grow_swapped.sh,v 1.1 2011/01/05 02:25:27 riz Exp $
+# $NetBSD: t_grow_swapped.sh,v 1.2 2011/01/11 00:50:02 riz Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -96,22 +96,22 @@
 test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29 swap
 test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28 swap
 test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25 swap
-test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 41 swap
+test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40 swap
 test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42 swap
 test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43 swap
 test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42 swap
 test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38 swap
-test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 55 swap
+test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53 swap
 test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56 swap
 test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58 swap
 test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56 swap
 test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51 swap
-test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 82 swap
+test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80 swap
 test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84 swap
 test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87 swap
 test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83 swap
 test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76 swap
-test_case grow_64M_v2_4096 

CVS commit: src/sys/arch/xen/xen

2011-01-10 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Jan 11 01:21:32 UTC 2011

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
Typo fix.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.35 src/sys/arch/xen/xen/xennetback_xenbus.c:1.36
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.35	Sat Jan  8 05:23:19 2011
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Tue Jan 11 01:21:32 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.35 2011/01/08 05:23:19 jym Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.36 2011/01/11 01:21:32 jym Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -242,13 +242,13 @@
 
 	if ((err = xenbus_read_ul(NULL, xbusd-xbusd_path,
 	frontend-id, domid, 10)) != 0) {
-		aprint_error(xvif: can' read %s/frontend-id: %d\n,
+		aprint_error(xvif: can't read %s/frontend-id: %d\n,
 		xbusd-xbusd_path, err);
 		return err;
 	}
 	if ((err = xenbus_read_ul(NULL, xbusd-xbusd_path,
 	handle, handle, 10)) != 0) {
-		aprint_error(xvif: can' read %s/handle: %d\n,
+		aprint_error(xvif: can't read %s/handle: %d\n,
 		xbusd-xbusd_path, err);
 		return err;
 	}



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/booke/dev

2011-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 11 03:45:29 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev [matt-nb5-pq3]: pq3etsec.c

Log Message:
Fix bpf_mtap call (tcpdump now works).


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

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.1.2.1 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.1.2.2
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.1.2.1	Fri Jan  7 01:26:19 2011
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Tue Jan 11 03:45:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.1.2.1 2011/01/07 01:26:19 matt Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.1.2.2 2011/01/11 03:45:29 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1436,7 +1436,7 @@
 	int s = splnet();
 #if NBPFILTER  0
 	if (ifp-if_bpf)
-		bpf_mtap(ifp, m);
+		bpf_mtap(ifp-if_bpf, m);
 #endif
 	(*ifp-if_input)(ifp, m);
 	splx(s);
@@ -2381,6 +2381,8 @@
 		softint_schedule(sc-sc_soft_ih);
 	splx(s);
 	callout_schedule(sc-sc_mii_callout, hz);
+#ifdef DEBUG
 	sc-sc_mii_last_tick = now;
+#endif
 	mutex_exit(sc-sc_lock);
 }



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

2011-01-10 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Jan 11 06:57:35 UTC 2011

Modified Files:
src/sys/arch/sandpoint/include: bootinfo.h

Log Message:
add btinfo_modulelist for MODULAR component loading.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/include/bootinfo.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/sandpoint/include/bootinfo.h
diff -u src/sys/arch/sandpoint/include/bootinfo.h:1.7 src/sys/arch/sandpoint/include/bootinfo.h:1.8
--- src/sys/arch/sandpoint/include/bootinfo.h:1.7	Thu May 20 19:27:25 2010
+++ src/sys/arch/sandpoint/include/bootinfo.h	Tue Jan 11 06:57:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo.h,v 1.7 2010/05/20 19:27:25 phx Exp $	*/
+/*	$NetBSD: bootinfo.h,v 1.8 2011/01/11 06:57:35 nisimura Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -44,6 +44,7 @@
 #define BTINFO_ROOTDEVICE	6
 #define BTINFO_NET		7
 #define BTINFO_PRODFAMILY	8
+#define BTINFO_MODULELIST	9
 
 struct btinfo_magic {
 	struct btinfo_common common;
@@ -90,6 +91,22 @@
 	char name[24];
 };
 
+struct btinfo_modulelist {
+	struct btinfo_common common;
+	int num;
+	uint32_t endpa;
+	/* bi_modulelist_entry follows as an array */
+};
+
+struct bi_modulelist_entry {
+	char kmod[80];
+	int type;
+#define BI_MODULE_NONE		0x00
+#define BI_MODULE_ELF		0x01
+	int len;
+	uint32_t base;
+};
+
 #define BOOTINFO_MAXSIZE 4096
 
 #ifdef _KERNEL



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 11 07:09:54 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: psl.h

Log Message:
PSL_SPV is actually same value of PSL_VEC (must be a coincidence).


To generate a diff of this commit:
cvs rdiff -u -r1.14.86.1 -r1.14.86.2 src/sys/arch/powerpc/include/psl.h

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

Modified files:

Index: src/sys/arch/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.14.86.1 src/sys/arch/powerpc/include/psl.h:1.14.86.2
--- src/sys/arch/powerpc/include/psl.h:1.14.86.1	Fri Jan  7 01:59:39 2011
+++ src/sys/arch/powerpc/include/psl.h	Tue Jan 11 07:09:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.14.86.1 2011/01/07 01:59:39 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.14.86.2 2011/01/11 07:09:54 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -43,8 +43,8 @@
  * [*] Little-endian mode on the 601 is implemented in the HID0 register.
  */
 #define	PSL_VEC		0x0200	/* ..6. AltiVec vector unit available */
+#define	PSL_SPV		0x0200	/* B... (e500) SPE enable */
 #define	PSL_UCLE	0x0040	/* B... user-mode cache lock enable */
-#define	PSL_SPV		0x0020	/* B... (e500) SPE enable */
 #define	PSL_POW		0x0004	/* ..6. power management */
 #define	PSL_WE		PSL_POW		/* B4.. wait state enable */
 #define	PSL_TGPR	0x0002	/* ..6. temp. gpr remapping (mpc603e) */



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 11 07:10:15 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: asm.h

Log Message:
Add a END(y) for function sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.26.26.1 -r1.26.26.2 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.26.26.1 src/sys/arch/powerpc/include/asm.h:1.26.26.2
--- src/sys/arch/powerpc/include/asm.h:1.26.26.1	Fri Jan  7 01:51:02 2011
+++ src/sys/arch/powerpc/include/asm.h	Tue Jan 11 07:10:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.26.26.1 2011/01/07 01:51:02 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.26.26.2 2011/01/11 07:10:15 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -110,6 +110,7 @@
 	.text; .align 2; .globl x; .type x,@function; x:
 
 #define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define	END(x)		.size _C_LABEL(x),.-_C_LABEL(x)
 
 #define	ENTRY_NOPROFILE(y) _ENTRY(_C_LABEL(y))
 



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 11 07:11:59 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: mcontext.h

Log Message:
Add a _UC_POWERPC_SPE bit to indicate the vectors are from SPE.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.26.1 src/sys/arch/powerpc/include/mcontext.h

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

Modified files:

Index: src/sys/arch/powerpc/include/mcontext.h
diff -u src/sys/arch/powerpc/include/mcontext.h:1.8 src/sys/arch/powerpc/include/mcontext.h:1.8.26.1
--- src/sys/arch/powerpc/include/mcontext.h:1.8	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/mcontext.h	Tue Jan 11 07:11:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.8 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.8.26.1 2011/01/11 07:11:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -111,6 +111,7 @@
 
 /* Machine-dependent uc_flags */
 #define	_UC_POWERPC_VEC	0x0001	/* Vector Register File valid */
+#define	_UC_POWERPC_SPE	0x0002	/* Vector Register File valid */
 
 #define _UC_MACHINE_SP(uc)	((uc)-uc_mcontext.__gregs[_REG_R1])
 #define _UC_MACHINE_PC(uc)	((uc)-uc_mcontext.__gregs[_REG_PC])



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 11 07:14:49 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: ptrace.h

Log Message:
Anything that applies to Altivec also applies SPE since to the common powerpc
code they share identical hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.70.1 src/sys/arch/powerpc/include/ptrace.h

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

Modified files:

Index: src/sys/arch/powerpc/include/ptrace.h
diff -u src/sys/arch/powerpc/include/ptrace.h:1.10 src/sys/arch/powerpc/include/ptrace.h:1.10.70.1
--- src/sys/arch/powerpc/include/ptrace.h:1.10	Sun Mar  4 06:00:37 2007
+++ src/sys/arch/powerpc/include/ptrace.h	Tue Jan 11 07:14:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.10 2007/03/04 06:00:37 christos Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.10.70.1 2011/01/11 07:14:49 matt Exp $	*/
 
 #ifndef _POWERPC_PTRACE_H
 #define	_POWERPC_PTRACE_H
@@ -22,7 +22,7 @@
 #include opt_altivec.h
 #endif
 
-#ifdef ALTIVEC
+#if defined(ALTIVEC) || defined(PPC_HAVE_SPE)
 
 /* We have machine-dependent process tracing requests.  */
 #define __HAVE_PTRACE_MACHDEP
@@ -58,7 +58,7 @@
 	struct pfsnode *, struct uio *);
 int procfs_machdep_validvecregs(struct lwp *, struct mount *);
 
-#endif /* ALTIVEC */
+#endif /* ALTIVEC || PPC_HAVE_SPE */
 #endif /* _KERNEL */
 
 #endif /* _POWERPC_PTRACE_H */