CVS commit: src/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 09:17:12 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
g/c unused global


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.76 src/lib/librumphijack/hijack.c:1.77
--- src/lib/librumphijack/hijack.c:1.76	Tue Mar  8 21:36:01 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 09:17:12 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.76 2011/03/08 21:36:01 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.77 2011/03/09 09:17:12 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.76 2011/03/08 21:36:01 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.77 2011/03/09 09:17:12 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -234,7 +234,6 @@
 
 static pid_t	(*host_fork)(void);
 static int	(*host_daemon)(int, int);
-static int	(*host_execve)(const char *, char *const[], char *const[]);
 static void *	(*host_mmap)(void *, size_t, int, int, int, off_t);
 
 /*
@@ -568,7 +567,6 @@
 
 	host_fork = dlsym(RTLD_NEXT, fork);
 	host_daemon = dlsym(RTLD_NEXT, daemon);
-	host_execve = dlsym(RTLD_NEXT, execve);
 	host_mmap = dlsym(RTLD_NEXT, mmap);
 
 	/*



CVS commit: src/sys/dev/nand

2011-03-09 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Wed Mar  9 10:05:08 UTC 2011

Modified Files:
src/sys/dev/nand: files.nand nand.c nand.h
Added Files:
src/sys/dev/nand: nand_micron.c

Log Message:
Add support for legacy devices not supporting the ONFI READ_PARAMETER_PAGE
command with example usage for Micron chips


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/nand/files.nand
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/nand/nand.c src/sys/dev/nand/nand.h
cvs rdiff -u -r0 -r1.1 src/sys/dev/nand/nand_micron.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/nand/files.nand
diff -u src/sys/dev/nand/files.nand:1.1 src/sys/dev/nand/files.nand:1.2
--- src/sys/dev/nand/files.nand:1.1	Sat Feb 26 18:07:31 2011
+++ src/sys/dev/nand/files.nand	Wed Mar  9 10:05:08 2011
@@ -1,4 +1,4 @@
-# $NetBSD: files.nand,v 1.1 2011/02/26 18:07:31 ahoka Exp $
+# $NetBSD: files.nand,v 1.2 2011/03/09 10:05:08 ahoka Exp $
 
 define	nandbus	{ }
 
@@ -9,6 +9,7 @@
 file	dev/nand/hamming.c	nand
 file	dev/nand/nand_bbt.c	nand
 file	dev/nand/nand_crc.c	nand
+file	dev/nand/nand_micron.c	nand
 
 defpseudodev	nandemulator: nandbus
 file	dev/nand/nandemulator.c	nandemulator

Index: src/sys/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.2 src/sys/dev/nand/nand.c:1.3
--- src/sys/dev/nand/nand.c:1.2	Wed Mar  9 07:49:15 2011
+++ src/sys/dev/nand/nand.c	Wed Mar  9 10:05:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.2 2011/03/09 07:49:15 ahoka Exp $	*/
+/*	$NetBSD: nand.c,v 1.3 2011/03/09 10:05:08 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.2 2011/03/09 07:49:15 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.3 2011/03/09 10:05:08 ahoka Exp $);
 
 #include locators.h
 
@@ -117,8 +117,10 @@
 		aprint_error(NAND chip is write protected!\n);
 		return;
 	}
-	if (nand_scan_media(self, chip))
+	
+	if (nand_scan_media(self, chip)) {
 		return;
+	}
 
 	/* allocate cache */
 	chip-nc_oob_cache = kmem_alloc(chip-nc_spare_size, KM_SLEEP);
@@ -281,6 +283,19 @@
 }
 #endif
 
+static int
+nand_read_legacy_parameters(device_t self, struct nand_chip *chip)
+{
+	switch (chip-nc_manf_id) {
+	case NAND_MFR_MICRON:
+		return nand_read_parameters_micron(self, chip);
+	default:
+		return 1;
+	}
+	
+	return 0;
+}
+
 /**
  * scan media to determine the chip's properties
  * this function resets the device
@@ -296,6 +311,7 @@
 	nand_command(self, ONFI_RESET);
 	nand_select(self, false);
 
+	/* check if the device implements the ONFI standard */
 	nand_select(self, true);
 	nand_command(self, ONFI_READ_ID);
 	nand_address(self, 0x20);
@@ -307,24 +323,48 @@
 
 	if (onfi_signature[0] != 'O' || onfi_signature[1] != 'N' ||
 	onfi_signature[2] != 'F' || onfi_signature[3] != 'I') {
-		aprint_error_dev(self,
-		device does not support the ONFI specification\n);
+		chip-nc_isonfi = false;
+		
+		aprint_normal(: Legacy NAND Flash\n);
+		
+		nand_readid(self, chip);
 
-		return 1;
-	}
+		if (nand_read_legacy_parameters(self, chip)) {
+			aprint_error_dev(self,
+			can't read device parameters for legacy chip\n);
+			return 1;
+		}
+	} else {
+		chip-nc_isonfi = true;
 
-	nand_readid(self, chip);
+		aprint_normal(: ONFI NAND Flash\n);
 
-	aprint_normal(: NAND Flash\n);
+		nand_readid(self, chip);
+		nand_read_parameter_page(self, chip);
+	}
 
-	aprint_debug_dev(self,
+#ifdef NAND_VERBOSE
+	aprint_normal_dev(self,
 	manufacturer id: 0x%.2x (%s), device id: 0x%.2x\n,
 	chip-nc_manf_id,
 	nand_midtoname(chip-nc_manf_id),
 	chip-nc_dev_id);
+#endif
 
-	nand_read_parameter_page(self, chip);
+	aprint_normal_dev(self,
+	   page size: %u bytes, spare size: %u bytes, block size: %u bytes\n,
+	chip-nc_page_size, chip-nc_spare_size, chip-nc_block_size);
+
+	aprint_normal_dev(self,
+	LUN size: %u blocks, LUNs: %u, total storage size: %u MB\n,
+	chip-nc_lun_blocks, chip-nc_num_luns,
+	chip-nc_size / 1024 / 1024);
 
+#ifdef NAND_VERBOSE
+	aprint_normal_dev(self, column cycles: %d, row cycles: %d\n,
+	chip-nc_addr_cycles_column, chip-nc_addr_cycles_row);
+#endif
+		
 	ecc = chip-nc_ecc = sc-nand_if-ecc;
 
 	/*
@@ -388,12 +428,13 @@
 	nand_select(self, true);
 	nand_command(self, ONFI_READ_ID);
 	nand_address(self, 0x00);
+	
 	nand_read_byte(self, chip-nc_manf_id);
 	nand_read_byte(self, chip-nc_dev_id);
+	
 	nand_select(self, false);
 }
 
-/* read the parameter page. TODO: check CRC! */
 static void
 nand_read_parameter_page(device_t self, struct nand_chip *chip)
 {
@@ -435,20 +476,10 @@
 
 	aprint_normal_dev(self, vendor: %s, model: %s\n, vendor, model);
 
-	aprint_normal_dev(self,
-	   page size: %u bytes, spare size: %u bytes, block size: %u bytes\n,
-	params.param_pagesize, params.param_sparesize,
-	

CVS commit: src/sys/modules/nand

2011-03-09 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Wed Mar  9 10:05:28 UTC 2011

Modified Files:
src/sys/modules/nand: Makefile

Log Message:
+ nand_micron.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/nand/Makefile

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

Modified files:

Index: src/sys/modules/nand/Makefile
diff -u src/sys/modules/nand/Makefile:1.1 src/sys/modules/nand/Makefile:1.2
--- src/sys/modules/nand/Makefile:1.1	Sat Feb 26 18:07:31 2011
+++ src/sys/modules/nand/Makefile	Wed Mar  9 10:05:28 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/02/26 18:07:31 ahoka Exp $
+# $NetBSD: Makefile,v 1.2 2011/03/09 10:05:28 ahoka Exp $
 
 .include ../Makefile.inc
 
@@ -11,5 +11,6 @@
 SRCS+=	nand_bbt.c
 SRCS+=	nand_crc.c
 SRCS+=	hamming.c
+SRCS+=	nand_micron.c
 
 .include bsd.kmodule.mk



CVS commit: src/sys/rump/include/rump

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 10:10:19 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump.h

Log Message:
Duh, the nfsd hacks in tests still used RUMP_SYS_NETWORKING.  It
appears that using nxr to search for users wasn't a very good idea.
Put networking back and make the test of the defines give out
#errors.

me be fixink this


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/rump/include/rump/rump.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/rump/include/rump/rump.h
diff -u src/sys/rump/include/rump/rump.h:1.51 src/sys/rump/include/rump/rump.h:1.52
--- src/sys/rump/include/rump/rump.h:1.51	Tue Mar  8 18:35:10 2011
+++ src/sys/rump/include/rump/rump.h	Wed Mar  9 10:10:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.h,v 1.51 2011/03/08 18:35:10 pooka Exp $	*/
+/*	$NetBSD: rump.h,v 1.52 2011/03/09 10:10:19 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -125,4 +125,53 @@
 _END_DECLS
 #endif
 
+/*
+ * Begin rump syscall conditionals.  Yes, something a little better
+ * is required here.
+ */
+#ifdef RUMP_SYS_NETWORKING
+#define socket(a,b,c) rump_sys_socket(a,b,c)
+#define accept(a,b,c) rump_sys_accept(a,b,c)
+#define bind(a,b,c) rump_sys_bind(a,b,c)
+#define connect(a,b,c) rump_sys_connect(a,b,c)
+#define getpeername(a,b,c) rump_sys_getpeername(a,b,c)
+#define getsockname(a,b,c) rump_sys_getsockname(a,b,c)
+#define listen(a,b) rump_sys_listen(a,b)
+#define recvfrom(a,b,c,d,e,f) rump_sys_recvfrom(a,b,c,d,e,f)
+#define recvmsg(a,b,c) rump_sys_recvmsg(a,b,c)
+#define sendto(a,b,c,d,e,f) rump_sys_sendto(a,b,c,d,e,f)
+#define sendmsg(a,b,c) rump_sys_sendmsg(a,b,c)
+#define getsockopt(a,b,c,d,e) rump_sys_getsockopt(a,b,c,d,e)
+#define setsockopt(a,b,c,d,e) rump_sys_setsockopt(a,b,c,d,e)
+#define shutdown(a,b) rump_sys_shutdown(a,b)
+#endif /* RUMP_SYS_NETWORKING */
+
+#ifdef RUMP_SYS_IOCTL
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_IOCTL */
+
+#ifdef RUMP_SYS_CLOSE
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_CLOSE */
+
+#ifdef RUMP_SYS_OPEN
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_OPEN */
+
+#ifdef RUMP_SYS_READWRITE
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_READWRITE */
+
+#ifdef RUMP_SYS_FILEOPS
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_FILEOPS */
+
+#ifdef RUMP_SYS_STAT
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_STAT */
+
+#ifdef RUMP_SYS_PROCOPS
+#error deprecated syscall selection.  use rumphijack
+#endif /* RUMP_SYS_PROCOPS */
+
 #endif /* _RUMP_RUMP_H_ */



CVS commit: src/sys/opencrypto

2011-03-09 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Mar  9 11:36:43 UTC 2011

Modified Files:
src/sys/opencrypto: deflate.c deflate.h

Log Message:
-start to make the GZIP code similar to DEFLATE: make error handling
 work the same way, grow output buffer exponentially and kill
 reallocation of metadata
-minor cleanup, make definitions private which are implementation
 details of deflate.gzip


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/opencrypto/deflate.c
cvs rdiff -u -r1.8 -r1.9 src/sys/opencrypto/deflate.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/opencrypto/deflate.c
diff -u src/sys/opencrypto/deflate.c:1.19 src/sys/opencrypto/deflate.c:1.20
--- src/sys/opencrypto/deflate.c:1.19	Thu Feb 24 20:03:41 2011
+++ src/sys/opencrypto/deflate.c	Wed Mar  9 11:36:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: deflate.c,v 1.19 2011/02/24 20:03:41 drochner Exp $ */
+/*	$NetBSD: deflate.c,v 1.20 2011/03/09 11:36:43 drochner Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/deflate.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $	*/
 /* $OpenBSD: deflate.c,v 1.3 2001/08/20 02:45:22 hugh Exp $ */
 
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: deflate.c,v 1.19 2011/02/24 20:03:41 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: deflate.c,v 1.20 2011/03/09 11:36:43 drochner Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -46,6 +46,12 @@
 #include opencrypto/cryptodev.h
 #include opencrypto/deflate.h
 
+#define ZBUF 10
+
+struct deflate_buf {
+	u_int8_t *out;
+	u_int32_t size;
+};
 
 int window_inflate = -1 * MAX_WBITS;
 int window_deflate = -12;
@@ -225,50 +231,37 @@
 	z_stream zbuf;
 	u_int8_t *output;
 	u_int32_t count, result;
-	int error, i = 0, j;
-	struct deflate_buf *buf, *tmp;
-	size_t nbufs;
+	int error, i, j;
+	struct deflate_buf buf[ZBUF];
 	u_int32_t crc;
 	u_int32_t isize, icrc;
 
 	DPRINTF((gzip_global: decomp %d, size %d\n, decomp, size));
 
-	nbufs = ZBUF;
-	buf = malloc(nbufs*sizeof(struct deflate_buf), M_CRYPTO_DATA, M_NOWAIT);
-	if (buf == NULL) {
-		DPRINTF((gzip_global.%d: failed to malloc %d\n,
-__LINE__, nbufs*sizeof(struct deflate_buf)));
-		return 0;
-	}
-
 	memset(zbuf, 0, sizeof(z_stream));
 	zbuf.zalloc = ocf_zalloc;
 	zbuf.zfree = ocf_zfree;
 	zbuf.opaque = Z_NULL;
 
-	crc = crc32(0, NULL, 0);	/* get initial crc value */
-
-	zbuf.avail_in = size;	/* Total length of data to be processed */
-	zbuf.next_in = data;	/* data that is going to be processed */
-
 	if (!decomp) {
 		/* compress */
-		DPRINTF((gzip_global: compress[%d] malloc %d + %d + %d = %d\n,
-i, size, sizeof(gzip_header), GZIP_TAIL_SIZE,
+		DPRINTF((gzip_global: compress malloc %d + %d + %d = %d\n,
+size, sizeof(gzip_header), GZIP_TAIL_SIZE,
 size + sizeof(gzip_header) + GZIP_TAIL_SIZE));
 
 		buf[0].size = size;
-
-		crc = crc32(crc, data, size);
+		crc = crc32(0, data, size);
 		DPRINTF((gzip_compress: size %d, crc 0x%x\n, size, crc));
+		zbuf.avail_in = size;	/* Total length of data to be processed */
+		zbuf.next_in = data;	/* data that is going to be processed */
 	} else {
 		/* decompress */
 		/* check the gzip header */
-		if (zbuf.avail_in = 0) {
+		if (size = sizeof(gzip_header) + GZIP_TAIL_SIZE) {
 			/* Not enough data for the header  tail */
 			DPRINTF((gzip_global: not enough data (%d)\n,
 	size));
-			goto bad2;
+			return 0;
 		}
 
 		/* XXX this is pretty basic,
@@ -281,7 +274,7 @@
 		if (memcmp(data, gzip_header, sizeof(gzip_header)) != 0) {
 			DPRINTF((gzip_global: unsupported gzip header (%02x%02x)\n,
 	data[0], data[1]));
-			goto bad2;
+			return 0;
 		} else {
 			DPRINTF((gzip_global.%d: gzip header ok\n,__LINE__));
 		}
@@ -299,6 +292,7 @@
 data[size-1]));
 
 		buf[0].size = isize;
+		crc = crc32(0, NULL, 0);	/* get initial crc value */
 
 		/* skip over the gzip header */
 		zbuf.next_in = data + sizeof(gzip_header);
@@ -309,7 +303,7 @@
 
 	buf[0].out = malloc(buf[0].size, M_CRYPTO_DATA, M_NOWAIT);
 	if (buf[0].out == NULL)
-		goto bad2;
+		return 0;
 	zbuf.next_out = buf[0].out;
 	zbuf.avail_out = buf[0].size;
 	DPRINTF((zbuf avail_in %d, avail_out %d\n,
@@ -322,7 +316,7 @@
 
 	if (error != Z_OK) {
 		printf(deflateInit2() failed\n);
-		goto bad;
+		goto bad2;
 	}
 	for (;;) {
 		DPRINTF((pre: %s in:%d out:%d\n, decomp ? deflate() : inflate(), 
@@ -331,37 +325,32 @@
  deflate(zbuf, Z_FINISH);
 		DPRINTF((post: %s in:%d out:%d\n, decomp ? deflate() : inflate(), 
 zbuf.avail_in, zbuf.avail_out));
-		if (error != Z_OK  error != Z_STREAM_END) {
-			printf(deflate() or inflate() failed, error=%d\n, error);
+		if (error == Z_STREAM_END) /* success */
+			break;
+		/*
+		 * XXX compensate for a zlib problem:
+		 * -sys/net/zlib.c has a bug which makes that Z_BUF_ERROR is
+		 *  set after successful decompression under rare conditions.
+		 */
+		else if (decomp  error == Z_BUF_ERROR
+			  zbuf.avail_in == 0  

CVS commit: src/sys/opencrypto

2011-03-09 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Mar  9 11:43:36 UTC 2011

Modified Files:
src/sys/opencrypto: xform.c xform.h

Log Message:
const'fy algorithm descriptors


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/opencrypto/xform.c
cvs rdiff -u -r1.12 -r1.13 src/sys/opencrypto/xform.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/opencrypto/xform.c
diff -u src/sys/opencrypto/xform.c:1.20 src/sys/opencrypto/xform.c:1.21
--- src/sys/opencrypto/xform.c:1.20	Fri Feb 25 20:13:10 2011
+++ src/sys/opencrypto/xform.c	Wed Mar  9 11:43:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform.c,v 1.20 2011/02/25 20:13:10 drochner Exp $ */
+/*	$NetBSD: xform.c,v 1.21 2011/03/09 11:43:36 drochner Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $	*/
 /*	$OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $	*/
 
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xform.c,v 1.20 2011/02/25 20:13:10 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: xform.c,v 1.21 2011/03/09 11:43:36 drochner Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -89,130 +89,130 @@
 };
 
 /* Encryption instances */
-struct enc_xform enc_xform_null = {
+const struct enc_xform enc_xform_null = {
 	CRYPTO_NULL_CBC, NULL,
 	/* NB: blocksize of 4 is to generate a properly aligned ESP header */
 	4, 0, 256 /* 2048 bits, max key */
 };
 
-struct enc_xform enc_xform_des = {
+const struct enc_xform enc_xform_des = {
 	CRYPTO_DES_CBC, DES,
 	8, 8, 8
 };
 
-struct enc_xform enc_xform_3des = {
+const struct enc_xform enc_xform_3des = {
 	CRYPTO_3DES_CBC, 3DES,
 	8, 24, 24
 };
 
-struct enc_xform enc_xform_blf = {
+const struct enc_xform enc_xform_blf = {
 	CRYPTO_BLF_CBC, Blowfish,
 	8, 5, 56 /* 448 bits, max key */
 };
 
-struct enc_xform enc_xform_cast5 = {
+const struct enc_xform enc_xform_cast5 = {
 	CRYPTO_CAST_CBC, CAST-128,
 	8, 5, 16
 };
 
-struct enc_xform enc_xform_skipjack = {
+const struct enc_xform enc_xform_skipjack = {
 	CRYPTO_SKIPJACK_CBC, Skipjack,
 	8, 10, 10
 };
 
-struct enc_xform enc_xform_rijndael128 = {
+const struct enc_xform enc_xform_rijndael128 = {
 	CRYPTO_RIJNDAEL128_CBC, Rijndael-128/AES,
 	16, 8, 32
 };
 
-struct enc_xform enc_xform_arc4 = {
+const struct enc_xform enc_xform_arc4 = {
 	CRYPTO_ARC4, ARC4,
 	1, 1, 32
 };
 
 /* Authentication instances */
-struct auth_hash auth_hash_null = {
+const struct auth_hash auth_hash_null = {
 	CRYPTO_NULL_HMAC, NULL-HMAC,
 	0, 0, 12, 64, sizeof(int)		/* NB: context isn't used */
 };
 
-struct auth_hash auth_hash_hmac_md5 = {
+const struct auth_hash auth_hash_hmac_md5 = {
 	CRYPTO_MD5_HMAC, HMAC-MD5,
 	16, 16, 16, 64, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha1 = {
+const struct auth_hash auth_hash_hmac_sha1 = {
 	CRYPTO_SHA1_HMAC, HMAC-SHA1,
 	20, 20, 20, 64, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_ripemd_160 = {
+const struct auth_hash auth_hash_hmac_ripemd_160 = {
 	CRYPTO_RIPEMD160_HMAC, HMAC-RIPEMD-160,
 	20, 20, 20, 64, sizeof(RMD160_CTX)
 };
 
-struct auth_hash auth_hash_hmac_md5_96 = {
+const struct auth_hash auth_hash_hmac_md5_96 = {
 	CRYPTO_MD5_HMAC_96, HMAC-MD5-96,
 	16, 16, 12, 64, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha1_96 = {
+const struct auth_hash auth_hash_hmac_sha1_96 = {
 	CRYPTO_SHA1_HMAC_96, HMAC-SHA1-96,
 	20, 20, 12, 64, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_ripemd_160_96 = {
+const struct auth_hash auth_hash_hmac_ripemd_160_96 = {
 	CRYPTO_RIPEMD160_HMAC_96, HMAC-RIPEMD-160,
 	20, 20, 12, 64, sizeof(RMD160_CTX)
 };
 
-struct auth_hash auth_hash_key_md5 = {
+const struct auth_hash auth_hash_key_md5 = {
 	CRYPTO_MD5_KPDK, Keyed MD5,
 	0, 16, 16, 0, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_key_sha1 = {
+const struct auth_hash auth_hash_key_sha1 = {
 	CRYPTO_SHA1_KPDK, Keyed SHA1,
 	0, 20, 20, 0, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_md5 = {
+const struct auth_hash auth_hash_md5 = {
 	CRYPTO_MD5, MD5,
 	0, 16, 16, 0, sizeof(MD5_CTX)
 };
 
-struct auth_hash auth_hash_sha1 = {
+const struct auth_hash auth_hash_sha1 = {
 	CRYPTO_SHA1, SHA1,
 	0, 20, 20, 0, sizeof(SHA1_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_256 = {
+const struct auth_hash auth_hash_hmac_sha2_256 = {
 	CRYPTO_SHA2_256_HMAC, HMAC-SHA2,
 	32, 32, 16, 64, sizeof(SHA256_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_384 = {
+const struct auth_hash auth_hash_hmac_sha2_384 = {
 	CRYPTO_SHA2_384_HMAC, HMAC-SHA2-384,
 	48, 48, 24, 128, sizeof(SHA384_CTX)
 };
 
-struct auth_hash auth_hash_hmac_sha2_512 = {
+const struct auth_hash auth_hash_hmac_sha2_512 = {
 	CRYPTO_SHA2_512_HMAC, HMAC-SHA2-512,
 	64, 64, 32, 128, sizeof(SHA512_CTX)
 };
 
 /* Compression instance */
-struct comp_algo comp_algo_deflate = {
+const struct comp_algo comp_algo_deflate = {
 	CRYPTO_DEFLATE_COMP, Deflate,
 	90
 };
 
-struct 

CVS commit: src/sys/rump/dev/lib/libcgd

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 11:56:17 UTC 2011

Modified Files:
src/sys/rump/dev/lib/libcgd: component.c

Log Message:
Create cgd block device files in the right directory.
hi pooka!


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/dev/lib/libcgd/component.c

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

Modified files:

Index: src/sys/rump/dev/lib/libcgd/component.c
diff -u src/sys/rump/dev/lib/libcgd/component.c:1.6 src/sys/rump/dev/lib/libcgd/component.c:1.7
--- src/sys/rump/dev/lib/libcgd/component.c:1.6	Mon Mar  1 13:12:19 2010
+++ src/sys/rump/dev/lib/libcgd/component.c	Wed Mar  9 11:56:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.6 2010/03/01 13:12:19 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.7 2011/03/09 11:56:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: component.c,v 1.6 2010/03/01 13:12:19 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: component.c,v 1.7 2011/03/09 11:56:17 pooka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -50,7 +50,7 @@
 	cgd_cdevsw, cmaj)) != 0)
 		panic(cannot attach cgd: %d, error);
 
-	if ((error = rump_vfs_makedevnodes(S_IFBLK, cgd0, 'a',
+	if ((error = rump_vfs_makedevnodes(S_IFBLK, /dev/cgd0, 'a',
 	bmaj, 0, 7)) != 0)
 		panic(cannot create cooked cgd dev nodes: %d, error);
 	if ((error = rump_vfs_makedevnodes(S_IFCHR, /dev/rcgd0, 'a',



CVS commit: src/sys/dev/nand

2011-03-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar  9 12:13:42 UTC 2011

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

Log Message:
Use %zu for size_t


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/nand/nand.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/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.3 src/sys/dev/nand/nand.c:1.4
--- src/sys/dev/nand/nand.c:1.3	Wed Mar  9 10:05:08 2011
+++ src/sys/dev/nand/nand.c	Wed Mar  9 12:13:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.3 2011/03/09 10:05:08 ahoka Exp $	*/
+/*	$NetBSD: nand.c,v 1.4 2011/03/09 12:13:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.3 2011/03/09 10:05:08 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.4 2011/03/09 12:13:42 martin Exp $);
 
 #include locators.h
 
@@ -352,11 +352,11 @@
 #endif
 
 	aprint_normal_dev(self,
-	   page size: %u bytes, spare size: %u bytes, block size: %u bytes\n,
+	   page size: %zu bytes, spare size: %zu bytes, block size: %zu bytes\n,
 	chip-nc_page_size, chip-nc_spare_size, chip-nc_block_size);
 
 	aprint_normal_dev(self,
-	LUN size: %u blocks, LUNs: %u, total storage size: %u MB\n,
+	LUN size: %u blocks, LUNs: %u, total storage size: %zu MB\n,
 	chip-nc_lun_blocks, chip-nc_num_luns,
 	chip-nc_size / 1024 / 1024);
 



CVS commit: src/sys/dev/nand

2011-03-09 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Wed Mar  9 12:33:59 UTC 2011

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

Log Message:
Add some PRIxxx macros to correctly print stdint types


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/nand/nand.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/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.4 src/sys/dev/nand/nand.c:1.5
--- src/sys/dev/nand/nand.c:1.4	Wed Mar  9 12:13:42 2011
+++ src/sys/dev/nand/nand.c	Wed Mar  9 12:33:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.4 2011/03/09 12:13:42 martin Exp $	*/
+/*	$NetBSD: nand.c,v 1.5 2011/03/09 12:33:59 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.4 2011/03/09 12:13:42 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: nand.c,v 1.5 2011/03/09 12:33:59 ahoka Exp $);
 
 #include locators.h
 
@@ -352,16 +352,19 @@
 #endif
 
 	aprint_normal_dev(self,
-	   page size: %zu bytes, spare size: %zu bytes, block size: %zu bytes\n,
+	page size: %zu bytes, spare size: %zu bytes, 
+	block size: %zu bytes\n,
 	chip-nc_page_size, chip-nc_spare_size, chip-nc_block_size);
 
 	aprint_normal_dev(self,
-	LUN size: %u blocks, LUNs: %u, total storage size: %zu MB\n,
+	LUN size: % PRIu32  blocks, LUNs: % PRIu8
+	, total storage size: %zu MB\n,
 	chip-nc_lun_blocks, chip-nc_num_luns,
 	chip-nc_size / 1024 / 1024);
 
 #ifdef NAND_VERBOSE
-	aprint_normal_dev(self, column cycles: %d, row cycles: %d\n,
+	aprint_normal_dev(self, column cycles: % PRIu8 , row cycles: %
+	PRIu8 \n,
 	chip-nc_addr_cycles_column, chip-nc_addr_cycles_row);
 #endif
 		



CVS commit: src/usr.bin/shmif_dumpbus

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 12:56:09 UTC 2011

Modified Files:
src/usr.bin/shmif_dumpbus: shmif_dumpbus.c

Log Message:
print processing details only if we've not outputting a pcap file
to stdout


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

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

Modified files:

Index: src/usr.bin/shmif_dumpbus/shmif_dumpbus.c
diff -u src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.1 src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.2
--- src/usr.bin/shmif_dumpbus/shmif_dumpbus.c:1.1	Wed Jan 12 16:14:24 2011
+++ src/usr.bin/shmif_dumpbus/shmif_dumpbus.c	Wed Mar  9 12:56:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmif_dumpbus.c,v 1.1 2011/01/12 16:14:24 pooka Exp $	*/
+/*	$NetBSD: shmif_dumpbus.c,v 1.2 2011/03/09 12:56:08 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -139,7 +139,7 @@
 		if (write(pfd, phdr, sizeof(phdr)) != sizeof(phdr))
 			err(1, phdr write);
 	} else {
-		pfd = 0; /* XXXgcc */
+		pfd = -1; /* XXXgcc */
 	}
 	
 	curbus = bmem-shm_first;
@@ -167,8 +167,10 @@
 		if (sp.sp_len == 0)
 			continue;
 
-		printf(packet %d, offset 0x%04x, length 0x%04x, ts %d/%06d\n,
-		i++, curbus, sp.sp_len, sp.sp_sec, sp.sp_usec);
+		if (pfd != STDOUT_FILENO)
+			printf(packet %d, offset 0x%04x, length 0x%04x, 
+			ts %d/%06d\n, i++, curbus,
+			sp.sp_len, sp.sp_sec, sp.sp_usec);
 
 		if (!pcapfile || sp.sp_len == 0) {
 			curbus = shmif_busread(bmem,



CVS commit: src/sys/arch/newsmips/newsmips

2011-03-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar  9 13:21:36 UTC 2011

Modified Files:
src/sys/arch/newsmips/newsmips: autoconf.c machdep.c news3400.c
news5000.c

Log Message:
Fix newsmips interrupt handling for new mips interrupt/spl framework:
 - make news3400_badaddr() work even if interrupts are disabled
   (in the old world bus error interrupt is enabled even during splhigh())
 - make ipl_sr_map values model dependent

Now GENERIC kernel boots to single user properly on R3000 NWS-3470D,
though sh(1) still gets floating point exceptions during /etc/rc scripts.
news5000 is untested (yet).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/newsmips/newsmips/autoconf.c
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/newsmips/newsmips/machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/newsmips/news3400.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/newsmips/news5000.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/newsmips/newsmips/autoconf.c
diff -u src/sys/arch/newsmips/newsmips/autoconf.c:1.34 src/sys/arch/newsmips/newsmips/autoconf.c:1.35
--- src/sys/arch/newsmips/newsmips/autoconf.c:1.34	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/autoconf.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,7 +49,7 @@
 #define __INTR_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -94,19 +94,14 @@
 	/*
 	 * Kick off autoconfiguration
 	 */
-	spl0();		/* enable all interrupts */
-	splhigh();	/* ...then disable device interrupts */
-
-	if (systype == NEWS3400) {
-		*(char *)INTEN0 = INTEN0_BERR;	/* only buserr occurs */
-		*(char *)INTEN1 = 0;
-	}
+	(*disable_intr)();
+	(void)splhigh();
 
 	if (config_rootfound(mainbus, NULL) == NULL)
 		panic(no mainbus found);
 
 	/* Enable hardware interrupt registers. */
-	enable_intr();
+	(*enable_intr)();
 
 	/* Configuration is finished, turn on interrupts. */
 	spl0();		/* enable all source forcing SOFT_INTs cleared */

Index: src/sys/arch/newsmips/newsmips/machdep.c
diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.112 src/sys/arch/newsmips/newsmips/machdep.c:1.113
--- src/sys/arch/newsmips/newsmips/machdep.c:1.112	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/machdep.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $);
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -138,27 +138,6 @@
 extern void stacktrace(void); /*XXX*/
 #endif
 
-/*
- * This is a mask of bits to clear in the SR when we go to a
- * given interrupt priority level.
- */
-const struct ipl_sr_map newsmips_ipl_sr_map = {
-.sr_bits = {
-	[IPL_NONE] =		0,
-	[IPL_SOFTCLOCK] =	MIPS_SOFT_INT_MASK_0,
-	[IPL_SOFTNET] =		MIPS_SOFT_INT_MASK,
-	[IPL_VM] =		MIPS_SOFT_INT_MASK
-| MIPS_INT_MASK_0
-| MIPS_INT_MASK_1,
-	[IPL_SCHED] =		MIPS_SOFT_INT_MASK
-| MIPS_INT_MASK_0
-| MIPS_INT_MASK_1
-| MIPS_INT_MASK_2,
-	[IPL_DDB] =		MIPS_INT_MASK,
-	[IPL_HIGH] =		MIPS_INT_MASK,
-},
-};
-
 extern u_long bootdev;
 extern char edata[], end[];
 
@@ -284,7 +263,6 @@
 	 * Initialize locore-function vector.
 	 * Clear out the I and D caches.
 	 */
-	ipl_sr_map = newsmips_ipl_sr_map;
 	mips_vector_init(NULL, false);
 
 	/*

Index: src/sys/arch/newsmips/newsmips/news3400.c
diff -u src/sys/arch/newsmips/newsmips/news3400.c:1.20 src/sys/arch/newsmips/newsmips/news3400.c:1.21
--- src/sys/arch/newsmips/newsmips/news3400.c:1.20	Sun Feb 20 07:56:31 2011
+++ src/sys/arch/newsmips/newsmips/news3400.c	Wed Mar  9 13:21:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $	*/
+/*	$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $);
 
 #define __INTR_PRIVATE
 #include sys/param.h
@@ -59,6 +59,27 @@
 #define INT_MASK_FPU MIPS_INT_MASK_3
 
 /*
+ * This is a mask of bits to clear in the SR when we go to a
+ * given interrupt priority 

CVS commit: src/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 15:03:18 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Add a bunch of process-wide hijack calls.  Among other things, it's
now possible to use unmodified userspace binaries (rpcbind, mountd,
nfsd) to start a rump nfs service and mount file systems from it.

pain-rustique:42:~ mount
rumpfs on / type rumpfs (local)
10.1.1.1:/export on /mnt type nfs


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.77 src/lib/librumphijack/hijack.c:1.78
--- src/lib/librumphijack/hijack.c:1.77	Wed Mar  9 09:17:12 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 15:03:18 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.77 2011/03/09 09:17:12 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.78 2011/03/09 15:03:18 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.77 2011/03/09 09:17:12 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.78 2011/03/09 15:03:18 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -94,6 +94,9 @@
 	DUALCALL_CHFLAGS, DUALCALL_LCHFLAGS, DUALCALL_FCHFLAGS,
 	DUALCALL_ACCESS,
 	DUALCALL_MKNOD,
+	DUALCALL___SYSCTL,
+	DUALCALL_GETVFSSTAT, DUALCALL_NFSSVC,
+	DUALCALL_GETFH, DUALCALL_FHOPEN, DUALCALL_FHSTAT, DUALCALL_FHSTATVFS1,
 	DUALCALL__NUM
 };
 
@@ -115,6 +118,7 @@
 #define REALLUTIMES lutimes
 #define REALFUTIMES futimes
 #define REALMKNOD mknod
+#define REALFHSTAT __fhstat40
 #else
 #define REALSELECT _sys___select50
 #define REALPOLLTS _sys___pollts50
@@ -126,12 +130,16 @@
 #define REALLUTIMES __lutimes50
 #define REALFUTIMES __futimes50
 #define REALMKNOD __mknod50
+#define REALFHSTAT __fhstat50
 #endif
 #define REALREAD _sys_read
 #define REALPREAD _sys_pread
 #define REALPWRITE _sys_pwrite
 #define REALGETDENTS __getdents30
 #define REALMOUNT __mount50
+#define REALGETFH __getfh30
+#define REALFHOPEN __fhopen40
+#define REALFHSTATVFS1 __fhstatvfs140
 
 int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 int REALPOLLTS(struct pollfd *, nfds_t,
@@ -151,6 +159,10 @@
 int REALMOUNT(const char *, const char *, int, void *, size_t);
 int __getcwd(char *, size_t);
 int REALMKNOD(const char *, mode_t, dev_t);
+int REALGETFH(const char *, void *, size_t *);
+int REALFHOPEN(const void *, size_t, int);
+int REALFHSTAT(const void *, size_t, struct stat *);
+int REALFHSTATVFS1(const void *, size_t, struct statvfs *, int);
 
 #define S(a) __STRING(a)
 struct sysnames {
@@ -223,6 +235,13 @@
 	{ DUALCALL_FCHFLAGS,	fchflags,	RSYS_NAME(FCHFLAGS)	},
 	{ DUALCALL_ACCESS,	access,	RSYS_NAME(ACCESS)	},
 	{ DUALCALL_MKNOD,	S(REALMKNOD),	RSYS_NAME(MKNOD)	},
+	{ DUALCALL___SYSCTL,	__sysctl,	RSYS_NAME(__SYSCTL)	},
+	{ DUALCALL_GETVFSSTAT,	getvfsstat,	RSYS_NAME(GETVFSSTAT)	},
+	{ DUALCALL_NFSSVC,	nfssvc,	RSYS_NAME(NFSSVC)	},
+	{ DUALCALL_GETFH,	S(REALGETFH),	RSYS_NAME(GETFH)	},
+	{ DUALCALL_FHOPEN,	S(REALFHOPEN),RSYS_NAME(FHOPEN)	},
+	{ DUALCALL_FHSTAT,	S(REALFHSTAT),RSYS_NAME(FHSTAT)	},
+	{ DUALCALL_FHSTATVFS1,	S(REALSTATVFS1),RSYS_NAME(FHSTATVFS1)	},
 };
 #undef S
 
@@ -403,6 +422,21 @@
 	return fun vars;		\
 }
 
+#define VFSCALL(bit, type, name, rcname, args, proto, vars)		\
+type name args\
+{	\
+	type (*fun) proto;		\
+	\
+	DPRINTF((%s (0x%x, 0x%x)\n, __STRING(name), bit, vfsbits));	\
+	if (vfsbits  bit) {		\
+		fun = syscalls[rcname].bs_rump;\
+	} else {			\
+		fun = syscalls[rcname].bs_host;\
+	}\
+	\
+	return fun vars;		\
+}
+
 /*
  * These variables are set from the RUMPHIJACK string and control
  * which operations can product rump kernel file descriptors.
@@ -462,7 +496,7 @@
 			}
 		}
 		if (socketmap[i].name == NULL) {
-			warnx(invalid socket specifier %s, p);
+			errx(1, invalid socket specifier %s, p);
 		}
 	}
 }
@@ -519,14 +553,103 @@
 	}
 }
 
+#define VFSBIT_NFSSVC		0x01
+#define VFSBIT_GETVFSSTAT	0x02
+#define VFSBIT_FHCALLS		0x04
+static unsigned vfsbits;
+
+static struct {
+	int bit;
+	const char *name;
+} vfscalls[] = {
+	{ VFSBIT_NFSSVC, nfssvc },
+	{ VFSBIT_GETVFSSTAT, getvfsstat },
+	{ VFSBIT_FHCALLS, fhcalls },
+	{ -1, NULL }
+};
+
+static void
+vfsparser(char *buf)
+{
+	char *p, *l;
+	bool turnon;
+	unsigned int fullmask;
+	int i;
+
+	/* build the full mask and sanity-check while we're at it */
+	fullmask = 0;
+	for (i = 0; vfscalls[i].name != NULL; i++) {
+		if (fullmask  vfscalls[i].bit)
+			errx(1, problem exists between vi and chair);
+		fullmask |= vfscalls[i].bit;
+	}
+
+
+	/* if all is present, it must be specified first */
+	if (strncmp(buf, all, strlen(all)) == 0) {
+		vfsbits = fullmask;
+		buf += strlen(all);
+		if (*buf == ':')
+			

CVS commit: src/lib/librumpclient

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 15:09:21 UTC 2011

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
* use _exit() instead of exit() in retryconn=die: atexit() handlers
  may hang if the server is dead
* consistent use of data


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/librumpclient/rumpclient.c

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

Modified files:

Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.42 src/lib/librumpclient/rumpclient.c:1.43
--- src/lib/librumpclient/rumpclient.c:1.42	Tue Mar  8 18:28:01 2011
+++ src/lib/librumpclient/rumpclient.c	Wed Mar  9 15:09:21 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.42 2011/03/08 18:28:01 pooka Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.43 2011/03/09 15:09:21 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpclient.c,v 1.42 2011/03/08 18:28:01 pooka Exp $);
+__RCSID($NetBSD: rumpclient.c,v 1.43 2011/03/09 15:09:21 pooka Exp $);
 
 #include sys/param.h
 #include sys/event.h
@@ -111,7 +111,7 @@
 break;
 			}
 			if (retrytimo == RUMPCLIENT_RETRYCONN_DIE)
-exit(1);
+_exit(1);
 
 			if (!prevreconmsg) {
 prevreconmsg = time(NULL);
@@ -329,7 +329,7 @@
 	int cancel, bool haslock)
 {
 	struct handshake_fork rf;
-	const char *myprogname;
+	const char *myprogname = NULL; /* XXXgcc */
 	struct rsp_hdr rhdr;
 	struct respwait rw;
 	sigset_t omask;
@@ -362,7 +362,7 @@
 		rf.rf_cancel = cancel;
 		IOVPUT(iov[1], rf);
 	} else {
-		IOVPUT_WITHSIZE(iov[1], __UNCONST(getprogname()), bonus);
+		IOVPUT_WITHSIZE(iov[1], __UNCONST(myprogname), bonus);
 	}
 	rv = send_with_recon(spc, iov, __arraycount(iov));
 	if (rv || cancel) {



CVS commit: src/lib/libc/arch/mips/gen

2011-03-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar  9 16:10:29 UTC 2011

Modified Files:
src/lib/libc/arch/mips/gen: _setjmp.S

Log Message:
Reorder insns to fix more load delay hazard botches on R3000.
Fixes floating point exceptions in _longjmp() during /etc/rc and
now NWS-3470D boots up to multi user with -current userland binaries.

Also fill BDslots in error path properly.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/arch/mips/gen/_setjmp.S

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/arch/mips/gen/_setjmp.S
diff -u src/lib/libc/arch/mips/gen/_setjmp.S:1.22 src/lib/libc/arch/mips/gen/_setjmp.S:1.23
--- src/lib/libc/arch/mips/gen/_setjmp.S:1.22	Fri Sep  3 17:22:51 2010
+++ src/lib/libc/arch/mips/gen/_setjmp.S	Wed Mar  9 16:10:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@
 #if 0
 	RCSID(from: @(#)_setjmp.s	8.1 (Berkeley) 6/4/93)
 #else
-	RCSID($NetBSD: _setjmp.S,v 1.22 2010/09/03 17:22:51 matt Exp $)
+	RCSID($NetBSD: _setjmp.S,v 1.23 2011/03/09 16:10:29 tsutsui Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -88,7 +88,6 @@
 	 */
 #ifndef SOFTFLOAT_FOR_GCC
 	cfc1	v0, $31# too bad cant check if FP used
-	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 #if defined(__mips_n64) || defined(__mips_n32)
 	FP_S	$f30, _OFFSETOF_SC_FPREGS_F30(a0)
 	FP_S	$f28, _OFFSETOF_SC_FPREGS_F28(a0)
@@ -109,6 +108,7 @@
 	FP_S	$f29, _OFFSETOF_SC_FPREGS_F29(a0)
 	FP_S	$f31, _OFFSETOF_SC_FPREGS_F31(a0)
 #endif
+	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 #endif	/* SOFTFLOAT_FOR_GCC */
 	REG_EPILOGUE
 
@@ -139,11 +139,13 @@
 #if defined(__mips_n32) || defined(__mips_n64)
 	REG_L		gp, _OFFSETOF_SC_REGS_GP(a0)
 #endif
+#ifndef SOFTFLOAT_FOR_GCC
 	# get fpu status
+	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
+#endif
 	REG_L		sp, _OFFSETOF_SC_REGS_SP(a0)
 	REG_L		s8, _OFFSETOF_SC_REGS_S8(a0)
 #ifndef SOFTFLOAT_FOR_GCC
-	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 	ctc1		v0, $31
 	/*
 	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
@@ -183,6 +185,8 @@
 	 * our caller's GP.
 	 */
 	jal	_C_LABEL(longjmperror)
+	 nop
 	
 	PIC_TAILCALL(abort)
+	 nop
 END(_longjmp)



CVS commit: src/usr.bin/window

2011-03-09 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Mar  9 17:32:03 UTC 2011

Added Files:
src/usr.bin/window: export.sh

Log Message:
Add a script to generate a distfile of window from the verbatim sources on
cvs.  This will be used for the upcoming pkgsrc package of window.

I am not copying the code to othersrc because I want to keep things as
simple as possible for now.  When we remove window from src, the code will
be moved to othersrc and any improvements (such as autoconfification) can
be done there.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.bin/window/export.sh

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

Added files:

Index: src/usr.bin/window/export.sh
diff -u /dev/null src/usr.bin/window/export.sh:1.1
--- /dev/null	Wed Mar  9 17:32:03 2011
+++ src/usr.bin/window/export.sh	Wed Mar  9 17:32:03 2011
@@ -0,0 +1,77 @@
+#! /bin/sh
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#
+# This script exports a fresh copy of the window(1) sources from cvs and
+# generates a distfile for them.  You can later upload the resulting
+# distfile to the NetBSD ftp site and update the pkgsrc/misc/window package.
+#
+# To generate a distfile, tag the sources in this directory with a tag of
+# the form window-MMDD and then run this script providing the same tag
+# name as the first argument and a target directory as the second argument.
+#
+# Example:
+# src/usr.bin/window$ cvs tag window-20110309
+# src/usr.bin/window$ ./export.sh window-20110309 /tmp
+#
+
+set -e
+
+ProgName=${0##*/}
+
+err() {
+	echo ${ProgName}: ${@} 12
+	exit 1
+}
+
+usage_error() {
+	echo Usage: ${ProgName} tag-name target-directory
+	echo Example: ${ProgName} window-20110309 /tmp
+	exit 1
+}
+
+main() {
+	[ -f wwopen.c ] || err Must be run from window's source directory
+
+	[ -d CVS ] || err Must be run from window's CVS source directory
+	local root=$(cat CVS/Root)
+
+	[ ${#} -eq 2 ] || usage_error
+	local tag=${1}; shift
+	local directory=${1}; shift
+
+	local distname=${tag}
+
+	cd ${directory}
+	cvs -d ${root} export -r ${tag} -d ${distname} src/usr.bin/window
+	rm -f ${distname}/${ProgName}
+	tar czf ${distname}.tar.gz ${distname}
+	rm -rf ${distname}
+	cd -
+}
+
+main ${@}



CVS commit: src/share/misc

2011-03-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar  9 17:52:45 UTC 2011

Modified Files:
src/share/misc: acronyms.comp

Log Message:
ADD, enough said.

AAA, ADD, ADS, AM, ARR, ASC, ASD, ASE, ASPM, ASQ, AV, AVL, AVX, BDD, BDUF,
BLC, BPB, BPM, BT, BTC, BTR, BTS, CA, CASE, CD, CLF, CLTT, CM, CMA, CSV,
CUT, CV, DA, DAA, DEA, DGL, DH, DIRT, DMS, DOE, DPST, DRRS, DSB, DSN, DTS,
DVCS, EBR, EH, EMI, EMR, FDE, FEA, FET, FLOSS, FMR, FRR, FS, FSK, FTA, FUS,
GR, HOOD, HTCC, HVM, IA, IBC, IDPS, IMS, IPE, IS, IV, JFET, LAR, LBS, LDA,
LDR, LFO, LL, LLMNR, LM, LPS, LSL, LTCC, LWP, MCM, MMIC, MO, MOSFET, MSE,
NCO, ND, NE, NW, OFET, OU, PA, PAC, PCD, PCE, PDAG, PDB, PDM, PE, PEP, PGE,
PIM, PIV, PLTM, PM, POF, PP, PSD, PSK, PTV, PVI, QAM, QDI, RA, RBF, RBT,
RFI, RIB, RMPM, RMS, RMW, RS, SA, SASD, SC, SCA, SCC, SCCS, SMA, SNR, SOC,
SQA, SS, SSB, STC, STD, TA, TAI, TB, TDC, TDM, TDOA, TK, TM, TOS, TSD, TSL,
UMPC, UT, VA, VCA, VCF, VCO, VFO, VME, W, WP, WS, ZBR.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.121 src/share/misc/acronyms.comp:1.122
--- src/share/misc/acronyms.comp:1.121	Thu Mar  3 18:40:23 2011
+++ src/share/misc/acronyms.comp	Wed Mar  9 17:52:45 2011
@@ -1,7 +1,8 @@
-$NetBSD: acronyms.comp,v 1.121 2011/03/03 18:40:23 jruoho Exp $
+$NetBSD: acronyms.comp,v 1.122 2011/03/09 17:52:45 jruoho Exp $
 
 3WHS	three-way handshake
 AA	anti-aliasing
+AAA	authentication, authorization, accounting
 AAT	average access time
 ABI	application binary interface
 ABR	available bit rate
@@ -17,11 +18,13 @@
 ACU	automatic calling unit
 ADB	Apple desktop bus
 ADC	analog [to] digital converter
+ADD	acronym driven development
 ADP	automatic data processing
 ADT	abstract data type
 ADO	active data objects
 ADP	automatic data processing
 ADPCM	adaptive differential pulse code modulation
+ADS	alternate data stream
 ADSL	asymmetric digital subscriber line
 AES	Advanced Encryption Standard
 AFS	Andrew File System
@@ -35,6 +38,7 @@
 ALU	arithmetic and logical unit
 AM	access method
 AM	amplitude modulation
+AM	alignment mask
 AMI	alternate mark inversion
 AMT	active management technology
 AN	Arabic number
@@ -52,13 +56,19 @@
 ARP	address resolution protocol
 ARPA	Advanced Research Projects Agency
 ARQ	automatic repeat request
+ARR	address range register
 ARU	audio response unit
 AS	autonomous system
+ASC	advanced smart cache
 ASCII	American standard code for information interchange
+ASD	agile software development
+ASE	advanced software environment
 ASIC	application-specific integrated circuit
 ASK	amplitude shif keying
 ASLR	address space layout randomization
+ASPM	active state power management
 ASN	autonomous system number
+ASQ	automated software quality
 ASR	address space register
 AST	abstract syntax tree
 AST	asynchronous trap
@@ -69,6 +79,9 @@
 ATC	address translation cache
 ATM	asynchronous transfer mode
 ATX	advanced technology extended
+AV	anti virus
+AVL	Adelson-Velsky-Landis
+AVX	advanced vector extensions
 AWK	Aho, Werner, and Kernighan
 BAL	basic assembly language
 BAR	base address register
@@ -78,6 +91,8 @@
 BCR	byte counte register
 BCS	base configuration space
 BD	baud
+BDD	binary decision diagram
+BDUF	big design up front
 BEDO	burst extended data output
 BER	basic encoding rules
 BER	bit error rate
@@ -94,6 +109,7 @@
 BKDG	BIOS and kernel developer's guide
 BLAS	basic linear algebra subprograms
 BLOB	binary large object
+BLC	back light control
 BM	bus master
 BMC	baseboard management controller
 BMIC	bus master interface controller
@@ -105,8 +121,10 @@
 BOM	beginning of message
 BP	base pointer
 BP	boot processor
+BPB	BIOS parameter block
 BPF	Berkeley packet filter
 BPI	bits per inch
+BPM	business process modelling
 BPS	bits per second
 BQS	Berkeley quality software
 BSD	Berkeley software distribution
@@ -118,9 +136,14 @@
 BSS	block started by symbol
 BT	Bluetooth
 BT	BitTorrent
+BT	bit test
+BTC	bit test [and] complement
+BTR	bit test [and] reset
+BTS	bit test [and] set
 BTS	bits per second
 BW	bandwidth
 BWM	block-write mode
+CA	certificate authority
 CAD	computer-aided design
 CAM	computer assisted manufacturing
 CAM	content addressable memory
@@ -128,6 +151,7 @@
 CAS	(atomic) compare and swap
 CAS	computer algebra system
 CAS	column address strobe
+CASE	computer aided software engineering
 CAU	control access unit
 CAV	constant angular velocity (as opposed to CLV)
 CBC	cipher block chaining
@@ -135,6 +159,7 @@
 CCD	charge coupled device
 CC	carbon coby
 CD	compact disc
+CD	cache disable
 CDDA	compact disc digital audio
 CDRAM	cache dynamic random access memory
 CER	canonical encoding rules
@@ -152,10 +177,14 @@
 CIL	common intermediate language
 CIS	contact image sensor
 CJK	Chinese, Japanese, and Korean
+CLF	common log format
 CLI	command line 

CVS commit: src/lib/librumphijack

2011-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Mar  9 18:06:22 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Fix last entries, make it work again.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.78 src/lib/librumphijack/hijack.c:1.79
--- src/lib/librumphijack/hijack.c:1.78	Wed Mar  9 15:03:18 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 18:06:22 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.78 2011/03/09 15:03:18 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.79 2011/03/09 18:06:22 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.78 2011/03/09 15:03:18 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.79 2011/03/09 18:06:22 bouyer Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -238,10 +238,10 @@
 	{ DUALCALL___SYSCTL,	__sysctl,	RSYS_NAME(__SYSCTL)	},
 	{ DUALCALL_GETVFSSTAT,	getvfsstat,	RSYS_NAME(GETVFSSTAT)	},
 	{ DUALCALL_NFSSVC,	nfssvc,	RSYS_NAME(NFSSVC)	},
-	{ DUALCALL_GETFH,	S(REALGETFH),	RSYS_NAME(GETFH)	},
-	{ DUALCALL_FHOPEN,	S(REALFHOPEN),RSYS_NAME(FHOPEN)	},
-	{ DUALCALL_FHSTAT,	S(REALFHSTAT),RSYS_NAME(FHSTAT)	},
-	{ DUALCALL_FHSTATVFS1,	S(REALSTATVFS1),RSYS_NAME(FHSTATVFS1)	},
+	{ DUALCALL_GETFH,	S(REALGETFH),	RSYS_NAME(GETFH)	},
+	{ DUALCALL_FHOPEN,	S(REALFHOPEN),RSYS_NAME(FHOPEN)	},
+	{ DUALCALL_FHSTAT,	S(REALFHSTAT),RSYS_NAME(FHSTAT)	},
+	{ DUALCALL_FHSTATVFS1,	S(REALFHSTATVFS1),RSYS_NAME(FHSTATVFS1)	},
 };
 #undef S
 



CVS commit: src/sys/ufs/ufs

2011-03-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar  9 18:12:04 UTC 2011

Modified Files:
src/sys/ufs/ufs: quota2.h

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/ufs/ufs/quota2.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/ufs/ufs/quota2.h
diff -u src/sys/ufs/ufs/quota2.h:1.2 src/sys/ufs/ufs/quota2.h:1.3
--- src/sys/ufs/ufs/quota2.h:1.2	Sun Mar  6 17:08:39 2011
+++ src/sys/ufs/ufs/quota2.h	Wed Mar  9 18:12:04 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: quota2.h,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/* $NetBSD: quota2.h,v 1.3 2011/03/09 18:12:04 dholland Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -67,7 +67,7 @@
 	struct quota2_val q2e_val[N_QL];
 	/* pointer to next entry for this list (offset in the file) */
 	uint64_t q2e_next;
-	/* ownerchip information */
+	/* ownership information */
 	uint32_t q2e_uid;
 	uint32_t q2e_pad;
 };



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

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 18:15:39 UTC 2011

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

Log Message:
Mark cv_wait mutex as locked before doing any further dances.
Fixes a LOCKDEBUG panic in case the uncommon condition is hit.


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

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

Modified files:

Index: src/sys/rump/librump/rumpkern/locks.c
diff -u src/sys/rump/librump/rumpkern/locks.c:1.51 src/sys/rump/librump/rumpkern/locks.c:1.52
--- src/sys/rump/librump/rumpkern/locks.c:1.51	Tue Mar  8 12:39:29 2011
+++ src/sys/rump/librump/rumpkern/locks.c	Wed Mar  9 18:15:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.51 2011/03/08 12:39:29 pooka Exp $	*/
+/*	$NetBSD: locks.c,v 1.52 2011/03/09 18:15:39 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.51 2011/03/08 12:39:29 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.52 2011/03/09 18:15:39 pooka Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -305,6 +305,8 @@
 		rumpuser_cv_wait(RUMPCV(cv), RUMPMTX(mtx));
 	}
 
+	LOCKED(mtx, false);
+
 	/*
 	 * Check for QEXIT.  if so, we need to wait here until we
 	 * are allowed to exit.
@@ -330,8 +332,6 @@
 	}
 	l-l_private = NULL;
 
-	LOCKED(mtx, false);
-
 	return rv;
 }
 



CVS commit: src/lib/librumphijack

2011-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Mar  9 18:45:31 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Add quotactl(2)


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.79 src/lib/librumphijack/hijack.c:1.80
--- src/lib/librumphijack/hijack.c:1.79	Wed Mar  9 18:06:22 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 18:45:30 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.79 2011/03/09 18:06:22 bouyer Exp $	*/
+/*  $NetBSD: hijack.c,v 1.80 2011/03/09 18:45:30 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.79 2011/03/09 18:06:22 bouyer Exp $);
+__RCSID($NetBSD: hijack.c,v 1.80 2011/03/09 18:45:30 bouyer Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -58,6 +58,7 @@
 #include string.h
 #include time.h
 #include unistd.h
+#include sys/quota.h
 
 #include hijack.h
 
@@ -97,6 +98,7 @@
 	DUALCALL___SYSCTL,
 	DUALCALL_GETVFSSTAT, DUALCALL_NFSSVC,
 	DUALCALL_GETFH, DUALCALL_FHOPEN, DUALCALL_FHSTAT, DUALCALL_FHSTATVFS1,
+	DUALCALL_QUOTACTL,
 	DUALCALL__NUM
 };
 
@@ -140,6 +142,7 @@
 #define REALGETFH __getfh30
 #define REALFHOPEN __fhopen40
 #define REALFHSTATVFS1 __fhstatvfs140
+#define REALQUOTACTL __quotactl50
 
 int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 int REALPOLLTS(struct pollfd *, nfds_t,
@@ -163,6 +166,7 @@
 int REALFHOPEN(const void *, size_t, int);
 int REALFHSTAT(const void *, size_t, struct stat *);
 int REALFHSTATVFS1(const void *, size_t, struct statvfs *, int);
+int REALQUOTACTL(const char *, struct plistref *);
 
 #define S(a) __STRING(a)
 struct sysnames {
@@ -242,6 +246,7 @@
 	{ DUALCALL_FHOPEN,	S(REALFHOPEN),RSYS_NAME(FHOPEN)	},
 	{ DUALCALL_FHSTAT,	S(REALFHSTAT),RSYS_NAME(FHSTAT)	},
 	{ DUALCALL_FHSTATVFS1,	S(REALFHSTATVFS1),RSYS_NAME(FHSTATVFS1)	},
+	{ DUALCALL_QUOTACTL,	S(REALQUOTACTL),RSYS_NAME(QUOTACTL)	},
 };
 #undef S
 
@@ -2161,6 +2166,11 @@
 	(const char *, int),		\
 	(path, flags))
 
+PATHCALL(int, REALQUOTACTL, DUALCALL_QUOTACTL,\
+	(const char *path, struct plistref *p),\
+	(const char *, struct plistref *),\
+	(path, p))
+
 /*
  * These act different on a per-process vfs configuration
  */



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

2011-03-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Mar  9 18:55:56 UTC 2011

Modified Files:
src/distrib/sets/lists/xserver: md.alpha md.amd64 md.bebox md.cats
md.dreamcast md.ews4800mips md.hp300 md.hpcarm md.hpcmips md.hpcsh
md.i386 md.macppc md.netwinder md.ofppc md.prep md.sgimips md.shark
md.sparc md.sparc64 md.zaurus mi

Log Message:
move xorg-server.m4 into the MD files that build xorg-server.
this should fix most of the recent build issues on xorg without
xorg-server platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/distrib/sets/lists/xserver/md.alpha
cvs rdiff -u -r1.60 -r1.61 src/distrib/sets/lists/xserver/md.amd64
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/xserver/md.bebox \
src/distrib/sets/lists/xserver/md.zaurus
cvs rdiff -u -r1.40 -r1.41 src/distrib/sets/lists/xserver/md.cats \
src/distrib/sets/lists/xserver/md.sgimips
cvs rdiff -u -r1.12 -r1.13 src/distrib/sets/lists/xserver/md.dreamcast \
src/distrib/sets/lists/xserver/md.ofppc
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/xserver/md.ews4800mips \
src/distrib/sets/lists/xserver/md.prep
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/xserver/md.hp300
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/xserver/md.hpcarm
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/xserver/md.hpcmips
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/xserver/md.hpcsh
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/lists/xserver/md.i386
cvs rdiff -u -r1.58 -r1.59 src/distrib/sets/lists/xserver/md.macppc
cvs rdiff -u -r1.25 -r1.26 src/distrib/sets/lists/xserver/md.netwinder
cvs rdiff -u -r1.35 -r1.36 src/distrib/sets/lists/xserver/md.shark
cvs rdiff -u -r1.49 -r1.50 src/distrib/sets/lists/xserver/md.sparc
cvs rdiff -u -r1.46 -r1.47 src/distrib/sets/lists/xserver/md.sparc64
cvs rdiff -u -r1.31 -r1.32 src/distrib/sets/lists/xserver/mi

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

Modified files:

Index: src/distrib/sets/lists/xserver/md.alpha
diff -u src/distrib/sets/lists/xserver/md.alpha:1.30 src/distrib/sets/lists/xserver/md.alpha:1.31
--- src/distrib/sets/lists/xserver/md.alpha:1.30	Tue Nov 23 10:24:03 2010
+++ src/distrib/sets/lists/xserver/md.alpha	Wed Mar  9 18:55:55 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.alpha,v 1.30 2010/11/23 10:24:03 mrg Exp $
+# $NetBSD: md.alpha,v 1.31 2011/03/09 18:55:55 mrg Exp $
 ./usr/X11R6/bin/X	-unknown-	x11
 ./usr/X11R6/bin/XalphaNetBSD-unknown-	x11
 ./usr/X11R6/bin/XdecNetBSD-unknown-	x11
@@ -388,3 +388,4 @@
 ./usr/X11R7/man/man4/ws.4-unknown-	.man,xorg
 ./usr/X11R7/man/man4/wsfb.4-unknown-	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			-unknown-	.man,xorg
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg

Index: src/distrib/sets/lists/xserver/md.amd64
diff -u src/distrib/sets/lists/xserver/md.amd64:1.60 src/distrib/sets/lists/xserver/md.amd64:1.61
--- src/distrib/sets/lists/xserver/md.amd64:1.60	Tue Nov 23 10:24:03 2010
+++ src/distrib/sets/lists/xserver/md.amd64	Wed Mar  9 18:55:55 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.60 2010/11/23 10:24:03 mrg Exp $
+# $NetBSD: md.amd64,v 1.61 2011/03/09 18:55:55 mrg Exp $
 ./usr/X11R6/bin/X	-unknown-	x11
 ./usr/X11R6/bin/XFree86	-unknown-	x11
 ./usr/X11R6/bin/gtf	-unknown-	x11
@@ -732,3 +732,4 @@
 ./usr/X11R7/man/man4/ws.4-unknown-	.man,xorg
 ./usr/X11R7/man/man4/wsfb.4-unknown-	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			-unknown-	.man,xorg
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg

Index: src/distrib/sets/lists/xserver/md.bebox
diff -u src/distrib/sets/lists/xserver/md.bebox:1.3 src/distrib/sets/lists/xserver/md.bebox:1.4
--- src/distrib/sets/lists/xserver/md.bebox:1.3	Tue Dec  7 05:51:45 2010
+++ src/distrib/sets/lists/xserver/md.bebox	Wed Mar  9 18:55:55 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.bebox,v 1.3 2010/12/07 05:51:45 kiyohara Exp $
+# $NetBSD: md.bebox,v 1.4 2011/03/09 18:55:55 mrg Exp $
 ./usr/X11R7/bin/X	-unknown-	xorg
 ./usr/X11R7/bin/Xorg	-unknown-	xorg
 ./usr/X11R7/bin/cvt	-unknown-	xorg
@@ -145,3 +145,4 @@
 ./usr/X11R7/man/man4/vga.4-unknown-	obsolete
 ./usr/X11R7/man/man4/ws.4-unknown-	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			-unknown-	.man,xorg
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg
Index: src/distrib/sets/lists/xserver/md.zaurus
diff -u src/distrib/sets/lists/xserver/md.zaurus:1.3 src/distrib/sets/lists/xserver/md.zaurus:1.4
--- src/distrib/sets/lists/xserver/md.zaurus:1.3	Tue Nov 23 10:24:04 2010
+++ src/distrib/sets/lists/xserver/md.zaurus	Wed Mar  9 18:55:56 2011
@@ -118,3 +118,4 @@
 ./usr/X11R7/man/man4/ws.4-unknown-	.man,xorg
 ./usr/X11R7/man/man4/wsfb.4-unknown-	.man,xorg
 ./usr/X11R7/man/man5/xorg.conf.5			-unknown-	.man,xorg
+./usr/X11R7/share/aclocal/xorg-server.m4		-unknown-	xorg

Index: src/distrib/sets/lists/xserver/md.cats
diff -u 

CVS commit: src/sys/sys

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 19:02:04 UTC 2011

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

Log Message:
Bump version for new quota code -- even if ABIs didn't change, it's
still a major feature.


To generate a diff of this commit:
cvs rdiff -u -r1.384 -r1.385 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.384 src/sys/sys/param.h:1.385
--- src/sys/sys/param.h:1.384	Fri Feb 25 13:29:46 2011
+++ src/sys/sys/param.h	Wed Mar  9 19:02:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.384 2011/02/25 13:29:46 joerg Exp $	*/
+/*	$NetBSD: param.h,v 1.385 2011/03/09 19:02:04 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	599004700	/* NetBSD 5.99.47 */
+#define	__NetBSD_Version__	599004800	/* NetBSD 5.99.48 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) = __NetBSD_Version__)



CVS commit: src

2011-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Mar  9 19:04:58 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/fs/ffs: t_clearquota.sh t_getquota.sh t_miscquota.sh
t_quotalimit.sh t_setquota.sh
Removed Files:
src/tests/fs/ffs/clients: Makefile quota_rumpops.c

Log Message:
Use librumphijack for quota commands instead of rumpifed versions.


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/t_clearquota.sh \
src/tests/fs/ffs/t_getquota.sh src/tests/fs/ffs/t_miscquota.sh \
src/tests/fs/ffs/t_quotalimit.sh src/tests/fs/ffs/t_setquota.sh
cvs rdiff -u -r1.3 -r0 src/tests/fs/ffs/clients/Makefile
cvs rdiff -u -r1.2 -r0 src/tests/fs/ffs/clients/quota_rumpops.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.261 src/distrib/sets/lists/tests/mi:1.262
--- src/distrib/sets/lists/tests/mi:1.261	Tue Mar  8 12:42:14 2011
+++ src/distrib/sets/lists/tests/mi	Wed Mar  9 19:04:57 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.261 2011/03/08 12:42:14 pooka Exp $
+# $NetBSD: mi,v 1.262 2011/03/09 19:04:57 bouyer Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1193,10 +1193,10 @@
 ./usr/tests/fs/ffs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/ffs/h_quota2_server		tests-fs-tests		atf
 ./usr/tests/fs/ffs/h_quota2_tests		tests-fs-tests		atf
-./usr/tests/fs/ffs/rump_edquota			tests-fs-tests		atf
-./usr/tests/fs/ffs/rump_quota			tests-fs-tests		atf
-./usr/tests/fs/ffs/rump_quotactl		tests-fs-tests		atf
-./usr/tests/fs/ffs/rump_repquota		tests-fs-tests		atf
+./usr/tests/fs/ffs/rump_edquota			tests-obsolete		obsolete
+./usr/tests/fs/ffs/rump_quota			tests-obsolete		obsolete
+./usr/tests/fs/ffs/rump_quotactl		tests-obsolete		obsolete
+./usr/tests/fs/ffs/rump_repquota		tests-obsolete		obsolete
 ./usr/tests/fs/ffs/t_fifos			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_mount			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_renamerace			tests-obsolete		obsolete

Index: src/tests/fs/ffs/t_clearquota.sh
diff -u src/tests/fs/ffs/t_clearquota.sh:1.2 src/tests/fs/ffs/t_clearquota.sh:1.3
--- src/tests/fs/ffs/t_clearquota.sh:1.2	Sun Mar  6 17:08:40 2011
+++ src/tests/fs/ffs/t_clearquota.sh	Wed Mar  9 19:04:58 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_clearquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $ 
+# $NetBSD: t_clearquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -67,17 +67,17 @@
 #set and check the expected quota
 	for q in ${expect} ; do
 		atf_check -s exit:0 \
-		   $(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \
+		   env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
 		   -t 2W/3D ${id}
 		atf_check -s exit:0 \
 -o match:/mnt0   1040960  2weeks   0  20   51200   3days \
 -o match:Disk quotas for .*: $ \
-		$(atf_get_srcdir)/rump_quota -${q} -v ${id}
+		env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
 	done
 #now clear the quotas
 	for q in ${expect} ; do
 		atf_check -s exit:0 \
-		   $(atf_get_srcdir)/rump_edquota -$q -c ${id}
+		   env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -c ${id}
 	done;
 
 #check that we do not get positive reply for any quota type
@@ -85,7 +85,7 @@
 		atf_check -s exit:0 -o not-match:/mnt \
 		-o not-match:Disk quotas for .*: $ \
 		-o match:Disk quotas for .*: none$ \
-		$(atf_get_srcdir)/rump_quota -${q} -v ${id}
+		env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
 	done
 	rump_shutdown
 }
Index: src/tests/fs/ffs/t_getquota.sh
diff -u src/tests/fs/ffs/t_getquota.sh:1.2 src/tests/fs/ffs/t_getquota.sh:1.3
--- src/tests/fs/ffs/t_getquota.sh:1.2	Sun Mar  6 17:08:40 2011
+++ src/tests/fs/ffs/t_getquota.sh	Wed Mar  9 19:04:58 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_getquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $ 
+# $NetBSD: t_getquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -66,11 +66,11 @@
 		atf_check -s exit:0 \
 -o match:/mnt0--   7days   1   -   -   7days \
 -o match:Disk quotas for .*: $ \
-		$(atf_get_srcdir)/rump_quota -${q} -v
+		env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
 		atf_check -s exit:0 \
 -o match:--0--1   -   - \
 -o not-match:\+\+			  \
-		$(atf_get_srcdir)/rump_repquota -${q} /mnt
+		env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
 	done
 

CVS commit: [rmind-uvmplock] src/sys/arch/hppa

2011-03-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar  9 19:13:21 UTC 2011

Modified Files:
src/sys/arch/hppa/hppa [rmind-uvmplock]: pmap.c
src/sys/arch/hppa/include [rmind-uvmplock]: pmap.h

Log Message:
Drop per-page locking i.e. pvh_lock and rely on locking provided by
upper layer, UVM.  Sprinkle asserts.


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.4 -r1.71.2.5 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.25.2.4 -r1.25.2.5 src/sys/arch/hppa/include/pmap.h

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

Modified files:

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.71.2.4 src/sys/arch/hppa/hppa/pmap.c:1.71.2.5
--- src/sys/arch/hppa/hppa/pmap.c:1.71.2.4	Sat Mar  5 20:50:36 2011
+++ src/sys/arch/hppa/hppa/pmap.c	Wed Mar  9 19:13:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.71.2.4 2011/03/05 20:50:36 rmind Exp $	*/
+/*	$NetBSD: pmap.c,v 1.71.2.5 2011/03/09 19:13:18 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.71.2.4 2011/03/05 20:50:36 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.71.2.5 2011/03/09 19:13:18 skrll Exp $);
 
 #include opt_cputype.h
 
@@ -504,13 +504,11 @@
 
 	pg = PHYS_TO_VM_PAGE(pa);
 	md = VM_PAGE_TO_MD(pg);
-	mutex_enter(md-pvh_lock);
 	db_printf(pg %p attr 0x%08x aliases %d\n, pg, md-pvh_attrs,
 	md-pvh_aliases);
 	for (pve = md-pvh_list; pve; pve = pve-pv_next)
 		db_printf(%x:%lx\n, pve-pv_pmap-pm_space,
 		pve-pv_va  PV_VAMASK);
-	mutex_exit(md-pvh_lock);
 }
 #endif
 
@@ -576,7 +574,7 @@
 	DPRINTF(PDB_FOLLOW|PDB_PV, (%s(%p, %p, %p, 0x%lx, %p, 0x%x)\n,
 	__func__, pg, pve, pm, va, pdep, flags));
 
-	KASSERT(mutex_owned(md-pvh_lock));
+	KASSERT(pm == pmap_kernel() || uvm_page_locked_p(pg));
 
 	pve-pv_pmap = pm;
 	pve-pv_va = va | flags;
@@ -591,7 +589,7 @@
 	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	struct pv_entry **pve, *pv;
 
-	KASSERT(mutex_owned(md-pvh_lock));
+	KASSERT(pmap == pmap_kernel() || uvm_page_locked_p(pg));
 
 	for (pv = *(pve = md-pvh_list);
 	pv; pv = *(pve = (*pve)-pv_next))
@@ -1216,11 +1214,10 @@
 		}
 
 		pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte));
-		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
-		mutex_enter(md-pvh_lock);
 		pve = pmap_pv_remove(pg, pmap, va);
+
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 		md-pvh_attrs |= pmap_pvh_attrs(pte);
-		mutex_exit(md-pvh_lock);
 	} else {
 		DPRINTF(PDB_ENTER, (%s: new mapping 0x%lx - 0x%lx\n,
 		__func__, va, pa));
@@ -1234,22 +1231,18 @@
 	}
 
 	if (pmap_initialized  (pg = PHYS_TO_VM_PAGE(pa))) {
-		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
-
 		if (!pve  !(pve = pmap_pv_alloc())) {
 			if (flags  PMAP_CANFAIL) {
- mutex_exit(md-pvh_lock);
  PMAP_UNLOCK(pmap);
 return (ENOMEM);
 			}
 			panic(%s: no pv entries available, __func__);
 		}
 pte |= PTE_PROT(pmap_prot(pmap, prot));
-		mutex_enter(md-pvh_lock);
 		if (pmap_check_alias(pg, va, pte))
-			pmap_page_remove_locked(pg);
+			pmap_page_remove(pg);
 		pmap_pv_enter(pg, pve, pmap, va, ptp, 0);
-		mutex_exit(md-pvh_lock);
+
 	} else if (pve) {
 		pmap_pv_free(pve);
 	}
@@ -1318,13 +1311,10 @@
 			(pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte {
 struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
-mutex_enter(md-pvh_lock);
 
 pve = pmap_pv_remove(pg, pmap, sva);
 md-pvh_attrs |= pmap_pvh_attrs(pte);
 
-mutex_exit(md-pvh_lock);
-
 if (pve != NULL)
 	pmap_pv_free(pve);
 			}
@@ -1374,9 +1364,7 @@
 
 			pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte));
 			struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
-			mutex_enter(md-pvh_lock);
 			md-pvh_attrs |= pmap_pvh_attrs(pte);
-			mutex_exit(md-pvh_lock);
 
 			pmap_pte_flush(pmap, sva, pte);
 			pte = ~PTE_PROT(TLB_AR_MASK);
@@ -1392,16 +1380,6 @@
 pmap_page_remove(struct vm_page *pg)
 {
 	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
-
-	mutex_enter(md-pvh_lock);
-	pmap_page_remove_locked(pg);
-	mutex_exit(md-pvh_lock);
-}
-
-void
-pmap_page_remove_locked(struct vm_page *pg)
-{
-	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	struct pv_entry *pve, *npve, **pvp;
 
 	DPRINTF(PDB_FOLLOW|PDB_PV, (%s(%p)\n, __func__, pg));
@@ -1496,8 +1474,6 @@
 	KASSERT((set  ~(PVF_REF|PVF_UNCACHEABLE)) == 0);
 	KASSERT((clear  ~(PVF_MOD|PVF_WRITE|PVF_UNCACHEABLE)) == 0);
 
-	mutex_enter(md-pvh_lock);
-
 	/* preserve other bits */
 	res = md-pvh_attrs  (set | clear);
 	md-pvh_attrs ^= res;
@@ -1532,7 +1508,6 @@
 			}
 		}
 	}
-	mutex_exit(md-pvh_lock);
 
 	return ((res  (clear | set)) != 0);
 }
@@ -1547,8 +1522,6 @@
 
 	DPRINTF(PDB_FOLLOW|PDB_BITS, (%s(%p, %x)\n, __func__, pg, bit));
 
-	mutex_enter(md-pvh_lock);
-
 	for (pve = md-pvh_list; !(md-pvh_attrs  bit)  pve;
 	pve = pve-pv_next) {
 		pmap_t pm = pve-pv_pmap;
@@ -1560,7 +1533,6 @@
 		md-pvh_attrs |= pmap_pvh_attrs(pte);

CVS commit: src/tests/fs/ffs

2011-03-09 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar  9 20:13:47 UTC 2011

Modified Files:
src/tests/fs/ffs: Makefile

Log Message:
Don't descend into non-existing subdirectory clients.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/fs/ffs/Makefile

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

Modified files:

Index: src/tests/fs/ffs/Makefile
diff -u src/tests/fs/ffs/Makefile:1.15 src/tests/fs/ffs/Makefile:1.16
--- src/tests/fs/ffs/Makefile:1.15	Sun Mar  6 17:08:39 2011
+++ src/tests/fs/ffs/Makefile	Wed Mar  9 20:13:47 2011
@@ -1,10 +1,8 @@
-#	$NetBSD: Makefile,v 1.15 2011/03/06 17:08:39 bouyer Exp $
+#	$NetBSD: Makefile,v 1.16 2011/03/09 20:13:47 tron Exp $
 #
 
 .include bsd.own.mk
 
-SUBDIR=		clients
-
 TESTSDIR=	${TESTSBASE}/fs/ffs
 WARNS=		4
 



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

2011-03-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Mar  9 20:33:57 UTC 2011

Modified Files:
src/sys/arch/sandpoint/sandpoint: satmgr.c

Log Message:
DLink DSM-G600 button handling.
There are no commands to reboot or poweroff a G600, though.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sandpoint/sandpoint/satmgr.c

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

Modified files:

Index: src/sys/arch/sandpoint/sandpoint/satmgr.c
diff -u src/sys/arch/sandpoint/sandpoint/satmgr.c:1.4 src/sys/arch/sandpoint/sandpoint/satmgr.c:1.5
--- src/sys/arch/sandpoint/sandpoint/satmgr.c:1.4	Thu Feb 24 19:32:34 2011
+++ src/sys/arch/sandpoint/sandpoint/satmgr.c	Wed Mar  9 20:33:57 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: satmgr.c,v 1.4 2011/02/24 19:32:34 phx Exp $ */
+/* $NetBSD: satmgr.c,v 1.5 2011/03/09 20:33:57 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -76,8 +76,9 @@
 	char			sc_wr_buf[16];
 	char			*sc_wr_lim, *sc_wr_cur, *sc_wr_ptr;
 	int			sc_rd_cnt, sc_wr_cnt;
-	int			sc_btnstate;
 	struct satops		*sc_ops;
+	char			sc_btn_buf[8];
+	int			sc_btn_cnt;
 };
 
 static int  satmgr_match(device_t, cfdata_t, void *);
@@ -114,12 +115,15 @@
 static void kreboot(struct satmgr_softc *);
 static void sreboot(struct satmgr_softc *);
 static void qreboot(struct satmgr_softc *);
+static void dreboot(struct satmgr_softc *);
 static void kpwroff(struct satmgr_softc *);
 static void spwroff(struct satmgr_softc *);
 static void qpwroff(struct satmgr_softc *);
+static void dpwroff(struct satmgr_softc *);
 static void kbutton(struct satmgr_softc *, int);
 static void sbutton(struct satmgr_softc *, int);
 static void qbutton(struct satmgr_softc *, int);
+static void dbutton(struct satmgr_softc *, int);
 static void guarded_pbutton(void *);
 static void sched_sysmon_pbutton(void *);
 
@@ -133,7 +137,8 @@
 static struct satops satmodel[] = {
 { kurobox,  kreboot, kpwroff, kbutton },
 { synology, sreboot, spwroff, sbutton },
-{ qnap, qreboot, qpwroff, qbutton }
+{ qnap, qreboot, qpwroff, qbutton },
+{ dlink,dreboot, dpwroff, dbutton }
 };
 
 /* single byte stride register layout */
@@ -206,7 +211,7 @@
 	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_HIGH);
 	cv_init(sc-sc_rdcv, satrd);
 	cv_init(sc-sc_wrcv, satwr);
-	sc-sc_btnstate = 0;
+	sc-sc_btn_cnt = 0;
 
 	epicirq = (eaa-eumb_unit == 0) ? 24 : 25;
 	intr_establish(epicirq + 16, IST_LEVEL, IPL_SERIAL, hwintr, sc);
@@ -663,7 +668,7 @@
 
 	switch (ch) {
 	case '0':
-		/* notified after 3 secord guard time */
+		/* notified after 5 seconds guard time */
 		sysmon_task_queue_sched(0, sched_sysmon_pbutton, sc);
 		break;
 	case 'a':
@@ -689,10 +694,44 @@
 static void
 qbutton(struct satmgr_softc *sc, int ch)
 {
+
 	/* research in progress */
 }
 
 static void
+dreboot(struct satmgr_softc *sc)
+{
+
+	/* XXX cause a machine check exception? */
+}
+
+static void
+dpwroff(struct satmgr_softc *sc)
+{
+
+	/* not possible */
+}
+
+static void
+dbutton(struct satmgr_softc *sc, int ch)
+{
+
+	if (ch == '\n' || ch == '\r') {
+		if (sc-sc_btn_cnt == 3) {
+			if (strncmp(sc-sc_btn_buf, PKO, 3) == 0) {
+/* notified after 5 seconds guard time */
+sysmon_task_queue_sched(0,
+sched_sysmon_pbutton, sc);
+			} else if (strncmp(sc-sc_btn_buf, RKO, 3) == 0) {
+/* notified after 5 seconds guard time */
+			}
+		}
+		sc-sc_btn_cnt = 0;
+	} else if (sc-sc_btn_cnt  7)
+		sc-sc_btn_buf[sc-sc_btn_cnt++] = ch;
+}
+
+static void
 guarded_pbutton(void *arg)
 {
 	struct satmgr_softc *sc = arg;



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

2011-03-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Mar  9 20:35:56 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: pciide.c

Log Message:
Check the PCI-interface for legacy/native mode, not the PCI-revision.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/pciide.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/pciide.c
diff -u src/sys/arch/sandpoint/stand/altboot/pciide.c:1.3 src/sys/arch/sandpoint/stand/altboot/pciide.c:1.4
--- src/sys/arch/sandpoint/stand/altboot/pciide.c:1.3	Sun Mar  6 13:55:12 2011
+++ src/sys/arch/sandpoint/stand/altboot/pciide.c	Wed Mar  9 20:35:56 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide.c,v 1.3 2011/03/06 13:55:12 phx Exp $ */
+/* $NetBSD: pciide.c,v 1.4 2011/03/09 20:35:56 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
 	l-tag = tag;
 
 	val = pcicfgread(tag, PCI_CLASS_REG);
-	native = val  03;
+	native = ((val  8)  05) != 0;
 	if (native) {
 		/* native, use BAR 01234 */
 		l-bar[0] = pciiobase + (pcicfgread(tag, 0x10) ~ 01);



CVS commit: src/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 20:48:57 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Make this compile/work on NetBSD 5 once again.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.80 src/lib/librumphijack/hijack.c:1.81
--- src/lib/librumphijack/hijack.c:1.80	Wed Mar  9 18:45:30 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 20:48:57 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.80 2011/03/09 18:45:30 bouyer Exp $	*/
+/*  $NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.80 2011/03/09 18:45:30 bouyer Exp $);
+__RCSID($NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -58,7 +58,6 @@
 #include string.h
 #include time.h
 #include unistd.h
-#include sys/quota.h
 
 #include hijack.h
 
@@ -134,6 +133,7 @@
 #define REALMKNOD __mknod50
 #define REALFHSTAT __fhstat50
 #endif
+
 #define REALREAD _sys_read
 #define REALPREAD _sys_pread
 #define REALPWRITE _sys_pwrite
@@ -173,7 +173,9 @@
 	enum dualcall scm_callnum;
 	const char *scm_hostname;
 	const char *scm_rumpname;
-} syscnames[] = {
+};
+
+struct sysnames sys_mandatory[] = {
 	{ DUALCALL_SOCKET,	__socket30,	RSYS_NAME(SOCKET)	},
 	{ DUALCALL_ACCEPT,	accept,	RSYS_NAME(ACCEPT)	},
 	{ DUALCALL_BIND,	bind,		RSYS_NAME(BIND)		},
@@ -243,13 +245,23 @@
 	{ DUALCALL_GETVFSSTAT,	getvfsstat,	RSYS_NAME(GETVFSSTAT)	},
 	{ DUALCALL_NFSSVC,	nfssvc,	RSYS_NAME(NFSSVC)	},
 	{ DUALCALL_GETFH,	S(REALGETFH),	RSYS_NAME(GETFH)	},
-	{ DUALCALL_FHOPEN,	S(REALFHOPEN),RSYS_NAME(FHOPEN)	},
-	{ DUALCALL_FHSTAT,	S(REALFHSTAT),RSYS_NAME(FHSTAT)	},
+	{ DUALCALL_FHOPEN,	S(REALFHOPEN),	RSYS_NAME(FHOPEN)	},
+	{ DUALCALL_FHSTAT,	S(REALFHSTAT),	RSYS_NAME(FHSTAT)	},
 	{ DUALCALL_FHSTATVFS1,	S(REALFHSTATVFS1),RSYS_NAME(FHSTATVFS1)	},
+};
+
+struct sysnames sys_optional[] = {
 	{ DUALCALL_QUOTACTL,	S(REALQUOTACTL),RSYS_NAME(QUOTACTL)	},
 };
 #undef S
 
+static int
+nolibcstub(void)
+{
+
+	return ENOSYS;
+}
+
 struct bothsys {
 	void *bs_host;
 	void *bs_rump;
@@ -690,6 +702,9 @@
 break;
 			}
 		}
+
+		if (hijackparse[i].parsefn == NULL)
+			errx(1, invalid hijack specifier name in %s, p);
 	}
 
 }
@@ -698,6 +713,8 @@
 rcinit(void)
 {
 	char buf[1024];
+	struct sysnames *sysvec;
+	size_t totalsys;
 	unsigned i, j;
 
 	host_fork = dlsym(RTLD_NEXT, fork);
@@ -710,27 +727,38 @@
 	 * is a bit of a strech, but it might work.
 	 */
 
+	totalsys = __arraycount(sys_mandatory) + __arraycount(sys_optional);
 	for (i = 0; i  DUALCALL__NUM; i++) {
 		/* build runtime O(1) access */
-		for (j = 0; j  __arraycount(syscnames); j++) {
-			if (syscnames[j].scm_callnum == i)
-break;
-		}
 
-		if (j == __arraycount(syscnames))
-			errx(1, rumphijack error: syscall pos %d missing, i);
+		sysvec = sys_mandatory;
+		for (j = 0; j  __arraycount(sys_mandatory); j++) {
+			if (sys_mandatory[j].scm_callnum == i)
+goto found;
+		}
+		sysvec = sys_optional;
+		for (j = 0; j  __arraycount(sys_optional); j++, j++) {
+			if (sys_optional[j].scm_callnum == i)
+goto found;
+		}
+		errx(1, rumphijack error: syscall pos %d missing, i);
 
+ found:
 		syscalls[i].bs_host = dlsym(RTLD_NEXT,
-		syscnames[j].scm_hostname);
-		if (syscalls[i].bs_host == NULL)
-			errx(1, hostcall %s not found!,
-			syscnames[j].scm_hostname);
+		sysvec[j].scm_hostname);
+		if (syscalls[i].bs_host == NULL) {
+			if (sysvec == sys_optional)
+syscalls[i].bs_host = nolibcstub;
+			else
+errx(1, hostcall %s not found!,
+sysvec[j].scm_hostname);
+		}
 
 		syscalls[i].bs_rump = dlsym(RTLD_NEXT,
-		syscnames[j].scm_rumpname);
+		sysvec[j].scm_rumpname);
 		if (syscalls[i].bs_rump == NULL)
 			errx(1, rumpcall %s not found!,
-			syscnames[j].scm_rumpname);
+			sysvec[j].scm_rumpname);
 	}
 
 	if (rumpclient_init() == -1)



CVS commit: src/tests/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 21:26:00 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
nfsd + mount_nfs test with stock system binaries


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/librumphijack/t_tcpip.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_tcpip.sh
diff -u src/tests/lib/librumphijack/t_tcpip.sh:1.5 src/tests/lib/librumphijack/t_tcpip.sh:1.6
--- src/tests/lib/librumphijack/t_tcpip.sh:1.5	Wed Feb 16 19:31:31 2011
+++ src/tests/lib/librumphijack/t_tcpip.sh	Wed Mar  9 21:25:59 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_tcpip.sh,v 1.5 2011/02/16 19:31:31 pooka Exp $
+#   $NetBSD: t_tcpip.sh,v 1.6 2011/03/09 21:25:59 pooka Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -146,8 +146,94 @@
 	# sshd dies due to RUMPHIJACK_RETRYCONNECT=1d6
 }
 
+
+atf_test_case nfs cleanup
+nfs_head()
+{
+atf_set descr Test hijacked nfsd and mount_nfs
+}
+
+nfs_body()
+{
+
+	magicstr='wind in my hair'
+	# create ffs file system we'll be serving from
+	atf_check -s exit:0 -o ignore newfs -F -s 1 ffs.img
+
+	# start nfs kernel server.  this is a mouthful
+	export RUMP_SERVER=unix://serversock
+	atf_check -s exit:0 rump_server -lrumpvfs -lrumpdev -lrumpnet	\
+	-lrumpnet_net -lrumpnet_netinet -lrumpnet_local		\
+	-lrumpnet_shmif -lrumpdev_disk -lrumpfs_ffs -lrumpfs_nfs	\
+	-lrumpfs_nfsserver		\
+	-d key=/dk,hostpath=ffs.img,size=host ${RUMP_SERVER}
+
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.1
+
+	export RUMPHIJACK_RETRYCONNECT=die
+	export LD_PRELOAD=/usr/lib/librumphijack.so
+
+	atf_check -s exit:0 mkdir -p /rump/var/run
+	atf_check -s exit:0 mkdir -p /rump/var/db
+	atf_check -s exit:0 touch /rump/var/db/mountdtab
+	atf_check -s exit:0 mkdir /rump/etc
+	atf_check -s exit:0 mkdir /rump/export
+
+	atf_check -s exit:0 sh -c	\
+	'echo /export -noresvport -noresvmnt 10.1.1.100 | \
+		dd of=/rump/etc/exports 2 /dev/null'
+
+	atf_check -s exit:0 -e ignore mount_ffs /dk /rump/export
+	atf_check -s exit:0 sh -c echo ${magicstr}  /rump/export/im_alive
+
+	# start rpcbind.  we want /var/run/rpcbind.sock
+	export RUMPHIJACK='blanket=/var/run,socket=all' 
+	atf_check -s exit:0 rpcbind
+
+	# ok, then we want mountd in the similar fashion
+	export RUMPHIJACK='blanket=/var/run:/var/db:/export,socket=all,path=/rump,vfs=all'
+	atf_check -s exit:0 mountd /rump/etc/exports
+
+	# finally, le nfschuck
+	export RUMPHIJACK='blanket=/var/run,socket=all,vfs=all'
+	atf_check -s exit:0 nfsd -tu 
+
+	# now, time for the client server and associated madness.
+	export RUMP_SERVER=unix://clientsock
+	unset LD_PRELOAD
+
+	# at least the kernel server is easier
+	atf_check -s exit:0 rump_server -lrumpvfs -lrumpnet		\
+	-lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpfs_nfs\
+	${RUMP_SERVER}
+
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 10.1.1.100
+
+	export LD_PRELOAD=/usr/lib/librumphijack.so
+	unset RUMPHIJACK
+
+	atf_check -s exit:0 mkdir /rump/mnt
+	atf_check -s exit:0 mount_nfs 10.1.1.1:/export /rump/mnt
+
+	atf_check -s exit:0 -o inline:${magicstr}\n cat /rump/mnt/im_alive
+}
+
+nfs_cleanup()
+{
+
+	RUMP_SERVER=unix://serversock rump.halt 2 /dev/null
+	RUMP_SERVER=unix://clientsock rump.halt 2 /dev/null
+	:
+}
+
+
 atf_init_test_cases()
 {
 	atf_add_test_case http
 	atf_add_test_case ssh
+	atf_add_test_case nfs
 }



CVS commit: src/sys/kern

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 21:52:31 UTC 2011

Modified Files:
src/sys/kern: syscalls.master

Log Message:
mark old quotactl rump too


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/sys/kern/syscalls.master

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/syscalls.master
diff -u src/sys/kern/syscalls.master:1.246 src/sys/kern/syscalls.master:1.247
--- src/sys/kern/syscalls.master:1.246	Sun Mar  6 17:08:36 2011
+++ src/sys/kern/syscalls.master	Wed Mar  9 21:52:31 2011
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.246 2011/03/06 17:08:36 bouyer Exp $
+	$NetBSD: syscalls.master,v 1.247 2011/03/09 21:52:31 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -282,7 +282,7 @@
 			const struct orlimit *rlp); } osetrlimit
 146	COMPAT_43 MODULAR { int|sys||killpg(int pgid, int signum); } okillpg
 147	STD 	RUMP 	{ int|sys||setsid(void); }
-148	COMPAT_50 MODULAR { int|sys||quotactl(const char *path, int cmd, \
+148	COMPAT_50 MODULAR RUMP { int|sys||quotactl(const char *path, int cmd, \
 			int uid, void *arg); }
 149	COMPAT_43 MODULAR { int|sys||quota(void); } oquota
 150	COMPAT_43 MODULAR { int|sys||getsockname(int fdec, void *asa, \



CVS commit: src/sys/netiso

2011-03-09 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Mar  9 22:04:53 UTC 2011

Modified Files:
src/sys/netiso: if_eon.c

Log Message:
Remove ifa == NULL check, ifa cannot be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/netiso/if_eon.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/netiso/if_eon.c
diff -u src/sys/netiso/if_eon.c:1.69 src/sys/netiso/if_eon.c:1.70
--- src/sys/netiso/if_eon.c:1.69	Fri Nov  7 00:20:18 2008
+++ src/sys/netiso/if_eon.c	Wed Mar  9 22:04:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_eon.c,v 1.69 2008/11/07 00:20:18 dyoung Exp $	*/
+/*	$NetBSD: if_eon.c,v 1.70 2011/03/09 22:04:52 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_eon.c,v 1.69 2008/11/07 00:20:18 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_eon.c,v 1.70 2011/03/09 22:04:52 dyoung Exp $);
 
 #include opt_eon.h
 
@@ -191,8 +191,6 @@
 
 	switch (cmd) {
 	case SIOCINITIFADDR:
-		if (ifa == NULL)
-			break;
 		ifp-if_flags |= IFF_UP;
 		if (ifa-ifa_addr-sa_family != AF_LINK)
 			ifa-ifa_rtrequest = eonrtrequest;



CVS commit: src/sys/netnatm

2011-03-09 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Mar  9 22:06:42 UTC 2011

Modified Files:
src/sys/netnatm: natm.c

Log Message:
unifdef -U__OpenBSD__ -D__NetBSD__ -U__FreeBSD__ for readability.  No
functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/netnatm/natm.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/netnatm/natm.c
diff -u src/sys/netnatm/natm.c:1.23 src/sys/netnatm/natm.c:1.24
--- src/sys/netnatm/natm.c:1.23	Tue Feb  1 19:40:24 2011
+++ src/sys/netnatm/natm.c	Wed Mar  9 22:06:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: natm.c,v 1.23 2011/02/01 19:40:24 chuck Exp $	*/
+/*	$NetBSD: natm.c,v 1.24 2011/03/09 22:06:42 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: natm.c,v 1.23 2011/02/01 19:40:24 chuck Exp $);
+__KERNEL_RCSID(0, $NetBSD: natm.c,v 1.24 2011/03/09 22:06:42 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -63,22 +63,12 @@
  * user requests
  */
 
-#if defined(__NetBSD__)
 int natm_usrreq(so, req, m, nam, control, l)
-#elif defined(__OpenBSD__)
-int natm_usrreq(so, req, m, nam, control, p)
-#elif defined(__FreeBSD__)
-int natm_usrreq(so, req, m, nam, control)
-#endif
 
 struct socket *so;
 int req;
 struct mbuf *m, *nam, *control;
-#if defined(__NetBSD__)
 struct lwp *l;
-#elif deifned(__OpenBSD__)
-struct proc *p;
-#endif
 
 {
   int error = 0, s, s2;
@@ -270,12 +260,7 @@
   memset(snatm, 0, sizeof(*snatm));
   nam-m_len = snatm-snatm_len = sizeof(*snatm);
   snatm-snatm_family = AF_NATM;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
   memcpy(snatm-snatm_if, npcb-npcb_ifp-if_xname, sizeof(snatm-snatm_if));
-#elif defined(__FreeBSD__)
-  snprintf(snatm-snatm_if, sizeof(snatm-snatm_if), %s%d,
-  npcb-npcb_ifp-if_name, npcb-npcb_ifp-if_unit);
-#endif
   snatm-snatm_vci = npcb-npcb_vci;
   snatm-snatm_vpi = npcb-npcb_vpi;
   break;
@@ -411,52 +396,3 @@
 
   goto next;
 }
-
-#if defined(__FreeBSD__)
-NETISR_SET(NETISR_NATM, natmintr);
-#endif
-
-
-#ifdef notyet
-/*
- * natm0_sysctl: not used, but here in case we want to add something
- * later...
- */
-
-int natm0_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
-
-int *name;
-u_int namelen;
-void *oldp;
-size_t *oldlenp;
-void *newp;
-size_t newlen;
-
-{
-  /* All sysctl names at this level are terminal. */
-  if (namelen != 1)
-return (ENOTDIR);
-  return (ENOPROTOOPT);
-}
-
-/*
- * natm5_sysctl: not used, but here in case we want to add something
- * later...
- */
-
-int natm5_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
-
-int *name;
-u_int namelen;
-void *oldp;
-size_t *oldlenp;
-void *newp;
-size_t newlen;
-
-{
-  /* All sysctl names at this level are terminal. */
-  if (namelen != 1)
-return (ENOTDIR);
-  return (ENOPROTOOPT);
-}
-#endif



CVS commit: src/sys/kern

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 22:12:45 UTC 2011

Modified Files:
src/sys/kern: syscalls.master

Log Message:
actually, revert previous for now.  quotactl doesn't play with the
same rules as all the other compat functions.


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/sys/kern/syscalls.master

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/syscalls.master
diff -u src/sys/kern/syscalls.master:1.247 src/sys/kern/syscalls.master:1.248
--- src/sys/kern/syscalls.master:1.247	Wed Mar  9 21:52:31 2011
+++ src/sys/kern/syscalls.master	Wed Mar  9 22:12:45 2011
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.247 2011/03/09 21:52:31 pooka Exp $
+	$NetBSD: syscalls.master,v 1.248 2011/03/09 22:12:45 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -282,7 +282,7 @@
 			const struct orlimit *rlp); } osetrlimit
 146	COMPAT_43 MODULAR { int|sys||killpg(int pgid, int signum); } okillpg
 147	STD 	RUMP 	{ int|sys||setsid(void); }
-148	COMPAT_50 MODULAR RUMP { int|sys||quotactl(const char *path, int cmd, \
+148	COMPAT_50 MODULAR { int|sys||quotactl(const char *path, int cmd, \
 			int uid, void *arg); }
 149	COMPAT_43 MODULAR { int|sys||quota(void); } oquota
 150	COMPAT_43 MODULAR { int|sys||getsockname(int fdec, void *asa, \



CVS commit: src/bin/csh

2011-03-09 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Mar  9 22:26:36 UTC 2011

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

Log Message:
Fix sub-section references.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/bin/csh/csh.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/csh/csh.1
diff -u src/bin/csh/csh.1:1.48 src/bin/csh/csh.1:1.49
--- src/bin/csh/csh.1:1.48	Mon Mar 22 18:33:27 2010
+++ src/bin/csh/csh.1	Wed Mar  9 22:26:36 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: csh.1,v 1.48 2010/03/22 18:33:27 joerg Exp $
+.\	$NetBSD: csh.1,v 1.49 2011/03/09 22:26:36 njoly Exp $
 .\
 .\ Copyright (c) 1980, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -46,7 +46,7 @@
 .Nm
 is a command language interpreter
 incorporating a history mechanism (see
-.Sx History Substitutions ) ,
+.Sx History substitutions ) ,
 job control facilities (see
 .Sx Jobs ) ,
 interactive file name
@@ -1977,7 +1977,7 @@
 .Ar name .
 .It Ic noclobber
 As described in the section on
-.Sx input/output ,
+.Sx Input/output ,
 restrictions are placed on output redirection to ensure that
 files are not accidentally destroyed, and that `\*[Gt]\*[Gt]' redirections
 refer to existing files.
@@ -2046,7 +2046,7 @@
 This variable is used in forking shells to interpret files that have execute
 bits set, but which are not executable by the system.
 (See the description of
-.Sx Non-builtin Command Execution
+.Sx Non-builtin command execution
 below.)
 Initialized to the (system-dependent) home of the shell.
 .It Ic status
@@ -2245,7 +2245,7 @@
 .Bx 3 .
 It was a first implementation of a command language interpreter
 incorporating a history mechanism (see
-.Sx History Substitutions ) ,
+.Sx History substitutions ) ,
 job control facilities (see
 .Sx Jobs ) ,
 interactive file name



CVS commit: src/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 23:26:20 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Make getfh() a pathcall instead of a fhcall.  while it does pertain
to file handles, it still gets passed a path and we can DTRT based
on that.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.81 src/lib/librumphijack/hijack.c:1.82
--- src/lib/librumphijack/hijack.c:1.81	Wed Mar  9 20:48:57 2011
+++ src/lib/librumphijack/hijack.c	Wed Mar  9 23:26:19 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.82 2011/03/09 23:26:19 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.82 2011/03/09 23:26:19 pooka Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -2199,6 +2199,11 @@
 	(const char *, struct plistref *),\
 	(path, p))
 
+PATHCALL(int, REALGETFH, DUALCALL_GETFH,\
+	(const char *path, void *fhp, size_t *fh_size),			\
+	(const char *, void *, size_t *),\
+	(path, fhp, fh_size))
+
 /*
  * These act different on a per-process vfs configuration
  */
@@ -2208,11 +2213,6 @@
 	(struct statvfs *, size_t, int),\
 	(buf, buflen, flags))
 
-VFSCALL(VFSBIT_FHCALLS, int, REALGETFH, DUALCALL_GETFH,			\
-	(const char *path, void *fhp, size_t *fh_size),			\
-	(const char *, void *, size_t *),\
-	(path, fhp, fh_size))
-
 VFSCALL(VFSBIT_FHCALLS, int, REALFHOPEN, DUALCALL_FHOPEN,		\
 	(const void *fhp, size_t fh_size, int flags),			\
 	(const char *, size_t, int),	\



CVS commit: src/lib/librumphijack

2011-03-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar  9 23:40:44 UTC 2011

Modified Files:
src/lib/librumphijack: rumphijack.3

Log Message:
document vfs and sysctl knobs to RUMPHIJACK


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/librumphijack/rumphijack.3

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

Modified files:

Index: src/lib/librumphijack/rumphijack.3
diff -u src/lib/librumphijack/rumphijack.3:1.9 src/lib/librumphijack/rumphijack.3:1.10
--- src/lib/librumphijack/rumphijack.3:1.9	Tue Mar  8 23:51:23 2011
+++ src/lib/librumphijack/rumphijack.3	Wed Mar  9 23:40:44 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: rumphijack.3,v 1.9 2011/03/08 23:51:23 wiz Exp $
+.\ $NetBSD: rumphijack.3,v 1.10 2011/03/09 23:40:44 pooka Exp $
 .\
 .\ Copyright (c) 2011 Antti Kantee.  All rights reserved.
 .\
@@ -23,7 +23,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd March 8, 2011
+.Dd March 9, 2011
 .Dt RUMPHIJACK 3
 .Os
 .Sh NAME
@@ -135,6 +135,44 @@
 specifies that all protocol families except
 .Dv PF_INET
 should be hijacked.
+.It Dq vfs
+The specifier
+.Ar value
+contains a colon-separated list of which vfs-related system calls
+should be hijacked.
+These differ from the pathname-based file system syscalls in that
+there is no pathname to make the selection based on.
+Current possible values are
+.Dq nfssvc ,
+.Dq getvfsstat
+and
+.Dq fhcalls.
+They indicate hijacking
+.Fn nfssvc ,
+.Fn getvfsstat
+and all file handle calls, respectively.
+The file handle calls include
+.Fn fhopen ,
+.Fn fhstat
+and
+.Fn fhstatvfs1 .
+.Pp
+It is also possible to use
+.Dq all
+and
+.Dq no
+in the same fashion as with the socket hijack specifier.
+.It Dq sysctl
+Direct the
+.Fn __sysctl
+backend of the
+.Xr sysctl 3
+facility to the rump kernel.
+Acceptable values are
+.Dq yes
+and
+.Dq no ,
+meaning to call the rump or the host kernel, respectively.
 .El
 .Pp
 If the environment variable is unset, the default value



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2011-03-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Mar  9 23:49:07 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_config.c

Log Message:
If the config is zero size, don't try to read it.

OK haad@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.4
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.3	Sat Feb 27 23:43:53 2010
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c	Wed Mar  9 23:49:06 2011
@@ -95,6 +95,9 @@
 	if (kobj_get_filesize(file, fsize) != 0)
 		goto out;
 
+	if (fsize == 0)
+		goto out;
+
 	buf = kmem_alloc(fsize, KM_SLEEP);
 
 	/*



CVS commit: src/lib/libc/tls

2011-03-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Mar  9 23:50:41 UTC 2011

Modified Files:
src/lib/libc/tls: tls.c

Log Message:
Define namespace remap macros before including sys/tls.h.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/tls/tls.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/tls/tls.c
diff -u src/lib/libc/tls/tls.c:1.1 src/lib/libc/tls/tls.c:1.2
--- src/lib/libc/tls/tls.c:1.1	Wed Mar  9 23:10:06 2011
+++ src/lib/libc/tls/tls.c	Wed Mar  9 23:50:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls.c,v 1.1 2011/03/09 23:10:06 joerg Exp $	*/
+/*	$NetBSD: tls.c,v 1.2 2011/03/09 23:50:40 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,17 +30,17 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: tls.c,v 1.1 2011/03/09 23:10:06 joerg Exp $);
+__RCSID($NetBSD: tls.c,v 1.2 2011/03/09 23:50:40 joerg Exp $);
 
 #include namespace.h
 
+#define	_rtld_tls_allocate	__libc_rtld_tls_allocate
+#define	_rtld_tls_free		__libc_rtld_tls_free
+
 #include sys/tls.h
 
 #if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
 
-#define	_rtld_tls_allocate	__libc_rtld_tls_allocate
-#define	_rtld_tls_free		__libc_rtld_tls_free
-
 #include sys/param.h
 #include sys/mman.h
 #include link_elf.h



CVS commit: src/external/cddl/osnet/dist/common/acl

2011-03-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Mar  9 23:55:46 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/common/acl: acl_common.c

Log Message:
#include sys/debug.h (from the ZFS sources) so that ASSERT() is
defined, and we don't get problems like kern/44430.  This is
more a workaround than a fix, but at least I can load zfs now.

ok haad@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dist/common/acl/acl_common.c

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

Modified files:

Index: src/external/cddl/osnet/dist/common/acl/acl_common.c
diff -u src/external/cddl/osnet/dist/common/acl/acl_common.c:1.2 src/external/cddl/osnet/dist/common/acl/acl_common.c:1.3
--- src/external/cddl/osnet/dist/common/acl/acl_common.c:1.2	Fri Aug  7 20:16:45 2009
+++ src/external/cddl/osnet/dist/common/acl/acl_common.c	Wed Mar  9 23:55:46 2011
@@ -26,6 +26,7 @@
 #pragma ident	%Z%%M%	%I%	%E% SMI
 
 #include sys/types.h
+#include sys/debug.h
 #include sys/stat.h
 #include sys/avl.h
 #if defined(_KERNEL)



CVS commit: src/sys/dev/usb

2011-03-09 Thread Steve Woodford
Module Name:src
Committed By:   scw
Date:   Thu Mar 10 00:11:59 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add entry for Toshiba version of a Novatel EU870D 3G/HSDPA WWAN Card.


To generate a diff of this commit:
cvs rdiff -u -r1.578 -r1.579 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.578 src/sys/dev/usb/usbdevs:1.579
--- src/sys/dev/usb/usbdevs:1.578	Sun Feb  6 23:11:11 2011
+++ src/sys/dev/usb/usbdevs	Thu Mar 10 00:11:59 2011
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.578 2011/02/06 23:11:11 njoly Exp $
+$NetBSD: usbdevs,v 1.579 2011/03/10 00:11:59 scw Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2688,6 +2688,7 @@
 
 /* Toshiba Corporation products */
 product TOSHIBA POCKETPC_E740	0x0706	PocketPC e740
+product TOSHIBA HSDPA_MODEM_EU870DT1	0x1302	HSDPA 3G Modem Card
 
 /* Trek Technology products */
 product TREK THUMBDRIVE		0x	ThumbDrive



CVS commit: src/sys/dev/usb

2011-03-09 Thread Steve Woodford
Module Name:src
Committed By:   scw
Date:   Thu Mar 10 00:12:51 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen for Toshiba version of Novatel EU870D 3G/HSDPA WWAN Card


To generate a diff of this commit:
cvs rdiff -u -r1.571 -r1.572 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.572 -r1.573 src/sys/dev/usb/usbdevs_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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.571 src/sys/dev/usb/usbdevs.h:1.572
--- src/sys/dev/usb/usbdevs.h:1.571	Sun Feb  6 23:11:54 2011
+++ src/sys/dev/usb/usbdevs.h	Thu Mar 10 00:12:51 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.571 2011/02/06 23:11:54 njoly Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.572 2011/03/10 00:12:51 scw Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.578 2011/02/06 23:11:11 njoly Exp
+ *	NetBSD: usbdevs,v 1.579 2011/03/10 00:11:59 scw Exp
  */
 
 /*
@@ -2695,6 +2695,7 @@
 
 /* Toshiba Corporation products */
 #define	USB_PRODUCT_TOSHIBA_POCKETPC_E740	0x0706		/* PocketPC e740 */
+#define	USB_PRODUCT_TOSHIBA_HSDPA_MODEM_EU870DT1	0x1302		/* HSDPA 3G Modem Card */
 
 /* Trek Technology products */
 #define	USB_PRODUCT_TREK_THUMBDRIVE	0x		/* ThumbDrive */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.572 src/sys/dev/usb/usbdevs_data.h:1.573
--- src/sys/dev/usb/usbdevs_data.h:1.572	Sun Feb  6 23:11:54 2011
+++ src/sys/dev/usb/usbdevs_data.h	Thu Mar 10 00:12:51 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.572 2011/02/06 23:11:54 njoly Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.573 2011/03/10 00:12:51 scw Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.578 2011/02/06 23:11:11 njoly Exp
+ *	NetBSD: usbdevs,v 1.579 2011/03/10 00:11:59 scw Exp
  */
 
 /*
@@ -7915,6 +7915,10 @@
 	PocketPC e740,
 	},
 	{
+	USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_HSDPA_MODEM_EU870DT1,
+	HSDPA 3G Modem Card,
+	},
+	{
 	USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE,
 	ThumbDrive,
 	},
@@ -8411,4 +8415,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1601;
+const int usb_nproducts = 1602;



CVS commit: src/sys/dev/usb

2011-03-09 Thread Steve Woodford
Module Name:src
Committed By:   scw
Date:   Thu Mar 10 00:13:56 UTC 2011

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

Log Message:
Match a Toshiba-branded version of Novatel's EU870D 3G/HSDPA WWAN Card.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/u3g.c

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

Modified files:

Index: src/sys/dev/usb/u3g.c
diff -u src/sys/dev/usb/u3g.c:1.16 src/sys/dev/usb/u3g.c:1.17
--- src/sys/dev/usb/u3g.c:1.16	Sat Aug  7 20:43:46 2010
+++ src/sys/dev/usb/u3g.c	Thu Mar 10 00:13:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: u3g.c,v 1.16 2010/08/07 20:43:46 christos Exp $	*/
+/*	$NetBSD: u3g.c,v 1.17 2011/03/10 00:13:56 scw Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.16 2010/08/07 20:43:46 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.17 2011/03/10 00:13:56 scw Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -241,6 +241,9 @@
 	{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 },
 	{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MINI5725 },
 	{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_USB305 },
+
+	/* Toshiba */
+	{ USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_HSDPA_MODEM_EU870DT1 },
 };
 
 static int



CVS commit: src/sys/dev/ic

2011-03-09 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 10 03:35:38 UTC 2011

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

Log Message:
Shorten infinite loop.  Tames atactl(8) atabus reset on mvsata(4).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/mvsata.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/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.7 src/sys/dev/ic/mvsata.c:1.8
--- src/sys/dev/ic/mvsata.c:1.7	Sun Feb 20 01:26:22 2011
+++ src/sys/dev/ic/mvsata.c	Thu Mar 10 03:35:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.7 2011/02/20 01:26:22 riz Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.8 2011/03/10 03:35:37 jakllsch Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mvsata.c,v 1.7 2011/02/20 01:26:22 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: mvsata.c,v 1.8 2011/03/10 03:35:37 jakllsch Exp $);
 
 #include opt_mvsata.h
 
@@ -575,7 +575,7 @@
 		mvport-port_sata_scontrol, mvport-port_sata_sstatus);
 	}
 
-	for (i = 0; MVSATA_EDMAQ_LEN; i++) {
+	for (i = 0; i  MVSATA_EDMAQ_LEN; i++) {
 		xfer = mvport-port_reqtbl[i].xfer;
 		if (xfer == NULL)
 			continue;