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

2017-12-26 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed Dec 27 01:17:01 UTC 2017

Modified Files:
src/distrib/sets/lists/xserver: md.macppc

Log Message:
Add missing catman entry.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/xserver/md.macppc

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

Modified files:

Index: src/distrib/sets/lists/xserver/md.macppc
diff -u src/distrib/sets/lists/xserver/md.macppc:1.76 src/distrib/sets/lists/xserver/md.macppc:1.77
--- src/distrib/sets/lists/xserver/md.macppc:1.76	Thu Jan  5 02:22:19 2017
+++ src/distrib/sets/lists/xserver/md.macppc	Wed Dec 27 01:17:01 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.macppc,v 1.76 2017/01/05 02:22:19 christos Exp $
+# $NetBSD: md.macppc,v 1.77 2017/12/27 01:17:01 nakayama Exp $
 ./usr/X11R7/bin/X	-unknown-	xorg
 ./usr/X11R7/bin/Xorg	-unknown-	xorg
 ./usr/X11R7/bin/cvt	-unknown-	xorg
@@ -186,6 +186,7 @@
 ./usr/X11R7/man/cat4/ati.0-unknown-	.cat,xorg
 ./usr/X11R7/man/cat4/chips.0-unknown-	.cat,xorg
 ./usr/X11R7/man/cat4/exa.0-unknown-	.cat,xorg
+./usr/X11R7/man/cat4/glint.0-unknown-	.cat,xorg
 ./usr/X11R7/man/cat4/imstt.0-unknown-	obsolete
 ./usr/X11R7/man/cat4/kbd.0-unknown-	.cat,xorg
 ./usr/X11R7/man/cat4/mga.0-unknown-	.cat,xorg



CVS commit: src/sys/dev

2017-12-26 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Dec 27 00:12:06 UTC 2017

Modified Files:
src/sys/dev: mulaw.c mulaw.h

Log Message:
mulaw/alaw_to_linearN macros replaced with individual faster filters.
NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/mulaw.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mulaw.h

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

Modified files:

Index: src/sys/dev/mulaw.c
diff -u src/sys/dev/mulaw.c:1.32 src/sys/dev/mulaw.c:1.33
--- src/sys/dev/mulaw.c:1.32	Mon Jun 26 12:17:09 2017
+++ src/sys/dev/mulaw.c	Wed Dec 27 00:12:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat Exp $	*/
+/*	$NetBSD: mulaw.c,v 1.33 2017/12/27 00:12:06 nat Exp $	*/
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.33 2017/12/27 00:12:06 nat Exp $");
 
 #include 
 #include 
@@ -295,118 +295,197 @@ DEFINE_FILTER(mulaw_to_linear8)
 	return 0;
 }
 
-#define MULAWTOLINEARN(n_prec) 		\
-DEFINE_FILTER(mulaw_to_linear##n_prec)	\
-{	\
-	stream_filter_t *this;		\
-	int hw, j, m, err;		\
-	\
-	hw = n_prec / NBBY;		\
-	this = (stream_filter_t *)self;	\
-	max_used = (max_used + 1) & ~1; /* round up to even */		\
-	if ((err = this->prev->fetch_to(sc, this->prev,			\
-		this->src, max_used / hw)))\
-		return err;		\
-	m = (dst->end - dst->start) & ~1;\
-	m = min(m, max_used);		\
-	switch (dst->param.encoding) {	\
-	case AUDIO_ENCODING_ULINEAR_LE:	\
-		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
-			d[hw - 2] = mulawtolin16[s[0]][1];		\
-			d[hw - 1] = mulawtolin16[s[0]][0];		\
-			while (j > 0)	\
-d[--j] = 0;\
-		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
-		break;			\
-	case AUDIO_ENCODING_ULINEAR_BE:	\
-		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = 2;		\
-			d[0] = mulawtolin16[s[0]][0];			\
-			d[1] = mulawtolin16[s[0]][1];			\
-			while (j < hw)	\
-d[j++] = 0;\
-		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
-		break;			\
-	case AUDIO_ENCODING_SLINEAR_LE:	\
-		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
-			d[hw - 2] = mulawtolin16[s[0]][1];		\
-			d[hw - 1] = mulawtolin16[s[0]][0] ^ 0x80;	\
-			while (j > 0)	\
-d[--j] = 0;\
-		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
-		break;			\
-	case AUDIO_ENCODING_SLINEAR_BE:	\
-		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = 2;		\
-			d[0] = mulawtolin16[s[0]][0] ^ 0x80;		\
-			d[1] = mulawtolin16[s[0]][1];			\
-			while (j < hw)	\
-d[j++] = 0;\
-		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
-		break;			\
-	default:			\
-		aprint_error(		\
-		"%s: encoding must be [s/u]linear_[le/be]\n",	\
-		__func__);		\
-		break;			\
-	}\
-	return 0;			\
+DEFINE_FILTER(mulaw_to_linear16)
+{
+	stream_filter_t *this;
+	int m, err;
+
+	this = (stream_filter_t *)self;
+	max_used = (max_used + 1) & ~1;
+	if ((err = this->prev->fetch_to(sc, this->prev,
+		this->src, max_used / 2)))
+		return err;
+	m = (dst->end - dst->start) & ~1;
+	m = min(m, max_used);
+	switch (dst->param.encoding) {
+	case AUDIO_ENCODING_ULINEAR_LE:
+		FILTER_LOOP_PROLOGUE(this->src, 1, dst, 2, m) {
+			d[1] = mulawtolin16[s[0]][0];
+			d[0] = mulawtolin16[s[0]][1];
+		} FILTER_LOOP_EPILOGUE(this->src, dst);
+		break;
+	case AUDIO_ENCODING_ULINEAR_BE:
+		FILTER_LOOP_PROLOGUE(this->src, 1, dst, 2, m) {
+			d[0] = mulawtolin16[s[0]][0];
+			d[1] = mulawtolin16[s[0]][1];
+		} FILTER_LOOP_EPILOGUE(this->src, dst);
+		break;
+	case AUDIO_ENCODING_SLINEAR_LE:
+		FILTER_LOOP_PROLOGUE(this->src, 1, dst, 2, m) {
+			d[1] = mulawtolin16[s[0]][0] ^ 0x80;
+			d[0] = mulawtolin16[s[0]][1];
+		} FILTER_LOOP_EPILOGUE(this->src, dst);
+		break;
+	case AUDIO_ENCODING_SLINEAR_BE:
+		FILTER_LOOP_PROLOGUE(this->src, 1, dst, 2, m) {
+			d[0] = mulawtolin16[s[0]][0] ^ 0x80;
+			d[1] = mulawtolin16[s[0]][1];
+		} FILTER_LOOP_EPILOGUE(this->src, dst);
+		break;
+	default:
+		aprint_error(
+		"%s: encoding must be [s/u]linear_[le/be]\n",
+		__func__);
+		break;
+	}
+	return 0;
 }
 
-MULAWTOLINEARN(32)
-MULAWTOLINEARN(24)
-MULAWTOLINEARN(16)
-
-#define LINEARNTOMULAW(n_prec, n_valid)	\
-DEFINE_FILTER(linear##n_prec##_##n_valid##_to_mulaw)			\
-{	\
-	stream_filter_t *this;		\
-	int hw, m, err;			\
-	\
-	hw = n_prec / NBBY;		\
-	this = (stream_filter_t *)self;	\
-	if ((err = this->prev->fetch_to(sc, this->prev, this->src,	\
-		 max_used * hw)))	\
-		return err;		\
-	m = dst->end - dst->start;	\
-	m = min(m, max_used);		\
-	switch (this->src->param.encoding) {\
-	case AUDIO_ENCODING_SLINEAR_LE:	\

CVS commit: src

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 20:04:03 UTC 2017

Modified Files:
src: UPDATING

Log Message:
build without -u does not work because of the dependencies and the stale
files. Be more explicit with instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.288 src/UPDATING:1.289
--- src/UPDATING:1.288	Tue Dec 26 06:40:47 2017
+++ src/UPDATING	Tue Dec 26 15:04:03 2017
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.288 2017/12/26 11:40:47 martin Exp $
+$NetBSD: UPDATING,v 1.289 2017/12/26 20:04:03 christos Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -22,9 +22,11 @@ Recent changes:
 20171225:
 	removal of the vadvise syscall requires manual removal of all
 	associated files from the libc build object directory (including
-	the .depend files) - a command like
+	the .depend files) - a command like:
 		cd $OBJ && find . -type d -name libc | xargs rm -rf
-	or a one time build without -u will do.
+	For architectures that support multiple "compat" binary targets,
+	you'll need to cleanup both the regular libc directory and the
+	compat one.
 
 20171010:
 	a change to the build structure of external/bsd/acpica/bin/iasl



CVS commit: src/sys/dev/usb

2017-12-26 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Dec 26 18:44:52 UTC 2017

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

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/dev/usb/usb_subr.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/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.222 src/sys/dev/usb/usb_subr.c:1.223
--- src/sys/dev/usb/usb_subr.c:1.222	Fri Dec  8 14:46:18 2017
+++ src/sys/dev/usb/usb_subr.c	Tue Dec 26 18:44:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.223 2017/12/26 18:44:52 khorben Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.223 2017/12/26 18:44:52 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1695,7 +1695,7 @@ usb_free_device(struct usbd_device *dev)
  * driver is dying and then wakes any sleepers.  It then sleeps on the
  * softc.  Each place that can sleep must maintain the reference
  * count.  When the reference count drops to -1 (0 is the normal value
- * of the reference count) the a wakeup on the softc is performed
+ * of the reference count) then a wakeup on the softc is performed
  * signaling to the detach waiter that all references are gone.
  */
 



CVS commit: src/lib/libc/sys

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:09:20 UTC 2017

Modified Files:
src/lib/libc/sys: vadvise.c

Log Message:
use __USE()


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/sys/vadvise.c

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

Modified files:

Index: src/lib/libc/sys/vadvise.c
diff -u src/lib/libc/sys/vadvise.c:1.2 src/lib/libc/sys/vadvise.c:1.3
--- src/lib/libc/sys/vadvise.c:1.2	Tue Dec 26 00:45:50 2017
+++ src/lib/libc/sys/vadvise.c	Tue Dec 26 12:09:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vadvise.c,v 1.2 2017/12/26 05:45:50 maya Exp $	*/
+/*	$NetBSD: vadvise.c,v 1.3 2017/12/26 17:09:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vadvise.c,v 1.2 2017/12/26 05:45:50 maya Exp $");
+__RCSID("$NetBSD: vadvise.c,v 1.3 2017/12/26 17:09:20 christos Exp $");
 #endif
 
 #include 
@@ -37,7 +37,7 @@ int vadvise(int va);
 int
 vadvise(int va)
 {
-	(void)va;
+	__USE(va);
 
 	errno = EINVAL;
 	return -1;



CVS commit: src/sys/sys

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:08:56 UTC 2017

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

Log Message:
add linted to __USE()


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/sys/cdefs.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/cdefs.h
diff -u src/sys/sys/cdefs.h:1.134 src/sys/sys/cdefs.h:1.135
--- src/sys/sys/cdefs.h:1.134	Tue Dec 26 12:03:10 2017
+++ src/sys/sys/cdefs.h	Tue Dec 26 12:08:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.134 2017/12/26 17:03:10 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.135 2017/12/26 17:08:56 christos Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -609,7 +609,7 @@
 #define __CASTV(__dt, __st)	__CAST(__dt, __CAST(void *, __st))
 #define __CASTCV(__dt, __st)	__CAST(__dt, __CAST(const void *, __st))
 
-#define __USE(a) ((void)(a))
+#define __USE(a) (/*LINTED*/(void)(a))
 
 #define __type_mask(t) (/*LINTED*/sizeof(t) < sizeof(intmax_t) ? \
 (~((1ULL << (sizeof(t) * NBBY)) - 1)) : 0ULL)



CVS commit: src/sys/sys

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:03:10 UTC 2017

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

Log Message:
lint knows about all inline variant syntax...


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/sys/cdefs.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/cdefs.h
diff -u src/sys/sys/cdefs.h:1.133 src/sys/sys/cdefs.h:1.134
--- src/sys/sys/cdefs.h:1.133	Sat Jul 15 09:46:02 2017
+++ src/sys/sys/cdefs.h	Tue Dec 26 12:03:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.133 2017/07/15 13:46:02 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.134 2017/12/26 17:03:10 christos Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -369,7 +369,7 @@
 #define	__c99inline	extern __attribute__((__gnu_inline__)) __inline
 #elif defined(__GNUC__)
 #define	__c99inline	extern __inline
-#elif defined(__STDC_VERSION__)
+#elif defined(__STDC_VERSION__) || defined(__lint__)
 #define	__c99inline	__inline
 #endif
 



CVS commit: src/usr.bin/xlint

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:02:19 UTC 2017

Modified Files:
src/usr.bin/xlint/lint1: emit1.c
src/usr.bin/xlint/lint2: chk.c lint2.h read.c

Log Message:
Don't print duplicate definitions for inline symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint2/lint2.h
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint2/read.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/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.19 src/usr.bin/xlint/lint1/emit1.c:1.20
--- src/usr.bin/xlint/lint1/emit1.c:1.19	Fri Sep 26 18:52:24 2008
+++ src/usr.bin/xlint/lint1/emit1.c	Tue Dec 26 12:02:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.19 2008/09/26 22:52:24 matt Exp $ */
+/* $NetBSD: emit1.c,v 1.20 2017/12/26 17:02:19 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.19 2008/09/26 22:52:24 matt Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.20 2017/12/26 17:02:19 christos Exp $");
 #endif
 
 #include 
@@ -367,6 +367,9 @@ outfdef(sym_t *fsym, pos_t *posp, int rv
 		/* old style function definition */
 		outchar('o');
 
+	if (fsym->s_inline)
+		outchar('i');
+
 	if (fsym->s_scl == STATIC)
 		outchar('s');
 

Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.22 src/usr.bin/xlint/lint2/chk.c:1.23
--- src/usr.bin/xlint/lint2/chk.c:1.22	Mon Oct 17 12:31:14 2011
+++ src/usr.bin/xlint/lint2/chk.c	Tue Dec 26 12:02:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.22 2011/10/17 16:31:14 mbalmer Exp $ */
+/* $NetBSD: chk.c,v 1.23 2017/12/26 17:02:19 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.22 2011/10/17 16:31:14 mbalmer Exp $");
+__RCSID("$NetBSD: chk.c,v 1.23 2017/12/26 17:02:19 christos Exp $");
 #endif
 
 #include 
@@ -211,6 +211,8 @@ chkmd(hte_t *hte)
 		 */
 		if (sym->s_def != DEF && (!sflag || sym->s_def != TDEF))
 			continue;
+		if (sym->s_inline)
+			continue;
 		if (def1 == NULL) {
 			def1 = sym;
 			continue;

Index: src/usr.bin/xlint/lint2/lint2.h
diff -u src/usr.bin/xlint/lint2/lint2.h:1.7 src/usr.bin/xlint/lint2/lint2.h:1.8
--- src/usr.bin/xlint/lint2/lint2.h:1.7	Thu Apr  7 12:28:40 2005
+++ src/usr.bin/xlint/lint2/lint2.h	Tue Dec 26 12:02:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: lint2.h,v 1.7 2005/04/07 16:28:40 christos Exp $ */
+/* $NetBSD: lint2.h,v 1.8 2017/12/26 17:02:19 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -119,6 +119,7 @@ typedef	struct sym {
 		def_t	s_def;
 #endif
 		u_int	s_rval : 1;	/* function has return value */
+		u_int	s_inline : 1;	/* function is inline */
 		u_int	s_osdef : 1;	/* old style function definition */
 		u_int	s_static : 1;	/* symbol is static */
 		u_int	s_va : 1;	/* check only first s_nva arguments */
@@ -135,6 +136,7 @@ typedef	struct sym {
 #define s_pos		s_s.s_pos
 #define s_rval		s_s.s_rval
 #define s_osdef		s_s.s_osdef
+#define s_inline	s_s.s_inline
 #define s_static	s_s.s_static
 #define s_def		s_s.s_def
 #define s_va		s_s.s_va

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.26 src/usr.bin/xlint/lint2/read.c:1.27
--- src/usr.bin/xlint/lint2/read.c:1.26	Sat Oct 18 04:33:30 2014
+++ src/usr.bin/xlint/lint2/read.c	Tue Dec 26 12:02:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.26 2014/10/18 08:33:30 snj Exp $ */
+/* $NetBSD: read.c,v 1.27 2017/12/26 17:02:19 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.26 2014/10/18 08:33:30 snj Exp $");
+__RCSID("$NetBSD: read.c,v 1.27 2017/12/26 17:02:19 christos Exp $");
 #endif
 
 #include 
@@ -371,14 +371,9 @@ decldef(pos_t *posp, const char *cp)
 
 	used = 0;
 
-	while (strchr("tdeurosvPS", (c = *cp)) != NULL) {
+	while (strchr("deiorstuvPS", (c = *cp)) != NULL) {
 		cp++;
 		switch (c) {
-		case 't':
-			if (sym.s_def != NODECL)
-inperr("nodecl %c", c);
-			sym.s_def = TDEF;
-			break;
 		case 'd':
 			if (sym.s_def != NODECL)
 inperr("nodecl %c", c);
@@ -389,26 +384,36 @@ decldef(pos_t *posp, const char *cp)
 inperr("nodecl %c", c);
 			sym.s_def = DECL;
 			break;
-		case 'u':
-			if (used)
-inperr("used %c", c);
-			used = 1;
-			break;
-		case 'r':
-			if (sym.s_rval)
-inperr("rval");
-			sym.s_rval = 1;
+		case 'i':
+			if (sym.s_inline != NODECL)
+inperr("inline %c", c);
+			sym.s_inline = DECL;
 			break;
 		case 'o':
 			if (sym.s_osdef)
 	

CVS commit: src/lib/libpthread

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:00:51 UTC 2017

Modified Files:
src/lib/libpthread: pthread.h

Log Message:
Needs to be protected since it has a timespec argument. Found by lint(1)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libpthread/pthread.h

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

Modified files:

Index: src/lib/libpthread/pthread.h
diff -u src/lib/libpthread/pthread.h:1.38 src/lib/libpthread/pthread.h:1.39
--- src/lib/libpthread/pthread.h:1.38	Sun Oct 30 19:26:33 2016
+++ src/lib/libpthread/pthread.h	Tue Dec 26 12:00:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.h,v 1.38 2016/10/30 23:26:33 kamil Exp $	*/
+/*	$NetBSD: pthread.h,v 1.39 2017/12/26 17:00:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -94,8 +94,10 @@ int	pthread_mutex_destroy(pthread_mutex_
 int	pthread_mutex_lock(pthread_mutex_t *);
 int	pthread_mutex_trylock(pthread_mutex_t *);
 int	pthread_mutex_unlock(pthread_mutex_t *);
+#ifndef __LIBC12_SOURCE__
 int	pthread_mutex_timedlock(pthread_mutex_t * __restrict,
 	const struct timespec * __restrict);
+#endif
 int	pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict,
 	int * __restrict);
 int	pthread_mutex_setprioceiling(pthread_mutex_t * __restrict, int,



CVS commit: src/lib/libc/compat

2017-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 26 17:01:25 UTC 2017

Modified Files:
src/lib/libc/compat/include: lwp.h
src/lib/libc/compat/sys: compat___lwp_park50.c

Log Message:
Fix const argument inconsistency (found by lint(1))


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/lwp.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/sys/compat___lwp_park50.c

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

Modified files:

Index: src/lib/libc/compat/include/lwp.h
diff -u src/lib/libc/compat/include/lwp.h:1.4 src/lib/libc/compat/include/lwp.h:1.5
--- src/lib/libc/compat/include/lwp.h:1.4	Fri Jan 31 15:45:49 2014
+++ src/lib/libc/compat/include/lwp.h	Tue Dec 26 12:01:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.4 2014/01/31 20:45:49 christos Exp $	*/
+/*	$NetBSD: lwp.h,v 1.5 2017/12/26 17:01:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@ __BEGIN_DECLS
 struct timespec50;
 int	_lwp_park(const struct timespec50 *, lwpid_t, const void *, const void *);
 int	___lwp_park50(const struct timespec *, lwpid_t, const void *, const void *);
-int	___lwp_park60(clockid_t, int, const struct timespec *, lwpid_t,
+int	___lwp_park60(clockid_t, int, struct timespec *, lwpid_t,
 const void *, const void *);
 __END_DECLS
 

Index: src/lib/libc/compat/sys/compat___lwp_park50.c
diff -u src/lib/libc/compat/sys/compat___lwp_park50.c:1.2 src/lib/libc/compat/sys/compat___lwp_park50.c:1.3
--- src/lib/libc/compat/sys/compat___lwp_park50.c:1.2	Fri Jan 31 15:45:49 2014
+++ src/lib/libc/compat/sys/compat___lwp_park50.c	Tue Dec 26 12:01:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat___lwp_park50.c,v 1.2 2014/01/31 20:45:49 christos Exp $	*/
+/*	$NetBSD: compat___lwp_park50.c,v 1.3 2017/12/26 17:01:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat___lwp_park50.c,v 1.2 2014/01/31 20:45:49 christos Exp $");
+__RCSID("$NetBSD: compat___lwp_park50.c,v 1.3 2017/12/26 17:01:25 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #define __LIBC12_SOURCE__
@@ -53,6 +53,11 @@ int
 ___lwp_park50(const struct timespec *ts, lwpid_t unpark, const void *hint,
 	const void *unparkhint)
 {
-	return ___lwp_park60(CLOCK_REALTIME, TIMER_ABSTIME, ts,  unpark,
+	struct timespec ts1, *tsp = 
+	if (ts)
+		ts1 = *ts;
+	else
+		tsp = NULL;
+	return ___lwp_park60(CLOCK_REALTIME, TIMER_ABSTIME, tsp, unpark,
 	hint, unparkhint);
 }



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

2017-12-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 26 14:54:52 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: files.tegra tegra_drm.c tegra_drm.h
tegra_drm_fb.c tegra_drm_mode.c tegra_fb.c
Removed Files:
src/sys/arch/arm/nvidia: tegra_drm_gem.c

Log Message:
Use DRM GEM/CMA helper.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_drm.c \
src/sys/arch/arm/nvidia/tegra_drm.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/nvidia/tegra_drm_fb.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/nvidia/tegra_drm_gem.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/nvidia/tegra_drm_mode.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_fb.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/arm/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.45 src/sys/arch/arm/nvidia/files.tegra:1.46
--- src/sys/arch/arm/nvidia/files.tegra:1.45	Tue Sep 26 16:12:45 2017
+++ src/sys/arch/arm/nvidia/files.tegra	Tue Dec 26 14:54:52 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.45 2017/09/26 16:12:45 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.46 2017/12/26 14:54:52 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -157,7 +157,6 @@ attach	tegradrm at fdt with tegra_drm
 file	arch/arm/nvidia/tegra_drm.c		tegra_drm
 file	arch/arm/nvidia/tegra_drm_mode.c	tegra_drm
 file	arch/arm/nvidia/tegra_drm_fb.c		tegra_drm
-file	arch/arm/nvidia/tegra_drm_gem.c		tegra_drm
 
 # Framebuffer console
 device	tegrafb: tegrafbbus, drmfb, wsemuldisplaydev

Index: src/sys/arch/arm/nvidia/tegra_drm.c
diff -u src/sys/arch/arm/nvidia/tegra_drm.c:1.7 src/sys/arch/arm/nvidia/tegra_drm.c:1.8
--- src/sys/arch/arm/nvidia/tegra_drm.c:1.7	Sun Apr 16 12:28:21 2017
+++ src/sys/arch/arm/nvidia/tegra_drm.c	Tue Dec 26 14:54:52 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_drm.c,v 1.7 2017/04/16 12:28:21 jmcneill Exp $ */
+/* $NetBSD: tegra_drm.c,v 1.8 2017/12/26 14:54:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.7 2017/04/16 12:28:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.8 2017/12/26 14:54:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -57,29 +57,18 @@ static int	tegra_drm_set_busid(struct dr
 static int	tegra_drm_load(struct drm_device *, unsigned long);
 static int	tegra_drm_unload(struct drm_device *);
 
-static int	tegra_drm_dumb_create(struct drm_file *, struct drm_device *,
-		struct drm_mode_create_dumb *);
-static int	tegra_drm_dumb_map_offset(struct drm_file *,
-		struct drm_device *, uint32_t, uint64_t *);
-
-static const struct uvm_pagerops tegra_drm_gem_uvm_ops = {
-	.pgo_reference = drm_gem_pager_reference,
-	.pgo_detach = drm_gem_pager_detach,
-	.pgo_fault = tegra_drm_gem_fault,
-};
-
 static struct drm_driver tegra_drm_driver = {
 	.driver_features = DRIVER_MODESET | DRIVER_GEM,
 	.dev_priv_size = 0,
 	.load = tegra_drm_load,
 	.unload = tegra_drm_unload,
 
-	.gem_free_object = tegra_drm_gem_free_object,
+	.gem_free_object = drm_gem_cma_free_object,
 	.mmap_object = drm_gem_or_legacy_mmap_object,
-	.gem_uvm_ops = _drm_gem_uvm_ops,
+	.gem_uvm_ops = _gem_cma_uvm_ops,
 
-	.dumb_create = tegra_drm_dumb_create,
-	.dumb_map_offset = tegra_drm_dumb_map_offset,
+	.dumb_create = drm_gem_cma_dumb_create,
+	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
 	.dumb_destroy = drm_gem_dumb_destroy,
 
 	.get_vblank_counter = tegra_drm_get_vblank_counter,
@@ -283,62 +272,3 @@ tegra_drm_unload(struct drm_device *ddev
 
 	return 0;
 }
-
-static int
-tegra_drm_dumb_create(struct drm_file *file_priv, struct drm_device *ddev,
-struct drm_mode_create_dumb *args)
-{
-	struct tegra_gem_object *obj;
-	uint32_t handle;
-	int error;
-
-	args->pitch = args->width * ((args->bpp + 7) / 8);
-	args->size = args->pitch * args->height;
-	args->size = roundup(args->size, PAGE_SIZE);
-	args->handle = 0;
-
-	obj = tegra_drm_obj_alloc(ddev, args->size);
-	if (obj == NULL)
-		return -ENOMEM;
-
-	error = drm_gem_handle_create(file_priv, >base, );
-	drm_gem_object_unreference_unlocked(>base);
-	if (error) {
-		tegra_drm_obj_free(obj);
-		return error;
-	}
-
-	args->handle = handle;
-
-	return 0;
-}
-
-static int
-tegra_drm_dumb_map_offset(struct drm_file *file_priv,
-struct drm_device *ddev, uint32_t handle, uint64_t *offset)
-{
-	struct drm_gem_object *gem_obj;
-	struct tegra_gem_object *obj;
-	int error;
-
-	gem_obj = drm_gem_object_lookup(ddev, file_priv, handle);
-	if (gem_obj == NULL)
-		return -ENOENT;
-
-	obj = to_tegra_gem_obj(gem_obj);
-
-	if (drm_vma_node_has_offset(>base.vma_node) == 0) {
-		error = drm_gem_create_mmap_offset(>base);
-		if (error)
-			goto done;
-	} else {
-		error = 0;
-	}
-
-	*offset = 

CVS commit: src/sys/external/bsd/drm2

2017-12-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 26 14:53:12 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_gem_cma_helper.h
src/sys/external/bsd/drm2/drm: files.drmkms
Added Files:
src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c

Log Message:
Implement the DRM GEM/CMA helpers. The implementation has been extracted
from our tegra DRM driver, but generalized for use with other drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/drm/files.drmkms

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h:1.1.1.1 src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h:1.2
--- src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h:1.1.1.1	Wed Jul 16 19:35:30 2014
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_gem_cma_helper.h	Tue Dec 26 14:53:12 2017
@@ -5,8 +5,15 @@
 
 struct drm_gem_cma_object {
 	struct drm_gem_object base;
+#ifdef __NetBSD__
+	bus_dma_tag_t dmat;
+	bus_dma_segment_t dmasegs[1];
+	bus_size_t dmasize;
+	bus_dmamap_t dmamap;
+#else
 	dma_addr_t paddr;
 	struct sg_table *sgt;
+#endif
 
 	/* For objects with DMA memory allocated by GEM CMA */
 	void *vaddr;
@@ -36,7 +43,11 @@ int drm_gem_cma_mmap(struct file *filp, 
 struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
 		unsigned int size);
 
+#ifdef __NetBSD__
+extern const struct uvm_pagerops drm_gem_cma_uvm_ops;
+#else
 extern const struct vm_operations_struct drm_gem_cma_vm_ops;
+#endif
 
 #ifdef CONFIG_DEBUG_FS
 void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m);

Index: src/sys/external/bsd/drm2/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.13 src/sys/external/bsd/drm2/drm/files.drmkms:1.14
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.13	Wed Feb 24 22:04:15 2016
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Tue Dec 26 14:53:12 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.13 2016/02/24 22:04:15 skrll Exp $
+#	$NetBSD: files.drmkms,v 1.14 2017/12/26 14:53:12 jmcneill Exp $
 
 include "external/bsd/drm2/linux/files.drmkms_linux"
 
@@ -68,6 +68,7 @@ file	external/bsd/drm2/drm/drm_vm.c			dr
 file	external/bsd/drm2/drm/drm_vma_manager.c		drmkms
 
 file	external/bsd/drm2/drm/drm_gem_vm.c		drmkms
+file	external/bsd/drm2/drm/drm_gem_cma_helper.c	drmkms
 file	external/bsd/drm2/drm/drm_module.c		drmkms
 file	external/bsd/drm2/drm/drm_sysctl.c		drmkms
 
@@ -75,4 +76,4 @@ file	external/bsd/drm2/drm/drm_sysctl.c	
 define	drmfb: genfb
 file	external/bsd/drm2/drm/drmfb.c			drmfb
 
-include "external/bsd/drm2/ttm/files.ttm"
+include "external/bsd/drm2/ttm/files.ttm"	

Added files:

Index: src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
diff -u /dev/null src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.1
--- /dev/null	Tue Dec 26 14:53:12 2017
+++ src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c	Tue Dec 26 14:53:12 2017
@@ -0,0 +1,221 @@
+/* $NetBSD: drm_gem_cma_helper.c,v 1.1 2017/12/26 14:53:12 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015-2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.1 2017/12/26 14:53:12 jmcneill Exp $");
+
+#include 
+#include 
+
+#include 
+
+struct drm_gem_cma_object *

CVS commit: src/sys/modules/lua

2017-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 26 12:43:59 UTC 2017

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

Log Message:
Fix cargo cult ioctl implementation for LUAINFO: the name and desc fields
are arrays, not pointers, so don't use copyoutstr on them, but instead
copyin/copyout the whole array of structures.
Fixes PR 52864 for me (on sparc64).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/modules/lua/lua.c:1.24
--- src/sys/modules/lua/lua.c:1.23	Sat May 20 09:46:17 2017
+++ src/sys/modules/lua/lua.c	Tue Dec 26 12:43:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.23 2017/05/20 09:46:17 mbalmer Exp $ */
+/*	$NetBSD: lua.c,v 1.24 2017/12/26 12:43:59 martin Exp $ */
 
 /*
  * Copyright (c) 2011 - 2017 by Marc Balmer .
@@ -288,6 +288,7 @@ luaioctl(dev_t dev, u_long cmd, void *da
 	struct pathbuf *pb;
 	struct vattr va;
 	struct lua_loadstate ls;
+	struct lua_state_info *states;
 	int error, n;
 	klua_State *K;
 
@@ -307,14 +308,25 @@ luaioctl(dev_t dev, u_long cmd, void *da
 			LIST_FOREACH(s, _states, lua_next) {
 if (n > info->num_states)
 	break;
-copyoutstr(s->lua_name, info->states[n].name,
-MAX_LUA_NAME, NULL);
-copyoutstr(s->lua_desc, info->states[n].desc,
-MAX_LUA_DESC, NULL);
-info->states[n].user = s->K->ks_user;
 n++;
 			}
 			info->num_states = n;
+			states = kmem_alloc(sizeof(*states) * n, KM_SLEEP);
+			if (copyin(info->states, states, sizeof(*states) * n)
+			== 0) {
+n = 0;
+LIST_FOREACH(s, _states, lua_next) {
+	if (n > info->num_states)
+		break;
+	strcpy(states[n].name, s->lua_name);
+	strcpy(states[n].desc, s->lua_desc);
+	states[n].user = s->K->ks_user;
+	n++;
+}
+copyout(states, info->states,
+sizeof(*states) * n);
+kmem_free(states, sizeof(*states) * n);
+			}
 		}
 		break;
 	case LUACREATE:



CVS commit: src

2017-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 26 11:40:47 UTC 2017

Modified Files:
src: UPDATING

Log Message:
Note build fallout from vadvise removal.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.287 src/UPDATING:1.288
--- src/UPDATING:1.287	Fri Oct 13 07:04:58 2017
+++ src/UPDATING	Tue Dec 26 11:40:47 2017
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.287 2017/10/13 07:04:58 kre Exp $
+$NetBSD: UPDATING,v 1.288 2017/12/26 11:40:47 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,13 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20171225:
+	removal of the vadvise syscall requires manual removal of all
+	associated files from the libc build object directory (including
+	the .depend files) - a command like
+		cd $OBJ && find . -type d -name libc | xargs rm -rf
+	or a one time build without -u will do.
+
 20171010:
 	a change to the build structure of external/bsd/acpica/bin/iasl
 	means that its objdir (or *.d and .depend at least) might need



CVS commit: src/sys

2017-12-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 26 08:30:58 UTC 2017

Modified Files:
src/sys/compat/linux/arch/alpha: linux_pipe.c
src/sys/compat/linux/common: linux_pipe.c
src/sys/compat/linux32/common: linux32_unistd.c
src/sys/compat/netbsd32: netbsd32_netbsd.c
src/sys/kern: sys_descrip.c sys_pipe.c uipc_syscalls.c
src/sys/sys: filedesc.h

Log Message:
Refactor pipe1() and correct a bug in sys_pipe2() (SYS_pipe2)

sys_pipe2() returns two integers (values), the 2nd one is a copy of the 2nd
file descriptor that lands in fildes[2]. This is a side effect of reusing
the code for sys_pipe() (SYS_pipe) and not cleaning it up.

The first returned value is (on success) 0.

Introduced a small refactoring in pipe1() that it does not operate over
retval[], but on an array int[2]. A user sets retval[] for pipe() when
desired and needed.

This refactoring touches compat code: netbsd32, linux, linux32.

Before the changes on NetBSD/amd64:

$ ktruss -i ./a.out
[...]
 15131  1 a.outpipe2(0x7f7fff2e62b8, 0)= 0, 4
[...]

After the changes:

$ ktruss -i ./a.out
[...]
   782  1 a.outpipe2(0x7f7fff97e850, 0)= 0
[...]

There should not be a visible change for current users.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux/arch/alpha/linux_pipe.c
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/common/linux_pipe.c
cvs rdiff -u -r1.39 -r1.40 src/sys/compat/linux32/common/linux32_unistd.c
cvs rdiff -u -r1.211 -r1.212 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/sys_descrip.c
cvs rdiff -u -r1.142 -r1.143 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.187 -r1.188 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.63 -r1.64 src/sys/sys/filedesc.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/compat/linux/arch/alpha/linux_pipe.c
diff -u src/sys/compat/linux/arch/alpha/linux_pipe.c:1.17 src/sys/compat/linux/arch/alpha/linux_pipe.c:1.18
--- src/sys/compat/linux/arch/alpha/linux_pipe.c:1.17	Sun Nov  9 17:48:07 2014
+++ src/sys/compat/linux/arch/alpha/linux_pipe.c	Tue Dec 26 08:30:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pipe.c,v 1.17 2014/11/09 17:48:07 maxv Exp $	*/
+/*	$NetBSD: linux_pipe.c,v 1.18 2017/12/26 08:30:57 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.17 2014/11/09 17:48:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.18 2017/12/26 08:30:57 kamil Exp $");
 
 #include 
 #include 
@@ -62,12 +62,13 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c
 int
 linux_sys_pipe(struct lwp *l, const void *v, register_t *retval)
 {
-	int error;
+	int fd[2], error;
 
-	if ((error = pipe1(l, retval, 0)))
+	if ((error = pipe1(l, fd, 0)))
 		return error;
 
-	(l->l_md.md_tf)->tf_regs[FRAME_A4] = retval[1];
+	retval[0] = fd[0];
+	(l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1];
 	return 0;
 }
 
@@ -79,16 +80,17 @@ linux_sys_pipe2(struct lwp *l, const str
 		syscallarg(int *) pfds;
 		syscallarg(int) flags;
 	} */
-	int error, flags;
+	int fd[2], error, flags;
 
 	flags = linux_to_bsd_ioflags(SCARG(uap, flags));
 	if ((flags & ~(O_CLOEXEC|O_NONBLOCK)) != 0)
 		return EINVAL;
 
-	if ((error = pipe1(l, retval, flags)))
+	if ((error = pipe1(l, fd, flags)))
 		return error;
 
-	(l->l_md.md_tf)->tf_regs[FRAME_A4] = retval[1];
+	retval[0] = fd[0];
+	(l->l_md.md_tf)->tf_regs[FRAME_A4] = fd[1];
 
 	return 0;
 }

Index: src/sys/compat/linux/common/linux_pipe.c
diff -u src/sys/compat/linux/common/linux_pipe.c:1.67 src/sys/compat/linux/common/linux_pipe.c:1.68
--- src/sys/compat/linux/common/linux_pipe.c:1.67	Sun Nov  9 17:48:08 2014
+++ src/sys/compat/linux/common/linux_pipe.c	Tue Dec 26 08:30:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pipe.c,v 1.67 2014/11/09 17:48:08 maxv Exp $	*/
+/*	$NetBSD: linux_pipe.c,v 1.68 2017/12/26 08:30:57 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.67 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.68 2017/12/26 08:30:57 kamil Exp $");
 
 #include 
 #include 
@@ -57,31 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c
 /* Not used on: alpha, mips, sparc, sparc64 */
 /* Alpha, mips, sparc and sparc64 pass one of the fds in a register */
 
-/*
- * NetBSD passes fd[0] in retval[0], and fd[1] in retval[1].
- * Linux directly passes the pointer.
- */
-static int
-linux_pipe_return(struct lwp *l, int *pfds, register_t *retval)
-{
-	int error;
-
-	if (sizeof(*retval) != sizeof(*pfds)) {
-		/* On amd64, sizeof(register_t) != sizeof(int) */
-		int rpfds[2];
-		rpfds[0] = (int)retval[0];
-		rpfds[1] = (int)retval[1];
-
-		if ((error = copyout(rpfds, pfds, sizeof(rpfds
-			return error;
-	} else {
-		if ((error