CVS commit: src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb

2013-12-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  3 08:49:09 UTC 2013

Removed Files:
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb: a

Log Message:
remove accidently commited file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/a

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



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

2013-12-03 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Dec  3 16:13:49 UTC 2013

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

Log Message:
+SIMPLEQ_LAST.0


To generate a diff of this commit:
cvs rdiff -u -r1.1867 -r1.1868 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1867 src/distrib/sets/lists/comp/mi:1.1868
--- src/distrib/sets/lists/comp/mi:1.1867	Thu Nov 28 13:47:29 2013
+++ src/distrib/sets/lists/comp/mi	Tue Dec  3 16:13:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1867 2013/11/28 13:47:29 joerg Exp $
+#	$NetBSD: mi,v 1.1868 2013/12/03 16:13:49 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4911,6 +4911,7 @@
 ./usr/share/man/cat3/SIMPLEQ_INSERT_AFTER.0	comp-c-catman		.cat
 ./usr/share/man/cat3/SIMPLEQ_INSERT_HEAD.0	comp-c-catman		.cat
 ./usr/share/man/cat3/SIMPLEQ_INSERT_TAIL.0	comp-c-catman		.cat
+./usr/share/man/cat3/SIMPLEQ_LAST.0		comp-c-catman		.cat
 ./usr/share/man/cat3/SIMPLEQ_NEXT.0		comp-c-catman		.cat
 ./usr/share/man/cat3/SIMPLEQ_REMOVE.0		comp-c-catman		.cat
 ./usr/share/man/cat3/SIMPLEQ_REMOVE_AFTER.0	comp-c-catman		.cat



CVS commit: src/lib/libc/compiler_rt

2013-12-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec  3 16:14:50 UTC 2013

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
Don't include bswap for ARM right now, the routines require ARMv6.
Separate the soft-float code and don't include it in the libgcc case.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compiler_rt/Makefile.inc

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/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.2 src/lib/libc/compiler_rt/Makefile.inc:1.3
--- src/lib/libc/compiler_rt/Makefile.inc:1.2	Tue Dec  3 02:28:51 2013
+++ src/lib/libc/compiler_rt/Makefile.inc	Tue Dec  3 16:14:50 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.2 2013/12/03 02:28:51 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.3 2013/12/03 16:14:50 joerg Exp $
 
 COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -35,15 +35,31 @@ GENERIC_SRCS+= \
 # Conflicts with soft-float
 GENERIC_SRCS+= \
 	comparedf2.c \
-	comparesf2.c
+	comparesf2.c \
+	adddf3.c \
+	addsf3.c \
+	divdf3.c \
+	divsf3.c \
+	extendsfdf2.c \
+	fixdfdi.c \
+	fixdfsi.c \
+	fixdfti.c \
+	fixsfdi.c \
+	fixsfsi.c \
+	fixsfti.c \
+	floatsidf.c \
+	floatsisf.c \
+	muldf3.c \
+	mulsf3.c \
+	subdf3.c \
+	subsf3.c \
+	truncdfsf2.c
 .endif
 
 GENERIC_SRCS+= \
 	absvdi2.c \
 	absvsi2.c \
 	absvti2.c \
-	adddf3.c \
-	addsf3.c \
 	addvdi3.c \
 	addvsi3.c \
 	addvti3.c \
@@ -59,22 +75,13 @@ GENERIC_SRCS+= \
 	ctzdi2.c \
 	ctzsi2.c \
 	ctzti2.c \
-	divdf3.c \
 	divdi3.c \
 	divmoddi4.c \
 	divmodsi4.c \
-	divsf3.c \
 	divsi3.c \
 	divti3.c \
-	extendsfdf2.c \
 	ffsdi2.c \
 	ffsti2.c \
-	fixdfdi.c \
-	fixdfsi.c \
-	fixdfti.c \
-	fixsfdi.c \
-	fixsfsi.c \
-	fixsfti.c \
 	fixunsdfdi.c \
 	fixunsdfsi.c \
 	fixunsdfti.c \
@@ -89,8 +96,6 @@ GENERIC_SRCS+= \
 	floatdidf.c \
 	floatdisf.c \
 	floatdixf.c \
-	floatsidf.c \
-	floatsisf.c \
 	floattidf.c \
 	floattisf.c \
 	floattixf.c \
@@ -109,12 +114,10 @@ GENERIC_SRCS+= \
 	modsi3.c \
 	modti3.c \
 	muldc3.c \
-	muldf3.c \
 	muldi3.c \
 	mulodi4.c \
 	mulosi4.c \
 	muloti4.c \
-	mulsf3.c \
 	multi3.c \
 	mulvdi3.c \
 	mulvsi3.c \
@@ -136,12 +139,9 @@ GENERIC_SRCS+= \
 	powisf2.c \
 	powitf2.c \
 	powixf2.c \
-	subdf3.c \
-	subsf3.c \
 	subvdi3.c \
 	subvsi3.c \
 	subvti3.c \
-	truncdfsf2.c \
 	ucmpdi2.c \
 	ucmpti2.c \
 	udivdi3.c \
@@ -154,6 +154,7 @@ GENERIC_SRCS+= \
 	umodsi3.c \
 	umodti3.c
 
+.if ${HAVE_LIBGCC} == "no"
 .if ${MACHINE_ARCH} == "powerpc"
 GENERIC_SRCS+= \
 	fixtfdi.c \
@@ -165,6 +166,7 @@ GENERIC_SRCS+= \
 	gcc_qmul.c \
 	gcc_qsub.c
 .endif
+.endif
 
 .if ${MACHINE_CPU} == "arm"
 .if !empty(LIBC_MACHINE_ARCH:Mearm*)
@@ -176,10 +178,10 @@ GENERIC_SRCS+= \
 	aeabi_uidivmod.S \
 	aeabi_uldivmod.S
 .endif
-
-GENERIC_SRCS+= \
-	bswapdi2.S \
-	bswapsi2.S
+# Not yet, requires ARMv6
+#GENERIC_SRCS+= \
+#	bswapdi2.S \
+#	bswapsi2.S
 .endif
 
 .for src in ${GENERIC_SRCS}



CVS commit: src/sys/lib/libkern

2013-12-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec  3 16:15:22 UTC 2013

Added Files:
src/sys/lib/libkern: Makefile.compiler-rt

Log Message:
libkern build glue for compiler-rt.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/lib/libkern/Makefile.compiler-rt

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

Added files:

Index: src/sys/lib/libkern/Makefile.compiler-rt
diff -u /dev/null src/sys/lib/libkern/Makefile.compiler-rt:1.1
--- /dev/null	Tue Dec  3 16:15:22 2013
+++ src/sys/lib/libkern/Makefile.compiler-rt	Tue Dec  3 16:15:22 2013
@@ -0,0 +1,106 @@
+# $NetBSD: Makefile.compiler-rt,v 1.1 2013/12/03 16:15:22 joerg Exp $
+
+COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
+
+.if ${MACHINE_ARCH} == "powerpc"
+COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/ppc
+COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/ppc
+.else
+COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/${MACHINE_CPU}
+COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/${MACHINE_ARCH}
+.endif
+
+.PATH: ${COMPILER_RT_CPU_DIR}
+.PATH: ${COMPILER_RT_ARCH_DIR}
+.PATH: ${COMPILER_RT_SRCDIR}/lib
+
+GENERIC_SRCS+= \
+	absvdi2.c \
+	absvsi2.c \
+	absvti2.c \
+	addvdi3.c \
+	addvsi3.c \
+	addvti3.c \
+	ashldi3.c \
+	ashlti3.c \
+	ashrdi3.c \
+	ashrti3.c \
+	clzdi2.c \
+	clzsi2.c \
+	clzti2.c \
+	cmpdi2.c \
+	cmpti2.c \
+	ctzdi2.c \
+	ctzsi2.c \
+	ctzti2.c \
+	divdi3.c \
+	divmoddi4.c \
+	divmodsi4.c \
+	divsi3.c \
+	divti3.c \
+	ffsdi2.c \
+	ffsti2.c \
+	int_util.c \
+	lshrdi3.c \
+	lshrti3.c \
+	moddi3.c \
+	modsi3.c \
+	modti3.c \
+	muldi3.c \
+	mulodi4.c \
+	mulosi4.c \
+	muloti4.c \
+	multi3.c \
+	mulvdi3.c \
+	mulvsi3.c \
+	mulvti3.c \
+	negdi2.c \
+	negti2.c \
+	negvdi2.c \
+	negvsi2.c \
+	negvti2.c \
+	paritydi2.c \
+	paritysi2.c \
+	parityti2.c \
+	popcountdi2.c \
+	popcountsi2.c \
+	popcountti2.c \
+	subvdi3.c \
+	subvsi3.c \
+	subvti3.c \
+	ucmpdi2.c \
+	ucmpti2.c \
+	udivdi3.c \
+	udivmoddi4.c \
+	udivmodsi4.c \
+	udivmodti4.c \
+	udivsi3.c \
+	udivti3.c \
+	umoddi3.c \
+	umodsi3.c \
+	umodti3.c
+
+.if ${MACHINE_CPU} == "arm"
+.  if !empty(LIBC_MACHINE_ARCH:Mearm*)
+GENERIC_SRCS+= \
+	aeabi_idivmod.S \
+	aeabi_ldivmod.S \
+	aeabi_uidivmod.S \
+	aeabi_uldivmod.S
+.  endif
+.endif
+
+.for src in ${GENERIC_SRCS}
+.  if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
+  exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S)
+SRCS+=	${src:R}.S
+.  else
+SRCS+=	${src}
+COPTS.${src}+=	-Wno-missing-prototypes \
+		-Wno-old-style-definition \
+		-Wno-strict-prototypes \
+		-Wno-uninitialized
+.  endif
+.endfor
+
+CPPFLAGS.int_util.c+=	-DKERNEL_USE



CVS commit: src/sys/dev/sun

2013-12-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Dec  3 17:01:04 UTC 2013

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
- don't use defattr before it actually contains something useful
- clear the screen only once, when we know what colour to use
- set up the colour map only once, when we know which one to use
-> no more funky colour flashing while cgsix attaches on my U1


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/sun/cgsix.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/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.62 src/sys/dev/sun/cgsix.c:1.63
--- src/sys/dev/sun/cgsix.c:1.62	Thu Sep 12 12:42:18 2013
+++ src/sys/dev/sun/cgsix.c	Tue Dec  3 17:01:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $ */
+/*	$NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $");
 
 #include 
 #include 
@@ -614,9 +614,6 @@ cg6attach(struct cgsix_softc *sc, const 
 	vcons_init(&sc->vd, sc, &cgsix_defaultscreen, &cgsix_accessops);
 	sc->vd.init_screen = cgsix_init_screen;
 
-	cg6_setup_palette(sc);
-	cgsix_clearscreen(sc);
-
 	sc->sc_gc.gc_bitblt = cgsix_bitblt;
 	sc->sc_gc.gc_blitcookie = sc;
 	sc->sc_gc.gc_rop = CG6_ALU_COPY;
@@ -625,6 +622,19 @@ cg6attach(struct cgsix_softc *sc, const 
 		/* we mess with cg6_console_screen only once */
 		vcons_init_screen(&sc->vd, &cg6_console_screen, 1,
 		&defattr);
+		sc->sc_bg = (defattr >> 16) & 0xf; /* yes, this is an index into devcmap */
+		
+		/*
+		 * XXX
+		 * Is this actually necessary? We're going to use the blitter later on anyway.
+		 */ 
+		/* We need unaccelerated initial screen clear on old revisions */
+		if (sc->sc_fhcrev < 2) {
+			memset(sc->sc_fb.fb_pixels, ri->ri_devcmap[sc->sc_bg],
+			sc->sc_stride * sc->sc_height);
+		} else
+			cgsix_clearscreen(sc);
+
 		cg6_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
 		
 		cgsix_defaultscreen.textops = &ri->ri_ops;
@@ -655,6 +665,7 @@ cg6attach(struct cgsix_softc *sc, const 
 			&defattr);
 		} else
 			(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+		sc->sc_bg = (defattr >> 16) & 0xf;
 		if (ri->ri_flg & RI_ENABLE_ALPHA) {
 			glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
 (sc->sc_ramsize / sc->sc_stride) - 
@@ -1297,10 +1308,6 @@ cgsix_init_screen(void *cookie, struct v
 	}
 	ri->ri_bits = sc->sc_fb.fb_pixels;
 	
-	/* We need unaccelerated initial screen clear on old revisions */
-	if (sc->sc_fhcrev < 2)
-		memset(sc->sc_fb.fb_pixels, (*defattr >> 16) & 0xff,
-		sc->sc_stride * sc->sc_height);
 	rasops_init(ri, 0, 0);
 	ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
 	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,



CVS commit: src/bin/cat

2013-12-03 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Tue Dec  3 17:06:52 UTC 2013

Modified Files:
src/bin/cat: cat.c

Log Message:
Coverity complaint fixes:
bin/cat/cat.c 976654 Argument cannot be negative
 (missing check for fileno result, stdout)
bin/cat/cat.c 976653 Improper use of negative value
 (missing check for fileno result, stdin)


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/bin/cat/cat.c

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

Modified files:

Index: src/bin/cat/cat.c
diff -u src/bin/cat/cat.c:1.52 src/bin/cat/cat.c:1.53
--- src/bin/cat/cat.c:1.52	Mon Nov 19 19:41:31 2012
+++ src/bin/cat/cat.c	Tue Dec  3 17:06:51 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cat.c,v 1.52 2012/11/19 19:41:31 christos Exp $	*/
+/* $NetBSD: cat.c,v 1.53 2013/12/03 17:06:51 spz Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)cat.c	8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: cat.c,v 1.52 2012/11/19 19:41:31 christos Exp $");
+__RCSID("$NetBSD: cat.c,v 1.53 2013/12/03 17:06:51 spz Exp $");
 #endif
 #endif /* not lint */
 
@@ -250,9 +250,11 @@ raw_args(char **argv)
 	filename = "stdin";
 	do {
 		if (*argv) {
-			if (!strcmp(*argv, "-"))
+			if (!strcmp(*argv, "-")) {
 fd = fileno(stdin);
-			else if (fflag) {
+if (fd < 0)
+	goto skip;
+			} else if (fflag) {
 struct stat st;
 fd = open(*argv, O_RDONLY|O_NONBLOCK, 0);
 if (fd < 0)
@@ -279,7 +281,8 @@ skipnomsg:
 			filename = *argv++;
 		}
 		raw_cat(fd);
-		if (fd != fileno(stdin))
+		/* fd > 0 would be cuter but let's priorize human-readability */
+		if (fd >= 0 && fd != fileno(stdin))
 			(void)close(fd);
 	} while (*argv);
 }
@@ -294,6 +297,8 @@ raw_cat(int rfd)
 	int wfd;
 
 	wfd = fileno(stdout);
+	if (wfd < 0)
+		err(EXIT_FAILURE, "stdout");
 	if (buf == NULL) {
 		struct stat sbuf;
 



CVS commit: src/crypto/external/bsd/openssh/dist

2013-12-03 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Tue Dec  3 17:14:35 UTC 2013

Modified Files:
src/crypto/external/bsd/openssh/dist: monitor.c

Log Message:
Coverity fix:
979928 Use after free
debug3 line moved to before one of its arguments is freed


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/crypto/external/bsd/openssh/dist/monitor.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/monitor.c
diff -u src/crypto/external/bsd/openssh/dist/monitor.c:1.11 src/crypto/external/bsd/openssh/dist/monitor.c:1.12
--- src/crypto/external/bsd/openssh/dist/monitor.c:1.11	Fri Nov  8 19:18:25 2013
+++ src/crypto/external/bsd/openssh/dist/monitor.c	Tue Dec  3 17:14:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: monitor.c,v 1.11 2013/11/08 19:18:25 christos Exp $	*/
+/*	$NetBSD: monitor.c,v 1.12 2013/12/03 17:14:35 spz Exp $	*/
 /* $OpenBSD: monitor.c,v 1.127 2013/07/19 07:37:48 markus Exp $ */
 /*
  * Copyright 2002 Niels Provos 
@@ -27,7 +27,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: monitor.c,v 1.11 2013/11/08 19:18:25 christos Exp $");
+__RCSID("$NetBSD: monitor.c,v 1.12 2013/12/03 17:14:35 spz Exp $");
 #include 
 #include 
 #include 
@@ -1181,6 +1181,9 @@ mm_answer_keyallowed(int sock, Buffer *m
 			break;
 		}
 	}
+	debug3("%s: key %p is %s",
+	__func__, key, allowed ? "allowed" : "not allowed");
+
 	if (key != NULL)
 		key_free(key);
 
@@ -1202,9 +1205,6 @@ mm_answer_keyallowed(int sock, Buffer *m
 		free(chost);
 	}
 
-	debug3("%s: key %p is %s",
-	__func__, key, allowed ? "allowed" : "not allowed");
-
 	buffer_clear(m);
 	buffer_put_int(m, allowed);
 	buffer_put_int(m, forced_command != NULL);



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

2013-12-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Dec  3 20:51:00 UTC 2013

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

Log Message:
Remove the "evtchn_do_event: handler %p didn't lower ipl %d %d\n" printf.
With help from Robert Elz we've finally figured out what's going on, and
it actually isn't a bug in the handler, but related to spin mutexes.
When a spin mutex is released, the IPL isn't lowered back if the
curcpu is holding other spin mutexes. This is because mutexes may not
be released in order (and, in this case, the CPU in interrupted while
it holds a spin mutex at IPL < IPL_SCHED).
Also remove the test and resetting the IPL, it will be reset anyway
inside the loop, or at the end of the loop.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/xen/xen/evtchn.c

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

Modified files:

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.69 src/sys/arch/xen/xen/evtchn.c:1.70
--- src/sys/arch/xen/xen/evtchn.c:1.69	Sun Jan 13 21:01:05 2013
+++ src/sys/arch/xen/xen/evtchn.c	Tue Dec  3 20:51:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.69 2013/01/13 21:01:05 bouyer Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.70 2013/12/03 20:51:00 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.69 2013/01/13 21:01:05 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.70 2013/12/03 20:51:00 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -343,13 +343,6 @@ splx:
 	ih_fun = (void *)ih->ih_fun;
 	ih_fun(ih->ih_arg, regs);
 	cli();
-	if (ci->ci_ilevel != i) {
-		printf("evtchn_do_event: "
-		"handler %p didn't lower "
-		"ipl %d %d\n",
-		ih_fun, ci->ci_ilevel, i);
-		ci->ci_ilevel = i;
-	}
 }
 hypervisor_enable_ipl(i);
 /* more pending IPLs may have been registered */



CVS commit: src/external/bsd/llvm

2013-12-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec  3 22:42:55 UTC 2013

Modified Files:
src/external/bsd/llvm: Makefile

Log Message:
Split checkout target into two parts now that llvm and clang are
imported. Requested by matt@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/llvm/Makefile

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

Modified files:

Index: src/external/bsd/llvm/Makefile
diff -u src/external/bsd/llvm/Makefile:1.6 src/external/bsd/llvm/Makefile:1.7
--- src/external/bsd/llvm/Makefile:1.6	Thu Nov 28 14:19:59 2013
+++ src/external/bsd/llvm/Makefile	Tue Dec  3 22:42:55 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2013/11/28 14:19:59 joerg Exp $
+#	$NetBSD: Makefile,v 1.7 2013/12/03 22:42:55 joerg Exp $
 
 .include 
 
@@ -15,11 +15,13 @@ SUBDIR+=	librt
 .include "Makefile.inc"
 
 checkout:
-	svn co -r ${CLANG_REVISION} ${SVN_ROOT}/cfe/${SVN_BRANCH} ${CLANG_SRCDIR}
 	svn co -r ${COMPILER_RT_REVISION} ${SVN_ROOT}/compiler-rt/${SVN_BRANCH} \
 	${COMPILER_RT_SRCDIR}
 	svn co -r ${LLD_REVISION} ${SVN_ROOT}/lld/${SVN_BRANCH} ${LLD_SRCDIR}
 	svn co -r ${LLDB_REVISION} ${SVN_ROOT}/lldb/${SVN_BRANCH} ${LLDB_SRCDIR}
+
+checkout-imported:
+	svn co -r ${CLANG_REVISION} ${SVN_ROOT}/cfe/${SVN_BRANCH} ${CLANG_SRCDIR}
 	svn co -r ${LLVM_REVISION} ${SVN_ROOT}/llvm/${SVN_BRANCH} ${LLVM_SRCDIR}
 
 checkout-mclinker:



CVS commit: src/external/lgpl3/gmp/lib/libgmp

2013-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  4 00:49:19 UTC 2013

Modified Files:
src/external/lgpl3/gmp/lib/libgmp: Makefile
src/external/lgpl3/gmp/lib/libgmp/arch/alpha: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/arm: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/armeb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/coldfire: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/earm: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/earmeb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/earmhf: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/earmhfeb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/hppa: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/i386: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/ia64: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/m68000: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/m68k: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/mips64el: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/mipseb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/mipsel: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/powerpc: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/powerpc64: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/sh3eb: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/sh3el: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/sparc: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/sparc64: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/vax: Makefile.inc
src/external/lgpl3/gmp/lib/libgmp/arch/x86_64: Makefile.inc

Log Message:
consolidate the trialdivtab.h generation code.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/lgpl3/gmp/lib/libgmp/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/alpha/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/arm/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/armeb/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 \
src/external/lgpl3/gmp/lib/libgmp/arch/coldfire/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/earm/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 \
src/external/lgpl3/gmp/lib/libgmp/arch/earmeb/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 \
src/external/lgpl3/gmp/lib/libgmp/arch/earmhf/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 \
src/external/lgpl3/gmp/lib/libgmp/arch/earmhfeb/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/hppa/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 \
src/external/lgpl3/gmp/lib/libgmp/arch/i386/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/m68000/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 \
src/external/lgpl3/gmp/lib/libgmp/arch/m68k/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/mipseb/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/mipsel/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 \
src/external/lgpl3/gmp/lib/libgmp/arch/powerpc64/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/sh3eb/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/sh3el/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/sparc/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 \
src/external/lgpl3/gmp/lib/libgmp/arch/sparc64/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/vax/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/x86_64/Makefile.inc

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

Modified files:

Index: src/external/lgpl3/gmp/lib/libgmp/Makefile
diff -u src/external/lgpl3/gmp/lib/libgmp/Makefile:1.21 src/external/lgpl3/gmp/lib/libgmp/Makefile:1.22
--- src/external/lgpl3/gmp/lib/libgmp/Makefile:1.21	Sun Dec  1 09:29:37 2013
+++ src/external/lgpl3/gmp/lib/libgmp/Makefile	Wed Dec  4 00:49:17 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2013/12/01 09:29:37 martin Exp $
+#	$NetBSD: Makefile,v 1.22 2013/12/04 00:49:17 mrg Exp $
 
 .include 
 
@@ -147,11 +147,13 @@ CLEANFILES+=	${_dir}_${_srcfile}
 
 .endfor
 
-CPPFLAGS+=	-I. -I${DIST} -I${.CURDIR}/arch/${GMP_MACHINE_ARCH} -D__GMP_WITHIN_GMP -DHAVE_CO

CVS commit: src/external/lgpl3/gmp/lib/libgmp

2013-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  4 00:57:21 UTC 2013

Modified Files:
src/external/lgpl3/gmp/lib/libgmp: Makefile

Log Message:
make trialdivtab.h depend on the Makefile.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/lgpl3/gmp/lib/libgmp/Makefile

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

Modified files:

Index: src/external/lgpl3/gmp/lib/libgmp/Makefile
diff -u src/external/lgpl3/gmp/lib/libgmp/Makefile:1.22 src/external/lgpl3/gmp/lib/libgmp/Makefile:1.23
--- src/external/lgpl3/gmp/lib/libgmp/Makefile:1.22	Wed Dec  4 00:49:17 2013
+++ src/external/lgpl3/gmp/lib/libgmp/Makefile	Wed Dec  4 00:57:21 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2013/12/04 00:49:17 mrg Exp $
+#	$NetBSD: Makefile,v 1.23 2013/12/04 00:57:21 mrg Exp $
 
 .include 
 
@@ -193,7 +193,7 @@ gen-trialdivtab: gen-trialdivtab.c
 	${HOST_CC} -o ${.OBJDIR}/gen-trialdivtab ${.ALLSRC} -lm
 
 trialdiv.c: trialdivtab.h
-trialdivtab.h: gen-trialdivtab
+trialdivtab.h: gen-trialdivtab Makefile
 	${.OBJDIR}/gen-trialdivtab $(GMP_LIMB_BITS) 8000 > ${.OBJDIR}/trialdivtab.h
 
 CLEANFILES+=	${DPSRCS} gen-fac gen-fib gen-bases gen-jacobitab \



CVS commit: src/external/lgpl3/gmp

2013-12-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  4 01:03:15 UTC 2013

Modified Files:
src/external/lgpl3/gmp: README
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb: gmp-mparam.h gmp.h
src/external/lgpl3/gmp/lib/libgmp/arch/mips64el: gmp-mparam.h gmp.h

Log Message:
repply the hacks from rev 1.2 to the gmp*.h files, and
make a note about it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/lgpl3/gmp/README
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h

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

Modified files:

Index: src/external/lgpl3/gmp/README
diff -u src/external/lgpl3/gmp/README:1.4 src/external/lgpl3/gmp/README:1.5
--- src/external/lgpl3/gmp/README:1.4	Mon Jul 15 08:59:47 2013
+++ src/external/lgpl3/gmp/README	Wed Dec  4 01:03:15 2013
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.4 2013/07/15 08:59:47 mrg Exp $
+$NetBSD: README,v 1.5 2013/12/04 01:03:15 mrg Exp $
 
 GMP in NetBSD.  We need GMP for GCC >= 4.2.
 
@@ -44,6 +44,11 @@ There are a few steps to this:
 The amd64 port is a good reference to compare.  The trialdivtab.h
 generation may need to be moved the into libgmp/Makefile itself.
 
+This mips64* ports need some minor hacks to the generated gmp*.h
+files to fix their library builds for compat issues.  See these
+files in:
+	http://mail-index.netbsd.org/source-changes/2011/07/10/msg024467.html
+
 
 This is still a work in progress and methods used to build may be
 changed at any time.

Index: src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h
diff -u src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h:1.3 src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h:1.4
--- src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h:1.3	Fri Nov 29 08:03:42 2013
+++ src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp-mparam.h	Wed Dec  4 01:03:15 2013
@@ -19,8 +19,13 @@ You should have received a copy of the G
 with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
 
 
+#ifdef _ABI64
 #define GMP_LIMB_BITS 64
 #define BYTES_PER_MP_LIMB 8
+#else
+#define GMP_LIMB_BITS 32
+#define BYTES_PER_MP_LIMB 4
+#endif
 
 
 /* Generated by tuneup.c, 2004-02-10, gcc 3.2 & MIPSpro C 7.2.1 (R1x000) */

Index: src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h
diff -u src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h:1.4 src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h:1.5
--- src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h:1.4	Fri Nov 29 08:03:42 2013
+++ src/external/lgpl3/gmp/lib/libgmp/arch/mips64eb/gmp.h	Wed Dec  4 01:03:15 2013
@@ -31,7 +31,11 @@ along with the GNU MP Library.  If not, 
 #if ! defined (__GMP_WITHIN_CONFIGURE)
 #define __GMP_HAVE_HOST_CPU_FAMILY_power   0
 #define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0
+#ifdef _ABI64
 #define GMP_LIMB_BITS  64
+#else
+#define GMP_LIMB_BITS  32
+#endif
 #define GMP_NAIL_BITS  0
 #endif
 #define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS)
@@ -56,7 +60,9 @@ along with the GNU MP Library.  If not, 
 
 /* Instantiated by configure. */
 #if ! defined (__GMP_WITHIN_CONFIGURE)
+#ifdef _LP64
 #define _LONG_LONG_LIMB 1
+#endif
 #define __GMP_LIBGMP_DLL  0
 #endif
 

Index: src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h
diff -u src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h:1.3 src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h:1.4
--- src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h:1.3	Fri Nov 29 08:10:04 2013
+++ src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp-mparam.h	Wed Dec  4 01:03:15 2013
@@ -19,8 +19,13 @@ You should have received a copy of the G
 with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
 
 
+#ifdef _ABI64
 #define GMP_LIMB_BITS 64
 #define BYTES_PER_MP_LIMB 8
+#else
+#define GMP_LIMB_BITS 32
+#define BYTES_PER_MP_LIMB 4
+#endif
 
 
 /* Generated by tuneup.c, 2004-02-10, gcc 3.2 & MIPSpro C 7.2.1 (R1x000) */

Index: src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h
diff -u src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h:1.5 src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h:1.6
--- src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h:1.5	Fri Nov 29 13:26:16 2013
+++ src/external/lgpl3/gmp/lib/libgmp/arch/mips64el/gmp.h	Wed Dec  4 01:03:15 2013
@@ -31,7 +31,11 @@ along with the GNU MP Library.  If not, 
 #if ! defined (__GMP_WITHIN_CONFIGURE)
 #define __GMP_HAVE_HOST_CPU_FAMILY_power   0
 #define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0
+#ifdef _ABI64
 #define GMP_LIMB_BITS  64
+#else
+#define GMP_LIMB_

CVS commit: src/sys/net/npf

2013-12-03 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Dec  4 01:38:49 UTC 2013

Modified Files:
src/sys/net/npf: npf_impl.h npf_nat.c npf_ruleset.c npf_session.c

Log Message:
- npf_do_nat: fix a race condition and simplify the logic.
- npf_session_setnat: clear the NAT association on failure.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.21 -r1.22 src/sys/net/npf/npf_nat.c
cvs rdiff -u -r1.29 -r1.30 src/sys/net/npf/npf_ruleset.c
cvs rdiff -u -r1.28 -r1.29 src/sys/net/npf/npf_session.c

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

Modified files:

Index: src/sys/net/npf/npf_impl.h
diff -u src/sys/net/npf/npf_impl.h:1.43 src/sys/net/npf/npf_impl.h:1.44
--- src/sys/net/npf/npf_impl.h:1.43	Sat Nov 23 19:32:20 2013
+++ src/sys/net/npf/npf_impl.h	Wed Dec  4 01:38:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_impl.h,v 1.43 2013/11/23 19:32:20 rmind Exp $	*/
+/*	$NetBSD: npf_impl.h,v 1.44 2013/12/04 01:38:49 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -267,7 +267,7 @@ void		npf_rule_free(npf_rule_t *);
 uint64_t	npf_rule_getid(const npf_rule_t *);
 npf_natpolicy_t *npf_rule_getnat(const npf_rule_t *);
 void		npf_rule_setnat(npf_rule_t *, npf_natpolicy_t *);
-npf_rproc_t *	npf_rule_getrproc(npf_rule_t *);
+npf_rproc_t *	npf_rule_getrproc(const npf_rule_t *);
 
 void		npf_ext_sysinit(void);
 void		npf_ext_sysfini(void);
@@ -329,7 +329,7 @@ void		npf_nat_freealg(npf_natpolicy_t *,
 int		npf_do_nat(npf_cache_t *, npf_session_t *, nbuf_t *, const int);
 int		npf_nat_translate(npf_cache_t *, nbuf_t *, npf_nat_t *,
 		const bool, const int);
-void		npf_nat_expire(npf_nat_t *);
+void		npf_nat_destroy(npf_nat_t *);
 void		npf_nat_getorig(npf_nat_t *, npf_addr_t **, in_port_t *);
 void		npf_nat_gettrans(npf_nat_t *, npf_addr_t **, in_port_t *);
 void		npf_nat_setalg(npf_nat_t *, npf_alg_t *, uintptr_t);

Index: src/sys/net/npf/npf_nat.c
diff -u src/sys/net/npf/npf_nat.c:1.21 src/sys/net/npf/npf_nat.c:1.22
--- src/sys/net/npf/npf_nat.c:1.21	Tue Oct 29 16:39:10 2013
+++ src/sys/net/npf/npf_nat.c	Wed Dec  4 01:38:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_nat.c,v 1.21 2013/10/29 16:39:10 rmind Exp $	*/
+/*	$NetBSD: npf_nat.c,v 1.22 2013/12/04 01:38:49 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010-2013 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.21 2013/10/29 16:39:10 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_nat.c,v 1.22 2013/12/04 01:38:49 rmind Exp $");
 
 #include 
 #include 
@@ -246,13 +246,14 @@ npf_nat_freepolicy(npf_natpolicy_t *np)
 	npf_session_t *se;
 	npf_nat_t *nt;
 
-	/* De-associate all entries from the policy. */
+	/*
+	 * Disassociate all entries from the policy.  At this point,
+	 * new entries can no longer be created for this policy.
+	 */
 	mutex_enter(&np->n_lock);
 	LIST_FOREACH(nt, &np->n_nat_list, nt_entry) {
-		se = nt->nt_session; /* XXXSMP */
-		if (se == NULL) {
-			continue;
-		}
+		se = nt->nt_session;
+		KASSERT(se != NULL);
 		npf_session_expire(se);
 	}
 	while (!LIST_EMPTY(&np->n_nat_list)) {
@@ -265,6 +266,7 @@ npf_nat_freepolicy(npf_natpolicy_t *np)
 	while (np->n_refcnt) {
 		kpause("npfgcnat", false, 1, NULL);
 	}
+	KASSERT(LIST_EMPTY(&np->n_nat_list));
 
 	/* Destroy the port map, on last reference. */
 	if (pm && --pm->p_refcnt == 0) {
@@ -449,7 +451,7 @@ npf_nat_inspect(npf_cache_t *npc, nbuf_t
  * npf_nat_create: create a new NAT translation entry.
  */
 static npf_nat_t *
-npf_nat_create(npf_cache_t *npc, npf_natpolicy_t *np)
+npf_nat_create(npf_cache_t *npc, npf_natpolicy_t *np, npf_session_t *se)
 {
 	const int proto = npc->npc_proto;
 	npf_nat_t *nt;
@@ -457,14 +459,14 @@ npf_nat_create(npf_cache_t *npc, npf_nat
 	KASSERT(npf_iscached(npc, NPC_IP46));
 	KASSERT(npf_iscached(npc, NPC_LAYER4));
 
-	/* New NAT association. */
+	/* Construct a new NAT entry and associate it with the session. */
 	nt = pool_cache_get(nat_cache, PR_NOWAIT);
 	if (nt == NULL){
 		return NULL;
 	}
 	npf_stats_inc(NPF_STAT_NAT_CREATE);
 	nt->nt_natpolicy = np;
-	nt->nt_session = NULL;
+	nt->nt_session = se;
 	nt->nt_alg = NULL;
 
 	/* Save the original address which may be rewritten. */
@@ -604,7 +606,7 @@ npf_do_nat(npf_cache_t *npc, npf_session
 	npf_natpolicy_t *np;
 	npf_nat_t *nt;
 	int error;
-	bool forw, new;
+	bool forw;
 
 	/* All relevant IPv4 data should be already cached. */
 	if (!npf_iscached(npc, NPC_IP46) || !npf_iscached(npc, NPC_LAYER4)) {
@@ -619,7 +621,6 @@ npf_do_nat(npf_cache_t *npc, npf_session
 	 */
 	if (se && (nt = npf_session_retnat(se, di, &forw)) != NULL) {
 		np = nt->nt_natpolicy;
-		new = false;
 		goto translate;
 	}
 
@@ -635,22 +636,6 @@ npf_do_nat(npf_cache_t *npc, npf_session
 	forw = true;
 
 	/*
-	 * Create a new NAT entry (not yet associated with any session).
-	 * We will consume the reference on success (release on error).

CVS commit: src/sys/modules/lua

2013-12-03 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Wed Dec  4 02:12:01 UTC 2013

Modified Files:
src/sys/modules/lua: lua.c

Log Message:
fixed lua(4) alloc (nsize can be lesser than osize)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.5 src/sys/modules/lua/lua.c:1.6
--- src/sys/modules/lua/lua.c:1.5	Sat Nov 23 15:53:37 2013
+++ src/sys/modules/lua/lua.c	Wed Dec  4 02:12:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.5 2013/11/23 15:53:37 mbalmer Exp $ */
+/*	$NetBSD: lua.c,v 1.6 2013/12/04 02:12:01 lneto Exp $ */
 
 /*
  * Copyright (c) 2011, 2013 by Marc Balmer .
@@ -515,7 +515,7 @@ lua_alloc(void *ud, void *ptr, size_t os
 	} else {
 		nptr = kmem_alloc(nsize, KM_SLEEP);
 		if (ptr != NULL) {
-			memcpy(nptr, ptr, osize);
+			memcpy(nptr, ptr, osize < nsize ? osize : nsize);
 			kmem_free(ptr, osize);
 		}
 	}



CVS commit: src/sys/dev/ic

2013-12-03 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Wed Dec  4 07:48:59 UTC 2013

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

Log Message:
Fix RTC going backwards a year when saving time, because dt_mon != dt_year.

Patch by Roc Valles.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/msm6242b.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/msm6242b.c
diff -u src/sys/dev/ic/msm6242b.c:1.2 src/sys/dev/ic/msm6242b.c:1.3
--- src/sys/dev/ic/msm6242b.c:1.2	Wed Nov 14 17:15:25 2012
+++ src/sys/dev/ic/msm6242b.c	Wed Dec  4 07:48:59 2013
@@ -1,4 +1,4 @@
-/*  $NetBSD: msm6242b.c,v 1.2 2012/11/14 17:15:25 rkujawa Exp $ */
+/*  $NetBSD: msm6242b.c,v 1.3 2013/12/04 07:48:59 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msm6242b.c,v 1.2 2012/11/14 17:15:25 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msm6242b.c,v 1.3 2013/12/04 07:48:59 rkujawa Exp $");
 
 /* 
  * Driver for OKI MSM6242B Real Time Clock. Somewhat based on an ancient, amiga
@@ -243,8 +243,8 @@ msm6242b_settime_ymdhms(todr_chip_handle
 	msm6242b_write(sc, MSM6242B_1DAY, dt->dt_day % 10);
 	msm6242b_write(sc, MSM6242B_10MONTH, dt->dt_mon / 10);
 	msm6242b_write(sc, MSM6242B_1MONTH, dt->dt_mon % 10);
-	msm6242b_write(sc, MSM6242B_10YEAR, (dt->dt_mon / 10) % 10);
-	msm6242b_write(sc, MSM6242B_1YEAR, dt->dt_mon % 10);
+	msm6242b_write(sc, MSM6242B_10YEAR, (dt->dt_year / 10) % 10);
+	msm6242b_write(sc, MSM6242B_1YEAR, dt->dt_year % 10);
 	msm6242b_write(sc, MSM6242B_WEEK, dt->dt_wday);
 
 	msm6242b_free(sc);