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

2018-09-19 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Sep 20 05:08:45 UTC 2018

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

Log Message:
When we removed the XEN special case from isa/isa_machdep.c
there was a corner case that was missed in
x86/intr.c:intr_establish_xname()

In isa_machdep.c:isa_intr_establish_xname() the legacy_irq parameter
is never set to -1. It is also incorrect to call
isa_intr_establish_xname() with a legacy_irq parameter of -1.

Thus we infer that whenever we see (legacy_irq == -1) in
intr_establish_xname() which is downstream, we were *NOT* called from
isa_machdep.c:isa_intr_establish_xname()

Given that there are no other users of intr_establish_xnam() which
pass a valid legacy_irq != -1, we assume therefore that we *WERE*
called from isa_machdep.c:isa_intr_establish_xname() in this case.

This is an important distinction in the case where a valid
legacy_irq > NUM_LEGACY_IRQS was passed down from
isa_intr_establish_xname() but was ignored by xen_pirq_alloc() and
overwritten with the "pseudo" irq which is then passed back. We thus
pass the incorrect "legacy" irq value to pirq_establish().

Even though non ISA (ie; PCI and MSI(X) cases), this is the correct
behaviour, we need to maintain (bug?) compatibility with the isa
case.

Thus the one liner diff.

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.129 src/sys/arch/x86/x86/intr.c:1.130
--- src/sys/arch/x86/x86/intr.c:1.129	Fri Sep 14 01:50:51 2018
+++ src/sys/arch/x86/x86/intr.c	Thu Sep 20 05:08:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.129 2018/09/14 01:50:51 mrg Exp $	*/
+/*	$NetBSD: intr.c,v 1.130 2018/09/20 05:08:45 cherry Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.129 2018/09/14 01:50:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.130 2018/09/20 05:08:45 cherry Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1291,6 +1291,7 @@ intr_establish_xname(int legacy_irq, str
 	sizeof(intrstr_buf));
 
 	evtchn = xen_pirq_alloc(, type);
+	irq = (legacy_irq == -1) ? irq : legacy_irq; /* ISA compat */	
 	pih = pirq_establish(irq & 0xff, evtchn, handler, arg, level,
 	intrstr, xname);
 	pih->pic_type = pic->pic_type;



CVS commit: src/compat

2018-09-19 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Sep 20 02:51:21 UTC 2018

Modified Files:
src/compat: exec.mk

Log Message:
don't build kernel grovelling tools as n64 on sgimips - we don't actually have
n64 kernels there. Yet.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/compat/exec.mk

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

Modified files:

Index: src/compat/exec.mk
diff -u src/compat/exec.mk:1.3 src/compat/exec.mk:1.4
--- src/compat/exec.mk:1.3	Thu Jan  5 21:28:42 2017
+++ src/compat/exec.mk	Thu Sep 20 02:51:21 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: exec.mk,v 1.3 2017/01/05 21:28:42 skrll Exp $
+#	$NetBSD: exec.mk,v 1.4 2018/09/20 02:51:21 macallan Exp $
 
 # this makefile fragment can be included to modify the default
 # ABI a program is compiled with.  this is designed to be used
@@ -27,7 +27,7 @@
 # mips64 defaults to 32 bit userland, but with a 64 bit kernel
 # most kvm-using tools are happier with 64 bit.
 
-.if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
+.if ${MACHINE_ARCH} == "mips64el" || (${MACHINE_ARCH} == "mips64eb" && ${MACHINE} != "sgimips")
 
 # XXX -pie makes n64 crash
 NOPIE=1



CVS commit: src/sbin/dmesg

2018-09-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Sep 20 01:11:20 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.8

Log Message:
Remove a comma and some trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/dmesg/dmesg.8

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

Modified files:

Index: src/sbin/dmesg/dmesg.8
diff -u src/sbin/dmesg/dmesg.8:1.23 src/sbin/dmesg/dmesg.8:1.24
--- src/sbin/dmesg/dmesg.8:1.23	Wed Sep 19 23:02:14 2018
+++ src/sbin/dmesg/dmesg.8	Thu Sep 20 01:11:19 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dmesg.8,v 1.23 2018/09/19 23:02:14 christos Exp $
+.\"	$NetBSD: dmesg.8,v 1.24 2018/09/20 01:11:19 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -61,7 +61,7 @@ Extract the name list from the specified
 Format uptime timestamps in a human readable form (using
 .Xr ctime 3 )
 using output suitable for the local locale as set in the environment.
-Repeating this option, prints the uptime in ISO 8601 duration form,
+Repeating this option prints the uptime in ISO 8601 duration form,
 giving the duration since boot, in hours, minutes, and seconds (to
 millisecond resolution).
 A third occurrence causes the duration to always be represented
@@ -98,7 +98,7 @@ The
 command appeared in
 .Bx 3.0 .
 .Sh BUGS
-When 
+When
 .Fl TT
 is used, the duration is always given with maximum units of hours,
 even when the number or hours is in the hundreds, or thousands, or more.



CVS commit: src/sys/arch/atari/dev

2018-09-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 19 23:28:58 UTC 2018

Modified Files:
src/sys/arch/atari/dev: wskbdmap_atari.c

Log Message:
Remove unused KBD_NULLMAP entries copy-paste from sys/dev/pckbport.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/atari/dev/wskbdmap_atari.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/atari/dev/wskbdmap_atari.c
diff -u src/sys/arch/atari/dev/wskbdmap_atari.c:1.4 src/sys/arch/atari/dev/wskbdmap_atari.c:1.5
--- src/sys/arch/atari/dev/wskbdmap_atari.c:1.4	Mon Apr 28 20:23:15 2008
+++ src/sys/arch/atari/dev/wskbdmap_atari.c	Wed Sep 19 23:28:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: wskbdmap_atari.c,v 1.4 2008/04/28 20:23:15 martin Exp $	*/
+/*	$NetBSD: wskbdmap_atari.c,v 1.5 2018/09/19 23:28:58 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wskbdmap_atari.c,v 1.4 2008/04/28 20:23:15 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbdmap_atari.c,v 1.5 2018/09/19 23:28:58 rin Exp $");
 
 #include 
 #include 
@@ -461,9 +461,6 @@ static const keysym_t atarikbd_keydesc_i
 
 #define KBD_MAP(name, base, map) \
 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
-/* KBD_NULLMAP generates a entry for machine native variant.
-   the entry will be modified by machine dependent keyboard driver. */
-#define KBD_NULLMAP(name, base) { name, base, 0, 0 }
 
 const struct wscons_keydesc atarikbd_keydesctab[] = {
 	KBD_MAP(KB_US,			0,	atarikbd_keydesc_us),
@@ -490,12 +487,6 @@ const struct wscons_keydesc atarikbd_key
 	KBD_MAP(KB_US | KB_IOPENER | KB_SWAPCTRLCAPS,	KB_US | KB_IOPENER,
 		atarikbd_keydesc_swapctrlcaps),
 	KBD_MAP(KB_ES ,			KB_US,	atarikbd_keydesc_es),
-	KBD_NULLMAP(KB_US | KB_MACHDEP,	KB_US),
-	KBD_NULLMAP(KB_JP | KB_MACHDEP,	KB_JP),
-	KBD_NULLMAP(KB_US | KB_MACHDEP | KB_SWAPCTRLCAPS,
-		KB_US | KB_SWAPCTRLCAPS),
-	KBD_NULLMAP(KB_JP | KB_MACHDEP | KB_SWAPCTRLCAPS,
-		KB_JP | KB_SWAPCTRLCAPS),
 	{0, 0, 0, 0}
 };
 



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

2018-09-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 19 23:22:17 UTC 2018

Modified Files:
src/sys/arch/evbmips/conf: GDIUM LOONGSON

Log Message:
Remove invalid option copy-paste from hpcmips.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/conf/GDIUM
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbmips/conf/LOONGSON

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/evbmips/conf/GDIUM
diff -u src/sys/arch/evbmips/conf/GDIUM:1.32 src/sys/arch/evbmips/conf/GDIUM:1.33
--- src/sys/arch/evbmips/conf/GDIUM:1.32	Wed Aug  1 20:04:11 2018
+++ src/sys/arch/evbmips/conf/GDIUM	Wed Sep 19 23:22:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GDIUM,v 1.32 2018/08/01 20:04:11 maxv Exp $
+# $NetBSD: GDIUM,v 1.33 2018/09/19 23:22:17 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/evbmips/conf/std.gdium"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GDIUM-$Revision: 1.32 $"
+#ident 		"GDIUM-$Revision: 1.33 $"
 
 maxusers	16
 
@@ -136,11 +136,6 @@ options 	WSDISPLAY_COMPAT_USL		# wsconsc
 options 	FONT_GALLANT12x22
 # compatibility to other console drivers
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
-#
-# Hpckbd will set key board layout appropriately. You can use option
-# 'PCKBD_LAYOUT' to overrite the default layout.
-#
-#options 	PCKBD_LAYOUT="(KB_US | KB_SWAPCTRLCAPS | KB_MACHDEP)"
 
 mainbus0	at root
 cpu0		at mainbus0

Index: src/sys/arch/evbmips/conf/LOONGSON
diff -u src/sys/arch/evbmips/conf/LOONGSON:1.39 src/sys/arch/evbmips/conf/LOONGSON:1.40
--- src/sys/arch/evbmips/conf/LOONGSON:1.39	Wed Aug  1 20:04:11 2018
+++ src/sys/arch/evbmips/conf/LOONGSON	Wed Sep 19 23:22:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: LOONGSON,v 1.39 2018/08/01 20:04:11 maxv Exp $
+# $NetBSD: LOONGSON,v 1.40 2018/09/19 23:22:17 rin Exp $
 #
 # LOONGSON machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/evbmips/conf/std.loongson
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"LOONGSON-$Revision: 1.39 $"
+#ident 		"LOONGSON-$Revision: 1.40 $"
 
 maxusers	16
 
@@ -150,11 +150,6 @@ options 	FONT_GALLANT12x22
 options 	FONT_BOLD8x16
 # compatibility to other console drivers
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
-#
-# Hpckbd will set key board layout appropriately. You can use option
-# 'PCKBD_LAYOUT' to overrite the default layout.
-#
-#options 	PCKBD_LAYOUT="(KB_US | KB_SWAPCTRLCAPS | KB_MACHDEP)"
 
 mainbus0	at root
 cpu0		at mainbus0



CVS commit: src/sbin/dmesg

2018-09-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 19 23:02:14 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.8 dmesg.c

Log Message:
changes from kre@
- pass intmax to fmtydhmsf instead of time_t to avoid extra conversions.
- make -TTT mean "always keep 3 decimal digits of duration precision" (ie:
  always print ms)  (including trailing 0's, even .000 if it happens)
- make -T (all forms) be subject to the locale (obey the radix character)
- don't print ymd, since that would require calendar calculations to get
  right.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/dmesg/dmesg.8
cvs rdiff -u -r1.36 -r1.37 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.8
diff -u src/sbin/dmesg/dmesg.8:1.22 src/sbin/dmesg/dmesg.8:1.23
--- src/sbin/dmesg/dmesg.8:1.22	Tue Sep 18 20:15:05 2018
+++ src/sbin/dmesg/dmesg.8	Wed Sep 19 19:02:14 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dmesg.8,v 1.22 2018/09/19 00:15:05 christos Exp $
+.\"	$NetBSD: dmesg.8,v 1.23 2018/09/19 23:02:14 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -58,9 +58,15 @@ instead of the default ``/dev/mem''.
 Extract the name list from the specified system instead of the default
 ``/netbsd''.
 .It Fl T
-Format uptime timestamps in a human readable form.  (using
-.Xr ctime 3 ) .
-Repeating this option, prints the uptime in ISO 8601 duration form.
+Format uptime timestamps in a human readable form (using
+.Xr ctime 3 )
+using output suitable for the local locale as set in the environment.
+Repeating this option, prints the uptime in ISO 8601 duration form,
+giving the duration since boot, in hours, minutes, and seconds (to
+millisecond resolution).
+A third occurrence causes the duration to always be represented
+to millisecond precision, even where that means trailing zeroes
+appear.
 .It Fl t
 Quiet printing, don't print timestamps.
 .El
@@ -91,3 +97,20 @@ The
 .Nm
 command appeared in
 .Bx 3.0 .
+.Sh BUGS
+When 
+.Fl TT
+is used, the duration is always given with maximum units of hours,
+even when the number or hours is in the hundreds, or thousands, or more.
+This is because converting hours to days, over periods when
+.Dq time skips
+occur, such as summer time beginning or ending, is not trivial.
+A duration of 26 hours might be 1D3H or 1D1H at such events,
+rather than the usual 1D2H,
+and when a time zone alters its offset,
+even more complex calculations are needed.
+None of those calculations are done
+.Pq even to account for sub-hour time zone shifts ,
+the duration indicated is always calculated by simple division of
+seconds by 60 to produce minutes, and again to produce hours.
+Most of the time\ [!] this is correct.

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.36 src/sbin/dmesg/dmesg.c:1.37
--- src/sbin/dmesg/dmesg.c:1.36	Wed Sep 19 18:58:03 2018
+++ src/sbin/dmesg/dmesg.c	Wed Sep 19 19:02:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.36 2018/09/19 22:58:03 kre Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.37 2018/09/19 23:02:14 christos Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.36 2018/09/19 22:58:03 kre Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.37 2018/09/19 23:02:14 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -59,12 +59,17 @@ __RCSID("$NetBSD: dmesg.c,v 1.36 2018/09
 #include 
 
 #ifndef SMALL
+#include 
+#include 
+
 static struct nlist nl[] = {
 #define	X_MSGBUF	0
 	{ .n_name = "_msgbufp" },
 	{ .n_name = NULL },
 };
 
+static const char *radix;
+
 __dead static void	usage(void);
 
 #define	KREAD(addr, var) \
@@ -73,7 +78,10 @@ __dead static void	usage(void);
 static const char *
 fmtydhmsf(char *b, size_t l, intmax_t t, long nsec, int ht)
 {
-	intmax_t s, m, h, d, M, y;
+	intmax_t s, m, h
+#if 0
+			, d, M, y
+#endif
 	int z;
 	int prec;
 	size_t o;
@@ -84,6 +92,17 @@ fmtydhmsf(char *b, size_t l, intmax_t t,
 	m = t % 60;
 	t /= 60;
 
+#if 0
+	/*
+	 * This is wrong for 2 reasons, first, months do not all
+	 * have 30 days (and yes, it matters, I think) and because when
+	 * summer time begins(ends) "1 day" is 23 (25) hours, not 24.
+	 *
+	 * We would need to convert to localtime, before and after,
+	 * and subtract in localtime format, then normalise, to produce
+	 * a meaningfuly yYmMdD string to use here.   So just stick to
+	 * a count of hours.  It is legit, and easy...
+	 */
 	h = t % 24;
 	t /= 24;
 
@@ -94,6 +113,9 @@ fmtydhmsf(char *b, size_t l, intmax_t t,
 	t /= 12;
 
 	y = t;
+#else
+	h = t;
+#endif
 
 	z = 0;
 	o = 0;
@@ -117,9 +139,11 @@ fmtydhmsf(char *b, size_t l, intmax_t t,
 	toupper((unsigned char)__STRING(a)[0]))
 

CVS commit: src/sbin/dmesg

2018-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 19 22:58:03 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Allow a third use of -T to force .NNN (always three digits) in -TT
(ISO8601 durations) format for timestamps - that is,not dropping trailing 0's.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.35 src/sbin/dmesg/dmesg.c:1.36
--- src/sbin/dmesg/dmesg.c:1.35	Wed Sep 19 22:55:12 2018
+++ src/sbin/dmesg/dmesg.c	Wed Sep 19 22:58:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.35 2018/09/19 22:55:12 kre Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.36 2018/09/19 22:58:03 kre Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.35 2018/09/19 22:55:12 kre Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.36 2018/09/19 22:58:03 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,7 +71,7 @@ __dead static void	usage(void);
 	kvm_read(kd, addr, , sizeof(var)) != sizeof(var)
 
 static const char *
-fmtydhmsf(char *b, size_t l, intmax_t t, long nsec)
+fmtydhmsf(char *b, size_t l, intmax_t t, long nsec, int ht)
 {
 	intmax_t s, m, h, d, M, y;
 	int z;
@@ -126,9 +126,11 @@ fmtydhmsf(char *b, size_t l, intmax_t t,
 	if (nsec)
 		nsec = (nsec + 50) / 100;	/* now milliseconds */
 	prec = 3;
-	while (prec > 0 && (nsec % 10) == 0)
-		--prec, nsec /= 10;
-	if (nsec)
+	if (nsec && ht == 2) {
+		while (prec > 0 && (nsec % 10) == 0)
+			--prec, nsec /= 10;
+	}
+	if (nsec || ht > 2)
 		APPENDS(s, prec, nsec);
 	else
 		APPEND(s);
@@ -345,7 +347,7 @@ main(int argc, char *argv[])
 	}
 } else if (humantime > 1) {
 	const char *fp = fmtydhmsf(tbuf,
-	sizeof(tbuf), sec, fsec);
+	sizeof(tbuf), sec, fsec, humantime);
 	if (fp) {
 		printf("%s", fp);
 	}



CVS commit: src/sbin/dmesg

2018-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Sep 19 22:55:12 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
In -TT mode (ISO8601 duration timestamps) print milliseconds as
decimal fractions of a second (as they should be) rather than integer
milliseconds (ie nnn.1means nnn seconds and 1/10 of a second, not
nnn seconds, and 1 millisecond).   While here convert some inappropriate
time_t usage to intmax_t which works better (int, or long, would probably
work just as well).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.34 src/sbin/dmesg/dmesg.c:1.35
--- src/sbin/dmesg/dmesg.c:1.34	Wed Sep 19 00:15:05 2018
+++ src/sbin/dmesg/dmesg.c	Wed Sep 19 22:55:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.34 2018/09/19 00:15:05 christos Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.35 2018/09/19 22:55:12 kre Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.34 2018/09/19 00:15:05 christos Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.35 2018/09/19 22:55:12 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,10 +71,11 @@ __dead static void	usage(void);
 	kvm_read(kd, addr, , sizeof(var)) != sizeof(var)
 
 static const char *
-fmtydhmsf(char *b, size_t l, time_t t, long nsec)
+fmtydhmsf(char *b, size_t l, intmax_t t, long nsec)
 {
-	time_t s, m, h, d, M, y;
+	intmax_t s, m, h, d, M, y;
 	int z;
+	int prec;
 	size_t o;
 
 	s = t % 60;
@@ -109,10 +110,10 @@ fmtydhmsf(char *b, size_t l, time_t t, l
 
 #define APPEND(a) \
 do if (a) \
-APPENDFMT("%jd%c", (intmax_t)a, toupper((unsigned char)__STRING(a)[0])); \
+APPENDFMT("%jd%c", a, toupper((unsigned char)__STRING(a)[0])); \
 while (/*CONSTCOND*/0)
-#define APPENDS(a, s) \
-APPENDFMT("%jd.%ld%c", (intmax_t)a, s, \
+#define APPENDS(a, pr, ms) \
+APPENDFMT("%jd%s%.*ld%c", a, radix, pr, ms, \
 	toupper((unsigned char)__STRING(a)[0]))
 
 	APPENDFMT("%s", "P");
@@ -123,9 +124,12 @@ fmtydhmsf(char *b, size_t l, time_t t, l
 	APPEND(h);
 	APPEND(m);
 	if (nsec)
-		nsec = nsec / 100;
+		nsec = (nsec + 50) / 100;	/* now milliseconds */
+	prec = 3;
+	while (prec > 0 && (nsec % 10) == 0)
+		--prec, nsec /= 10;
 	if (nsec)
-		APPENDS(s, nsec);
+		APPENDS(s, prec, nsec);
 	else
 		APPEND(s);
 	return b;



CVS commit: src/share/misc

2018-09-19 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Sep 19 18:53:25 UTC 2018

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

Log Message:
Add AMDD, ASF, MSC, RMCP, SAML, STOMP, and YAML
Hyphenate TDD description (grammar)


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

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.214 src/share/misc/acronyms.comp:1.215
--- src/share/misc/acronyms.comp:1.214	Mon Aug 13 22:22:59 2018
+++ src/share/misc/acronyms.comp	Wed Sep 19 18:53:25 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.214 2018/08/13 22:22:59 alnsn Exp $
+$NetBSD: acronyms.comp,v 1.215 2018/09/19 18:53:25 ginsbach Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -45,6 +45,7 @@ AM	access method
 AM	alignment mask
 AM	amplitude modulation
 AMD	Advanced Micro Devices Inc
+AMDD	Agile model-driven development
 AMI	alternate mark inversion
 AMP	asymmetric multiprocessing
 AMQP	advanced message queuing protocol
@@ -83,6 +84,7 @@ ASC	advanced smart cache
 ASCII	American Standard Code for Information Interchange
 ASD	agile software development
 ASE	advanced software environment
+ASF	alert standard format
 ASIC	application-specific integrated circuit
 ASK	amplitude shift keying
 ASLR	address space layout randomization
@@ -770,6 +772,7 @@ LSB	Linux standards base
 LSB	least significant {bit,byte}
 LSI	large scale integration
 LSL	load segment limit
+LSM	log structured merge
 LSN	Large Scale NAT
 LSN	log sequence number
 LSR	label switch router
@@ -871,6 +874,7 @@ MRU	most recently used
 MS	Microsoft
 MSAN	Memory Sanitizer
 MSB	most significant {bit,byte}
+MSC	message sequence chart
 MSE	mean square error
 MSF	minutes seconds frames
 MSI	message signaled interrupt
@@ -1169,6 +1173,7 @@ RLE	run length encoding
 RLL	run length limited
 RLO	right-to-left override
 RM	read miss
+RMCP	Remote Management Control Protocol
 RMI	remote method invocation
 RMO	Relaxed Memory Ordering
 RMPM	rapid memory power management
@@ -1216,6 +1221,7 @@ SAD	security association database
 SAL	{service,system} abstraction layer
 SAM	serial access memory
 SAM	sum addressed memory
+SAML	security assertion markup language
 SAN	storage area network
 SAP	service access point
 SAPIC	streamlined advanced programmable interrupt controller
@@ -1341,6 +1347,7 @@ SSL	secure sockets layer
 SSP	stack smashing protection
 STC	software thermal control
 STD	state transition diagram
+STOMP	Streaming Text Oriented Messaging Protocol
 STP	Spanning Tree Protocol
 STP	shielded twisted pair
 SUS	Single Unix Specification
@@ -1370,7 +1377,7 @@ TCL	tool command language
 TCP	Transmission Control Protocol
 TCQ	tagged command queueing
 TDC	time [to] digital converter
-TDD	test driven development
+TDD	test-driven development
 TDD	time division duplex
 TDM	time division multiplexing
 TDMA	time division multiple access
@@ -1556,6 +1563,7 @@ XSS	cross site scripting
 XT	extended technology
 XUL	XML user interface language
 YACC	yet another compiler compiler
+YAML	YAML ain't markup language
 YANG	yet another next generation
 YAWPFAPR	you are welcome; please file a problem report
 YP	Yellow Pages



CVS commit: src/share/misc

2018-09-19 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Sep 19 18:50:40 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Add BDFL and SJW


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.274 src/share/misc/acronyms:1.275
--- src/share/misc/acronyms:1.274	Fri May 25 00:31:07 2018
+++ src/share/misc/acronyms	Wed Sep 19 18:50:39 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.274 2018/05/25 00:31:07 riastradh Exp $
+$NetBSD: acronyms,v 1.275 2018/09/19 18:50:39 ginsbach Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -62,6 +62,7 @@ BBT	be back tomorrow
 BCNU	be seeing you
 BCNUL8R	be seeing you later
 BCP	best current practice
+BDFL	benevolent dictator for life
 BF	best friend
 BF	boyfriend
 BFF	best {friend,friends} forever
@@ -473,6 +474,7 @@ SFAICT	so far as I can tell
 SHID	slaps head in disgust
 SIMCA	sitting in my chair amused
 SITD	still in the dark
+SJW	social justice warrior
 SMAP	Soil Moisture Active Passive
 SMH	shaking my head
 SMLSFB	so many losers, so few bullets



CVS commit: src/sys/arch

2018-09-19 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Wed Sep 19 17:31:39 UTC 2018

Added Files:
src/sys/arch/arm/altera: cycv_clkmgr.c cycv_dwcmmc.c cycv_gmac.c
cycv_intr.h cycv_platform.c cycv_reg.h cycv_rstmgr.c cycv_var.h
files.altera
src/sys/arch/arm/dts: socfpga_cyclone5_de0_sockit.dts
src/sys/arch/evbarm/altera: altera_start.S genassym.cf platform.h
src/sys/arch/evbarm/conf: NANOSOC files.altera mk.altera std.altera

Log Message:
Add support for the DE0 NanoSoC board.

It's Cyclone V based and thus includes a dual-core Cortex A9 @925MHz.
Most standard peripherals are supported (USB, SDCard, Ethernet) and
no unusual peripheral is supported yet (FPGA, GPIO, ...)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/altera/cycv_clkmgr.c \
src/sys/arch/arm/altera/cycv_dwcmmc.c src/sys/arch/arm/altera/cycv_gmac.c \
src/sys/arch/arm/altera/cycv_intr.h \
src/sys/arch/arm/altera/cycv_platform.c \
src/sys/arch/arm/altera/cycv_reg.h src/sys/arch/arm/altera/cycv_rstmgr.c \
src/sys/arch/arm/altera/cycv_var.h src/sys/arch/arm/altera/files.altera
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/socfpga_cyclone5_de0_sockit.dts
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/altera/altera_start.S \
src/sys/arch/evbarm/altera/genassym.cf \
src/sys/arch/evbarm/altera/platform.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/NANOSOC \
src/sys/arch/evbarm/conf/files.altera src/sys/arch/evbarm/conf/mk.altera \
src/sys/arch/evbarm/conf/std.altera

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

Added files:

Index: src/sys/arch/arm/altera/cycv_clkmgr.c
diff -u /dev/null src/sys/arch/arm/altera/cycv_clkmgr.c:1.1
--- /dev/null	Wed Sep 19 17:31:39 2018
+++ src/sys/arch/arm/altera/cycv_clkmgr.c	Wed Sep 19 17:31:38 2018
@@ -0,0 +1,660 @@
+/* $NetBSD: cycv_clkmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $ */
+
+/* This file is in the public domain. */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define CYCV_CLOCK_OSC1		2500
+
+static int cycv_clkmgr_match(device_t, cfdata_t, void *);
+static void cycv_clkmgr_attach(device_t, device_t, void *);
+
+static struct clk *cycv_clkmgr_clock_decode(device_t, int, const void *,
+	size_t);
+
+static const struct fdtbus_clock_controller_func cycv_clkmgr_fdtclock_funcs = {
+	.decode = cycv_clkmgr_clock_decode
+};
+
+static struct clk *cycv_clkmgr_clock_get(void *, const char *);
+static void cycv_clkmgr_clock_put(void *, struct clk *);
+static u_int cycv_clkmgr_clock_get_rate(void *, struct clk *);
+static int cycv_clkmgr_clock_set_rate(void *, struct clk *, u_int);
+static int cycv_clkmgr_clock_enable(void *, struct clk *);
+static int cycv_clkmgr_clock_disable(void *, struct clk *);
+static int cycv_clkmgr_clock_set_parent(void *, struct clk *, struct clk *);
+static struct clk *cycv_clkmgr_clock_get_parent(void *, struct clk *);
+
+static const struct clk_funcs cycv_clkmgr_clock_funcs = {
+	.get = cycv_clkmgr_clock_get,
+	.put = cycv_clkmgr_clock_put,
+	.get_rate = cycv_clkmgr_clock_get_rate,
+	.set_rate = cycv_clkmgr_clock_set_rate,
+	.enable = cycv_clkmgr_clock_enable,
+	.disable = cycv_clkmgr_clock_disable,
+	.get_parent = cycv_clkmgr_clock_get_parent,
+	.set_parent = cycv_clkmgr_clock_set_parent,
+};
+
+struct cycv_clk {
+	struct clk base;
+
+	int id;
+	u_int refcnt;
+
+	struct cycv_clk *parent;	/* cached and valid if not NULL */
+	/* parent_id is not zero and filled with dtb if only one parent clock */
+	int parent_id;
+
+	int type;
+#define CYCV_CLK_TYPE_PLL	0x0001
+#define CYCV_CLK_TYPE_FIXED	0x0002
+#define CYCV_CLK_TYPE_FIXED_DIV	0x0003
+#define CYCV_CLK_TYPE_DIV	0x0004
+
+	int flags;
+#define CYCV_CLK_FLAG_HAVE_GATE	0x0001
+#define CYCV_CLK_FLAG_IS_AVAIL	0x0002
+
+	union {
+		bus_addr_t pll_addr;
+		uint32_t fixed_freq;
+		uint32_t fixed_div;
+		struct {
+			bus_addr_t addr;
+			uint32_t mask;
+			int shift;
+		} div;
+	} u;
+
+	bus_addr_t gate_addr;
+	int gate_shift;
+};
+
+struct cycv_clkmgr_softc {
+	device_t sc_dev;
+	struct clk_domain sc_clkdom;
+
+	bus_space_tag_t sc_bst;
+	bus_space_handle_t sc_bsh;
+
+	struct cycv_clk *sc_clocks;
+	u_int sc_nclocks;
+};
+
+static void cycv_clkmgr_init(struct cycv_clkmgr_softc *, int);
+static void cycv_clkmgr_clock_parse(struct cycv_clkmgr_softc *, int, u_int);
+static u_int cycv_clkmgr_clocks_traverse(struct cycv_clkmgr_softc *, int,
+	void (*)(struct cycv_clkmgr_softc *, int, u_int), u_int);
+static struct cycv_clk_mux_info *cycv_clkmgr_get_mux_info(const char *);
+static void cycv_clkmgr_clock_print(struct cycv_clkmgr_softc *,
+	struct cycv_clk *);
+
+CFATTACH_DECL_NEW(cycvclkmgr, sizeof (struct cycv_clkmgr_softc),
+	cycv_clkmgr_match, 

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

2018-09-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Sep 19 16:23:05 UTC 2018

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

Log Message:
i386 xen is pae


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.119 src/sys/arch/x86/x86/x86_machdep.c:1.120
--- src/sys/arch/x86/x86/x86_machdep.c:1.119	Fri Jul 13 09:37:32 2018
+++ src/sys/arch/x86/x86/x86_machdep.c	Wed Sep 19 16:23:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.119 2018/07/13 09:37:32 maxv Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.120 2018/09/19 16:23:05 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.119 2018/07/13 09:37:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.120 2018/09/19 16:23:05 maxv Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -89,7 +89,6 @@ static char x86_cpu_idle_text[16];
 
 #ifdef XEN
 char module_machine_amd64_xen[] = "amd64-xen";
-char module_machine_i386_xen[] = "i386-xen";
 char module_machine_i386pae_xen[] = "i386pae-xen";
 #endif
 
@@ -206,14 +205,10 @@ module_init_md(void)
 
 	/* setup module path for XEN kernels */
 #ifdef XEN
-#if defined(amd64)
+#ifdef __x86_64__
 	module_machine = module_machine_amd64_xen;
-#elif defined(i386)
-#ifdef PAE
-	module_machine = module_machine_i386pae_xen;
 #else
-	module_machine = module_machine_i386_xen;
-#endif
+	module_machine = module_machine_i386pae_xen;
 #endif
 #endif
 



CVS commit: src

2018-09-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Sep 19 16:11:53 UTC 2018

Modified Files:
src/distrib/sets/lists/modules: md.i386
src/sys/modules/arch: archdirs.mk
Removed Files:
src/sys/modules/arch/x86/i386-xen: Makefile bsd.i386-xen.mk

Log Message:
Don't build the module sets for non-pae-32bit-pv. Noted by John D. Baker
on port-i386@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/arch/archdirs.mk
cvs rdiff -u -r1.1 -r0 src/sys/modules/arch/x86/i386-xen/Makefile \
src/sys/modules/arch/x86/i386-xen/bsd.i386-xen.mk

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/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.81 src/distrib/sets/lists/modules/md.i386:1.82
--- src/distrib/sets/lists/modules/md.i386:1.81	Tue Aug 28 09:42:10 2018
+++ src/distrib/sets/lists/modules/md.i386	Wed Sep 19 16:11:53 2018
@@ -1,7 +1,6 @@
-# $NetBSD: md.i386,v 1.81 2018/08/28 09:42:10 martin Exp $
+# $NetBSD: md.i386,v 1.82 2018/09/19 16:11:53 maxv Exp $
 #
-# NOTE that there are three sets of files here:
-# @MODULEDIR@, i386-xen, and i386pae-xen
+# NOTE that there are two sets of files here: @MODULEDIR@ and i386pae-xen
 #
 
 ./@MODULEDIR@/acpiacadbase-kernel-modules	kmod

Index: src/sys/modules/arch/archdirs.mk
diff -u src/sys/modules/arch/archdirs.mk:1.3 src/sys/modules/arch/archdirs.mk:1.4
--- src/sys/modules/arch/archdirs.mk:1.3	Mon Jun 22 06:46:27 2015
+++ src/sys/modules/arch/archdirs.mk	Wed Sep 19 16:11:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: archdirs.mk,v 1.3 2015/06/22 06:46:27 matt Exp $
+#	$NetBSD: archdirs.mk,v 1.4 2018/09/19 16:11:53 maxv Exp $
 
 # list of subdirs used per-platform
 
@@ -7,7 +7,7 @@ ARCHDIR_SUBDIR=	x86/amd64-xen
 .endif
 
 .if ${MACHINE} == "i386"
-ARCHDIR_SUBDIR=	x86/i386-xen x86/i386pae-xen
+ARCHDIR_SUBDIR=	x86/i386pae-xen
 .endif
 
 .if ${MACHINE_ARCH} == "powerpc"



CVS commit: src/usr.sbin/npf/npfctl

2018-09-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Sep 19 15:36:12 UTC 2018

Modified Files:
src/usr.sbin/npf/npfctl: npf.conf.5

Log Message:
Switch back to tabs, it was nicer this way.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/usr.sbin/npf/npfctl/npf.conf.5

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/npf.conf.5
diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.75 src/usr.sbin/npf/npfctl/npf.conf.5:1.76
--- src/usr.sbin/npf/npfctl/npf.conf.5:1.75	Tue Sep  4 15:36:01 2018
+++ src/usr.sbin/npf/npfctl/npf.conf.5	Wed Sep 19 15:36:12 2018
@@ -1,4 +1,4 @@
-.\"$NetBSD: npf.conf.5,v 1.75 2018/09/04 15:36:01 maxv Exp $
+.\"$NetBSD: npf.conf.5,v 1.76 2018/09/19 15:36:12 maxv Exp $
 .\"
 .\" Copyright (c) 2009-2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 4, 2018
+.Dd September 19, 2018
 .Dt NPF.CONF 5
 .Os
 .Sh NAME
@@ -529,33 +529,33 @@ map $ext_if dynamic 10.1.1.0/24 -> $ext_
 map $ext_if dynamic proto tcp 10.1.1.2 port 22 <- $ext_if port 9022
 
 procedure "log" {
-  # The logging facility can be used together with npfd(8).
-  log: npflog0
+	# The logging facility can be used together with npfd(8).
+	log: npflog0
 }
 
 group "external" on $ext_if {
-  pass stateful out final all
+	pass stateful out final all
 
-  block in final from 
-  pass stateful in final family inet4 proto tcp to $ext_if port ssh apply "log"
-  pass stateful in final proto tcp to $ext_if port $services_tcp
-  pass stateful in final proto udp to $ext_if port $services_udp
-  pass stateful in final proto tcp to $ext_if port 49151-65535  # passive FTP
-  pass stateful in final proto udp to $ext_if port 33434-33600  # traceroute
+	block in final from 
+	pass stateful in final family inet4 proto tcp to $ext_if port ssh apply "log"
+	pass stateful in final proto tcp to $ext_if port $services_tcp
+	pass stateful in final proto udp to $ext_if port $services_udp
+	pass stateful in final proto tcp to $ext_if port 49151-65535  # passive FTP
+	pass stateful in final proto udp to $ext_if port 33434-33600  # traceroute
 }
 
 group "internal" on $int_if {
-  block in all
-  block in final from 
+	block in all
+	block in final from 
 
-  # Ingress filtering as per BCP 38 / RFC 2827.
-  pass in final from $localnet
-  pass out final all
+	# Ingress filtering as per BCP 38 / RFC 2827.
+	pass in final from $localnet
+	pass out final all
 }
 
 group default {
-  pass final on lo0 all
-  block all
+	pass final on lo0 all
+	block all
 }
 .Ed
 .\" -



CVS commit: src/bin/ps

2018-09-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Sep 19 15:20:39 UTC 2018

Modified Files:
src/bin/ps: print.c

Log Message:
Don't display l_wchan, either there is something in l_wmesg and we display
it, or there's nothing and we print "-".


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/bin/ps/print.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/ps/print.c
diff -u src/bin/ps/print.c:1.129 src/bin/ps/print.c:1.130
--- src/bin/ps/print.c:1.129	Wed Apr 11 18:52:05 2018
+++ src/bin/ps/print.c	Wed Sep 19 15:20:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.129 2018/04/11 18:52:05 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.130 2018/09/19 15:20:39 maxv Exp $	*/
 
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)print.c	8.6 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.129 2018/04/11 18:52:05 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.130 2018/09/19 15:20:39 maxv Exp $");
 #endif
 #endif /* not lint */
 
@@ -927,22 +927,11 @@ wchan(struct pinfo *pi, VARENT *ve, enum
 {
 	struct kinfo_lwp *l = pi->li;
 	VAR *v;
-	char *buf;
 
 	v = ve->var;
-	if (l->l_wchan) {
-		if (l->l_wmesg[0]) {
-			strprintorsetwidth(v, l->l_wmesg, mode);
-			v->width = min(v->width, KI_WMESGLEN);
-		} else {
-			(void)asprintf(, "%-*" PRIx64, v->width,
-			l->l_wchan);
-			if (buf == NULL)
-err(EXIT_FAILURE, "%s", "");
-			strprintorsetwidth(v, buf, mode);
-			v->width = min(v->width, KI_WMESGLEN);
-			free(buf);
-		}
+	if (l->l_wmesg[0]) {
+		strprintorsetwidth(v, l->l_wmesg, mode);
+		v->width = min(v->width, KI_WMESGLEN);
 	} else {
 		if (mode == PRINTMODE)
 			(void)printf("%-*s", v->width, "-");



CVS commit: src

2018-09-19 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Sep 19 13:58:27 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
src/sys/conf: files
src/sys/dev: DEVNAMES
src/sys/dev/isa: files.isa
src/usr.sbin/isdn: Makefile
Removed Files:
src/share/man/man4: daic.4
src/sys/dev/ic: daic.c daicreg.h daicvar.h
src/sys/dev/isa: daic_isa.c
src/usr.sbin/isdn/daicctl: Makefile daicctl.1 daicctl.h debug.c
dnload.c istat.c main.c xlog.c

Log Message:
Remove daic(4), it has never been functional.

ok martin@


To generate a diff of this commit:
cvs rdiff -u -r1.1187 -r1.1188 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.264 -r1.265 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1616 -r1.1617 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.666 -r1.667 src/share/man/man4/Makefile
cvs rdiff -u -r1.10 -r0 src/share/man/man4/daic.4
cvs rdiff -u -r1.1207 -r1.1208 src/sys/conf/files
cvs rdiff -u -r1.312 -r1.313 src/sys/dev/DEVNAMES
cvs rdiff -u -r1.32 -r0 src/sys/dev/ic/daic.c
cvs rdiff -u -r1.6 -r0 src/sys/dev/ic/daicreg.h
cvs rdiff -u -r1.12 -r0 src/sys/dev/ic/daicvar.h
cvs rdiff -u -r1.20 -r0 src/sys/dev/isa/daic_isa.c
cvs rdiff -u -r1.169 -r1.170 src/sys/dev/isa/files.isa
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/isdn/Makefile
cvs rdiff -u -r1.1.1.1 -r0 src/usr.sbin/isdn/daicctl/Makefile
cvs rdiff -u -r1.11 -r0 src/usr.sbin/isdn/daicctl/daicctl.1
cvs rdiff -u -r1.8 -r0 src/usr.sbin/isdn/daicctl/daicctl.h \
src/usr.sbin/isdn/daicctl/dnload.c
cvs rdiff -u -r1.5 -r0 src/usr.sbin/isdn/daicctl/debug.c
cvs rdiff -u -r1.6 -r0 src/usr.sbin/isdn/daicctl/istat.c
cvs rdiff -u -r1.10 -r0 src/usr.sbin/isdn/daicctl/main.c
cvs rdiff -u -r1.7 -r0 src/usr.sbin/isdn/daicctl/xlog.c

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1187 src/distrib/sets/lists/base/mi:1.1188
--- src/distrib/sets/lists/base/mi:1.1187	Wed Sep 12 19:55:39 2018
+++ src/distrib/sets/lists/base/mi	Wed Sep 19 13:58:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1187 2018/09/12 19:55:39 para Exp $
+# $NetBSD: mi,v 1.1188 2018/09/19 13:58:26 maxv Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1657,7 +1657,7 @@
 ./usr/sbin/cpuctlbase-sysutil-bin
 ./usr/sbin/crashbase-sysutil-bin
 ./usr/sbin/cron	base-cron-bin
-./usr/sbin/daicctlbase-isdn-bin
+./usr/sbin/daicctlbase-obsolete		obsolete
 ./usr/sbin/dbsymbase-sysutil-bin	binutils
 ./usr/sbin/ddns-confgenbase-bind-bin
 ./usr/sbin/dev_mkdbbase-sysutil-bin

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.264 src/distrib/sets/lists/debug/mi:1.265
--- src/distrib/sets/lists/debug/mi:1.264	Thu Sep  6 06:41:59 2018
+++ src/distrib/sets/lists/debug/mi	Wed Sep 19 13:58:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.264 2018/09/06 06:41:59 maxv Exp $
+# $NetBSD: mi,v 1.265 2018/09/19 13:58:26 maxv Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1042,7 +1042,7 @@
 ./usr/libdata/debug/usr/sbin/cpuctl.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/usr/sbin/crash.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/usr/sbin/cron.debug		comp-cron-debug		debug
-./usr/libdata/debug/usr/sbin/daicctl.debug	comp-isdn-debug		debug
+./usr/libdata/debug/usr/sbin/daicctl.debug	comp-obsolete		obsolete
 ./usr/libdata/debug/usr/sbin/dbsym.debug	comp-sysutil-debug	binutils,debug
 ./usr/libdata/debug/usr/sbin/ddns-confgen.debug	comp-bind-bin		debug
 ./usr/libdata/debug/usr/sbin/dev_mkdb.debug	comp-sysutil-debug	debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1616 src/distrib/sets/lists/man/mi:1.1617
--- src/distrib/sets/lists/man/mi:1.1616	Thu Sep  6 14:08:24 2018
+++ src/distrib/sets/lists/man/mi	Wed Sep 19 13:58:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1616 2018/09/06 14:08:24 maxv Exp $
+# $NetBSD: mi,v 1.1617 2018/09/19 13:58:27 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -130,7 +130,7 @@
 ./usr/share/man/cat1/ctfmerge.0			man-util-catman		.cat,ctf
 ./usr/share/man/cat1/cu.0			man-util-catman		.cat
 ./usr/share/man/cat1/cut.0			man-util-catman		.cat
-./usr/share/man/cat1/daicctl.0			man-sysutil-catman	.cat
+./usr/share/man/cat1/daicctl.0			man-obsolete		obsolete
 ./usr/share/man/cat1/date.0			man-util-catman		.cat
 ./usr/share/man/cat1/db.0			man-util-catman		.cat
 ./usr/share/man/cat1/dc.0			man-util-catman		.cat
@@ -1002,7 +1002,7 @@
 ./usr/share/man/cat4/cy.0			man-sys-catman		.cat
 ./usr/share/man/cat4/cypide.0			

CVS commit: src/sys

2018-09-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 19 07:54:11 UTC 2018

Modified Files:
src/sys/netinet: in_offload.c
src/sys/netinet6: in6_offload.c

Log Message:
Fix in_undefer_cksum() and in6_undefer_cksum().

The 4th argument for in[46]_cksum() should be length of L4 header +
L4 payload. The previous revisions are wrong

- for IPv4 when hdrlen != 0
- for IPv6 always

These functions are used only in net/if_loop.c and
arch/powerpc/booke/dev/pq3etsec.c under some special circumferences.
This should be why the bugs have not been found until today.

OK maxv


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/netinet/in_offload.c
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet6/in6_offload.c

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

Modified files:

Index: src/sys/netinet/in_offload.c
diff -u src/sys/netinet/in_offload.c:1.11 src/sys/netinet/in_offload.c:1.12
--- src/sys/netinet/in_offload.c:1.11	Wed Jul 11 06:25:05 2018
+++ src/sys/netinet/in_offload.c	Wed Sep 19 07:54:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_offload.c,v 1.11 2018/07/11 06:25:05 maxv Exp $	*/
+/*	$NetBSD: in_offload.c,v 1.12 2018/09/19 07:54:11 rin Exp $	*/
 
 /*
  * Copyright (c)2005, 2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_offload.c,v 1.11 2018/07/11 06:25:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_offload.c,v 1.12 2018/09/19 07:54:11 rin Exp $");
 
 #include 
 #include 
@@ -213,7 +213,7 @@ in_undefer_cksum(struct mbuf *m, size_t 
 	if (csum_flags & (M_CSUM_UDPv4|M_CSUM_TCPv4)) {
 		size_t l4offset = hdrlen + iphdrlen;
 
-		csum = in4_cksum(m, 0, l4offset, ip_len - l4offset - hdrlen);
+		csum = in4_cksum(m, 0, l4offset, ip_len - iphdrlen);
 		if (csum == 0 && (csum_flags & M_CSUM_UDPv4) != 0)
 			csum = 0x;
 

Index: src/sys/netinet6/in6_offload.c
diff -u src/sys/netinet6/in6_offload.c:1.10 src/sys/netinet6/in6_offload.c:1.11
--- src/sys/netinet6/in6_offload.c:1.10	Fri Aug 10 06:55:04 2018
+++ src/sys/netinet6/in6_offload.c	Wed Sep 19 07:54:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_offload.c,v 1.10 2018/08/10 06:55:04 maxv Exp $	*/
+/*	$NetBSD: in6_offload.c,v 1.11 2018/09/19 07:54:11 rin Exp $	*/
 
 /*
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.10 2018/08/10 06:55:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.11 2018/09/19 07:54:11 rin Exp $");
 
 #include 
 #include 
@@ -193,7 +193,8 @@ in6_undefer_cksum(struct mbuf *m, size_t
 
 	l4hdroff = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
 	l4offset = hdrlen + l4hdroff;
-	csum = in6_cksum(m, 0, l4offset, plen - l4hdroff);
+	csum = in6_cksum(m, 0, l4offset,
+	plen - (l4hdroff - sizeof(struct ip6_hdr)));
 
 	if (csum == 0 && (csum_flags & M_CSUM_UDPv6) != 0)
 		csum = 0x;



CVS commit: src/sys/net

2018-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 19 07:51:23 UTC 2018

Modified Files:
src/sys/net: if_bridge.c

Log Message:
Micro optimization. m_copym(M_COPYALL) -> m_copypacket().


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/net/if_bridge.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/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.158 src/sys/net/if_bridge.c:1.159
--- src/sys/net/if_bridge.c:1.158	Tue Sep 18 09:27:35 2018
+++ src/sys/net/if_bridge.c	Wed Sep 19 07:51:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.158 2018/09/18 09:27:35 msaitoh Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.159 2018/09/19 07:51:23 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.158 2018/09/18 09:27:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.159 2018/09/19 07:51:23 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -1540,7 +1540,7 @@ bridge_output(struct ifnet *ifp, struct 
 used = true;
 mc = m;
 			} else {
-mc = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+mc = m_copypacket(m, M_DONTWAIT);
 if (mc == NULL) {
 	sc->sc_if.if_oerrors++;
 	goto next;
@@ -1558,8 +1558,7 @@ bridge_output(struct ifnet *ifp, struct 
 	used = true;
 	mc = m;
 } else {
-	mc = m_copym(m, 0, M_COPYALL,
-	M_DONTWAIT);
+	mc = m_copypacket(m, M_DONTWAIT);
 	if (mc == NULL) {
 		sc->sc_if.if_oerrors++;
 		goto next;
@@ -1975,7 +1974,7 @@ bridge_broadcast(struct bridge_softc *sc
 			goto next;
 
 		if (dst_if != src_if) {
-			mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+			mc = m_copypacket(m, M_DONTWAIT);
 			if (mc == NULL) {
 sc->sc_if.if_oerrors++;
 goto next;
@@ -1993,7 +1992,7 @@ bridge_broadcast(struct bridge_softc *sc
 		}
 
 		if (bmcast) {
-			mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+			mc = m_copypacket(m, M_DONTWAIT);
 			if (mc == NULL) {
 sc->sc_if.if_oerrors++;
 goto next;



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

2018-09-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 19 07:26:54 UTC 2018

Removed Files:
src/sys/arch/ews4800mips/conf: Makefile.ews4800mips.inc

Log Message:
This file was only for setting COMPAT_AS appropriately, which is
automatically done in sys/compat/common/Makefile.inc since r1.24:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/compat/common/Makefile.inc#rev1.24


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/ews4800mips/conf/Makefile.ews4800mips.inc

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



CVS commit: [pgoyette-compat] src/sys/compat/linux/common

2018-09-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Sep 19 06:56:51 UTC 2018

Modified Files:
src/sys/compat/linux/common [pgoyette-compat]: linux_mod.c

Log Message:
Remove leading coma from list of required modules.  It doesn't seem
to cause any real problems, but it makes modstat output look weird.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/sys/compat/linux/common/linux_mod.c

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

Modified files:

Index: src/sys/compat/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.10.2.1 src/sys/compat/linux/common/linux_mod.c:1.10.2.2
--- src/sys/compat/linux/common/linux_mod.c:1.10.2.1	Wed Sep 12 07:45:56 2018
+++ src/sys/compat/linux/common/linux_mod.c	Wed Sep 19 06:56:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.10.2.1 2018/09/12 07:45:56 pgoyette Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.10.2.2 2018/09/19 06:56:51 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.10.2.1 2018/09/12 07:45:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.10.2.2 2018/09/19 06:56:51 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -66,7 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_mod.c,
 # define	MD3	""
 #endif
 
-#define REQ1",compat_ossaudio,sysv_ipc"
+#define REQ1"compat_ossaudio,sysv_ipc"
 #define REQ2",compat_12,compat_30,compat_50,compat_43,compat_sysv_50"
 
 MODULE(MODULE_CLASS_EXEC, compat_linux, REQ1 REQ2 MD1 MD2 MD3);



CVS commit: [pgoyette-compat] src/sys/compat/common

2018-09-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Sep 19 06:37:11 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_30_mod.c

Log Message:
We have some COMPAT_30 code that needs compat_offseterr(), so let's
require the compat_util module.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/compat/common/compat_30_mod.c

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

Modified files:

Index: src/sys/compat/common/compat_30_mod.c
diff -u src/sys/compat/common/compat_30_mod.c:1.1.2.7 src/sys/compat/common/compat_30_mod.c:1.1.2.8
--- src/sys/compat/common/compat_30_mod.c:1.1.2.7	Sat Sep 15 02:14:39 2018
+++ src/sys/compat/common/compat_30_mod.c	Wed Sep 19 06:37:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_30_mod.c,v 1.1.2.7 2018/09/15 02:14:39 pgoyette Exp $	*/
+/*	$NetBSD: compat_30_mod.c,v 1.1.2.8 2018/09/19 06:37:11 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_30_mod.c,v 1.1.2.7 2018/09/15 02:14:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_30_mod.c,v 1.1.2.8 2018/09/19 06:37:11 pgoyette Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ compat_30_fini(void)
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_30, "compat_40");
+MODULE(MODULE_CLASS_EXEC, compat_30, "compat_util,compat_40");
 
 static int
 compat_30_modcmd(modcmd_t cmd, void *arg)



CVS commit: [pgoyette-compat] src/sys/sys

2018-09-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Sep 19 06:26:13 UTC 2018

Modified Files:
src/sys/sys [pgoyette-compat]: module_hook.h

Log Message:
Ooops - we need to grab the mutex before we can drain the localcount!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/sys/module_hook.h

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

Modified files:

Index: src/sys/sys/module_hook.h
diff -u src/sys/sys/module_hook.h:1.1.2.1 src/sys/sys/module_hook.h:1.1.2.2
--- src/sys/sys/module_hook.h:1.1.2.1	Tue Sep 18 21:38:08 2018
+++ src/sys/sys/module_hook.h	Wed Sep 19 06:26:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: module_hook.h,v 1.1.2.1 2018/09/18 21:38:08 pgoyette Exp $	*/
+/* $NetBSD: module_hook.h,v 1.1.2.2 2018/09/19 06:26:13 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -116,6 +116,9 @@ static void (hook ## _unset)(void)\
 	KASSERT(hook.hooked);	\
 	KASSERT(hook.f);	\
 \
+	/* Grab the mutex */	\
+	mutex_enter();	\
+\
 	/* Prevent new localcount_acquire calls.  */		\
 	hook.hooked = false;	\
 \
@@ -125,6 +128,8 @@ static void (hook ## _unset)(void)\
 	/* Wait for existing localcount references to drain.  */\
 	localcount_drain(, , );	\
 \
+	/* Release the mutex and clean up all resources */	\
+	mutex_exit();	\
 	localcount_fini();\
 	cv_destroy();	\
 	mutex_destroy();\