CVS commit: src/sys/arch/landisk/landisk

2010-03-28 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Mar 28 07:31:59 UTC 2010

Modified Files:
src/sys/arch/landisk/landisk: bus_dma.c

Log Message:
return allocated va.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/landisk/landisk/bus_dma.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/landisk/landisk/bus_dma.c
diff -u src/sys/arch/landisk/landisk/bus_dma.c:1.11 src/sys/arch/landisk/landisk/bus_dma.c:1.12
--- src/sys/arch/landisk/landisk/bus_dma.c:1.11	Sun Mar 21 14:49:28 2010
+++ src/sys/arch/landisk/landisk/bus_dma.c	Sun Mar 28 07:31:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.11 2010/03/21 14:49:28 nonaka Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.12 2010/03/28 07:31:59 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2005 NONAKA Kimihiro
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.11 2010/03/21 14:49:28 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.12 2010/03/28 07:31:59 nonaka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -664,7 +664,7 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
+	vaddr_t va, topva;
 	bus_addr_t addr;
 	int curseg;
 
@@ -695,6 +695,7 @@
 			  | ((flags  BUS_DMA_NOWAIT) ? UVM_KMF_NOWAIT : 0));
 	if (va == 0)
 		return (ENOMEM);
+	topva = va;
 
 	for (curseg = 0; curseg  nsegs; curseg++) {
 		DPRINTF((%s: segs[%d]: ds_addr = 0x%08lx, ds_len = %ld\n,
@@ -714,7 +715,7 @@
 	}
 
 	pmap_update(pmap_kernel());
-	*kvap = (void *)va;
+	*kvap = (void *)topva;
 	return (0);
 }
 



CVS commit: src/crypto/external/bsd/openssl/dist/ssl

2010-03-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 28 11:32:29 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/dist/ssl: s3_pkt.c

Log Message:
Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
In TLS connections, certain incorrectly formatted records can cause an OpenSSL
client or server to crash due to a read attempt at NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c:1.6 src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c:1.7
--- src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c:1.6	Sun Jan 10 16:39:10 2010
+++ src/crypto/external/bsd/openssl/dist/ssl/s3_pkt.c	Sun Mar 28 11:32:29 2010
@@ -337,9 +337,9 @@
 			if (version != s-version)
 {
 SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-/* Send back error using their
- * version number :-) */
-s-version=version;
+if ((s-version  0xFF00) == (version  0xFF00))
+	/* Send back error using their minor version number :-) */
+	s-version = (unsigned short)version;
 al=SSL_AD_PROTOCOL_VERSION;
 goto f_err;
 }



CVS commit: src/sys/dev/acpi

2010-03-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Mar 28 13:11:23 UTC 2010

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

Log Message:
Update acpiapm_get_powstat() to adjust for the recent changes to
acpi_bat(4).  (The warn_cap and low_cap sensors were removed, and the
values are now stored as the alarm limits of the charge sensor.)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/acpi/acpi_apm.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_apm.c
diff -u src/sys/dev/acpi/acpi_apm.c:1.16 src/sys/dev/acpi/acpi_apm.c:1.17
--- src/sys/dev/acpi/acpi_apm.c:1.16	Wed Mar 24 01:45:37 2010
+++ src/sys/dev/acpi/acpi_apm.c	Sun Mar 28 13:11:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_apm.c,v 1.16 2010/03/24 01:45:37 pgoyette Exp $	*/
+/*	$NetBSD: acpi_apm.c,v 1.17 2010/03/28 13:11:23 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -35,12 +35,16 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_apm.c,v 1.16 2010/03/24 01:45:37 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_apm.c,v 1.17 2010/03/28 13:11:23 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/device.h
 #include sys/sysctl.h
 #include sys/systm.h
+#include sys/queue.h
+#include sys/envsys.h
+
+#include dev/sysmon/sysmonvar.h
 
 #include dev/acpi/acpivar.h
 #include dev/apm/apmvar.h
@@ -49,6 +53,8 @@
 static void	acpiapm_enable(void *, int);
 static int	acpiapm_set_powstate(void *, u_int, u_int);
 static int	acpiapm_get_powstat(void *, u_int, struct apm_power_info *);
+static bool	apm_per_sensor(const struct sysmon_envsys *,
+			   const envsys_data_t *, void *);
 static int	acpiapm_get_event(void *, u_int *, u_int *);
 static void	acpiapm_cpu_busy(void *);
 static void	acpiapm_cpu_idle(void *);
@@ -253,6 +259,69 @@
 	return 0;
 }
 
+struct apm_sensor_info {
+	struct apm_power_info *pinfo;
+	int present;
+	int lastcap, descap, cap, warncap, lowcap, discharge;
+	int lastcap_valid, cap_valid, discharge_valid;
+};
+
+static bool
+apm_per_sensor(const struct sysmon_envsys *sme, const envsys_data_t *edata,
+	   void *arg)
+{
+	struct apm_sensor_info *info = (struct apm_sensor_info *)arg;
+	int data;
+
+	if (sme-sme_class != SME_CLASS_ACADAPTER 
+	sme-sme_class != SME_CLASS_BATTERY)
+		return false;
+
+	if (edata-state == ENVSYS_SINVALID)
+		return true;
+
+	data = edata-value_cur;
+
+	DPRINTF((%s (%s) %d\n, sme-sme_name, edata-desc, data));
+
+	if (strstr(edata-desc, connected)) {
+		info-pinfo-ac_state = data ? APM_AC_ON : APM_AC_OFF;
+	}
+	else if (strstr(edata-desc, present)  data != 0)
+		info-present++;
+	else if (strstr(edata-desc, charging)) {
+		if (data)
+			info-pinfo-battery_flags |= APM_BATT_FLAG_CHARGING;
+		else
+			info-pinfo-battery_flags = ~APM_BATT_FLAG_CHARGING;
+		}
+	else if (strstr(edata-desc, last full cap)) {
+		info-lastcap += data / 1000;
+		info-lastcap_valid = 1;
+	}
+	else if (strstr(edata-desc, design cap))
+		info-descap = data / 1000;
+	else if (strstr(edata-desc, charge) 
+	strstr(edata-desc, charge rate) == NULL 
+	strstr(edata-desc, charge state) == NULL) {
+
+		/* Update cumulative capacity */
+		info-cap += data / 1000;
+
+		/* get warning-  critical-capacity values */
+		info-warncap = edata-limits.sel_warnmin / 1000;
+		info-lowcap = edata-limits.sel_critmin / 1000;
+
+		info-cap_valid = 1;
+		info-pinfo-nbattery++;
+	}
+	else if (strstr(edata-desc, discharge rate)) {
+		info-discharge += data / 1000;
+		info-discharge_valid = 1;
+	}
+	return true;
+}
+
 static int
 /*ARGSUSED*/
 acpiapm_get_powstat(void *opaque, u_int batteryid,
@@ -261,17 +330,20 @@
 #define APM_BATT_FLAG_WATERMARK_MASK (APM_BATT_FLAG_CRITICAL |		  \
   APM_BATT_FLAG_LOW |		  \
   APM_BATT_FLAG_HIGH)
-	int i, curcap, lowcap, warncap, cap, descap, lastcap, discharge;
-	int cap_valid, lastcap_valid, discharge_valid, present;
-	envsys_tre_data_t etds;
-	envsys_basic_info_t ebis;
+	struct apm_sensor_info info;
 
 	/* Denote most variables as unitialized. */
-	curcap = lowcap = warncap = descap = -1;
+	info.lowcap = info.warncap = info.descap = -1;
 
-	/* Prepare to aggregate these two variables over all batteries. */
-	cap = lastcap = discharge = 0;
-	cap_valid = lastcap_valid = discharge_valid = present = 0;
+	/*
+	 * Prepare to aggregate capacity, charge, and discharge over all
+	 * batteries.
+	 */
+	info.cap = info.lastcap = info.discharge = 0;
+	info.cap_valid = info.lastcap_valid = info.discharge_valid = 0;
+	info.present = 0;
+
+	info.pinfo = pinfo;
 
 	(void)memset(pinfo, 0, sizeof(*pinfo));
 	pinfo-ac_state = APM_AC_UNKNOWN;
@@ -283,82 +355,31 @@
 	pinfo-battery_state = APM_BATT_UNKNOWN; /* ignored */
 	pinfo-battery_life = APM_BATT_LIFE_UNKNOWN;
 
-	sysmonopen_envsys(0, 0, 0, lwp0);
-
-	for (i = 0;; i++) {
-		const char *desc;
-		int data;
-		int flags;
-
-		ebis.sensor = i;
-		if 

CVS commit: src/lib/libc/locale

2010-03-28 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sun Mar 28 14:05:09 UTC 2010

Modified Files:
src/lib/libc/locale: setlocale32.c

Log Message:
avoid mbrtowc/wcrtomb buffer overrun when CPUARCH=hppa and MB_CUR_MAX  6.
it is not usual case(merely used such mutibyte locale, eg. ja_JP.ISO-2022-JP).

[background]
before merging minoura-xpg4dl branch(2001), we argued and decided to increase
MB_LEN_MAX 1 - 32 all CPUARCH(*but* we forgot to change it MD to MI).

without knowing that NetBSD/hp700(mergeing -current 2002) incorrectly set
MB_LEN_MAX=6 (maybe this value taken from FreeBSD). but our setlocale(3)
assumes __mb_len_max_runtime as 32, so that mbrtowc/wcrtomb may overrun.

we have to increase hppa's MB_LEN_MAX upto 32, and change it MD to MI
next libc major bump(scheduled next release 6.0).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/setlocale32.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/locale/setlocale32.c
diff -u src/lib/libc/locale/setlocale32.c:1.2 src/lib/libc/locale/setlocale32.c:1.3
--- src/lib/libc/locale/setlocale32.c:1.2	Tue Mar 11 17:23:07 2003
+++ src/lib/libc/locale/setlocale32.c	Sun Mar 28 14:05:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: setlocale32.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $	*/
+/*	$NetBSD: setlocale32.c,v 1.3 2010/03/28 14:05:09 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: setlocale32.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $);
+__RCSID($NetBSD: setlocale32.c,v 1.3 2010/03/28 14:05:09 tnozaki Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -44,6 +44,6 @@
 
 	/* locale may be NULL */
 
-	__mb_len_max_runtime = 32;
+	__mb_len_max_runtime = MB_LEN_MAX;
 	return __setlocale(category, locale);
 }



CVS commit: src/lib/libc

2010-03-28 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sun Mar 28 14:08:22 UTC 2010

Modified Files:
src/lib/libc: shlib_version

Log Message:
MB_LEN_MAX should moved from MD to MI.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/lib/libc/shlib_version

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/shlib_version
diff -u src/lib/libc/shlib_version:1.215 src/lib/libc/shlib_version:1.216
--- src/lib/libc/shlib_version:1.215	Fri Oct  2 02:45:29 2009
+++ src/lib/libc/shlib_version	Sun Mar 28 14:08:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.215 2009/10/02 02:45:29 tsarna Exp $
+#	$NetBSD: shlib_version,v 1.216 2010/03/28 14:08:22 tnozaki Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
@@ -34,5 +34,7 @@
 # - change _ctype_ table in ctype.h and gen/ctype_.c 8bit - 16 or 32bit.
 #   it's insufficient bitwidth to implement all ctype class.
 #   see isblank's comment in ctype.h.
+# - increase MB_LEN_MAX 6 - 32 sys/arch/hppa/include/limits.h
+#   and make it's definition MD - MI.
 major=12
 minor=171



CVS commit: [netbsd-5] src

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:03:23 UTC 2010

Modified Files:
src/share/man/man4 [netbsd-5]: mfi.4
src/sys/dev/ic [netbsd-5]: mfi.c mfireg.h mfivar.h
src/sys/dev/pci [netbsd-5]: mfi_pci.c pcidevs

Log Message:
Apply patch (requested by msaitoh in ticket #1326):
Add support for MFI gen2 devices.  Mention newer devices, RAID 6 and
RAID60 in mfi.4.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.8.1 src/share/man/man4/mfi.4
cvs rdiff -u -r1.19.4.3 -r1.19.4.4 src/sys/dev/ic/mfi.c
cvs rdiff -u -r1.3 -r1.3.14.1 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.10 -r1.10.6.1 src/sys/dev/ic/mfivar.h
cvs rdiff -u -r1.5 -r1.5.14.1 src/sys/dev/pci/mfi_pci.c
cvs rdiff -u -r1.962.4.10 -r1.962.4.11 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/share/man/man4/mfi.4
diff -u src/share/man/man4/mfi.4:1.7 src/share/man/man4/mfi.4:1.7.8.1
--- src/share/man/man4/mfi.4:1.7	Fri Feb 29 20:56:33 2008
+++ src/share/man/man4/mfi.4	Sun Mar 28 15:03:23 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: mfi.4,v 1.7 2008/02/29 20:56:33 xtraeme Exp $
+.\	$NetBSD: mfi.4,v 1.7.8.1 2010/03/28 15:03:23 snj Exp $
 .\	$OpenBSD: mfi.4,v 1.7 2006/09/01 09:58:09 jmc Exp $
 .\
 .\ Written by Marco Peereboom ma...@peereboom.us
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 29, 2008
+.Dd February 9, 2010
 .Dt MFI 4
 .Os
 .Sh NAME
@@ -55,12 +55,14 @@
 MegaRAID SAS 8344ELP,
 MegaRAID SAS 8408E,
 MegaRAID SAS 8480E,
+MegaRAID SAS 8708ELP,
 MegaRAID SAS ELP,
-MegaRAID SAS 8880EM2
+MegaRAID SAS 8880EM2,
+MegaRAID SAS 9260-8i
 .El
 .Pp
-These controllers support RAID 0, RAID 1, RAID 5, RAID 10, and RAID 50
-using either SAS or SATA II drives.
+These controllers support RAID 0, RAID 1, RAID 5, RAID 6, RAID 10, RAID 50 and
+RAID 60 using either SAS or SATA II drives.
 .Pp
 Although the controllers are actual RAID controllers,
 the driver makes them look just like SCSI controllers.

Index: src/sys/dev/ic/mfi.c
diff -u src/sys/dev/ic/mfi.c:1.19.4.3 src/sys/dev/ic/mfi.c:1.19.4.4
--- src/sys/dev/ic/mfi.c:1.19.4.3	Wed Jan 27 21:40:25 2010
+++ src/sys/dev/ic/mfi.c	Sun Mar 28 15:03:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.19.4.3 2010/01/27 21:40:25 sborrill Exp $ */
+/* $NetBSD: mfi.c,v 1.19.4.4 2010/03/28 15:03:22 snj Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom ma...@peereboom.us
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mfi.c,v 1.19.4.3 2010/01/27 21:40:25 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: mfi.c,v 1.19.4.4 2010/03/28 15:03:22 snj Exp $);
 
 #include bio.h
 
@@ -92,7 +92,7 @@
 static void		mfi_mgmt_done(struct mfi_ccb *);
 
 #if NBIO  0
-static int		mfi_ioctl(struct device *, u_long, void *);
+static int		mfi_ioctl(device_t, u_long, void *);
 static int		mfi_ioctl_inq(struct mfi_softc *, struct bioc_inq *);
 static int		mfi_ioctl_vol(struct mfi_softc *, struct bioc_vol *);
 static int		mfi_ioctl_disk(struct mfi_softc *, struct bioc_disk *);
@@ -112,26 +112,38 @@
 static void 		mfi_xscale_intr_ena(struct mfi_softc *sc);
 static int 		mfi_xscale_intr(struct mfi_softc *sc);
 static void 		mfi_xscale_post(struct mfi_softc *sc, struct mfi_ccb *ccb);
-			  	 
+
 static const struct mfi_iop_ops mfi_iop_xscale = {
 	mfi_xscale_fw_state,
 	mfi_xscale_intr_ena,
 	mfi_xscale_intr,
 	mfi_xscale_post
 };
- 	 
+
 static uint32_t 	mfi_ppc_fw_state(struct mfi_softc *sc);
 static void 		mfi_ppc_intr_ena(struct mfi_softc *sc);
 static int 		mfi_ppc_intr(struct mfi_softc *sc);
 static void 		mfi_ppc_post(struct mfi_softc *sc, struct mfi_ccb *ccb);
-		  	 
+
 static const struct mfi_iop_ops mfi_iop_ppc = {
 	mfi_ppc_fw_state,
 	mfi_ppc_intr_ena,
 	mfi_ppc_intr,
 	mfi_ppc_post
 };
- 	 
+
+uint32_t	mfi_gen2_fw_state(struct mfi_softc *sc);
+void		mfi_gen2_intr_ena(struct mfi_softc *sc);
+int		mfi_gen2_intr(struct mfi_softc *sc);
+void		mfi_gen2_post(struct mfi_softc *sc, struct mfi_ccb *ccb);
+
+static const struct mfi_iop_ops mfi_iop_gen2 = {
+	mfi_gen2_fw_state,
+	mfi_gen2_intr_ena,
+	mfi_gen2_intr,
+	mfi_gen2_post
+};
+
 #define mfi_fw_state(_s) 	((_s)-sc_iop-mio_fw_state(_s))
 #define mfi_intr_enable(_s) 	((_s)-sc_iop-mio_intr_ena(_s))
 #define mfi_my_intr(_s) 	((_s)-sc_iop-mio_intr(_s))
@@ -284,7 +296,7 @@
 
 	if (bus_dmamap_create(sc-sc_dmat, size, 1, size, 0,
 	BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, mm-am_map) != 0)
-		goto amfree; 
+		goto amfree;
 
 	if (bus_dmamem_alloc(sc-sc_dmat, size, PAGE_SIZE, 0, mm-am_seg, 1,
 	nsegs, BUS_DMA_NOWAIT) != 0)
@@ -617,6 +629,9 @@
 	case MFI_IOP_PPC:
 		sc-sc_iop = mfi_iop_ppc;
 		break;
+	case MFI_IOP_GEN2:
+		sc-sc_iop = mfi_iop_gen2;
+		break;
 	default:
 		 panic(%s: unknown iop %d, DEVNAME(sc), iop);
 	}
@@ -701,7 +716,7 @@
 		

CVS commit: [netbsd-5] src/sys/dev/pci

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:07:31 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1326.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.10 -r1.963.4.11 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.10 -r1.962.4.11 src/sys/dev/pci/pcidevs_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/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.10 src/sys/dev/pci/pcidevs.h:1.963.4.11
--- src/sys/dev/pci/pcidevs.h:1.963.4.10	Wed Jan 27 22:27:42 2010
+++ src/sys/dev/pci/pcidevs.h	Sun Mar 28 15:07:24 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.10 2010/01/27 22:27:42 sborrill Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.11 2010/03/28 15:07:24 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.9 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
  */
 
 /*
@@ -2974,6 +2974,10 @@
 #define	PCI_PRODUCT_SYMBIOS_SAS1066	0x005E		/* SAS1066 */
 #define	PCI_PRODUCT_SYMBIOS_SAS1078	0x0060		/* SAS1078 PCI */
 #define	PCI_PRODUCT_SYMBIOS_SAS1078_PCIE	0x0062		/* SAS1078 PCI Express */
+#define	PCI_PRODUCT_SYMBIOS_SAS2008	0x0072		/* SAS2008 */
+#define	PCI_PRODUCT_SYMBIOS_SAS2108_1	0x0078		/* MegaRAID SAS2108 CRYPTO GEN2 */
+#define	PCI_PRODUCT_SYMBIOS_SAS2108_2	0x0079		/* MegaRAID SAS2108 GEN2 */
+#define	PCI_PRODUCT_SYMBIOS_SAS1078DE	0x007c		/* SAS1078DE */
 #define	PCI_PRODUCT_SYMBIOS_875J	0x008f		/* 53c875J */
 #define	PCI_PRODUCT_SYMBIOS_FC909	0x0620		/* FC909 */
 #define	PCI_PRODUCT_SYMBIOS_FC909A	0x0621		/* FC909A */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.10 src/sys/dev/pci/pcidevs_data.h:1.962.4.11
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.10	Wed Jan 27 22:27:42 2010
+++ src/sys/dev/pci/pcidevs_data.h	Sun Mar 28 15:07:24 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.10 2010/01/27 22:27:42 sborrill Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.11 2010/03/28 15:07:24 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.9 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
  */
 
 /*
@@ -10412,6 +10412,22 @@
 	SAS1078 PCI Express,
 	},
 	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2008,
+	SAS2008,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2108_1,
+	MegaRAID SAS2108 CRYPTO GEN2,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2108_2,
+	MegaRAID SAS2108 GEN2,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS1078DE,
+	SAS1078DE,
+	},
+	{
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_875J,
 	53c875J,
 	},
@@ -14808,4 +14824,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3101;
+const int pci_nproducts = 3105;



CVS commit: [netbsd-5] src/crypto/dist/openssl/ssl

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:20:11 UTC 2010

Modified Files:
src/crypto/dist/openssl/ssl [netbsd-5]: s3_pkt.c

Log Message:
Apply patch (requested by bouyer in ticket #1355):
Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
In TLS connections, certain incorrectly formatted records can cause an OpenSSL
client or server to crash due to a read attempt at NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.9.4.2 -r1.9.4.3 src/crypto/dist/openssl/ssl/s3_pkt.c

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

Modified files:

Index: src/crypto/dist/openssl/ssl/s3_pkt.c
diff -u src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.4.2 src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.4.3
--- src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.4.2	Tue Jan 12 09:07:51 2010
+++ src/crypto/dist/openssl/ssl/s3_pkt.c	Sun Mar 28 15:20:11 2010
@@ -313,9 +313,9 @@
 			if (version != s-version)
 {
 SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-/* Send back error using their
- * version number :-) */
-s-version=version;
+if ((s-version  0xFF00) == (version  0xFF00))
+	/* Send back error using their minor version number :-) */
+	s-version = (unsigned short)version;
 al=SSL_AD_PROTOCOL_VERSION;
 goto f_err;
 }



CVS commit: [netbsd-5-0] src/crypto/dist/openssl/ssl

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:22:01 UTC 2010

Modified Files:
src/crypto/dist/openssl/ssl [netbsd-5-0]: s3_pkt.c

Log Message:
Apply patch (requested by bouyer in ticket #1355):
Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
In TLS connections, certain incorrectly formatted records can cause an OpenSSL
client or server to crash due to a read attempt at NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.9.8.2 -r1.9.8.3 src/crypto/dist/openssl/ssl/s3_pkt.c

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

Modified files:

Index: src/crypto/dist/openssl/ssl/s3_pkt.c
diff -u src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.8.2 src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.8.3
--- src/crypto/dist/openssl/ssl/s3_pkt.c:1.9.8.2	Tue Jan 12 09:08:45 2010
+++ src/crypto/dist/openssl/ssl/s3_pkt.c	Sun Mar 28 15:22:01 2010
@@ -313,9 +313,9 @@
 			if (version != s-version)
 {
 SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-/* Send back error using their
- * version number :-) */
-s-version=version;
+if ((s-version  0xFF00) == (version  0xFF00))
+	/* Send back error using their minor version number :-) */
+	s-version = (unsigned short)version;
 al=SSL_AD_PROTOCOL_VERSION;
 goto f_err;
 }



CVS commit: [netbsd-5] src/sys/kern

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:32:00 UTC 2010

Modified Files:
src/sys/kern [netbsd-5]: uipc_syscalls.c

Log Message:
Apply patch (requested by jakllsch in ticket #1352):
In do_sys_recvmsg(), call free(9) with the same type malloc(9) used.


To generate a diff of this commit:
cvs rdiff -u -r1.134.4.2 -r1.134.4.3 src/sys/kern/uipc_syscalls.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/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.134.4.2 src/sys/kern/uipc_syscalls.c:1.134.4.3
--- src/sys/kern/uipc_syscalls.c:1.134.4.2	Sat Apr  4 23:36:28 2009
+++ src/sys/kern/uipc_syscalls.c	Sun Mar 28 15:32:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.134.4.2 2009/04/04 23:36:28 snj Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.134.4.3 2010/03/28 15:32:00 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.134.4.2 2009/04/04 23:36:28 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.134.4.3 2010/03/28 15:32:00 snj Exp $);
 
 #include opt_pipe.h
 
@@ -858,7 +858,7 @@
 	}
  out:
 	if (iov != aiov)
-		free(iov, M_TEMP);
+		free(iov, M_IOV);
 	fd_putfile(s);
 	return (error);
 }



CVS commit: [netbsd-5-0] src/sys/kern

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:32:40 UTC 2010

Modified Files:
src/sys/kern [netbsd-5-0]: uipc_syscalls.c

Log Message:
Apply patch (requested by jakllsch in ticket #1352):
In do_sys_recvmsg(), call free(9) with the same type malloc(9) used.


To generate a diff of this commit:
cvs rdiff -u -r1.134.4.2 -r1.134.4.2.2.1 src/sys/kern/uipc_syscalls.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/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.134.4.2 src/sys/kern/uipc_syscalls.c:1.134.4.2.2.1
--- src/sys/kern/uipc_syscalls.c:1.134.4.2	Sat Apr  4 23:36:28 2009
+++ src/sys/kern/uipc_syscalls.c	Sun Mar 28 15:32:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.134.4.2 2009/04/04 23:36:28 snj Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.134.4.2.2.1 2010/03/28 15:32:39 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.134.4.2 2009/04/04 23:36:28 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.134.4.2.2.1 2010/03/28 15:32:39 snj Exp $);
 
 #include opt_pipe.h
 
@@ -858,7 +858,7 @@
 	}
  out:
 	if (iov != aiov)
-		free(iov, M_TEMP);
+		free(iov, M_IOV);
 	fd_putfile(s);
 	return (error);
 }



CVS commit: [netbsd-5-0] src/doc

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:43:25 UTC 2010

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3

Log Message:
Tickets 1352 and 1355.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/doc/CHANGES-5.0.3

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

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.6 src/doc/CHANGES-5.0.3:1.1.2.7
--- src/doc/CHANGES-5.0.3:1.1.2.6	Sat Mar  6 23:21:18 2010
+++ src/doc/CHANGES-5.0.3	Sun Mar 28 15:43:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.6 2010/03/06 23:21:18 sborrill Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.7 2010/03/28 15:43:25 snj Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -158,3 +158,16 @@
 	Should fix PR#42881.
 	[joerg, ticket #1320]
 
+crypto/dist/openssl/ssl/s3_pkt.c		patch
+
+	Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
+	From http://www.openssl.org/news/secadv_20100324.txt:
+	In TLS connections, certain incorrectly formatted records can cause
+	an OpenSSL client or server to crash due to a read attempt at NULL.
+	[bouyer, ticket #1355]
+
+sys/kern/uipc_syscalls.c			patch
+
+	In do_sys_recvmsg(), call free(9) with the same type malloc(9) used.
+	[jakllsch, ticket #1352]
+



CVS commit: [netbsd-5] src/sys/dev/ic

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:21:18 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: ahcisata_core.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1317):
sys/dev/ic/ahcisata_core.c: revision 1.23, 1.24
Move ahci_channel_start() after BSY has cleared (what seems to matter
here is not touching SError while BSY is asserted). Fix random
behavior (serial console corruption/misfunction, misbehavior of USB
controllers, crasy interrupts crashing the Xen hypervisor, ...)
of Intel ESB2 controller with some brand of hitachi drives.
--
ahcisata_core.c 1.23 cause long drive probe (31s, reported by
Roy Marples), or other devices misbehavior probably due to interrupts issues
(reported by Jukka Ruohonen). Back it out and do the following changes:
- clear port interrupt register before ahci_channel_start() which enables
  interrupts
- wait 500ms after sata_reset_interface() before touching SERROR register.
  This is what seems to fix the issue I'm seeming on ESB2 controller.
- The 31s delay didn't cause the probe to fail because of a mismatch
  in loop index comparison; use a #define for delay after reset
  instead of numeric values, to avoid this kind of bugs in the
  future.


To generate a diff of this commit:
cvs rdiff -u -r1.18.4.3 -r1.18.4.4 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.18.4.3 src/sys/dev/ic/ahcisata_core.c:1.18.4.4
--- src/sys/dev/ic/ahcisata_core.c:1.18.4.3	Sun Mar  7 08:52:21 2010
+++ src/sys/dev/ic/ahcisata_core.c	Sun Mar 28 16:21:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.18.4.3 2010/03/07 08:52:21 sborrill Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.18.4.4 2010/03/28 16:21:18 snj Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.18.4.3 2010/03/07 08:52:21 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.18.4.4 2010/03/28 16:21:18 snj Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -102,6 +102,8 @@
 #endif /* NATAPIBUS */
 
 #define ATA_DELAY 1 /* 10s for a drive I/O */
+#define ATA_RESET_DELAY 31000 /* 31s for a drive reset */
+#define AHCI_RST_WAIT (ATA_RESET_DELAY / 10)
 
 const struct ata_bustype ahci_ata_bustype = {
 	SCSIPI_BUSTYPE_ATA,
@@ -510,16 +512,20 @@
 		chp-ch_queue-active_xfer-c_kill_xfer(chp,
 		chp-ch_queue-active_xfer, KILL_RESET);
 	}
+	tsleep(sc, PRIBIO, ahcirst, mstohz(500));
+	/* clear port interrupt register */
+	AHCI_WRITE(sc, AHCI_P_IS(chp-ch_channel), 0x);
+	/* clear SErrors and start operations */
 	ahci_channel_start(sc, chp);
 	/* wait 31s for BSY to clear */
-	for (i = 0; i 3100; i++) {
+	for (i = 0; i AHCI_RST_WAIT; i++) {
 		tfd = AHCI_READ(sc, AHCI_P_TFD(chp-ch_channel));
 		if tfd  AHCI_P_TFD_ST)  AHCI_P_TFD_ST_SHIFT)
 		 WDCS_BSY) == 0)
 			break;
 		tsleep(sc, PRIBIO, ahcid2h, mstohz(10));
 	}
-	if (i == 1500)
+	if (i == AHCI_RST_WAIT)
 		aprint_error(%s: BSY never cleared, TD 0x%x\n,
 		AHCINAME(sc), tfd);
 	AHCIDEBUG_PRINT((%s: BSY took %d ms\n, AHCINAME(sc), i * 10),
@@ -570,19 +576,24 @@
 	switch (sata_reset_interface(chp, sc-sc_ahcit, achp-ahcic_scontrol,
 	achp-ahcic_sstatus)) {
 	case SStatus_DET_DEV:
+		tsleep(sc, PRIBIO, ahcidv, mstohz(500));
+		/* clear port interrupt register */
+		AHCI_WRITE(sc, AHCI_P_IS(chp-ch_channel), 0x);
 		/* clear SErrors and start operations */
 		ahci_channel_start(sc, chp);
 		/* wait 31s for BSY to clear */
-		for (i = 0; i 3100; i++) {
+		for (i = 0; i AHCI_RST_WAIT; i++) {
 			sig = AHCI_READ(sc, AHCI_P_TFD(chp-ch_channel));
 			if sig  AHCI_P_TFD_ST)  AHCI_P_TFD_ST_SHIFT)
 			 WDCS_BSY) == 0)
 break;
 			tsleep(sc, PRIBIO, ahcid2h, mstohz(10));
 		}
-		if (i == 1500)
+		if (i == AHCI_RST_WAIT) {
 			aprint_error(%s: BSY never cleared, TD 0x%x\n,
 			AHCINAME(sc), sig);
+			return;
+		}
 		AHCIDEBUG_PRINT((%s: BSY took %d ms\n, AHCINAME(sc), i * 10),
 		DEBUG_PROBE);
 		sig = AHCI_READ(sc, AHCI_P_SIG(chp-ch_channel));
@@ -599,7 +610,9 @@
 		} else
 			chp-ch_drive[0].drive_flags |= DRIVE_ATA;
 		splx(s);
-		/* enable interrupts */
+		/* clear port interrupt register */
+		AHCI_WRITE(sc, AHCI_P_IS(chp-ch_channel), 0x);
+		/* and enable interrupts */
 		AHCI_WRITE(sc, AHCI_P_IE(chp-ch_channel),
 		AHCI_P_IX_TFES | AHCI_P_IX_HBFS | AHCI_P_IX_IFS |
 		AHCI_P_IX_OFS | AHCI_P_IX_DPS | AHCI_P_IX_UFS |



CVS commit: [netbsd-5] src/crypto/dist/ipsec-tools/src/racoon

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:36:57 UTC 2010

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon [netbsd-5]: handler.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1341):
crypto/dist/ipsec-tools/src/racoon/handler.c: revision 1.31, 1.32
PR/42363: Yasuoka Masahiko:

racoon uses a wrong IPsec-SA handle that is for other peer in case it
receives a ISAKMP message for IPsec-SA that has the same message-id as
the message-id that is received before.

racoon uses message-id to find the handle of IPsec-SA.  The message-id
is a unique number for each peer, but different peers may use the same
value.

Different Windows Vista or Windows 7 peers seem to use the same
message-id.  racoon can handle the first Windows's Phase-2, but it
cannot handle the second Windows.  Because racoon misunderstands the
message for the second Windows as the message for the first Windows.
--
PR/42363: Yasuoka Masahiko: Second part of the patch: iterate only on the
phase2 handles that are bound by the given phase1 handle.


To generate a diff of this commit:
cvs rdiff -u -r1.21.4.1 -r1.21.4.2 \
src/crypto/dist/ipsec-tools/src/racoon/handler.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/handler.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/handler.c:1.21.4.1 src/crypto/dist/ipsec-tools/src/racoon/handler.c:1.21.4.2
--- src/crypto/dist/ipsec-tools/src/racoon/handler.c:1.21.4.1	Sun Feb  8 18:42:16 2009
+++ src/crypto/dist/ipsec-tools/src/racoon/handler.c	Sun Mar 28 16:36:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: handler.c,v 1.21.4.1 2009/02/08 18:42:16 snj Exp $	*/
+/*	$NetBSD: handler.c,v 1.21.4.2 2010/03/28 16:36:57 snj Exp $	*/
 
 /* Id: handler.c,v 1.28 2006/05/26 12:17:29 manubsd Exp */
 
@@ -478,7 +478,7 @@
 {
 	struct ph2handle *p;
 
-	LIST_FOREACH(p, ph2tree, chain) {
+	LIST_FOREACH(p, iph1-ph2tree, ph1bind) {
 		if (p-msgid == msgid)
 			return p;
 	}



CVS commit: [netbsd-5] src/sys/external/bsd/drm/dist/bsd-core

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:44:23 UTC 2010

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core [netbsd-5]: drm_pci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1346):
sys/external/bsd/drm/dist/bsd-core/drm_pci.c: revision 1.8
fix some confusion between highest DMA address and the boundary not to
be crossed in a transfer,
back out previous fixes which only added to the confusion


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.1 -r1.4.10.2 \
src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c

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

Modified files:

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.1 src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.2
--- src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.1	Sat Jun 20 23:36:59 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c	Sun Mar 28 16:44:23 2010
@@ -110,9 +110,10 @@
 		return NULL;
 	}
 #elif   defined(__NetBSD__)
-	dmah-tag = dev-pa.pa_dmat;
+	KASSERT(maxaddr = 0xUL); /* no way to tell bus_dma_alloc */
+	dmah-tag = dev-pa.pa_dmat; /* use 32-bit DMA tag */
 
-	if ((ret = bus_dmamem_alloc(dmah-tag, size, align, maxaddr,
+	if ((ret = bus_dmamem_alloc(dmah-tag, size, align, 0,
 	dmah-segs, 1, nsegs, BUS_DMA_WAITOK)) != 0) {
 		printf(drm: Unable to allocate %zu bytes of DMA, error %d\n,
 		size, ret);



CVS commit: [netbsd-5] src/sys/external/bsd/drm/dist/bsd-core

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:45:21 UTC 2010

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core [netbsd-5]: drm_pci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1346):
sys/external/bsd/drm/dist/bsd-core/drm_pci.c: revision 1.9
don't pass maxaddr as a boundary in bus_dmamap_create() like rev 1.8
did for _alloc().


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.2 -r1.4.10.3 \
src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c

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

Modified files:

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.2 src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.3
--- src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4.10.2	Sun Mar 28 16:44:23 2010
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c	Sun Mar 28 16:45:21 2010
@@ -137,7 +137,7 @@
 		free(dmah, DRM_MEM_DMA);
 		return NULL;
 	}
-	if ((ret = bus_dmamap_create(dmah-tag, size, 1, size, maxaddr,
+	if ((ret = bus_dmamap_create(dmah-tag, size, 1, size, 0,
 	 BUS_DMA_NOWAIT, dmah-map)) != 0) {
 		printf(drm: Unable to create DMA map, error %d\n, ret);
 		bus_dmamem_unmap(dmah-tag, dmah-vaddr, size);



CVS commit: [netbsd-5] src/sys/arch/sparc64/dev

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:48:36 UTC 2010

Modified Files:
src/sys/arch/sparc64/dev [netbsd-5]: lom.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1349):
sys/arch/sparc64/dev/lom.c: revision 1.6
Fix off-by-one in LOMlite hostname code.  From rev 1.21 of OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/sparc64/dev/lom.c

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

Modified files:

Index: src/sys/arch/sparc64/dev/lom.c
diff -u src/sys/arch/sparc64/dev/lom.c:1.1.2.5 src/sys/arch/sparc64/dev/lom.c:1.1.2.6
--- src/sys/arch/sparc64/dev/lom.c:1.1.2.5	Sat Jan  9 01:30:13 2010
+++ src/sys/arch/sparc64/dev/lom.c	Sun Mar 28 16:48:36 2010
@@ -1,5 +1,5 @@
-/*	$NetBSD: lom.c,v 1.1.2.5 2010/01/09 01:30:13 snj Exp $	*/
-/*	$OpenBSD: lom.c,v 1.20 2009/12/12 13:01:00 kettenis Exp $	*/
+/*	$NetBSD: lom.c,v 1.1.2.6 2010/03/28 16:48:36 snj Exp $	*/
+/*	$OpenBSD: lom.c,v 1.21 2010/02/28 20:44:39 kettenis Exp $	*/
 /*
  * Copyright (c) 2009 Mark Kettenis
  *
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lom.c,v 1.1.2.5 2010/01/09 01:30:13 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: lom.c,v 1.1.2.6 2010/03/28 16:48:36 snj Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -1035,7 +1035,7 @@
 static void
 lom1_write_hostname(struct lom_softc *sc)
 {
-	char name[LOM1_IDX_HOSTNAME12 - LOM1_IDX_HOSTNAME1 + 1];
+	char name[(LOM1_IDX_HOSTNAME12 - LOM1_IDX_HOSTNAME1 + 1) + 1];
 	char *p;
 	int i;
 
@@ -1045,7 +1045,7 @@
 	 * strip off the domain name.
 	 */
 	strlcpy(name, hostname, sizeof(name));
-	if (hostnamelen  sizeof(name)) {
+	if (hostnamelen = sizeof(name)) {
 		p = strchr(name, '.');
 		if (p)
 			*p = '\0';



CVS commit: [netbsd-5] src/bin/pax

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 16:52:46 UTC 2010

Modified Files:
src/bin/pax [netbsd-5]: tar.1

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1354):
bin/pax/tar.1: revision 1.28, 1.29
The -X option of tar names a file containing exception globs, not
exception filenames, same as in gtar. PR 41168 from Perry.
--
bump date for previous


To generate a diff of this commit:
cvs rdiff -u -r1.26.12.1 -r1.26.12.2 src/bin/pax/tar.1

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

Modified files:

Index: src/bin/pax/tar.1
diff -u src/bin/pax/tar.1:1.26.12.1 src/bin/pax/tar.1:1.26.12.2
--- src/bin/pax/tar.1:1.26.12.1	Sun Nov 23 21:25:01 2008
+++ src/bin/pax/tar.1	Sun Mar 28 16:52:46 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: tar.1,v 1.26.12.1 2008/11/23 21:25:01 riz Exp $
+.\ $NetBSD: tar.1,v 1.26.12.2 2010/03/28 16:52:46 snj Exp $
 .\
 .\ Copyright (c) 1996 SigmaSoft, Th. Lockert
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\
 .\	OpenBSD: tar.1,v 1.28 2000/11/09 23:58:56 aaron Exp
 .\
-.Dd May 4, 2007
+.Dd March 23, 2010
 .Dt TAR 1
 .Os
 .Sh NAME
@@ -249,7 +249,7 @@
 A line may also specify the positional argument
 .Dq Fl C Ar directory .
 .It Fl X Ar file , Fl -exclude-from Ar file
-Exclude files listed in the given file.
+Exclude files matching the shell glob patterns listed in the given file.
 .\ exclude should be '-E' and '-X' should be one-file-system
 .Pp
 Note that it would be more standard to use this option to mean ``do not



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:07:26 UTC 2010

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: if_xennet.c

Log Message:
Apply patch (requested by bad in ticket #1347):
Make it possible to use netbsd-5 domUs running on a Xen2 hypervisor.
This changes two panics to printfs.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.60.2.1 src/sys/arch/xen/xen/if_xennet.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/if_xennet.c
diff -u src/sys/arch/xen/xen/if_xennet.c:1.60 src/sys/arch/xen/xen/if_xennet.c:1.60.2.1
--- src/sys/arch/xen/xen/if_xennet.c:1.60	Mon Oct 27 10:58:22 2008
+++ src/sys/arch/xen/xen/if_xennet.c	Sun Mar 28 17:07:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_xennet.c,v 1.60 2008/10/27 10:58:22 cegger Exp $	*/
+/*	$NetBSD: if_xennet.c,v 1.60.2.1 2010/03/28 17:07:26 snj Exp $	*/
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_xennet.c,v 1.60 2008/10/27 10:58:22 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_xennet.c,v 1.60.2.1 2010/03/28 17:07:26 snj Exp $);
 
 #include opt_inet.h
 #include opt_nfs_boot.h
@@ -657,8 +657,10 @@
 	(void)HYPERVISOR_multicall(rx_mcl, nr_pfns+1);
 
 	/* Check return status of HYPERVISOR_dom_mem_op(). */
-	if ( rx_mcl[nr_pfns].args[5] != nr_pfns )
-		panic(Unable to reduce memory reservation\n);
+	if ( rx_mcl[nr_pfns].args[5] != nr_pfns ) {
+		printf(xennet_rx_push_buffer: unable to reduce memory 
+		reservation (%lu != %d)\n, rx_mcl[nr_pfns].args[5], nr_pfns);
+	}
 
 	/* Above is a suitable barrier to ensure backend will see requests. */
 	sc-sc_rx-req_prod = ringidx;
@@ -994,8 +996,10 @@
 	(void)HYPERVISOR_multicall(rx_mcl, nr_pfns+1);
 
 	/* Check return status of HYPERVISOR_dom_mem_op(). */
-	if (rx_mcl[nr_pfns].args[5] != nr_pfns)
-		panic(Unable to reduce memory reservation\n);
+	if (rx_mcl[nr_pfns].args[5] != nr_pfns) {
+		printf(xennet_alloc_rx_buffers: unable to reduce memory 
+		reservation (%lu != %d)\n, rx_mcl[nr_pfns].args[5], nr_pfns);
+	}
 
 	/* Above is a suitable barrier to ensure backend will see requests. */
 	sc-sc_rx-req_prod = ringidx;



CVS commit: [netbsd-5] src/sys/dev

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:25:12 UTC 2010

Modified Files:
src/sys/dev [netbsd-5]: fss.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/dev/fss.c: revision 1.64
Fix a race where the backing store thread runs (and exits immediately)
before kthread_create() returns.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.1 -r1.60.4.2 src/sys/dev/fss.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/fss.c
diff -u src/sys/dev/fss.c:1.60.4.1 src/sys/dev/fss.c:1.60.4.2
--- src/sys/dev/fss.c:1.60.4.1	Fri Nov  7 23:32:19 2008
+++ src/sys/dev/fss.c	Sun Mar 28 17:25:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.60.4.1 2008/11/07 23:32:19 snj Exp $	*/
+/*	$NetBSD: fss.c,v 1.60.4.2 2010/03/28 17:25:12 snj Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.1 2008/11/07 23:32:19 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.2 2010/03/28 17:25:12 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -446,11 +446,12 @@
 		sc-sc_indir_data = NULL;
 	}
 
+	sc-sc_flags |= FSS_BS_THREAD;
 	if ((error = kthread_create(PRI_BIO, 0, NULL, fss_bs_thread, sc,
-	sc-sc_bs_lwp, device_xname(sc-sc_dev))) != 0)
+	sc-sc_bs_lwp, device_xname(sc-sc_dev))) != 0) {
+		sc-sc_flags = ~FSS_BS_THREAD;
 		return error;
-
-	sc-sc_flags |= FSS_BS_THREAD;
+	}
 
 	disk_attach(sc-sc_dkdev);
 



CVS commit: [netbsd-5] src/sys/dev

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:26:26 UTC 2010

Modified Files:
src/sys/dev [netbsd-5]: fss.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/dev/fss.c: revision 1.65
Remove unneeded vinvalbuf() on backing store as we don't use
VOP_BMAP()/VOP_STRATEGY() here.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.2 -r1.60.4.3 src/sys/dev/fss.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/fss.c
diff -u src/sys/dev/fss.c:1.60.4.2 src/sys/dev/fss.c:1.60.4.3
--- src/sys/dev/fss.c:1.60.4.2	Sun Mar 28 17:25:12 2010
+++ src/sys/dev/fss.c	Sun Mar 28 17:26:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.60.4.2 2010/03/28 17:25:12 snj Exp $	*/
+/*	$NetBSD: fss.c,v 1.60.4.3 2010/03/28 17:26:26 snj Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.2 2010/03/28 17:25:12 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.3 2010/03/28 17:26:26 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -696,14 +696,6 @@
 		sc-sc_bs_bmask = FSS_FSBSIZE(sc)-1;
 	}
 
-	/*
-	 * As all IO to from/to the backing store goes through
-	 * VOP_STRATEGY() clean the buffer cache to prevent
-	 * cache incoherencies.
-	 */
-	if ((error = vinvalbuf(sc-sc_bs_vp, V_SAVE, l-l_cred, l, 0, 0)) != 0)
-		return error;
-
 	return 0;
 }
 



CVS commit: [netbsd-5] src/sys/ufs/ffs

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:27:30 UTC 2010

Modified Files:
src/sys/ufs/ffs [netbsd-5]: ffs_snapshot.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/ufs/ffs/ffs_snapshot.c: revision 1.96
Fix a deadlock where fscow_disestablish() blocks because outstanding
copy-on-write operations wait for si_snaplock.


To generate a diff of this commit:
cvs rdiff -u -r1.82.4.1 -r1.82.4.2 src/sys/ufs/ffs/ffs_snapshot.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/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.1 src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.2
--- src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.1	Wed Dec 10 21:49:31 2008
+++ src/sys/ufs/ffs/ffs_snapshot.c	Sun Mar 28 17:27:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.82.4.1 2008/12/10 21:49:31 snj Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.82.4.2 2010/03/28 17:27:29 snj Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.82.4.1 2008/12/10 21:49:31 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.82.4.2 2010/03/28 17:27:29 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1314,7 +1314,6 @@
 	int error, loc, last;
 
 	si = VFSTOUFS(mp)-um_snapinfo;
-	mutex_enter(si-si_snaplock);
 	/*
 	 * If active, delete from incore list (this snapshot may
 	 * already have been in the process of being deleted, so
@@ -1330,21 +1329,19 @@
 			/* Roll back the list of preallocated blocks. */
 			xp = TAILQ_LAST(si-si_snapshots, inodelst);
 			si-si_snapblklist = xp-i_snapblklist;
+			si-si_gen++;
+			mutex_exit(si-si_lock);
 		} else {
 			si-si_snapblklist = 0;
 			si-si_gen++;
 			mutex_exit(si-si_lock);
 			fscow_disestablish(mp, ffs_copyonwrite, devvp);
-			mutex_enter(si-si_lock);
 		}
-		si-si_gen++;
-		mutex_exit(si-si_lock);
 		if (ip-i_snapblklist != NULL) {
 			free(ip-i_snapblklist, M_UFSMNT);
 			ip-i_snapblklist = NULL;
 		}
 	}
-	mutex_exit(si-si_snaplock);
 	/*
 	 * Clear all BLK_NOCOPY fields. Pass any block claims to other
 	 * snapshots that want them (see ffs_snapblkfree below).
@@ -1738,10 +1735,10 @@
 			mutex_enter(si-si_lock);
 		}
 	}
-	if (vp)
-		fscow_disestablish(mp, ffs_copyonwrite, devvp);
 	si-si_gen++;
 	mutex_exit(si-si_lock);
+	if (vp)
+		fscow_disestablish(mp, ffs_copyonwrite, devvp);
 }
 
 /*



CVS commit: [netbsd-5] src/sys/ufs/ffs

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:28:34 UTC 2010

Modified Files:
src/sys/ufs/ffs [netbsd-5]: ffs_snapshot.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/ufs/ffs/ffs_snapshot.c: revision 1.97
No longer abuse TAILQ internal data.


To generate a diff of this commit:
cvs rdiff -u -r1.82.4.2 -r1.82.4.3 src/sys/ufs/ffs/ffs_snapshot.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/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.2 src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.3
--- src/sys/ufs/ffs/ffs_snapshot.c:1.82.4.2	Sun Mar 28 17:27:29 2010
+++ src/sys/ufs/ffs/ffs_snapshot.c	Sun Mar 28 17:28:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.82.4.2 2010/03/28 17:27:29 snj Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.82.4.3 2010/03/28 17:28:33 snj Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.82.4.2 2010/03/28 17:27:29 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.82.4.3 2010/03/28 17:28:33 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -76,6 +76,14 @@
 
 #include uvm/uvm.h
 
+struct snap_info {
+	kmutex_t si_lock;			/* Lock this snapinfo */
+	kmutex_t si_snaplock;			/* Snapshot vnode common lock */
+	TAILQ_HEAD(inodelst, inode) si_snapshots; /* List of active snapshots */
+	daddr_t *si_snapblklist;		/* Snapshot block hints list */
+	uint32_t si_gen;			/* Incremented on change */
+};
+
 #if !defined(FFS_NO_SNAPSHOT)
 typedef int (*acctfunc_t)
 (struct vnode *, void *, int, int, struct fs *, daddr_t, int);
@@ -107,6 +115,7 @@
 static int syncsnap(struct vnode *);
 static int wrsnapblk(struct vnode *, void *, daddr_t);
 
+static inline bool is_active_snapshot(struct snap_info *, struct inode *);
 static inline daddr_t db_get(struct inode *, int);
 static inline void db_assign(struct inode *, int, daddr_t);
 static inline daddr_t ib_get(struct inode *, int);
@@ -114,14 +123,6 @@
 static inline daddr_t idb_get(struct inode *, void *, int);
 static inline void idb_assign(struct inode *, void *, int, daddr_t);
 
-struct snap_info {
-	kmutex_t si_lock;			/* Lock this snapinfo */
-	kmutex_t si_snaplock;			/* Snapshot vnode common lock */
-	TAILQ_HEAD(inodelst, inode) si_snapshots; /* List of active snapshots */
-	daddr_t *si_snapblklist;		/* Snapshot block hints list */
-	uint32_t si_gen;			/* Incremented on change */
-};
-
 #ifdef DEBUG
 static int snapdebug = 0;
 #endif
@@ -277,7 +278,7 @@
 	fs-fs_snapinum[snaploc] = ip-i_number;
 
 	mutex_enter(si-si_lock);
-	if (ip-i_nextsnap.tqe_prev != 0)
+	if (is_active_snapshot(si, ip))
 		panic(ffs_snapshot: %PRIu64 already on list, ip-i_number);
 	TAILQ_INSERT_TAIL(si-si_snapshots, ip, i_nextsnap);
 	if (TAILQ_FIRST(si-si_snapshots) == ip) {
@@ -1321,10 +1322,9 @@
 	 *
 	 * Clear copy-on-write flag if last snapshot.
 	 */
-	if (ip-i_nextsnap.tqe_prev != 0) {
-		mutex_enter(si-si_lock);
+	mutex_enter(si-si_lock);
+	if (is_active_snapshot(si, ip)) {
 		TAILQ_REMOVE(si-si_snapshots, ip, i_nextsnap);
-		ip-i_nextsnap.tqe_prev = 0;
 		if (TAILQ_FIRST(si-si_snapshots) != 0) {
 			/* Roll back the list of preallocated blocks. */
 			xp = TAILQ_LAST(si-si_snapshots, inodelst);
@@ -1341,7 +1341,8 @@
 			free(ip-i_snapblklist, M_UFSMNT);
 			ip-i_snapblklist = NULL;
 		}
-	}
+	} else
+		mutex_exit(si-si_lock);
 	/*
 	 * Clear all BLK_NOCOPY fields. Pass any block claims to other
 	 * snapshots that want them (see ffs_snapblkfree below).
@@ -1681,9 +1682,9 @@
 		/*
 		 * Link it onto the active snapshot list.
 		 */
-		if (ip-i_nextsnap.tqe_prev != 0)
-			panic(ffs_snapshot_mount: %llu already on list,
-			(unsigned long long)ip-i_number);
+		if (is_active_snapshot(si, ip))
+			panic(ffs_snapshot_mount: %PRIu64 already on list,
+			ip-i_number);
 		else
 			TAILQ_INSERT_TAIL(si-si_snapshots, ip, i_nextsnap);
 		vp-v_vflag |= VV_SYSTEM;
@@ -1724,7 +1725,6 @@
 		vp = ITOV(xp);
 		vp-v_vnlock = vp-v_lock;
 		TAILQ_REMOVE(si-si_snapshots, xp, i_nextsnap);
-		xp-i_nextsnap.tqe_prev = 0;
 		if (xp-i_snapblklist == si-si_snapblklist)
 			si-si_snapblklist = NULL;
 		FREE(xp-i_snapblklist, M_UFSMNT);
@@ -2125,6 +2125,23 @@
 }
 
 /*
+ * Check if this inode is present on the active snapshot list.
+ * Must be called with snapinfo locked.
+ */
+static inline bool
+is_active_snapshot(struct snap_info *si, struct inode *ip)
+{
+	struct inode *xp;
+
+	KASSERT(mutex_owned(si-si_lock));
+
+	TAILQ_FOREACH(xp, si-si_snapshots, i_nextsnap)
+		if (xp == ip)
+			return true;
+	return false;
+}
+
+/*
  * Get/Put direct block from inode or buffer containing disk addresses. Take
  * care for fs type (UFS1/UFS2) and byte swapping. These functions should go
  * into a global include.



CVS commit: [netbsd-5] src/sys/ufs/ufs

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:29:41 UTC 2010

Modified Files:
src/sys/ufs/ufs [netbsd-5]: ufs_inode.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/ufs/ufs/ufs_inode.c: revision 1.80
Allow ufs_inactive() while a file system is suspending.  Removes a possible
deadlock between vrele() and ffs_sync() during suspension.


To generate a diff of this commit:
cvs rdiff -u -r1.76.4.2 -r1.76.4.3 src/sys/ufs/ufs/ufs_inode.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/ufs/ufs/ufs_inode.c
diff -u src/sys/ufs/ufs/ufs_inode.c:1.76.4.2 src/sys/ufs/ufs/ufs_inode.c:1.76.4.3
--- src/sys/ufs/ufs/ufs_inode.c:1.76.4.2	Mon Feb 22 04:43:47 2010
+++ src/sys/ufs/ufs/ufs_inode.c	Sun Mar 28 17:29:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_inode.c,v 1.76.4.2 2010/02/22 04:43:47 snj Exp $	*/
+/*	$NetBSD: ufs_inode.c,v 1.76.4.3 2010/03/28 17:29:41 snj Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ufs_inode.c,v 1.76.4.2 2010/02/22 04:43:47 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ufs_inode.c,v 1.76.4.3 2010/03/28 17:29:41 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -92,7 +92,7 @@
 	UFS_WAPBL_JUNLOCK_ASSERT(vp-v_mount);
 
 	transmp = vp-v_mount;
-	fstrans_start(transmp, FSTRANS_SHARED);
+	fstrans_start(transmp, FSTRANS_LAZY);
 	/*
 	 * Ignore inodes related to stale file handles.
 	 */



CVS commit: [netbsd-5] src/sys/ufs/ufs

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:31:55 UTC 2010

Modified Files:
src/sys/ufs/ufs [netbsd-5]: ufs_vnops.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1345):
sys/ufs/ufs/ufs_vnops.c: revision 1.180 via patch
ufs_rmdir(): move fstrans_done() after vput().  No more unlinked and
zero-sized directory inodes in snapshots.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.169.4.1 src/sys/ufs/ufs/ufs_vnops.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/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.169 src/sys/ufs/ufs/ufs_vnops.c:1.169.4.1
--- src/sys/ufs/ufs/ufs_vnops.c:1.169	Thu Aug 14 16:19:25 2008
+++ src/sys/ufs/ufs/ufs_vnops.c	Sun Mar 28 17:31:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.169 2008/08/14 16:19:25 matt Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.169.4.1 2010/03/28 17:31:55 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ufs_vnops.c,v 1.169 2008/08/14 16:19:25 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ufs_vnops.c,v 1.169.4.1 2010/03/28 17:31:55 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1683,7 +1683,6 @@
 #endif
  out:
 	VN_KNOTE(vp, NOTE_DELETE);
-	fstrans_done(dvp-v_mount);
 	pace = DOINGSOFTDEP(dvp);
 	vput(dvp);
 	vput(vp);
@@ -1694,6 +1693,7 @@
 		 */
 		softdep_pace_dirrem();
 	}
+	fstrans_done(dvp-v_mount);
 	return (error);
 }
 



CVS commit: [netbsd-5] src/doc

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 17:50:07 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.1

Log Message:
Tickets 1317, 1326, 1341, 1345, 1346, 1347, 1349, 1352, 1354, 1355.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.219 -r1.1.2.220 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.219 src/doc/CHANGES-5.1:1.1.2.220
--- src/doc/CHANGES-5.1:1.1.2.219	Sun Mar 21 03:46:42 2010
+++ src/doc/CHANGES-5.1	Sun Mar 28 17:50:07 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.219 2010/03/21 03:46:42 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.220 2010/03/28 17:50:07 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -17024,3 +17024,101 @@
 	usable in arbitrary expressions.  Fixes PR/41890.
 	[joerg, ticket #1344]
 
+sys/dev/ic/mfi.c1.20, 1.23, 1.26, 1.30, 1.33 via patch
+sys/dev/ic/mfireg.h1.4
+sys/dev/ic/mfivar.h1.12, 1.14
+sys/dev/pci/mfi_pci.c1.6-1.8, 1.10, 1.12
+sys/dev/pci/pcidevs1.1020
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+share/man/man4/mfi.41.9-1.10
+
+	Add support for MFI gen2 devices.  Mention newer devices, RAID 6 and
+	RAID60 in mfi.4.
+	[msaitoh, ticket #1326]
+
+crypto/dist/openssl/ssl/s3_pkt.c		patch
+
+	Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
+	From http://www.openssl.org/news/secadv_20100324.txt:
+	In TLS connections, certain incorrectly formatted records can cause
+	an OpenSSL client or server to crash due to a read attempt at NULL.
+	[bouyer, ticket #1355]
+
+sys/kern/uipc_syscalls.c			patch
+
+	In do_sys_recvmsg(), call free(9) with the same type malloc(9) used.
+	[jakllsch, ticket #1352]
+ 
+sys/dev/ic/ahcisata_core.c			1.23, 1.24
+
+	- Clear port interrupt register before ahci_channel_start() which
+	  enables interrupts
+	- Wait 500ms after sata_reset_interface() before touching SERROR
+	  register.  This is what seems to fix the issue I'm seeming on ESB2
+	  controller.
+	- The 31s delay didn't cause the probe to fail because of a mismatch
+	  in loop index comparison; use a #define for delay after reset
+	  instead of numeric values, to avoid this kind of bugs in the
+	  future.
+	[bouyer, ticket #1317]
+
+crypto/dist/ipsec-tools/src/racoon/handler.c	1.31, 1.32 via patch
+
+	Fix a bug where racoon used a wrong IPsec-SA handle that was for
+	another peer if it received an ISAKMP message for IPsec-SA that has
+	the same message-id as the message-id that was received before.
+	[hubertf, ticket #1341]
+
+sys/external/bsd/drm/dist/bsd-core/drm_pci.c	1.8, 1.9
+
+	Fix some confusion between highest DMA address and the boundary not
+	to be crossed in a transfer.  Back out previous fixes which only
+	added to the confusion.
+	--
+	Don't pass maxaddr as a boundary in bus_dmamap_create() like rev
+	1.8 did for _alloc().
+	[mrg, ticket #1346]
+
+sys/arch/sparc64/dev/lom.c			1.6
+
+	Fix off-by-one in LOMlite hostname code.
+	[nakayama, ticket #1349]
+
+bin/pax/tar.1	1.28, 1.29
+
+	Document that the -X option of tar names a file containing exception
+	globs, not exception filenames, same as in gtar. Fixes PR bin/41168.
+	[dholland, ticket #1354]
+
+sys/arch/xen/xen/if_xennet.c			patch
+
+	Make it possible to use netbsd-5 domUs running on a Xen2 hypervisor.
+	This changes two panics to printfs.
+	[bad, ticket #1347]
+
+sys/dev/fss.c	1.64, 1.65
+sys/ufs/ffs/ffs_snapshot.c			1.96, 1.97
+sys/ufs/ufs/ufs_inode.c1.80
+sys/ufs/ufs/ufs_vnops.c1.180 via patch
+
+	sys/dev/fss.c:
+	- Fix a race where the backing store thread runs (and exits
+	  immediately) before kthread_create() returns.
+	- Remove unneeded vinvalbuf() on backing store as we don't use
+	  VOP_BMAP()/VOP_STRATEGY() here.
+
+	sys/ufs/ffs/ffs_snapshot.c:
+	- Fix a deadlock where fscow_disestablish() blocks because outstanding
+	  copy-on-write operations wait for si_snaplock.
+	- No longer abuse TAILQ internal data.
+
+	sys/ufs/ufs/ufs_inode.c:
+	- Allow ufs_inactive() while a file system is suspending.  Removes a
+	  possible deadlock between vrele() and ffs_sync() during suspension.
+
+	sys/ufs/ufs/ufs_vnops.c:
+	- ufs_rmdir(): move fstrans_done() after vput().  No more unlinked
+	  and zero-sized directory inodes in snapshots.
+	[hannken, ticket #1345]
+



CVS commit: src/lib/libc/locale

2010-03-28 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sun Mar 28 18:19:52 UTC 2010

Modified Files:
src/lib/libc/locale: setlocale32.c

Log Message:
woops, fogot to include limits.h.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/setlocale32.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/locale/setlocale32.c
diff -u src/lib/libc/locale/setlocale32.c:1.3 src/lib/libc/locale/setlocale32.c:1.4
--- src/lib/libc/locale/setlocale32.c:1.3	Sun Mar 28 14:05:09 2010
+++ src/lib/libc/locale/setlocale32.c	Sun Mar 28 18:19:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: setlocale32.c,v 1.3 2010/03/28 14:05:09 tnozaki Exp $	*/
+/*	$NetBSD: setlocale32.c,v 1.4 2010/03/28 18:19:52 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -28,12 +28,13 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: setlocale32.c,v 1.3 2010/03/28 14:05:09 tnozaki Exp $);
+__RCSID($NetBSD: setlocale32.c,v 1.4 2010/03/28 18:19:52 tnozaki Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
 #define __SETLOCALE_SOURCE__
 #include locale.h
+#include limits.h
 #include rune.h
 
 char *



CVS commit: [netbsd-4] src/bin/pax

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 18:37:36 UTC 2010

Modified Files:
src/bin/pax [netbsd-4]: tar.1

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1391):
bin/pax/tar.1: revision 1.28, 1.29 via patch
The -X option of tar names a file containing exception globs, not
exception filenames, same as in gtar. PR 41168 from Perry.
--
bump date for previous


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.4.1 src/bin/pax/tar.1

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

Modified files:

Index: src/bin/pax/tar.1
diff -u src/bin/pax/tar.1:1.22 src/bin/pax/tar.1:1.22.4.1
--- src/bin/pax/tar.1:1.22	Tue May 24 00:05:01 2005
+++ src/bin/pax/tar.1	Sun Mar 28 18:37:36 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: tar.1,v 1.22 2005/05/24 00:05:01 wiz Exp $
+.\ $NetBSD: tar.1,v 1.22.4.1 2010/03/28 18:37:36 snj Exp $
 .\
 .\ Copyright (c) 1996 SigmaSoft, Th. Lockert
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\
 .\	OpenBSD: tar.1,v 1.28 2000/11/09 23:58:56 aaron Exp
 .\
-.Dd May 7, 2005
+.Dd March 23, 2010
 .Dt TAR 1
 .Os
 .Sh NAME
@@ -228,7 +228,7 @@
 A line may also specify the positional argument
 .Dq Fl C Ar directory .
 .It Fl X Ar file , Fl -exclude-from Ar file
-Exclude files listed in the given file.
+Exclude files matching the shell glob patterns listed in the given file.
 .It Fl Z , -compress , -uncompress
 Compress archive using compress.
 .It Fl -strict



CVS commit: [netbsd-4] src/crypto/dist/openssl/ssl

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 18:44:13 UTC 2010

Modified Files:
src/crypto/dist/openssl/ssl [netbsd-4]: s3_pkt.c

Log Message:
Apply patch (requested by bouyer in ticket #1392):
Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
In TLS connections, certain incorrectly formatted records can cause an OpenSSL
client or server to crash due to a read attempt at NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.6.4.3 -r1.6.4.4 src/crypto/dist/openssl/ssl/s3_pkt.c

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

Modified files:

Index: src/crypto/dist/openssl/ssl/s3_pkt.c
diff -u src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.3 src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.4
--- src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.3	Tue Jan 12 09:18:40 2010
+++ src/crypto/dist/openssl/ssl/s3_pkt.c	Sun Mar 28 18:44:13 2010
@@ -282,9 +282,9 @@
 			if (version != s-version)
 {
 SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-/* Send back error using their
- * version number :-) */
-s-version=version;
+if ((s-version  0xFF00) == (version  0xFF00))
+	/* Send back error using their minor version number :-) */
+	s-version = (unsigned short)version;
 al=SSL_AD_PROTOCOL_VERSION;
 goto f_err;
 }



CVS commit: [netbsd-4-0] src/crypto/dist/openssl/ssl

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 18:48:45 UTC 2010

Modified Files:
src/crypto/dist/openssl/ssl [netbsd-4-0]: s3_pkt.c

Log Message:
Apply patch (requested by bouyer in ticket #1392):
Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
In TLS connections, certain incorrectly formatted records can cause
an OpenSSL client or server to crash due to a read attempt at NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.6.4.1.2.2 -r1.6.4.1.2.3 src/crypto/dist/openssl/ssl/s3_pkt.c

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

Modified files:

Index: src/crypto/dist/openssl/ssl/s3_pkt.c
diff -u src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.1.2.2 src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.1.2.3
--- src/crypto/dist/openssl/ssl/s3_pkt.c:1.6.4.1.2.2	Tue Jan 12 09:19:37 2010
+++ src/crypto/dist/openssl/ssl/s3_pkt.c	Sun Mar 28 18:48:45 2010
@@ -282,9 +282,9 @@
 			if (version != s-version)
 {
 SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-/* Send back error using their
- * version number :-) */
-s-version=version;
+if ((s-version  0xFF00) == (version  0xFF00))
+	/* Send back error using their minor version number :-) */
+	s-version = (unsigned short)version;
 al=SSL_AD_PROTOCOL_VERSION;
 goto f_err;
 }



CVS commit: [netbsd-4-0] src/doc

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 18:49:06 UTC 2010

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Ticket 1392.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-4.0.2

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

Modified files:

Index: src/doc/CHANGES-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.70 src/doc/CHANGES-4.0.2:1.1.2.71
--- src/doc/CHANGES-4.0.2:1.1.2.70	Mon Feb  1 21:47:34 2010
+++ src/doc/CHANGES-4.0.2	Sun Mar 28 18:49:06 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.70 2010/02/01 21:47:34 bouyer Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.71 2010/03/28 18:49:06 snj Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -1020,14 +1020,22 @@
 	security issues.
 	[christos, ticket #1376]
 
-xsrc/xfree/xc/extras/expat/lib/xmlparse.c		1.2
+xsrc/xfree/xc/extras/expat/lib/xmlparse.c	1.2
 
 	Add patch from upstream CVS to fix CVE-2009-3560 (possible DOS due to
 	crash on bad input).
 	[tron, ticket #1383]
 
-crypto/dist/openssl/crypto/comp/c_zlib.c		patch
+crypto/dist/openssl/crypto/comp/c_zlib.c	patch
 
 	Fix to deal with CVE-2009-4355 from OpenSSL's repositroy.
 	[taca, ticket #1378]
 
+crypto/dist/openssl/ssl/s3_pkt.c		patch
+
+	Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
+	From http://www.openssl.org/news/secadv_20100324.txt:
+	In TLS connections, certain incorrectly formatted records can cause
+	an OpenSSL client or server to crash due to a read attempt at NULL.
+	[bouyer, ticket #1392]
+



CVS commit: [netbsd-4] src/doc

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 18:49:29 UTC 2010

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Tickets 1391 and 1392.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.197 -r1.1.2.198 src/doc/CHANGES-4.1

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

Modified files:

Index: src/doc/CHANGES-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.197 src/doc/CHANGES-4.1:1.1.2.198
--- src/doc/CHANGES-4.1:1.1.2.197	Sat Mar 13 18:25:31 2010
+++ src/doc/CHANGES-4.1	Sun Mar 28 18:49:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.197 2010/03/13 18:25:31 riz Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.198 2010/03/28 18:49:28 snj Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -4059,3 +4059,17 @@
 	PR/42943: Takashi Sogabe: pppd generates invalid netmask
 	[christos, ticket #1389]
 
+bin/pax/tar.1	1.28, 1.29 via patch
+
+	The -X option of tar names a file containing exception globs, not
+	exception filenames, same as in gtar. Fixes PR bin/41168.
+	[dholland, ticket #1391]
+
+crypto/dist/openssl/ssl/s3_pkt.c		patch
+
+	Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
+	From http://www.openssl.org/news/secadv_20100324.txt:
+	In TLS connections, certain incorrectly formatted records can cause
+	an OpenSSL client or server to crash due to a read attempt at NULL.
+	[bouyer, ticket #1392]
+



CVS commit: src/sys

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 20:46:19 UTC 2010

Modified Files:
src/sys/arch/xen/x86: xen_shm_machdep.c
src/sys/arch/xen/xen: clock.c
src/sys/dev/ata: ata.c ata_wdc.c
src/sys/dev/ic: mvsata.c rtl81x9.c wdc.c
src/sys/dev/scsipi: atapi_wdc.c

Log Message:
Spell enough properly.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/x86/xen_shm_machdep.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/ic/rtl81x9.c
cvs rdiff -u -r1.260 -r1.261 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/scsipi/atapi_wdc.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_shm_machdep.c
diff -u src/sys/arch/xen/x86/xen_shm_machdep.c:1.7 src/sys/arch/xen/x86/xen_shm_machdep.c:1.8
--- src/sys/arch/xen/x86/xen_shm_machdep.c:1.7	Mon Oct 19 18:41:11 2009
+++ src/sys/arch/xen/x86/xen_shm_machdep.c	Sun Mar 28 20:46:18 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: xen_shm_machdep.c,v 1.7 2009/10/19 18:41:11 bouyer Exp $  */
+/*  $NetBSD: xen_shm_machdep.c,v 1.8 2010/03/28 20:46:18 snj Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xen_shm_machdep.c,v 1.7 2009/10/19 18:41:11 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_shm_machdep.c,v 1.8 2010/03/28 20:46:18 snj Exp $);
 
 
 #include sys/types.h
@@ -61,7 +61,7 @@
 static u_long xen_shm_base_address_pg;
 static vaddr_t xen_shm_end_address;
 
-/* Grab enouth VM space to map an entire vbd ring. */
+/* Grab enough VM space to map an entire vbd ring. */
 /* Xen3 linux guests seems to eat more pages, gives enough for 10 vbd rings */
 #define BLKIF_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
 #define XENSHM_NPAGES (BLKIF_RING_SIZE * (BLKIF_MAX_SEGMENTS_PER_REQUEST + 1) * 10)

Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.53 src/sys/arch/xen/xen/clock.c:1.54
--- src/sys/arch/xen/xen/clock.c:1.53	Sat Dec 12 14:44:10 2009
+++ src/sys/arch/xen/xen/clock.c	Sun Mar 28 20:46:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.53 2009/12/12 14:44:10 tsutsui Exp $	*/
+/*	$NetBSD: clock.c,v 1.54 2010/03/28 20:46:18 snj Exp $	*/
 
 /*
  *
@@ -29,7 +29,7 @@
 #include opt_xen.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.53 2009/12/12 14:44:10 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.54 2010/03/28 20:46:18 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -303,7 +303,7 @@
 	if (n  50) {
 		/*
 		 * shadow_system_time is updated every hz tick, it's not
-		 * precise enouth for short delays. Use the CPU counter
+		 * precise enough for short delays. Use the CPU counter
 		 * instead. We assume it's working at this point.
 		 */
 		uint64_t cc, cc2, when;

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.112 src/sys/dev/ata/ata.c:1.113
--- src/sys/dev/ata/ata.c:1.112	Wed Feb 24 22:37:56 2010
+++ src/sys/dev/ata/ata.c	Sun Mar 28 20:46:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.112 2010/02/24 22:37:56 dyoung Exp $	*/
+/*	$NetBSD: ata.c,v 1.113 2010/03/28 20:46:18 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.112 2010/02/24 22:37:56 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.113 2010/03/28 20:46:18 snj Exp $);
 
 #include opt_ata.h
 
@@ -1232,7 +1232,7 @@
 			 */
 			if (atac-atac_set_modes)
 /*
- * It's OK to pool here, it's fast enouth
+ * It's OK to pool here, it's fast enough
  * to not bother waiting for interrupt
  */
 if (ata_set_mode(drvp, 0x08 | (i + 3),

Index: src/sys/dev/ata/ata_wdc.c
diff -u src/sys/dev/ata/ata_wdc.c:1.92 src/sys/dev/ata/ata_wdc.c:1.93
--- src/sys/dev/ata/ata_wdc.c:1.92	Mon Oct 19 18:41:12 2009
+++ src/sys/dev/ata/ata_wdc.c	Sun Mar 28 20:46:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_wdc.c,v 1.92 2009/10/19 18:41:12 bouyer Exp $	*/
+/*	$NetBSD: ata_wdc.c,v 1.93 2010/03/28 20:46:18 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata_wdc.c,v 1.92 2009/10/19 18:41:12 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata_wdc.c,v 1.93 2010/03/28 20:46:18 snj Exp $);
 
 #include opt_ata.h
 
@@ -201,7 +201,7 @@
 		}
 		/*
 		 * disable interrupts, all commands here should be quick
-		 * enouth to be able to poll, and we don't go here that often
+		 * enough to be able to poll, and we don't go here that often
 		 */
 		bus_space_write_1(wdr-ctl_iot, wdr-ctl_ioh, wd_aux_ctlr,
 		WDCTL_4BIT | WDCTL_IDS);

Index: src/sys/dev/ic/mvsata.c

CVS commit: src/sys/compat/netbsd32

2010-03-28 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 28 22:03:51 UTC 2010

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c

Log Message:
Cleanup compat netbsd32 nanosleep syscalls to use the common
nanosleep1() call instead of their own stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_time.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/compat/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.10 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.11
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.10	Tue Mar  2 16:09:11 2010
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sun Mar 28 22:03:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.10 2010/03/02 16:09:11 pooka Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.11 2010/03/28 22:03:51 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.10 2010/03/02 16:09:11 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_compat_50.c,v 1.11 2010/03/28 22:03:51 njoly Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sysv.h
@@ -441,50 +441,22 @@
 		syscallarg(const netbsd32_timespec50p_t) rqtp;
 		syscallarg(netbsd32_timespecp_t) rmtp;
 	} */
-	static int nanowait;
 	struct netbsd32_timespec50 ts32;
-	struct timespec rqt, ctime, rmt;
-	int error, timo;
+	struct timespec rqt, rmt;
+	int error, error1;
 
 	error = copyin(SCARG_P32(uap, rqtp), ts32, sizeof(ts32));
 	if (error)
 		return (error);
-
 	netbsd32_to_timespec50(ts32, rqt);
-	if (itimespecfix(rqt))
-		return (EINVAL);
-
-	getnanotime(ctime);
-	timespecadd(rqt, ctime, rqt);
-	timo = tshzto(rqt);
-	/*
-	 * Avoid inadvertantly sleeping forever
-	 */
-	if (timo == 0)
-		timo = 1;
 
-	error = tsleep(nanowait, PWAIT | PCATCH, nanosleep, timo);
-	if (error == ERESTART)
-		error = EINTR;
-	if (error == EWOULDBLOCK)
-		error = 0;
-
-	if (SCARG_P32(uap, rmtp)) {
-		int error1;
-
-		getnanotime(rmt);
-
-		timespecsub(rqt, rmt, rmt);
-		if (rmt.tv_sec  0)
-			timespecclear(rmt);
-
-		netbsd32_from_timespec50(rmt, ts32);
-		error1 = copyout(ts32, SCARG_P32(uap,rmtp), sizeof(ts32));
-		if (error1)
-			return (error1);
-	}
+	error = nanosleep1(l, rqt, SCARG_P32(uap, rmtp) ? rmt : NULL);
+	if (SCARG_P32(uap, rmtp) == NULL || (error != 0  error != EINTR))
+		return error;
 
-	return error;
+	netbsd32_from_timespec50(rmt, ts32);
+	error1 = copyout(ts32, SCARG_P32(uap,rmtp), sizeof(ts32));
+	return error1 ? error1 : error;
 }
 
 static int

Index: src/sys/compat/netbsd32/netbsd32_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.36 src/sys/compat/netbsd32/netbsd32_time.c:1.37
--- src/sys/compat/netbsd32/netbsd32_time.c:1.36	Thu Feb 26 21:08:48 2009
+++ src/sys/compat/netbsd32/netbsd32_time.c	Sun Mar 28 22:03:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_time.c,v 1.36 2009/02/26 21:08:48 christos Exp $	*/
+/*	$NetBSD: netbsd32_time.c,v 1.37 2010/03/28 22:03:51 njoly Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_time.c,v 1.36 2009/02/26 21:08:48 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_time.c,v 1.37 2010/03/28 22:03:51 njoly Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ntp.h
@@ -425,50 +425,22 @@
 		syscallarg(const netbsd32_timespecp_t) rqtp;
 		syscallarg(netbsd32_timespecp_t) rmtp;
 	} */
-	static int nanowait;
 	struct netbsd32_timespec ts32;
-	struct timespec rqt, ctime, rmt;
-	int error, timo;
+	struct timespec rqt, rmt;
+	int error, error1;
 
 	error = copyin(SCARG_P32(uap, rqtp), ts32, sizeof(ts32));
 	if (error)
 		return (error);
-
 	netbsd32_to_timespec(ts32, rqt);
-	if (itimespecfix(rqt))
-		return (EINVAL);
-
-	getnanotime(ctime);
-	timespecadd(rqt, ctime, rqt);
-	timo = tshzto(rqt);
-	/*
-	 * Avoid inadvertantly sleeping forever
-	 */
-	if (timo == 0)
-		timo = 1;
 
-	error = tsleep(nanowait, PWAIT | PCATCH, nanosleep, timo);
-	if (error == ERESTART)
-		error = EINTR;
-	if (error == EWOULDBLOCK)
-		error = 0;
-
-	if (SCARG_P32(uap, rmtp)) {
-		int error1;
-
-		getnanotime(rmt);
-
-		timespecsub(rqt, rmt, rmt);
-		if (rmt.tv_sec  0)
-			timespecclear(rmt);
-
-		netbsd32_from_timespec(rmt, ts32);
-		error1 = copyout(ts32, SCARG_P32(uap,rmtp), sizeof(ts32));
-		if (error1)
-			return (error1);
-	}
+	error = nanosleep1(l, rqt, SCARG_P32(uap, rmtp) ? rmt : NULL);
+	if (SCARG_P32(uap, rmtp) == NULL || (error != 0  error != EINTR))
+		return error;
 
-	return error;
+	netbsd32_from_timespec(rmt, ts32);
+	error1 = copyout(ts32, SCARG_P32(uap,rmtp), sizeof(ts32));
+	return error1 ? error1 : error;
 }
 
 static int



CVS commit: src/sys/arch/macppc/stand/ofwboot

2010-03-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Mar 29 00:13:33 UTC 2010

Modified Files:
src/sys/arch/macppc/stand/ofwboot: boot.c

Log Message:
avoid some warnings on powerpc64.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/macppc/stand/ofwboot/boot.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/macppc/stand/ofwboot/boot.c
diff -u src/sys/arch/macppc/stand/ofwboot/boot.c:1.23 src/sys/arch/macppc/stand/ofwboot/boot.c:1.24
--- src/sys/arch/macppc/stand/ofwboot/boot.c:1.23	Wed Jan 28 15:03:28 2009
+++ src/sys/arch/macppc/stand/ofwboot/boot.c	Mon Mar 29 00:13:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.23 2009/01/28 15:03:28 tsutsui Exp $	*/
+/*	$NetBSD: boot.c,v 1.24 2010/03/29 00:13:32 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -332,8 +332,8 @@
 	esym = (void *)marks[MARK_END];
 
 	printf( start=0x%x\n, entry);
-	__syncicache((void *) entry, (u_int) ssym - (u_int) entry);
-	chain((boot_entry_t) entry, bootline, ssym, esym);
+	__syncicache((void *)(uintptr_t)entry, (size_t)ssym - entry);
+	chain((boot_entry_t)(uintptr_t)entry, bootline, ssym, esym);
 
 	OF_exit();
 }



CVS commit: [netbsd-5] src/sys/arch/xen/x86

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar 29 00:23:12 UTC 2010

Modified Files:
src/sys/arch/xen/x86 [netbsd-5]: xen_bus_dma.c

Log Message:
Pull up following revision(s) (requested by jym in ticket #1334):
sys/arch/xen/x86/xen_bus_dma.c: revision 1.20
Although Xen's documentation states that the address_bits field is not used
by XENMEM_decrease_reservation, it is checked by the hypervisor. In certain
circumstances (stack leak), the field could have an improper value, leading
to a fail of the hypercall.
Set it to 0 (no addressing restriction) to avoid that.
Patch tested by Sam Fourman and h...@.
This should fix the rare failed allocating DMA memory encountered
under NetBSD dom0.


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.1 -r1.11.8.2 src/sys/arch/xen/x86/xen_bus_dma.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.1 src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.2
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.1	Sat Jan 30 19:14:20 2010
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Mon Mar 29 00:23:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -99,6 +99,7 @@
 		res.extent_start = mfn;
 		res.nr_extents = 1;
 		res.extent_order = 0;
+		res.address_bits = 0;
 		res.domid = DOMID_SELF;
 		if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, res)
 		 0) {



CVS commit: [netbsd-5] src/sys/netinet

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar 29 00:29:44 UTC 2010

Modified Files:
src/sys/netinet [netbsd-5]: in.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1357):
sys/netinet/in.c: revision 1.137 via patch
Fixed a number of race conditions in the case of receiving ipv4 packet.
found by iij seil team.


To generate a diff of this commit:
cvs rdiff -u -r1.127.4.1 -r1.127.4.2 src/sys/netinet/in.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.127.4.1 src/sys/netinet/in.c:1.127.4.2
--- src/sys/netinet/in.c:1.127.4.1	Fri Jan  9 02:57:34 2009
+++ src/sys/netinet/in.c	Mon Mar 29 00:29:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.127.4.1 2009/01/09 02:57:34 snj Exp $	*/
+/*	$NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.1 2009/01/09 02:57:34 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $);
 
 #include opt_inet.h
 #include opt_inet_conf.h
@@ -398,6 +398,7 @@
 			if (ia == 0)
 return (ENOBUFS);
 			bzero((void *)ia, sizeof *ia);
+			mutex_enter(softnet_lock);
 			TAILQ_INSERT_TAIL(in_ifaddrhead, ia, ia_list);
 			IFAREF(ia-ia_ifa);
 			ifa_insert(ifp, ia-ia_ifa);
@@ -417,6 +418,7 @@
 			ia-ia_ifp = ifp;
 			ia-ia_idsalt = arc4random() % 65535;
 			LIST_INIT(ia-ia_multiaddrs);
+			mutex_exit(softnet_lock);
 			newifaddr = 1;
 		}
 		break;
@@ -464,12 +466,14 @@
 	case SIOCSIFDSTADDR:
 		if ((ifp-if_flags  IFF_POINTOPOINT) == 0)
 			return (EINVAL);
+		mutex_enter(softnet_lock);
 		oldaddr = ia-ia_dstaddr;
 		ia-ia_dstaddr = *satocsin(ifreq_getdstaddr(cmd, ifr));
 		if (ifp-if_ioctl != NULL 
 		(error = (*ifp-if_ioctl)(ifp, SIOCSIFDSTADDR,
 		  (void *)ia)) != 0) {
 			ia-ia_dstaddr = oldaddr;
+			mutex_exit(softnet_lock);
 			return error;
 		}
 		if (ia-ia_flags  IFA_ROUTE) {
@@ -478,6 +482,7 @@
 			ia-ia_ifa.ifa_dstaddr = sintosa(ia-ia_dstaddr);
 			rtinit(ia-ia_ifa, RTM_ADD, RTF_HOST|RTF_UP);
 		}
+		mutex_exit(softnet_lock);
 		break;
 
 	case SIOCSIFBRDADDR:
@@ -487,6 +492,7 @@
 		break;
 
 	case SIOCSIFADDR:
+		mutex_enter(softnet_lock);
 		error = in_ifinit(ifp, ia, satocsin(ifreq_getaddr(cmd, ifr)),
 		1);
 #ifdef PFIL_HOOKS
@@ -494,18 +500,22 @@
 			(void)pfil_run_hooks(if_pfil,
 			(struct mbuf **)SIOCSIFADDR, ifp, PFIL_IFADDR);
 #endif
+		mutex_exit(softnet_lock);
 		break;
 
 	case SIOCSIFNETMASK:
+		mutex_enter(softnet_lock);
 		in_ifscrub(ifp, ia);
 		ia-ia_sockmask = *satocsin(ifreq_getaddr(cmd, ifr));
 		ia-ia_subnetmask = ia-ia_sockmask.sin_addr.s_addr;
 		error = in_ifinit(ifp, ia, NULL, 0);
+		mutex_exit(softnet_lock);
 		break;
 
 	case SIOCAIFADDR:
 		maskIsNew = 0;
 		hostIsNew = 1;
+		mutex_enter(softnet_lock);
 		if (ia-ia_addr.sin_family != AF_INET)
 			;
 		else if (ifra-ifra_addr.sin_len == 0) {
@@ -538,6 +548,7 @@
 			(void)pfil_run_hooks(if_pfil,
 			(struct mbuf **)SIOCAIFADDR, ifp, PFIL_IFADDR);
 #endif
+		mutex_exit(softnet_lock);
 		break;
 
 	case SIOCGIFALIAS:
@@ -554,11 +565,13 @@
 		break;
 
 	case SIOCDIFADDR:
+		mutex_enter(softnet_lock);
 		in_purgeaddr(ia-ia_ifa);
 #ifdef PFIL_HOOKS
 		(void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCDIFADDR,
 		ifp, PFIL_IFADDR);
 #endif
+		mutex_exit(softnet_lock);
 		break;
 
 #ifdef MROUTING



CVS commit: [netbsd-5] src/doc

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar 29 00:33:09 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.1

Log Message:
Tickets 1334 and 1357.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.220 -r1.1.2.221 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.220 src/doc/CHANGES-5.1:1.1.2.221
--- src/doc/CHANGES-5.1:1.1.2.220	Sun Mar 28 17:50:07 2010
+++ src/doc/CHANGES-5.1	Mon Mar 29 00:33:09 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.220 2010/03/28 17:50:07 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.221 2010/03/29 00:33:09 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -17122,3 +17122,19 @@
 	  and zero-sized directory inodes in snapshots.
 	[hannken, ticket #1345]
 
+sys/arch/xen/x86/xen_bus_dma.c			1.20
+
+	Although Xen's documentation states that the address_bits field is
+	not used by XENMEM_decrease_reservation, it is checked by the
+	hypervisor. In certain circumstances (stack leak), the field could
+	have an improper value, leading to a fail of the hypercall.
+	Set it to 0 (no addressing restriction) to avoid that.  This
+	should fix the rare failed allocating DMA memory encountered
+	under NetBSD dom0.
+	[jym, ticket #1334]
+
+sys/netinet/in.c1.137 via patch
+
+	Fixed a number of race conditions when receiving ipv4 packets.
+	[bouyer, ticket #1357]
+



CVS commit: src/share/examples/rump/virtual_ip_router

2010-03-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Mar 29 02:11:15 UTC 2010

Modified Files:
src/share/examples/rump/virtual_ip_router: README.txt
Added Files:
src/share/examples/rump/virtual_ip_router: startrouters.sh

Log Message:
amazing grep, how sweet the find
that saved a hack like me
script once was lost but now it's found
was -x, but now I sh


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/examples/rump/virtual_ip_router/README.txt
cvs rdiff -u -r0 -r1.1 \
src/share/examples/rump/virtual_ip_router/startrouters.sh

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

Modified files:

Index: src/share/examples/rump/virtual_ip_router/README.txt
diff -u src/share/examples/rump/virtual_ip_router/README.txt:1.1 src/share/examples/rump/virtual_ip_router/README.txt:1.2
--- src/share/examples/rump/virtual_ip_router/README.txt:1.1	Mon Mar 29 02:01:47 2010
+++ src/share/examples/rump/virtual_ip_router/README.txt	Mon Mar 29 02:11:14 2010
@@ -1,4 +1,4 @@
-	$NetBSD: README.txt,v 1.1 2010/03/29 02:01:47 pooka Exp $
+	$NetBSD: README.txt,v 1.2 2010/03/29 02:11:14 pooka Exp $
 
 Using rump it is possible to build a router test setup consisting
 of thousands of NetBSD IP stacks within a single host OS, one
@@ -92,8 +92,7 @@
 ./a.out 10.0.253.1 10.0.253.255 /tmp/rumpshm_253 10.0.253.2 10.0.255.1 10.0.255.
 255 /tmp/rumpshm_255 0
 
-Unfortunately I lost script used to produce that, but the algorithm
-is quickly obvious.
+(see startrouters.sh for a script to produce that output)
 
 Easy but slightly more interesting setups, such as a M^N matrix
 (hyper-matrix?) are also possible, but left as an exercise to the

Added files:

Index: src/share/examples/rump/virtual_ip_router/startrouters.sh
diff -u /dev/null src/share/examples/rump/virtual_ip_router/startrouters.sh:1.1
--- /dev/null	Mon Mar 29 02:11:15 2010
+++ src/share/examples/rump/virtual_ip_router/startrouters.sh	Mon Mar 29 02:11:14 2010
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+#	$NetBSD: startrouters.sh,v 1.1 2010/03/29 02:11:14 pooka Exp $
+#
+
+dummy=
+amp=
+LIF=10.0.XXX.1
+LBCAST=10.0.XXX.255
+LFILE=/tmp/rumpshm_XXX
+LROUTE=10.0.XXX.2
+
+RIF=10.0.YYY.2
+RBCAST=10.0.YYY.255
+RFILE=/tmp/rumpshm_YYY
+RROUTE=10.0.YYY.1
+
+die ()
+{
+
+	echo $1
+	exit 1
+}
+
+[ $# != 1 ]  die usage: script.sh nrouters
+n=${1}
+
+[ $n -lt 1 ]  die n must be between 1 and 254
+[ $n -gt 254 ]  die n must be between 1 and 254
+
+pkill a.out
+rm /tmp/rumpshm_*
+rm -f cmds
+
+i=1
+ip=0
+while [ ${i} -le ${n} ]
+do
+	lif=`echo ${LIF} | sed s/XXX/${ip}/`
+	lbcast=`echo ${LBCAST} | sed s/XXX/${ip}/`
+	lfile=`echo ${LFILE} | sed s/XXX/${ip}/`
+	lroute=`echo ${LROUTE} | sed s/XXX/${ip}/`
+
+	rif=`echo ${RIF} | sed s/YYY/${i}/`
+	rbcast=`echo ${RBCAST} | sed s/YYY/${i}/`
+	rfile=`echo ${RFILE} | sed s/YYY/${i}/`
+	rroute=`echo ${RROUTE} | sed s/YYY/${i}/`
+
+	if [ $i = 1 ]
+	then
+		lroute=0
+	fi
+
+	if [ $i = $n ]
+	then
+		rif=10.0.255.1
+		rbcast=10.0.255.255
+		rfile=/tmp/rumpshm_255
+		rroute=0
+	fi
+
+	echo ./a.out ${lif} ${lbcast} ${lfile} ${lroute} ${rif} ${rbcast} ${rfile} ${rroute}  cmds
+
+	ip=${i}
+	i=$((i+1))
+done
+
+#echo ./specialpint send tcp 10.0.255.10  cmds



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 02:21:04 UTC 2010

Modified Files:
src/games/gomoku: bdisp.c

Log Message:
Don't exit(0) on failure. Use errx() instead of fprintf.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/games/gomoku/bdisp.c

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.12 src/games/gomoku/bdisp.c:1.13
--- src/games/gomoku/bdisp.c:1.12	Mon Jul 13 19:05:40 2009
+++ src/games/gomoku/bdisp.c	Mon Mar 29 02:21:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.12 2009/07/13 19:05:40 roy Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.13 2010/03/29 02:21:04 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,13 +37,14 @@
 #if 0
 static char sccsid[] = @(#)bdisp.c	8.2 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: bdisp.c,v 1.12 2009/07/13 19:05:40 roy Exp $);
+__RCSID($NetBSD: bdisp.c,v 1.13 2010/03/29 02:21:04 dholland Exp $);
 #endif
 #endif /* not lint */
 
 #include curses.h
 #include string.h
 #include stdlib.h
+#include err.h
 #include gomoku.h
 
 #define	SCRNH		24		/* assume 24 lines for the moment */
@@ -63,8 +64,7 @@
 {
 
 	if (!initscr()) {
-		fprintf(stderr, couldn't initialize screen\n);
-		exit (0);
+		errx(EXIT_FAILURE, Couldn't initialize screen);
 	}
 	noecho();
 	cbreak();



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 02:32:45 UTC 2010

Modified Files:
src/games/gomoku: gomoku.6

Log Message:
Fix typo. From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/games/gomoku/gomoku.6

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

Modified files:

Index: src/games/gomoku/gomoku.6
diff -u src/games/gomoku/gomoku.6:1.11 src/games/gomoku/gomoku.6:1.12
--- src/games/gomoku/gomoku.6:1.11	Thu Sep 15 02:09:41 2005
+++ src/games/gomoku/gomoku.6	Mon Mar 29 02:32:45 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: gomoku.6,v 1.11 2005/09/15 02:09:41 wiz Exp $
+.\	$NetBSD: gomoku.6,v 1.12 2010/03/29 02:32:45 dholland Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -45,7 +45,7 @@
 .Op Ar inputfile
 .Sh DESCRIPTION
 .Nm
-is a two player game were the object is to get 5 in a row horizontally,
+is a two player game where the object is to get 5 in a row horizontally,
 vertically or diagonally on a 19 by 19 grid.
 By convention, black always moves first.
 With no arguments,



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 02:34:50 UTC 2010

Modified Files:
src/games/gomoku: gomoku.6

Log Message:
fix quote markup, spotted in openbsd diffs


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/games/gomoku/gomoku.6

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

Modified files:

Index: src/games/gomoku/gomoku.6
diff -u src/games/gomoku/gomoku.6:1.12 src/games/gomoku/gomoku.6:1.13
--- src/games/gomoku/gomoku.6:1.12	Mon Mar 29 02:32:45 2010
+++ src/games/gomoku/gomoku.6	Mon Mar 29 02:34:50 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: gomoku.6,v 1.12 2010/03/29 02:32:45 dholland Exp $
+.\	$NetBSD: gomoku.6,v 1.13 2010/03/29 02:34:50 dholland Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -53,9 +53,14 @@
 will display a playing board and prompt for moves from the user.
 Valid moves are a letter for the column and a number for the row of an empty
 board location.
-Entering ``quit or ``resign will end the game.
-You can save the current state of the game by entering ``save and
-supplying a file name when prompted.
+Entering
+.Dq quit
+or
+.Dq resign
+will end the game.
+You can save the current state of the game by entering
+.Dq save
+and supplying a file name when prompted.
 The optional file
 .Ar inputfile
 can be used to restore a saved game.
@@ -66,7 +71,11 @@
 This option sets background mode.
 Input moves are read from standard input,
 the computer picks a move, and prints it to standard output.
-The first input line should be either ``black or ``white to specify whether
+The first input line should be either
+.Dq black
+or
+.Dq white
+to specify whether
 .Nm
 has the first move or not respectively.
 This option was intended for game tournaments where a referee program handles



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 02:46:05 UTC 2010

Modified Files:
src/games/gomoku: main.c

Log Message:
Allow saved game filenames up to PATH_MAX. From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/games/gomoku/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/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.20 src/games/gomoku/main.c:1.21
--- src/games/gomoku/main.c:1.20	Wed Aug 12 06:19:17 2009
+++ src/games/gomoku/main.c	Mon Mar 29 02:46:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.20 2009/08/12 06:19:17 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.21 2010/03/29 02:46:05 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -42,12 +42,13 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.4 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: main.c,v 1.20 2009/08/12 06:19:17 dholland Exp $);
+__RCSID($NetBSD: main.c,v 1.21 2010/03/29 02:46:05 dholland Exp $);
 #endif
 #endif /* not lint */
 
 #include curses.h
 #include err.h
+#include limits.h
 #include signal.h
 #include stdarg.h
 #include stdlib.h
@@ -88,6 +89,7 @@
 main(int argc, char **argv)
 {
 	char buf[128];
+	char fname[PATH_MAX];
 	int color, curmove, i, ch;
 	int input[2];
 	static const char *const fmt[2] = {
@@ -255,8 +257,8 @@
 	FILE *fp;
 
 	ask(save file name? );
-	(void)get_line(buf, sizeof(buf));
-	if ((fp = fopen(buf, w)) == NULL) {
+	(void)get_line(fname, sizeof(fname));
+	if ((fp = fopen(fname, w)) == NULL) {
 		misclog(cannot create save file);
 		goto getinput;
 	}
@@ -314,8 +316,8 @@
 FILE *fp;
 
 ask(save file name? );
-(void)get_line(buf, sizeof(buf));
-if ((fp = fopen(buf, w)) == NULL) {
+(void)get_line(fname, sizeof(fname));
+if ((fp = fopen(fname, w)) == NULL) {
 	misclog(cannot create save file);
 	goto replay;
 }



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 02:48:17 UTC 2010

Modified Files:
src/games/gomoku: main.c

Log Message:
Spell versus right.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/games/gomoku/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/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.21 src/games/gomoku/main.c:1.22
--- src/games/gomoku/main.c:1.21	Mon Mar 29 02:46:05 2010
+++ src/games/gomoku/main.c	Mon Mar 29 02:48:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.21 2010/03/29 02:46:05 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.22 2010/03/29 02:48:17 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.4 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: main.c,v 1.21 2010/03/29 02:46:05 dholland Exp $);
+__RCSID($NetBSD: main.c,v 1.22 2010/03/29 02:48:17 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -120,10 +120,10 @@
 			if ((debugfp = fopen(optarg, w)) == NULL)
 err(1, %s, optarg);
 			break;
-		case 'u':	/* testing: user verses user */
+		case 'u':	/* testing: user versus user */
 			test = 1;
 			break;
-		case 'c':	/* testing: computer verses computer */
+		case 'c':	/* testing: computer versus computer */
 			test = 2;
 			break;
 		}
@@ -191,17 +191,17 @@
 		input[WHITE] = INPUTF;
 	} else {
 		switch (test) {
-		case 0: /* user verses program */
+		case 0: /* user versus program */
 			input[color] = USER;
 			input[!color] = PROGRAM;
 			break;
 
-		case 1: /* user verses user */
+		case 1: /* user versus user */
 			input[BLACK] = USER;
 			input[WHITE] = USER;
 			break;
 
-		case 2: /* program verses program */
+		case 2: /* program versus program */
 			input[BLACK] = PROGRAM;
 			input[WHITE] = PROGRAM;
 			break;
@@ -221,17 +221,17 @@
 			if (curmove != ILLEGAL)
 break;
 			switch (test) {
-			case 0: /* user verses program */
+			case 0: /* user versus program */
 input[color] = USER;
 input[!color] = PROGRAM;
 break;
 
-			case 1: /* user verses user */
+			case 1: /* user versus user */
 input[BLACK] = USER;
 input[WHITE] = USER;
 break;
 
-			case 2: /* program verses program */
+			case 2: /* program versus program */
 input[BLACK] = PROGRAM;
 input[WHITE] = PROGRAM;
 break;



CVS commit: src/sys/dev/pci

2010-03-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Mar 29 03:07:24 UTC 2010

Removed Files:
src/sys/dev/pci: fwlynx_pci.c

Log Message:
Remove obsolete file.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r0 src/sys/dev/pci/fwlynx_pci.c

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



CVS commit: src/sys/dev/ieee1394

2010-03-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Mar 29 03:42:15 UTC 2010

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

Log Message:
Remove debugging process.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ieee1394/firewire.c
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/ieee1394/fwohci.c

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

Modified files:

Index: src/sys/dev/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.27 src/sys/dev/ieee1394/firewire.c:1.28
--- src/sys/dev/ieee1394/firewire.c:1.27	Mon Mar 29 03:05:27 2010
+++ src/sys/dev/ieee1394/firewire.c	Mon Mar 29 03:42:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.27 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: firewire.c,v 1.28 2010/03/29 03:42:15 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.27 2010/03/29 03:05:27 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.28 2010/03/29 03:42:15 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -1727,21 +1727,10 @@
 	node = dfwdev-dst;
 
 	/* First quad */
-#if 0
-printf(%s: speed=0x%x(0x%x)\n, __func__, dfwdev-speed, fc-speed_map-speed[fc-nodeid][node]);
-if (dfwdev-speed == 0)
-  dfwdev-speed = fc-speed_map-speed[fc-nodeid][node];
-else if (dfwdev-speed == 2)
-  dfwdev-speed = 1;
-else
-  dfwdev-speed = 0;
-printf(%s: Re: speed=0x%x\n, __func__, dfwdev-speed);
-#endif
 	err = fw_explore_read_quads(dfwdev, CSRROMOFF, csr, 1);
 	if (err) {
 		aprint_error_dev(fc-bdev,
 		node%d: explore_read_quads failure\n, node);
-printf(err=%d\n, err);
 		dfwdev-status = FWDEVINVAL;
 		return -1;
 	}

Index: src/sys/dev/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.121 src/sys/dev/ieee1394/fwohci.c:1.122
--- src/sys/dev/ieee1394/fwohci.c:1.121	Mon Mar 29 03:05:27 2010
+++ src/sys/dev/ieee1394/fwohci.c	Mon Mar 29 03:42:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.121 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.122 2010/03/29 03:42:15 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.121 2010/03/29 03:05:27 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.122 2010/03/29 03:42:15 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -2998,25 +2998,7 @@
 	}
 	fwdma_sync_multiseg(dbch-am, db_tr-idx, db_tr-idx,
 	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
-#if 0
-{
-uint32_t _status;
-
-fwdma_sync_multiseg(dbch-am, db_tr-idx, db_tr-idx, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
-_status = FWOHCI_DMA_READ(db_tr-db[0].db.desc.res)  OHCI_STATUS_SHIFT;
-if (status != _status)
-printf(Ooops status ? 0x%x : 0x%x, %p\n, status, _status, db_tr-db);
-fwdma_sync_multiseg(dbch-am, db_tr-idx, db_tr-idx, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
-_status = FWOHCI_DMA_READ(((struct fwohcidb *)MIPS_PHYS_TO_KSEG1(MIPS_KSEG0_TO_PHYS(db_tr-db)))[0].db.desc.res)  OHCI_STATUS_SHIFT;
-if (status != _status)
-printf(Ops status ? 0x%x : 0x%x\n, status, _status);
-}
-#endif
 	mutex_exit(dbch-xferq.q_mtx);
-#if 0
-prev_resCounts[i] = resCount;
-i = (i + 1)  0xf;
-#endif
 	return;
 
 err:



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

2010-03-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Mar 29 03:44:37 UTC 2010

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

Log Message:
Add scsi...@sbp.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/ofppc/conf/GENERIC

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

Modified files:

Index: src/sys/arch/ofppc/conf/GENERIC
diff -u src/sys/arch/ofppc/conf/GENERIC:1.125 src/sys/arch/ofppc/conf/GENERIC:1.126
--- src/sys/arch/ofppc/conf/GENERIC:1.125	Sun Mar 14 10:14:14 2010
+++ src/sys/arch/ofppc/conf/GENERIC	Mon Mar 29 03:44:37 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.125 2010/03/14 10:14:14 kiyohara Exp $
+# $NetBSD: GENERIC,v 1.126 2010/03/29 03:44:37 kiyohara Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.125 $
+#ident 		GENERIC-$Revision: 1.126 $
 
 maxusers	32
 
@@ -231,6 +231,7 @@
 scsibus* 	at siop?
 scsibus* 	at esiop?
 scsibus* 	at umass?
+scsibus* 	at sbp?
 
 # SCSI devices
 sd*		at scsibus? target ? lun ?	# SCSI disk drives



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 03:51:55 UTC 2010

Modified Files:
src/games/gomoku: bdisp.c gomoku.6 gomoku.h main.c

Log Message:
Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/gomoku/bdisp.c src/games/gomoku/gomoku.6
cvs rdiff -u -r1.17 -r1.18 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.22 -r1.23 src/games/gomoku/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/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.13 src/games/gomoku/bdisp.c:1.14
--- src/games/gomoku/bdisp.c:1.13	Mon Mar 29 02:21:04 2010
+++ src/games/gomoku/bdisp.c	Mon Mar 29 03:51:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.13 2010/03/29 02:21:04 dholland Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)bdisp.c	8.2 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: bdisp.c,v 1.13 2010/03/29 02:21:04 dholland Exp $);
+__RCSID($NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -66,9 +66,19 @@
 	if (!initscr()) {
 		errx(EXIT_FAILURE, Couldn't initialize screen);
 	}
+	if ((LINES  SCRNH) || (COLS  SCRNW)) {
+		errx(EXIT_FAILURE, Screen too small (need %d%xd),
+		SCRNW, SCRNH);
+	}
+	keypad(stdscr, TRUE);
+	nonl();
 	noecho();
 	cbreak();
-	leaveok(stdscr, TRUE);
+	leaveok(stdscr, FALSE);
+
+#if 0 /* no mouse support in netbsd curses yet */
+	mousemask(BUTTON1_CLICKED, NULL);
+#endif
 }
 
 /*
@@ -78,10 +88,10 @@
 cursfini(void)
 {
 
-	leaveok(stdscr, FALSE);
-	move(23, 0);
+	move(BSZ4, 0);
 	clrtoeol();
 	refresh();
+	echo();
 	endwin();
 }
 
@@ -123,18 +133,28 @@
 void
 bdwho(int update)
 {
-	int i;
+	int i, j;
 
 	move(21, 0);
-	clrtoeol();
-	i = 6 - strlen(plyr[BLACK]) / 2;
-	move(21, i  0 ? i : 0);
-	printw(BLACK/%s, plyr[BLACK]);
-	i = 30 - strlen(plyr[WHITE]) / 2;
-	move(21, i);
-	printw(WHITE/%s, plyr[WHITE]);
-	move(21, 19);
-	addstr( vs. );
+printw(  );
+	i = strlen(plyr[BLACK]);
+	j = strlen(plyr[WHITE]);
+	if (i + j = 20) {
+		move(21, 10 - (i+j)/2);
+		printw(BLACK/%s (*) vs. WHITE/%s (O),
+		plyr[BLACK], plyr[WHITE]);
+	} else {
+		move(21, 0);
+		if (i = 10) {
+			j = 20 - i;
+		} else if (j = 10) {
+			i = 20 - j;
+		} else {
+			i = j = 10;
+		}
+		printw(BLACK/%.*s (*) vs. WHITE/%.*s (O),
+		i, plyr[BLACK], j, plyr[WHITE]);
+	}
 	if (update)
 		refresh();
 }
@@ -217,10 +237,10 @@
 		/* move 'em up */
 		lastline = 1;
 	}
-	move(lastline, 46);
-	addnstr(str, SCRNW - 46 - 1);
+	move(lastline, TRANSCRIPT_COL);
+	addnstr(str, SCRNW - TRANSCRIPT_COL - 1);
 	clrtoeol();
-	move(lastline + 1, 46);
+	move(lastline + 1, TRANSCRIPT_COL);
 	clrtoeol();
 }
 
@@ -233,10 +253,10 @@
 {
 	int len = strlen(str);
 
-	move(23, 0);
+	move(BSZ4, 0);
 	addstr(str);
 	clrtoeol();
-	move(23, len);
+	move(BSZ4, len);
 	refresh();
 }
 
@@ -284,3 +304,146 @@
 	*cp = '\0';
 	return(c != EOF);
 }
+
+/*
+ * Decent (n)curses interface for the game, based on Eric S. Raymond's
+ * modifications to the battleship (bs) user interface.
+ */
+int
+get_coord(void)
+{
+	static int curx = BSZ / 2;
+	static int cury = BSZ / 2;
+	int ny, nx, ch;
+
+	BGOTO(cury, curx);
+	refresh();
+	nx = curx;
+	ny = cury;
+	for (;;) {
+		mvprintw(BSZ3, (BSZ -6)/2, (%c %d), 
+'A'+ ((curx  7) ? (curx+1) : curx), cury + 1);
+		BGOTO(cury, curx);
+
+		ch = getch();
+		switch (ch) {
+		case 'k':
+		case '8':
+		case KEY_UP:
+			nx = curx;
+			ny = cury + 1;
+			break;
+		case 'j':
+		case '2':
+		case KEY_DOWN:
+			nx = curx;
+			ny = BSZ + cury - 1;
+			break;
+		case 'h':
+		case '4':
+		case KEY_LEFT:
+			nx = BSZ + curx - 1;
+			ny = cury;
+			break;
+		case 'l':
+		case '6':
+		case KEY_RIGHT:
+			nx = curx + 1;
+			ny = cury;
+			break;
+		case 'y':
+		case '7':
+		case KEY_A1:
+			nx = BSZ + curx - 1;
+			ny = cury + 1;
+			break;
+		case 'b':
+		case '1':
+		case KEY_C1:
+			nx = BSZ + curx - 1;
+			ny = BSZ + cury - 1;
+			break;
+		case 'u':
+		case '9':
+		case KEY_A3:
+			nx = curx + 1;
+			ny = cury + 1;
+			break;
+		case 'n':
+		case '3':
+		case KEY_C3:
+			nx = curx + 1;
+			ny = BSZ + cury - 1;
+			break;
+		case 'K':
+			nx = curx;
+			ny = cury + 5;
+			break;
+		case 'J':
+			nx = curx;
+			ny = BSZ + cury - 5;
+			break;
+		case 'H':
+			nx = BSZ + curx - 5;
+			ny = cury;
+			break;
+		case 'L':
+			nx = curx + 5;
+			ny = cury;
+			break;
+		case 'Y':
+		nx = BSZ + curx - 5;
+			ny = cury + 5;
+			break;
+		case 'B':
+			nx = BSZ + curx - 5;
+			ny = BSZ + cury - 5;
+			break;
+		case 'U':
+			nx = curx + 5;
+			ny = cury + 5;
+			break;
+		case 'N':
+			nx = curx + 5;
+			ny = BSZ + cury - 5;
+			break;
+		case '\f':
+			nx = curx;
+			ny = 

CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 04:00:03 UTC 2010

Modified Files:
src/games/gomoku: gomoku.6

Log Message:
reorg for clarity and exposition.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/gomoku/gomoku.6

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

Modified files:

Index: src/games/gomoku/gomoku.6
diff -u src/games/gomoku/gomoku.6:1.14 src/games/gomoku/gomoku.6:1.15
--- src/games/gomoku/gomoku.6:1.14	Mon Mar 29 03:51:55 2010
+++ src/games/gomoku/gomoku.6	Mon Mar 29 04:00:03 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: gomoku.6,v 1.14 2010/03/29 03:51:55 dholland Exp $
+.\	$NetBSD: gomoku.6,v 1.15 2010/03/29 04:00:03 dholland Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -48,9 +48,37 @@
 is a two player game where the object is to get 5 in a row horizontally,
 vertically or diagonally on a 19 by 19 grid.
 By convention, black always moves first.
+.Pp
+The options are:
+.Bl -tag -width Ds
+.It Fl b
+Run in batch mode.
+.Pq See below.
+.It Fl c
+Computer versus computer.
+.Nm
+will play a game against itself.
+This is mostly used for testing.
+.It Fl d
+Print debugging information.
+Repeating this option more than once yields more detailed information.
+.It Fl D Ar debugfile
+Print the debug information to
+.Ar debugfile
+instead of to the standard output.
+.It Fl u
+User versus user.
+.Pq Play against yourself.
+This is mostly used for testing.
+.It Ar savefile
+Load a previously saved game from
+.Pa savefile .
+.El
+.Pp
 With no arguments,
 .Nm
-will display a playing board and prompt for moves from the user.
+starts a fresh user vs. computer game.
+.Pp
 Moves may be entered by selecting the desired board location and
 pressing the space or enter key.
 The cursor may be moved using the arrow keys or
@@ -68,41 +96,20 @@
 and to save the game, type
 .Sq S
 and supply a file name when prompted.
-To restore a saved game, pass the file name on the
-.Nm
-command line.
-.Pp
-The options are:
-.Bl -tag -width Ds
-.It Fl b
-This option sets background mode.
-Input moves are read from standard input,
-the computer picks a move, and prints it to standard output.
-The first input line should be either
+.Ss Batch mode
+Batch mode was intended for game tournaments where a referee program
+handles the board display and pits one program against another.
+In this mode,
+.Nm
+reads moves from standard input and writes its responses to standard
+output.
+The first line of input should be either
 .Dq black
 or
 .Dq white
 to specify whether
 .Nm
 has the first move or not respectively.
-This option was intended for game tournaments where a referee program handles
-the board display and pits one program against another.
-.It Fl c
-Computer versus computer.
-.Nm
-will play a game against itself.
-This is mostly used for testing.
-.It Fl d
-Print debugging information.
-Repeating this option more than once yields more detailed information.
-.It Fl D Ar debugfile
-Print the debug information to
-.Ar debugfile
-instead of to the standard output.
-.It Fl u
-User versus user.
-This is mostly used for testing.
-.El
 .Sh AUTHORS
 .An Ralph Campbell
 .Sh ACKNOWLEDGEMENTS



CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 04:28:47 UTC 2010

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c

Log Message:
Some improvements to the new UI.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.23 -r1.24 src/games/gomoku/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/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.14 src/games/gomoku/bdisp.c:1.15
--- src/games/gomoku/bdisp.c:1.14	Mon Mar 29 03:51:55 2010
+++ src/games/gomoku/bdisp.c	Mon Mar 29 04:28:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.15 2010/03/29 04:28:47 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)bdisp.c	8.2 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: bdisp.c,v 1.14 2010/03/29 03:51:55 dholland Exp $);
+__RCSID($NetBSD: bdisp.c,v 1.15 2010/03/29 04:28:47 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -261,6 +261,24 @@
 }
 
 int
+get_key(const char *allowed)
+{
+	int ch;
+
+	while (1) {
+		ch = getch();
+		if (allowed != NULL 
+		ch != '\0'  strchr(allowed, ch) == NULL) {
+			beep();
+			refresh();
+			continue;
+		}
+		break;
+	}
+	return ch;
+}
+
+int
 get_line(char *buf, int size)
 {
 	char *cp, *end;
@@ -321,7 +339,7 @@
 	nx = curx;
 	ny = cury;
 	for (;;) {
-		mvprintw(BSZ3, (BSZ -6)/2, (%c %d), 
+		mvprintw(BSZ3, (BSZ -6)/2, (%c %d) , 
 'A'+ ((curx  7) ? (curx+1) : curx), cury + 1);
 		BGOTO(cury, curx);
 
@@ -431,9 +449,11 @@
 		break;
 #endif /* 0 */
 		case 'Q':
+		case 'q':
 			return RESIGN;
 			break;
 		case 'S':
+		case 's':
 			return SAVE;
 			break;
 		case ' ':

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.18 src/games/gomoku/gomoku.h:1.19
--- src/games/gomoku/gomoku.h:1.18	Mon Mar 29 03:51:55 2010
+++ src/games/gomoku/gomoku.h	Mon Mar 29 04:28:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.18 2010/03/29 03:51:55 dholland Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.19 2010/03/29 04:28:47 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -269,6 +269,7 @@
 
 void	bdinit(struct spotstr *);
 int	get_coord(void);
+int	get_key(const char *allowedkeys);
 int	get_line(char *, int);
 void	ask(const char *);
 void	dislog(const char *);

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.23 src/games/gomoku/main.c:1.24
--- src/games/gomoku/main.c:1.23	Mon Mar 29 03:51:55 2010
+++ src/games/gomoku/main.c	Mon Mar 29 04:28:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.23 2010/03/29 03:51:55 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.4 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: main.c,v 1.23 2010/03/29 03:51:55 dholland Exp $);
+__RCSID($NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -165,9 +165,11 @@
 #endif
 
 		if (inputfp == NULL  test == 0) {
-			ask(black or white? );
+			move(BSZ3, 0);
+			printw(Black moves first. );
+			ask((B)lack or (W)hite? );
 			for (;;) {
-ch = getchar();
+ch = get_key(NULL);
 if (ch == 'b' || ch == 'B') {
 	color = BLACK;
 	break;
@@ -176,8 +178,11 @@
 	color = WHITE;
 	break;
 }
-move(BSZ3, 0);
-printw(Black moves first. Please enter `black' or `white'\n);
+if (ch == 'q' || ch == 'Q') {
+	quit();
+}
+beep();
+ask(Please choose (B)lack or (W)hite: );
 			}
 			move(BSZ3, 0);
 			clrtoeol();
@@ -253,12 +258,12 @@
 		case USER: /* input comes from standard input */
 		getinput:
 			if (interactive) {
-ask(move? );
+ask(Select move, (S)ave or (Q)uit.);
 curmove = get_coord();
 if (curmove == SAVE) {
 	FILE *fp;
 
-	ask(save file name? );
+	ask(Save file name? );
 	(void)get_line(fname, sizeof(fname));
 	if ((fp = fopen(fname, w)) == NULL) {
 		misclog(cannot create save file);
@@ -313,7 +318,7 @@
 addstr(Rats! you won);
 			break;
 		case TIE:
-			addstr(Wow! its a tie);
+			addstr(Wow! It's a tie);
 			break;
 		case ILLEGAL:
 			addstr(Illegal move);
@@ -323,14 +328,14 @@
 		bdisp();
 		if (i != RESIGN) {
 		replay:
-			ask(replay? );
-			if (get_line(buf, sizeof(buf)) 
-			(buf[0] == 'y' || buf[0] == 'Y'))
+			ask(Play again? );
+			ch = get_key(YyNnQqSs); 
+			if (ch == 'Y' || ch == 'y')
 goto again;
-			if (strcmp(buf, save) == 0) {
+			if (ch == 'S') {
 FILE *fp;
 
-ask(save file name? );
+ask(Save file name? );
 (void)get_line(fname, sizeof(fname));
 if ((fp = fopen(fname, w)) == NULL) {
 	misclog(cannot create save file);
@@ -382,7 +387,7 @@
 	if (!interactive)
 		quit();
 top:
-	ask(cmd? );
+	ask(debug command: );
 	if (!get_line(input, 

CVS commit: src/games/gomoku

2010-03-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 29 05:16:08 UTC 2010

Modified Files:
src/games/gomoku: main.c pickmove.c

Log Message:
remove #ifdef SVR4


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/games/gomoku/main.c
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/pickmove.c

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

Modified files:

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.24 src/games/gomoku/main.c:1.25
--- src/games/gomoku/main.c:1.24	Mon Mar 29 04:28:47 2010
+++ src/games/gomoku/main.c	Mon Mar 29 05:16:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.25 2010/03/29 05:16:08 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.4 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: main.c,v 1.24 2010/03/29 04:28:47 dholland Exp $);
+__RCSID($NetBSD: main.c,v 1.25 2010/03/29 05:16:08 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -145,11 +145,7 @@
 	}
 
 	if (!debug)
-#ifdef SVR4
-		srand(time(0));
-#else
 		srandom(time(0));
-#endif
 	if (interactive)
 		cursinit();		/* initialize curses */
 again:

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.19 src/games/gomoku/pickmove.c:1.20
--- src/games/gomoku/pickmove.c:1.19	Wed Aug 12 06:19:17 2009
+++ src/games/gomoku/pickmove.c	Mon Mar 29 05:16:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pickmove.c,v 1.19 2009/08/12 06:19:17 dholland Exp $	*/
+/*	$NetBSD: pickmove.c,v 1.20 2010/03/29 05:16:08 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)pickmove.c	8.2 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: pickmove.c,v 1.19 2009/08/12 06:19:17 dholland Exp $);
+__RCSID($NetBSD: pickmove.c,v 1.20 2010/03/29 05:16:08 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -217,11 +217,7 @@
 	if (sp-s_wval != sp1-s_wval)
 		return (0);
 
-#ifdef SVR4
-	return (rand()  1);
-#else
 	return (random()  1);
-#endif
 }
 
 static int curcolor;	/* implicit parameter to makecombo() */