CVS commit: src/sys/dev/ic

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Jul 30 05:51:34 UTC 2017

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

Log Message:
Improve diagnostic code.
If the specified encoding is wrong, it outputs a sound like a buzzer :)
rather than panic.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/msm6258.c

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

Modified files:

Index: src/sys/dev/ic/msm6258.c
diff -u src/sys/dev/ic/msm6258.c:1.19 src/sys/dev/ic/msm6258.c:1.20
--- src/sys/dev/ic/msm6258.c:1.19	Thu Jul 27 07:53:54 2017
+++ src/sys/dev/ic/msm6258.c	Sun Jul 30 05:51:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msm6258.c,v 1.19 2017/07/27 07:53:54 isaki Exp $	*/
+/*	$NetBSD: msm6258.c,v 1.20 2017/07/30 05:51:34 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msm6258.c,v 1.19 2017/07/27 07:53:54 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msm6258.c,v 1.20 2017/07/30 05:51:34 isaki Exp $");
 
 #include 
 #include 
@@ -75,6 +75,8 @@ static const int adpcm_estimstep[16] = {
 	-1, -1, -1, -1, 2, 4, 6, 8
 };
 
+static int16_t buzzer;	/* sound for debug */
+
 static stream_filter_t *
 msm6258_factory(struct audio_softc *asc,
 int (*fetch_to)(struct audio_softc *, stream_fetcher_t *, audio_stream_t *, int))
@@ -181,11 +183,7 @@ DEFINE_FILTER(msm6258_slinear16_to_adpcm
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 2);
 		}
-#if defined(DIAGNOSTIC)
 	} else if (enc_src == AUDIO_ENCODING_SLINEAR_BE) {
-#else
-	} else {
-#endif
 		while (dst->used < m && this->src->used >= 4) {
 			uint8_t f;
 			int16_t ss;
@@ -205,12 +203,18 @@ DEFINE_FILTER(msm6258_slinear16_to_adpcm
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 2);
 		}
-	}
+	} else {
 #if defined(DIAGNOSTIC)
-	else {
 		panic("msm6258_slinear16_to_adpcm: unsupported enc_src(%d)", enc_src);
-	}
 #endif
+		/* dummy run */
+		while (dst->used < m && this->src->used >= 4) {
+			s = audio_stream_add_outp(this->src, s, 2);
+			s = audio_stream_add_outp(this->src, s, 2);
+			*d = buzzer++;
+			d = audio_stream_add_inp(dst, d, 1);
+		}
+	}
 	dst->inp = d;
 	this->src->outp = s;
 	return 0;
@@ -247,12 +251,8 @@ DEFINE_FILTER(msm6258_linear8_to_adpcm)
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-#if defined(DIAGNOSTIC)
 	} else if (enc_src == AUDIO_ENCODING_ULINEAR_LE
 	|| enc_src == AUDIO_ENCODING_ULINEAR_BE) {
-#else
-	} else {
-#endif
 		while (dst->used < m && this->src->used >= 4) {
 			uint8_t f;
 			int16_t ss;
@@ -265,12 +265,18 @@ DEFINE_FILTER(msm6258_linear8_to_adpcm)
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-	}
+	} else {
 #if defined(DIAGNOSTIC)
-	else {
 		panic("msm6258_linear8_to_adpcm: unsupported enc_src(%d)", enc_src);
-	}
 #endif
+		/* dummy run */
+		while (dst->used < m && this->src->used >= 4) {
+			s = audio_stream_add_outp(this->src, s, 1);
+			s = audio_stream_add_outp(this->src, s, 1);
+			*d = buzzer++;
+			d = audio_stream_add_inp(dst, d, 1);
+		}
+	}
 	dst->inp = d;
 	this->src->outp = s;
 	return 0;
@@ -336,11 +342,7 @@ DEFINE_FILTER(msm6258_adpcm_to_slinear16
 			d = audio_stream_add_inp(dst, d, 2);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-#if defined(DIAGNOSTIC)
 	} else if (enc_dst == AUDIO_ENCODING_SLINEAR_BE) {
-#else
-	} else {
-#endif
 		while (dst->used < m && this->src->used >= 1) {
 			uint8_t a;
 			int16_t s1, s2;
@@ -361,12 +363,19 @@ DEFINE_FILTER(msm6258_adpcm_to_slinear16
 			d = audio_stream_add_inp(dst, d, 2);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-	}
+	} else {
 #if defined(DIAGNOSTIC)
-	else {
 		panic("msm6258_adpcm_to_slinear16: unsupported enc_dst(%d)", enc_dst);
-	}
 #endif
+		/* dummy run */
+		while (dst->used < m && this->src->used >= 1) {
+			*d = buzzer++;
+			d = audio_stream_add_inp(dst, d, 2);
+			*d = buzzer++;
+			d = audio_stream_add_inp(dst, d, 2);
+			s = audio_stream_add_outp(this->src, s, 1);
+		}
+	}
 	dst->inp = d;
 	this->src->outp = s;
 	return 0;
@@ -403,11 +412,7 @@ DEFINE_FILTER(msm6258_adpcm_to_linear8)
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-#if defined(DIAGNOSTIC)
 	} else if (enc_dst == AUDIO_ENCODING_ULINEAR_LE) {
-#else
-	} else {
-#endif
 		while (dst->used < m && this->src->used >= 1) {
 			uint8_t a;
 			int16_t s1, s2;
@@ -420,12 +425,19 @@ DEFINE_FILTER(msm6258_adpcm_to_linear8)
 			d = audio_stream_add_inp(dst, d, 1);
 			s = audio_stream_add_outp(this->src, s, 1);
 		}
-	}
+	} else {
 #if defined(DIAGNOSTIC)
-	else {
 		panic("msm6258_adpcm_to_linear8: unsupported enc_dst(%d)", enc_dst);
-	}
 #endif
+		/* dummy run */
+		while (dst->used < m && this->src->used >= 1) {
+			*d = buzzer++;
+			d = 

CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Jul 30 02:41:58 UTC 2017

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

Log Message:
Typo in debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.383 -r1.384 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.383 src/sys/dev/audio.c:1.384
--- src/sys/dev/audio.c:1.383	Sun Jul 30 00:47:48 2017
+++ src/sys/dev/audio.c	Sun Jul 30 02:41:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.384 2017/07/30 02:41:58 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.384 2017/07/30 02:41:58 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1429,7 +1429,7 @@ audio_setup_rfilters(struct audio_softc 
 
 #ifdef AUDIO_DEBUG
 	if (audiodebug) {
-		printf("%s: HW-buffer=%p pustream=%p\n",
+		printf("%s: HW-buffer=%p rustream=%p\n",
 		   __func__, >sc_mrr.s, vc->sc_rustream);
 		audio_print_params("[HW]", >sc_mrr.s.param);
 		for (i = 0; i < rfilters->req_size; i++) {



CVS commit: src/sys/modules/audio

2017-07-29 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jul 30 00:53:58 UTC 2017

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

Log Message:
Audio now compiles with WARNS=5, so there is no need to specify WARNS=3.


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

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

Modified files:

Index: src/sys/modules/audio/Makefile
diff -u src/sys/modules/audio/Makefile:1.1 src/sys/modules/audio/Makefile:1.2
--- src/sys/modules/audio/Makefile:1.1	Thu Jun  1 09:58:27 2017
+++ src/sys/modules/audio/Makefile	Sun Jul 30 00:53:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2017/06/01 09:58:27 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.2 2017/07/30 00:53:57 nat Exp $
 
 .include "../Makefile.inc"
 
@@ -14,9 +14,4 @@ SRCS=	audio.c \
 
 CPPFLAGS+=	-DNAUDIO=1 -DNAURATECONV=1 -DNMULAW=1
 
-# Rather than our usual WARNS=4, we need to use 3, since there are a
-# lot of signed-vs-unsigned compares
-
-WARNS=	3
-
 .include 



CVS commit: src/sys/dev/pad

2017-07-29 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jul 30 00:50:52 UTC 2017

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

Log Message:
The pad module will now compile with WARNS=5.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pad/pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.41 src/sys/dev/pad/pad.c:1.42
--- src/sys/dev/pad/pad.c:1.41	Sun Jul  2 13:32:50 2017
+++ src/sys/dev/pad/pad.c	Sun Jul 30 00:50:52 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.41 2017/07/02 13:32:50 nat Exp $ */
+/* $NetBSD: pad.c,v 1.42 2017/07/30 00:50:52 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.41 2017/07/02 13:32:50 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.42 2017/07/30 00:50:52 nat Exp $");
 
 #include 
 #include 
@@ -241,7 +241,7 @@ pad_get_block(pad_softc_t *sc, pad_block
 	KASSERT(mutex_owned(>sc_lock));
 	KASSERT(pb != NULL);
 
-	if (sc->sc_buflen < blksize)
+	if (sc->sc_buflen < (uint)blksize)
 		return ERESTART;
 
 	pb->pb_ptr = (sc->sc_audiobuf + sc->sc_rpos);



CVS commit: src/sys/dev

2017-07-29 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Jul 30 00:47:48 UTC 2017

Modified Files:
src/sys/dev: auconv.c audio.c audiovar.h aurateconv.c

Log Message:
The audio module will now compile with WARNS=5.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/auconv.c
cvs rdiff -u -r1.382 -r1.383 src/sys/dev/audio.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/audiovar.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/aurateconv.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/auconv.c
diff -u src/sys/dev/auconv.c:1.30 src/sys/dev/auconv.c:1.31
--- src/sys/dev/auconv.c:1.30	Fri Jul 28 01:36:40 2017
+++ src/sys/dev/auconv.c	Sun Jul 30 00:47:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.c,v 1.30 2017/07/28 01:36:40 nat Exp $	*/
+/*	$NetBSD: auconv.c,v 1.31 2017/07/30 00:47:48 nat Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.30 2017/07/28 01:36:40 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.31 2017/07/30 00:47:48 nat Exp $");
 
 #include 
 #include 
@@ -928,7 +928,7 @@ auconv_rateconv_check_rates(const struct
 			if (formats[i].frequency[1] > maxrate)
 maxrate = formats[i].frequency[1];
 		} else {
-			for (j = 0; j < formats[i].frequency_type; j++) {
+			for (j = 0; j < (int)formats[i].frequency_type; j++) {
 if (formats[i].frequency[j] < minrate)
 	minrate = formats[i].frequency[j];
 if (formats[i].frequency[j] > maxrate)

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.382 src/sys/dev/audio.c:1.383
--- src/sys/dev/audio.c:1.382	Sat Jul 29 06:45:35 2017
+++ src/sys/dev/audio.c	Sun Jul 30 00:47:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.383 2017/07/30 00:47:48 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -206,7 +206,7 @@ int	audiodebug = AUDIO_DEBUG;
 #endif
 
 #define ROUNDSIZE(x)	(x) &= -16	/* round to nice boundary */
-#define SPECIFIED(x)	((x) != ~0)
+#define SPECIFIED(x)	((int)(x) != ~0)
 #define SPECIFIED_CH(x)	((x) != (u_char)~0)
 
 /* #define AUDIO_PM_IDLE */
@@ -1986,7 +1986,7 @@ audio_init_ringbuffer(struct audio_softc
 	blksize = rp->blksize;
 	if (blksize < AUMINBLK)
 		blksize = AUMINBLK;
-	if (blksize > rp->s.bufsize / AUMINNOBLK)
+	if (blksize > (int)(rp->s.bufsize / AUMINNOBLK))
 		blksize = rp->s.bufsize / AUMINNOBLK;
 	ROUNDSIZE(blksize);
 	DPRINTF(("audio_init_ringbuffer: MI blksize=%d\n", blksize));
@@ -2348,8 +2348,8 @@ audio_drain(struct audio_softc *sc, stru
 {
 	struct audio_ringbuffer *cb;
 	struct virtual_channel *vc;
-	int error, drops;
-	int cc, i, used;
+	int error, cc, i, used;
+	uint drops;
 	bool hw = false;
 
 	KASSERT(mutex_owned(sc->sc_lock));
@@ -2537,7 +2537,8 @@ audio_read(struct audio_softc *sc, struc
 	struct audio_ringbuffer *cb;
 	const uint8_t *outp;
 	uint8_t *inp;
-	int error, used, cc, n;
+	int error, used, n;
+	uint cc;
 
 	KASSERT(mutex_owned(sc->sc_lock));
 
@@ -3445,7 +3446,7 @@ audio_mmap(struct audio_softc *sc, off_t
 	cb = >sc_mpr;
 #endif
 
-	if (len > cb->s.bufsize || *offp > cb->s.bufsize - len)
+	if (len > cb->s.bufsize || *offp > (uint)(cb->s.bufsize - len))
 		return EOVERFLOW;
 
 	if (!cb->mmapped) {
@@ -4524,7 +4525,7 @@ audiosetinfo(struct audio_softc *sc, str
 	int setmode;
 	int error;
 	int np, nr;
-	unsigned int blks;
+	int blks;
 	u_int gain;
 	bool rbus, pbus;
 	bool cleared, modechange, pausechange;
@@ -6063,7 +6064,8 @@ vchan_autoconfig(struct audio_softc *sc)
 {
 	struct audio_chan *chan;
 	struct virtual_channel *vc;
-	int error, i, j, k;
+	uint i, j, k;
+	int error;
 
 	chan = SIMPLEQ_FIRST(>sc_audiochan);
 	vc = chan->vc;

Index: src/sys/dev/audiovar.h
diff -u src/sys/dev/audiovar.h:1.59 src/sys/dev/audiovar.h:1.60
--- src/sys/dev/audiovar.h:1.59	Sat Jul 29 03:05:51 2017
+++ src/sys/dev/audiovar.h	Sun Jul 30 00:47:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiovar.h,v 1.59 2017/07/29 03:05:51 isaki Exp $	*/
+/*	$NetBSD: audiovar.h,v 1.60 2017/07/30 00:47:48 nat Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -164,8 +164,8 @@ struct au_mixer_ports {
 	bool	isenum;		/* selector is enum type */
 	u_int	allports;	/* all aumasks or'd */
 	u_int	aumask[AUDIO_N_PORTS];	/* exposed value of "ports" */
-	u_int	misel [AUDIO_N_PORTS];	/* ord of port, for selector */
-	u_int	miport[AUDIO_N_PORTS];	/* index of port's mixerctl */
+	int	misel [AUDIO_N_PORTS];	/* ord of port, for selector */
+	int	miport[AUDIO_N_PORTS];	/* index of port's mixerctl */
 	bool	isdual;		/* has working mixerout */
 	int	mixerout;	/* ord of mixerout, 

CVS commit: src/doc

2017-07-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul 29 23:10:36 UTC 2017

Modified Files:
src/doc: 3RDPARTY

Log Message:
dts updated to 4.12.4


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1460 src/doc/3RDPARTY:1.1461
--- src/doc/3RDPARTY:1.1460	Fri Jul 28 22:53:32 2017
+++ src/doc/3RDPARTY	Sat Jul 29 23:10:36 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1460 2017/07/28 22:53:32 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1461 2017/07/29 23:10:36 jmcneill Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1717,8 +1717,8 @@ Notes:
 external/gpl2/dtc/dtc2netbsd should be used to create directories to import
 
 Package:	dts
-Version:	4.12.3
-Current Vers:	4.12.3
+Version:	4.12.4
+Current Vers:	4.12.4
 Maintainer:	https://www.kernel.org/
 Archive Site:	https://cdn.kernel.org/pub/linux/kernel/v4.x/
 Home Page:	https://www.kernel.org/



CVS commit: src/sys/external/gpl2/dts/dist

2017-07-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul 29 23:09:10 UTC 2017

Added Files:
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts:
sun8i-a23-ippo-q8h-v1.2.dts sun8i-a23-ippo-q8h-v5.dts
sun8i-a33-et-q8-v1.6.dts sun8i-a33-ippo-q8h-v1.2.dts
src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/arm:
vexpress-v2m-rs1.dtsi
src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/broadcom:
bcm2835-rpi.dtsi bcm283x-rpi-smsc9514.dtsi
bcm283x-rpi-usb-host.dtsi bcm283x.dtsi
src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/socionext:
uniphier-pinctrl.dtsi uniphier-ref-daughter.dtsi
uniphier-support-card.dtsi
src/sys/external/gpl2/dts/dist/include/dt-bindings/input:
linux-event-codes.h

Log Message:
merge


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 \

src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts
cvs rdiff -u -r0 -r1.3 \
src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi
cvs rdiff -u -r0 -r1.3 \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi
 \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
 \
src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/broadcom/bcm283x.dtsi
cvs rdiff -u -r0 -r1.3 \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/socionext/uniphier-pinctrl.dtsi
 \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/socionext/uniphier-ref-daughter.dtsi
 \

src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/socionext/uniphier-support-card.dtsi
cvs rdiff -u -r0 -r1.3 \
src/sys/external/gpl2/dts/dist/include/dt-bindings/input/linux-event-codes.h

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

Added files:

Index: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts
diff -u /dev/null src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts:1.3
--- /dev/null	Sat Jul 29 23:09:10 2017
+++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts	Sat Jul 29 23:09:09 2017
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2015 Hans de Goede 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a23.dtsi"
+#include "sun8i-q8-common.dtsi"
+
+/ {
+	model = "Q8 A23 Tablet";
+	compatible = "allwinner,q8-a23", "allwinner,sun8i-a23";
+};
+
+ {
+	allwinner,pa-gpios = < 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	allwinner,audio-routing =
+		"Headphone", "HP",
+		"Headphone", "HPCOM",
+		"Speaker", "HP",
+		"MIC1", "Mic",
+		"MIC2", 

CVS commit: src/sys/external/gpl2/dts

2017-07-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jul 29 23:06:22 UTC 2017

Modified Files:
src/sys/external/gpl2/dts: dts2netbsd

Log Message:
Use cp -RL to follow symlinks


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/gpl2/dts/dts2netbsd

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/gpl2/dts/dts2netbsd
diff -u src/sys/external/gpl2/dts/dts2netbsd:1.2 src/sys/external/gpl2/dts/dts2netbsd:1.3
--- src/sys/external/gpl2/dts/dts2netbsd:1.2	Thu Jun 15 20:22:44 2017
+++ src/sys/external/gpl2/dts/dts2netbsd	Sat Jul 29 23:06:22 2017
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: dts2netbsd,v 1.2 2017/06/15 20:22:44 jmcneill Exp $ */
+#	$NetBSD: dts2netbsd,v 1.3 2017/07/29 23:06:22 jmcneill Exp $ */
 #
 # Copyright (c) 2013, 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -72,11 +72,11 @@ echo copying $r to $d
 cd $r
 
 mkdir -p $d/include
-cp -r $r/include/dt-bindings $d/include
+cp -RL $r/include/dt-bindings $d/include
 
 for arch in arm arm64 mips; do
 	mkdir -p $d/arch/${arch}/boot
-	cp -r $r/arch/${arch}/boot/dts $d/arch/${arch}/boot
+	cp -RL $r/arch/${arch}/boot/dts $d/arch/${arch}/boot
 	rm -rf $d/arch/${arch}/boot/dts/include
 done
 



CVS commit: src/share/man/man8

2017-07-29 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jul 29 22:47:55 UTC 2017

Modified Files:
src/share/man/man8: compat_svr4.8

Log Message:
Standardize NAME section.

Remove unneeded troff macros.

XXX: this is still MLINKed as names that are not in Nm.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man8/compat_svr4.8

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

Modified files:

Index: src/share/man/man8/compat_svr4.8
diff -u src/share/man/man8/compat_svr4.8:1.28 src/share/man/man8/compat_svr4.8:1.29
--- src/share/man/man8/compat_svr4.8:1.28	Sat Jul 29 12:15:12 2017
+++ src/share/man/man8/compat_svr4.8	Sat Jul 29 22:47:55 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: compat_svr4.8,v 1.28 2017/07/29 12:15:12 maxv Exp $
+.\"	$NetBSD: compat_svr4.8,v 1.29 2017/07/29 22:47:55 wiz Exp $
 .\"
 .\" Copyright (c) 1996 Christos Zoulas
 .\" All rights reserved.
@@ -29,10 +29,9 @@
 .Dt COMPAT_SVR4 8
 .Os
 .Sh NAME
-.Nm compat_svr4
-.Nd setup procedure for running SVR4/iBCS2 binaries
+.Nm compat_svr4 ,
 .Nm compat_svr4_32
-.Nd setup procedure for running 32-bit SVR4/iBCS2 binaries
+.Nd setup procedure for running (32-bit) SVR4/iBCS2 binaries
 .Sh DESCRIPTION
 .Nx
 supports running SVR4/iBCS2 binaries.
@@ -144,11 +143,8 @@ Make the necessary directories:
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@netbsd) mkdir -p /emul/svr4/{dev,etc}
-.br
 .It (me@netbsd) mkdir -p /emul/svr4/usr/{bin,lib,ucblib}
-.br
 .It (me@netbsd) mkdir -p /emul/svr4/usr/openwin/{bin,lib}
-.br
 .It (me@netbsd) mkdir -p /emul/svr4/usr/dt/{bin,lib}
 .El
 .Pp
@@ -157,37 +153,25 @@ Copy files from an svr4 system:
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@svr4) cd /usr/lib
-.br
 .It (me@svr4) tar -cf -\ . | \e
-.in +5
 .It rsh netbsd 'cd /emul/svr4/usr/lib && tar -xpf -'
-.in -5
 .El
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@svr4) cd /usr/ucblib
-.br
 .It (me@svr4) tar -cf -\ . | \e
-.in +5
 .It rsh netbsd 'cd /emul/svr4/usr/ucblib && tar -xpf -'
-.in -5
 .El
 .Pp
 If you are running openwindows:
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@svr4) cd /usr/openwin/lib
-.br
 .It (me@svr4) tar -cf -\ . | \e
-.in +5
 .It rsh netbsd 'cd /emul/svr4/usr/openwin/lib && tar -xpf -'
-.in -5
 .It (me@svr4) cd /usr/dt/lib
-.br
 .It (me@svr4) tar -cf -\ . | \e
-.in +5
 .It rsh netbsd 'cd /emul/svr4/usr/dt/lib && tar -xpf -'
-.in -5
 .El
 .It
 You will also probably need the timezone files from your Solaris
@@ -195,30 +179,20 @@ system, otherwise emulated binaries will
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@netbsd) mkdir -p /emul/svr4/usr/share/lib/zoneinfo
-.br
 .It (me@netbsd) mkdir -p /emul/svr4/etc/default
-.br
 .It (me@svr4) cd /usr/share/lib/zoneinfo
-.br
 .It (me@solaris) tar -cf - . | \e
-.in +5
 .It rsh netbsd 'cd /emul/svr4/usr/share/lib/zoneinfo &&
 .It tar -xpf -'
-.in -5
-.br
 .It (me@netbsd) echo TZ=US/Pacific > /emul/svr4/etc/default/init
-.br
 .El
 .It
 Set up the configuration files and devices:
 .Pp
 .Bl -tag -width 123 -compact -offset indent
 .It (me@netbsd) cd /usr/share/examples/emul/svr4/etc
-.br
 .It (me@netbsd) cp netconfig nsswitch.conf /emul/svr4/etc
-.br
 .It (me@netbsd) cp SVR4_MAKEDEV /emul/svr4/dev
-.br
 .It (me@netbsd) cd /emul/svr4/dev && sh SVR4_MAKEDEV all
 .El
 .Pp



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 22:40:04 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisatareg.h

Log Message:
add macro for getting the slot from context register, just for reference for now


To generate a diff of this commit:
cvs rdiff -u -r1.7.42.3 -r1.7.42.4 src/sys/dev/ic/siisatareg.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/ic/siisatareg.h
diff -u src/sys/dev/ic/siisatareg.h:1.7.42.3 src/sys/dev/ic/siisatareg.h:1.7.42.4
--- src/sys/dev/ic/siisatareg.h:1.7.42.3	Wed Jul 19 20:03:29 2017
+++ src/sys/dev/ic/siisatareg.h	Sat Jul 29 22:40:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisatareg.h,v 1.7.42.3 2017/07/19 20:03:29 jdolecek Exp $ */
+/* $NetBSD: siisatareg.h,v 1.7.42.4 2017/07/29 22:40:04 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2010, 2011 Jonathan A. Kollasch.
@@ -188,6 +188,7 @@ struct siisata_prb {
 #define PRO_CARX(p,s) (PRX(p, PRO_CAR) + (s) * sizeof(uint64_t))
 
 #define PRO_PCR		0x1e04		/* port context register */
+#define PRO_PCR_SLOT(x)	(((x) & __BITS(4, 0)) >> 0) /* Slot */
 #define PRO_PCR_PMP(x)	(((x) & __BITS(8, 5)) >> 5) /* PM Port */
 #define PRO_SCONTROL	0x1f00		/* SControl */
 #define PRO_SSTATUS	0x1f04		/* SStatus */



CVS commit: src/usr.bin/vndcompress

2017-07-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 21:04:07 UTC 2017

Modified Files:
src/usr.bin/vndcompress: common.h offtab.c vndcompress.c
vnduncompress.c

Log Message:
Clarify compile-time and run-time arithmetic safety assertions.

This is an experiment with a handful of macros for writing the
checks, most of which are compile-time:

MUL_OK(t, a, b) Does a*b avoid overflow in type t?
ADD_OK(t, a, b) Does a + b avoid overflow in type t?
TOOMANY(t, x, b, m) Are there more than m b-element blocks in x in type t?
(I.e., does ceiling(x/b) > m?)

Addenda that might make sense but are not needed here:

MUL(t, a, b, )Set p = a*b and return 0, or return ERANGE if overflow.
ADD(t, a, b, )Set s = a+b and return 0, or return ERANGE if overflow.

Example:

uint32_t a = ..., b = ..., y = ..., z = ..., x, w;

/* input validation */
error = MUL(size_t, a, b, );
if (error)
fail;
if (TOOMANY(uint32_t, x, BLKSIZ, MAX_NBLK))
fail;
y = HOWMANY(x, BLKSIZ);
if (z > Z_MAX)
fail;
...
/* internal computation */
__CTASSERT(MUL_OK(uint32_t, Z_MAX, MAX_NBLK));
w = z*y;

Obvious shortcomings:

1. Nothing checks your ctassert matches your subsequent arithmetic.
   (Maybe we could have BOUNDED_MUL(t, x, xmax, y, ymax) with a
   ctassert inside.)

2. Nothing flows the bounds needed by the arithmetic you use back
   into candidate definitions of X_MAX/Y_MAX.

But at least the reviewer's job is only to make sure that (a) the
MUL_OK matches the *, and (b) the bounds in the assertion match the
bounds on the inputs -- in particular, the reviewer need not derive
the bounds from the context, only confirm they are supported by the
paths to it.

This is not meant to be a general-purpose proof assistant, or even a
special-purpose one like gfverif .
Rather, it is an experiment in adding a modicum of compile-time
verification with a simple C API change.

This also is not intended to serve as trapping arithmetic on
overflow.  The goal here is to enable writing the program with
explicit checks on input and compile-time annotations on computation
to gain confident that overflow won't happen in the computation.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/vndcompress/common.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/vndcompress/offtab.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/vndcompress/vndcompress.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/vndcompress/vnduncompress.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/vndcompress/common.h
diff -u src/usr.bin/vndcompress/common.h:1.7 src/usr.bin/vndcompress/common.h:1.8
--- src/usr.bin/vndcompress/common.h:1.7	Sun Apr 16 23:43:57 2017
+++ src/usr.bin/vndcompress/common.h	Sat Jul 29 21:04:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.7 2017/04/16 23:43:57 riastradh Exp $	*/
+/*	$NetBSD: common.h,v 1.8 2017/07/29 21:04:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -83,6 +83,16 @@
 #define	ISSET(t, f)	((t) & (f))
 
 /*
+ * Bounds checks for arithmetic.
+ */
+#define	ADD_OK(T, A, B)	((A) <= __type_max(T) - (B))
+
+#define	MUL_OK(T, A, B)	((A) <= __type_max(T)/(B))
+
+#define	HOWMANY(X, N)		(((X) + ((N) - 1))/(N))
+#define	TOOMANY(T, X, N, M)	(!ADD_OK(T, X, (N) - 1) || HOWMANY(X, N) > (M))
+
+/*
  * We require:
  *
  *   0 < blocksize			(duh)

Index: src/usr.bin/vndcompress/offtab.c
diff -u src/usr.bin/vndcompress/offtab.c:1.14 src/usr.bin/vndcompress/offtab.c:1.15
--- src/usr.bin/vndcompress/offtab.c:1.14	Sun Apr 16 23:50:40 2017
+++ src/usr.bin/vndcompress/offtab.c	Sat Jul 29 21:04:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: offtab.c,v 1.14 2017/04/16 23:50:40 riastradh Exp $	*/
+/*	$NetBSD: offtab.c,v 1.15 2017/07/29 21:04:07 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: offtab.c,v 1.14 2017/04/16 23:50:40 riastradh Exp $");
+__RCSID("$NetBSD: offtab.c,v 1.15 2017/07/29 21:04:07 riastradh Exp $");
 
 #include 
 #include 
@@ -95,18 +95,18 @@ offtab_compute_window_position(struct of
 	const uint32_t window_size = offtab_compute_window_size(offtab,
 	window_start);
 
-	__CTASSERT(MAX_WINDOW_SIZE <= (SIZE_MAX / sizeof(uint64_t)));
+	__CTASSERT(MUL_OK(size_t, MAX_WINDOW_SIZE, sizeof(uint64_t)));
 	*bytes = (window_size * sizeof(uint64_t));
 
 	assert(window_start <= offtab->ot_n_offsets);
-	__CTASSERT(MAX_N_OFFSETS <= (OFF_MAX / sizeof(uint64_t)));
+	__CTASSERT(MUL_OK(off_t, MAX_N_OFFSETS, sizeof(uint64_t)));
 	const off_t window_offset = ((off_t)window_start *
 	(off_t)sizeof(uint64_t));
 
 	assert(offtab->ot_fdpos <= OFFTAB_MAX_FDPOS);
-	__CTASSERT(OFFTAB_MAX_FDPOS <=
-	(OFF_MAX - 

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

2017-07-29 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Jul 29 19:39:58 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386

Log Message:
If i386/svr4_machdep.h is no longer to be installed in /usr/include
it should no longer be listed in the sets lists as installed.
Mark it obsolete (hopefully unbreak builds.)


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/comp/md.i386

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

Modified files:

Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.243 src/distrib/sets/lists/comp/md.amd64:1.244
--- src/distrib/sets/lists/comp/md.amd64:1.243	Thu Feb 23 03:34:22 2017
+++ src/distrib/sets/lists/comp/md.amd64	Sat Jul 29 19:39:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.243 2017/02/23 03:34:22 kamil Exp $
+# $NetBSD: md.amd64,v 1.244 2017/07/29 19:39:58 kre Exp $
 
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
@@ -468,7 +468,7 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
-./usr/include/i386/svr4_machdep.h		comp-c-include
+./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.167 src/distrib/sets/lists/comp/md.i386:1.168
--- src/distrib/sets/lists/comp/md.i386:1.167	Wed Mar  8 22:55:20 2017
+++ src/distrib/sets/lists/comp/md.i386	Sat Jul 29 19:39:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.167 2017/03/08 22:55:20 kre Exp $
+# $NetBSD: md.i386,v 1.168 2017/07/29 19:39:58 kre Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -400,7 +400,7 @@
 ./usr/include/i386/specialreg.h			comp-c-include
 ./usr/include/i386/spkr.h			comp-c-include
 ./usr/include/i386/stdarg.h			comp-obsolete		obsolete
-./usr/include/i386/svr4_machdep.h		comp-c-include
+./usr/include/i386/svr4_machdep.h		comp-obsolete		obsolete
 ./usr/include/i386/sysarch.h			comp-c-include
 ./usr/include/i386/trap.h			comp-c-include
 ./usr/include/i386/tss.h			comp-c-include



CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 18:08:59 UTC 2017

Modified Files:
src/sys/arch/acorn26/conf: FOURMEG GENERIC INSTALL
src/sys/arch/alpha/conf: GENERIC
src/sys/arch/amigappc/conf: GENERIC NULL
src/sys/arch/arc/conf: ARCTIC GENERIC M403 MIMORI PICA RPC44
src/sys/arch/atari/conf: GENERIC.in
src/sys/arch/bebox/conf: GENERIC INSTALL
src/sys/arch/cats/conf: GENERIC INSTALL
src/sys/arch/cobalt/conf: GENERIC INSTALL
src/sys/arch/dreamcast/conf: G1IDE GENERIC
src/sys/arch/emips/conf: GENERIC
src/sys/arch/evbarm/conf: ADI_BRH ARMADAXP ARMADILLO-IOT-G3
ARMADILLO210 ARMADILLO9 BCM5301X BCM56340 BEAGLEBOARD BEAGLEBOARDXM
CP3100 CUBOX CUBOX-I DUOVERO GEMINI GEMINI_MASTER GEMINI_SLAVE
GENERIC.common GOLDENGATE GUMSTIX HDL_G HPT5325 IGEPV2
IMX6UL-STARTER INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 LUBBOCK
MARVELL_NAS MINI2440 MMNET_GENERIC MPCSA_GENERIC MV2120 N900
NITROGEN6X NSLU2 OMAP5EVM OPENBLOCKS_A6 OPENBLOCKS_AX3 OVERO
PANDABOARD PEPPER SHEEVAPLUG SMDK2410 SMDK2800 TEAMASA_NPWR_FC
TISDP2420 TISDP2430 TS7200 TWINTAIL VTC100 ZAO425
src/sys/arch/evbarm64/conf: A64EMUL
src/sys/arch/evbmips/conf: ALCHEMY CI20 CPMBR1400 ERLITE
LINKITSMART7688 MALTA SBMIPS ZYXELKX
src/sys/arch/evbppc/conf: EV64260 EXPLORA451 MPC8536DS MPC8548CDS
OPENBLOCKS200 OPENBLOCKS266 OPENBLOCKS600 P2020DS P2020RDB PMPPC
RB800 RB850GX2 TWRP1025 WALNUT
src/sys/arch/ews4800mips/conf: GENERIC
src/sys/arch/hpcarm/conf: IPAQ JORNADA720 JORNADA820 NETBOOKPRO WZERO3
src/sys/arch/hppa/conf: GENERIC
src/sys/arch/i386/conf: ALL GENERIC GENERIC_TINY INSTALL_FLOPPY
INSTALL_TINY NET4501 XEN3_DOM0 XEN3_DOMU
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/landisk/conf: GENERIC
src/sys/arch/luna68k/conf: GENERIC INSTALL
src/sys/arch/mac68k/conf: GENERIC
src/sys/arch/macppc/conf: GENERIC GENERIC_601 MAMBO POWERMAC_G5
POWERMAC_G5_11_2
src/sys/arch/mmeye/conf: GENERIC MMEYE_WLF MMTA MMTAICE MMTAROMNEW
src/sys/arch/mvme68k/conf: GENERIC
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/news68k/conf: GENERIC GENERIC_TINY
src/sys/arch/next68k/conf: GENERIC
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/rs6000/conf: GENERIC
src/sys/arch/sandpoint/conf: ENCPP1 GENERIC SANDPOINT
src/sys/arch/sbmips/conf: GENERIC
src/sys/arch/shark/conf: GENERIC INSTALL
src/sys/arch/sparc/conf: INSTALL TADPOLE3GX
src/sys/arch/sparc64/conf: GENERIC NONPLUS64
src/sys/arch/sun2/conf: DISKLESS FOURMEG GENERIC INSTALL RAMDISK VME
src/sys/arch/x68k/conf: GENERIC INSTALL
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Remove TCP_COMPAT_42 from the config files. Pass 3.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/acorn26/conf/FOURMEG
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/acorn26/conf/GENERIC
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/acorn26/conf/INSTALL
cvs rdiff -u -r1.375 -r1.376 src/sys/arch/alpha/conf/GENERIC
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amigappc/conf/GENERIC
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amigappc/conf/NULL
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/arc/conf/ARCTIC
cvs rdiff -u -r1.185 -r1.186 src/sys/arch/arc/conf/GENERIC
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/arc/conf/M403
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arc/conf/MIMORI
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/arc/conf/PICA
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/arc/conf/RPC44
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/atari/conf/GENERIC.in
cvs rdiff -u -r1.153 -r1.154 src/sys/arch/bebox/conf/GENERIC
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/bebox/conf/INSTALL
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/cats/conf/INSTALL
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/cobalt/conf/GENERIC
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/cobalt/conf/INSTALL
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/dreamcast/conf/G1IDE
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/dreamcast/conf/GENERIC
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/emips/conf/GENERIC
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/evbarm/conf/ADI_BRH \
src/sys/arch/evbarm/conf/IQ31244
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/ARMADAXP
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/ARMADILLO210
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/conf/ARMADILLO9
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbarm/conf/BCM5301X \
src/sys/arch/evbarm/conf/MMNET_GENERIC \
src/sys/arch/evbarm/conf/OPENBLOCKS_A6
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/BCM56340 \
src/sys/arch/evbarm/conf/VTC100
cvs rdiff -u -r1.61 -r1.62 

CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 16:50:32 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.23 -r1.57.6.24 src/sys/dev/ic/ahcisata_core.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.23 src/sys/dev/ic/ahcisata_core.c:1.57.6.24
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.23	Sat Jul 29 15:07:46 2017
+++ src/sys/dev/ic/ahcisata_core.c	Sat Jul 29 16:50:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.57.6.23 2017/07/29 15:07:46 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57.6.24 2017/07/29 16:50:32 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.23 2017/07/29 15:07:46 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.24 2017/07/29 16:50:32 jdolecek Exp $");
 
 #include 
 #include 
@@ -1609,7 +1609,6 @@ ahci_channel_recover(struct ahci_softc *
 		/*
 		 * Failed to get resources to run the recovery command, must
 		 * reset the drive. This will also kill all still outstanding
-
 		 * transfers.
 		 */
 reset:



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 15:07:46 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c ahcisatavar.h

Log Message:
make compile without AHCI_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.22 -r1.57.6.23 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.17.6.1 -r1.17.6.2 src/sys/dev/ic/ahcisatavar.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/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.22 src/sys/dev/ic/ahcisata_core.c:1.57.6.23
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.22	Sat Jul 29 14:50:58 2017
+++ src/sys/dev/ic/ahcisata_core.c	Sat Jul 29 15:07:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.57.6.22 2017/07/29 14:50:58 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57.6.23 2017/07/29 15:07:46 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.22 2017/07/29 14:50:58 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.23 2017/07/29 15:07:46 jdolecek Exp $");
 
 #include 
 #include 
@@ -967,9 +967,9 @@ ahci_exec_command(struct ata_drive_datas
 	int ret;
 	int s;
 
-	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
 	AHCIDEBUG_PRINT(("ahci_exec_command port %d CI 0x%x\n",
-	chp->ch_channel, AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))),
+	chp->ch_channel,
+	AHCI_READ(AHCI_CH2SC(chp), AHCI_P_CI(chp->ch_channel))),
 	DEBUG_XFERS);
 	if (ata_c->flags & AT_POLL)
 		xfer->c_flags |= C_POLL;
@@ -1007,17 +1007,17 @@ ahci_exec_command(struct ata_drive_datas
 static void
 ahci_cmd_start(struct ata_channel *chp, struct ata_xfer *xfer)
 {
-	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
+	struct ahci_softc *sc = AHCI_CH2SC(chp);
 	struct ahci_channel *achp = (struct ahci_channel *)chp;
 	struct ata_command *ata_c = >c_ata_c;
 	int slot = xfer->c_slot;
 	struct ahci_cmd_tbl *cmd_tbl;
 	struct ahci_cmd_header *cmd_h;
 	int i;
-	int channel = chp->ch_channel;
 
 	AHCIDEBUG_PRINT(("ahci_cmd_start CI 0x%x timo %d\n slot %d",
-	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel)), ata_c->timeout, slot),
+	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel)),
+	ata_c->timeout, slot),
 	DEBUG_XFERS);
 
 	KASSERT((achp->ahcic_cmds_active & (1 << slot)) == 0);
@@ -1072,11 +1072,14 @@ ahci_cmd_start(struct ata_channel *chp, 
 		ahci_intr_port(sc, achp);
 		ata_delay(10, "ahcipl", ata_c->flags);
 	}
-	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), channel, 
+	AHCIDEBUG_PRINT(("%s port %d poll end GHC 0x%x IS 0x%x list 0x%x%x fis 0x%x%x CMD 0x%x CI 0x%x\n", AHCINAME(sc), chp->ch_channel, 
 	AHCI_READ(sc, AHCI_GHC), AHCI_READ(sc, AHCI_IS),
-	AHCI_READ(sc, AHCI_P_CLBU(channel)), AHCI_READ(sc, AHCI_P_CLB(channel)),
-	AHCI_READ(sc, AHCI_P_FBU(channel)), AHCI_READ(sc, AHCI_P_FB(channel)),
-	AHCI_READ(sc, AHCI_P_CMD(channel)), AHCI_READ(sc, AHCI_P_CI(channel))),
+	AHCI_READ(sc, AHCI_P_CLBU(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_CLB(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_FBU(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_FB(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))),
 	DEBUG_XFERS);
 	if ((ata_c->flags & AT_DONE) == 0) {
 		ata_c->flags |= AT_TIMEOU;
@@ -1127,12 +1130,12 @@ static int
 ahci_cmd_complete(struct ata_channel *chp, struct ata_xfer *xfer, int tfd)
 {
 	struct ata_command *ata_c = >c_ata_c;
-	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
 	struct ahci_channel *achp = (struct ahci_channel *)chp;
 
 	AHCIDEBUG_PRINT(("ahci_cmd_complete channel %d CMD 0x%x CI 0x%x\n",
-	chp->ch_channel, AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)),
-	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))),
+	chp->ch_channel,
+	AHCI_READ(AHCI_CH2SC(chp), AHCI_P_CMD(chp->ch_channel)),
+	AHCI_READ(AHCI_CH2SC(chp), AHCI_P_CI(chp->ch_channel))),
 	DEBUG_FUNCS);
 
 	if (ata_waitdrain_xfer_check(chp, xfer))
@@ -1217,9 +1220,9 @@ ahci_ata_bio(struct ata_drive_datas *drv
 	struct ata_channel *chp = drvp->chnl_softc;
 	struct ata_bio *ata_bio = >c_bio;
 
-	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
 	AHCIDEBUG_PRINT(("ahci_ata_bio port %d CI 0x%x\n",
-	chp->ch_channel, AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))),
+	chp->ch_channel,
+	AHCI_READ(AHCI_CH2SC(chp), AHCI_P_CI(chp->ch_channel))),
 	DEBUG_XFERS);
 	if (ata_bio->flags & ATA_POLL)
 		xfer->c_flags |= C_POLL;
@@ -1242,7 +1245,6 @@ ahci_bio_start(struct ata_channel *chp, 
 	struct ahci_cmd_tbl *cmd_tbl;
 	struct ahci_cmd_header *cmd_h;
 	int i;
-	int channel = chp->ch_channel;
 
 	AHCIDEBUG_PRINT(("ahci_bio_start CI 0x%x\n",
 	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))), DEBUG_XFERS);
@@ -1297,11 

CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 14:50:58 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c

Log Message:
make ahci_channel_recover() non-static, so that it's visible in backtrace,
and can set a separate breakpoint there


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.21 -r1.57.6.22 src/sys/dev/ic/ahcisata_core.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.21 src/sys/dev/ic/ahcisata_core.c:1.57.6.22
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.21	Sat Jul 29 13:02:50 2017
+++ src/sys/dev/ic/ahcisata_core.c	Sat Jul 29 14:50:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.57.6.21 2017/07/29 13:02:50 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57.6.22 2017/07/29 14:50:58 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.21 2017/07/29 13:02:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.22 2017/07/29 14:50:58 jdolecek Exp $");
 
 #include 
 #include 
@@ -77,8 +77,7 @@ static void ahci_bio_kill_xfer(struct at
 static void ahci_channel_stop(struct ahci_softc *, struct ata_channel *, int);
 static void ahci_channel_start(struct ahci_softc *, struct ata_channel *,
 int, int);
-static void ahci_channel_recover(struct ahci_softc *, struct ata_channel *,
-int);
+void ahci_channel_recover(struct ahci_softc *, struct ata_channel *, int);
 static int  ahci_dma_setup(struct ata_channel *, int, void *, size_t, int);
 
 #if NATAPIBUS > 0
@@ -627,7 +626,7 @@ ahci_intr_port(struct ahci_softc *sc, st
 		tfd = 0;
 	}
 
-	if (recover)
+	if (__predict_false(recover))
 		ata_channel_freeze(chp);
 
 	if (slot >= 0) {
@@ -652,7 +651,7 @@ ahci_intr_port(struct ahci_softc *sc, st
 		}
 	}
 
-	if (recover) {
+	if (__predict_false(recover)) {
 		ata_channel_thaw(chp);
 		ahci_channel_recover(sc, chp, tfd);
 	}



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

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 13:05:16 UTC 2017

Modified Files:
src/sys/arch/i386/include: freebsd_machdep.h param.h

Log Message:
Remove unused.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/include/freebsd_machdep.h
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/i386/include/param.h

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

Modified files:

Index: src/sys/arch/i386/include/freebsd_machdep.h
diff -u src/sys/arch/i386/include/freebsd_machdep.h:1.13 src/sys/arch/i386/include/freebsd_machdep.h:1.14
--- src/sys/arch/i386/include/freebsd_machdep.h:1.13	Wed Feb 12 23:24:09 2014
+++ src/sys/arch/i386/include/freebsd_machdep.h	Sat Jul 29 13:05:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_machdep.h,v 1.13 2014/02/12 23:24:09 dsl Exp $	*/
+/*	$NetBSD: freebsd_machdep.h,v 1.14 2017/07/29 13:05:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -110,9 +110,6 @@ struct freebsd_sigframe {
 	struct	freebsd_sigcontext sf_sc;
 };
 
-/* sys/i386/include/exec.h */
-#define FREEBSD___LDPGSZ	4096
-
 void freebsd_syscall_intern(struct proc *);
 
 #endif /* _FREEBSD_MACHDEP_H */

Index: src/sys/arch/i386/include/param.h
diff -u src/sys/arch/i386/include/param.h:1.81 src/sys/arch/i386/include/param.h:1.82
--- src/sys/arch/i386/include/param.h:1.81	Wed Jun 14 12:27:24 2017
+++ src/sys/arch/i386/include/param.h	Sat Jul 29 13:05:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.81 2017/06/14 12:27:24 maxv Exp $	*/
+/*	$NetBSD: param.h,v 1.82 2017/07/29 13:05:15 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -80,10 +80,6 @@
 #include "opt_kernbase.h"
 #endif /* defined(_KERNEL_OPT) */
 
-#ifdef KERNBASE_LOCORE
-#error "You should only re-define KERNBASE"
-#endif
-
 #ifndef	KERNBASE
 #define	KERNBASE	0xc000UL	/* start of kernel virtual space */
 #endif



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 13:04:43 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisatareg.h

Log Message:
fix AHCI_P_CMD_CCS_SHIFT - must shift only by 8, otherwise the result would
be always 0


To generate a diff of this commit:
cvs rdiff -u -r1.12.26.1 -r1.12.26.2 src/sys/dev/ic/ahcisatareg.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/ic/ahcisatareg.h
diff -u src/sys/dev/ic/ahcisatareg.h:1.12.26.1 src/sys/dev/ic/ahcisatareg.h:1.12.26.2
--- src/sys/dev/ic/ahcisatareg.h:1.12.26.1	Wed Jul 19 20:21:42 2017
+++ src/sys/dev/ic/ahcisatareg.h	Sat Jul 29 13:04:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatareg.h,v 1.12.26.1 2017/07/19 20:21:42 jdolecek Exp $	*/
+/*	$NetBSD: ahcisatareg.h,v 1.12.26.2 2017/07/29 13:04:43 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -234,8 +234,8 @@ struct ahci_r_fis {
 #define		AHCI_P_CMD_CR	0x8000 /* command list running */
 #define		AHCI_P_CMD_FR	0x4000 /* FIS receive running */
 #define		AHCI_P_CMD_MPSS	0x2000 /* mechanical switch state */
-#define		AHCI_P_CMD_CCS_MASK 0x1f00 /* current command slot */
-#define		AHCI_P_CMD_CCS_SHIFT 12
+#define		AHCI_P_CMD_CCS_MASK __BITS(12, 8) /* current command slot */
+#define		AHCI_P_CMD_CCS_SHIFT 8
 #define		AHCI_P_CMD_FRE	0x0010 /* FIS receive enable */
 #define		AHCI_P_CMD_CLO	0x0008 /* command list override */
 #define		AHCI_P_CMD_POD	0x0004 /* power on device */



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 13:02:50 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c

Log Message:
do not do the drive reset on non-fatal recovery - spec explicitely says
says the READ LOG EXT should only be done when neither COMRESET nor software
reset was done, and indeed it returns junk in this case

use C_RECOVERY slot for drive reset, so that it now will always succeed
in getting a slot, in cases when it would be necessary

adjust code and comments on the recovery path to explain better what's going on

with this AHCI error recovery works with real hardware without timeouts again


To generate a diff of this commit:
cvs rdiff -u -r1.57.6.20 -r1.57.6.21 src/sys/dev/ic/ahcisata_core.c

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

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.20 src/sys/dev/ic/ahcisata_core.c:1.57.6.21
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.20	Sun Jul 23 14:14:43 2017
+++ src/sys/dev/ic/ahcisata_core.c	Sat Jul 29 13:02:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.57.6.20 2017/07/23 14:14:43 jdolecek Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57.6.21 2017/07/29 13:02:50 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.20 2017/07/23 14:14:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.21 2017/07/29 13:02:50 jdolecek Exp $");
 
 #include 
 #include 
@@ -568,10 +568,12 @@ ahci_intr_port(struct ahci_softc *sc, st
 
 	is = AHCI_READ(sc, AHCI_P_IS(chp->ch_channel));
 	AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), is);
-	AHCIDEBUG_PRINT(("ahci_intr_port %s port %d is 0x%x CI 0x%x TFD 0x%x\n",
+	AHCIDEBUG_PRINT((
+	"ahci_intr_port %s port %d is 0x%x CI 0x%x SACT 0x%x TFD 0x%x\n",
 	AHCINAME(sc),
 	chp->ch_channel, is,
 	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel)),
+	AHCI_READ(sc, AHCI_P_SACT(chp->ch_channel)),
 	AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel))),
 	DEBUG_INTR);
 
@@ -613,8 +615,9 @@ ahci_intr_port(struct ahci_softc *sc, st
 		tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel));
 
 		/* D2H Register FIS or Set Device Bits */
-		if ((tfd & WDCS_ERR) != 0 && !achp->ahcic_recovering) {
-			recover = true;
+		if ((tfd & WDCS_ERR) != 0) {
+			if (!achp->ahcic_recovering)
+recover = true;
 
 			aprint_error("%s port %d: transfer aborted 0x%x\n",
 			AHCINAME(sc), chp->ch_channel, tfd);
@@ -757,11 +760,7 @@ again:
 
 	/* polled command, assume interrupts are disabled */
 	/* use available slot to send reset, if none available fail */
-	xfer = ata_get_xfer_ext(chp, false, 0);
-	if (xfer == NULL) {
-		printf("%s: no xfer\n", __func__);
-		return 1;
-	}
+	xfer = ata_get_xfer_ext(chp, C_RECOVERY, 0);
 
 	cmd_h = >ahcic_cmdh[xfer->c_slot];
 	cmd_tbl = achp->ahcic_cmd_tbl[xfer->c_slot];
@@ -1556,22 +1555,16 @@ ahci_channel_recover(struct ahci_softc *
 
 	/*
 	 * If BSY or DRQ bits are set, must execute COMRESET to return
-	 * device to idle state. Otherwise, commands can be reissued
-	 * after resetting CMD.ST. After resetting CMD.ST, need to execute
-	 * READ LOG EXT for NCQ to unblock device processing if COMRESET
-	 * was not done.
+	 * device to idle state. If drive is idle, it's enough to just
+	 * reset CMD.ST, it's not necessary to do software reset.
+	 * After resetting CMD.ST, need to execute READ LOG EXT for NCQ
+	 * to unblock device processing if COMRESET was not done.
 	 */
 	if (reset || (AHCI_TFD_ST(tfd) & (WDCS_BSY|WDCS_DRQ)) != 0)
 		goto reset;
 
 	KASSERT(drive >= 0);
 	ahci_channel_stop(sc, chp, AT_POLL);
-	if (ahci_do_reset_drive(chp, drive, AT_POLL, NULL) != 0) {
-reset:
-		/* This will also kill all still outstanding transfers */
-		ahci_reset_channel(chp, AT_POLL);
-		goto out;
-	}
 	ahci_channel_start(sc, chp, AT_POLL,
	(sc->sc_ahci_cap & AHCI_CAP_CLO) ? 1 : 0);
 
@@ -1585,18 +1578,48 @@ reset:
 
 	ahci_unhold(achp);
 
-	if (error == 0) {
+	switch (error) {
+	case 0:
 		/* Error out the particular NCQ xfer, then requeue the others */
-		xfer = ata_queue_hwslot_to_xfer(chp, eslot);
-		xfer->c_intr(chp, xfer, (err << AHCI_P_TFD_ERR_SHIFT) | st);
-	} else if (error == EOPNOTSUPP) {
-		/* command already processed before entering recovery */
-		KASSERT(achp->ahcic_cmds_active == 0);
-	} else {
+		if ((achp->ahcic_cmds_active & (1 << eslot)) != 0) {
+			xfer = ata_queue_hwslot_to_xfer(chp, eslot);
+			xfer->c_intr(chp, xfer,
+			(err << AHCI_P_TFD_ERR_SHIFT) | st);
+		}
+		break;
+
+	case EOPNOTSUPP:
+		/*
+		 * Non-NCQ command error, just find the slot and end with
+		 * the error.
+		 */
+		for (slot = 0; slot < sc->sc_ncmds; slot++) {
+			if ((achp->ahcic_cmds_active & (1 << slot)) != 0) {
+xfer = ata_queue_hwslot_to_xfer(chp, slot);
+xfer->c_intr(chp, xfer, tfd);
+			}
+		}
+		break;
+
+	

CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 12:58:30 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c atavar.h

Log Message:
reserve the highest slot for error recovery, and also have ata_channel
include space for the READ LOG EXT sector, so that it's not necessary
to allocate memory on the error handling path; now ata_read_log_ext_ncq()
will never fail due to resource shortage


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.21 -r1.132.8.22 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.92.8.19 -r1.92.8.20 src/sys/dev/ata/atavar.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.21 src/sys/dev/ata/ata.c:1.132.8.22
--- src/sys/dev/ata/ata.c:1.132.8.21	Sat Jul 22 22:02:21 2017
+++ src/sys/dev/ata/ata.c	Sat Jul 29 12:58:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.21 2017/07/22 22:02:21 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.22 2017/07/29 12:58:29 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.21 2017/07/22 22:02:21 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.22 2017/07/29 12:58:29 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -191,7 +191,7 @@ ata_queue_reset(struct ata_queue *chq)
 	chq->queue_freeze = 0;
 	chq->queue_active = 0;
 	chq->active_xfers_used = 0;
-	chq->queue_xfers_avail = (1 << chq->queue_openings) - 1;
+	chq->queue_xfers_avail = __BIT(chq->queue_openings) - 1;
 }
 
 struct ata_xfer *
@@ -202,7 +202,8 @@ ata_queue_hwslot_to_xfer(struct ata_chan
 
 	mutex_enter(>ch_lock);
 
-	KASSERT(hwslot < chq->queue_openings);
+	KASSERTMSG(hwslot < chq->queue_openings, "hwslot %d > openings %d",
+	hwslot, chq->queue_openings);
 	KASSERT((chq->active_xfers_used & __BIT(hwslot)) != 0);
 
 	/* Usually the first entry will be the one */
@@ -1048,20 +1049,9 @@ ata_read_log_ext_ncq(struct ata_drive_da
 	(drvp->drive_flags & ATA_DRIVE_NCQ) == 0)
 		return EOPNOTSUPP;
 
-	xfer = ata_get_xfer_ext(chp, false, 0);
-	if (xfer == NULL) {
-		ATADEBUG_PRINT(("%s: no xfer\n", __func__),
-		DEBUG_FUNCS|DEBUG_XFERS);
-		return EAGAIN;
-	}
+	xfer = ata_get_xfer_ext(chp, C_RECOVERY, 0);
 
-	tb = malloc(DEV_BSIZE, M_DEVBUF, M_NOWAIT);
-	if (tb == NULL) {
-		ATADEBUG_PRINT(("%s: memory allocation failed\n", __func__),
-		DEBUG_FUNCS|DEBUG_XFERS);
-		rv = EAGAIN;
-		goto out;
-	}
+	tb = chp->ch_recovery;
 	memset(tb, 0, DEV_BSIZE);
 
 	/*
@@ -1070,14 +1060,14 @@ ata_read_log_ext_ncq(struct ata_drive_da
 	 * and to make this a little faster. Realistically, it
 	 * should not matter.
 	 */
-	xfer->c_flags |= C_IMMEDIATE;
+	xfer->c_flags |= C_RECOVERY;
 	xfer->c_ata_c.r_command = WDCC_READ_LOG_EXT;
 	xfer->c_ata_c.r_lba = page = WDCC_LOG_PAGE_NCQ;
 	xfer->c_ata_c.r_st_bmask = WDCS_DRDY;
 	xfer->c_ata_c.r_st_pmask = WDCS_DRDY;
 	xfer->c_ata_c.r_count = 1;
 	xfer->c_ata_c.r_device = WDSD_LBA;
-	xfer->c_ata_c.flags = AT_READ | AT_LBA | AT_LBA48 | flags;
+	xfer->c_ata_c.flags = AT_READ | AT_LBA | flags;
 	xfer->c_ata_c.timeout = 1000; /* 1s */
 	xfer->c_ata_c.data = tb;
 	xfer->c_ata_c.bcount = DEV_BSIZE;
@@ -1085,11 +1075,11 @@ ata_read_log_ext_ncq(struct ata_drive_da
 	if ((*atac->atac_bustype_ata->ata_exec_command)(drvp,
 		xfer) != ATACMD_COMPLETE) {
 		rv = EAGAIN;
-		goto out2;
+		goto out;
 	}
 	if (xfer->c_ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
 		rv = EINVAL;
-		goto out2;
+		goto out;
 	}
 
 	cksum = 0;
@@ -1100,23 +1090,26 @@ ata_read_log_ext_ncq(struct ata_drive_da
 		"invalid checksum %x for READ LOG EXT page %x\n",
 		cksum, page);
 		rv = EINVAL;
-		goto out2;
+		goto out;
 	}
 
 	if (tb[0] & WDCC_LOG_NQ) {
 		/* not queued command */
 		rv = EOPNOTSUPP;
-		goto out2;
+		goto out;
 	}
 
 	*slot = tb[0] & 0x1f;
 	*status = tb[2];
 	*err = tb[3];
 
+	KASSERTMSG((*status & WDCS_ERR),
+	"%s: non-error command slot %d reported by READ LOG EXT page %x: "
+	"err %x status %x\n",
+	device_xname(drvp->drv_softc), *slot, page, *err, *status);
+
 	rv = 0;
 
-out2:
-	free(tb, DEV_BSIZE);
 out:
 	ata_free_xfer(chp, xfer);
 	return rv;
@@ -1180,12 +1173,15 @@ ata_exec_xfer(struct ata_channel *chp, s
 
 	mutex_enter(>ch_lock);
 
-	/* insert at the end of command list unless specially requested */
-	if (xfer->c_flags & C_IMMEDIATE)
-		TAILQ_INSERT_HEAD(>ch_queue->queue_xfer, xfer,
+	/*
+	 * Standard commands are added to the end of command list, but
+	 * recovery commands must be run immediatelly.
+	 */
+	if ((xfer->c_flags & C_RECOVERY) == 0)
+		TAILQ_INSERT_TAIL(>ch_queue->queue_xfer, xfer,
 		c_xferchain);
 	else
-		TAILQ_INSERT_TAIL(>ch_queue->queue_xfer, xfer,
+		TAILQ_INSERT_HEAD(>ch_queue->queue_xfer, xfer,
 		c_xferchain);
 	ATADEBUG_PRINT(("atastart from ata_exec_xfer, flags 0x%x\n",
 	chp->ch_flags), 

CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 12:51:22 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: wd.c

Log Message:
actually count the REQUEUE as retry also, so that it will be retried
as non-NCQ, will not be subject to chaos monkey, and reported as fixed
once finished, too


To generate a diff of this commit:
cvs rdiff -u -r1.428.2.29 -r1.428.2.30 src/sys/dev/ata/wd.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/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.428.2.29 src/sys/dev/ata/wd.c:1.428.2.30
--- src/sys/dev/ata/wd.c:1.428.2.29	Sun Jul 23 13:50:43 2017
+++ src/sys/dev/ata/wd.c	Sat Jul 29 12:51:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.428.2.29 2017/07/23 13:50:43 jdolecek Exp $ */
+/*	$NetBSD: wd.c,v 1.428.2.30 2017/07/29 12:51:22 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.29 2017/07/23 13:50:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.30 2017/07/29 12:51:22 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -662,7 +662,7 @@ wdstart(device_t self)
 
 	while (bufq_peek(wd->sc_q) != NULL) {
 		/* First try to get xfer. Limit to drive openings iff NCQ. */
-		xfer = ata_get_xfer_ext(wd->drvp->chnl_softc, false,
+		xfer = ata_get_xfer_ext(wd->drvp->chnl_softc, 0,
 		ISSET(wd->drvp->drive_flags, ATA_DRIVE_NCQ)
 		? wd->drvp->drv_openings : 0);
 		if (xfer == NULL)
@@ -839,17 +839,11 @@ retry2:
 			wdperror(wd, xfer);
 
 		if (xfer->c_retries < WDIORETRIES) {
-			int timo;
+			xfer->c_retries++;
 
-			if (xfer->c_bio.error == REQUEUE) {
-/* rerun ASAP, and do not count as retry */
-timo = 1;
-			} else {
-xfer->c_retries++;
-timo = RECOVERYTIME;
-			}
-
-			callout_reset(>c_retry_callout, timo,
+			/* Rerun ASAP if just requeued */
+			callout_reset(>c_retry_callout,
+			(xfer->c_bio.error == REQUEUE) ? 1 : RECOVERYTIME,
 			wdbiorestart, xfer);
 
 			mutex_exit(>sc_lock);
@@ -894,7 +888,7 @@ out:
 	case NOERROR:
 noerror:	if ((xfer->c_bio.flags & ATA_CORR) || xfer->c_retries > 0)
 			aprint_error_dev(wd->sc_dev,
-			"soft error (corrected)\n");
+			"soft error (corrected) slot %d\n", xfer->c_slot);
 #ifdef WD_CHAOS_MONKEY
 		KASSERT((xfer->c_flags & C_CHAOS) == 0);
 #endif
@@ -1692,7 +1686,7 @@ wddump(dev_t dev, daddr_t blkno, void *v
 		wd->drvp->state = RESET;
 	}
 
-	xfer = ata_get_xfer_ext(wd->drvp->chnl_softc, false, 0);
+	xfer = ata_get_xfer_ext(wd->drvp->chnl_softc, 0, 0);
 	if (xfer == NULL) {
 		printf("%s: no xfer\n", __func__);
 		return EAGAIN;



CVS commit: src/sys/arch/i386/i386

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:34:34 UTC 2017

Modified Files:
src/sys/arch/i386/i386: locore.S

Log Message:
Remove undocumented hack.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/i386/i386/locore.S

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/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.148 src/sys/arch/i386/i386/locore.S:1.149
--- src/sys/arch/i386/i386/locore.S:1.148	Sat Jul 29 11:54:14 2017
+++ src/sys/arch/i386/i386/locore.S	Sat Jul 29 12:34:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.149 2017/07/29 12:34:34 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.149 2017/07/29 12:34:34 maxv Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -841,24 +841,6 @@ begin:
 	addl	$PDE_SIZE,%esp		/* pop paddr_t */
 	addl	$NGDT*8,%esp		/* pop temporary gdt */
 
-#ifdef SAFARI_FIFO_HACK
-	movb	$5,%al
-	movw	$0x37b,%dx
-	outb	%al,%dx
-	movw	$0x37f,%dx
-	inb	%dx,%al
-	movb	%al,%cl
-
-	orb	$1,%cl
-
-	movb	$5,%al
-	movw	$0x37b,%dx
-	outb	%al,%dx
-	movw	$0x37f,%dx
-	movb	%cl,%al
-	outb	%al,%dx
-#endif /* SAFARI_FIFO_HACK */
-
 	call 	_C_LABEL(main)
 #else /* XEN */
 	/* First, reset the PSL. */



CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:28:28 UTC 2017

Modified Files:
src/sys/arch/cesfic/conf: GENERIC
src/sys/arch/evbarm/conf: IMX31LITE INTEGRATOR_CP IXM1200 NAPPI OSK5912
TEAMASA_NPWR VIPER
src/sys/arch/evbmips/conf: ADM5120 ADM5120-NB ADM5120-USB AP30 DB120
MERAKI RB433UAH WGT624V3 XLSATX
src/sys/arch/evbppc/conf: VIRTEX_DFC VIRTEX_GSRD1 VIRTEX_GSRD2
src/sys/arch/mvme68k/conf: VME147 VME162 VME167 VME172 VME177
src/sys/arch/news68k/conf: INSTALL LIBERO NEWS1200
src/sys/arch/shark/conf: OFWGENCFG
src/sys/arch/sparc64/conf: MODULAR

Log Message:
Remove TCP_COMPAT_42 from the config files. Pass 2.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/cesfic/conf/GENERIC
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/conf/IMX31LITE
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/INTEGRATOR_CP
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/evbarm/conf/IXM1200
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/evbarm/conf/NAPPI
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/conf/OSK5912
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/evbarm/conf/TEAMASA_NPWR
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/conf/VIPER
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/conf/ADM5120 \
src/sys/arch/evbmips/conf/XLSATX
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbmips/conf/ADM5120-NB \
src/sys/arch/evbmips/conf/ADM5120-USB
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbmips/conf/AP30
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbmips/conf/DB120
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbmips/conf/MERAKI
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbmips/conf/RB433UAH
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/conf/WGT624V3
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbppc/conf/VIRTEX_DFC
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbppc/conf/VIRTEX_GSRD1
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbppc/conf/VIRTEX_GSRD2
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mvme68k/conf/VME147
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mvme68k/conf/VME162 \
src/sys/arch/mvme68k/conf/VME172
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mvme68k/conf/VME167
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mvme68k/conf/VME177
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/news68k/conf/INSTALL
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/news68k/conf/LIBERO
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/news68k/conf/NEWS1200
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/shark/conf/OFWGENCFG
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/conf/MODULAR

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/cesfic/conf/GENERIC
diff -u src/sys/arch/cesfic/conf/GENERIC:1.65 src/sys/arch/cesfic/conf/GENERIC:1.66
--- src/sys/arch/cesfic/conf/GENERIC:1.65	Sun Nov 16 16:01:40 2014
+++ src/sys/arch/cesfic/conf/GENERIC	Sat Jul 29 12:28:27 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.65 2014/11/16 16:01:40 manu Exp $
+# $NetBSD: GENERIC,v 1.66 2017/07/29 12:28:27 maxv Exp $
 #
 # GENERIC machine description file
 # 
@@ -41,7 +41,6 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 #options 	BUFQ_READPRIO
 #options 	BUFQ_PRIOCSCAN
 
-#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 options 	COMPAT_43	# compatibility with 4.3BSD interfaces
 options 	COMPAT_44	# compatibility with 4.4BSD binaries
 options 	COMPAT_09	# NetBSD 0.9,

Index: src/sys/arch/evbarm/conf/IMX31LITE
diff -u src/sys/arch/evbarm/conf/IMX31LITE:1.31 src/sys/arch/evbarm/conf/IMX31LITE:1.32
--- src/sys/arch/evbarm/conf/IMX31LITE:1.31	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/IMX31LITE	Sat Jul 29 12:28:27 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: IMX31LITE,v 1.31 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: IMX31LITE,v 1.32 2017/07/29 12:28:27 maxv Exp $
 #
 #	IMX31LITE -- Freescale IMX31LITE Evaluation Board Kernel
 #
@@ -90,7 +90,6 @@ options 	COMPAT_40	# NetBSD 4.0,
 options 	COMPAT_50	# NetBSD 5.0,
 options 	COMPAT_60	# NetBSD 6.0, and
 options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
-#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # Shared memory options

Index: src/sys/arch/evbarm/conf/INTEGRATOR_CP
diff -u src/sys/arch/evbarm/conf/INTEGRATOR_CP:1.12 src/sys/arch/evbarm/conf/INTEGRATOR_CP:1.13
--- src/sys/arch/evbarm/conf/INTEGRATOR_CP:1.12	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/INTEGRATOR_CP	Sat Jul 29 12:28:27 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: INTEGRATOR_CP,v 1.12 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: INTEGRATOR_CP,v 1.13 2017/07/29 12:28:27 maxv Exp $
 #
 #	INTEGRATOR_CP -- ARM Integrator CP kernel
 #
@@ -91,7 +91,6 @@ options		COMPAT_NETBSD32	# allow running
 options 	COMPAT_50	# NetBSD 5.0,
 options 	COMPAT_60	# NetBSD 6.0, and
 options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
-#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 

CVS commit: src/share/man

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:15:13 UTC 2017

Modified Files:
src/share/man/man4: options.4
src/share/man/man8: compat_svr4.8

Log Message:
Remove references to i386.


To generate a diff of this commit:
cvs rdiff -u -r1.468 -r1.469 src/share/man/man4/options.4
cvs rdiff -u -r1.27 -r1.28 src/share/man/man8/compat_svr4.8

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.468 src/share/man/man4/options.4:1.469
--- src/share/man/man4/options.4:1.468	Sat Jul 29 05:46:29 2017
+++ src/share/man/man4/options.4	Sat Jul 29 12:15:12 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.468 2017/07/29 05:46:29 maxv Exp $
+.\"	$NetBSD: options.4,v 1.469 2017/07/29 12:15:12 maxv Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -378,7 +378,7 @@ On those architectures that support it, 
 compatibility with
 .At V.4
 applications built for the same architecture.
-This currently includes the i386, m68k, and sparc ports.
+This currently includes the m68k and sparc ports.
 .It Cd options COMPAT_LINUX
 On those architectures that support it, this enables binary
 compatibility with Linux ELF and

Index: src/share/man/man8/compat_svr4.8
diff -u src/share/man/man8/compat_svr4.8:1.27 src/share/man/man8/compat_svr4.8:1.28
--- src/share/man/man8/compat_svr4.8:1.27	Mon Jul  3 21:31:00 2017
+++ src/share/man/man8/compat_svr4.8	Sat Jul 29 12:15:12 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: compat_svr4.8,v 1.27 2017/07/03 21:31:00 wiz Exp $
+.\"	$NetBSD: compat_svr4.8,v 1.28 2017/07/29 12:15:12 maxv Exp $
 .\"
 .\" Copyright (c) 1996 Christos Zoulas
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\"
 .\"	Stolen from compat_linux.8,v 1.2 1995/10/16 20:17:59 fvdl
 .\"
-.Dd April 19, 1999
+.Dd July 29, 2017
 .Dt COMPAT_SVR4 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nx
 supports running SVR4/iBCS2 binaries.
 This code has been tested on
-i386 (with binaries from SCO OpenServer and XENIX), m68k (with binaries from
+m68k (with binaries from
 .Tn AMIX )
 and sparc (with binaries from Solaris) systems.
 Most programs should work, but not ones that use or depend on:



CVS commit: src/sys/arch/i386

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:07:45 UTC 2017

Modified Files:
src/sys/arch/i386/i386: genassym.cf
src/sys/arch/i386/include: Makefile

Log Message:
Unlink svr4_machdep.h.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/include/Makefile

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

Modified files:

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.100 src/sys/arch/i386/i386/genassym.cf:1.101
--- src/sys/arch/i386/i386/genassym.cf:1.100	Sun Jul 16 14:02:48 2017
+++ src/sys/arch/i386/i386/genassym.cf	Sat Jul 29 12:07:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.100 2017/07/16 14:02:48 cherry Exp $
+#	$NetBSD: genassym.cf,v 1.101 2017/07/29 12:07:45 maxv Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -64,7 +64,6 @@
 #
 
 if defined(_KERNEL_OPT)
-include "opt_compat_svr4.h"
 include "opt_compat_freebsd.h"
 include "opt_compat_linux.h"
 include "opt_compat_netbsd.h"
@@ -108,10 +107,6 @@ endif
 
 include 
 
-ifdef COMPAT_SVR4
-include 
-endif
-
 ifdef COMPAT_LINUX
 include 
 include 
@@ -230,11 +225,6 @@ define	TF_PUSHSIZE		offsetof(struct trap
 
 define	FRAMESIZE		sizeof(struct trapframe)
 
-ifdef COMPAT_SVR4
-define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
-define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
-endif
-
 ifdef COMPAT_LINUX
 define	LINUX_SIGF_HANDLER	offsetof(struct linux_sigframe, sf_handler)
 define	LINUX_SIGF_SC		offsetof(struct linux_sigframe, sf_sc)

Index: src/sys/arch/i386/include/Makefile
diff -u src/sys/arch/i386/include/Makefile:1.44 src/sys/arch/i386/include/Makefile:1.45
--- src/sys/arch/i386/include/Makefile:1.44	Sat Feb 27 00:09:45 2016
+++ src/sys/arch/i386/include/Makefile	Sat Jul 29 12:07:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2016/02/27 00:09:45 tls Exp $
+#	$NetBSD: Makefile,v 1.45 2017/07/29 12:07:45 maxv Exp $
 
 INCSDIR= /usr/include/i386
 
@@ -20,7 +20,7 @@ INCS=	ansi.h aout_machdep.h apmvar.h asm
 	pte.h ptrace.h \
 	reg.h rwlock.h \
 	segments.h setjmp.h signal.h sljit_machdep.h specialreg.h spkr.h \
-	svr4_machdep.h sysarch.h \
+	sysarch.h \
 	trap.h tss.h types.h \
 	vm86.h vmparam.h \
 	wchar_limits.h



CVS commit: src/sys/modules/compat_svr4

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:03:37 UTC 2017

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

Log Message:
Remove i386. By the way, it looks like several architectures are missing
here.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/compat_svr4/Makefile

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

Modified files:

Index: src/sys/modules/compat_svr4/Makefile
diff -u src/sys/modules/compat_svr4/Makefile:1.3 src/sys/modules/compat_svr4/Makefile:1.4
--- src/sys/modules/compat_svr4/Makefile:1.3	Sat Feb 14 13:56:41 2009
+++ src/sys/modules/compat_svr4/Makefile	Sat Jul 29 12:03:37 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2009/02/14 13:56:41 abs Exp $
+#	$NetBSD: Makefile,v 1.4 2017/07/29 12:03:37 maxv Exp $
 
 .include "../Makefile.inc"
 .include "../Makefile.assym"
@@ -16,12 +16,4 @@ SRCS+=	svr4_socket.c svr4_sockio.c svr4_
 SRCS+=	svr4_syscalls.c  svr4_sysent.c svr4_termios.c svr4_ttold.c
 SRCS+=	svr4_mod.c
 
-.if ${MACHINE_ARCH} == "i386"
-CPPFLAGS+=	-DEXEC_ELF32
-SRCS+=	svr4_exec_elf32.c
-.PATH:	${S}/arch/i386/i386
-SRCS+=	svr4_machdep.c svr4_syscall.c svr4_sigcode.S
-CPPFLAGS.svr4_sigcode.S+=	-D_LOCORE
-.endif
-
 .include 



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

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 12:00:56 UTC 2017

Modified Files:
src/sys/arch/i386/conf: ALL GENERIC GENERIC_TINY INSTALL_FLOPPY
INSTALL_TINY MODULAR NET4501 XEN3_DOM0 XEN3_DOMU

Log Message:
Remove svr4 from the config files.


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1159 -r1.1160 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/i386/conf/GENERIC_TINY
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/conf/INSTALL_FLOPPY
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/i386/conf/INSTALL_TINY
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/conf/MODULAR
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/i386/conf/NET4501
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/i386/conf/XEN3_DOMU

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/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.422 src/sys/arch/i386/conf/ALL:1.423
--- src/sys/arch/i386/conf/ALL:1.422	Sat Jul 29 07:19:47 2017
+++ src/sys/arch/i386/conf/ALL	Sat Jul 29 12:00:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.422 2017/07/29 07:19:47 maxv Exp $
+# $NetBSD: ALL,v 1.423 2017/07/29 12:00:56 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.422 $"
+#ident		"ALL-$Revision: 1.423 $"
 
 maxusers	64		# estimated number of users
 
@@ -149,7 +149,6 @@ options 	COMPAT_386BSD_MBRPART # recogni
 options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 
 options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
-options 	COMPAT_SVR4	# binary compatibility with SVR4
 options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 options 	COMPAT_LINUX	# binary compatibility with Linux
 options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
@@ -2105,7 +2104,6 @@ options DEBUG_PTM
 options DEBUG_RAWFS
 options DEBUG_RPC
 options DEBUG_SNAPPER
-options DEBUG_SVR4
 options DEBUG_SYNC
 options DEBUG_TERM
 options DEBUG_UL

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1159 src/sys/arch/i386/conf/GENERIC:1.1160
--- src/sys/arch/i386/conf/GENERIC:1.1159	Fri Jul 28 14:13:13 2017
+++ src/sys/arch/i386/conf/GENERIC	Sat Jul 29 12:00:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1159 2017/07/28 14:13:13 maxv Exp $
+# $NetBSD: GENERIC,v 1.1160 2017/07/29 12:00:56 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1159 $"
+#ident		"GENERIC-$Revision: 1.1160 $"
 
 maxusers	64		# estimated number of users
 
@@ -144,7 +144,6 @@ options 	COMPAT_43	# 4.3BSD, 386BSD, and
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 
 options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
-#options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD

Index: src/sys/arch/i386/conf/GENERIC_TINY
diff -u src/sys/arch/i386/conf/GENERIC_TINY:1.149 src/sys/arch/i386/conf/GENERIC_TINY:1.150
--- src/sys/arch/i386/conf/GENERIC_TINY:1.149	Sun Feb 26 12:21:15 2017
+++ src/sys/arch/i386/conf/GENERIC_TINY	Sat Jul 29 12:00:56 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC_TINY,v 1.149 2017/02/26 12:21:15 maya Exp $
+#	$NetBSD: GENERIC_TINY,v 1.150 2017/07/29 12:00:56 maxv Exp $
 #
 #	GENERIC_TINY -- suitable default for 4M machines
 #			No EISA, PCI, or SCSI.
@@ -76,7 +76,6 @@ options 	COMPAT_43	# 4.3BSD, 386BSD, and
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 
-#options 	COMPAT_SVR4	# binary compatibility with SVR4
 #options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
 #options 	COMPAT_LINUX	# binary compatibility with Linux
 #options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD

Index: src/sys/arch/i386/conf/INSTALL_FLOPPY
diff -u src/sys/arch/i386/conf/INSTALL_FLOPPY:1.37 src/sys/arch/i386/conf/INSTALL_FLOPPY:1.38
--- src/sys/arch/i386/conf/INSTALL_FLOPPY:1.37	Sun Feb 26 12:21:15 2017
+++ src/sys/arch/i386/conf/INSTALL_FLOPPY	Sat Jul 29 12:00:56 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_FLOPPY,v 1.37 2017/02/26 12:21:15 maya Exp $
+#	$NetBSD: INSTALL_FLOPPY,v 1.38 2017/07/29 12:00:56 maxv Exp $
 #
 #	INSTALL - Installation kernel.
 #
@@ -98,7 +98,6 @@ options 	COMPAT_70	# NetBSD 7.0 binary c
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not 

CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 11:54:14 UTC 2017

Modified Files:
src/sys/arch/i386/conf: files.i386
src/sys/arch/i386/i386: locore.S machdep.c
src/sys/arch/xen/conf: files.xen
Removed Files:
src/sys/arch/i386/i386: svr4_machdep.c svr4_sigcode.S svr4_syscall.c

Log Message:
Drop support for svr4 on i386. This feature is not maintained, not
reliable, and of a limited use case. Most svr4 applications got time to be
ported to linux, and we do have a functional, maintained linux emulation.

Reduces the number of entry points into the kernel, the number of
places that need special care (cpu context).

Note that compat_svr4 is still available on sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.786 -r1.787 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.99 -r0 src/sys/arch/i386/i386/svr4_machdep.c
cvs rdiff -u -r1.13 -r0 src/sys/arch/i386/i386/svr4_sigcode.S
cvs rdiff -u -r1.48 -r0 src/sys/arch/i386/i386/svr4_syscall.c
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/xen/conf/files.xen

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/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.380 src/sys/arch/i386/conf/files.i386:1.381
--- src/sys/arch/i386/conf/files.i386:1.380	Sat Jul 29 06:29:31 2017
+++ src/sys/arch/i386/conf/files.i386	Sat Jul 29 11:54:14 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.380 2017/07/29 06:29:31 maxv Exp $
+#	$NetBSD: files.i386,v 1.381 2017/07/29 11:54:14 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -327,9 +327,6 @@ file	arch/i386/i386/compat_16_machdep.c	
 
 # SVR4 binary compatibility (COMPAT_SVR4)
 include	"compat/svr4/files.svr4"
-file	arch/i386/i386/svr4_machdep.c		compat_svr4
-file	arch/i386/i386/svr4_sigcode.S		compat_svr4
-file	arch/i386/i386/svr4_syscall.c		compat_svr4
 
 # iBCS-2 binary compatibility (COMPAT_IBCS2)
 include	"compat/ibcs2/files.ibcs2"

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.147 src/sys/arch/i386/i386/locore.S:1.148
--- src/sys/arch/i386/i386/locore.S:1.147	Sat Jul 29 06:29:31 2017
+++ src/sys/arch/i386/i386/locore.S	Sat Jul 29 11:54:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.148 2017/07/29 11:54:14 maxv Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1330,39 +1330,6 @@ IDTVEC(syscall)
 	jmp	.Lsyscall_checkast	/* re-check ASTs */
 IDTVEC_END(syscall)
 
-IDTVEC(svr4_fasttrap)
-	pushl	$2		/* size of instruction for restart */
-	pushl	$T_ASTFLT	/* trap # for doing ASTs */
-	INTRENTRY
-	STI(%eax)
-	pushl	$RW_READER
-	pushl	$_C_LABEL(svr4_fasttrap_lock)
-	call	_C_LABEL(rw_enter)
-	addl	$8,%esp
-	call	*_C_LABEL(svr4_fasttrap_vec)
-	pushl	$_C_LABEL(svr4_fasttrap_lock)
-	call	_C_LABEL(rw_exit)
-	addl	$4,%esp
-2:	/* Check for ASTs on exit to user mode. */
-	cli
-	CHECK_ASTPENDING(%eax)
-	je	1f
-	/* Always returning to user mode here. */
-	CLEAR_ASTPENDING(%eax)
-	sti
-	/* Pushed T_ASTFLT into tf_trapno on entry. */
-	pushl	%esp
-	call	_C_LABEL(trap)
-	addl	$4,%esp
-	jmp	2b
-1:	CHECK_DEFERRED_SWITCH
-	jnz	9f
-	INTRFASTEXIT
-9:	sti
-	call	_C_LABEL(pmap_load)
-	cli
-	jmp	2b
-
 /*
  * int npx586bug1(int a, int b)
  * Used when checking for the FDIV bug on first generations pentiums.

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.786 src/sys/arch/i386/i386/machdep.c:1.787
--- src/sys/arch/i386/i386/machdep.c:1.786	Sat Jul 29 06:29:32 2017
+++ src/sys/arch/i386/i386/machdep.c	Sat Jul 29 11:54:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.787 2017/07/29 11:54:14 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,13 +67,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.787 2017/07/29 11:54:14 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
 #include "opt_compat_freebsd.h"
 #include "opt_compat_netbsd.h"
-#include "opt_compat_svr4.h"
 #include "opt_cpureset_delay.h"
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -923,9 +922,6 @@ setsegment(struct segment_descriptor *sd
 typedef void (vector)(void);
 extern vector IDTVEC(syscall);
 extern vector *IDTVEC(exceptions)[];
-extern vector IDTVEC(svr4_fasttrap);
-void (*svr4_fasttrap_vec)(void) = (void (*)(void))nullop;
-krwlock_t svr4_fasttrap_lock;
 #ifdef XEN
 #define MAX_XEN_IDT 128
 

CVS commit: src/sys

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 10:39:48 UTC 2017

Modified Files:
src/sys/compat/freebsd: files.freebsd freebsd_exec.h freebsd_mod.c
src/sys/modules/compat_freebsd: Makefile
Removed Files:
src/sys/compat/freebsd: freebsd_exec_aout.c

Log Message:
Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/freebsd/files.freebsd
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/freebsd/freebsd_exec.h
cvs rdiff -u -r1.9 -r0 src/sys/compat/freebsd/freebsd_exec_aout.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/freebsd/freebsd_mod.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/compat_freebsd/Makefile

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

Modified files:

Index: src/sys/compat/freebsd/files.freebsd
diff -u src/sys/compat/freebsd/files.freebsd:1.13 src/sys/compat/freebsd/files.freebsd:1.14
--- src/sys/compat/freebsd/files.freebsd:1.13	Mon Nov 17 01:01:57 2014
+++ src/sys/compat/freebsd/files.freebsd	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.freebsd,v 1.13 2014/11/17 01:01:57 uebayasi Exp $
+#	$NetBSD: files.freebsd,v 1.14 2017/07/29 10:39:48 maxv Exp $
 #
 # Config file description for machine-independent FreeBSD compat code.
 # Included by ports that need it.
@@ -9,7 +9,6 @@
 define	compat_freebsd
 file	compat/freebsd/freebsd_exec.c		compat_freebsd
 file	compat/freebsd/freebsd_exec_elf32.c	compat_freebsd & exec_elf32
-file	compat/freebsd/freebsd_exec_aout.c	compat_freebsd & exec_aout
 file	compat/freebsd/freebsd_file.c		compat_freebsd
 file	compat/freebsd/freebsd_fork.c		compat_freebsd
 file	compat/freebsd/freebsd_ioctl.c		compat_freebsd

Index: src/sys/compat/freebsd/freebsd_exec.h
diff -u src/sys/compat/freebsd/freebsd_exec.h:1.17 src/sys/compat/freebsd/freebsd_exec.h:1.18
--- src/sys/compat/freebsd/freebsd_exec.h:1.17	Thu Dec 10 14:13:53 2009
+++ src/sys/compat/freebsd/freebsd_exec.h	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_exec.h,v 1.17 2009/12/10 14:13:53 matt Exp $	*/
+/*	$NetBSD: freebsd_exec.h,v 1.18 2017/07/29 10:39:48 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -29,72 +29,11 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
- *	from: imgact_aout.h,v 1.2 1994/12/30 08:06:19 bde Exp
  */
 
 #ifndef	_FREEBSD_EXEC_H
 #define	_FREEBSD_EXEC_H
 
-#ifdef EXEC_AOUT
-#define FREEBSD_N_GETMAGIC(ex) \
-	( (ex).a_midmag & 0x )
-#define FREEBSD_N_GETMID(ex) \
-	( ((ex).a_midmag >> 16) & 0x03ff )
-#define FREEBSD_N_GETFLAG(ex) \
-	( ((ex).a_midmag >> 26) & 0x3f )
-#define FREEBSD_N_SETMAGIC(ex,mag,mid,flag) \
-	( (ex).a_midmag = (((flag) & 0x3f) <<26) | (((mid) & 0x03ff) << 16) | \
-	((mag) & 0x) )
-
-#define FREEBSD_N_ALIGN(ex,x) \
-	(FREEBSD_N_GETMAGIC(ex) == ZMAGIC || \
-	 FREEBSD_N_GETMAGIC(ex) == QMAGIC ? \
-	 ((x) + FREEBSD___LDPGSZ - 1) & \
-	 ~(unsigned long)(FREEBSD___LDPGSZ - 1) : (x))
-
-/* Valid magic number check. */
-#define	FREEBSD_N_BADMAG(ex) \
-	(FREEBSD_N_GETMAGIC(ex) != OMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != NMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != ZMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != QMAGIC)
-
-/* Address of the bottom of the text segment. */
-#define FREEBSD_N_TXTADDR(ex) \
-	((FREEBSD_N_GETMAGIC(ex) == OMAGIC || \
-	  FREEBSD_N_GETMAGIC(ex) == NMAGIC || \
-	  FREEBSD_N_GETMAGIC(ex) == ZMAGIC) ? 0 : AOUT_LDPGSZ)
-
-/* Address of the bottom of the data segment. */
-#define FREEBSD_N_DATADDR(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_TXTADDR(ex) + (ex).a_text)
-
-/* Text segment offset. */
-#define	FREEBSD_N_TXTOFF(ex) \
-	(FREEBSD_N_GETMAGIC(ex) == ZMAGIC ? AOUT_LDPGSZ : \
-	 FREEBSD_N_GETMAGIC(ex) == QMAGIC ? 0 : sizeof(struct exec))
-
-/* Data segment offset. */
-#define	FREEBSD_N_DATOFF(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_TXTOFF(ex) + (ex).a_text)
-
-/* Relocation table offset. */
-#define FREEBSD_N_RELOFF(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_DATOFF(ex) + (ex).a_data)
-
-/* Symbol table offset. */
-#define FREEBSD_N_SYMOFF(ex) \
-	(FREEBSD_N_RELOFF(ex) + (ex).a_trsize + (ex).a_drsize)
-
-/* String table offset. */
-#define	FREEBSD_N_STROFF(ex) 	(FREEBSD_N_SYMOFF(ex) + (ex).a_syms)
-
-#define	FREEBSD_AOUT_HDR_SIZE	sizeof(struct exec)
-
-int exec_freebsd_aout_makecmds(struct lwp *, struct exec_package *);
-
-#endif /* EXEC_AOUT */
-
 #ifdef EXEC_ELF32
 #define FREEBSD_ELF_BRAND_STRING "FreeBSD"
 #define FREEBSD_ELF_INTERP_PREFIX_STRING "/usr/libexec/ld-elf.so"

Index: src/sys/compat/freebsd/freebsd_mod.c
diff -u src/sys/compat/freebsd/freebsd_mod.c:1.5 src/sys/compat/freebsd/freebsd_mod.c:1.6
--- src/sys/compat/freebsd/freebsd_mod.c:1.5	Fri Mar  7 02:02:16 2014
+++ src/sys/compat/freebsd/freebsd_mod.c	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_mod.c,v 1.5 2014/03/07 02:02:16 christos Exp $	*/

CVS commit: [jdolecek-ncq] src/sys/dev/scsipi

2017-07-29 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Jul 29 09:04:39 UTC 2017

Modified Files:
src/sys/dev/scsipi [jdolecek-ncq]: atapi_wdc.c

Log Message:
do not use freed xfer in error message in wdc_atapi_get_params()


To generate a diff of this commit:
cvs rdiff -u -r1.123.4.9 -r1.123.4.10 src/sys/dev/scsipi/atapi_wdc.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/scsipi/atapi_wdc.c
diff -u src/sys/dev/scsipi/atapi_wdc.c:1.123.4.9 src/sys/dev/scsipi/atapi_wdc.c:1.123.4.10
--- src/sys/dev/scsipi/atapi_wdc.c:1.123.4.9	Tue Jun 27 18:36:03 2017
+++ src/sys/dev/scsipi/atapi_wdc.c	Sat Jul 29 09:04:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: atapi_wdc.c,v 1.123.4.9 2017/06/27 18:36:03 jdolecek Exp $	*/
+/*	$NetBSD: atapi_wdc.c,v 1.123.4.10 2017/07/29 09:04:39 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.123.4.9 2017/06/27 18:36:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.123.4.10 2017/07/29 09:04:39 jdolecek Exp $");
 
 #ifndef ATADEBUG
 #define ATADEBUG
@@ -242,9 +242,9 @@ wdc_atapi_get_params(struct scsipi_chann
 	delay(5000);
 	if (ata_get_params(>ch_drive[drive], AT_WAIT, id) != 0) {
 		ATADEBUG_PRINT(("wdc_atapi_get_params: ATAPI_IDENTIFY_DEVICE "
-		"failed for drive %s:%d:%d: error 0x%x\n",
-		device_xname(atac->atac_dev), chp->ch_channel, drive,
-		xfer->c_ata_c.r_error), DEBUG_PROBE);
+		"failed for drive %s:%d:%d\n",
+		device_xname(atac->atac_dev), chp->ch_channel, drive),
+		DEBUG_PROBE);
 		rv = -1;
 		goto out;
 	}



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

2017-07-29 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Jul 29 07:30:39 UTC 2017

Modified Files:
src/sys/arch/x68k/dev: vs.c

Log Message:
Audio vchan auto config works again due to the use of a null_filter.

Tested and confirmed working by isaki@.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/x68k/dev/vs.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/x68k/dev/vs.c
diff -u src/sys/arch/x68k/dev/vs.c:1.39 src/sys/arch/x68k/dev/vs.c:1.40
--- src/sys/arch/x68k/dev/vs.c:1.39	Sun Jul  9 12:49:26 2017
+++ src/sys/arch/x68k/dev/vs.c	Sat Jul 29 07:30:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vs.c,v 1.39 2017/07/09 12:49:26 isaki Exp $	*/
+/*	$NetBSD: vs.c,v 1.40 2017/07/29 07:30:39 nat Exp $	*/
 
 /*
  * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vs.c,v 1.39 2017/07/09 12:49:26 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vs.c,v 1.40 2017/07/29 07:30:39 nat Exp $");
 
 #include "audio.h"
 #include "vs.h"
@@ -160,6 +160,8 @@ struct {
 
 #define NUM_RATE	(sizeof(vs_l2r)/sizeof(vs_l2r[0]))
 
+extern stream_filter_factory_t null_filter;
+
 static int
 vs_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -405,6 +407,12 @@ vs_set_params(void *hdl, int setmode, in
 	pfil->prepend(pfil, msm6258_slinear16_to_adpcm, play);
 	rfil->prepend(rfil, msm6258_adpcm_to_slinear16, play);
 
+	play->validbits = 16;
+	play->precision = 16;
+
+	pfil->prepend(pfil, null_filter, play);
+	rfil->prepend(rfil, null_filter, play);
+
 	sc->sc_current.prate = rate;
 	sc->sc_current.rrate = rate;
 



CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 07:19:47 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Remove DEBUG_HPUX (does not exist).


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.421 -r1.422 src/sys/arch/i386/conf/ALL

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.63 src/sys/arch/amd64/conf/ALL:1.64
--- src/sys/arch/amd64/conf/ALL:1.63	Sat Jul 29 07:16:15 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Jul 29 07:19:47 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.63 2017/07/29 07:16:15 maxv Exp $
+# $NetBSD: ALL,v 1.64 2017/07/29 07:19:47 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.63 $"
+#ident		"ALL-$Revision: 1.64 $"
 
 maxusers	64		# estimated number of users
 
@@ -1929,7 +1929,6 @@ options DEBUG_FIND_PCIC_I82365SL_ONLY
 options DEBUG_FPE
 options DEBUG_GPIO
 options DEBUG_GPIO2
-options DEBUG_HPUX
 options DEBUG_IBCS2
 options DEBUG_IPR_VJ
 options DEBUG_ISAPNP

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.421 src/sys/arch/i386/conf/ALL:1.422
--- src/sys/arch/i386/conf/ALL:1.421	Sat Jul 29 07:16:14 2017
+++ src/sys/arch/i386/conf/ALL	Sat Jul 29 07:19:47 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.421 2017/07/29 07:16:14 maxv Exp $
+# $NetBSD: ALL,v 1.422 2017/07/29 07:19:47 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.421 $"
+#ident		"ALL-$Revision: 1.422 $"
 
 maxusers	64		# estimated number of users
 
@@ -2079,7 +2079,6 @@ options DEBUG_FIND_PCIC_I82365SL_ONLY
 options DEBUG_FPE
 options DEBUG_GPIO
 options DEBUG_GPIO2
-options DEBUG_HPUX
 options DEBUG_IBCS2
 options DEBUG_IPR_VJ
 options DEBUG_ISAPNP



CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 07:16:15 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Remove IBCS2_DEBUG (does not exist).


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.420 -r1.421 src/sys/arch/i386/conf/ALL

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.62 src/sys/arch/amd64/conf/ALL:1.63
--- src/sys/arch/amd64/conf/ALL:1.62	Fri Jul 28 19:26:15 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Jul 29 07:16:15 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.62 2017/07/28 19:26:15 maxv Exp $
+# $NetBSD: ALL,v 1.63 2017/07/29 07:16:15 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.62 $"
+#ident		"ALL-$Revision: 1.63 $"
 
 maxusers	64		# estimated number of users
 
@@ -2041,7 +2041,6 @@ options I2ODEBUG
 options I4BISPPPDEBUG
 options I4B_MBUF_DEBUG
 options I4B_MBUF_TYPE_DEBUG
-options IBCS2_DEBUG
 options ICONV_DEBUG
 options ICP_DEBUG
 options IEDEBUG

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.420 src/sys/arch/i386/conf/ALL:1.421
--- src/sys/arch/i386/conf/ALL:1.420	Wed Jun 14 09:00:08 2017
+++ src/sys/arch/i386/conf/ALL	Sat Jul 29 07:16:14 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.420 2017/06/14 09:00:08 pgoyette Exp $
+# $NetBSD: ALL,v 1.421 2017/07/29 07:16:14 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.420 $"
+#ident		"ALL-$Revision: 1.421 $"
 
 maxusers	64		# estimated number of users
 
@@ -2191,7 +2191,6 @@ options I2ODEBUG
 options I4BISPPPDEBUG
 options I4B_MBUF_DEBUG
 options I4B_MBUF_TYPE_DEBUG
-options IBCS2_DEBUG
 options ICONV_DEBUG
 options ICP_DEBUG
 options IEDEBUG



CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 29 06:45:35 UTC 2017

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

Log Message:
"bits" sounds better than "name" for argument name.
I feel expression (name / NBBY) a little strange.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.381 src/sys/dev/audio.c:1.382
--- src/sys/dev/audio.c:1.381	Sat Jul 29 06:36:21 2017
+++ src/sys/dev/audio.c	Sat Jul 29 06:45:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.381 2017/07/29 06:36:21 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.381 2017/07/29 06:36:21 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.382 2017/07/29 06:45:35 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5605,9 +5605,9 @@ done:
 	return error;
 }
 
-#define DEF_MIX_FUNC(name, type, bigger_type, MINVAL, MAXVAL)		\
+#define DEF_MIX_FUNC(bits, type, bigger_type, MINVAL, MAXVAL)		\
 	static void			\
-	mix_func##name(struct audio_softc *sc, struct audio_ringbuffer *cb, \
+	mix_func##bits(struct audio_softc *sc, struct audio_ringbuffer *cb, \
 		  struct virtual_channel *vc)\
 	{\
 		int blksize, cc, cc1, cc2, m, resid;			\
@@ -5630,7 +5630,7 @@ done:
 			if (cc > cc2)	\
 cc = cc2;\
 	\
-			for (m = 0; m < (cc / (name / NBBY)); m++) {	\
+			for (m = 0; m < (cc / (bits / NBBY)); m++) {	\
 tomix[m] = (bigger_type)tomix[m] *	\
 (bigger_type)(vc->sc_swvol) / 255;	\
 result = orig[m] + tomix[m];		\
@@ -5675,9 +5675,9 @@ mix_func(struct audio_softc *sc, struct 
 	}
 }
 
-#define DEF_RECSWVOL_FUNC(name, type, bigger_type)			\
+#define DEF_RECSWVOL_FUNC(bits, type, bigger_type)			\
 	static void		\
-	recswvol_func##name(struct audio_softc *sc,			\
+	recswvol_func##bits(struct audio_softc *sc,			\
 	struct audio_ringbuffer *cb, size_t blksize,		\
 	struct virtual_channel *vc)	\
 	{\
@@ -5693,7 +5693,7 @@ mix_func(struct audio_softc *sc, struct 
 			if (cc > cc1)	\
 cc = cc1;\
 	\
-			for (m = 0; m < (cc / (name / 8)); m++) {	\
+			for (m = 0; m < (cc / (bits / 8)); m++) {	\
 orig[m] = (bigger_type)(orig[m] *	\
 (bigger_type)(vc->sc_recswvol) / 256);\
 			}		\



CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 29 06:36:21 UTC 2017

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

Log Message:
Use do .. while (0) for macros.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.380 src/sys/dev/audio.c:1.381
--- src/sys/dev/audio.c:1.380	Sat Jul 29 06:33:45 2017
+++ src/sys/dev/audio.c	Sat Jul 29 06:36:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.380 2017/07/29 06:33:45 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.381 2017/07/29 06:36:21 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.380 2017/07/29 06:33:45 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.381 2017/07/29 06:36:21 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -214,11 +214,15 @@ int	audiodebug = AUDIO_DEBUG;
 int	audio_idle_timeout = 30;
 #endif
 
-#define HW_LOCK(x)	if ((x) == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
-mutex_enter(sc->sc_intr_lock);
-
-#define HW_UNLOCK(x)	if ((x) == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
-mutex_exit(sc->sc_intr_lock);
+#define HW_LOCK(x)	do { \
+	if ((x) == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
+		mutex_enter(sc->sc_intr_lock); \
+} while (0)
+
+#define HW_UNLOCK(x)	do { \
+	if ((x) == SIMPLEQ_FIRST(>sc_audiochan)->vc) \
+		mutex_exit(sc->sc_intr_lock); \
+} while (0)
 
 int	audio_blk_ms = AUDIO_BLK_MS;
 



CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 29 06:33:45 UTC 2017

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

Log Message:
Fix a resource leak on error handling in audio_alloc_ring().


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.379 src/sys/dev/audio.c:1.380
--- src/sys/dev/audio.c:1.379	Sat Jul 29 06:30:56 2017
+++ src/sys/dev/audio.c	Sat Jul 29 06:33:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.379 2017/07/29 06:30:56 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.380 2017/07/29 06:33:45 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.379 2017/07/29 06:30:56 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.380 2017/07/29 06:33:45 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1228,6 +1228,7 @@ audio_alloc_ring(struct audio_softc *sc,
 		false, 0);
 		if (error) {
 			uvm_unmap(kernel_map, vstart, vstart + vsize);
+			uao_detach(r->uobj);
 			r->uobj = NULL;		/* paranoia */
 			return error;
 		}



CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 29 06:30:56 UTC 2017

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

Log Message:
Fix error handling of ring buffers allocation in audioattach().
NULL dereference, dead code, reference to uninitialized variable,
and mutex leak.
XXX In the current implementation, if audio_alloc_ring() returns error,
it is not guaranteed that ringbuf->s.start will be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.378 src/sys/dev/audio.c:1.379
--- src/sys/dev/audio.c:1.378	Sat Jul 29 06:00:47 2017
+++ src/sys/dev/audio.c	Sat Jul 29 06:30:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.378 2017/07/29 06:00:47 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.379 2017/07/29 06:30:56 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.378 2017/07/29 06:00:47 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.379 2017/07/29 06:30:56 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -275,6 +275,7 @@ void	audio_calc_blksize(struct audio_sof
 void	audio_fill_silence(const struct audio_params *, uint8_t *, int);
 int	audio_silence_copyout(struct audio_softc *, int, struct uio *);
 
+static int	audio_allocbufs(struct audio_softc *, struct virtual_channel *);
 void	audio_init_ringbuffer(struct audio_softc *,
 			  struct audio_ringbuffer *, int);
 int	audio_initbufs(struct audio_softc *, struct virtual_channel *);
@@ -482,7 +483,6 @@ audioattach(device_t parent, device_t se
 	mixer_devinfo_t mi;
 	int iclass, mclass, oclass, rclass, props;
 	int record_master_found, record_source_found;
-	bool can_capture, can_playback;
 
 	sc = device_private(self);
 	sc->dev = self;
@@ -557,7 +557,6 @@ audioattach(device_t parent, device_t se
 	hwp->query_devinfo == NULL ||
 	hwp->get_props == NULL) {
 		aprint_error(": missing method\n");
-		sc->hw_if = NULL;
 		return;
 	}
 #endif
@@ -588,56 +587,16 @@ audioattach(device_t parent, device_t se
 	aprint_normal("\n");
 
 	mutex_enter(sc->sc_lock);
-	can_playback = audio_can_playback(sc);
-	can_capture = audio_can_capture(sc);
-
-	if (can_playback) {
-		error = audio_alloc_ring(sc, >sc_pr,
-		AUMODE_PLAY, AU_RING_SIZE);
-		if (error)
-			goto bad_play;
-
-		error = audio_alloc_ring(sc, >sc_mpr,
-		AUMODE_PLAY, AU_RING_SIZE);
-bad_play:
-		if (error) {
-			if (sc->sc_pr.s.start != NULL)
-audio_free_ring(sc, >sc_pr);
-			sc->hw_if = NULL;
-			if (vc->sc_mpr.s.start != 0)
-audio_free_ring(sc, >sc_mpr);
-			sc->hw_if = NULL;
-			aprint_error_dev(sc->sc_dev, "could not allocate play "
-			"buffer\n");
-			return;
-		}
-	}
-	if (can_capture) {
-		error = audio_alloc_ring(sc, >sc_rr,
-		AUMODE_RECORD, AU_RING_SIZE);
-		if (error)
-			goto bad_rec;
-
-		error = audio_alloc_ring(sc, >sc_mrr,
-		AUMODE_RECORD, AU_RING_SIZE);
-bad_rec:
-		if (error) {
-			if (vc->sc_mrr.s.start != NULL)
-audio_free_ring(sc, >sc_mrr);
-			if (sc->sc_pr.s.start != NULL)
-audio_free_ring(sc, >sc_pr);
-			if (vc->sc_mpr.s.start != 0)
-audio_free_ring(sc, >sc_mpr);
-			sc->hw_if = NULL;
-			aprint_error_dev(sc->sc_dev, "could not allocate record"
-			   " buffer\n");
-			return;
-		}
+	if (audio_allocbufs(sc, vc) != 0) {
+		aprint_error_dev(sc->sc_dev,
+			"could not allocate ring buffer\n");
+		mutex_exit(sc->sc_lock);
+		return;
 	}
+	mutex_exit(sc->sc_lock);
 
 	sc->sc_lastgain = 128;
 	sc->sc_multiuser = false;
-	mutex_exit(sc->sc_lock);
 
 	error = vchan_autoconfig(sc);
 	if (error != 0) {
@@ -1168,6 +1127,54 @@ audio_print_params(const char *s, struct
 }
 #endif
 
+/* Allocate all ring buffers. called from audioattach() */
+static int
+audio_allocbufs(struct audio_softc *sc, struct virtual_channel *vc)
+{
+	int error;
+
+	sc->sc_pr.s.start = NULL;
+	vc->sc_mpr.s.start = NULL;
+	sc->sc_rr.s.start = NULL;
+	vc->sc_mrr.s.start = NULL;
+
+	if (audio_can_playback(sc)) {
+		error = audio_alloc_ring(sc, >sc_pr,
+		AUMODE_PLAY, AU_RING_SIZE);
+		if (error)
+			goto bad_play1;
+
+		error = audio_alloc_ring(sc, >sc_mpr,
+		AUMODE_PLAY, AU_RING_SIZE);
+		if (error)
+			goto bad_play2;
+	}
+	if (audio_can_capture(sc)) {
+		error = audio_alloc_ring(sc, >sc_rr,
+		AUMODE_RECORD, AU_RING_SIZE);
+		if (error)
+			goto bad_rec1;
+
+		error = audio_alloc_ring(sc, >sc_mrr,
+		AUMODE_RECORD, AU_RING_SIZE);
+		if (error)
+			goto bad_rec2;
+	}
+	return 0;
+
+bad_rec2:
+	if (sc->sc_rr.s.start != NULL)
+		audio_free_ring(sc, >sc_rr);
+bad_rec1:
+	if (vc->sc_mpr.s.start != NULL)
+		audio_free_ring(sc, >sc_mpr);
+bad_play2:
+	if (sc->sc_pr.s.start != NULL)
+		audio_free_ring(sc, >sc_pr);
+bad_play1:
+	return error;
+}
+
 int
 audio_alloc_ring(struct audio_softc 

CVS commit: src/sys/arch

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 06:29:32 UTC 2017

Modified Files:
src/sys/arch/i386/conf: files.i386
src/sys/arch/i386/i386: autoconf.c locore.S machdep.c
src/sys/arch/xen/conf: files.compat
src/sys/arch/xen/x86: autoconf.c

Log Message:
Remove the remaining parts of compat_oldboot.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/i386/i386/autoconf.c
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.785 -r1.786 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/conf/files.compat
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/autoconf.c

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

Modified files:

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.379 src/sys/arch/i386/conf/files.i386:1.380
--- src/sys/arch/i386/conf/files.i386:1.379	Wed Jul 12 16:59:41 2017
+++ src/sys/arch/i386/conf/files.i386	Sat Jul 29 06:29:31 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.379 2017/07/12 16:59:41 maxv Exp $
+#	$NetBSD: files.i386,v 1.380 2017/07/29 06:29:31 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -35,9 +35,6 @@ defparam opt_realmem.h	REALBASEMEM REALE
 # The PHYSMEM_MAX_{SIZE,ADDR} optionms
 defparam opt_physmem.h	PHYSMEM_MAX_ADDR PHYSMEM_MAX_SIZE
 
-# understand boot device passed by pre-1.3 bootblocks
-defflag			COMPAT_OLDBOOT
-
 # PCI BIOS options
 defflag	opt_pcibios.h	PCIBIOS PCIBIOSVERBOSE
 			PCIBIOS_INTR_GUESS PCIINTR_DEBUG

Index: src/sys/arch/i386/i386/autoconf.c
diff -u src/sys/arch/i386/i386/autoconf.c:1.103 src/sys/arch/i386/i386/autoconf.c:1.104
--- src/sys/arch/i386/i386/autoconf.c:1.103	Tue May 23 08:48:34 2017
+++ src/sys/arch/i386/i386/autoconf.c	Sat Jul 29 06:29:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.103 2017/05/23 08:48:34 nonaka Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.104 2017/07/29 06:29:31 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,9 +46,8 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.103 2017/05/23 08:48:34 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.104 2017/07/29 06:29:31 maxv Exp $");
 
-#include "opt_compat_oldboot.h"
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
 

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.146 src/sys/arch/i386/i386/locore.S:1.147
--- src/sys/arch/i386/i386/locore.S:1.146	Sat Jul  1 10:44:42 2017
+++ src/sys/arch/i386/i386/locore.S	Sat Jul 29 06:29:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.146 2017/07/01 10:44:42 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,9 +128,8 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.146 2017/07/01 10:44:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.147 2017/07/29 06:29:31 maxv Exp $");
 
-#include "opt_compat_oldboot.h"
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
 #include "opt_modular.h"

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.785 src/sys/arch/i386/i386/machdep.c:1.786
--- src/sys/arch/i386/i386/machdep.c:1.785	Sat Jul 22 09:01:46 2017
+++ src/sys/arch/i386/i386/machdep.c	Sat Jul 29 06:29:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.785 2017/07/22 09:01:46 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.785 2017/07/22 09:01:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.786 2017/07/29 06:29:32 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -337,14 +337,6 @@ native_loader(int bl_boothowto, int bl_b
 
 	*RELOC(int *, ) = bl_boothowto;
 
-#ifdef COMPAT_OLDBOOT
-	/*
-	 * Pre-1.3 boot loaders gave the boot device as a parameter
-	 * (instead of a bootinfo entry).
-	 */
-	*RELOC(int *, ) = bl_bootdev;
-#endif
-
 	/*
 	 * The boot loader provides a physical, non-relocated address
 	 * for the symbols table's end.  We need to convert it to a

Index: src/sys/arch/xen/conf/files.compat
diff -u src/sys/arch/xen/conf/files.compat:1.26 src/sys/arch/xen/conf/files.compat:1.27
--- src/sys/arch/xen/conf/files.compat:1.26	Wed Jul 12 16:59:41 2017
+++ src/sys/arch/xen/conf/files.compat	Sat Jul 29 06:29:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.compat,v 1.26 2017/07/12 16:59:41 maxv Exp $
+#	$NetBSD: files.compat,v 1.27 2017/07/29 06:29:32 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 
 # options for MP configuration through the MP spec
@@ -39,9 +39,6 @@ defflag	opt_xserver.h			SERVER S
 # The REAL{BASE,EXT}MEM options
 defparam opt_realmem.h			XXXREALBASEMEM 

CVS commit: src/sys/compat/sys

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 06:12:50 UTC 2017

Modified Files:
src/sys/compat/sys: socket.h

Log Message:
Only compat_43 needs compat_osock. Note that the use of vec_compat_ifioctl
is racy.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/socket.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/sys/socket.h
diff -u src/sys/compat/sys/socket.h:1.14 src/sys/compat/sys/socket.h:1.15
--- src/sys/compat/sys/socket.h:1.14	Thu Apr  7 17:48:40 2016
+++ src/sys/compat/sys/socket.h	Sat Jul 29 06:12:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.14 2016/04/07 17:48:40 mrg Exp $	*/
+/*	$NetBSD: socket.h,v 1.15 2017/07/29 06:12:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
@@ -43,8 +43,7 @@
 #include "opt_compat_43.h"
 #include "opt_modular.h"
 
-#if defined(COMPAT_43) || defined(COMPAT_LINUX) || defined(COMPAT_SVR4) || \
-defined(COMPAT_ULTRIX) || defined(MODULAR)
+#if defined(COMPAT_43) || defined(MODULAR)
 #define COMPAT_OSOCK
 #endif
 



CVS commit: src/sys/dev

2017-07-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jul 29 06:00:47 UTC 2017

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

Log Message:
0 -> NULL in audioattach()


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.377 src/sys/dev/audio.c:1.378
--- src/sys/dev/audio.c:1.377	Sat Jul 29 05:55:58 2017
+++ src/sys/dev/audio.c	Sat Jul 29 06:00:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.377 2017/07/29 05:55:58 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.378 2017/07/29 06:00:47 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.377 2017/07/29 05:55:58 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.378 2017/07/29 06:00:47 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -537,7 +537,7 @@ audioattach(device_t parent, device_t se
 	cv_init(>sc_condvar,"play");
 	cv_init(>sc_rcondvar,"record");
 
-	if (hwp == 0 || hwp->get_locks == 0) {
+	if (hwp == NULL || hwp->get_locks == NULL) {
 		aprint_error(": missing method\n");
 		panic("audioattach");
 	}
@@ -545,17 +545,17 @@ audioattach(device_t parent, device_t se
 	hwp->get_locks(hdlp, >sc_intr_lock, >sc_lock);
 
 #ifdef DIAGNOSTIC
-	if (hwp->query_encoding == 0 ||
-	hwp->set_params == 0 ||
-	(hwp->start_output == 0 && hwp->trigger_output == 0) ||
-	(hwp->start_input == 0 && hwp->trigger_input == 0) ||
-	hwp->halt_output == 0 ||
-	hwp->halt_input == 0 ||
-	hwp->getdev == 0 ||
-	hwp->set_port == 0 ||
-	hwp->get_port == 0 ||
-	hwp->query_devinfo == 0 ||
-	hwp->get_props == 0) {
+	if (hwp->query_encoding == NULL ||
+	hwp->set_params == NULL ||
+	(hwp->start_output == NULL && hwp->trigger_output == NULL) ||
+	(hwp->start_input == NULL && hwp->trigger_input == NULL) ||
+	hwp->halt_output == NULL ||
+	hwp->halt_input == NULL ||
+	hwp->getdev == NULL ||
+	hwp->set_port == NULL ||
+	hwp->get_port == NULL ||
+	hwp->query_devinfo == NULL ||
+	hwp->get_props == NULL) {
 		aprint_error(": missing method\n");
 		sc->hw_if = NULL;
 		return;