CVS commit: src/sys/arch/usermode

2012-01-10 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Jan 10 12:04:56 UTC 2012

Modified Files:
src/sys/arch/usermode/include: thunk.h
src/sys/arch/usermode/usermode: thunk.c

Log Message:
Add thunk_madvise() for memory access hints to the host kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/usermode/include/thunk.h
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/usermode/usermode/thunk.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/usermode/include/thunk.h
diff -u src/sys/arch/usermode/include/thunk.h:1.57 src/sys/arch/usermode/include/thunk.h:1.58
--- src/sys/arch/usermode/include/thunk.h:1.57	Fri Jan  6 14:11:55 2012
+++ src/sys/arch/usermode/include/thunk.h	Tue Jan 10 12:04:56 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.57 2012/01/06 14:11:55 jmcneill Exp $ */
+/* $NetBSD: thunk.h,v 1.58 2012/01/10 12:04:56 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -67,6 +67,14 @@ struct thunk_termios {
 #define THUNK_PROT_WRITE	0x02
 #define THUNK_PROT_EXEC		0x04
 
+#define THUNK_MADV_NORMAL	0x01
+#define THUNK_MADV_RANDOM	0x02
+#define THUNK_MADV_SEQUENTIAL	0x04
+#define THUNK_MADV_WILLNEED	0x08
+#define THUNK_MADV_DONTNEED	0x10
+#define THUNK_MADV_FREE		0x20
+
+
 struct aiocb;
 
 void	thunk_printf_debug(const char *fmt, ...) __attribute__((__format__(__printf__, 1, 2)));
@@ -138,6 +146,7 @@ void *	thunk_sbrk(intptr_t len);
 void *	thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
 int	thunk_munmap(void *addr, size_t len);
 int	thunk_mprotect(void *addr, size_t len, int prot);
+int	thunk_madvise(void *addr, size_t len, int behav);
 int	thunk_posix_memalign(void **, size_t, size_t);
 
 int	thunk_idle(void);

Index: src/sys/arch/usermode/usermode/thunk.c
diff -u src/sys/arch/usermode/usermode/thunk.c:1.75 src/sys/arch/usermode/usermode/thunk.c:1.76
--- src/sys/arch/usermode/usermode/thunk.c:1.75	Fri Jan  6 14:11:55 2012
+++ src/sys/arch/usermode/usermode/thunk.c	Tue Jan 10 12:04:56 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.75 2012/01/06 14:11:55 jmcneill Exp $ */
+/* $NetBSD: thunk.c,v 1.76 2012/01/10 12:04:56 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill jmcne...@invisible.ca
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifdef __NetBSD__
-__RCSID($NetBSD: thunk.c,v 1.75 2012/01/06 14:11:55 jmcneill Exp $);
+__RCSID($NetBSD: thunk.c,v 1.76 2012/01/10 12:04:56 reinoud Exp $);
 #endif
 
 #include sys/types.h
@@ -213,6 +213,27 @@ thunk_to_native_mapflags(int flags)
 	return nflags;
 }
 
+static int
+thunk_to_native_madviseflags(int flags)
+{
+	int nflags = 0;
+
+	if (flags  THUNK_MADV_NORMAL)
+		nflags |= MADV_NORMAL;
+	if (flags  THUNK_MADV_RANDOM)
+		nflags |= MADV_RANDOM;
+	if (flags  THUNK_MADV_SEQUENTIAL)
+		nflags |= MADV_SEQUENTIAL;
+	if (flags  THUNK_MADV_WILLNEED)
+		nflags |= MADV_WILLNEED;
+	if (flags  THUNK_MADV_DONTNEED)
+		nflags |= MADV_DONTNEED;
+	if (flags  THUNK_MADV_FREE)
+		nflags |= MADV_FREE;
+
+	return nflags;
+}
+
 int
 thunk_setitimer(int which, const struct thunk_itimerval *value,
 struct thunk_itimerval *ovalue)
@@ -673,6 +694,16 @@ thunk_mprotect(void *addr, size_t len, i
 }
 
 int
+thunk_madvise(void *addr, size_t len, int behav)
+{
+	int nbehav;
+
+	nbehav = thunk_to_native_madviseflags(behav);
+
+	return madvise(addr, len, nbehav);
+}
+
+int
 thunk_posix_memalign(void **ptr, size_t alignment, size_t size)
 {
 	return posix_memalign(ptr, alignment, size);



CVS commit: src/sys/arch/usermode/usermode

2012-01-10 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Jan 10 12:07:18 UTC 2012

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
Use thunk_madvise() on the memory space hinting the kernel we are using it in
a random order and hint the kernel that we we need the memory.i

No measured effect on a memory file on tmpfs /tmp though.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.100 src/sys/arch/usermode/usermode/pmap.c:1.101
--- src/sys/arch/usermode/usermode/pmap.c:1.100	Tue Jan 10 10:09:49 2012
+++ src/sys/arch/usermode/usermode/pmap.c	Tue Jan 10 12:07:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.101 2012/01/10 12:07:17 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.101 2012/01/10 12:07:17 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -255,6 +255,13 @@ pmap_bootstrap(void)
 		THUNK_PROT_READ | THUNK_PROT_EXEC);
 	assert(err == 0);
 
+	/* madvise the host kernel about our intentions with the memory */
+	/* no measured effect, but might make a difference on high load */
+	err = thunk_madvise((void *) kmem_user_start,
+		kmem_k_start - kmem_user_start,
+		THUNK_MADV_WILLNEED | THUNK_MADV_RANDOM);
+	assert(err == 0);
+
 	/* initialize counters */
 	fpos = 0;
 	free_start = fpos; /* in physical space ! */



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

2012-01-10 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Tue Jan 10 12:07:30 UTC 2012

Modified Files:
src/crypto/dist/ipsec-tools: configure.ac
src/crypto/dist/ipsec-tools/src/racoon: isakmp_unity.c

Log Message:
From Rainer Weikusat rweiku...@mobileactivedefense.com: Enhance splitnet
environment variable string value generation.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/crypto/dist/ipsec-tools/configure.ac
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/configure.ac
diff -u src/crypto/dist/ipsec-tools/configure.ac:1.10 src/crypto/dist/ipsec-tools/configure.ac:1.11
--- src/crypto/dist/ipsec-tools/configure.ac:1.10	Fri Jan 23 08:25:06 2009
+++ src/crypto/dist/ipsec-tools/configure.ac	Tue Jan 10 12:07:30 2012
@@ -112,7 +112,7 @@ esac
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h sys/time.h unistd.h stdarg.h varargs.h)
-AC_CHECK_HEADERS(shadow.h)
+AC_CHECK_HEADERS(shadow.h strings.h)
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.10 src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.11
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.10	Sun Jan  1 17:31:42 2012
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c	Tue Jan 10 12:07:30 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp_unity.c,v 1.10 2012/01/01 17:31:42 tteras Exp $	*/
+/*	$NetBSD: isakmp_unity.c,v 1.11 2012/01/10 12:07:30 tteras Exp $	*/
 
 /* Id: isakmp_unity.c,v 1.10 2006/07/31 04:49:23 manubsd Exp */
 
@@ -62,6 +62,9 @@
 #endif
 #include ctype.h
 #include resolv.h
+#ifdef HAVE_STRINGS_H
+#include strings.h
+#endif
 
 #include var.h
 #include misc.h
@@ -399,16 +402,17 @@ char * splitnet_list_2str(list, splitnet
 	while (netentry != NULL) {
 
 		inet_ntop(AF_INET, netentry-network.addr4, tmp1, 40);
-		inet_ntop(AF_INET, netentry-network.mask4, tmp2, 40);
 		if (splitnet_ipaddr == CIDR) {
 			uint32_t tmp3;
 			int cidrmask;
 
 			tmp3 = ntohl(netentry-network.mask4.s_addr);
-			for (cidrmask = 0; tmp3 != 0; cidrmask++)
-tmp3 = 1;
+			cidrmask = 33 - ffs(tmp3);
+			if (cidrmask == 33) cidrmask = 0;
+			
 			len += sprintf(str+len, %s/%d , tmp1, cidrmask);
 		} else {
+			inet_ntop(AF_INET, netentry-network.mask4, tmp2, 40);
 			len += sprintf(str+len, %s/%s , tmp1, tmp2);
 		}
 



CVS commit: src/sys/arch/evbppc/obs405

2012-01-10 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jan 10 12:17:20 UTC 2012

Modified Files:
src/sys/arch/evbppc/obs405: obs600_autoconf.c

Log Message:
Establish the cascading uic[12] by calling pic_finish_setup().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/obs405/obs600_autoconf.c

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

Modified files:

Index: src/sys/arch/evbppc/obs405/obs600_autoconf.c
diff -u src/sys/arch/evbppc/obs405/obs600_autoconf.c:1.5 src/sys/arch/evbppc/obs405/obs600_autoconf.c:1.6
--- src/sys/arch/evbppc/obs405/obs600_autoconf.c:1.5	Mon Dec 12 11:23:57 2011
+++ src/sys/arch/evbppc/obs405/obs600_autoconf.c	Tue Jan 10 12:17:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs600_autoconf.c,v 1.5 2011/12/12 11:23:57 kiyohara Exp $	*/
+/*	$NetBSD: obs600_autoconf.c,v 1.6 2012/01/10 12:17:20 kiyohara Exp $	*/
 
 /*
  * Copyright 2004 Shigeyuki Fukushima.
@@ -33,7 +33,7 @@
  * DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: obs600_autoconf.c,v 1.5 2011/12/12 11:23:57 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: obs600_autoconf.c,v 1.6 2012/01/10 12:17:20 kiyohara Exp $);
 
 #include sys/systm.h
 #include sys/device.h
@@ -68,6 +68,8 @@ cpu_configure(void)
 	if (config_rootfound(plb, NULL) == NULL)
 		panic(configure: mainbus not configured);
 
+	pic_finish_setup();
+
 	printf(biomask %x netmask %x ttymask %x\n,
 	imask[IPL_BIO], imask[IPL_NET], imask[IPL_TTY]);
 



CVS commit: src/tools/gcc

2012-01-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan 10 12:26:45 UTC 2012

Modified Files:
src/tools/gcc: Makefile

Log Message:
Fix (harmless?) HAVE_GCC comparison version.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/tools/gcc/Makefile

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.48 src/tools/gcc/Makefile:1.49
--- src/tools/gcc/Makefile:1.48	Mon Dec 12 18:59:06 2011
+++ src/tools/gcc/Makefile	Tue Jan 10 12:26:45 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.48 2011/12/12 18:59:06 joerg Exp $
+#	$NetBSD: Makefile,v 1.49 2012/01/10 12:26:45 skrll Exp $
 
 .include bsd.own.mk
 
@@ -103,7 +103,7 @@ BUILD_MAKE=${TOOL_GMAKE}
 # mknative-gcc specific stuff
 #
 
-.if ${HAVE_GCC} = 45
+.if ${HAVE_GCC}  45
 GCCSRCDIR=${.CURDIR}/../../gnu/dist/gcc4
 .else
 GCCSRCDIR=${.CURDIR}/../../external/gpl3/gcc/dist



CVS commit: src/tools/gcc

2012-01-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan 10 12:27:54 UTC 2012

Modified Files:
src/tools/gcc: Makefile mknative-gcc

Log Message:
Fix bootstrap-libgcc for gcc 4.5


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tools/gcc/Makefile
cvs rdiff -u -r1.65 -r1.66 src/tools/gcc/mknative-gcc

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.49 src/tools/gcc/Makefile:1.50
--- src/tools/gcc/Makefile:1.49	Tue Jan 10 12:26:45 2012
+++ src/tools/gcc/Makefile	Tue Jan 10 12:27:54 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2012/01/10 12:26:45 skrll Exp $
+#	$NetBSD: Makefile,v 1.50 2012/01/10 12:27:54 skrll Exp $
 
 .include bsd.own.mk
 
@@ -117,7 +117,7 @@ MKNATIVE?=	${.CURDIR}/mknative-gcc
 
 bootstrap-libgcc: .configure_done
 	@echo 'Creating files needed for libgcc by a native bootstrap build.'
-	@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MODULE} \
+	@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET} \
 		${.OBJDIR}/build ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \
 		${DESTDIR}
 

Index: src/tools/gcc/mknative-gcc
diff -u src/tools/gcc/mknative-gcc:1.65 src/tools/gcc/mknative-gcc:1.66
--- src/tools/gcc/mknative-gcc:1.65	Thu Oct 13 19:52:33 2011
+++ src/tools/gcc/mknative-gcc	Tue Jan 10 12:27:54 2012
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-gcc,v 1.65 2011/10/13 19:52:33 matt Exp $
+#	$NetBSD: mknative-gcc,v 1.66 2012/01/10 12:27:54 skrll Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/gnu/dist/gcc.
@@ -691,6 +691,15 @@ libgcc4)
 	exit 0
 	;;
 
+libgcc45)
+	_OUTDIR=$_TOP/external/gpl3/gcc
+	_OUTDIRBASE=external/gpl3/gcc
+	get_libgcc gcc
+	get_crtstuff crtstuff
+	get_libgcov gcc
+	exit 0
+	;;
+
 # gcc files
 gcc4)
 	get_gcc gcc4



CVS commit: src/usr.bin/telnet

2012-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 10 13:49:32 UTC 2012

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

Log Message:
fix signed/unsigned comparison.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/telnet/telnet.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/telnet/telnet.c
diff -u src/usr.bin/telnet/telnet.c:1.35 src/usr.bin/telnet/telnet.c:1.36
--- src/usr.bin/telnet/telnet.c:1.35	Mon Jan  9 11:08:55 2012
+++ src/usr.bin/telnet/telnet.c	Tue Jan 10 08:49:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnet.c,v 1.35 2012/01/09 16:08:55 christos Exp $	*/
+/*	$NetBSD: telnet.c,v 1.36 2012/01/10 13:49:32 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)telnet.c	8.4 (Berkeley) 5/30/95;
 #else
-__RCSID($NetBSD: telnet.c,v 1.35 2012/01/09 16:08:55 christos Exp $);
+__RCSID($NetBSD: telnet.c,v 1.36 2012/01/10 13:49:32 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -1633,7 +1633,7 @@ env_opt_add(unsigned char *ep)
 	vp = env_getvalue(ep);
 	elen = 2 * (vp ? strlen((char *)vp) : 0) +
 		2 * strlen((char *)ep) + 6;
-	if ((opt_replyend - opt_replyp)  elen)
+	if ((unsigned int)(opt_replyend - opt_replyp)  elen)
 	{
 		unsigned char *p;
 		len = opt_replyend - opt_reply + elen;



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

2012-01-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jan 10 15:23:11 UTC 2012

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

Log Message:
Call aprint_naive for quiet boot message.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/x86/ipmi.c

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

Modified files:

Index: src/sys/arch/x86/x86/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.50 src/sys/arch/x86/x86/ipmi.c:1.51
--- src/sys/arch/x86/x86/ipmi.c:1.50	Wed Aug 11 11:31:45 2010
+++ src/sys/arch/x86/x86/ipmi.c	Tue Jan 10 15:23:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.50 2010/08/11 11:31:45 pgoyette Exp $ */
+/*	$NetBSD: ipmi.c,v 1.51 2012/01/10 15:23:11 njoly Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.50 2010/08/11 11:31:45 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.51 2012/01/10 15:23:11 njoly Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -2125,6 +2125,7 @@ ipmi_attach(device_t parent, device_t se
 
 	sc-sc_ia = *(struct ipmi_attach_args *)aux;
 	sc-sc_dev = self;
+	aprint_naive(\n);
 	aprint_normal(\n);
 
 	/* lock around read_sensor so that no one messes with the bmc regs */



CVS commit: src/lib/libkvm

2012-01-10 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Jan 10 16:01:16 UTC 2012

Modified Files:
src/lib/libkvm: kvm_x86_64.c

Log Message:
fix handling of large pages.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libkvm/kvm_x86_64.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/libkvm/kvm_x86_64.c
diff -u src/lib/libkvm/kvm_x86_64.c:1.8 src/lib/libkvm/kvm_x86_64.c:1.9
--- src/lib/libkvm/kvm_x86_64.c:1.8	Mon Sep 20 23:23:16 2010
+++ src/lib/libkvm/kvm_x86_64.c	Tue Jan 10 16:01:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_x86_64.c,v 1.8 2010/09/20 23:23:16 jym Exp $	*/
+/*	$NetBSD: kvm_x86_64.c,v 1.9 2012/01/10 16:01:16 chs Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)kvm_hp300.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: kvm_x86_64.c,v 1.8 2010/09/20 23:23:16 jym Exp $);
+__RCSID($NetBSD: kvm_x86_64.c,v 1.9 2012/01/10 16:01:16 chs Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -105,7 +105,6 @@ _kvm_kvatop(kvm_t *kd, vaddr_t va, paddr
 	}
 
 	cpu_kh = kd-cpu_data;
-	page_off = va  PGOFSET;
 
 	/*
 	 * Find and read all entries to get to the pa.
@@ -138,6 +137,11 @@ _kvm_kvatop(kvm_t *kd, vaddr_t va, paddr
 		_kvm_err(kd, 0, invalid translation (invalid level 3 PDE));
 		goto lose;
 	}
+	if (pde  PG_PS) {
+		page_off = va  (NBPD_L3 - 1);
+		*pa = (pde  PG_1GFRAME) + page_off;
+		return (int)(NBPD_L3 - page_off);
+	}
 
 	/*
 	 * Level 2.
@@ -152,7 +156,11 @@ _kvm_kvatop(kvm_t *kd, vaddr_t va, paddr
 		_kvm_err(kd, 0, invalid translation (invalid level 2 PDE));
 		goto lose;
 	}
-
+	if (pde  PG_PS) {
+		page_off = va  (NBPD_L2 - 1);
+		*pa = (pde  PG_2MFRAME) + page_off;
+		return (int)(NBPD_L2 - page_off);
+	}
 
 	/*
 	 * Level 1.
@@ -170,6 +178,7 @@ _kvm_kvatop(kvm_t *kd, vaddr_t va, paddr
 		_kvm_err(kd, 0, invalid translation (invalid PTE));
 		goto lose;
 	}
+	page_off = va  PGOFSET;
 	*pa = (pte  PG_FRAME) + page_off;
 	return (int)(NBPG - page_off);
 



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

2012-01-10 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Jan 10 16:03:17 UTC 2012

Modified Files:
src/sys/arch/amd64/include: vmparam.h

Log Message:
reduce VM_MAX_KERNEL_ADDRESS so that it does not include
the direct-map or APTE regions.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/include/vmparam.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/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.28 src/sys/arch/amd64/include/vmparam.h:1.29
--- src/sys/arch/amd64/include/vmparam.h:1.28	Thu Nov 24 17:08:07 2011
+++ src/sys/arch/amd64/include/vmparam.h	Tue Jan 10 16:03:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.28 2011/11/24 17:08:07 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.29 2012/01/10 16:03:17 chs Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -122,7 +122,7 @@
 #else /* XEN */
 #define VM_MIN_KERNEL_ADDRESS	0xa000
 #endif
-#define VM_MAX_KERNEL_ADDRESS	0xff80
+#define VM_MAX_KERNEL_ADDRESS	0xfe80
 
 #define VM_MAXUSER_ADDRESS32	0xf000
 



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

2012-01-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan 10 16:26:43 UTC 2012

Modified Files:
src/sys/arch/hppa/include: types.h

Log Message:
G/C vm_{offset,size}_t


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/include/types.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/include/types.h
diff -u src/sys/arch/hppa/include/types.h:1.20 src/sys/arch/hppa/include/types.h:1.21
--- src/sys/arch/hppa/include/types.h:1.20	Thu Mar 17 22:14:43 2011
+++ src/sys/arch/hppa/include/types.h	Tue Jan 10 16:26:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.20 2011/03/17 22:14:43 skrll Exp $	*/
+/*	$NetBSD: types.h,v 1.21 2012/01/10 16:26:43 skrll Exp $	*/
 
 /*	$OpenBSD: types.h,v 1.6 2001/08/11 01:58:34 art Exp $	*/
 
@@ -61,10 +61,6 @@ typedef	unsigned long		psize_t;
 #define	PRIxPADDR		lx
 #define	PRIxPSIZE		lx
 #define	PRIuPSIZE		lu
-/* XXX DIE DIE DIE */
-typedef	unsigned long vm_offset_t;
-typedef unsigned long vm_size_t;
-
 #endif
 
 /*



CVS commit: src/sys/dev

2012-01-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jan 10 17:53:51 UTC 2012

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

Log Message:
Call aprint_naive for quiet boot message.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/midi.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/midi.c
diff -u src/sys/dev/midi.c:1.74 src/sys/dev/midi.c:1.75
--- src/sys/dev/midi.c:1.74	Thu Nov 24 02:54:32 2011
+++ src/sys/dev/midi.c	Tue Jan 10 17:53:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.74 2011/11/24 02:54:32 mrg Exp $	*/
+/*	$NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.74 2011/11/24 02:54:32 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $);
 
 #include midi.h
 #include sequencer.h
@@ -294,6 +294,7 @@ midi_attach(struct midi_softc *sc, devic
 			device_xname(sc-dev), rcv incomplete msgs);
 	}
 	
+	aprint_naive(\n);
 	aprint_normal(: %s\n, mi.name);
 }
 



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

2012-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 10 18:01:09 UTC 2012

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mem.c

Log Message:
Allow access to KSEGX from /dev/mem


To generate a diff of this commit:
cvs rdiff -u -r1.35.38.7 -r1.35.38.8 src/sys/arch/mips/mips/mem.c

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

Modified files:

Index: src/sys/arch/mips/mips/mem.c
diff -u src/sys/arch/mips/mips/mem.c:1.35.38.7 src/sys/arch/mips/mips/mem.c:1.35.38.8
--- src/sys/arch/mips/mips/mem.c:1.35.38.7	Tue Nov 29 07:48:31 2011
+++ src/sys/arch/mips/mips/mem.c	Tue Jan 10 18:01:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.35.38.7 2011/11/29 07:48:31 matt Exp $	*/
+/*	$NetBSD: mem.c,v 1.35.38.8 2012/01/10 18:01:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 #include opt_mips_cache.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.7 2011/11/29 07:48:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.8 2012/01/10 18:01:09 matt Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -107,12 +107,20 @@ mmrw(dev_t dev, struct uio *uio, int fla
 			/*
 			 * XXX Broken; assumes contiguous physical memory.
 			 */
+#ifdef _LP64
 			if (v + c  ctob(physmem))
 return (EFAULT);
-#ifdef _LP64
 			v = MIPS_PHYS_TO_XKPHYS_CACHED(v);
 #else
-			v = MIPS_PHYS_TO_KSEG0(v);
+			if (MIPS_KSEG0_P(v + c - 1)) {
+v = MIPS_PHYS_TO_KSEG0(v);
+#ifdef ENABLE_MIPS_KSEGX
+			} else if (mips_ksegx_start = v
+			 v + c = mips_ksegx_start + VM_KSEGX_SIZE) {
+v += VM_KSEGX_ADDRESS - mips_ksegx_start;
+#endif
+			} else
+return (EFAULT);
 #endif
 			error = uiomove((void *)v, c, uio);
 #if defined(MIPS3_PLUS)



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

2012-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 10 18:34:03 UTC 2012

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mem.c

Log Message:
Deal with KMEM reading KSEG0 addresses and limit those reads to available
memory.  Also deal with the case that there may be memory beyond the end
of KSEG0 so compare the physical address against mips_avail_end.


To generate a diff of this commit:
cvs rdiff -u -r1.35.38.8 -r1.35.38.9 src/sys/arch/mips/mips/mem.c

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

Modified files:

Index: src/sys/arch/mips/mips/mem.c
diff -u src/sys/arch/mips/mips/mem.c:1.35.38.8 src/sys/arch/mips/mips/mem.c:1.35.38.9
--- src/sys/arch/mips/mips/mem.c:1.35.38.8	Tue Jan 10 18:01:09 2012
+++ src/sys/arch/mips/mips/mem.c	Tue Jan 10 18:34:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.35.38.8 2012/01/10 18:01:09 matt Exp $	*/
+/*	$NetBSD: mem.c,v 1.35.38.9 2012/01/10 18:34:03 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 #include opt_mips_cache.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.8 2012/01/10 18:01:09 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.9 2012/01/10 18:34:03 matt Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -150,20 +150,25 @@ mmrw(dev_t dev, struct uio *uio, int fla
 #else
 			if (v  MIPS_KSEG0_START)
 return (EFAULT);
-			if (v  MIPS_PHYS_TO_KSEG0(mips_avail_end +
-	mips_round_page(MSGBUFSIZE) - c)
-			 (v  MIPS_KSEG2_START
-|| (
+			if (MIPS_KSEG0_P(v + c - 1)) {
+/*
+ * If all of memory is in KSEG0, make sure
+ * we don't beyond its limit.  (mips_avail_end
+ * may be beyond the end of KSEG0).
+ */
+if (MIPS_KSEG0_TO_PHYS(v) = mips_avail_end
++ mips_round_page(MSGBUFSIZE) - c)
+	return (EFAULT);
 #ifdef ENABLE_MIPS_KSEGX
-(v  VM_KSEGX_ADDRESS
- || v = VM_KSEGX_ADDRESS + VM_KSEGX_SIZE)
-#else
-true
-#endif
- !uvm_kernacc((void *)v, c,
-	uio-uio_rw == UIO_READ
-	? B_READ
-	: B_WRITE
+			} else if (VM_KSEGX_ADDRESS = v
+			 v + c = VM_KSEGX_ADDRESS + VM_KSEGX_SIZE) {
+/* nothing */
+#endif
+			} else if (v  MIPS_KSEG2_START
+   || !uvm_kernacc((void *)v, c,
+	uio-uio_rw == UIO_READ
+		? B_READ
+		: B_WRITE))
 return (EFAULT);
 #endif
 			error = uiomove((void *)v, c, uio);



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

2012-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 10 18:36:59 UTC 2012

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mem.c

Log Message:
Fix gimplish in a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35.38.9 -r1.35.38.10 src/sys/arch/mips/mips/mem.c

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

Modified files:

Index: src/sys/arch/mips/mips/mem.c
diff -u src/sys/arch/mips/mips/mem.c:1.35.38.9 src/sys/arch/mips/mips/mem.c:1.35.38.10
--- src/sys/arch/mips/mips/mem.c:1.35.38.9	Tue Jan 10 18:34:03 2012
+++ src/sys/arch/mips/mips/mem.c	Tue Jan 10 18:36:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.35.38.9 2012/01/10 18:34:03 matt Exp $	*/
+/*	$NetBSD: mem.c,v 1.35.38.10 2012/01/10 18:36:58 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 #include opt_mips_cache.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.9 2012/01/10 18:34:03 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.35.38.10 2012/01/10 18:36:58 matt Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -152,8 +152,8 @@ mmrw(dev_t dev, struct uio *uio, int fla
 return (EFAULT);
 			if (MIPS_KSEG0_P(v + c - 1)) {
 /*
- * If all of memory is in KSEG0, make sure
- * we don't beyond its limit.  (mips_avail_end
+ * If all of memory is in KSEG0, make sure we
+ * don't go beyond its limit.  (mips_avail_end
  * may be beyond the end of KSEG0).
  */
 if (MIPS_KSEG0_TO_PHYS(v) = mips_avail_end



CVS commit: src/sys/arch/arm/xscale

2012-01-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Jan 10 18:55:38 UTC 2012

Modified Files:
src/sys/arch/arm/xscale: i80312_i2c.c i80321_i2c.c iopi2c.c iopi2cvar.h

Log Message:
split iopi2c(4) device/softc


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/xscale/i80312_i2c.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/xscale/i80321_i2c.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/xscale/iopi2c.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/xscale/iopi2cvar.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/arm/xscale/i80312_i2c.c
diff -u src/sys/arch/arm/xscale/i80312_i2c.c:1.5 src/sys/arch/arm/xscale/i80312_i2c.c:1.6
--- src/sys/arch/arm/xscale/i80312_i2c.c:1.5	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80312_i2c.c	Tue Jan 10 18:55:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80312_i2c.c,v 1.5 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: i80312_i2c.c,v 1.6 2012/01/10 18:55:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i80312_i2c.c,v 1.5 2011/07/01 20:32:51 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: i80312_i2c.c,v 1.6 2012/01/10 18:55:37 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/mutex.h
@@ -59,7 +59,7 @@ __KERNEL_RCSID(0, $NetBSD: i80312_i2c.c
 #include arm/xscale/iopi2creg.h
 
 static int
-iic312_match(struct device *parent, struct cfdata *cf, void *aux)
+iic312_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct iopxs_attach_args *ia = aux;
 
@@ -70,21 +70,22 @@ iic312_match(struct device *parent, stru
 }
 
 static void
-iic312_attach(struct device *parent, struct device *self, void *aux)
+iic312_attach(device_t parent, device_t self, void *aux)
 {
-	struct iopiic_softc *sc = (void *) self;
+	struct iopiic_softc *sc = device_private(self);
 	struct iopxs_attach_args *ia = aux;
 	int error;
 
 	aprint_naive(: I2C controller\n);
 	aprint_normal(: I2C controller\n);
 
+	sc-sc_dev = self;
 	sc-sc_st = ia-ia_st;
 	if ((error = bus_space_subregion(sc-sc_st, ia-ia_sh,
 	 ia-ia_offset, ia-ia_size,
 	 sc-sc_sh)) != 0) {
-		aprint_error(%s: unable to subregion registers, error = %d\n,
-		sc-sc_dev.dv_xname, error);
+		aprint_error_dev(self,
+		unable to subregion registers, error = %d\n, error);
 		return;
 	}
 
@@ -97,8 +98,8 @@ iic312_attach(struct device *parent, str
 	sc-sc_ih = i80321_intr_establish(ICU_INT_I2C, IPL_BIO,
 	  iopiic_intr, sc);
 	if (sc-sc_ih == NULL) {
-		aprint_error(%s: unable to establish interrupt handler\n,
-		sc-sc_dev.dv_xname);
+		aprint_error_dev(self,
+		unable to establish interrupt handler\n);
 		return;
 	}
 #endif
@@ -117,5 +118,5 @@ iic312_attach(struct device *parent, str
 	iopiic_attach(sc);
 }
 
-CFATTACH_DECL(iopiic, sizeof(struct iopiic_softc),
+CFATTACH_DECL_NEW(iopiic, sizeof(struct iopiic_softc),
 iic312_match, iic312_attach, NULL, NULL);

Index: src/sys/arch/arm/xscale/i80321_i2c.c
diff -u src/sys/arch/arm/xscale/i80321_i2c.c:1.4 src/sys/arch/arm/xscale/i80321_i2c.c:1.5
--- src/sys/arch/arm/xscale/i80321_i2c.c:1.4	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/i80321_i2c.c	Tue Jan 10 18:55:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80321_i2c.c,v 1.4 2011/07/01 20:32:51 dyoung Exp $	*/
+/*	$NetBSD: i80321_i2c.c,v 1.5 2012/01/10 18:55:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i80321_i2c.c,v 1.4 2011/07/01 20:32:51 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: i80321_i2c.c,v 1.5 2012/01/10 18:55:37 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/mutex.h
@@ -60,7 +60,7 @@ __KERNEL_RCSID(0, $NetBSD: i80321_i2c.c
 #include arm/xscale/iopi2cvar.h
 
 static int
-iic321_match(struct device *parent, struct cfdata *cf, void *aux)
+iic321_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct iopxs_attach_args *ia = aux;
 
@@ -71,9 +71,9 @@ iic321_match(struct device *parent, stru
 }
 
 static void
-iic321_attach(struct device *parent, struct device *self, void *aux)
+iic321_attach(device_t parent, device_t self, void *aux)
 {
-	struct iopiic_softc *sc = (void *) self;
+	struct iopiic_softc *sc = device_private(self);
 	struct iopxs_attach_args *ia = aux;
 	int error;
 	uint8_t gpio_bits;
@@ -81,12 +81,13 @@ iic321_attach(struct device *parent, str
 	aprint_naive(: I2C controller\n);
 	aprint_normal(: I2C controller\n);
 
+	sc-sc_dev = self;
 	sc-sc_st = ia-ia_st;
 	if ((error = bus_space_subregion(sc-sc_st, ia-ia_sh,
 	 ia-ia_offset, ia-ia_size,
 	 sc-sc_sh)) != 0) {
-		aprint_error(%s: unable to subregion registers, error = %d\n,
-		sc-sc_dev.dv_xname, error);
+		aprint_error_dev(self,
+		unable to subregion registers, error = %d\n, error);
 		return;
 	}
 
@@ -104,8 +105,8 @@ iic321_attach(struct device *parent, str
 	sc-sc_ih = 

CVS commit: src/sys

2012-01-10 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jan 10 20:01:57 UTC 2012

Modified Files:
src/sys/netinet6: ip6_input.c ip6_output.c ip6_var.h
src/sys/netipsec: ipsec_output.c xform_ah.c

Log Message:
add patch from Arnaud Degroote to handle IPv6 extended options with
(FAST_)IPSEC, tested lightly with a DSTOPTS header consisting
of PAD1


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.142 -r1.143 src/sys/netinet6/ip6_output.c
cvs rdiff -u -r1.56 -r1.57 src/sys/netinet6/ip6_var.h
cvs rdiff -u -r1.37 -r1.38 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.33 -r1.34 src/sys/netipsec/xform_ah.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/netinet6/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.135 src/sys/netinet6/ip6_input.c:1.136
--- src/sys/netinet6/ip6_input.c:1.135	Sat Dec 31 20:41:59 2011
+++ src/sys/netinet6/ip6_input.c	Tue Jan 10 20:01:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.135 2011/12/31 20:41:59 christos Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.136 2012/01/10 20:01:56 drochner Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_input.c,v 1.135 2011/12/31 20:41:59 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_input.c,v 1.136 2012/01/10 20:01:56 drochner Exp $);
 
 #include opt_gateway.h
 #include opt_inet.h
@@ -161,7 +161,8 @@ percpu_t *ip6stat_percpu;
 static void ip6_init2(void *);
 static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *);
 
-static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *);
+static int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *,
+	u_int32_t *);
 static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
 static void sysctl_net_inet6_ip6_setup(struct sysctllog **);
 
@@ -882,7 +883,7 @@ ip6_getdstifaddr(struct mbuf *m)
  *
  * rtalertp - XXX: should be stored more smart way
  */
-static int
+int
 ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, 
 	struct mbuf **mp, int *offp)
 {
@@ -927,7 +928,7 @@ ip6_hopopts_input(u_int32_t *plenp, u_in
  * (RFC2460 p7), opthead is pointer into data content in m, and opthead to
  * opthead + hbhlen is located in continuous memory region.
  */
-int
+static int
 ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, 
 	u_int32_t *rtalertp, u_int32_t *plenp)
 {

Index: src/sys/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.142 src/sys/netinet6/ip6_output.c:1.143
--- src/sys/netinet6/ip6_output.c:1.142	Sat Dec 31 20:41:59 2011
+++ src/sys/netinet6/ip6_output.c	Tue Jan 10 20:01:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.142 2011/12/31 20:41:59 christos Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.143 2012/01/10 20:01:56 drochner Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.142 2011/12/31 20:41:59 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.143 2012/01/10 20:01:56 drochner Exp $);
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -317,10 +317,6 @@ ip6_output(
 #ifdef FAST_IPSEC
 	/* Check the security policy (SP) for the packet */
 
-	/* XXX For moment, we doesn't support packet with extented action */
-	if (optlen !=0)
-		goto freehdrs;
-
 	sp = ipsec6_check_policy(m,so,flags,needipsec,error);
 	if (error != 0) {
 		/*
@@ -858,28 +854,18 @@ skip_ipsec2:;
 	 * it must be examined and processed even by the source node.
 	 * (RFC 2460, section 4.)
 	 */
-	if (exthdrs.ip6e_hbh) {
-		struct ip6_hbh *hbh = mtod(exthdrs.ip6e_hbh, struct ip6_hbh *);
+	if (ip6-ip6_nxt == IPV6_HOPOPTS) {
 		u_int32_t dummy1; /* XXX unused */
 		u_int32_t dummy2; /* XXX unused */
+		int hoff = sizeof(struct ip6_hdr);
 
-		/*
-		 *  XXX: if we have to send an ICMPv6 error to the sender,
-		 *   we need the M_LOOP flag since icmp6_error() expects
-		 *   the IPv6 and the hop-by-hop options header are
-		 *   continuous unless the flag is set.
-		 */
-		m-m_flags |= M_LOOP;
-		m-m_pkthdr.rcvif = ifp;
-		if (ip6_process_hopopts(m, (u_int8_t *)(hbh + 1),
-		((hbh-ip6h_len + 1)  3) - sizeof(struct ip6_hbh),
-		dummy1, dummy2)  0) {
+		if (ip6_hopopts_input(dummy1, dummy2, m, hoff)) {
 			/* m was already freed at this point */
 			error = EINVAL;/* better error? */
 			goto done;
 		}
-		m-m_flags = ~M_LOOP; /* XXX */
-		m-m_pkthdr.rcvif = NULL;
+
+		ip6 = mtod(m, struct ip6_hdr *);
 	}
 
 #ifdef PFIL_HOOKS

Index: src/sys/netinet6/ip6_var.h
diff -u src/sys/netinet6/ip6_var.h:1.56 src/sys/netinet6/ip6_var.h:1.57
--- src/sys/netinet6/ip6_var.h:1.56	Fri Nov  4 00:22:33 2011
+++ src/sys/netinet6/ip6_var.h	Tue Jan 10 20:01:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_var.h,v 1.56 2011/11/04 

CVS commit: src/sys/netinet6

2012-01-10 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jan 10 20:05:37 UTC 2012

Modified Files:
src/sys/netinet6: ip6_output.c

Log Message:
remove conditionals which can't succeed, and also shouldn't because
one would get a kernel NULL dereference immediately


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/netinet6/ip6_output.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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.143 src/sys/netinet6/ip6_output.c:1.144
--- src/sys/netinet6/ip6_output.c:1.143	Tue Jan 10 20:01:56 2012
+++ src/sys/netinet6/ip6_output.c	Tue Jan 10 20:05:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.143 2012/01/10 20:01:56 drochner Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.144 2012/01/10 20:05:37 drochner Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.143 2012/01/10 20:01:56 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.144 2012/01/10 20:05:37 drochner Exp $);
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -2323,7 +2323,7 @@ do {\
 	if (src-type) {	\
 		int hlen = (((struct ip6_ext *)src-type)-ip6e_len + 1)  3;\
 		dst-type = malloc(hlen, M_IP6OPT, canwait);	\
-		if (dst-type == NULL  canwait == M_NOWAIT)	\
+		if (dst-type == NULL)\
 			goto bad;\
 		memcpy(dst-type, src-type, hlen);		\
 	}			\
@@ -2338,14 +2338,14 @@ copypktopts(struct ip6_pktopts *dst, str
 	if (src-ip6po_pktinfo) {
 		dst-ip6po_pktinfo = malloc(sizeof(*dst-ip6po_pktinfo),
 		M_IP6OPT, canwait);
-		if (dst-ip6po_pktinfo == NULL  canwait == M_NOWAIT)
+		if (dst-ip6po_pktinfo == NULL)
 			goto bad;
 		*dst-ip6po_pktinfo = *src-ip6po_pktinfo;
 	}
 	if (src-ip6po_nexthop) {
 		dst-ip6po_nexthop = malloc(src-ip6po_nexthop-sa_len,
 		M_IP6OPT, canwait);
-		if (dst-ip6po_nexthop == NULL  canwait == M_NOWAIT)
+		if (dst-ip6po_nexthop == NULL)
 			goto bad;
 		memcpy(dst-ip6po_nexthop, src-ip6po_nexthop,
 		src-ip6po_nexthop-sa_len);
@@ -2375,7 +2375,7 @@ ip6_copypktopts(struct ip6_pktopts *src,
 	struct ip6_pktopts *dst;
 
 	dst = malloc(sizeof(*dst), M_IP6OPT, canwait);
-	if (dst == NULL  canwait == M_NOWAIT)
+	if (dst == NULL)
 		return (NULL);
 	ip6_initpktopts(dst);
 



CVS commit: src/sys/arch/amiga

2012-01-10 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Tue Jan 10 20:29:50 UTC 2012

Modified Files:
src/sys/arch/amiga/amiga: amiga_init.c
src/sys/arch/amiga/conf: DRACO GENERIC GENERIC.in INSTALL files.amiga
src/sys/arch/amiga/dev: bppcsc.c cbiiisc.c
src/sys/arch/amiga/pci: p5pb.c p5pbreg.h p5pbvar.h
Added Files:
src/sys/arch/amiga/dev: p5bus.c p5busvar.h
src/sys/arch/amiga/pci: p5membar.c p5membarvar.h

Log Message:
Changes to Phase5 hardware support:
- Rework p5pb driver - simplify, cleanup, make more flexible.
- Add p5membar driver, which handles PCI resources autoconfigured by the 
firmware.
- Introduce intermediate p5bus layer, between zbus and CSPPC/BPPC on-board 
devices (p5pb, cbiiisc, bppcsc).
- Add experimental G-REX support to p5pb (first slot support only).
- Split CV64/3D PCI bridge support into separate cv3dpb driver (to be committed 
later).

Approved by phx.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/amiga/amiga/amiga_init.c
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.278 -r1.279 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/amiga/conf/INSTALL
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/amiga/conf/files.amiga
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/dev/bppcsc.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amiga/dev/cbiiisc.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/dev/p5bus.c \
src/sys/arch/amiga/dev/p5busvar.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/amiga/pci/p5membar.c \
src/sys/arch/amiga/pci/p5membarvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/pci/p5pb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/pci/p5pbreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amiga/pci/p5pbvar.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/amiga/amiga/amiga_init.c
diff -u src/sys/arch/amiga/amiga/amiga_init.c:1.124 src/sys/arch/amiga/amiga/amiga_init.c:1.125
--- src/sys/arch/amiga/amiga/amiga_init.c:1.124	Sun Jul 10 21:02:37 2011
+++ src/sys/arch/amiga/amiga/amiga_init.c	Tue Jan 10 20:29:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: amiga_init.c,v 1.124 2011/07/10 21:02:37 mhitch Exp $	*/
+/*	$NetBSD: amiga_init.c,v 1.125 2012/01/10 20:29:49 rkujawa Exp $	*/
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -38,7 +38,7 @@
 #include ser.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amiga_init.c,v 1.124 2011/07/10 21:02:37 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: amiga_init.c,v 1.125 2012/01/10 20:29:49 rkujawa Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -331,6 +331,16 @@ start_c(id, fphystart, fphysize, cphysiz
 	ncd = RELOC(ncfdev, int); ncd  0; ncd--, cd++) {
 		int bd_type = cd-rom.type  (ERT_TYPEMASK | ERTF_MEMLIST);
 
+		/*
+		 * Hack to support p5bus and p5pb on CyberStorm Mk-III / PPC
+		 * and Blizzard PPC. XXX: this hack should only be active if
+		 * non-autoconfiguring CyberVision PPC or BlizzardVision PPC
+		 * was found. 
+		 */
+		if (cd-rom.manid == 8512  
+		(cd-rom.prodid == 100 || cd-rom.prodid == 110)) 
+			RELOC(ZBUSAVAIL, u_int) += m68k_round_page(0x140);
+
 		if (bd_type != ERT_ZORROIII 
 		(bd_type != ERT_ZORROII || isztwopa(cd-addr)))
 			continue;	/* It's not Z2 or Z3 I/O board */
@@ -345,6 +355,7 @@ start_c(id, fphystart, fphysize, cphysiz
 		(cd-rom.flags  ERT_Z3_SSMASK) == 0)
 			cd-size = 0x1 
 			((cd-rom.type - 1)  ERT_MEMMASK);
+
 		RELOC(ZBUSAVAIL, u_int) += m68k_round_page(cd-size);
 	}
 

Index: src/sys/arch/amiga/conf/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.148 src/sys/arch/amiga/conf/DRACO:1.149
--- src/sys/arch/amiga/conf/DRACO:1.148	Mon Dec 26 13:09:03 2011
+++ src/sys/arch/amiga/conf/DRACO	Tue Jan 10 20:29:49 2012
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.148 2011/12/26 13:09:03 mlelstv Exp $
+# $NetBSD: DRACO,v 1.149 2012/01/10 20:29:49 rkujawa Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include arch/amiga/conf/std.amiga
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.148 $
+#ident 		GENERIC-$Revision: 1.149 $
 
 
 maxusers	8

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.278 src/sys/arch/amiga/conf/GENERIC:1.279
--- src/sys/arch/amiga/conf/GENERIC:1.278	Mon Dec 26 13:09:03 2011
+++ src/sys/arch/amiga/conf/GENERIC	Tue Jan 10 20:29:49 2012
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.278 2011/12/26 13:09:03 mlelstv Exp $
+# $NetBSD: GENERIC,v 1.279 2012/01/10 20:29:49 rkujawa Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include arch/amiga/conf/std.amiga
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.278 $
+#ident 		

CVS commit: src/share/man/man4/man4.amiga

2012-01-10 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Tue Jan 10 20:41:45 UTC 2012

Modified Files:
src/share/man/man4/man4.amiga: Makefile bppcsc.4 p5pb.4
Added Files:
src/share/man/man4/man4.amiga: p5membar.4

Log Message:
Update p5pb(4) and bppcsc(4) due to recent changes to Phase5 drivers. Add 
p5membar(4) page.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man4/man4.amiga/Makefile
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.amiga/bppcsc.4 \
src/share/man/man4/man4.amiga/p5pb.4
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.amiga/p5membar.4

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

Modified files:

Index: src/share/man/man4/man4.amiga/Makefile
diff -u src/share/man/man4/man4.amiga/Makefile:1.21 src/share/man/man4/man4.amiga/Makefile:1.22
--- src/share/man/man4/man4.amiga/Makefile:1.21	Thu Oct 27 22:12:24 2011
+++ src/share/man/man4/man4.amiga/Makefile	Tue Jan 10 20:41:45 2012
@@ -1,10 +1,10 @@
 # 	from: @(#)Makefile	8.2 (Berkeley) 2/16/94
-#	$NetBSD: Makefile,v 1.21 2011/10/27 22:12:24 rkujawa Exp $
+#	$NetBSD: Makefile,v 1.22 2012/01/10 20:41:45 rkujawa Exp $
 
 MAN=	afsc.4 ahsc.4 amidisplaycc.4 atzsc.4 autoconf.4 console.4 bah.4 \
 	bppcsc.4 ed.4 efa.4 es.4 fdc.4 grf.4 \
 	grfcl.4 grfcv.4 grfcv3d.4 grfet.4 grfrh.4 grfrt.4 grful.4 \
-	gtsc.4 intro.4 ite.4 mem.4 mfcs.4 mgnsc.4 mppb.4 p5pb.4 \
+	gtsc.4 intro.4 ite.4 mem.4 mfcs.4 mgnsc.4 mppb.4 p5membar.4 p5pb.4 \
 	qn.4 ser.4 wesc.4 zssc.4
 MLINKS=	mem.4 kmem.4
 MANSUBDIR=/amiga

Index: src/share/man/man4/man4.amiga/bppcsc.4
diff -u src/share/man/man4/man4.amiga/bppcsc.4:1.4 src/share/man/man4/man4.amiga/bppcsc.4:1.5
--- src/share/man/man4/man4.amiga/bppcsc.4:1.4	Sat Jan 15 11:59:42 2011
+++ src/share/man/man4/man4.amiga/bppcsc.4	Tue Jan 10 20:41:45 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: bppcsc.4,v 1.4 2011/01/15 11:59:42 phx Exp $
+.\ $NetBSD: bppcsc.4,v 1.5 2012/01/10 20:41:45 rkujawa Exp $
 .\
 .\ Copyright (c) 2011 Radoslaw Kujawa
 .\
@@ -29,7 +29,7 @@
 .Nm bppcsc
 .Nd BlizzardPPC 603e+ SCSI host adapter device driver
 .Sh SYNOPSIS
-.Cd bppcsc0 at zbus0
+.Cd bppcsc0 at p5bus0
 .Cd scsibus* at bppcsc?
 .Sh DESCRIPTION
 The
Index: src/share/man/man4/man4.amiga/p5pb.4
diff -u src/share/man/man4/man4.amiga/p5pb.4:1.4 src/share/man/man4/man4.amiga/p5pb.4:1.5
--- src/share/man/man4/man4.amiga/p5pb.4:1.4	Fri Oct  7 09:22:53 2011
+++ src/share/man/man4/man4.amiga/p5pb.4	Tue Jan 10 20:41:45 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: p5pb.4,v 1.4 2011/10/07 09:22:53 wiz Exp $
+.\ $NetBSD: p5pb.4,v 1.5 2012/01/10 20:41:45 rkujawa Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,38 +27,53 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 26, 2011
+.Dd January 10, 2012
 .Dt P5PB 4 amiga
 .Os
 .Sh NAME
 .Nm p5pb
 .Nd Phase5 PCI bridge driver
 .Sh SYNOPSIS
-.Cd p5pb0 at zbus0
+.Cd p5pb0 at p5bus0
 .Cd pci* at p5pb?
 .Cd genfb* at pci?
+.Cd options P5PB_OLD_FIRMWARE
+.Cd options P5PB_GENFB
+.Cd options P5PB_DEBUG
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for the PCI bus present on BlizzardVisionPPC,
-CyberVisionPPC and CybrerVision 64/3D graphics cards.
+driver provides support for the PCI bus present on various devices equipped with
+the Phase5 PCI bridge. 
+.Pp
+Processor boards running firmware revision older than 44.69 need a kernel 
+configured with P5PB_OLD_FIRMWARE option. 
+.Pp
+The
+.Nm 
+driver provides necessary support for CyberVisionPPC and BlizzardVisionPPC, 
+allowing attachment of 
+.Xr genfb 4
+driver. 
+Owners of these cards should enable the P5PB_GENFB option.
+.Pp
+Additional, excessive debugging output is enabled by P5PB_DEBUG option.
 .Sh HARDWARE
 The
 .Nm
 driver supports the following hardware:
-.Bl -tag -width BLIZZARDVISIONPPC -offset indent
-.It Em BLIZZARDVISIONPPC
-Phase5 BlizzardVisionPPC graphics card.
-.It Em CYBERVISIONPPC
-Phase5 CyberVisionPPC graphics card.
-.It Em CYBERVISION 64/3D
-Phase5 CyberVision 64/3D graphics card.
+.Bl -tag -offset indent
+.It Phase5 BlizzardVisionPPC graphics card.
+.It Phase5 CyberVisionPPC graphics card.
+.It DCE Computer G-REX 1200 (experimental, first slot only).
+.It DCE Computer G-REX 4000 (experimental, first slot only).
 .El
 .Sh SEE ALSO
 .Xr genfb 4 ,
-.Xr grfcv3d 4 ,
-.Xr pci 4
 .\ .Xr pm2fb 4
+.\ .Xr cv3dpb 4 ,
+.Xr p5membar 4 ,
+.Xr pci 4
 .Sh HISTORY
 The
 .Nm
@@ -71,24 +86,18 @@ The
 driver was written by
 .An Radoslaw Kujawa Aq radoslaw.kuj...@gmail.com .
 .Sh CAVEATS
-G-REX PCI bridge is currently not supported, however the driver
-will try to attach to it, because it has the same vendor and product
-ID as CVPPC/BVPPC cards.
-Due to similarities between these products, it may even detect the
-card inserted into first slot, but the driver will (most likely)
-not work properly.
-.Pp
-Support for CV64/3D is disabled by default, since the

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

2012-01-10 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Tue Jan 10 20:47:02 UTC 2012

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

Log Message:
Add p5membar(4) to man set list.


To generate a diff of this commit:
cvs rdiff -u -r1.1366 -r1.1367 src/distrib/sets/lists/man/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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1366 src/distrib/sets/lists/man/mi:1.1367
--- src/distrib/sets/lists/man/mi:1.1366	Mon Jan  9 16:59:36 2012
+++ src/distrib/sets/lists/man/mi	Tue Jan 10 20:47:01 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1366 2012/01/09 16:59:36 skrll Exp $
+# $NetBSD: mi,v 1.1367 2012/01/10 20:47:01 rkujawa Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -751,6 +751,7 @@
 ./usr/share/man/cat4/amiga/mfcs.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/mgnsc.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/mppb.0		man-sys-catman		.cat
+./usr/share/man/cat4/amiga/p5membar.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/p5pb.0		man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/qn.0			man-sys-catman		.cat
 ./usr/share/man/cat4/amiga/ser.0		man-sys-catman		.cat
@@ -3645,6 +3646,7 @@
 ./usr/share/man/html4/amiga/mfcs.html		man-sys-htmlman		html
 ./usr/share/man/html4/amiga/mgnsc.html		man-sys-htmlman		html
 ./usr/share/man/html4/amiga/mppb.html		man-sys-htmlman		html
+./usr/share/man/html4/amiga/p5membar.html	man-sys-htmlman		html
 ./usr/share/man/html4/amiga/p5pb.html		man-sys-htmlman		html
 ./usr/share/man/html4/amiga/qn.html		man-sys-htmlman		html
 ./usr/share/man/html4/amiga/ser.html		man-sys-htmlman		html
@@ -6238,6 +6240,7 @@
 ./usr/share/man/man4/amiga/mfcs.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/mgnsc.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/mppb.4		man-sys-man		.man
+./usr/share/man/man4/amiga/p5membar.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/p5pb.4		man-sys-man		.man
 ./usr/share/man/man4/amiga/qn.4			man-sys-man		.man
 ./usr/share/man/man4/amiga/ser.4		man-sys-man		.man



CVS commit: src/distrib/utils/sysinst

2012-01-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jan 10 21:02:48 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h main.c menus.mi msg.mi.de msg.mi.en
msg.mi.es msg.mi.fr msg.mi.pl net.c util.c

Log Message:
Add support for installing source sets as discussed on tech-install,
with improved German translations from Martin Husemann and Julian
Djamil Fagir.  French, Spanish, and Polish translations are
still needed.  OK christos, riz.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.62 -r1.63 src/distrib/utils/sysinst/main.c
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/sysinst/menus.mi
cvs rdiff -u -r1.60 -r1.61 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.168 -r1.169 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.118 -r1.119 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.77 -r1.78 src/distrib/utils/sysinst/msg.mi.pl
cvs rdiff -u -r1.129 -r1.130 src/distrib/utils/sysinst/net.c
cvs rdiff -u -r1.172 -r1.173 src/distrib/utils/sysinst/util.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/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.160 src/distrib/utils/sysinst/defs.h:1.161
--- src/distrib/utils/sysinst/defs.h:1.160	Thu Jan  5 22:18:36 2012
+++ src/distrib/utils/sysinst/defs.h	Tue Jan 10 21:02:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.160 2012/01/05 22:18:36 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.161 2012/01/10 21:02:47 gson Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -122,6 +122,13 @@ enum {
 SET_MD_2,		/* Machine dependent set */
 SET_MD_3,		/* Machine dependent set */
 SET_MD_4,		/* Machine dependent set */
+
+/* Source sets */
+SET_SYSSRC,
+SET_SRC,
+SET_SHARESRC,
+SET_GNUSRC,
+SET_XSRC,
 
 SET_LAST,
 SET_GROUP,		/* Start of submenu */
@@ -144,6 +151,9 @@ enum {
 /* All machine dependent sets */
 #define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
 
+/* All source sets */
+#define SET_SOURCE SET_SYSSRC, SET_SRC, SET_SHARESRC, SET_GNUSRC, SET_XSRC
+
 /* Set list flags */
 #define SFLAG_MINIMAL	1
 #define	SFLAG_NOX	2
@@ -278,11 +288,17 @@ int  clean_xfer_dir;
 #define SYSINST_FTP_DIR		pub/NetBSD/NetBSD- REL
 #endif
 
-/* Abs. path we extract from */
-char ext_dir[STRSIZE];
+/* Abs. path we extract binary sets from */
+char ext_dir_bin[STRSIZE];
+
+/* Abs. path we extract source sets from */
+char ext_dir_src[STRSIZE];
+
+/* Place we look for binary sets in all fs types */
+char set_dir_bin[STRSIZE];
 
-/* Place we look in all fs types */
-char set_dir[STRSIZE];
+/* Place we look for source sets in all fs types */
+char set_dir_src[STRSIZE];
 
 struct {
 char host[STRSIZE];
@@ -427,6 +443,9 @@ int	check_lfs_progs(void);
 void	init_set_status(int);
 void	customise_sets(void);
 void	umount_mnt2(void);
+int 	set_is_source(const char *);
+const char *set_dir_for_set(const char *);
+const char *ext_dir_for_set(const char *);
 
 /* from target.c */
 #if defined(DEBUG)  ||	defined(DEBUG_ROOT)

Index: src/distrib/utils/sysinst/main.c
diff -u src/distrib/utils/sysinst/main.c:1.62 src/distrib/utils/sysinst/main.c:1.63
--- src/distrib/utils/sysinst/main.c:1.62	Thu Jan  5 21:29:24 2012
+++ src/distrib/utils/sysinst/main.c	Tue Jan 10 21:02:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.62 2012/01/05 21:29:24 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.63 2012/01/10 21:02:47 gson Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -80,10 +80,12 @@ static const struct f_arg fflagopts[] = 
 	{release, REL, rel, sizeof rel},
 	{machine, MACH, machine, sizeof machine},
 	{xfer dir, /usr/INSTALL, xfer_dir, sizeof xfer_dir},
-	{ext dir, , ext_dir, sizeof ext_dir},
+	{ext dir, , ext_dir_bin, sizeof ext_dir_bin},
+	{ext src dir, , ext_dir_src, sizeof ext_dir_src},
 	{ftp host, SYSINST_FTP_HOST, ftp.host, sizeof ftp.host},
 	{ftp dir, SYSINST_FTP_DIR, ftp.dir, sizeof ftp.dir},
-	{ftp prefix, / MACH /binary/sets, set_dir, sizeof set_dir},
+	{ftp prefix, / MACH /binary/sets, set_dir_bin, sizeof set_dir_bin},
+	{ftp src prefix, /source/sets, set_dir_src, sizeof set_dir_src},
 	{ftp user, ftp, ftp.user, sizeof ftp.user},
 	{ftp pass, , ftp.pass, sizeof ftp.pass},
 	{ftp proxy, , ftp.proxy, sizeof ftp.proxy},

Index: src/distrib/utils/sysinst/menus.mi
diff -u src/distrib/utils/sysinst/menus.mi:1.43 src/distrib/utils/sysinst/menus.mi:1.44
--- src/distrib/utils/sysinst/menus.mi:1.43	Sun Oct 30 00:30:56 2011
+++ src/distrib/utils/sysinst/menus.mi	Tue Jan 10 21:02:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.43 2011/10/30 00:30:56 jakllsch Exp $	*/
+/*	$NetBSD: menus.mi,v 1.44 2012/01/10 21:02:47 gson Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -246,8 +246,10 @@ menu ftpsource, y=-4, x=0, w=70, no 

CVS commit: src

2012-01-10 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan 10 23:39:11 UTC 2012

Modified Files:
src/libexec/telnetd: ext.h telnetd.c
src/usr.bin/telnet: externs.h

Log Message:
Use __dead


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/libexec/telnetd/ext.h
cvs rdiff -u -r1.53 -r1.54 src/libexec/telnetd/telnetd.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/telnet/externs.h

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

Modified files:

Index: src/libexec/telnetd/ext.h
diff -u src/libexec/telnetd/ext.h:1.21 src/libexec/telnetd/ext.h:1.22
--- src/libexec/telnetd/ext.h:1.21	Mon Jan  9 16:36:48 2012
+++ src/libexec/telnetd/ext.h	Tue Jan 10 23:39:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext.h,v 1.21 2012/01/09 16:36:48 christos Exp $	*/
+/*	$NetBSD: ext.h,v 1.22 2012/01/10 23:39:11 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -81,7 +81,7 @@ extern void
 	add_slc(char, char, cc_t),
 	check_slc(void),
 	change_slc(int, int, cc_t),
-	cleanup(int),
+	cleanup(int) __dead,
 	clientstat(int, int, int),
 	copy_termbuf(char *, int),
 	deferslc(void),
@@ -91,8 +91,8 @@ extern void
 	dooption(int),
 	dontoption(int),
 	edithost(const char *, const char *),
-	fatal(int, const char *),
-	fatalperror(int, const char *),
+	fatal(int, const char *) __dead,
+	fatalperror(int, const char *) __dead,
 	get_slc_defaults(void),
 	init_env(void),
 	init_termbuf(void),
@@ -120,7 +120,7 @@ extern void
 	sendbrk(void),
 	sendsusp(void),
 	set_termbuf(void),
-	start_login(char *, int, char *),
+	start_login(char *, int, char *) __dead,
 	start_slc(int),
 	startslave(char *, int, char *),
 	suboption(void),

Index: src/libexec/telnetd/telnetd.c
diff -u src/libexec/telnetd/telnetd.c:1.53 src/libexec/telnetd/telnetd.c:1.54
--- src/libexec/telnetd/telnetd.c:1.53	Mon Jan  9 16:36:48 2012
+++ src/libexec/telnetd/telnetd.c	Tue Jan 10 23:39:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnetd.c,v 1.53 2012/01/09 16:36:48 christos Exp $	*/
+/*	$NetBSD: telnetd.c,v 1.54 2012/01/10 23:39:11 joerg Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -65,7 +65,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)telnetd.c	8.4 (Berkeley) 5/30/95;
 #else
-__RCSID($NetBSD: telnetd.c,v 1.53 2012/01/09 16:36:48 christos Exp $);
+__RCSID($NetBSD: telnetd.c,v 1.54 2012/01/10 23:39:11 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -121,11 +121,10 @@ int keepalive = 1;
 const char *gettyname = default;
 char *progname;
 
-int main(int, char *[]);
-void usage(void);
+void usage(void) __dead;
 int getterminaltype(char *, size_t);
 int getent(char *, const char *);
-void doit(struct sockaddr *);
+static void doit(struct sockaddr *) __dead;
 void _gettermname(void);
 int terminaltypeok(char *);
 char *getstr(const char *, char **);
@@ -670,12 +669,12 @@ char *hostname;
 char host_name[MAXHOSTNAMELEN + 1];
 char remote_host_name[MAXHOSTNAMELEN + 1];
 
-extern void telnet(int, int);
+static void telnet(int, int) __dead;
 
 /*
  * Get a pty, scan input lines.
  */
-void
+static void
 doit(struct sockaddr *who)
 {
 	char *host;
@@ -739,7 +738,7 @@ doit(struct sockaddr *who)
  * Main loop.  Select from pty and network, and
  * hand data to telnet receiver finite state machine.
  */
-void
+static void
 telnet(int f, int p)
 {
 	int on = 1;

Index: src/usr.bin/telnet/externs.h
diff -u src/usr.bin/telnet/externs.h:1.36 src/usr.bin/telnet/externs.h:1.37
--- src/usr.bin/telnet/externs.h:1.36	Mon Jan  9 16:08:55 2012
+++ src/usr.bin/telnet/externs.h	Tue Jan 10 23:39:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.36 2012/01/09 16:08:55 christos Exp $	*/
+/*	$NetBSD: externs.h,v 1.37 2012/01/10 23:39:11 joerg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1990, 1993
@@ -234,7 +234,7 @@ int sourceroute(struct addrinfo *, char 
 
 /* main.c */
 void tninit(void);
-void usage(void);
+void usage(void) __dead;
 
 /* network.c */
 void init_network(void);



CVS commit: src/usr.sbin

2012-01-10 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan 10 23:39:33 UTC 2012

Modified Files:
src/usr.sbin/npf/npfctl: npfctl.h
src/usr.sbin/tprof: tprof.c

Log Message:
Use __dead


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npfctl/npfctl.h
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/tprof/tprof.c

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npfctl.h
diff -u src/usr.sbin/npf/npfctl/npfctl.h:1.8 src/usr.sbin/npf/npfctl/npfctl.h:1.9
--- src/usr.sbin/npf/npfctl/npfctl.h:1.8	Sun Jan  8 21:34:21 2012
+++ src/usr.sbin/npf/npfctl/npfctl.h	Tue Jan 10 23:39:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfctl.h,v 1.8 2012/01/08 21:34:21 rmind Exp $	*/
+/*	$NetBSD: npfctl.h,v 1.9 2012/01/10 23:39:32 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@ typedef struct module_arg {
 	npfvar_t *	ma_opts;
 } module_arg_t;
 
-void		yyerror(const char *, ...) __printflike(1, 2);
+void		yyerror(const char *, ...) __printflike(1, 2) __dead;
 void *		zalloc(size_t);
 void *		xrealloc(void *, size_t);
 char *		xstrdup(const char *);

Index: src/usr.sbin/tprof/tprof.c
diff -u src/usr.sbin/tprof/tprof.c:1.4 src/usr.sbin/tprof/tprof.c:1.5
--- src/usr.sbin/tprof/tprof.c:1.4	Mon Jan 26 05:53:10 2009
+++ src/usr.sbin/tprof/tprof.c	Tue Jan 10 23:39:33 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof.c,v 1.4 2009/01/26 05:53:10 yamt Exp $	*/
+/*	$NetBSD: tprof.c,v 1.5 2012/01/10 23:39:33 joerg Exp $	*/
 
 /*-
  * Copyright (c)2008 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: tprof.c,v 1.4 2009/01/26 05:53:10 yamt Exp $);
+__RCSID($NetBSD: tprof.c,v 1.5 2012/01/10 23:39:33 joerg Exp $);
 #endif /* not lint */
 
 #include sys/ioctl.h
@@ -53,7 +53,7 @@ __RCSID($NetBSD: tprof.c,v 1.4 2009/01/
 int devfd;
 int outfd;
 
-static void
+__dead static void
 usage(void)
 {
 



CVS commit: [yamt-pagecache] src/sys/uvm

2012-01-10 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 11 00:08:41 UTC 2012

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_extern.h uvm_loan.c uvm_meter.c

Log Message:
create a sysctl knob to turn on/off loaned read.


To generate a diff of this commit:
cvs rdiff -u -r1.176.2.6 -r1.176.2.7 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.81.2.9 -r1.81.2.10 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.56.4.6 -r1.56.4.7 src/sys/uvm/uvm_meter.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.176.2.6 src/sys/uvm/uvm_extern.h:1.176.2.7
--- src/sys/uvm/uvm_extern.h:1.176.2.6	Mon Dec 26 16:03:10 2011
+++ src/sys/uvm/uvm_extern.h	Wed Jan 11 00:08:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.176.2.6 2011/12/26 16:03:10 yamt Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.176.2.7 2012/01/11 00:08:40 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -504,6 +504,8 @@ struct uvmexp_sysctl {
 extern struct uvmexp uvmexp;
 /* MD code needs this without including uvm/uvm.h */
 extern bool vm_page_zero_enable;
+
+extern bool vm_loan_read;
 #endif
 
 /*

Index: src/sys/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.81.2.9 src/sys/uvm/uvm_loan.c:1.81.2.10
--- src/sys/uvm/uvm_loan.c:1.81.2.9	Wed Jan  4 16:31:17 2012
+++ src/sys/uvm/uvm_loan.c	Wed Jan 11 00:08:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v
 
 #include uvm/uvm.h
 
-bool doloanobj = true;
+bool vm_loan_read = true;
 
 /*
  * loaned pages are pages which are (read-only, copy-on-write) loaned
@@ -1304,7 +1304,7 @@ uvm_loanobj(struct uvm_object *uobj, str
 	size_t len;
 	int i, error = 0;
 
-	if (!doloanobj) {
+	if (!vm_loan_read) {
 		return ENOSYS;
 	}
 

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.56.4.6 src/sys/uvm/uvm_meter.c:1.56.4.7
--- src/sys/uvm/uvm_meter.c:1.56.4.6	Mon Dec 26 16:03:11 2011
+++ src/sys/uvm/uvm_meter.c	Wed Jan 11 00:08:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.56.4.6 2011/12/26 16:03:11 yamt Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.56.4.7 2012/01/11 00:08:41 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.56.4.6 2011/12/26 16:03:11 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.56.4.7 2012/01/11 00:08:41 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -322,6 +322,12 @@ SYSCTL_SETUP(sysctl_vm_setup, sysctl vm
 		   SYSCTL_DESCR(Whether try to zero pages in idle loop),
 		   NULL, 0, vm_page_zero_enable, 0,
 		   CTL_VM, CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_BOOL, loanread,
+		   SYSCTL_DESCR(Use page loaning for read),
+		   NULL, 0, vm_loan_read, 0,
+		   CTL_VM, CTL_CREATE, CTL_EOL);
 
 	uvmpdpol_sysctlsetup();
 }



CVS commit: [yamt-pagecache] src/sys/uvm

2012-01-10 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 11 00:09:51 UTC 2012

Modified Files:
src/sys/uvm [yamt-pagecache]: uvm_loan.c

Log Message:
turn an error return to an assertion


To generate a diff of this commit:
cvs rdiff -u -r1.81.2.10 -r1.81.2.11 src/sys/uvm/uvm_loan.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/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.81.2.10 src/sys/uvm/uvm_loan.c:1.81.2.11
--- src/sys/uvm/uvm_loan.c:1.81.2.10	Wed Jan 11 00:08:41 2012
+++ src/sys/uvm/uvm_loan.c	Wed Jan 11 00:09:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.81.2.11 2012/01/11 00:09:51 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.81.2.10 2012/01/11 00:08:41 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_loan.c,v 1.81.2.11 2012/01/11 00:09:51 yamt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1391,9 +1391,7 @@ uvm_loanobj_read(struct vm_map *map, vad
 	UVMHIST_LOG(ubchist, map %p va 0x%x npages %d, map, va, npages, 0);
 	UVMHIST_LOG(ubchist, uobj %p off 0x%x, uobj, off, 0, 0);
 
-	if (npages  MAXPAGES) {
-		return EINVAL;
-	}
+	KASSERT(npages = MAXPAGES);
 #if defined(PMAP_PREFER)
 	/*
 	 * avoid creating VAC aliases.



CVS commit: src/sys/kern

2012-01-10 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Jan 11 00:11:32 UTC 2012

Modified Files:
src/sys/kern: vfs_wapbl.c

Log Message:
comments


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/vfs_wapbl.c

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

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.48 src/sys/kern/vfs_wapbl.c:1.49
--- src/sys/kern/vfs_wapbl.c:1.48	Fri Dec  2 12:38:59 2011
+++ src/sys/kern/vfs_wapbl.c	Wed Jan 11 00:11:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.48 2011/12/02 12:38:59 yamt Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.49 2012/01/11 00:11:32 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.48 2011/12/02 12:38:59 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.49 2012/01/11 00:11:32 yamt Exp $);
 
 #include sys/param.h
 #include sys/bitops.h
@@ -1956,7 +1956,12 @@ wapbl_write_commit(struct wapbl *wl, off
 	int error;
 	daddr_t pbn;
 
-	/* XXX Calc checksum here, instead we do this for now */
+	/*
+	 * flush disk cache to ensure that blocks we've written are actually
+	 * written to the stable storage before the commit header.
+	 *
+	 * XXX Calc checksum here, instead we do this for now
+	 */
 	wapbl_cache_sync(wl, 1);
 
 	wc-wc_head = head;
@@ -1972,6 +1977,8 @@ wapbl_write_commit(struct wapbl *wl, off
 	(intmax_t)head, (intmax_t)tail));
 
 	/*
+	 * write the commit header.
+	 *
 	 * XXX if generation will rollover, then first zero
 	 * over second commit header before trying to write both headers.
 	 */
@@ -1984,6 +1991,10 @@ wapbl_write_commit(struct wapbl *wl, off
 	if (error)
 		return error;
 
+	/*
+	 * flush disk cache to ensure that the commit header is actually
+	 * written before meta data blocks.
+	 */
 	wapbl_cache_sync(wl, 2);
 
 	/*



CVS commit: src/usr.bin/msgc

2012-01-10 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 11 00:30:56 UTC 2012

Modified Files:
src/usr.bin/msgc: msgc.1

Log Message:
MENU_name - MSG_name


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/msgc/msgc.1

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/msgc/msgc.1
diff -u src/usr.bin/msgc/msgc.1:1.22 src/usr.bin/msgc/msgc.1:1.23
--- src/usr.bin/msgc/msgc.1:1.22	Fri May 14 17:24:38 2010
+++ src/usr.bin/msgc/msgc.1	Wed Jan 11 00:30:56 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: msgc.1,v 1.22 2010/05/14 17:24:38 joerg Exp $
+.\	$NetBSD: msgc.1,v 1.23 2012/01/11 00:30:56 riz Exp $
 .\
 .\ Copyright 1997 Piermont Information Systems Inc.
 .\ All rights reserved.
@@ -132,7 +132,7 @@ The messages may have
 .Xr sprintf 3
 conversions in them and the corresponding parameters should match.
 Messages are identified by name using the notation
-.Sq MENU_name
+.Sq MSG_name
 where
 .Dq name
 is the name in the message source file.



CVS commit: src/doc

2012-01-10 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 11 01:20:10 UTC 2012

Modified Files:
src/doc: 3RDPARTY

Log Message:
Various changes and corrections from Snader_LB:

- clarify and correct the notes on the format of the file on top;
- remove spurious trailing whitespace on several places;
- update `Version' (4.1.34 was imported on 2010-04-17) and `Current
  Version' fields for the `ipf' entry, as well as correct the path
  to its license file (which uses the non-American spelling, using
  a `c' instead of an `s') and use a semicolon in its line instead
  of a comma;
- update / correct `Curr Vers', `Home page' and `Notes' fields for
  the pkg_install entry, as well as correct some minor typing
  mistakes there;
- add note for the license change for rcs-5.8;
- since 5.8 is released, change the note on rcs concerning its
  Purdue FTP site (the line as it was dates from r1.1 of this file);
- clarify the license field for the `texinfo' entry;
- update version fields of the `services' / `protocols' entry,
  split those for the two (like was already done for the `Archive
  Site' field in r1.780 of this file), clarify the `Archive Site'
  fields for the two, and add a trailing slash (`/') to its `Home
  Page' field.


To generate a diff of this commit:
cvs rdiff -u -r1.893 -r1.894 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.893 src/doc/3RDPARTY:1.894
--- src/doc/3RDPARTY:1.893	Sun Dec 25 23:29:34 2011
+++ src/doc/3RDPARTY	Wed Jan 11 01:20:10 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.893 2011/12/25 23:29:34 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.894 2012/01/11 01:20:10 riz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -15,13 +15,13 @@
 # A few notes on the format of this file (for the benefit of
 # 3rdparty2html):
 #
-# 1.) Any line whose first non-whitespace character is # is a comment
-# 2.) Entries are separated by blank lines
-# 3.) Every package needs at least the following entries: Package,
-# Version, Current Vers, and Maintainer.
+# 1.) Any line whose first non-whitespace character is # is a comment;
+# 2.) Entries are separated by blank lines;
+# 3.) Every package needs at least the Package, Version, Current Vers,
+# and Maintainer fields;
 # 4.) Where a field has multiple lines of information, the field tag
 # should be repeated on each line, except:
-# 5.) The Notes: field tag should appear on a line by itself.  All
+# 5.) The Notes: field tag should appear on a line by itself; all
 # remaining lines until the end of the record are notes.
 
 Package:	acpica
@@ -142,7 +142,7 @@ Responsible:	thorpej, mrg
 License:	GPLv3, LGPLv3, GPLv2, LGPLv2, BSD
 Notes:
 
-Package:	bozohttpd 
+Package:	bozohttpd
 Version:	20100617
 Current Vers:	20100617
 Maintainer:	m...@eterna.com.au
@@ -328,7 +328,7 @@ Archive Site:	http://flex.sourceforge.ne
 Home Page:	http://flex.sourceforge.net/
 Mailing List:	http://lists.sourceforge.net/mailman/listinfo/flex-announce
 Responsible:
-License:	BSD-like	
+License:	BSD-like
 Notes:
 There is a flex2netbsd script to help newer imports.
 
@@ -448,14 +448,14 @@ License:	BSD (3-clause)
 Notes:
 
 Package:	ipf
-Version:	4.1.33
-Current Vers:	4.1.33
+Version:	4.1.34
+Current Vers:	5.1.0
 Maintainer:	Darren Reed
 Archive Site:	http://coombs.anu.edu.au/~avalon/
 Home Page:	http://coombs.anu.edu.au/~avalon/
 Mailing List:	ipfil...@postbox.anu.edu.au
 Responsible:	darrenr, mike
-License:	BSD-based, see src/dist/ipf/IPFILTER.LICENSE
+License:	BSD-based; see src/dist/ipf/IPFILTER.LICENCE
 Notes:
 ipf2netbsd should be used on a virgin ipfilter source tree.
 See also dist/ipf/README.NetBSD
@@ -478,13 +478,13 @@ When configure.ac is updated, run the fo
   cd src/crypto/dist/ipsec-tools
   ./bootstrap
   ./configure --enable-adminport --enable-hybrid --enable-frag \
-  	  --enable-natt --enable-dpd 
+  	  --enable-natt --enable-dpd
 Then copy package_version.h to src/lib/libipsec and merge config.h with
 src/lib/libipsec/config.h (it needs some manual tweaking)
 
-NOTE: As NetBSD HEAD and ipsec-tools HEAD are just the same thing, 
+NOTE: As NetBSD HEAD and ipsec-tools HEAD are just the same thing,
 NetBSD-current always contains latest ipsec-tools code. On the other hand,
-ipsec-tools has stable branches (e.g.: ipsec-tools-0_7-branch), which 
+ipsec-tools has stable branches (e.g.: ipsec-tools-0_7-branch), which
 are manually pulled up to NetBSD stable branches (e.g.: netbsd-4 is regularly
 sync with ipsec-tools-0_7-branch)
 
@@ -559,7 +559,7 @@ Home Page:	http://sources.redhat.com/lvm
 Responsible:	haad
 License:	LGPLv2.1
 Notes:
-The lvm2tools and the libdevmapper are now distributed as one source 
+The lvm2tools and the libdevmapper are now distributed as one source
 repository. See the lvm2tools Notes 

CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2012-01-10 Thread Darran Hunt
Module Name:src
Committed By:   darran
Date:   Tue Jan 10 08:42:22 UTC 2012

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctf.c dwarf.c

Log Message:
Fix a segfault in ctfmerge.

GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0x.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35998 .

GCC is currently doing this for external/bsd/tmux/dist/compat/imsg-buffer.c:
readelf -a --debug-dump imsg-buffer.o
...
 26e3: Abbrev Number: 32 (DW_TAG_union_type)
6e4   DW_AT_byte_size   : 0x
6e8   DW_AT_decl_file   : 1
6e9   DW_AT_decl_line   : 229
6ea   DW_AT_sibling : 0x705

This resulted in ctfconvert generating a faulty CTF entry which then caused the
segfault in ctfmerge.

The fix has ctfconvert check for the bogus 0x value and works around it.
It also adds some protection to ctfmerge to avoid the segfault and fail
more gracefully if the error should occur in the future.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.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/tools/ctf/cvt/ctf.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.5 src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.6
--- src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c:1.5	Thu Mar 11 23:26:33 2010
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctf.c	Tue Jan 10 08:42:22 2012
@@ -53,6 +53,10 @@
  */
 char *curfile;
 
+
+/* The number of types. */
+static int ntypes=0;
+
 #define	CTF_BUF_CHUNK_SIZE	(64 * 1024)
 #define	RES_BUF_CHUNK_SIZE	(64 * 1024)
 
@@ -1048,6 +1052,9 @@ resurrect_types(ctf_header_t *h, tdata_t
 	(*mpp)-ml_type = tdarr[ctm-ctm_type];
 	(*mpp)-ml_offset = ctm-ctm_offset;
 	(*mpp)-ml_size = 0;
+	if (ctm-ctm_type  ntypes) {
+	parseterminate(Invalid member type ctm_type=%d, ctm-ctm_type);
+	}
 }
 			} else {
 for (i = 0, mpp = tdp-t_members; i  vlen;
@@ -1064,6 +1071,9 @@ resurrect_types(ctf_header_t *h, tdata_t
 	(*mpp)-ml_offset =
 	(int)CTF_LMEM_OFFSET(ctlm);
 	(*mpp)-ml_size = 0;
+	if (ctlm-ctlm_type  ntypes) {
+	parseterminate(Invalid lmember type ctlm_type=%d, ctlm-ctlm_type);
+	}
 }
 			}
 
@@ -1177,9 +1187,10 @@ ctf_parse(ctf_header_t *h, caddr_t buf, 
 {
 	tdata_t *td = tdata_new();
 	tdesc_t **tdarr;
-	int ntypes = count_types(h, buf);
 	int idx, i;
 
+	ntypes = count_types(h, buf);
+
 	/* shudder */
 	tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1));
 	tdarr[0] = NULL;

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.5
--- src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c:1.4	Wed Feb 24 21:53:26 2010
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c	Tue Jan 10 08:42:22 2012
@@ -678,6 +678,12 @@ die_array_create(dwarf_t *dw, Dwarf_Die 
 		tdesc_t *dimtdp;
 		int flags;
 
+		/* Check for bogus gcc DW_AT_byte_size attribute */
+		if (uval == 0x) {
+		printf(dwarf.c:%s() working around bogus DW_AT_byte_size = 0x\n, __func__);
+		uval = 0;
+		}
+
 		tdp-t_size = uval;
 
 		/*
@@ -764,6 +770,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d
 	tdp-t_type = ENUM;
 
 	(void) die_unsigned(dw, die, DW_AT_byte_size, uval, DW_ATTR_REQ);
+	/* Check for bogus gcc DW_AT_byte_size attribute */
+	if (uval == 0x) {
+	printf(dwarf.c:%s() working around bogus DW_AT_byte_size = 0x\n, __func__);
+	uval = 0;
+	}
 	tdp-t_size = uval;
 
 	if ((mem = die_child(dw, die)) != NULL) {
@@ -877,7 +888,7 @@ static void
 die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
 int type, const char *typename)
 {
-	Dwarf_Unsigned sz, bitsz, bitoff;
+	Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0;
 	Dwarf_Die mem;
 	mlist_t *ml, **mlastp;
 	iidesc_t *ii;
@@ -933,6 +944,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st
 			ml-ml_name = NULL;
 
 		ml-ml_type = die_lookup_pass1(dw, mem, DW_AT_type);
+		debug(3, die_sou_create(): ml_type = %p t_id = %d\n, ml-ml_type,
+			ml-ml_type-t_id);
 
 		if (die_mem_offset(dw, mem, DW_AT_data_member_location,
 		mloff, 0)) {
@@ -960,8 +973,21 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st
 
 		*mlastp = ml;
 		mlastp = ml-ml_next;
+
+		/* work out the size of the largest member to work around a gcc bug */
+		if (maxsz  ml-ml_size) {
+		maxsz = ml-ml_size;
+		}
 	} while ((mem = die_sibling(dw, mem)) != NULL);
 
+	/* See if we got a bogus DW_AT_byte_size.  GCC will sometimes
+	 * emit this.
+	 */
+	if (sz == 0x) {
+	printf(dwarf.c:%s() working around bogus DW_AT_byte_size = 0x\n, __func__);
+	tdp-t_size = maxsz / 8;	/* maxsz is in 

CVS commit: src/sys/arch/usermode/usermode

2012-01-10 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Jan 10 10:09:49 UTC 2012

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
Explicitly protect the kernel image against tampering by marking it R-X


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.99 src/sys/arch/usermode/usermode/pmap.c:1.100
--- src/sys/arch/usermode/usermode/pmap.c:1.99	Mon Jan  9 14:58:15 2012
+++ src/sys/arch/usermode/usermode/pmap.c	Tue Jan 10 10:09:49 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.99 2012/01/09 14:58:15 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk rein...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.99 2012/01/09 14:58:15 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $);
 
 #include opt_memsize.h
 #include opt_kmempages.h
@@ -251,12 +251,9 @@ pmap_bootstrap(void)
 #endif
 
 	/* protect the current kernel section */
-#if 0
-	int err;
 	err = thunk_mprotect((void *) kmem_k_start, kmem_k_end - kmem_k_start,
 		THUNK_PROT_READ | THUNK_PROT_EXEC);
 	assert(err == 0);
-#endif
 
 	/* initialize counters */
 	fpos = 0;



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

2012-01-10 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Jan 10 10:19:38 UTC 2012

Modified Files:
src/sys/arch/usermode/include: vmparam.h

Log Message:
Clarify comment about PAGER_MAP_DEFAULT_SIZE


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/usermode/include/vmparam.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/usermode/include/vmparam.h
diff -u src/sys/arch/usermode/include/vmparam.h:1.14 src/sys/arch/usermode/include/vmparam.h:1.15
--- src/sys/arch/usermode/include/vmparam.h:1.14	Fri Jan  6 12:53:07 2012
+++ src/sys/arch/usermode/include/vmparam.h	Tue Jan 10 10:19:38 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.14 2012/01/06 12:53:07 reinoud Exp $ */
+/* $NetBSD: vmparam.h,v 1.15 2012/01/10 10:19:38 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -51,8 +51,12 @@ extern paddr_t kmem_user_start, kmem_use
 
 #define	USRSTACK		VM_MAXUSER_ADDRESS
 
-/* override the default pager_map size, there is little KVA */
-#define PAGER_MAP_DEFAULT_SIZE	(8 * 1024 * 1024)
+/*
+ * When an architecture has little KVA then override the default pager_map
+ * size in its block by limiting it like this:
+ *
+ * #define PAGER_MAP_DEFAULT_SIZE	(8 * 1024 * 1024)
+ */
 
 #if defined(__i386__) 
 #define	PAGE_SHIFT		12



CVS commit: src/sys/dev/usb

2012-01-10 Thread Wolfgang Solfrank
Module Name:src
Committed By:   ws
Date:   Tue Jan 10 11:32:25 UTC 2012

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

Log Message:
Delete Linux Ethernet Gadget from special handling.
This makes at least the Openmoko Freerunner work again.
Fixes PR kern/45591.
Ok Jeff Rizzo (releng).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_cdce.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/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.33 src/sys/dev/usb/if_cdce.c:1.34
--- src/sys/dev/usb/if_cdce.c:1.33	Tue Jun  7 05:46:00 2011
+++ src/sys/dev/usb/if_cdce.c	Tue Jan 10 11:32:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.33 2011/06/07 05:46:00 msaitoh Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.34 2012/01/10 11:32:25 ws Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul wp...@windriver.com
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_cdce.c,v 1.33 2011/06/07 05:46:00 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_cdce.c,v 1.34 2012/01/10 11:32:25 ws Exp $);
 #ifdef	__NetBSD__
 #include opt_inet.h
 #endif
@@ -100,7 +100,6 @@ Static const struct cdce_type cdce_devs[
   {{ USB_VENDOR_GMATE, USB_PRODUCT_GMATE_YP3X00 }, CDCE_NO_UNION },
   {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN }, CDCE_ZAURUS | CDCE_NO_UNION },
   {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2 }, CDCE_ZAURUS | CDCE_NO_UNION },
-  {{ USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_ETHERNETGADGET }, CDCE_NO_UNION },
   {{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2501 }, CDCE_NO_UNION },
   {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5500 }, CDCE_ZAURUS },
   {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_A300 }, CDCE_ZAURUS | CDCE_NO_UNION },