CVS commit: src/sys/dev/ic

2020-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 29 07:56:22 UTC 2020

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

Log Message:
Function declaration formating whitespace consistency.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 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.92 src/sys/dev/ic/ahcisata_core.c:1.93
--- src/sys/dev/ic/ahcisata_core.c:1.92	Mon Dec 28 14:08:42 2020
+++ src/sys/dev/ic/ahcisata_core.c	Tue Dec 29 07:56:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.92 2020/12/28 14:08:42 jmcneill Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.93 2020/12/29 07:56:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.92 2020/12/28 14:08:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.93 2020/12/29 07:56:22 skrll Exp $");
 
 #include 
 #include 
@@ -62,19 +62,19 @@ static int  ahci_do_reset_drive(struct a
 	uint8_t);
 static void ahci_reset_drive(struct ata_drive_datas *, int, uint32_t *);
 static void ahci_reset_channel(struct ata_channel *, int);
-static void  ahci_exec_command(struct ata_drive_datas *, struct ata_xfer *);
+static void ahci_exec_command(struct ata_drive_datas *, struct ata_xfer *);
 static int  ahci_ata_addref(struct ata_drive_datas *);
 static void ahci_ata_delref(struct ata_drive_datas *);
 static void ahci_killpending(struct ata_drive_datas *);
 
-static int ahci_cmd_start(struct ata_channel *, struct ata_xfer *);
+static int  ahci_cmd_start(struct ata_channel *, struct ata_xfer *);
 static int  ahci_cmd_complete(struct ata_channel *, struct ata_xfer *, int);
 static void ahci_cmd_poll(struct ata_channel *, struct ata_xfer *);
 static void ahci_cmd_abort(struct ata_channel *, struct ata_xfer *);
 static void ahci_cmd_done(struct ata_channel *, struct ata_xfer *);
 static void ahci_cmd_done_end(struct ata_channel *, struct ata_xfer *);
 static void ahci_cmd_kill_xfer(struct ata_channel *, struct ata_xfer *, int);
-static int ahci_bio_start(struct ata_channel *, struct ata_xfer *);
+static int  ahci_bio_start(struct ata_channel *, struct ata_xfer *);
 static void ahci_bio_poll(struct ata_channel *, struct ata_xfer *);
 static void ahci_bio_abort(struct ata_channel *, struct ata_xfer *);
 static int  ahci_bio_complete(struct ata_channel *, struct ata_xfer *, int);
@@ -84,7 +84,7 @@ static void ahci_channel_start(struct ah
 int, int);
 static void ahci_channel_recover(struct ata_channel *, int, uint32_t);
 static int  ahci_dma_setup(struct ata_channel *, int, void *, size_t, int);
-static int ahci_intr_port_common(struct ata_channel *);
+static int  ahci_intr_port_common(struct ata_channel *);
 
 #if NATAPIBUS > 0
 static void ahci_atapibus_attach(struct atabus_softc *);
@@ -92,7 +92,7 @@ static void ahci_atapi_kill_pending(stru
 static void ahci_atapi_minphys(struct buf *);
 static void ahci_atapi_scsipi_request(struct scsipi_channel *,
 scsipi_adapter_req_t, void *);
-static int ahci_atapi_start(struct ata_channel *, struct ata_xfer *);
+static int  ahci_atapi_start(struct ata_channel *, struct ata_xfer *);
 static void ahci_atapi_poll(struct ata_channel *, struct ata_xfer *);
 static void ahci_atapi_abort(struct ata_channel *, struct ata_xfer *);
 static int  ahci_atapi_complete(struct ata_channel *, struct ata_xfer *, int);



CVS commit: src/usr.bin/make

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 03:21:09 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): clean up code in extracted ExportVar functions


To generate a diff of this commit:
cvs rdiff -u -r1.776 -r1.777 src/usr.bin/make/var.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/make/var.c
diff -u src/usr.bin/make/var.c:1.776 src/usr.bin/make/var.c:1.777
--- src/usr.bin/make/var.c:1.776	Tue Dec 29 03:05:15 2020
+++ src/usr.bin/make/var.c	Tue Dec 29 03:21:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.776 2020/12/29 03:05:15 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.777 2020/12/29 03:21:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.776 2020/12/29 03:05:15 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.777 2020/12/29 03:21:09 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -579,155 +579,64 @@ MayExport(const char *name)
 static Boolean
 ExportVarEnv(Var *v)
 {
-	VarExportMode mode = VEM_ENV;
 	const char *name = v->name.str;
-	char *val;
+	char *val = v->val.data;
+	char *expr;
 
-	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
+	if ((v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
 		return FALSE;	/* nothing to do */
 
-	val = Buf_GetAll(>val, NULL);
-	if (mode != VEM_LITERAL && strchr(val, '$') != NULL) {
-		char *expr;
-
-		if (mode == VEM_PLAIN) {
-			/*
-			 * Flag the variable as something we need to re-export.
-			 * No point actually exporting it now though,
-			 * the child process can do it at the last minute.
-			 */
-			v->flags |= VAR_EXPORTED | VAR_REEXPORT;
-			return TRUE;
-		}
-		if (v->flags & VAR_IN_USE) {
-			/*
-			 * We recursed while exporting in a child.
-			 * This isn't going to end well, just skip it.
-			 */
-			return FALSE;
-		}
-
-		/* XXX: name is injected without escaping it */
-		expr = str_concat3("${", name, "}");
-		(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
-		/* TODO: handle errors */
-		setenv(name, val, 1);
-		free(val);
-		free(expr);
-	} else {
-		if (mode == VEM_PLAIN)
-			v->flags &= ~(unsigned)VAR_REEXPORT; /* once will do */
-		if (mode == VEM_PLAIN || !(v->flags & VAR_EXPORTED))
+	if (strchr(val, '$') == NULL) {
+		if (!(v->flags & VAR_EXPORTED))
 			setenv(name, val, 1);
+		return TRUE;
 	}
 
-	/* This is so Var_Set knows to call Var_Export again. */
-	if (mode == VEM_PLAIN)
-		v->flags |= VAR_EXPORTED;
+	if (v->flags & VAR_IN_USE) {
+		/*
+		 * We recursed while exporting in a child.
+		 * This isn't going to end well, just skip it.
+		 */
+		return FALSE;
+	}
 
+	/* XXX: name is injected without escaping it */
+	expr = str_concat3("${", name, "}");
+	(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
+	/* TODO: handle errors */
+	setenv(name, val, 1);
+	free(val);
+	free(expr);
 	return TRUE;
 }
 
 static Boolean
 ExportVarPlain(Var *v)
 {
-	VarExportMode mode = VEM_PLAIN;
-	const char *name = v->name.str;
-	char *val;
-
-	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
-		return FALSE;	/* nothing to do */
-
-	val = Buf_GetAll(>val, NULL);
-	if (mode != VEM_LITERAL && strchr(val, '$') != NULL) {
-		char *expr;
-
-		if (mode == VEM_PLAIN) {
-			/*
-			 * Flag the variable as something we need to re-export.
-			 * No point actually exporting it now though,
-			 * the child process can do it at the last minute.
-			 */
-			v->flags |= VAR_EXPORTED | VAR_REEXPORT;
-			return TRUE;
-		}
-		if (v->flags & VAR_IN_USE) {
-			/*
-			 * We recursed while exporting in a child.
-			 * This isn't going to end well, just skip it.
-			 */
-			return FALSE;
-		}
-
-		/* XXX: name is injected without escaping it */
-		expr = str_concat3("${", name, "}");
-		(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
-		/* TODO: handle errors */
-		setenv(name, val, 1);
-		free(val);
-		free(expr);
-	} else {
-		if (mode == VEM_PLAIN)
-			v->flags &= ~(unsigned)VAR_REEXPORT; /* once will do */
-		if (mode == VEM_PLAIN || !(v->flags & VAR_EXPORTED))
-			setenv(name, val, 1);
-	}
-
-	/* This is so Var_Set knows to call Var_Export again. */
-	if (mode == VEM_PLAIN)
+	if (strchr(v->val.data, '$') == NULL) {
+		setenv(v->name.str, v->val.data, 1);
 		v->flags |= VAR_EXPORTED;
+		v->flags &= ~(unsigned)VAR_REEXPORT;
+		return TRUE;
+	}
 
+	/*
+	 * Flag the variable as something we need to re-export.
+	 * No point actually exporting it now though,
+	 * the child process can do it at the last minute.
+	 */
+	v->flags |= VAR_EXPORTED | VAR_REEXPORT;
 	return TRUE;
 }
 
 static Boolean
 ExportVarLiteral(Var *v)
 {
-	VarExportMode mode = VEM_LITERAL;
-	const char *name = v->name.str;
-	char *val;
-
-	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
-		return 

CVS commit: src/usr.bin/make

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 03:05:15 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): split ExportVar into separate functions


To generate a diff of this commit:
cvs rdiff -u -r1.775 -r1.776 src/usr.bin/make/var.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/make/var.c
diff -u src/usr.bin/make/var.c:1.775 src/usr.bin/make/var.c:1.776
--- src/usr.bin/make/var.c:1.775	Tue Dec 29 01:48:46 2020
+++ src/usr.bin/make/var.c	Tue Dec 29 03:05:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.775 2020/12/29 01:48:46 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.776 2020/12/29 03:05:15 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.775 2020/12/29 01:48:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.776 2020/12/29 03:05:15 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -576,40 +576,125 @@ MayExport(const char *name)
 	return TRUE;
 }
 
-/*
- * Export a single variable.
- *
- * We ignore make internal variables (those which start with '.').
- * Also we jump through some hoops to avoid calling setenv
- * more than necessary since it can leak.
- * We only manipulate flags of vars if 'parent' is set.
- */
 static Boolean
-ExportVar(const char *name, VarExportMode mode)
+ExportVarEnv(Var *v)
 {
-	/*
-	 * XXX: It sounds wrong to handle VEM_PLAIN and VEM_LITERAL
-	 * differently here.
-	 */
-	Boolean plain = mode == VEM_PLAIN;
-	Var *v;
+	VarExportMode mode = VEM_ENV;
+	const char *name = v->name.str;
 	char *val;
 
-	if (!MayExport(name))
-		return FALSE;
+	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
+		return FALSE;	/* nothing to do */
 
-	v = VarFind(name, VAR_GLOBAL, FALSE);
-	if (v == NULL)
-		return FALSE;
+	val = Buf_GetAll(>val, NULL);
+	if (mode != VEM_LITERAL && strchr(val, '$') != NULL) {
+		char *expr;
+
+		if (mode == VEM_PLAIN) {
+			/*
+			 * Flag the variable as something we need to re-export.
+			 * No point actually exporting it now though,
+			 * the child process can do it at the last minute.
+			 */
+			v->flags |= VAR_EXPORTED | VAR_REEXPORT;
+			return TRUE;
+		}
+		if (v->flags & VAR_IN_USE) {
+			/*
+			 * We recursed while exporting in a child.
+			 * This isn't going to end well, just skip it.
+			 */
+			return FALSE;
+		}
+
+		/* XXX: name is injected without escaping it */
+		expr = str_concat3("${", name, "}");
+		(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
+		/* TODO: handle errors */
+		setenv(name, val, 1);
+		free(val);
+		free(expr);
+	} else {
+		if (mode == VEM_PLAIN)
+			v->flags &= ~(unsigned)VAR_REEXPORT; /* once will do */
+		if (mode == VEM_PLAIN || !(v->flags & VAR_EXPORTED))
+			setenv(name, val, 1);
+	}
+
+	/* This is so Var_Set knows to call Var_Export again. */
+	if (mode == VEM_PLAIN)
+		v->flags |= VAR_EXPORTED;
+
+	return TRUE;
+}
+
+static Boolean
+ExportVarPlain(Var *v)
+{
+	VarExportMode mode = VEM_PLAIN;
+	const char *name = v->name.str;
+	char *val;
+
+	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
+		return FALSE;	/* nothing to do */
+
+	val = Buf_GetAll(>val, NULL);
+	if (mode != VEM_LITERAL && strchr(val, '$') != NULL) {
+		char *expr;
+
+		if (mode == VEM_PLAIN) {
+			/*
+			 * Flag the variable as something we need to re-export.
+			 * No point actually exporting it now though,
+			 * the child process can do it at the last minute.
+			 */
+			v->flags |= VAR_EXPORTED | VAR_REEXPORT;
+			return TRUE;
+		}
+		if (v->flags & VAR_IN_USE) {
+			/*
+			 * We recursed while exporting in a child.
+			 * This isn't going to end well, just skip it.
+			 */
+			return FALSE;
+		}
+
+		/* XXX: name is injected without escaping it */
+		expr = str_concat3("${", name, "}");
+		(void)Var_Subst(expr, VAR_GLOBAL, VARE_WANTRES, );
+		/* TODO: handle errors */
+		setenv(name, val, 1);
+		free(val);
+		free(expr);
+	} else {
+		if (mode == VEM_PLAIN)
+			v->flags &= ~(unsigned)VAR_REEXPORT; /* once will do */
+		if (mode == VEM_PLAIN || !(v->flags & VAR_EXPORTED))
+			setenv(name, val, 1);
+	}
 
-	if (!plain && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
+	/* This is so Var_Set knows to call Var_Export again. */
+	if (mode == VEM_PLAIN)
+		v->flags |= VAR_EXPORTED;
+
+	return TRUE;
+}
+
+static Boolean
+ExportVarLiteral(Var *v)
+{
+	VarExportMode mode = VEM_LITERAL;
+	const char *name = v->name.str;
+	char *val;
+
+	if (!(mode == VEM_PLAIN) && (v->flags & VAR_EXPORTED) && !(v->flags & VAR_REEXPORT))
 		return FALSE;	/* nothing to do */
 
 	val = Buf_GetAll(>val, NULL);
 	if (mode != VEM_LITERAL && strchr(val, '$') != NULL) {
 		char *expr;
 
-		if (plain) {
+		if (mode == VEM_PLAIN) {
 			/*
 			 * Flag the variable as something we need to re-export.
 			 * No point 

CVS commit: src/usr.bin/make

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 01:48:46 UTC 2020

Modified Files:
src/usr.bin/make: var.c

Log Message:
make(1): rename local variables in Var_ReexportVars


To generate a diff of this commit:
cvs rdiff -u -r1.774 -r1.775 src/usr.bin/make/var.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/make/var.c
diff -u src/usr.bin/make/var.c:1.774 src/usr.bin/make/var.c:1.775
--- src/usr.bin/make/var.c:1.774	Mon Dec 28 00:46:24 2020
+++ src/usr.bin/make/var.c	Tue Dec 29 01:48:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.774 2020/12/28 00:46:24 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.775 2020/12/29 01:48:46 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.774 2020/12/28 00:46:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.775 2020/12/29 01:48:46 rillig Exp $");
 
 typedef enum VarFlags {
 	VAR_NONE	= 0,
@@ -654,7 +654,7 @@ ExportVar(const char *name, VarExportMod
 void
 Var_ReexportVars(void)
 {
-	char *val;
+	char *xvarnames;
 
 	/*
 	 * Several make implementations support this sort of mechanism for
@@ -682,17 +682,17 @@ Var_ReexportVars(void)
 	}
 
 	(void)Var_Subst("${" MAKE_EXPORTED ":O:u}", VAR_GLOBAL, VARE_WANTRES,
-	);
+	);
 	/* TODO: handle errors */
-	if (val[0] != '\0') {
-		Words words = Str_Words(val, FALSE);
+	if (xvarnames[0] != '\0') {
+		Words varnames = Str_Words(xvarnames, FALSE);
 		size_t i;
 
-		for (i = 0; i < words.len; i++)
-			ExportVar(words.words[i], VEM_ENV);
-		Words_Free(words);
+		for (i = 0; i < varnames.len; i++)
+			ExportVar(varnames.words[i], VEM_ENV);
+		Words_Free(varnames);
 	}
-	free(val);
+	free(xvarnames);
 }
 
 static void



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

2020-12-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec 29 01:48:22 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: GENERIC GENERIC64

Log Message:
Add pcaiicmux.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/evbarm/conf/GENERIC
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.89 src/sys/arch/evbarm/conf/GENERIC:1.90
--- src/sys/arch/evbarm/conf/GENERIC:1.89	Wed Dec 23 15:56:43 2020
+++ src/sys/arch/evbarm/conf/GENERIC	Tue Dec 29 01:48:22 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.89 2020/12/23 15:56:43 skrll Exp $
+#	$NetBSD: GENERIC,v 1.90 2020/12/29 01:48:22 thorpej Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -353,6 +353,7 @@ axppmic* 	at iic?			# X-Powers AXP Power
 axpreg* 	at axppmic?
 em3027rtc* 	at iic?
 max77620pmic* 	at iic?
+pcaiicmux*	at iic?			# PCA954x / PCA984x I2C switch / mux
 pcf8563rtc* 	at iic?			# PCF8563 RTC
 seeprom* 	at iic?			# AT24Cxx Serial EEPROM
 sy8106a* 	at iic?			# Silergy SY81061 regulator

Index: src/sys/arch/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.168 src/sys/arch/evbarm/conf/GENERIC64:1.169
--- src/sys/arch/evbarm/conf/GENERIC64:1.168	Wed Dec 23 04:09:32 2020
+++ src/sys/arch/evbarm/conf/GENERIC64	Tue Dec 29 01:48:22 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.168 2020/12/23 04:09:32 thorpej Exp $
+#	$NetBSD: GENERIC64,v 1.169 2020/12/29 01:48:22 thorpej Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -317,6 +317,7 @@ cwfg*		at iic?			# CellWise CW2015 Fuel 
 es8316ac*	at iic?			# Everest Semi ES8316 Audio CODEC
 fan53555reg*	at iic?			# FAN53555 / SY82x regulator
 max77620pmic*	at iic?
+pcaiicmux*	at iic?			# PCA954x / PCA984x I2C switch / mux
 pcf8563rtc*	at iic?			# PCF8563 RTC
 rkpmic*		at iic?			# Rockchip Power Management IC
 rkreg*		at rkpmic?



CVS commit: src/sys/dev/i2c

2020-12-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec 29 01:47:52 UTC 2020

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: pcai2cmux.c

Log Message:
Add a driver for NXP PCA954x / PCA984x I2C switch / mux controllers.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/pcai2cmux.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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.113 src/sys/dev/i2c/files.i2c:1.114
--- src/sys/dev/i2c/files.i2c:1.113	Mon Dec 28 20:29:57 2020
+++ src/sys/dev/i2c/files.i2c	Tue Dec 29 01:47:51 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.113 2020/12/28 20:29:57 thorpej Exp $
+#	$NetBSD: files.i2c,v 1.114 2020/12/29 01:47:51 thorpej Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -370,6 +370,11 @@ device	anxedp: edid, videomode, drmkms, 
 attach	anxedp at iic
 file	dev/i2c/anxedp.c			anxedp
 
+# NXP PCA954x / PCA984x I2C switch / mux controllers
+device	pcaiicmux: i2cbus, i2cmux
+attach	pcaiicmux at iic
+file	dev/i2c/pcai2cmux.c			pcaiicmux
+
 # NXP PCA9685 16-channel, 12-bit PWM Fm+ LED controller
 device	pcapwm: pwm
 attach	pcapwm at iic

Added files:

Index: src/sys/dev/i2c/pcai2cmux.c
diff -u /dev/null src/sys/dev/i2c/pcai2cmux.c:1.1
--- /dev/null	Tue Dec 29 01:47:52 2020
+++ src/sys/dev/i2c/pcai2cmux.c	Tue Dec 29 01:47:51 2020
@@ -0,0 +1,354 @@
+/*	$NetBSD: pcai2cmux.c,v 1.1 2020/12/29 01:47:51 thorpej Exp $	*/
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.1 2020/12/29 01:47:51 thorpej Exp $");
+
+/*
+ * Driver for NXP PCA954x / PCA984x I2C switches and multiplexers.
+ *
+ * There are two flavors of this device:
+ *
+ * - Multiplexers, which connect the upstream bus to one downstream bus
+ *   at a time.
+ *
+ * - Switches, which can connect the upstream bus to one or more downstream
+ *   busses at a time (which is useful when using an all-call address for
+ *   a large array of PCA9685 LED controllers, for example).
+ *
+ * Alas, the device tree bindings don't have anything specifically for
+ * switches, so we treat the switch variants as basic multiplexers,
+ * only enabling one downstream bus at a time.
+ *
+ * Note that some versions of these chips also have interrupt mux
+ * capability.  XXX We do not support this yet.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/* There are a maximum of 8 busses supported. */
+#define	PCAIICMUX_MAX_BUSSES	8
+
+struct pcaiicmux_type {
+	unsigned int	nchannels;	/* # of downstream channels */
+	uint8_t		enable_bit;	/* if 0, chip is switch type */
+};
+
+static const struct pcaiicmux_type mux2_type = {
+	.nchannels = 2,
+	.enable_bit = __BIT(2),
+};
+
+static const struct pcaiicmux_type switch2_type = {
+	.nchannels = 2,
+	.enable_bit = 0,
+};
+
+static const struct pcaiicmux_type mux4_type = {
+	.nchannels = 4,
+	.enable_bit = __BIT(2),
+};
+
+static const struct pcaiicmux_type switch4_type = {
+	.nchannels = 4,
+	.enable_bit = 0,
+};
+
+static const struct pcaiicmux_type mux8_type = {
+	.nchannels = 8,
+	.enable_bit = __BIT(3),
+};
+
+static const struct pcaiicmux_type switch8_type = {
+	.nchannels = 8,
+	.enable_bit = 0,
+};
+
+static const struct device_compatible_entry compat_data[] = {
+	/* PCA9540 - 2 channel i2c mux */
+	{ .compat = "nxp,pca9540",

CVS commit: src

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec 29 01:45:06 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: directive-export-impl.exp
directive-export-impl.mk

Log Message:
make(1): add test that explains how variables are exported

Exporting the variables at the right time and with the correct values is
a subtle issue.  The current implementation carefully marks variables as
ready to be exported, then exports them and at the same time tries to
export as few variables as possible, to avoid memory leaks.  This test
describes and explains how all this works in detail.

This test also justifies that the call to Var_ReexportVars happens in
the make process itself, not in the child processes, no matter whether
these are created with vfork or (only theoretically) with plain fork.
This has changed in compat.c 1.217, job.c 1.390 and main.c 1.504 from
2020-12-27.


To generate a diff of this commit:
cvs rdiff -u -r1.999 -r1.1000 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.257 -r1.258 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/directive-export-impl.exp \
src/usr.bin/make/unit-tests/directive-export-impl.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.999 src/distrib/sets/lists/tests/mi:1.1000
--- src/distrib/sets/lists/tests/mi:1.999	Mon Dec 28 12:47:39 2020
+++ src/distrib/sets/lists/tests/mi	Tue Dec 29 01:45:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.999 2020/12/28 12:47:39 rillig Exp $
+# $NetBSD: mi,v 1.1000 2020/12/29 01:45:06 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5050,6 +5050,8 @@
 ./usr/tests/usr.bin/make/unit-tests/directive-export-env.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-export-gmake.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-export-gmake.mk			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-export-impl.exp			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/directive-export-impl.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-export-literal.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-export-literal.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/directive-export.exp			tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.257 src/usr.bin/make/unit-tests/Makefile:1.258
--- src/usr.bin/make/unit-tests/Makefile:1.257	Sun Dec 27 05:11:40 2020
+++ src/usr.bin/make/unit-tests/Makefile	Tue Dec 29 01:45:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.257 2020/12/27 05:11:40 rillig Exp $
+# $NetBSD: Makefile,v 1.258 2020/12/29 01:45:06 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -157,6 +157,7 @@ TESTS+=		directive-endif
 TESTS+=		directive-error
 TESTS+=		directive-export
 TESTS+=		directive-export-env
+TESTS+=		directive-export-impl
 TESTS+=		directive-export-gmake
 TESTS+=		directive-export-literal
 TESTS+=		directive-for

Added files:

Index: src/usr.bin/make/unit-tests/directive-export-impl.exp
diff -u /dev/null src/usr.bin/make/unit-tests/directive-export-impl.exp:1.1
--- /dev/null	Tue Dec 29 01:45:06 2020
+++ src/usr.bin/make/unit-tests/directive-export-impl.exp	Tue Dec 29 01:45:06 2020
@@ -0,0 +1,56 @@
+ParseReadLine (21): 'UT_VAR=		<${REF}>'
+Global:UT_VAR = <${REF}>
+ParseReadLine (28): '.export UT_VAR'
+Global:.MAKE.EXPORTED = UT_VAR
+ParseReadLine (32): ': ${UT_VAR:N*}'
+Var_Parse: ${UT_VAR:N*} with VARE_UNDEFERR|VARE_WANTRES
+Var_Parse: ${REF}> with VARE_UNDEFERR|VARE_WANTRES
+Applying ${UT_VAR:N...} to "<>" (VARE_UNDEFERR|VARE_WANTRES, VAR_EXPORTED|VAR_REEXPORT, none)
+Pattern[UT_VAR] for [<>] is [*]
+ModifyWords: split "<>" into 1 words
+Result of ${UT_VAR:N*} is "" (VARE_UNDEFERR|VARE_WANTRES, VAR_EXPORTED|VAR_REEXPORT, none)
+ParseDoDependency(: )
+CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>"
+Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" with VARE_UNDEFERR|VARE_WANTRES
+Applying ${:!...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
+Modifier part: "echo "$UT_VAR""
+Var_Parse: ${.MAKE.EXPORTED:O:u} with VARE_WANTRES
+Applying ${.MAKE.EXPORTED:O} to "UT_VAR" (VARE_WANTRES, none, none)
+Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (VARE_WANTRES, none, none)
+Applying ${.MAKE.EXPORTED:u} to "UT_VAR" (VARE_WANTRES, none, none)
+Result of ${.MAKE.EXPORTED:u} is "UT_VAR" (VARE_WANTRES, none, none)
+Var_Parse: ${UT_VAR} with VARE_WANTRES
+Var_Parse: ${REF}> with VARE_WANTRES
+Result of ${:!echo "\$UT_VAR"!} is "<>" 

CVS commit: src/sys/dev/i2c

2020-12-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Dec 29 00:26:51 UTC 2020

Modified Files:
src/sys/dev/i2c: i2cvar.h

Log Message:
- Use __BIT() macro to define I2C_F_* bits.
- Define an I2C_F_SPEED bitfield that can be used to specify an
  I2C bus speed:

  -> Standard Mode (100Kb/s)
  -> Fast Mode (400Kb/s)
  -> Fast Mode Plus (1Mb/s)
  -> High Speed (3.4Mb/s)

The speed values are treated as advisory; if a controller does not support
the requested speed mode, fallback to a lower one is allowed.

(Currently, all controllers simply use Standard Mode.)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/i2c/i2cvar.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/i2c/i2cvar.h
diff -u src/sys/dev/i2c/i2cvar.h:1.20 src/sys/dev/i2c/i2cvar.h:1.21
--- src/sys/dev/i2c/i2cvar.h:1.20	Tue Jul  7 16:14:23 2020
+++ src/sys/dev/i2c/i2cvar.h	Tue Dec 29 00:26:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cvar.h,v 1.20 2020/07/07 16:14:23 thorpej Exp $	*/
+/*	$NetBSD: i2cvar.h,v 1.21 2020/12/29 00:26:51 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -44,12 +44,18 @@
 #include 
 
 /* Flags passed to i2c routines. */
-#define	I2C_F_WRITE		0x00	/* new transfer is a write */
-#define	I2C_F_READ		0x01	/* new transfer is a read */
-#define	I2C_F_LAST		0x02	/* last byte of read */
-#define	I2C_F_STOP		0x04	/* send stop after byte */
-#define	I2C_F_POLL		0x08	/* poll, don't sleep */
-#define	I2C_F_PEC		0x10	/* smbus packet error checking */
+#define	I2C_F_WRITE	0		/* new transfer is a write */
+#define	I2C_F_READ	__BIT(0)	/* new transfer is a read */
+#define	I2C_F_LAST	__BIT(1)	/* last byte of read */
+#define	I2C_F_STOP	__BIT(2)	/* send stop after byte */
+#define	I2C_F_POLL	__BIT(3)	/* poll, don't sleep */
+#define	I2C_F_PEC	__BIT(4)	/* smbus packet error checking */
+#define	I2C_F_SPEED	__BITS(28,31)	/* I2C transfer speed selector */
+
+#define	I2C_SPEED_SM		0	/* standard mode (100Kb/s) */
+#define	I2C_SPEED_FM		1	/* fast mode (400Kb/s) */
+#define	I2C_SPEED_FMPLUS	2	/* fast mode+ (1Mb/s) */
+#define	I2C_SPEED_HS		3	/* high speed (3.4Mb/s) */
 
 /* i2c bus instance properties */
 #define	I2C_PROP_INDIRECT_PROBE_STRATEGY	\



CVS commit: src/sys/miscfs/procfs

2020-12-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Dec 28 22:36:16 UTC 2020

Modified Files:
src/sys/miscfs/procfs: procfs_vfsops.c

Log Message:
Fix procfs environ node.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/miscfs/procfs/procfs_vfsops.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/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.109 src/sys/miscfs/procfs/procfs_vfsops.c:1.110
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.109	Sat May 23 23:42:43 2020
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Mon Dec 28 22:36:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.109 2020/05/23 23:42:43 ad Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.110 2020/12/28 22:36:16 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.109 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.110 2020/12/28 22:36:16 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -387,6 +387,7 @@ procfs_loadvnode(struct mount *mp, struc
 	case PFSmap:		/* /proc/N/map = -r */
 	case PFSmaps:		/* /proc/N/maps = -r */
 	case PFSauxv:		/* /proc/N/auxv = -r */
+	case PFSenviron:	/* /proc/N/environ = -r */
 		pfs->pfs_mode = S_IRUSR;
 		vp->v_type = VREG;
 		break;
@@ -394,7 +395,6 @@ procfs_loadvnode(struct mount *mp, struc
 	case PFSstatus:		/* /proc/N/status = -r--r--r-- */
 	case PFSstat:		/* /proc/N/stat = -r--r--r-- */
 	case PFScmdline:	/* /proc/N/cmdline = -r--r--r-- */
-	case PFSenviron:	/* /proc/N/environ = -r--r--r-- */
 	case PFSemul:		/* /proc/N/emul = -r--r--r-- */
 	case PFSmeminfo:	/* /proc/meminfo = -r--r--r-- */
 	case PFScpustat:	/* /proc/stat = -r--r--r-- */



CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 22:31:32 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h init.c

Log Message:
lint: rename confusing function setcompl

The previous function name suggested that it would set the complete flag
of the type, but it was the exact opposite.  To reduce confusion, negate
the meaning of the parameter.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/lint1/init.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.73 src/usr.bin/xlint/lint1/decl.c:1.74
--- src/usr.bin/xlint/lint1/decl.c:1.73	Mon Dec 28 21:24:55 2020
+++ src/usr.bin/xlint/lint1/decl.c	Mon Dec 28 22:31:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.73 2020/12/28 21:24:55 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.74 2020/12/28 22:31:31 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.73 2020/12/28 21:24:55 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.74 2020/12/28 22:31:31 rillig Exp $");
 #endif
 
 #include 
@@ -189,22 +189,21 @@ incompl(type_t *tp)
 }
 
 /*
- * Set the flag for (in)complete array, struct, union or enum
- * types.
+ * Mark an array, struct, union or enum type as complete or incomplete.
  */
 void
-setcompl(type_t *tp, int ic)
+setcomplete(type_t *tp, int complete)
 {
 	tspec_t	t;
 
 	if ((t = tp->t_tspec) == ARRAY) {
-		tp->t_aincompl = ic;
+		tp->t_aincompl = !complete;
 	} else if (t == STRUCT || t == UNION) {
-		tp->t_str->sincompl = ic;
+		tp->t_str->sincompl = !complete;
 	} else {
 		if (t != ENUM)
-			LERROR("setcompl()");
-		tp->t_enum->eincompl = ic;
+			LERROR("setcomplete()");
+		tp->t_enum->eincompl = !complete;
 	}
 }
 
@@ -1357,8 +1356,7 @@ addarray(sym_t *decl, int dim, int n)
 		/* zero array dimension */
 		c99ism(322, dim);
 	} else if (n == 0 && !dim) {
-		/* is incomplete type */
-		setcompl(tp, 1);
+		setcomplete(tp, 0);
 	}
 
 	return (decl);
@@ -1687,8 +1685,7 @@ mktag(sym_t *tag, tspec_t kind, int decl
 			tp->t_enum = getblk(sizeof(*tp->t_enum));
 			tp->t_enum->etag = tag;
 		}
-		/* ist unvollstaendiger Typ */
-		setcompl(tp, 1);
+		setcomplete(tp, 0);
 	}
 	return (tp);
 }
@@ -1781,8 +1778,7 @@ compltag(type_t *tp, sym_t *fmem)
 	int	n;
 	sym_t	*mem;
 
-	/* from now on the type is complete */
-	setcompl(tp, 0);
+	setcomplete(tp, 1);
 
 	if ((t = tp->t_tspec) != ENUM) {
 		align(dcs->d_stralign, 0);
@@ -2312,8 +2308,7 @@ compltyp(sym_t *dsym, sym_t *ssym)
 			if (dst->t_dim == 0 && src->t_dim != 0) {
 *dstp = dst = duptyp(dst);
 dst->t_dim = src->t_dim;
-/* now a complete Typ */
-setcompl(dst, 0);
+setcomplete(dst, 1);
 			}
 		} else if (dst->t_tspec == FUNC) {
 			if (!dst->t_proto && src->t_proto) {

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.35 src/usr.bin/xlint/lint1/externs1.h:1.36
--- src/usr.bin/xlint/lint1/externs1.h:1.35	Mon Mar  6 21:01:39 2017
+++ src/usr.bin/xlint/lint1/externs1.h	Mon Dec 28 22:31:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.35 2017/03/06 21:01:39 christos Exp $	*/
+/*	$NetBSD: externs1.h,v 1.36 2020/12/28 22:31:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -140,7 +140,7 @@ extern	type_t	*gettyp(tspec_t);
 extern	type_t	*duptyp(const type_t *);
 extern	type_t	*tduptyp(const type_t *);
 extern	int	incompl(type_t *);
-extern	void	setcompl(type_t *, int);
+extern	void	setcomplete(type_t *, int);
 extern	void	addscl(scl_t);
 extern	void	addtype(type_t *);
 extern	void	addqual(tqual_t);

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.31 src/usr.bin/xlint/lint1/init.c:1.32
--- src/usr.bin/xlint/lint1/init.c:1.31	Mon Dec 28 19:07:43 2020
+++ src/usr.bin/xlint/lint1/init.c	Mon Dec 28 22:31:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.31 2020/12/28 19:07:43 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.32 2020/12/28 22:31:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.31 2020/12/28 19:07:43 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.32 2020/12/28 22:31:31 rillig Exp $");
 #endif
 
 #include 
@@ -275,8 +275,7 @@ pushinit(void)
 		if (istk->i_type->t_tspec != ARRAY)
 			LERROR("pushinit()");
 		istk->i_type->t_dim++;
-		/* from now its an complete type */
-		setcompl(istk->i_type, 0);
+		setcomplete(istk->i_type, 1);
 	}
 
 	if (istk->i_cnt <= 0)
@@ -671,8 +670,7 @@ strginit(tnode_t *tn)
 	if (istk->i_nolimit) {
 		istk->i_nolimit = 0;
 		istk->i_type->t_dim = len + 1;
-		/* from now complete type */
-	

CVS commit: src/usr.bin/xlint/common

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 22:16:42 UTC 2020

Modified Files:
src/usr.bin/xlint/common: mem.c

Log Message:
lint: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/xlint/common/mem.c

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

Modified files:

Index: src/usr.bin/xlint/common/mem.c
diff -u src/usr.bin/xlint/common/mem.c:1.9 src/usr.bin/xlint/common/mem.c:1.10
--- src/usr.bin/xlint/common/mem.c:1.9	Mon Dec 28 21:24:55 2020
+++ src/usr.bin/xlint/common/mem.c	Mon Dec 28 22:16:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $	*/
+/*	$NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $");
+__RCSID("$NetBSD: mem.c,v 1.10 2020/12/28 22:16:42 rillig Exp $");
 #endif
 
 #include 
@@ -137,4 +137,3 @@ xmapalloc(size_t len)
 		err(1, "Cannot map memory for %lu bytes", (unsigned long)len);
 	return p;
 }
- 
\ No newline at end of file



CVS commit: src/usr.bin/xlint

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 21:24:55 UTC 2020

Modified Files:
src/usr.bin/xlint/common: emit.c lint.h mem.c param.h
src/usr.bin/xlint/lint1: cgram.y decl.c emit1.c err.c func.c

Log Message:
lint: spell check


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/common/emit.c
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/common/mem.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/common/param.h
cvs rdiff -u -r1.109 -r1.110 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/func.c

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

Modified files:

Index: src/usr.bin/xlint/common/emit.c
diff -u src/usr.bin/xlint/common/emit.c:1.6 src/usr.bin/xlint/common/emit.c:1.7
--- src/usr.bin/xlint/common/emit.c:1.6	Thu Apr 17 18:52:03 2014
+++ src/usr.bin/xlint/common/emit.c	Mon Dec 28 21:24:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $	*/
+/*	$NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $");
+__RCSID("$NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $");
 #endif
 
 #include 
@@ -184,7 +184,7 @@ outqchar(int c)
 }
 
 /*
- * write a strint to the output buffer
+ * write a string to the output buffer
  * the string must not contain any characters which
  * should be quoted
  */
@@ -200,7 +200,7 @@ outstrg(const char *s)
 }
 
 /*
- * write an integer value to toe output buffer
+ * write an integer value to the output buffer
  */
 void
 outint(int i)

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.16 src/usr.bin/xlint/common/lint.h:1.17
--- src/usr.bin/xlint/common/lint.h:1.16	Mon Dec 28 18:49:02 2020
+++ src/usr.bin/xlint/common/lint.h	Mon Dec 28 21:24:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.16 2020/12/28 18:49:02 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.17 2020/12/28 21:24:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -46,7 +46,7 @@
 #include "param.h"
 
 /*
- * Type specifiers, used in type structures (type_t) and otherwere.
+ * Type specifiers, used in type structures (type_t) and elsewhere.
  */
 typedef enum {
 	NOTSPEC = 0,

Index: src/usr.bin/xlint/common/mem.c
diff -u src/usr.bin/xlint/common/mem.c:1.8 src/usr.bin/xlint/common/mem.c:1.9
--- src/usr.bin/xlint/common/mem.c:1.8	Mon Feb 10 04:54:01 2020
+++ src/usr.bin/xlint/common/mem.c	Mon Dec 28 21:24:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.8 2020/02/10 04:54:01 christos Exp $	*/
+/*	$NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem.c,v 1.8 2020/02/10 04:54:01 christos Exp $");
+__RCSID("$NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $");
 #endif
 
 #include 
@@ -137,3 +137,4 @@ xmapalloc(size_t len)
 		err(1, "Cannot map memory for %lu bytes", (unsigned long)len);
 	return p;
 }
+ 
\ No newline at end of file

Index: src/usr.bin/xlint/common/param.h
diff -u src/usr.bin/xlint/common/param.h:1.5 src/usr.bin/xlint/common/param.h:1.6
--- src/usr.bin/xlint/common/param.h:1.5	Sun Sep 21 17:06:40 2003
+++ src/usr.bin/xlint/common/param.h	Mon Dec 28 21:24:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.5 2003/09/21 17:06:40 martin Exp $	*/
+/*	$NetBSD: param.h,v 1.6 2020/12/28 21:24:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,14 +38,14 @@
 #define	STRBLEN		256
 
 /*
- * This defines the size of memory blocks which are used to allocate
- * memory in larger chunks.
+ * The size of memory blocks which are used to allocate memory in larger
+ * chunks.
  */
 #define	MBLKSIZ		((size_t)0x4000)
 
 /*
  * Sizes of hash tables
- * Should be a prime. Possible primes are
+ * Should be primes. Possible primes are
  * 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511.
  *
  * HSHSIZ1	symbol table 1st pass
@@ -67,7 +67,7 @@
 #define WCHAR	INT
 
 /*
- * And the sparc64 long double code generation is broken in old gcc.
+ * The sparc64 long double code generation is broken in old gcc.
  */
 #if !defined(__sparc64__) || !defined(__GNUC__) || __GNUC__ > 2
 typedef	long double ldbl_t;

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.109 src/usr.bin/xlint/lint1/cgram.y:1.110
--- src/usr.bin/xlint/lint1/cgram.y:1.109	Mon Dec 28 19:47:42 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Dec 28 21:24:55 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.109 2020/12/28 

CVS commit: src/sys/dev

2020-12-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 28 20:29:57 UTC 2020

Modified Files:
src/sys/dev/fdt: files.fdt i2cmux_fdt.c
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: i2cmux.c i2cmuxvar.h

Log Message:
Re-factor the "iicmux" driver to support other types of muxes that are
themselves i2c devices.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/i2cmux_fdt.c
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/i2cmux.c src/sys/dev/i2c/i2cmuxvar.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/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.58 src/sys/dev/fdt/files.fdt:1.59
--- src/sys/dev/fdt/files.fdt:1.58	Wed Dec 23 04:09:32 2020
+++ src/sys/dev/fdt/files.fdt	Mon Dec 28 20:29:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.58 2020/12/23 04:09:32 thorpej Exp $
+# $NetBSD: files.fdt,v 1.59 2020/12/28 20:29:57 thorpej Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -54,7 +54,7 @@ device	dispcon: fdt_port, drmkms, ddc_re
 attach	dispcon at fdt with dispcon_hdmi
 file	dev/fdt/hdmi_connector.c		dispcon_hdmi
 
-device	iicmux: i2cbus
+device	iicmux: i2cbus, i2cmux
 attach	iicmux at fdt with iicmux_fdt
 file	dev/fdt/i2cmux_fdt.c			iicmux_fdt
 

Index: src/sys/dev/fdt/i2cmux_fdt.c
diff -u src/sys/dev/fdt/i2cmux_fdt.c:1.3 src/sys/dev/fdt/i2cmux_fdt.c:1.4
--- src/sys/dev/fdt/i2cmux_fdt.c:1.3	Mon Dec 28 15:08:06 2020
+++ src/sys/dev/fdt/i2cmux_fdt.c	Mon Dec 28 20:29:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cmux_fdt.c,v 1.3 2020/12/28 15:08:06 thorpej Exp $	*/
+/*	$NetBSD: i2cmux_fdt.c,v 1.4 2020/12/28 20:29:57 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.3 2020/12/28 15:08:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.4 2020/12/28 20:29:57 thorpej Exp $");
 
 #include 
 #include 
@@ -40,188 +40,101 @@ __KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c
 #include 
 
 #include 
-#include 
+#include 
 
-/*
- * i2c mux
- *
- * This works by interposing a virtual controller in front of the
- * real i2c controller.  We provide our own acquire release functions
- * that perform the following tasks:
- *
- *	acquire -> acquire parent controller, program mux
- *
- *	release -> idle mux, release parent controller
- *
- * All of the actual I/O operations are transparently passed through.
- *
- * N.B. the locking order; the generic I2C layer has already acquired
- * our virtual controller's mutex before calling our acquire function,
- * and we will then acquire the real controller's mutex when we acquire
- * the bus, so the order is:
- *
- *	mux virtual controller -> parent controller
- */
-
-struct iicmux_softc;
-struct iicmux_bus;
-
-struct iicmux_config {
-	const char *desc;
-	int	(*get_mux_info)(struct iicmux_softc *);
-	int	(*get_bus_info)(struct iicmux_bus *);
-	int	(*acquire_bus)(struct iicmux_bus *, int);
-	void	(*release_bus)(struct iicmux_bus *, int);
-};
+/*/
 
-struct iicmux_bus {
-	struct i2c_controller controller;
-	struct iicmux_softc *mux;
-	int phandle;
-	int busidx;
-
-	union {
-		struct {
-			bus_addr_t value;
-		} gpio;
-
-		struct {
-			bus_addr_t idx;
-		} pinctrl;
-	};
+struct mux_info_gpio {
+	struct fdtbus_gpio_pin **pins;
+	int npins;
+	uint32_t idle_value;
+	bool has_idle_value;
 };
 
-struct iicmux_softc {
-	device_t			sc_dev;
-	intsc_phandle;
-	intsc_i2c_mux_phandle;
-	const struct iicmux_config *	sc_config;
-	i2c_tag_t			sc_i2c_parent;
-	struct iicmux_bus *		sc_busses;
-	intsc_nbusses;
-
-	union {
-		struct {
-			struct fdtbus_gpio_pin **pins;
-			int npins;
-			uint32_t idle_value;
-			bool has_idle_value;
-		} sc_gpio;
-
-		struct {
-			u_int idle_idx;
-			bool has_idle_idx;
-		} sc_pinctrl;
-	};
+struct bus_info_gpio {
+	bus_addr_t value;
 };
 
-/*/
-
-static int
-iicmux_acquire_bus(void * const v, int const flags)
-{
-	struct iicmux_bus * const bus = v;
-	struct iicmux_softc * const sc = bus->mux;
-	int error;
-
-	error = iic_acquire_bus(sc->sc_i2c_parent, flags);
-	if (error) {
-		return error;
-	}
-
-	error = sc->sc_config->acquire_bus(bus, flags);
-	if (error) {
-		iic_release_bus(sc->sc_i2c_parent, flags);
-	}
-
-	return error;
-}
-
-static void
-iicmux_release_bus(void * const v, int const flags)
-{
-	struct iicmux_bus * const bus = v;
-	struct iicmux_softc * const sc = bus->mux;
-
-	sc->sc_config->release_bus(bus, flags);
-	iic_release_bus(sc->sc_i2c_parent, flags);
-}
-
-static int
-iicmux_exec(void * const v, i2c_op_t const op, i2c_addr_t const addr,
-const void * const cmdbuf, size_t const cmdlen, void * const 

CVS commit: [netbsd-9] src/doc

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:24:05 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
Tickets #1161-#1163, #1165, #1166


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/doc/CHANGES-9.2

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

Modified files:

Index: src/doc/CHANGES-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.28 src/doc/CHANGES-9.2:1.1.2.29
--- src/doc/CHANGES-9.2:1.1.2.28	Mon Dec 28 16:00:51 2020
+++ src/doc/CHANGES-9.2	Mon Dec 28 20:24:05 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.28 2020/12/28 16:00:51 snj Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.29 2020/12/28 20:24:05 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1302,3 +1302,34 @@ etc/rc.d/ntpdate1.21
 	Adjust to "pool" usage in our standard ntp.conf.
 	[martin, ticket #1164]
 
+sys/arch/hp300/dev/dnkbd.c			1.11
+sys/arch/hp300/dev/hil_intio.c			1.4
+
+	Fix a longstanding bug in hilkbd (and dnkbd) console attachment
+	to make ddb(4) and kernel prompts for root device work.
+	[tsutsui, ticket #1161]
+
+sys/arch/hp300/dev/sti_sgc.c			1.4
+sys/dev/ic/sti.c1.23-1.25
+sys/dev/ic/stivar.h1.11
+
+	sti(4): add bitmap access ops support for SGC CRX (A1659-66001)
+	framebuffer and improve 425e EVRX support.
+	[tsutsui, ticket #1162]
+
+distrib/notes/hp300/hardware			1.21-1.24
+
+	Update supported hardware list for HP332, hp425e built-in EVRX
+	and A1659A CRX framebuffer. Minor fixes.
+	[tsutsui, ticket #1163]
+
+sys/dev/hdaudio/hdaudio.c			1.12
+
+	PR 51734: initialize DMA memory when allocating it.
+	[jmcneill, ticket #1165]
+
+sys/dev/hdaudio/hdaudio.c			1.13
+
+	Fix crash if a codec reports 0 nodes.
+	[jmcneill, ticket #1166]
+



CVS commit: [netbsd-9] src/sys/dev/hdaudio

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:21:55 UTC 2020

Modified Files:
src/sys/dev/hdaudio [netbsd-9]: hdaudio.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1166):

sys/dev/hdaudio/hdaudio.c: revision 1.13

If the Subordinate Node Count returns 0 nodes, complain and return instead
of trying to kmem_zalloc 0 bytes later on.


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.1 -r1.9.2.2 src/sys/dev/hdaudio/hdaudio.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/hdaudio/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.9.2.1 src/sys/dev/hdaudio/hdaudio.c:1.9.2.2
--- src/sys/dev/hdaudio/hdaudio.c:1.9.2.1	Mon Dec 28 20:18:09 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 20:21:54 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.9.2.1 2020/12/28 20:18:09 martin Exp $ */
+/* $NetBSD: hdaudio.c,v 1.9.2.2 2020/12/28 20:21:54 martin Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9.2.1 2020/12/28 20:18:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9.2.2 2020/12/28 20:21:54 martin Exp $");
 
 #include 
 #include 
@@ -713,6 +713,7 @@ hdaudio_attach_fg(struct hdaudio_functio
 static void
 hdaudio_codec_attach(struct hdaudio_codec *co)
 {
+	struct hdaudio_softc *sc = co->co_host;
 	struct hdaudio_function_group *fg;
 	uint32_t vid, snc, fgrp;
 	int starting_node, num_nodes, nid;
@@ -729,7 +730,6 @@ hdaudio_codec_attach(struct hdaudio_code
 		return;
 
 #ifdef HDAUDIO_DEBUG
-	struct hdaudio_softc *sc = co->co_host;
 	uint32_t rid = hdaudio_command(co, 0, CORB_GET_PARAMETER,
 	COP_REVISION_ID);
 	hda_print(sc, "Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n",
@@ -740,6 +740,16 @@ hdaudio_codec_attach(struct hdaudio_code
 	starting_node = (snc >> 16) & 0xff;
 	num_nodes = snc & 0xff;
 
+	/*
+	 * If the total number of nodes is 0, there's nothing we can do.
+	 * This shouldn't happen, so complain about it.
+	 */
+	if (num_nodes == 0) {
+		hda_error(sc, "Codec%02X: No subordinate nodes found (%08x)\n",
+		co->co_addr, snc);
+		return;
+	}
+
 	co->co_nfg = num_nodes;
 	co->co_fg = kmem_zalloc(co->co_nfg * sizeof(*co->co_fg), KM_SLEEP);
 



CVS commit: src/sys/netinet6

2020-12-28 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Dec 28 20:19:50 UTC 2020

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

Log Message:
Add more guards against NULL deref, since KUBSAN still complains.


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.275 src/sys/netinet6/nd6.c:1.276
--- src/sys/netinet6/nd6.c:1.275	Sat Dec 26 10:43:39 2020
+++ src/sys/netinet6/nd6.c	Mon Dec 28 20:19:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.275 2020/12/26 10:43:39 nia Exp $	*/
+/*	$NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.275 2020/12/26 10:43:39 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -384,8 +384,10 @@ nd6_llinfo_output(struct ifnet *ifp, con
 const union l3addr *hsrc)
 {
 
-	nd6_ns_output(ifp, daddr != NULL ? >addr6 : NULL,
-	>addr6, >addr6, NULL);
+	nd6_ns_output(ifp,
+	daddr != NULL ? >addr6 : NULL,
+	taddr != NULL ? >addr6 : NULL,
+	hsrc != NULL ? >addr6 : NULL, NULL);
 }
 
 static bool



CVS commit: [netbsd-9] src/sys/dev/hdaudio

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:18:09 UTC 2020

Modified Files:
src/sys/dev/hdaudio [netbsd-9]: hdaudio.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1165):

sys/dev/hdaudio/hdaudio.c: revision 1.12

Initialize DMA memory when allocating it. Should fix PR# 51734 (hdaudio
"RIRB timeout" on boot).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/dev/hdaudio/hdaudio.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/hdaudio/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.9 src/sys/dev/hdaudio/hdaudio.c:1.9.2.1
--- src/sys/dev/hdaudio/hdaudio.c:1.9	Fri Jul 26 11:13:46 2019
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 20:18:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.9.2.1 2020/12/28 20:18:09 martin Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9.2.1 2020/12/28 20:18:09 martin Exp $");
 
 #include 
 #include 
@@ -194,6 +194,10 @@ hdaudio_dma_alloc(struct hdaudio_softc *
 	if (err)
 		goto destroy;
 
+	memset(dma->dma_addr, 0, dma->dma_size);
+	bus_dmamap_sync(sc->sc_dmat, dma->dma_map, 0, dma->dma_size,
+	BUS_DMASYNC_PREWRITE);
+
 	dma->dma_valid = true;
 	return 0;
 



CVS commit: [netbsd-9] src/distrib/notes/hp300

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:15:16 UTC 2020

Modified Files:
src/distrib/notes/hp300 [netbsd-9]: hardware

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1163):

distrib/notes/hp300/hardware: revision 1.21
distrib/notes/hp300/hardware: revision 1.22
distrib/notes/hp300/hardware: revision 1.23
distrib/notes/hp300/hardware: revision 1.24

Fix typo.

Move HP332 to "Supported hardware" list, as reported by Chris Hanson.

Now Xserver works on hp425e built-in EVRX framebuffer.

Add A1659A CRX framebuffer to "Supported hardware" list.

Also remove SGC support from "Unsupported hardware" list.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.14.1 src/distrib/notes/hp300/hardware

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

Modified files:

Index: src/distrib/notes/hp300/hardware
diff -u src/distrib/notes/hp300/hardware:1.20 src/distrib/notes/hp300/hardware:1.20.14.1
--- src/distrib/notes/hp300/hardware:1.20	Sat Mar 25 23:33:11 2017
+++ src/distrib/notes/hp300/hardware	Mon Dec 28 20:15:16 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: hardware,v 1.20 2017/03/25 23:33:11 tsutsui Exp $
+.\"	$NetBSD: hardware,v 1.20.14.1 2020/12/28 20:15:16 martin Exp $
 .
 .Nx*M
 \*V will run on most HP 9000/300- and 400-series machines.
@@ -21,6 +21,8 @@ CPUs
 .br
 .Em "Requires Human Interface board"
 .It
+332 (16 MHz 68030, optional 68882, up to 8 MB RAM)
+.It
 340 (16 MHz 68030, up to 16 MB RAM)
 .It
 345 (50 MHz 68030 with 32 KB L2 cache, up to 128 MB RAM, built-in SCSI)
@@ -63,7 +65,7 @@ up to 128 MB RAM)
 .Ql SERVICE/NORMAL
 .Em "switch on the back panel is turned to"
 .Ql SERVICE
-.Em "potision."
+.Em "position."
 .It
 433s, 433t, 433dl (33 MHz 68040 with built-in SCSI, up to 128 MB RAM)
 .bullet)
@@ -175,6 +177,8 @@ A1096A monochrome Hyperion (1280x1024, 1
 .It
 A1416A Kathmandu (a.k.a. Color VRX) (1280x1024 @ 60 hz, 8 bits, DIO-II)
 .It
+A1659A CRX (1280x1024 @ 72 hz, 8 bits, SGC)
+.It
 98705 Tigershark PersonalVRX DIO-II graphics device
 .br
 .Em "Untested"
@@ -184,8 +188,6 @@ internal video on models 362/382 (A1474-
 .Em "No X server support"
 .It
 425e built-in EVRX framebuffer
-.br
-.Em "No X server support"
 .bullet)
 .It
 HP-HIL devices
@@ -245,14 +247,10 @@ CPUs
 .(bullet -compact
 310 (10 MHz 68010, with built-in monochrome framebuffer, rs232
 (25 pin), hil, and slow hpib)
-.It
-332 (16? MHz 68030, with no floating point unit)
 .bullet)
 .It
 Graphics Devices
 .(bullet -compact
-SGC support for some rare configurations of 4XXt and 4XXdl workstations
-.It
 98702 TurboVRX DIO-II graphics device
 .bullet)
 .It



CVS commit: [netbsd-9] src/sys

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:10:04 UTC 2020

Modified Files:
src/sys/arch/hp300/dev [netbsd-9]: sti_sgc.c
src/sys/dev/ic [netbsd-9]: sti.c stivar.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1162):

sys/dev/ic/stivar.h: revision 1.11
sys/dev/ic/sti.c: revision 1.23
sys/dev/ic/sti.c: revision 1.24
sys/dev/ic/sti.c: revision 1.25
sys/arch/hp300/dev/sti_sgc.c: revision 1.4

Pull the latest OpenBSD sti(4) changes for bitmap framebuffer support.
- bitmap and colormap ops based on old HP ngle X11 driver:
  http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/ic/sti.c#rev1.76
  > Work-in-progress support for non-accelerated X11 on *some* sti(4)
  > frame buffers; based upon the old HP ngle X11 driver.
  > Currently limited to CRX (720/735/750), Timber (710, old 715),
  > Artist (712, 715) and EG (B-series), however the
  > colormap isn't set up correctly on Timber and EG yet.
  >
  > Joint work with Artem Falcon, now in good enough shape to be worked further
  > in the tree.
- misc other cosmetic changes to reduce diffs
No particular comments on port-hp300@ and port-hppa@:
 https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
 https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

The MD hp300 attachment for SGC CRX (A1659-66001) will be committed
separately.

Add bitmap access ops support for SGC CRX (A1659-66001) framebuffer.
Also modify existing 425e EVRX attachment to use updated MI sti(4) ops
more efficiently.

The Xorg server and mlterm-wscons (that support wsdisplay bitmap) work
fine on SGC hp425t.

No particular comments on port-hp300@ and port-hppa@:
 https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
 https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

Special thanks to Miod Vallat again, for contributing the SGC CRX
framebuffer with the SGC connector and flexible cable for HP9000/425t.

He also contributed DIO-II "Hyperion" monochrome framebuffer and
1 plane grayscale SGC GRX (A1924-66001), and I've confirmed hyper(4)
just works even with Xorg server.  I will try GRX as the next project.

Handle WSSCREEN_REVERSE properly.  Based on OpenBSD's sti(4).

Also remove WSSCREEN_UNDERLINE from capabilities that is not handled
by sti(4) ROM routines.

Tested on HP9000/425t with CRX.

Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EMUL, i.e. text mode.

The hardware palette settings are handled by the STI ROM in STI_TEXTMODE
and changing cmap could cause mangled text colors at least on CRX on 425t.

Updating CMAP in EMUL mode isn't expected anyway.

Fixes "red or invisible text" after exiting mlterm-wscons on A1659 CRX.


To generate a diff of this commit:
cvs rdiff -u -r1.2.34.1 -r1.2.34.2 src/sys/arch/hp300/dev/sti_sgc.c
cvs rdiff -u -r1.19.12.1 -r1.19.12.2 src/sys/dev/ic/sti.c
cvs rdiff -u -r1.9.34.1 -r1.9.34.2 src/sys/dev/ic/stivar.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/hp300/dev/sti_sgc.c
diff -u src/sys/arch/hp300/dev/sti_sgc.c:1.2.34.1 src/sys/arch/hp300/dev/sti_sgc.c:1.2.34.2
--- src/sys/arch/hp300/dev/sti_sgc.c:1.2.34.1	Mon May 18 17:52:22 2020
+++ src/sys/arch/hp300/dev/sti_sgc.c	Mon Dec 28 20:10:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sti_sgc.c,v 1.2.34.1 2020/05/18 17:52:22 martin Exp $	*/
+/*	$NetBSD: sti_sgc.c,v 1.2.34.2 2020/12/28 20:10:04 martin Exp $	*/
 /*	$OpenBSD: sti_sgc.c,v 1.14 2007/05/26 00:36:03 krw Exp $	*/
 
 /*
@@ -27,7 +27,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.2.34.1 2020/05/18 17:52:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.2.34.2 2020/12/28 20:10:04 martin Exp $");
 
 #include 
 #include 
@@ -49,33 +49,40 @@ struct sti_sgc_softc {
 	struct sti_softc sc_sti;
 
 	paddr_t sc_bitmap;
-	bus_space_tag_t sc_bst;
-	bus_space_handle_t sc_ramdach;
 };
 
 /*
  * 425e EVRX specific hardware
  */
-#define STI_EVRX_RAMDACOFFSET	0x06
-#define STI_EVRX_RAMDACSIZE	0x000800
+/*
+ * EVRX RAMDAC (Bt458) is found at offset 0x06 from SGC bus PA and 
+ * offset 0x04 length 0x1c is mapped in MI sti via ROM region 2
+ */
+#define STI_EVRX_REGNO2OFFSET	0x02
 #define STI_EVRX_FBOFFSET	0x20
 
-#define EVRX_BT458_ADDR		(0x200 + 2)
-#define EVRX_BT458_CMAP		(0x204 + 2)
-#define EVRX_BT458_CTRL		(0x208 + 2)
-#define EVRX_BT458_OMAP		(0x20C + 2)
+#define EVRX_BT458_ADDR		(STI_EVRX_REGNO2OFFSET + 0x200 + 2)
+#define EVRX_BT458_CMAP		(STI_EVRX_REGNO2OFFSET + 0x204 + 2)
+#define EVRX_BT458_CTRL		(STI_EVRX_REGNO2OFFSET + 0x208 + 2)
+#define EVRX_BT458_OMAP		(STI_EVRX_REGNO2OFFSET + 0x20C + 2)
 
 /* from HP-UX /usr/lib/libddevrx.a */
-#define EVRX_MAGIC00		0x600
-#define EVRX_MAGIC04		0x604
-#define EVRX_MAGIC08		0x608
-#define EVRX_MAGIC0C		0x60c
-#define EVRX_MAGIC10		0x610
+#define EVRX_MAGIC00		(STI_EVRX_REGNO2OFFSET + 0x600)
+#define 

CVS commit: [netbsd-9] src/sys/arch/hp300/dev

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 20:02:30 UTC 2020

Modified Files:
src/sys/arch/hp300/dev [netbsd-9]: dnkbd.c hil_intio.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1161):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.18.1 src/sys/arch/hp300/dev/dnkbd.c
cvs rdiff -u -r1.3 -r1.3.64.1 src/sys/arch/hp300/dev/hil_intio.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/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.10 src/sys/arch/hp300/dev/dnkbd.c:1.10.18.1
--- src/sys/arch/hp300/dev/dnkbd.c:1.10	Sat Apr  8 17:04:56 2017
+++ src/sys/arch/hp300/dev/dnkbd.c	Mon Dec 28 20:02:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.10 2017/04/08 17:04:56 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.10.18.1 2020/12/28 20:02:30 martin Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -69,6 +69,9 @@
 
 #include "opt_wsdisplay_compat.h"
 
+#include "wsdisplay.h"
+#include "wsmouse.h"
+
 #include 
 #include 
 #include 
@@ -87,7 +90,9 @@
 #include 
 #include 
 #include 
-#include "wsmouse.h"
+#if NWSDISPLAY > 0
+#include 
+#endif
 #if NWSMOUSE > 0
 #include 
 #endif
@@ -354,7 +359,8 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 	 * plugged), unless the console keyboard has been claimed already
 	 * (i.e. late hotplug with hil keyboard plugged first).
 	 */
-	if (major(cn_tab->cn_dev) == devsw_name2chr("wsdisplay", NULL, 0)) {
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc == wsdisplay_cnputc) {
 #if NHILKBD > 0
 		if (hil_is_console == -1) {
 			ka.console = 1;
@@ -365,7 +371,10 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 		ka.console = 1;
 #endif
 	} else
+#endif
+	{
 		ka.console = 0;
+	}
 
 	ka.keymap = _keymapdata;
 	ka.accessops = _accessops;

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.3 src/sys/arch/hp300/dev/hil_intio.c:1.3.64.1
--- src/sys/arch/hp300/dev/hil_intio.c:1.3	Sat Feb 19 05:36:49 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Mon Dec 28 20:02:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.3.64.1 2020/12/28 20:02:30 martin Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -28,6 +28,8 @@
  *
  */
 
+#include "wsdisplay.h"
+
 #include 
 #include 
 #include 
@@ -38,6 +40,9 @@
 #include 
 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#endif
 
 #include 
 
@@ -88,8 +93,12 @@ hil_intio_attach(device_t parent, device
 	/*
 	 * Check that the configured console device is a wsdisplay.
 	 */
-	if (major(cn_tab->cn_dev) != devsw_name2chr("wsdisplay", NULL, 0))
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc != wsdisplay_cnputc)
+#endif
+	{
 		hil_is_console = 0;
+	}
 
 	hil_attach(sc, _is_console);
 	intr_establish(hil_intr, sc, ia->ia_ipl, IPL_TTY);



CVS commit: src/sys/dev/pci

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 20:01:46 UTC 2020

Modified Files:
src/sys/dev/pci: ahcisata_pci.c

Log Message:
Remove duplicate opt_ahcisata_pci.h include


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/ahcisata_pci.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/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.57 src/sys/dev/pci/ahcisata_pci.c:1.58
--- src/sys/dev/pci/ahcisata_pci.c:1.57	Sat Jan 18 11:26:11 2020
+++ src/sys/dev/pci/ahcisata_pci.c	Mon Dec 28 20:01:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.57 2020/01/18 11:26:11 simonb Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.58 2020/12/28 20:01:46 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,11 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.57 2020/01/18 11:26:11 simonb Exp $");
-
-#ifdef _KERNEL_OPT
-#include "opt_ahcisata_pci.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.58 2020/12/28 20:01:46 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"



CVS commit: [netbsd-8] src/doc

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 19:54:42 UTC 2020

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1642


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.63 -r1.1.2.64 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.63 src/doc/CHANGES-8.3:1.1.2.64
--- src/doc/CHANGES-8.3:1.1.2.63	Mon Dec 28 16:02:57 2020
+++ src/doc/CHANGES-8.3	Mon Dec 28 19:54:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.63 2020/12/28 16:02:57 snj Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.64 2020/12/28 19:54:42 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1506,3 +1506,10 @@ etc/rc.d/ntpdate1.21
 	Adjust to "pool" usage in our standard ntp.conf.
 	[martin, ticket #1643]
 
+sys/arch/hp300/dev/dnkbd.c			1.11
+sys/arch/hp300/dev/hil_intio.c			1.4
+
+	Fix a longstanding bug in hilkbd (and dnkbd) console attachment
+	to make ddb(4) and kernel prompts for root device work.
+	[tsutsui, ticket #1642]
+



CVS commit: [netbsd-8] src/sys/arch/hp300/dev

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 19:52:59 UTC 2020

Modified Files:
src/sys/arch/hp300/dev [netbsd-8]: dnkbd.c hil_intio.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1642):

sys/arch/hp300/dev/dnkbd.c: revision 1.11
sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.6.1 src/sys/arch/hp300/dev/dnkbd.c
cvs rdiff -u -r1.3 -r1.3.52.1 src/sys/arch/hp300/dev/hil_intio.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/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.10 src/sys/arch/hp300/dev/dnkbd.c:1.10.6.1
--- src/sys/arch/hp300/dev/dnkbd.c:1.10	Sat Apr  8 17:04:56 2017
+++ src/sys/arch/hp300/dev/dnkbd.c	Mon Dec 28 19:52:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.10 2017/04/08 17:04:56 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.10.6.1 2020/12/28 19:52:59 martin Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -69,6 +69,9 @@
 
 #include "opt_wsdisplay_compat.h"
 
+#include "wsdisplay.h"
+#include "wsmouse.h"
+
 #include 
 #include 
 #include 
@@ -87,7 +90,9 @@
 #include 
 #include 
 #include 
-#include "wsmouse.h"
+#if NWSDISPLAY > 0
+#include 
+#endif
 #if NWSMOUSE > 0
 #include 
 #endif
@@ -354,7 +359,8 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 	 * plugged), unless the console keyboard has been claimed already
 	 * (i.e. late hotplug with hil keyboard plugged first).
 	 */
-	if (major(cn_tab->cn_dev) == devsw_name2chr("wsdisplay", NULL, 0)) {
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc == wsdisplay_cnputc) {
 #if NHILKBD > 0
 		if (hil_is_console == -1) {
 			ka.console = 1;
@@ -365,7 +371,10 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 		ka.console = 1;
 #endif
 	} else
+#endif
+	{
 		ka.console = 0;
+	}
 
 	ka.keymap = _keymapdata;
 	ka.accessops = _accessops;

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.3 src/sys/arch/hp300/dev/hil_intio.c:1.3.52.1
--- src/sys/arch/hp300/dev/hil_intio.c:1.3	Sat Feb 19 05:36:49 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Mon Dec 28 19:52:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.3.52.1 2020/12/28 19:52:59 martin Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -28,6 +28,8 @@
  *
  */
 
+#include "wsdisplay.h"
+
 #include 
 #include 
 #include 
@@ -38,6 +40,9 @@
 #include 
 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#endif
 
 #include 
 
@@ -88,8 +93,12 @@ hil_intio_attach(device_t parent, device
 	/*
 	 * Check that the configured console device is a wsdisplay.
 	 */
-	if (major(cn_tab->cn_dev) != devsw_name2chr("wsdisplay", NULL, 0))
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc != wsdisplay_cnputc)
+#endif
+	{
 		hil_is_console = 0;
+	}
 
 	hil_attach(sc, _is_console);
 	intr_establish(hil_intr, sc, ia->ia_ipl, IPL_TTY);



CVS commit: src/usr.bin/xlint

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 19:47:42 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: cgram.y mkops scan.l
src/usr.bin/xlint/lint2: chk.c

Log Message:
lint: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/mkops
cvs rdiff -u -r1.94 -r1.95 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/xlint/lint2/chk.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.108 src/usr.bin/xlint/lint1/cgram.y:1.109
--- src/usr.bin/xlint/lint1/cgram.y:1.108	Mon Dec 28 19:07:43 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Dec 28 19:47:42 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.108 2020/12/28 19:07:43 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.109 2020/12/28 19:47:42 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.108 2020/12/28 19:07:43 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.109 2020/12/28 19:47:42 rillig Exp $");
 #endif
 
 #include 
@@ -534,7 +534,7 @@ type_attribute_bounded_type:
 
 
 type_attribute_spec:
-	  /* empty */	
+	  /* empty */
 	| T_AT_DEPRECATED T_LPARN string T_RPARN
 	| T_AT_DEPRECATED
 	| T_AT_ALIGNED T_LPARN constant T_RPARN
@@ -552,9 +552,9 @@ type_attribute_spec:
 	| T_AT_PCS T_LPARN string T_RPARN
 	| T_AT_SECTION T_LPARN string T_RPARN
 	| T_AT_TLS_MODEL T_LPARN string T_RPARN
-	| T_AT_ALIGNED 
-	| T_AT_CONSTRUCTOR 
-	| T_AT_DESTRUCTOR 
+	| T_AT_ALIGNED
+	| T_AT_CONSTRUCTOR
+	| T_AT_DESTRUCTOR
 	| T_AT_MALLOC
 	| T_AT_MAY_ALIAS
 	| T_AT_NO_INSTRUMENT_FUNCTION
@@ -582,7 +582,7 @@ type_attribute_spec:
 	| T_AT_WEAK
 	| T_AT_VISIBILITY T_LPARN constant T_RPARN
 	| T_QUAL {
-		if ($1 != CONST)	
+		if ($1 != CONST)
 			yyerror("Bad attribute");
 	}
 	;
@@ -1336,7 +1336,7 @@ init_expr_list:
 	| init_expr_list T_COMMA init_assign_expr
 	;
 
-lorange: 
+lorange:
 	  constant T_ELLIPSE {
 		$$.lo = toicon($1, 1);
 	  }
@@ -1551,7 +1551,7 @@ expr_stmnt:
 	;
 
 /*
- * The following two productions are used to implement 
+ * The following two productions are used to implement
  * ({ [[decl-list] stmt-list] }).
  * XXX: This is not well tested.
  */
@@ -1625,7 +1625,7 @@ switch_expr:
 
 association:
 	  type_name T_COLON expr
-	| T_DEFAULT T_COLON expr 
+	| T_DEFAULT T_COLON expr
 	;
 
 association_list:

Index: src/usr.bin/xlint/lint1/mkops
diff -u src/usr.bin/xlint/lint1/mkops:1.8 src/usr.bin/xlint/lint1/mkops:1.9
--- src/usr.bin/xlint/lint1/mkops:1.8	Mon Feb  7 23:56:18 2011
+++ src/usr.bin/xlint/lint1/mkops	Mon Dec 28 19:47:42 2020
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: mkops,v 1.8 2011/02/07 23:56:18 christos Exp $
+#	$NetBSD: mkops,v 1.9 2020/12/28 19:47:42 rillig Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -99,7 +99,7 @@ BEGIN {
 			m = $3;
 			act = 1;
 		}
-		printf("\t{ /* %s */\t{ %s \"%s\" }, %d },\n", $2, m, $1, act); 
+		printf("\t{ /* %s */\t{ %s \"%s\" }, %d },\n", $2, m, $1, act);
 	}
 }
 
@@ -110,7 +110,7 @@ END {
 		printf("} op_t;\n");
 		printf("const char *getopname(op_t);\n");
 		printf("void initmtab(void);\n");
-	} 
+	}
 	if (v == "c") {
 		printf("};\n");
 		printf("const char *\n");

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.94 src/usr.bin/xlint/lint1/scan.l:1.95
--- src/usr.bin/xlint/lint1/scan.l:1.94	Mon Dec 28 19:07:43 2020
+++ src/usr.bin/xlint/lint1/scan.l	Mon Dec 28 19:47:42 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.94 2020/12/28 19:07:43 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.95 2020/12/28 19:47:42 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.94 2020/12/28 19:07:43 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.95 2020/12/28 19:47:42 rillig Exp $");
 #endif
 
 #include 
@@ -355,7 +355,7 @@ addkw(struct kwtab *kw, int deco)
 
 	if (name == NULL)
 		err(1, "Can't init symbol table");
-		
+
 	sym = getblk(sizeof (sym_t));
 	sym->s_name = name;
 	sym->s_keyw = kw;
@@ -392,8 +392,8 @@ initscan(void)
 			continue;
 		if (kw->kw_gcc && !gflag)
 			continue;
-		addkw(kw, 1); 
-		addkw(kw, 2); 
+		addkw(kw, 1);
+		addkw(kw, 2);
 		addkw(kw, 4);
 	}
 
@@ -829,7 +829,7 @@ fcon(void)
 		typ = LDOUBLE;
 		len--;
 	} else {
-		if (c == 'd' || c == 'D') 
+		if (c == 'd' || c == 'D')
 			len--;
 		typ = DOUBLE;
 	}

Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.25 src/usr.bin/xlint/lint2/chk.c:1.26
--- src/usr.bin/xlint/lint2/chk.c:1.25	Mon Dec 28 19:07:43 2020
+++ src/usr.bin/xlint/lint2/chk.c	Mon Dec 28 19:47:42 

CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 19:38:54 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: op.h tree.c

Log Message:
lint: rename fields in mod_t


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/op.h
cvs rdiff -u -r1.92 -r1.93 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/op.h
diff -u src/usr.bin/xlint/lint1/op.h:1.6 src/usr.bin/xlint/lint1/op.h:1.7
--- src/usr.bin/xlint/lint1/op.h:1.6	Sat Feb  5 17:14:14 2011
+++ src/usr.bin/xlint/lint1/op.h	Mon Dec 28 19:38:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: op.h,v 1.6 2011/02/05 17:14:14 christos Exp $	*/
+/*	$NetBSD: op.h,v 1.7 2020/12/28 19:38:54 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -35,24 +35,24 @@
  * Various information about operators
  */
 typedef	struct {
-	u_int	m_binary : 1;	/* binary op. */
-	u_int	m_logop : 1;	/* logical op., result is int */
-	u_int	m_rqint : 1;	/* operands must have integer type */
-	u_int	m_rqsclt : 1;	/* operands must have scalar type */
-	u_int	m_rqatyp : 1;	/* operands must have arithmetic type */
+	u_int	m_binary : 1;	/* binary operator */
+	u_int	m_logical : 1;	/* logical operator, result is int */
+	u_int	m_requires_integer : 1;
+	u_int	m_requires_scalar : 1;
+	u_int	m_requires_arith : 1;
 	u_int	m_fold : 1;	/* operands should be folded */
 	u_int	m_vctx : 1;	/* value context for left operand */
 	u_int	m_tctx : 1;	/* test context for left operand */
-	u_int	m_balance : 1;	/* op. requires balancing */
-	u_int	m_sideeff : 1;	/* op. has side effect */
-	u_int	m_tlansiu : 1;	/* warning if left op. is unsign. in ANSI C */
-	u_int	m_transiu : 1;	/* warning if right op. is unsign. in ANSI C */
+	u_int	m_balance : 1;	/* operator requires balancing */
+	u_int	m_sideeff : 1;	/* operator has side effect */
+	u_int	m_tlansiu : 1;	/* warn if left op. is unsign. in ANSI C */
+	u_int	m_transiu : 1;	/* warn if right op. is unsign. in ANSI C */
 	u_int	m_tpconf : 1;	/* test possible precedence confusion */
-	u_int	m_comp : 1;	/* op. performs comparison */
-	u_int	m_enumop : 1;	/* valid operation on enums */
-	u_int	m_badeop : 1;	/* dubious operation on enums */
+	u_int	m_comp : 1;	/* operator performs comparison */
+	u_int	m_valid_on_enum : 1;	/* valid operation on enums */
+	u_int	m_bad_on_enum : 1;	/* dubious operation on enums */
 	u_int	m_eqwarn : 1;	/* warning if on operand stems from == */
-	u_int	m_rqintcomp : 1;/* operands must be integer or complex */
+	u_int	m_requires_integer_or_complex : 1;
 	const char *m_name;	/* name of op. */
 } mod_t;
 

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.92 src/usr.bin/xlint/lint1/tree.c:1.93
--- src/usr.bin/xlint/lint1/tree.c:1.92	Mon Dec 28 19:07:43 2020
+++ src/usr.bin/xlint/lint1/tree.c	Mon Dec 28 19:38:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.92 2020/12/28 19:07:43 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.93 2020/12/28 19:38:54 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.92 2020/12/28 19:07:43 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.93 2020/12/28 19:38:54 rillig Exp $");
 #endif
 
 #include 
@@ -591,7 +591,7 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
 		ntn = bldri(op, ln);
 		break;
 	default:
-		rtp = mp->m_logop ? gettyp(INT) : ln->tn_type;
+		rtp = mp->m_logical ? gettyp(INT) : ln->tn_type;
 		if (!mp->m_binary && rn != NULL)
 			LERROR("build()");
 		ntn = mktnode(op, rtp, ln, rn);
@@ -712,29 +712,25 @@ typeok(op_t op, int arg, tnode_t *ln, tn
 			rst = (rstp = rtp->t_subt)->t_tspec;
 	}
 
-	if (mp->m_rqint) {
-		/* integer types required */
+	if (mp->m_requires_integer) {
 		if (!tspec_is_int(lt) || (mp->m_binary && !tspec_is_int(rt))) {
 			incompat(op, lt, rt);
 			return (0);
 		}
-	} else if (mp->m_rqintcomp) {
-		/* integer or complex types required */
+	} else if (mp->m_requires_integer_or_complex) {
 		if ((!tspec_is_int(lt) && !tspec_is_complex(lt)) ||
 		(mp->m_binary &&
 		 (!tspec_is_int(rt) && !tspec_is_complex(rt {
 			incompat(op, lt, rt);
 			return (0);
 		}
-	} else if (mp->m_rqsclt) {
-		/* scalar types required */
+	} else if (mp->m_requires_scalar) {
 		if (!tspec_is_scalar(lt) ||
 		(mp->m_binary && !tspec_is_scalar(rt))) {
 			incompat(op, lt, rt);
 			return (0);
 		}
-	} else if (mp->m_rqatyp) {
-		/* arithmetic types required */
+	} else if (mp->m_requires_arith) {
 		if (!tspec_is_arith(lt) ||
 		(mp->m_binary && !tspec_is_arith(rt))) {
 			incompat(op, lt, rt);
@@ -1134,12 +1130,14 @@ typeok(op_t op, int arg, tnode_t *ln, tn
 		break;
 	}
 
-	if (mp->m_badeop &&
+	if (mp->m_bad_on_enum &&
 	(ltp->t_isenum || (mp->m_binary && rtp->t_isenum))) {
 		chkbeop(op, ln, rn);
-	} else if (mp->m_enumop && (ltp->t_isenum && rtp && 

CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 19:31:44 UTC 2020

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

Log Message:
If the Subordinate Node Count returns 0 nodes, complain and return instead
of trying to kmem_zalloc 0 bytes later on.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdaudio.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/hdaudio/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.12 src/sys/dev/hdaudio/hdaudio.c:1.13
--- src/sys/dev/hdaudio/hdaudio.c:1.12	Mon Dec 28 16:49:58 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 19:31:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.13 2020/12/28 19:31:43 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.13 2020/12/28 19:31:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -698,6 +698,7 @@ hdaudio_attach_fg(struct hdaudio_functio
 static void
 hdaudio_codec_attach(struct hdaudio_codec *co)
 {
+	struct hdaudio_softc *sc = co->co_host;
 	struct hdaudio_function_group *fg;
 	uint32_t vid, snc, fgrp;
 	int starting_node, num_nodes, nid;
@@ -714,7 +715,6 @@ hdaudio_codec_attach(struct hdaudio_code
 		return;
 
 #ifdef HDAUDIO_DEBUG
-	struct hdaudio_softc *sc = co->co_host;
 	uint32_t rid = hdaudio_command(co, 0, CORB_GET_PARAMETER,
 	COP_REVISION_ID);
 	hda_print(sc, "Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n",
@@ -725,6 +725,16 @@ hdaudio_codec_attach(struct hdaudio_code
 	starting_node = (snc >> 16) & 0xff;
 	num_nodes = snc & 0xff;
 
+	/*
+	 * If the total number of nodes is 0, there's nothing we can do.
+	 * This shouldn't happen, so complain about it.
+	 */
+	if (num_nodes == 0) {
+		hda_error(sc, "Codec%02X: No subordinate nodes found (%08x)\n",
+		co->co_addr, snc);
+		return;
+	}
+
 	co->co_nfg = num_nodes;
 	co->co_fg = kmem_zalloc(co->co_nfg * sizeof(*co->co_fg), KM_SLEEP);
 



CVS commit: src/usr.bin/xlint

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 19:07:44 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: cgram.y err.c init.c main1.c scan.l tree.c
src/usr.bin/xlint/lint2: chk.c mem2.c msg.c read.c

Log Message:
lint: sort includes


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/xlint/lint2/mem2.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/lint2/msg.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.107 src/usr.bin/xlint/lint1/cgram.y:1.108
--- src/usr.bin/xlint/lint1/cgram.y:1.107	Mon Dec 28 18:51:18 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Dec 28 19:07:43 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.107 2020/12/28 18:51:18 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.108 2020/12/28 19:07:43 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,12 +35,12 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.107 2020/12/28 18:51:18 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.108 2020/12/28 19:07:43 rillig Exp $");
 #endif
 
+#include 
 #include 
 #include 
-#include 
 
 #include "lint1.h"
 

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.54 src/usr.bin/xlint/lint1/err.c:1.55
--- src/usr.bin/xlint/lint1/err.c:1.54	Tue Jun  2 21:10:07 2020
+++ src/usr.bin/xlint/lint1/err.c	Mon Dec 28 19:07:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.54 2020/06/02 21:10:07 christos Exp $	*/
+/*	$NetBSD: err.c,v 1.55 2020/12/28 19:07:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,12 +37,12 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.54 2020/06/02 21:10:07 christos Exp $");
+__RCSID("$NetBSD: err.c,v 1.55 2020/12/28 19:07:43 rillig Exp $");
 #endif
 
 #include 
-#include 
 #include 
+#include 
 
 #include "lint1.h"
 

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.30 src/usr.bin/xlint/lint1/init.c:1.31
--- src/usr.bin/xlint/lint1/init.c:1.30	Mon Dec 28 19:02:16 2020
+++ src/usr.bin/xlint/lint1/init.c	Mon Dec 28 19:07:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.30 2020/12/28 19:02:16 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.31 2020/12/28 19:07:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,12 +37,12 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.30 2020/12/28 19:02:16 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.31 2020/12/28 19:07:43 rillig Exp $");
 #endif
 
+#include 
 #include 
 #include 
-#include 
 
 #include "lint1.h"
 

Index: src/usr.bin/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.28 src/usr.bin/xlint/lint1/main1.c:1.29
--- src/usr.bin/xlint/lint1/main1.c:1.28	Mon Dec 28 12:52:45 2020
+++ src/usr.bin/xlint/lint1/main1.c	Mon Dec 28 19:07:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.28 2020/12/28 12:52:45 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.29 2020/12/28 19:07:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,17 +37,17 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.28 2020/12/28 12:52:45 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.29 2020/12/28 19:07:43 rillig Exp $");
 #endif
 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include "lint1.h"
 

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.93 src/usr.bin/xlint/lint1/scan.l:1.94
--- src/usr.bin/xlint/lint1/scan.l:1.93	Mon Dec 28 18:51:18 2020
+++ src/usr.bin/xlint/lint1/scan.l	Mon Dec 28 19:07:43 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.93 2020/12/28 18:51:18 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.94 2020/12/28 19:07:43 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,16 +35,16 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.93 2020/12/28 18:51:18 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.94 2020/12/28 19:07:43 rillig Exp $");
 #endif
 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
+#include 
 
 #include "lint1.h"
 #include "cgram.h"

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.91 

CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 19:02:16 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: init.c tree.c

Log Message:
lint: realign code


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.29 src/usr.bin/xlint/lint1/init.c:1.30
--- src/usr.bin/xlint/lint1/init.c:1.29	Mon Dec 28 18:49:02 2020
+++ src/usr.bin/xlint/lint1/init.c	Mon Dec 28 19:02:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.29 2020/12/28 18:49:02 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.30 2020/12/28 19:02:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.29 2020/12/28 18:49:02 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.30 2020/12/28 19:02:16 rillig Exp $");
 #endif
 
 #include 
@@ -160,7 +160,7 @@ popi2(void)
 
 	DPRINTF(("%s+(%s): brace=%d count=%d namedmem %d\n", __func__,
 	tyname(buf, sizeof(buf),
-	initstk->i_type ? initstk->i_type : initstk->i_subt),
+		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
 	initstk = (istk = initstk)->i_nxt;
 	free(istk);
@@ -171,7 +171,7 @@ popi2(void)
 
 	DPRINTF(("%s-(%s): brace=%d count=%d namedmem %d\n", __func__,
 	tyname(buf, sizeof(buf),
-	initstk->i_type ? initstk->i_type : initstk->i_subt),
+		initstk->i_type ? initstk->i_type : initstk->i_subt),
 	initstk->i_brace, initstk->i_cnt, initstk->i_namedmem));
 
 	istk->i_cnt--;
@@ -263,8 +263,8 @@ pushinit(void)
 
 	/* Extend an incomplete array type by one element */
 	if (istk->i_cnt == 0) {
-		DPRINTF(("%s(extend) %s\n", __func__, tyname(buf, sizeof(buf),
-		istk->i_type)));
+		DPRINTF(("%s(extend) %s\n", __func__,
+		tyname(buf, sizeof(buf), istk->i_type)));
 		/*
 		 * Inside of other aggregate types must not be an incomplete
 		 * type.
@@ -368,7 +368,7 @@ again:
 		istk->i_brace = 1;
 		DPRINTF(("%s(): %s brace=%d\n", __func__,
 		tyname(buf, sizeof(buf),
-		istk->i_type ? istk->i_type : istk->i_subt),
+			istk->i_type ? istk->i_type : istk->i_subt),
 		istk->i_brace));
 		if (cnt == 0) {
 			/* cannot init. struct/union with no named member */
@@ -461,9 +461,11 @@ nextinit(int brace)
 		if (!initerr) {
 			initstk->i_brace = 1;
 			DPRINTF(("%s(): %p %s brace=%d\n", __func__,
-			namedmem, tyname(buf, sizeof(buf),
-			initstk->i_type ? initstk->i_type :
-			initstk->i_subt), initstk->i_brace));
+			namedmem,
+			tyname(buf, sizeof(buf),
+initstk->i_type ? initstk->i_type
+		: initstk->i_subt),
+			initstk->i_brace));
 		}
 	}
 }

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.90 src/usr.bin/xlint/lint1/tree.c:1.91
--- src/usr.bin/xlint/lint1/tree.c:1.90	Mon Dec 28 18:49:02 2020
+++ src/usr.bin/xlint/lint1/tree.c	Mon Dec 28 19:02:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.90 2020/12/28 18:49:02 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.91 2020/12/28 19:02:16 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.90 2020/12/28 18:49:02 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.91 2020/12/28 19:02:16 rillig Exp $");
 #endif
 
 #include 
@@ -1991,13 +1991,14 @@ cvtcon(op_t op, int arg, type_t *tp, val
 LERROR("cvtcon()");
 			if (op == FARG) {
 /* conv. of %s to %s is out of rng., arg #%d */
-warning(295, tyname(lbuf, sizeof(lbuf),
-gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp),
+warning(295,
+tyname(lbuf, sizeof(lbuf), gettyp(ot)),
+tyname(rbuf, sizeof(rbuf), tp),
 arg);
 			} else {
 /* conversion of %s to %s is out of range */
-warning(119, tyname(lbuf, sizeof(lbuf),
-gettyp(ot)),
+warning(119,
+tyname(lbuf, sizeof(lbuf), gettyp(ot)),
 tyname(rbuf, sizeof(rbuf), tp));
 			}
 			v->v_ldbl = v->v_ldbl > 0 ? max : min;
@@ -2085,8 +2086,9 @@ cvtcon(op_t op, int arg, type_t *tp, val
  * extra bits set to 0 in conversion
  * of '%s' to '%s', op %s
  */
-warning(309, tyname(lbuf, sizeof(lbuf),
-gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp),
+warning(309,
+tyname(lbuf, sizeof(lbuf), gettyp(ot)),
+tyname(rbuf, sizeof(rbuf), tp),
 modtab[op].m_name);
 			} else if (nsz < osz &&
    (v->v_quad & xmask) != xmask &&
@@ -2148,13 +2150,14 @@ cvtcon(op_t op, int arg, type_t *tp, val
 warning(196);
 			} else if (op == FARG) {
 /* conv. of %s to %s is out of rng., arg #%d */
-warning(295, tyname(lbuf, sizeof(lbuf),
-gettyp(ot)), tyname(rbuf, sizeof(rbuf), 

CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 18:51:18 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: cgram.y scan.l

Log Message:
lint: rename tspec macros


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.92 -r1.93 src/usr.bin/xlint/lint1/scan.l

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.106 src/usr.bin/xlint/lint1/cgram.y:1.107
--- src/usr.bin/xlint/lint1/cgram.y:1.106	Fri Dec  4 17:56:04 2020
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Dec 28 18:51:18 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.106 2020/12/04 17:56:04 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.107 2020/12/28 18:51:18 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.106 2020/12/04 17:56:04 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.107 2020/12/28 18:51:18 rillig Exp $");
 #endif
 
 #include 
@@ -2080,7 +2080,7 @@ toicon(tnode_t *tn, int required)
 		error(55);
 	} else {
 		i = (int)v->v_quad;
-		if (isutyp(t)) {
+		if (tspec_is_uint(t)) {
 			if (uq_gt((uint64_t)v->v_quad,
   (uint64_t)TARG_INT_MAX)) {
 /* integral constant too large */

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.92 src/usr.bin/xlint/lint1/scan.l:1.93
--- src/usr.bin/xlint/lint1/scan.l:1.92	Fri Sep 18 14:19:08 2020
+++ src/usr.bin/xlint/lint1/scan.l	Mon Dec 28 18:51:18 2020
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.92 2020/09/18 14:19:08 christos Exp $ */
+/* $NetBSD: scan.l,v 1.93 2020/12/28 18:51:18 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.92 2020/09/18 14:19:08 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.93 2020/12/28 18:51:18 rillig Exp $");
 #endif
 
 #include 
@@ -766,7 +766,7 @@ int
 sign(int64_t q, tspec_t t, int len)
 {
 
-	if (t == PTR || isutyp(t))
+	if (t == PTR || tspec_is_uint(t))
 		return (0);
 	return (msb(q, t, len));
 }
@@ -790,7 +790,7 @@ xsign(int64_t q, tspec_t t, int len)
 	if (len <= 0)
 		len = size(t);
 
-	if (t == PTR || isutyp(t) || !sign(q, t, len)) {
+	if (t == PTR || tspec_is_uint(t) || !sign(q, t, len)) {
 		q &= qlmasks[len];
 	} else {
 		q |= qumasks[len];



CVS commit: src/usr.bin/xlint

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 18:49:02 UTC 2020

Modified Files:
src/usr.bin/xlint/common: lint.h
src/usr.bin/xlint/lint1: decl.c emit1.c func.c init.c tree.c
src/usr.bin/xlint/lint2: chk.c

Log Message:
lint: rename tspec macros


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint2/chk.c

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

Modified files:

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.15 src/usr.bin/xlint/common/lint.h:1.16
--- src/usr.bin/xlint/common/lint.h:1.15	Mon Dec 28 18:06:23 2020
+++ src/usr.bin/xlint/common/lint.h	Mon Dec 28 18:49:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.15 2020/12/28 18:06:23 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.16 2020/12/28 18:49:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -94,25 +94,25 @@ typedef	struct {
 	   if pflag is set */
 	tspec_t	tt_styp;		/* signed counterpart */
 	tspec_t	tt_utyp;		/* unsigned counterpart */
-	u_int	tt_isityp : 1;		/* 1 if integer type */
-	u_int	tt_isutyp : 1;		/* 1 if unsigned integer type */
-	u_int	tt_isftyp : 1;		/* 1 if floating point type */
-	u_int	tt_isatyp : 1;		/* 1 if arithmetic type */
-	u_int	tt_issclt : 1;		/* 1 if scalar type */
-	u_int	tt_isctyp : 1;		/* 1 if complex type */
+	u_int	tt_is_int : 1;		/* 1 if integer type */
+	u_int	tt_is_uint : 1;		/* 1 if unsigned integer type */
+	u_int	tt_is_float : 1;	/* 1 if floating point type */
+	u_int	tt_is_arith : 1;	/* 1 if arithmetic type */
+	u_int	tt_is_scalar : 1;	/* 1 if scalar type */
+	u_int	tt_is_complex : 1;	/* 1 if complex type */
 	const char *tt_name;		/* name of the type */
 } ttab_t;
 
-#define size(t)		(ttab[t].tt_sz)
-#define psize(t)	(ttab[t].tt_psz)
-#define styp(t)		(ttab[t].tt_styp)
-#define utyp(t)		(ttab[t].tt_utyp)
-#define isityp(t)	(ttab[t].tt_isityp)
-#define isutyp(t)	(ttab[t].tt_isutyp)
-#define isftyp(t)	(ttab[t].tt_isftyp)
-#define isatyp(t)	(ttab[t].tt_isatyp)
-#define isctyp(t)	(ttab[t].tt_isctyp)
-#define issclt(t)	(ttab[t].tt_issclt)
+#define size(t)			(ttab[t].tt_sz)
+#define psize(t)		(ttab[t].tt_psz)
+#define styp(t)			(ttab[t].tt_styp)
+#define utyp(t)			(ttab[t].tt_utyp)
+#define tspec_is_int(t)		(ttab[t].tt_is_int)
+#define tspec_is_uint(t)	(ttab[t].tt_is_uint)
+#define tspec_is_float(t)	(ttab[t].tt_is_float)
+#define tspec_is_arith(t)	(ttab[t].tt_is_arith)
+#define tspec_is_complex(t)	(ttab[t].tt_is_complex)
+#define tspec_is_scalar(t)	(ttab[t].tt_is_scalar)
 
 extern	ttab_t	ttab[];
 

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.71 src/usr.bin/xlint/lint1/decl.c:1.72
--- src/usr.bin/xlint/lint1/decl.c:1.71	Tue Jun  2 21:10:07 2020
+++ src/usr.bin/xlint/lint1/decl.c	Mon Dec 28 18:49:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.71 2020/06/02 21:10:07 christos Exp $ */
+/* $NetBSD: decl.c,v 1.72 2020/12/28 18:49:02 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.71 2020/06/02 21:10:07 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.72 2020/12/28 18:49:02 rillig Exp $");
 #endif
 
 #include 
@@ -1142,7 +1142,7 @@ decl1str(sym_t *dsym)
 			 * Integer types not dealt with above are
 			 * okay only if BITFIELDTYPE is in effect.
 			 */
-			if (bitfieldtype_ok == 0 || isityp(t) == 0) {
+			if (bitfieldtype_ok == 0 || tspec_is_int(t) == 0) {
 /* illegal bit-field type */
 warning(35);
 sz = tp->t_flen;

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.21 src/usr.bin/xlint/lint1/emit1.c:1.22
--- src/usr.bin/xlint/lint1/emit1.c:1.21	Mon Dec 28 12:52:45 2020
+++ src/usr.bin/xlint/lint1/emit1.c	Mon Dec 28 18:49:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.21 2020/12/28 12:52:45 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.22 2020/12/28 18:49:02 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.21 2020/12/28 12:52:45 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.22 2020/12/28 18:49:02 rillig Exp $");
 #endif
 
 #include 
@@ -442,7 +442,7 @@ outcall(tnode_t *tn, int rvused, int rvd
 			continue;
 		arg = arg->tn_left;
 		if (arg->tn_op == CON) {
-			if (isityp(t = arg->tn_type->t_tspec)) {
+			if (tspec_is_int(t = arg->tn_type->t_tspec)) {
 /*
  * XXX it would probably be better to
  * 

CVS commit: src/usr.bin/xlint/common

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 18:06:23 UTC 2020

Modified Files:
src/usr.bin/xlint/common: lint.h

Log Message:
lint: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/common/lint.h

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

Modified files:

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.14 src/usr.bin/xlint/common/lint.h:1.15
--- src/usr.bin/xlint/common/lint.h:1.14	Fri Sep  7 15:16:15 2018
+++ src/usr.bin/xlint/common/lint.h	Mon Dec 28 18:06:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.14 2018/09/07 15:16:15 christos Exp $	*/
+/*	$NetBSD: lint.h,v 1.15 2020/12/28 18:06:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -100,7 +100,7 @@ typedef	struct {
 	u_int	tt_isatyp : 1;		/* 1 if arithmetic type */
 	u_int	tt_issclt : 1;		/* 1 if scalar type */
 	u_int	tt_isctyp : 1;		/* 1 if complex type */
-	const char *tt_name;		/* Bezeichnung des Typs */
+	const char *tt_name;		/* name of the type */
 } ttab_t;
 
 #define size(t)		(ttab[t].tt_sz)



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 17:00:37 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: t_integration.sh

Log Message:
lint1: remove redundant description from tests


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.11 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.12
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.11	Mon Dec 28 12:47:39 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 17:00:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.11 2020/12/28 12:47:39 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.12 2020/12/28 17:00:37 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -78,19 +78,19 @@ test_case type_question_colon
 test_case typefun
 test_case typename_as_var
 
-test_case c99_struct_init	"Checks C99 struct initialization"
-test_case c99_union_init1	"Checks C99 union initialization"
-test_case c99_union_init2	"Checks C99 union initialization"
-test_case c99_union_init3	"Checks C99 union initialization"
+test_case c99_struct_init
+test_case c99_union_init1
+test_case c99_union_init2
+test_case c99_union_init3
 test_case c99_recursive_init	"Checks C99 recursive struct/union" \
 "initialization"
 test_case c9x_recursive_init	"Checks C9X struct/union member" \
 "init, with nested union and trailing member"
-test_case nested_structs	"Checks nested structs"
-test_case packed_structs	"Checks packed structs"
+test_case nested_structs
+test_case packed_structs
 test_case struct_init_nested	"Initialization of nested structures"
 
-test_case cast_init		"Checks cast initialization"
+test_case cast_init
 test_case cast_init2		"Checks cast initialization as the rhs of a" \
 "- operand"
 test_case cast_lhs		"Checks whether pointer casts are valid lhs" \
@@ -100,15 +100,15 @@ test_case gcc_func		"Checks GCC __FUNCTI
 test_case c99_func		"Checks C99 __func__"
 
 test_case gcc_variable_array_init "Checks GCC variable array initializers"
-test_case c9x_array_init	"Checks C9X array initializers"
-test_case c99_decls_after_stmt	"Checks C99 decls after statements"
-test_case c99_decls_after_stmt3	"Checks C99 decls after statements"
+test_case c9x_array_init
+test_case c99_decls_after_stmt
+test_case c99_decls_after_stmt3
 test_case nolimit_init		"Checks no limit initializers"
-test_case zero_sized_arrays	"Checks zero sized arrays"
+test_case zero_sized_arrays
 
-test_case compound_literals1	"Checks compound literals"
-test_case compound_literals2	"Checks compound literals"
-test_case gcc_compound_statements1 "Checks GCC compound statements"
+test_case compound_literals1
+test_case compound_literals2
+test_case gcc_compound_statements1
 test_case gcc_compound_statements2 "Checks GCC compound statements with" \
 "non-expressions"
 test_case gcc_compound_statements3 "Checks GCC compound statements with" \
@@ -121,7 +121,7 @@ test_case cvt_constant		"Checks constant
 test_case ellipsis_in_switch	"Checks ellipsis in switch()"
 test_case c99_complex_num	"Checks C99 complex numbers"
 test_case c99_complex_split	"Checks C99 complex access"
-test_case c99_for_loops		"Checks C99 for loops"
+test_case c99_for_loops
 test_case alignof		"Checks __alignof__"
 test_case shift_to_narrower_type "Checks that type shifts that result in" \
 "narrower types do not produce warnings"



CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 16:49:58 UTC 2020

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

Log Message:
Initialize DMA memory when allocating it. Should fix PR# 51734 (hdaudio
"RIRB timeout" on boot).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hdaudio/hdaudio.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/hdaudio/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.11 src/sys/dev/hdaudio/hdaudio.c:1.12
--- src/sys/dev/hdaudio/hdaudio.c:1.11	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 16:49:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -179,6 +179,10 @@ hdaudio_dma_alloc(struct hdaudio_softc *
 	if (err)
 		goto destroy;
 
+	memset(dma->dma_addr, 0, dma->dma_size);
+	bus_dmamap_sync(sc->sc_dmat, dma->dma_map, 0, dma->dma_size,
+	BUS_DMASYNC_PREWRITE);
+
 	dma->dma_valid = true;
 	return 0;
 



CVS commit: [netbsd-8] src/doc

2020-12-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 28 16:02:57 UTC 2020

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
1643


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.62 -r1.1.2.63 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.62 src/doc/CHANGES-8.3:1.1.2.63
--- src/doc/CHANGES-8.3:1.1.2.62	Sun Dec 27 14:10:28 2020
+++ src/doc/CHANGES-8.3	Mon Dec 28 16:02:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.62 2020/12/27 14:10:28 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.63 2020/12/28 16:02:57 snj Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1501,3 +1501,8 @@ usr.bin/calendar/calendars/calendar.juda
 	Update to 2021.
 	[maya, ticket #1641]
 
+etc/rc.d/ntpdate1.21
+
+	Adjust to "pool" usage in our standard ntp.conf.
+	[martin, ticket #1643]
+



CVS commit: [netbsd-8] src/etc/rc.d

2020-12-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 28 16:02:34 UTC 2020

Modified Files:
src/etc/rc.d [netbsd-8]: ntpdate

Log Message:
Pull up following revision(s) (requested by martin in ticket #1643):

etc/rc.d/ntpdate: revision 1.21

Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.40.1 src/etc/rc.d/ntpdate

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

Modified files:

Index: src/etc/rc.d/ntpdate
diff -u src/etc/rc.d/ntpdate:1.20 src/etc/rc.d/ntpdate:1.20.40.1
--- src/etc/rc.d/ntpdate:1.20	Mon Aug  3 18:43:48 2009
+++ src/etc/rc.d/ntpdate	Mon Dec 28 16:02:33 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ntpdate,v 1.20 2009/08/03 18:43:48 perry Exp $
+# $NetBSD: ntpdate,v 1.20.40.1 2020/12/28 16:02:33 snj Exp $
 #
 
 # PROVIDE: ntpdate
@@ -21,7 +21,7 @@ ntpdate_start()
 		ntpdate_hosts=$(awk '
 			/^#/{ next }
 			/^(server|peer)[ \t]*127.127/	{ next }
-			/^(server|peer)/		{ if ($2 ~ /^-[46]/)
+			/^(server|peer|pool)/		{ if ($2 ~ /^-[46]/)
 			print $3
 			  else
 			print $2 }



CVS commit: [netbsd-9] src/doc

2020-12-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 28 16:00:51 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
1164


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-9.2

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

Modified files:

Index: src/doc/CHANGES-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.27 src/doc/CHANGES-9.2:1.1.2.28
--- src/doc/CHANGES-9.2:1.1.2.27	Sun Dec 27 14:07:13 2020
+++ src/doc/CHANGES-9.2	Mon Dec 28 16:00:51 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.27 2020/12/27 14:07:13 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.28 2020/12/28 16:00:51 snj Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1297,3 +1297,8 @@ usr.bin/calendar/calendars/calendar.juda
 	Update to 2021.
 	[maya, ticket #1160]
 
+etc/rc.d/ntpdate1.21
+
+	Adjust to "pool" usage in our standard ntp.conf.
+	[martin, ticket #1164]
+



CVS commit: [netbsd-9] src/etc/rc.d

2020-12-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Dec 28 16:00:19 UTC 2020

Modified Files:
src/etc/rc.d [netbsd-9]: ntpdate

Log Message:
Pull up following revision(s) (requested by martin in ticket #1164):

etc/rc.d/ntpdate: revision 1.21

Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.50.1 src/etc/rc.d/ntpdate

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

Modified files:

Index: src/etc/rc.d/ntpdate
diff -u src/etc/rc.d/ntpdate:1.20 src/etc/rc.d/ntpdate:1.20.50.1
--- src/etc/rc.d/ntpdate:1.20	Mon Aug  3 18:43:48 2009
+++ src/etc/rc.d/ntpdate	Mon Dec 28 16:00:19 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ntpdate,v 1.20 2009/08/03 18:43:48 perry Exp $
+# $NetBSD: ntpdate,v 1.20.50.1 2020/12/28 16:00:19 snj Exp $
 #
 
 # PROVIDE: ntpdate
@@ -21,7 +21,7 @@ ntpdate_start()
 		ntpdate_hosts=$(awk '
 			/^#/{ next }
 			/^(server|peer)[ \t]*127.127/	{ next }
-			/^(server|peer)/		{ if ($2 ~ /^-[46]/)
+			/^(server|peer|pool)/		{ if ($2 ~ /^-[46]/)
 			print $3
 			  else
 			print $2 }



CVS commit: src/usr.bin/make

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 15:42:53 UTC 2020

Modified Files:
src/usr.bin/make: buf.c buf.h parse.c

Log Message:
make(1): rename Buf_Expand_1 to Buf_Expand


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/make/buf.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/make/buf.h
cvs rdiff -u -r1.522 -r1.523 src/usr.bin/make/parse.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/make/buf.c
diff -u src/usr.bin/make/buf.c:1.45 src/usr.bin/make/buf.c:1.46
--- src/usr.bin/make/buf.c:1.45	Mon Nov 23 19:07:12 2020
+++ src/usr.bin/make/buf.c	Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.45 2020/11/23 19:07:12 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -69,17 +69,17 @@
  * SUCH DAMAGE.
  */
 
-/* Automatically-expanding null-terminated buffers. */
+/* Automatically-expanding null-terminated character buffers. */
 
 #include 
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.45 2020/11/23 19:07:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.46 2020/12/28 15:42:53 rillig Exp $");
 
-/* Make space in the buffer for adding a single byte. */
+/* Make space in the buffer for adding at least 16 more bytes. */
 void
-Buf_Expand_1(Buffer *buf)
+Buf_Expand(Buffer *buf)
 {
 	buf->cap += buf->cap > 16 ? buf->cap : 16;
 	buf->data = bmake_realloc(buf->data, buf->cap);

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.37 src/usr.bin/make/buf.h:1.38
--- src/usr.bin/make/buf.h:1.37	Sun Dec  6 11:00:56 2020
+++ src/usr.bin/make/buf.h	Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.37 2020/12/06 11:00:56 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.38 2020/12/28 15:42:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@ typedef struct Buffer {
 #define __predict_false(x) (x)
 #endif
 
-void Buf_Expand_1(Buffer *);
+void Buf_Expand(Buffer *);
 
 /* Buf_AddByte adds a single byte to a buffer. */
 MAKE_INLINE void
@@ -100,7 +100,7 @@ Buf_AddByte(Buffer *buf, char byte)
 	size_t old_len = buf->len++;
 	char *end;
 	if (__predict_false(old_len + 1 >= buf->cap))
-		Buf_Expand_1(buf);
+		Buf_Expand(buf);
 	end = buf->data + old_len;
 	end[0] = byte;
 	end[1] = '\0';

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.522 src/usr.bin/make/parse.c:1.523
--- src/usr.bin/make/parse.c:1.522	Mon Dec 28 15:21:33 2020
+++ src/usr.bin/make/parse.c	Mon Dec 28 15:42:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.523 2020/12/28 15:42:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.523 2020/12/28 15:42:53 rillig Exp $");
 
 /* types and constants */
 
@@ -459,7 +459,7 @@ loadfile(const char *path, int fd)
 Error("%s: file too large", path);
 exit(2); /* Not 1 so -q can distinguish error */
 			}
-			Buf_Expand_1();
+			Buf_Expand();
 		}
 		assert(buf.len < buf.cap);
 		n = read(fd, buf.data + buf.len, buf.cap - buf.len);



CVS commit: src/usr.bin/make

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 15:21:33 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): remove mmap for loading files, only allow files < 1 GiB

Using mmap is beneficial if the loaded data is read-only, or if it is
accessed in random order.  Neither of these applies here.  When loading
a file, make reads it strictly from top to bottom, once.  During
parsing, the loaded data is modified in-place to insert '\0' and '\n'
for terminating strings and lines.  Because of all of this, there is no
benefit in using mmap.

Reading the file using 2 calls to read(2) (one for the data, one for
checking for EOF) loads the data in a single pass, instead of producing
a page fault whenever the parser passes another page boundary.

Use a Buffer for loading the file data, to avoid calling bmake_realloc
directly.

Do not resize the loaded buffer at the end.  Each loaded file is
short-lived anyway, and only a few files are loaded at the same time, so
there is no point in optimizing this part for low memory usage.


To generate a diff of this commit:
cvs rdiff -u -r1.521 -r1.522 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.521 src/usr.bin/make/parse.c:1.522
--- src/usr.bin/make/parse.c:1.521	Mon Dec 28 00:46:24 2020
+++ src/usr.bin/make/parse.c	Mon Dec 28 15:21:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.521 2020/12/28 00:46:24 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -98,26 +98,18 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-#ifndef MAP_COPY
-#define MAP_COPY MAP_PRIVATE
-#endif
-
 #include "make.h"
 #include "dir.h"
 #include "job.h"
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.521 2020/12/28 00:46:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.522 2020/12/28 15:21:33 rillig Exp $");
 
 /* types and constants */
 
@@ -354,21 +346,19 @@ struct loadedfile {
 	const char *path;	/* name, for error reports */
 	char *buf;		/* contents buffer */
 	size_t len;		/* length of contents */
-	size_t maplen;		/* length of mmap area, or 0 */
 	Boolean used;		/* XXX: have we used the data yet */
 };
 
 /* XXX: What is the lifetime of the path? Who manages the memory? */
 static struct loadedfile *
-loadedfile_create(const char *path)
+loadedfile_create(const char *path, char *buf, size_t buflen)
 {
 	struct loadedfile *lf;
 
 	lf = bmake_malloc(sizeof *lf);
 	lf->path = path == NULL ? "(stdin)" : path;
-	lf->buf = NULL;
-	lf->len = 0;
-	lf->maplen = 0;
+	lf->buf = buf;
+	lf->len = buflen;
 	lf->used = FALSE;
 	return lf;
 }
@@ -376,12 +366,7 @@ loadedfile_create(const char *path)
 static void
 loadedfile_destroy(struct loadedfile *lf)
 {
-	if (lf->buf != NULL) {
-		if (lf->maplen > 0)
-			munmap(lf->buf, lf->maplen);
-		else
-			free(lf->buf);
-	}
+	free(lf->buf);
 	free(lf);
 }
 
@@ -420,65 +405,18 @@ load_getsize(int fd, size_t *ret)
 	 * st_size is an off_t, which is 64 bits signed; *ret is
 	 * size_t, which might be 32 bits unsigned or 64 bits
 	 * unsigned. Rather than being elaborate, just punt on
-	 * files that are more than 2^31 bytes. We should never
-	 * see a makefile that size in practice...
+	 * files that are more than 1 GiB. We should never
+	 * see a makefile that size in practice.
 	 *
 	 * While we're at it reject negative sizes too, just in case.
 	 */
-	if (st.st_size < 0 || st.st_size > 0x7fff)
+	if (st.st_size < 0 || st.st_size > 0x3fff)
 		return FALSE;
 
 	*ret = (size_t)st.st_size;
 	return TRUE;
 }
 
-static Boolean
-loadedfile_mmap(struct loadedfile *lf, int fd)
-{
-	static unsigned long pagesize = 0;
-
-	if (!load_getsize(fd, >len))
-		return FALSE;
-
-	/* found a size, try mmap */
-	if (pagesize == 0)
-		pagesize = (unsigned long)sysconf(_SC_PAGESIZE);
-	if (pagesize == 0 || pagesize == (unsigned long)-1)
-		pagesize = 0x1000;
-
-	/* round size up to a page */
-	lf->maplen = pagesize * ((lf->len + pagesize - 1) / pagesize);
-
-	/*
-	 * XXX hack for dealing with empty files; remove when
-	 * we're no longer limited by interfacing to the old
-	 * logic elsewhere in this file.
-	 */
-	if (lf->maplen == 0)
-		lf->maplen = pagesize;
-
-	/*
-	 * FUTURE: remove PROT_WRITE when the parser no longer
-	 * needs to scribble on the input.
-	 */
-	lf->buf = mmap(NULL, lf->maplen, PROT_READ | PROT_WRITE,
-	MAP_FILE | MAP_COPY, fd, 0);
-	if (lf->buf == MAP_FAILED)
-		return FALSE;
-
-	if (lf->len > 0 && lf->buf[lf->len - 1] != '\n') {
-		if (lf->len == lf->maplen) {
-			char *b = bmake_malloc(lf->len + 1);
-			memcpy(b, lf->buf, lf->len);
-			munmap(lf->buf, lf->maplen);
-			lf->maplen = 0;
-		}
-		lf->buf[lf->len++] = '\n';
-	}
-

CVS commit: src/sys/dev/fdt

2020-12-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Dec 28 15:08:06 UTC 2020

Modified Files:
src/sys/dev/fdt: i2cmux_fdt.c

Log Message:
The i2c-mux bindings specify that if the mux device has a child node named
"i2c-mux", then it is that node that is the parent of the i2c bus children.
This is to accommodate mux devices that may also have other kinds of child
nodes in addition to i2c bus child nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/i2cmux_fdt.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/fdt/i2cmux_fdt.c
diff -u src/sys/dev/fdt/i2cmux_fdt.c:1.2 src/sys/dev/fdt/i2cmux_fdt.c:1.3
--- src/sys/dev/fdt/i2cmux_fdt.c:1.2	Wed Dec 23 16:04:42 2020
+++ src/sys/dev/fdt/i2cmux_fdt.c	Mon Dec 28 15:08:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cmux_fdt.c,v 1.2 2020/12/23 16:04:42 thorpej Exp $	*/
+/*	$NetBSD: i2cmux_fdt.c,v 1.3 2020/12/28 15:08:06 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.2 2020/12/23 16:04:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.3 2020/12/28 15:08:06 thorpej Exp $");
 
 #include 
 #include 
@@ -94,6 +94,7 @@ struct iicmux_bus {
 struct iicmux_softc {
 	device_t			sc_dev;
 	intsc_phandle;
+	intsc_i2c_mux_phandle;
 	const struct iicmux_config *	sc_config;
 	i2c_tag_t			sc_i2c_parent;
 	struct iicmux_bus *		sc_busses;
@@ -317,10 +318,24 @@ static const struct of_compat_data compa
 static int
 iicmux_count_children(struct iicmux_softc * const sc)
 {
+	char name[32];
 	int child, count;
 
-	for (child = OF_child(sc->sc_phandle), count = 0; child;
+ restart:
+	for (child = OF_child(sc->sc_i2c_mux_phandle), count = 0; child;
 	 child = OF_peer(child)) {
+		if (OF_getprop(child, "name", name, sizeof(name)) <= 0) {
+			continue;
+		}
+		if (strcmp(name, "i2c-mux") == 0) {
+			/*
+			 * The node we encountered is the acutal parent
+			 * of the i2c bus children.  Stash its phandle
+			 * and restart the enumeration.
+			 */
+			sc->sc_i2c_mux_phandle = child;
+			goto restart;
+		}
 		count++;
 	}
 
@@ -394,6 +409,14 @@ iicmux_fdt_attach(device_t const parent,
 	aprint_naive("\n");
 	aprint_normal(": %s I2C mux\n", sc->sc_config->desc);
 
+	/*
+	 * We start out assuming that the i2c bus nodes are children of
+	 * our own node.  We'll adjust later if we encounter an "i2c-mux"
+	 * node when counting our children.  If we encounter such a node,
+	 * then it's that node that is the parent of the i2c bus children.
+	 */
+	sc->sc_i2c_mux_phandle = sc->sc_phandle;
+
 	sc->sc_i2c_parent = fdtbus_i2c_acquire(sc->sc_phandle, "i2c-parent");
 	if (sc->sc_i2c_parent == NULL) {
 		aprint_error_dev(sc->sc_dev, "unable to acquire i2c-parent\n");
@@ -409,7 +432,7 @@ iicmux_fdt_attach(device_t const parent,
 	KM_SLEEP);
 
 	int child, idx;
-	for (child = OF_child(sc->sc_phandle), idx = 0; child;
+	for (child = OF_child(sc->sc_i2c_mux_phandle), idx = 0; child;
 	 child = OF_peer(child), idx++) {
 		KASSERT(idx < nchildren);
 		iicmux_attach_bus(sc, child, idx);



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

2020-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 28 14:28:54 UTC 2020

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

Log Message:
Add resize


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/distrib/sets/lists/debug/mi

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.344 src/distrib/sets/lists/debug/mi:1.345
--- src/distrib/sets/lists/debug/mi:1.344	Sat Dec 12 03:03:14 2020
+++ src/distrib/sets/lists/debug/mi	Mon Dec 28 14:28:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.344 2020/12/12 03:03:14 pgoyette Exp $
+# $NetBSD: mi,v 1.345 2020/12/28 14:28:54 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -750,6 +750,7 @@
 ./usr/libdata/debug/usr/bin/quota.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/radioctl.debug	comp-audio-debug	debug
 ./usr/libdata/debug/usr/bin/ranlib.debug	comp-util-debug		binutils,debug
+./usr/libdata/debug/usr/bin/resize.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/rcs.debug		comp-rcs-debug		debug
 ./usr/libdata/debug/usr/bin/rcsclean.debug	comp-rcs-debug		debug
 ./usr/libdata/debug/usr/bin/rcsdiff.debug	comp-rcs-debug		debug



CVS commit: src/sys

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 14:08:42 UTC 2020

Modified Files:
src/sys/arch/arm/nvidia: tegra_ahcisata.c
src/sys/dev/ic: ahcisata_core.c ahcisatavar.h

Log Message:
Remove the AHCI_QUIRK_SKIP_RESET quirk now that the underlying issue is
fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/nvidia/tegra_ahcisata.c
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.25 -r1.26 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/arch/arm/nvidia/tegra_ahcisata.c
diff -u src/sys/arch/arm/nvidia/tegra_ahcisata.c:1.12 src/sys/arch/arm/nvidia/tegra_ahcisata.c:1.13
--- src/sys/arch/arm/nvidia/tegra_ahcisata.c:1.12	Fri Dec 14 12:29:22 2018
+++ src/sys/arch/arm/nvidia/tegra_ahcisata.c	Mon Dec 28 14:08:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_ahcisata.c,v 1.12 2018/12/14 12:29:22 skrll Exp $ */
+/* $NetBSD: tegra_ahcisata.c,v 1.13 2020/12/28 14:08:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.12 2018/12/14 12:29:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.13 2020/12/28 14:08:42 jmcneill Exp $");
 
 #include 
 #include 
@@ -202,7 +202,6 @@ tegra_ahcisata_attach(device_t parent, d
 		aprint_error(": couldn't map ahci registers: %d\n", error);
 		return;
 	}
-	sc->sc.sc_ahci_quirks = AHCI_QUIRK_SKIP_RESET;
 
 	aprint_naive("\n");
 	aprint_normal(": SATA\n");

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.91 src/sys/dev/ic/ahcisata_core.c:1.92
--- src/sys/dev/ic/ahcisata_core.c:1.91	Mon Dec 28 11:05:54 2020
+++ src/sys/dev/ic/ahcisata_core.c	Mon Dec 28 14:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.91 2020/12/28 11:05:54 jmcneill Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.92 2020/12/28 14:08:42 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.91 2020/12/28 11:05:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.92 2020/12/28 14:08:42 jmcneill Exp $");
 
 #include 
 #include 
@@ -872,9 +872,6 @@ again:
 		KASSERT(sc->sc_ahci_cap & AHCI_CAP_SPM);
 	}
 
-	if (sc->sc_ahci_quirks & AHCI_QUIRK_SKIP_RESET)
-		goto skip_reset;
-
 	/* polled command, assume interrupts are disabled */
 
 	cmd_h = >ahcic_cmdh[c_slot];
@@ -946,7 +943,6 @@ again:
 		goto end;
 	}
 
-skip_reset:
 	/*
 	 * wait 31s for BSY to clear
 	 * This should not be needed, but some controllers clear the

Index: src/sys/dev/ic/ahcisatavar.h
diff -u src/sys/dev/ic/ahcisatavar.h:1.25 src/sys/dev/ic/ahcisatavar.h:1.26
--- src/sys/dev/ic/ahcisatavar.h:1.25	Fri Dec 25 08:57:38 2020
+++ src/sys/dev/ic/ahcisatavar.h	Mon Dec 28 14:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatavar.h,v 1.25 2020/12/25 08:57:38 skrll Exp $	*/
+/*	$NetBSD: ahcisatavar.h,v 1.26 2020/12/28 14:08:42 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -58,8 +58,7 @@ struct ahci_softc {
 #define AHCI_PCI_QUIRK_FORCE	__BIT(0)  /* force attach */
 #define AHCI_PCI_QUIRK_BAD64	__BIT(1)  /* broken 64-bit DMA */
 #define AHCI_QUIRK_BADPMP	__BIT(2)  /* broken PMP support, ignore */
-#define AHCI_QUIRK_SKIP_RESET	__BIT(4)  /* skip drive reset sequence */
-#define AHCI_QUIRK_BADNCQ	__BIT(5)  /* possibly broken NCQ support, ignore */
+#define AHCI_QUIRK_BADNCQ	__BIT(3)  /* possibly broken NCQ support, ignore */
 
 	uint32_t sc_ahci_cap;	/* copy of AHCI_CAP */
 	int sc_ncmds; /* number of command slots */



CVS commit: src/doc

2020-12-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 28 13:59:50 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to dhcpcd-9.4.0


To generate a diff of this commit:
cvs rdiff -u -r1.1770 -r1.1771 src/doc/3RDPARTY
cvs rdiff -u -r1.2771 -r1.2772 src/doc/CHANGES

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.1770 src/doc/3RDPARTY:1.1771
--- src/doc/3RDPARTY:1.1770	Sun Dec 27 18:28:25 2020
+++ src/doc/3RDPARTY	Mon Dec 28 13:59:50 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1770 2020/12/27 18:28:25 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1771 2020/12/28 13:59:50 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -352,17 +352,17 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	9.3.4
-Current Vers:	9.3.4
+Version:	9.4.0
+Current Vers:	9.4.0
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2020-11-28
+Date:		2020-12-28
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist
 Notes:
-Please submit all changes to the author.
+Please submit all changes to the project mailing list.
 
 Package:   drm
 Version:   Linux 3.15

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2771 src/doc/CHANGES:1.2772
--- src/doc/CHANGES:1.2771	Sun Dec 27 21:13:17 2020
+++ src/doc/CHANGES	Mon Dec 28 13:59:50 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2771 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2772 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -324,4 +324,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	nvmm: implement support for trapping REP CMPS [reinoud 20201227]
 	resize: Import Xterm's resize(1) for querying (x)terminal sizes in
 		base for headless clients [reinoud 20201227]
-
+	dhcpcd: Update to version 9.4.0 [roy 20201228]



CVS commit: src/external/bsd/dhcpcd/dist

2020-12-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 28 13:57:40 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/hooks: 20-resolv.conf
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
if-options.c ipv6nd.c privsep.c script.c

Log Message:
Sync with dhcpcd-9.4.0


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
cvs rdiff -u -r1.44 -r1.45 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcp6.c \
src/external/bsd/dhcpcd/dist/src/ipv6nd.c
cvs rdiff -u -r1.47 -r1.48 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/dhcpcd/dist/src/privsep.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/script.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
diff -u src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.5 src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.6
--- src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf:1.5	Fri Nov 20 13:24:58 2020
+++ src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf	Mon Dec 28 13:57:40 2020
@@ -7,9 +7,15 @@
 # or dnsmasq. This is important as the libc resolver isn't that powerful.
 
 resolv_conf_dir="$state_dir/resolv.conf"
+nocarrier_roaming_dir="$state_dir/roaming"
 NL="
 "
 : ${resolvconf:=resolvconf}
+if type "$resolvconf" >/dev/null 2>&1; then
+	have_resolvconf=true
+else
+	have_resolvconf=false
+fi
 
 build_resolv_conf()
 {
@@ -164,7 +170,7 @@ add_resolv_conf()
 	for x in ${new_domain_name_servers}; do
 		conf="${conf}nameserver $x$NL"
 	done
-	if type "$resolvconf" >/dev/null 2>&1; then
+	if $have_resolvconf; then
 		[ -n "$ifmetric" ] && export IF_METRIC="$ifmetric"
 		printf %s "$conf" | "$resolvconf" -a "$ifname"
 		return $?
@@ -180,7 +186,7 @@ add_resolv_conf()
 
 remove_resolv_conf()
 {
-	if type "$resolvconf" >/dev/null 2>&1; then
+	if $have_resolvconf; then
 		"$resolvconf" -d "$ifname" -f
 	else
 		if [ -e "$resolv_conf_dir/$ifname" ]; then
@@ -199,7 +205,18 @@ BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
 esac
 
 if $if_configured; then
-	if $if_up || [ "$reason" = ROUTERADVERT ]; then
+	if $have_resolvconf && [ "$reason" = NOCARRIER_ROAMING ]; then
+		# avoid calling resolvconf -c on CARRIER unless we roam
+		mkdir -p "$nocarrier_roaming_dir"
+		echo " " >"$nocarrier_roaming_dir/$interface"
+		"$resolvconf" -C "$interface.*"
+	elif $have_resolvconf && [ "$reason" = CARRIER ]; then
+		# Not all resolvconf implementations support -c
+		if [ -e "$nocarrier_roaming_dir/$interface" ]; then
+			rm -f "$nocarrier_roaming_dir/$interface"
+			"$resolvconf" -c "$interface.*"
+		fi
+	elif $if_up || [ "$reason" = ROUTERADVERT ]; then
 		add_resolv_conf
 	elif $if_down; then
 		remove_resolv_conf

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.44 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.45
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.44	Sat Nov 28 14:27:20 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Mon Dec 28 13:57:40 2020
@@ -3886,20 +3886,9 @@ dhcp_init(struct interface *ifp)
 	state->clientid = NULL;
 
 	if (ifo->options & DHCPCD_ANONYMOUS) {
-		uint8_t duid[DUID_LEN];
-		uint8_t duid_len;
-
-		duid_len = (uint8_t)duid_make(duid, ifp, DUID_LL);
-		if (duid_len != 0) {
-			state->clientid = malloc((size_t)duid_len + 6);
-			if (state->clientid == NULL)
-goto eexit;
-			state->clientid[0] =(uint8_t)(duid_len + 5);
-			state->clientid[1] = 255; /* RFC 4361 */
-			memcpy(state->clientid + 2, ifo->iaid, 4);
-			memset(state->clientid + 2, 0, 4); /* IAID */
-			memcpy(state->clientid + 6, duid, duid_len);
-		}
+		/* Removing the option could show that we want anonymous.
+		 * As such keep it as it's already in the hwaddr field. */
+		goto make_clientid;
 	} else if (*ifo->clientid) {
 		state->clientid = malloc((size_t)(ifo->clientid[0] + 1));
 		if (state->clientid == NULL)
@@ -3917,6 +3906,7 @@ dhcp_init(struct interface *ifp)
 			memcpy(state->clientid + 6, ifp->ctx->duid,
 			ifp->ctx->duid_len);
 		} else {
+make_clientid:
 			len = (uint8_t)(ifp->hwlen + 1);
 			state->clientid = malloc((size_t)len + 1);
 			if (state->clientid == NULL)

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.26 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.27
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.26	Sat Nov 28 14:27:20 2020
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Mon Dec 28 13:57:40 2020
@@ -2065,7 +2065,8 @@ dhcp6_checkstatusok(const struct interfa
 	state->lerror = code;
 	errno = 0;
 
-	if (code != 0 && ifp->ctx->options & DHCPCD_TEST)
+	/* code cannot be D6_STATUS_OK, so 

CVS import: src/external/bsd/dhcpcd/dist

2020-12-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 28 13:56:26 UTC 2020

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv23356

Log Message:
Update to dhcpcd-9.4.0 with the following changes:

 * DHCP: For anonymous, just use a generic ClientID
 * link: Split hardware address randomisation out of anonymous option
 * link: Only report hardware changes for active interfaces
 * link: Report errors obtaining recv buffer size on overflow
 * hooks: Add NOCARRIER_ROAMING reason
 * hooks: interface_order now reflects priorities again

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-9_4_0

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
C src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
C src/external/bsd/dhcpcd/dist/src/privsep.c
U src/external/bsd/dhcpcd/dist/src/privsep-root.c
U src/external/bsd/dhcpcd/dist/src/privsep-control.c
U src/external/bsd/dhcpcd/dist/src/privsep-inet.c
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.c
U src/external/bsd/dhcpcd/dist/src/privsep-bsd.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/privsep.h
U src/external/bsd/dhcpcd/dist/src/privsep-root.h
U src/external/bsd/dhcpcd/dist/src/privsep-control.h
U src/external/bsd/dhcpcd/dist/src/privsep-inet.h
U src/external/bsd/dhcpcd/dist/src/privsep-bpf.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
C src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname.in
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

9 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/sys/dev/pci

2020-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 28 13:12:24 UTC 2020

Modified Files:
src/sys/dev/pci: pcireg.h

Log Message:
Add second space indentation for bit field values for Enhanced Allocation
capabilities.  From thorpej.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/dev/pci/pcireg.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/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.152 src/sys/dev/pci/pcireg.h:1.153
--- src/sys/dev/pci/pcireg.h:1.152	Mon Dec 28 12:38:44 2020
+++ src/sys/dev/pci/pcireg.h	Mon Dec 28 13:12:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.152 2020/12/28 12:38:44 skrll Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.153 2020/12/28 13:12:24 skrll Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1878,38 +1878,36 @@ struct pci_rom {
 /* Bit definitions for the first DW of each entry */
 #define PCI_EA_ES	__BITS(2, 0)	/* Entry Size */
 #define PCI_EA_BEI	__BITS(7, 4)	/* BAR Equivalent Indicator */
-#define PCI_EA_BEI_BAR0		0	/* BAR0 (10h) */
-#define PCI_EA_BEI_BAR1		1	/* BAR1 (14h) */
-#define PCI_EA_BEI_BAR2		2	/* BAR2 (18h) */
-#define PCI_EA_BEI_BAR3		3	/* BAR3 (1ch) */
-#define PCI_EA_BEI_BAR4		4	/* BAR4 (20h) */
-#define PCI_EA_BEI_BAR5		5	/* BAR5 (24h) */
-#define PCI_EA_BEI_BEHIND	6	/* Behind the function (for type1) */
-#define PCI_EA_BEI_NOTIND	7	/* Not Indicated */
-#define PCI_EA_BEI_EXPROM	8	/* Expansion ROM */
-#define PCI_EA_BEI_VFBAR0	9	/* VF BAR0 */
-#define PCI_EA_BEI_VFBAR1	10	/* VF BAR1 */
-#define PCI_EA_BEI_VFBAR2	11	/* VF BAR2 */
-#define PCI_EA_BEI_VFBAR3	12	/* VF BAR3 */
-#define PCI_EA_BEI_VFBAR4	13	/* VF BAR4 */
-#define PCI_EA_BEI_VFBAR5	14	/* VF BAR5 */
-#define PCI_EA_BEI_RESERVED	15	/* Reserved (treat as Not Indicated) */
-
+#define  PCI_EA_BEI_BAR0	0	/* BAR0 (10h) */
+#define  PCI_EA_BEI_BAR1	1	/* BAR1 (14h) */
+#define  PCI_EA_BEI_BAR2	2	/* BAR2 (18h) */
+#define  PCI_EA_BEI_BAR3	3	/* BAR3 (1ch) */
+#define  PCI_EA_BEI_BAR4	4	/* BAR4 (20h) */
+#define  PCI_EA_BEI_BAR5	5	/* BAR5 (24h) */
+#define  PCI_EA_BEI_BEHIND	6	/* Behind the function (for type1) */
+#define  PCI_EA_BEI_NOTIND	7	/* Not Indicated */
+#define  PCI_EA_BEI_EXPROM	8	/* Expansion ROM */
+#define  PCI_EA_BEI_VFBAR0	9	/* VF BAR0 */
+#define  PCI_EA_BEI_VFBAR1	10	/* VF BAR1 */
+#define  PCI_EA_BEI_VFBAR2	11	/* VF BAR2 */
+#define  PCI_EA_BEI_VFBAR3	12	/* VF BAR3 */
+#define  PCI_EA_BEI_VFBAR4	13	/* VF BAR4 */
+#define  PCI_EA_BEI_VFBAR5	14	/* VF BAR5 */
+#define  PCI_EA_BEI_RESERVED	15	/* Reserved (treat as Not Indicated) */
 #define PCI_EA_PP	__BITS(15, 8)	/* Primary Properties */
 #define PCI_EA_SP	__BITS(23, 16)	/* Secondary Properties */
 /* PP and SP's values */
-#define PCI_EA_PROP_MEM_NONPREF	0x00	/* Memory Space, Non-Prefetchable */
-#define PCI_EA_PROP_MEM_PREF	0x01	/* Memory Space, Prefetchable */
-#define PCI_EA_PROP_IO		0x02	/* I/O Space */
-#define PCI_EA_PROP_VF_MEM_NONPREF 0x03	/* Resorce for VF use. Mem. Non-Pref */
-#define PCI_EA_PROP_VF_MEM_PREF	0x04	/* Resorce for VF use. Mem. Prefetch */
-#define PCI_EA_PROP_BB_MEM_NONPREF 0x05	/* Behind Bridge: MEM. Non-Pref */
-#define PCI_EA_PROP_BB_MEM_PREF 0x06	/* Behind Bridge: MEM. Prefetch */
-#define PCI_EA_PROP_BB_IO	0x07	/* Behind Bridge: I/O Space */
-#define PCI_EA_PROP_MEM_UNAVAIL	0xfd	/* Memory Space Unavailable */
-#define PCI_EA_PROP_IO_UNAVAIL	0xfe	/* IO Space Unavailable */
-#define PCI_EA_PROP_UNAVAIL	0xff	/* Entry Unavailable for use */
-
+#define  PCI_EA_PROP_MEM_NONPREF	0x00	/* Memory Space, Non-Prefetchable */
+#define  PCI_EA_PROP_MEM_PREF		0x01	/* Memory Space, Prefetchable */
+#define  PCI_EA_PROP_IO			0x02	/* I/O Space */
+#define  PCI_EA_PROP_VF_MEM_NONPREF	0x03	/* Resorce for VF use. Mem. Non-Pref */
+#define  PCI_EA_PROP_VF_MEM_PREF	0x04	/* Resorce for VF use. Mem. Prefetch */
+#define  PCI_EA_PROP_BB_MEM_NONPREF	0x05	/* Behind Bridge: MEM. Non-Pref */
+#define  PCI_EA_PROP_BB_MEM_PREF	0x06	/* Behind Bridge: MEM. Prefetch */
+#define  PCI_EA_PROP_BB_IO		0x07	/* Behind Bridge: I/O Space */
+#define  PCI_EA_PROP_MEM_UNAVAIL	0xfd	/* Memory Space Unavailable */
+#define  PCI_EA_PROP_IO_UNAVAIL		0xfe	/* IO Space Unavailable */
+#define  PCI_EA_PROP_UNAVAIL		0xff	/* Entry Unavailable for use */
 #define PCI_EA_W	__BIT(30)	/* Writable */
 #define PCI_EA_E	__BIT(31)	/* Enable for this entry */
 



CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 12:56:33 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: lint1.h

Log Message:
lint1: remove unused t_field


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/lint1/lint1.h

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

Modified files:

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.31 src/usr.bin/xlint/lint1/lint1.h:1.32
--- src/usr.bin/xlint/lint1/lint1.h:1.31	Mon Mar  4 17:45:16 2019
+++ src/usr.bin/xlint/lint1/lint1.h	Mon Dec 28 12:56:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.31 2019/03/04 17:45:16 christos Exp $ */
+/* $NetBSD: lint1.h,v 1.32 2020/12/28 12:56:33 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -174,7 +174,6 @@ struct type {
 
 #define	t_dim	t_u._t_dim
 #define	t_str	t_u._t_str
-#define	t_field	t_u._t_field
 #define	t_enum	t_u._t_enum
 #define	t_args	t_u._t_args
 #define	t_flen	t_b._t_flen



CVS commit: src/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 12:52:45 UTC 2020

Modified Files:
src/usr.bin/xlint/lint1: emit1.c init.c main1.c mem1.c print.c tree.c

Log Message:
lint1: remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/lint1/init.c \
src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/print.c
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.20 src/usr.bin/xlint/lint1/emit1.c:1.21
--- src/usr.bin/xlint/lint1/emit1.c:1.20	Tue Dec 26 17:02:19 2017
+++ src/usr.bin/xlint/lint1/emit1.c	Mon Dec 28 12:52:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.20 2017/12/26 17:02:19 christos Exp $ */
+/* $NetBSD: emit1.c,v 1.21 2020/12/28 12:52:45 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.20 2017/12/26 17:02:19 christos Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.21 2020/12/28 12:52:45 rillig Exp $");
 #endif
 
 #include 
@@ -55,8 +55,8 @@ static	void	outfstrg(strg_t *);
  * a node is coded as follows:
  *	_Bool			B
  *	_Complex float		s X
- *	_Complex double		X 
- *	_Complex long double	l X 
+ *	_Complex double		X
+ *	_Complex long double	l X
  *	char			C
  *	signed char		s C
  *	unsigned char		u C

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.27 src/usr.bin/xlint/lint1/init.c:1.28
--- src/usr.bin/xlint/lint1/init.c:1.27	Tue Jul 28 17:55:13 2015
+++ src/usr.bin/xlint/lint1/init.c	Mon Dec 28 12:52:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.27 2015/07/28 17:55:13 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.28 2020/12/28 12:52:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.27 2015/07/28 17:55:13 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.28 2020/12/28 12:52:45 rillig Exp $");
 #endif
 
 #include 
@@ -87,7 +87,7 @@ void
 memberpush(sb)
 	sbuf_t *sb;
 {
-	namlist_t *nam = xcalloc(1, sizeof (namlist_t)); 
+	namlist_t *nam = xcalloc(1, sizeof (namlist_t));
 	nam->n_name = sb->sb_name;
 	DPRINTF(("%s: %s %p\n", __func__, nam->n_name, nam));
 	if (namedmem == NULL) {
@@ -356,7 +356,7 @@ again:
 			if (m == NULL) {
 DPRINTF(("%s(): struct pop\n", __func__));
 goto pop;
-			} 
+			}
 			istk->i_mem = m;
 			istk->i_subt = m->s_type;
 			istk->i_namedmem = 1;
Index: src/usr.bin/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.27 src/usr.bin/xlint/lint1/main1.c:1.28
--- src/usr.bin/xlint/lint1/main1.c:1.27	Sun Dec 23 19:09:03 2018
+++ src/usr.bin/xlint/lint1/main1.c	Mon Dec 28 12:52:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.27 2018/12/23 19:09:03 christos Exp $	*/
+/*	$NetBSD: main1.c,v 1.28 2020/12/28 12:52:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.27 2018/12/23 19:09:03 christos Exp $");
+__RCSID("$NetBSD: main1.c,v 1.28 2020/12/28 12:52:45 rillig Exp $");
 #endif
 
 #include 
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
 			msglist();
 			return(0);
 
-		case 'R':	
+		case 'R':
 			fnaddreplsrcdir(optarg);
 			break;
 

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.18 src/usr.bin/xlint/lint1/mem1.c:1.19
--- src/usr.bin/xlint/lint1/mem1.c:1.18	Sat Dec 24 17:43:45 2016
+++ src/usr.bin/xlint/lint1/mem1.c	Mon Dec 28 12:52:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.18 2016/12/24 17:43:45 christos Exp $	*/
+/*	$NetBSD: mem1.c,v 1.19 2020/12/28 12:52:45 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.18 2016/12/24 17:43:45 christos Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.19 2020/12/28 12:52:45 rillig Exp $");
 #endif
 
 #include 
@@ -100,9 +100,9 @@ void
 fnaddreplsrcdir(char *arg)
 {
 	struct repl *r = xmalloc(sizeof(*r));
-	
+
 	r->orig = arg;
-	if ((r->repl = strchr(arg, '=')) == NULL) 
+	if ((r->repl = strchr(arg, '=')) == NULL)
 		err(1, "Bad replacement directory spec `%s'", arg);
 	r->len = r->repl - r->orig;
 	*(r->repl)++ = '\0';

Index: src/usr.bin/xlint/lint1/print.c
diff -u src/usr.bin/xlint/lint1/print.c:1.4 src/usr.bin/xlint/lint1/print.c:1.5
--- src/usr.bin/xlint/lint1/print.c:1.4	Thu Jul 31 15:21:34 2008
+++ src/usr.bin/xlint/lint1/print.c	Mon Dec 28 12:52:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.4 2008/07/31 15:21:34 christos Exp $	*/
+/*	$NetBSD: 

CVS commit: src

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 12:47:39 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
Added Files:
src/tests/usr.bin/xlint/lint1: d_c99_union_cast.exp d_gcc_extension.exp

Log Message:
lint1: add forgotten tests


To generate a diff of this commit:
cvs rdiff -u -r1.998 -r1.999 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.19 -r1.20 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_cast.exp \
src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/t_integration.sh

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.998 src/distrib/sets/lists/tests/mi:1.999
--- src/distrib/sets/lists/tests/mi:1.998	Mon Dec 28 11:40:54 2020
+++ src/distrib/sets/lists/tests/mi	Mon Dec 28 12:47:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.998 2020/12/28 11:40:54 rillig Exp $
+# $NetBSD: mi,v 1.999 2020/12/28 12:47:39 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5750,6 +5750,7 @@
 ./usr/tests/usr.bin/xlint/lint1/d_c99_recursive_init.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_struct_init.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_cast.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_c99_union_cast.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init1.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init2.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init3.c		tests-usr.bin-tests	compattestfile,atf
@@ -5775,6 +5776,7 @@
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_compound_statements3.c	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_extension.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_gcc_extension.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_func.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.c	tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.19 src/tests/usr.bin/xlint/lint1/Makefile:1.20
--- src/tests/usr.bin/xlint/lint1/Makefile:1.19	Mon Dec 28 11:19:01 2020
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Dec 28 12:47:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2020/12/28 11:19:01 rillig Exp $
+# $NetBSD: Makefile,v 1.20 2020/12/28 12:47:39 rillig Exp $
 
 NOMAN=		# defined
 
@@ -26,6 +26,7 @@ FILES+=		d_c99_nested_struct.c
 FILES+=		d_c99_recursive_init.c
 FILES+=		d_c99_struct_init.c
 FILES+=		d_c99_union_cast.c
+FILES+=		d_c99_union_cast.exp
 FILES+=		d_c99_union_init1.c
 FILES+=		d_c99_union_init2.c
 FILES+=		d_c99_union_init3.c
@@ -51,6 +52,7 @@ FILES+=		d_gcc_compound_statements1.c
 FILES+=		d_gcc_compound_statements2.c
 FILES+=		d_gcc_compound_statements3.c
 FILES+=		d_gcc_extension.c
+FILES+=		d_gcc_extension.exp
 FILES+=		d_gcc_func.c
 FILES+=		d_gcc_variable_array_init.c
 FILES+=		d_incorrect_array_size.c

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.10 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.11
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.10	Mon Dec 28 12:17:23 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 12:47:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.10 2020/12/28 12:17:23 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.11 2020/12/28 12:47:39 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,7 +50,9 @@ test_case()
 
 	atf_test_case ${name}
 	eval "${name}_head() {
-		atf_set \"descr\" \"${descr}\"
+		if [ \"${descr}\" ]; then
+			atf_set \"descr\" \"${descr}\"
+		fi
 		atf_set \"require.progs\" \"${LINT1}\"
 	}"
 	eval "${name}_body() {
@@ -60,6 +62,22 @@ test_case()
 	Names="${Names} ${name}"
 }
 
+test_case bltinoffsetof
+test_case c99_anon_struct
+test_case c99_anon_union
+test_case c99_compound_literal_comma
+test_case c99_decls_after_stmt2
+test_case c99_flex_array_packed
+test_case c99_nested_struct
+test_case c99_union_cast
+test_case c99_union_init4
+test_case cast_fun_array_param
+test_case cast_typeof
+test_case gcc_extension
+test_case type_question_colon
+test_case typefun
+test_case typename_as_var
+
 test_case c99_struct_init	

CVS commit: src/sys/dev/pci

2020-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 28 12:38:45 UTC 2020

Modified Files:
src/sys/dev/pci: pci_map.c pcireg.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/pci_map.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/pci/pcireg.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/pci/pci_map.c
diff -u src/sys/dev/pci/pci_map.c:1.40 src/sys/dev/pci/pci_map.c:1.41
--- src/sys/dev/pci/pci_map.c:1.40	Tue May  5 16:58:11 2020
+++ src/sys/dev/pci/pci_map.c	Mon Dec 28 12:38:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_map.c,v 1.40 2020/05/05 16:58:11 bouyer Exp $	*/
+/*	$NetBSD: pci_map.c,v 1.41 2020/12/28 12:38:44 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.40 2020/05/05 16:58:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.41 2020/12/28 12:38:44 skrll Exp $");
 
 #include 
 #include 
@@ -309,7 +309,7 @@ pci_mapreg_map(const struct pci_attach_a
 int busflags, bus_space_tag_t *tagp, bus_space_handle_t *handlep,
 bus_addr_t *basep, bus_size_t *sizep)
 {
-	return pci_mapreg_submap(pa, reg, type, busflags, 0, 0, tagp, 
+	return pci_mapreg_submap(pa, reg, type, busflags, 0, 0, tagp,
 	handlep, basep, sizep);
 }
 
@@ -351,7 +351,7 @@ pci_mapreg_submap(const struct pci_attac
 		splx(s);
 	}
 
-	/* If we're called with maxsize/offset of 0, behave like 
+	/* If we're called with maxsize/offset of 0, behave like
 	 * pci_mapreg_map.
 	 */
 
@@ -415,7 +415,7 @@ pci_find_rom(const struct pci_attach_arg
 			return 1;
 
 		ptr = offset + hdr.romh_data_ptr;
-		
+
 		if (ptr > sz) {
 			printf("pci_find_rom: rom data ptr out of range\n");
 			return 1;
@@ -456,7 +456,7 @@ pci_find_rom(const struct pci_attach_arg
 			bus_space_subregion(bst, bsh, offset, imagesz, romh);
 			return 0;
 		}
-		
+
 		/* last image check */
 		if (rom.rom_indicator & PCI_ROM_INDICATOR_LAST)
 			return 1;

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.151 src/sys/dev/pci/pcireg.h:1.152
--- src/sys/dev/pci/pcireg.h:1.151	Tue Feb 18 04:08:12 2020
+++ src/sys/dev/pci/pcireg.h	Mon Dec 28 12:38:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.151 2020/02/18 04:08:12 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.152 2020/12/28 12:38:44 skrll Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -2073,7 +2073,7 @@ struct pci_rom {
 #define	PCI_DPC_RPPIO_MEMUR_CPL	__BIT(16)  /* MemReq received UR Complt. */
 #define	PCI_DPC_RPPIO_MEMCA_CPL	__BIT(17)  /* MemReq received CA Complt. */
 #define	PCI_DPC_RPPIO_MEM_CTO	__BIT(18)  /* MemReq Completion Timeout */
-	
+
 #define	PCI_DPC_RPPIO_MASK 0x10	/* RP PIO Mask Register */
   /* Bits are the same as RP PIO Status Register */
 #define	PCI_DPC_RPPIO_SEVE 0x14	/* RP PIO Severity Register */



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 12:17:23 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: t_integration.sh

Log Message:
lint1: use tabular layout for listing the test cases


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.9 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.10
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.9	Mon Dec 28 12:01:24 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 12:17:23 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.9 2020/12/28 12:01:24 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.10 2020/12/28 12:17:23 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,72 +60,70 @@ test_case()
 	Names="${Names} ${name}"
 }
 
-test_case c99_struct_init "Checks C99 struct initialization"
-test_case c99_union_init1 "Checks C99 union initialization"
-test_case c99_union_init2 "Checks C99 union initialization"
-test_case c99_union_init3 "Checks C99 union initialization"
-test_case c99_recursive_init "Checks C99 recursive struct/union" \
-"initialization"
-test_case c9x_recursive_init "Checks C9X struct/union member" \
-"init, with nested union and trailing member"
-test_case nested_structs "Checks nested structs"
-test_case packed_structs "Checks packed structs"
-test_case struct_init_nested \
-"Initialization of nested structures"
-
-test_case cast_init "Checks cast initialization"
-test_case cast_init2 "Checks cast initialization as the rhs of a" \
-"- operand"
-test_case cast_lhs "Checks whether pointer casts are valid lhs" \
-"lvalues"
+test_case c99_struct_init	"Checks C99 struct initialization"
+test_case c99_union_init1	"Checks C99 union initialization"
+test_case c99_union_init2	"Checks C99 union initialization"
+test_case c99_union_init3	"Checks C99 union initialization"
+test_case c99_recursive_init	"Checks C99 recursive struct/union" \
+"initialization"
+test_case c9x_recursive_init	"Checks C9X struct/union member" \
+"init, with nested union and trailing member"
+test_case nested_structs	"Checks nested structs"
+test_case packed_structs	"Checks packed structs"
+test_case struct_init_nested	"Initialization of nested structures"
+
+test_case cast_init		"Checks cast initialization"
+test_case cast_init2		"Checks cast initialization as the rhs of a" \
+"- operand"
+test_case cast_lhs		"Checks whether pointer casts are valid lhs" \
+"lvalues"
 
-test_case gcc_func "Checks GCC __FUNCTION__"
-test_case c99_func "Checks C99 __func__"
+test_case gcc_func		"Checks GCC __FUNCTION__"
+test_case c99_func		"Checks C99 __func__"
 
 test_case gcc_variable_array_init "Checks GCC variable array initializers"
-test_case c9x_array_init "Checks C9X array initializers"
-test_case c99_decls_after_stmt "Checks C99 decls after statements"
-test_case c99_decls_after_stmt3 "Checks C99 decls after statements"
-test_case nolimit_init "Checks no limit initializers"
-test_case zero_sized_arrays "Checks zero sized arrays"
+test_case c9x_array_init	"Checks C9X array initializers"
+test_case c99_decls_after_stmt	"Checks C99 decls after statements"
+test_case c99_decls_after_stmt3	"Checks C99 decls after statements"
+test_case nolimit_init		"Checks no limit initializers"
+test_case zero_sized_arrays	"Checks zero sized arrays"
 
-test_case compound_literals1 "Checks compound literals"
-test_case compound_literals2 "Checks compound literals"
+test_case compound_literals1	"Checks compound literals"
+test_case compound_literals2	"Checks compound literals"
 test_case gcc_compound_statements1 "Checks GCC compound statements"
-test_case gcc_compound_statements2 "Checks GCC compound" \
-"statements with non-expressions"
-test_case gcc_compound_statements3 "Checks GCC compound" \
-"statements with void type"
+test_case gcc_compound_statements2 "Checks GCC compound statements with" \
+"non-expressions"
+test_case gcc_compound_statements3 "Checks GCC compound statements with" \
+"void type"
 # XXX: Because of polymorphic __builtin_isnan and expression has null effect
 # test_case gcc_extension "Checks GCC __extension__ and __typeof__"
 
-test_case cvt_in_ternary "Checks CVT nodes handling in ?"
-test_case cvt_constant "Checks constant conversion"
-test_case ellipsis_in_switch "Checks ellipsis in switch()"
-test_case c99_complex_num "Checks C99 complex numbers"
-test_case c99_complex_split "Checks C99 complex access"
-test_case c99_for_loops "Checks C99 for loops"
-test_case alignof "Checks __alignof__"
-test_case shift_to_narrower_type "Checks that type shifts that" \
-"result in narrower types do not produce warnings"
-
-test_case 

CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 12:01:25 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: t_integration.sh

Log Message:
lint1: remove redundancy from test definitions

Whether a test is supposed to produce lint warnings is determined by the
corresponding .exp file.  There is no need to encode this information
redundantly in the test driver.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.8 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.9
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.8	Mon Dec 28 11:19:01 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 12:01:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.8 2020/12/28 11:19:01 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.9 2020/12/28 12:01:24 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -29,104 +29,102 @@ LINT1=/usr/libexec/lint1
 
 Names=
 
-check_valid()
-{
-	atf_check -s exit:0 ${LINT1} -g -S "$(atf_get_srcdir)/$1" /dev/null
-}
-
-check_invalid()
+check_lint1()
 {
 	local src="$(atf_get_srcdir)/$1"
 	local exp="${src%.c}.exp"
 
-	atf_check -s not-exit:0 -o "file:${exp}" -e empty \
-	${LINT1} -g -S -w "${src}" /dev/null
+	if [ -f "${exp}" ]; then
+		atf_check -s not-exit:0 -o "file:${exp}" -e empty \
+		${LINT1} -g -S -w "${src}" /dev/null
+	else
+		atf_check -s exit:0 \
+		${LINT1} -g -S -w "${src}" /dev/null
+	fi
 }
 
 test_case()
 {
-	local result="${1}"; shift
 	local name="${1}"; shift
 	local descr="${*}"
 
 	atf_test_case ${name}
 	eval "${name}_head() {
-		atf_set \"descr\" \"${descr}\";
-		atf_set \"require.progs\" \"${LINT1}\";
+		atf_set \"descr\" \"${descr}\"
+		atf_set \"require.progs\" \"${LINT1}\"
 	}"
 	eval "${name}_body() {
-		${result} d_${name}.c;
+		check_lint1 d_${name}.c
 	}"
 
 	Names="${Names} ${name}"
 }
 
-test_case check_valid c99_struct_init "Checks C99 struct initialization"
-test_case check_valid c99_union_init1 "Checks C99 union initialization"
-test_case check_valid c99_union_init2 "Checks C99 union initialization"
-test_case check_valid c99_union_init3 "Checks C99 union initialization"
-test_case check_valid c99_recursive_init "Checks C99 recursive struct/union" \
+test_case c99_struct_init "Checks C99 struct initialization"
+test_case c99_union_init1 "Checks C99 union initialization"
+test_case c99_union_init2 "Checks C99 union initialization"
+test_case c99_union_init3 "Checks C99 union initialization"
+test_case c99_recursive_init "Checks C99 recursive struct/union" \
 "initialization"
-test_case check_valid c9x_recursive_init "Checks C9X struct/union member" \
+test_case c9x_recursive_init "Checks C9X struct/union member" \
 "init, with nested union and trailing member"
-test_case check_valid nested_structs "Checks nested structs"
-test_case check_valid packed_structs "Checks packed structs"
-test_case check_invalid struct_init_nested \
+test_case nested_structs "Checks nested structs"
+test_case packed_structs "Checks packed structs"
+test_case struct_init_nested \
 "Initialization of nested structures"
 
-test_case check_valid cast_init "Checks cast initialization"
-test_case check_valid cast_init2 "Checks cast initialization as the rhs of a" \
+test_case cast_init "Checks cast initialization"
+test_case cast_init2 "Checks cast initialization as the rhs of a" \
 "- operand"
-test_case check_valid cast_lhs "Checks whether pointer casts are valid lhs" \
+test_case cast_lhs "Checks whether pointer casts are valid lhs" \
 "lvalues"
 
-test_case check_valid gcc_func "Checks GCC __FUNCTION__"
-test_case check_valid c99_func "Checks C99 __func__"
+test_case gcc_func "Checks GCC __FUNCTION__"
+test_case c99_func "Checks C99 __func__"
 
-test_case check_valid gcc_variable_array_init "Checks GCC variable array" \
-"initializers"
-test_case check_valid c9x_array_init "Checks C9X array initializers"
-test_case check_valid c99_decls_after_stmt "Checks C99 decls after statements"
-test_case check_valid c99_decls_after_stmt3 "Checks C99 decls after statements"
-test_case check_valid nolimit_init "Checks no limit initializers"
-test_case check_valid zero_sized_arrays "Checks zero sized arrays"
-
-test_case check_valid compound_literals1 "Checks compound literals"
-test_case check_valid compound_literals2 "Checks compound literals"
-test_case check_valid gcc_compound_statements1 "Checks GCC compound statements"
-test_case check_valid gcc_compound_statements2 "Checks GCC compound" \
+test_case gcc_variable_array_init "Checks GCC variable array initializers"
+test_case c9x_array_init "Checks C9X array initializers"
+test_case c99_decls_after_stmt "Checks C99 

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

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 11:40:55 UTC 2020

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

Log Message:
lint1: fix file list for recently added test output


To generate a diff of this commit:
cvs rdiff -u -r1.997 -r1.998 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.997 src/distrib/sets/lists/tests/mi:1.998
--- src/distrib/sets/lists/tests/mi:1.997	Sun Dec 27 05:11:40 2020
+++ src/distrib/sets/lists/tests/mi	Mon Dec 28 11:40:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.997 2020/12/27 05:11:40 rillig Exp $
+# $NetBSD: mi,v 1.998 2020/12/28 11:40:54 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5764,8 +5764,11 @@
 ./usr/tests/usr.bin/xlint/lint1/d_compound_literals1.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_compound_literals2.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_constant_conv1.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_constant_conv1.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_constant_conv2.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_constant_conv2.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_cvt_constant.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_cvt_constant.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_cvt_in_ternary.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c	tests-usr.bin-tests	compattestfile,atf
@@ -5775,14 +5778,21 @@
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_func.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_gcc_variable_array_init.c	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.c	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_long_double_int.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_long_double_int.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_nested_structs.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_nolimit_init.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_packed_structs.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_struct_init_nested.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_type_conv1.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_type_conv1.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_type_conv2.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_type_conv2.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_type_conv3.c			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_type_conv3.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_type_question_colon.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_typefun.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_typename_as_var.c		tests-usr.bin-tests	compattestfile,atf



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 11:19:01 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
Added Files:
src/tests/usr.bin/xlint/lint1: d_cvt_constant.exp

Log Message:
lint1: enable test cvt_constant

This test had never been enabled.  In t_integration.sh 1.3 from
2014-04-17 it was supposed to be enabled, but due to a line continuation
backslash, the words "test_case check_valid" ended up as the description
of the previous test, cvt_in_ternary.

While here, add the expected test output for d_struct_init_nested to
FILES.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_cvt_constant.exp
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.18 src/tests/usr.bin/xlint/lint1/Makefile:1.19
--- src/tests/usr.bin/xlint/lint1/Makefile:1.18	Mon Dec 28 10:22:21 2020
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Dec 28 11:19:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2020/12/28 10:22:21 rillig Exp $
+# $NetBSD: Makefile,v 1.19 2020/12/28 11:19:01 rillig Exp $
 
 NOMAN=		# defined
 
@@ -44,6 +44,7 @@ FILES+=		d_constant_conv1.exp
 FILES+=		d_constant_conv2.c
 FILES+=		d_constant_conv2.exp
 FILES+=		d_cvt_constant.c
+FILES+=		d_cvt_constant.exp
 FILES+=		d_cvt_in_ternary.c
 FILES+=		d_ellipsis_in_switch.c
 FILES+=		d_gcc_compound_statements1.c
@@ -61,6 +62,7 @@ FILES+=		d_nolimit_init.c
 FILES+=		d_packed_structs.c
 FILES+=		d_shift_to_narrower_type.c
 FILES+=		d_struct_init_nested.c
+FILES+=		d_struct_init_nested.exp
 FILES+=		d_type_conv1.c
 FILES+=		d_type_conv1.exp
 FILES+=		d_type_conv2.c

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.7 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.8
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.7	Mon Dec 28 10:22:21 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 11:19:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.7 2020/12/28 10:22:21 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.8 2020/12/28 11:19:01 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -101,8 +101,8 @@ test_case check_valid gcc_compound_state
 # XXX: Because of polymorphic __builtin_isnan and expression has null effect
 # test_case check_valid gcc_extension "Checks GCC __extension__ and __typeof__"
 
-test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?" \
-test_case check_valid cvt_constant "Checks constant conversion"
+test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?"
+test_case check_invalid cvt_constant "Checks constant conversion"
 test_case check_valid ellipsis_in_switch "Checks ellipsis in switch()"
 test_case check_valid c99_complex_num "Checks C99 complex numbers"
 test_case check_valid c99_complex_split "Checks C99 complex access"

Added files:

Index: src/tests/usr.bin/xlint/lint1/d_cvt_constant.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_cvt_constant.exp:1.1
--- /dev/null	Mon Dec 28 11:19:01 2020
+++ src/tests/usr.bin/xlint/lint1/d_cvt_constant.exp	Mon Dec 28 11:19:01 2020
@@ -0,0 +1,2 @@
+(7): warning: x set but not used in function main [191]
+(11): warning: function main falls off bottom without returning value [217]



CVS commit: src/sys/dev/ic

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 11:05:54 UTC 2020

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

Log Message:
Make sure to ack IS after PxIS when polling and when using multiple MSI-X
messages.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 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.90 src/sys/dev/ic/ahcisata_core.c:1.91
--- src/sys/dev/ic/ahcisata_core.c:1.90	Sun Dec 27 15:13:07 2020
+++ src/sys/dev/ic/ahcisata_core.c	Mon Dec 28 11:05:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.90 2020/12/27 15:13:07 jmcneill Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.91 2020/12/28 11:05:54 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.90 2020/12/27 15:13:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.91 2020/12/28 11:05:54 jmcneill Exp $");
 
 #include 
 #include 
@@ -84,6 +84,7 @@ static void ahci_channel_start(struct ah
 int, int);
 static void ahci_channel_recover(struct ata_channel *, int, uint32_t);
 static int  ahci_dma_setup(struct ata_channel *, int, void *, size_t, int);
+static int ahci_intr_port_common(struct ata_channel *);
 
 #if NATAPIBUS > 0
 static void ahci_atapibus_attach(struct atabus_softc *);
@@ -602,7 +603,7 @@ ahci_intr(void *v)
 		ports = is;
 		while ((bit = ffs(ports)) != 0) {
 			bit--;
-			ahci_intr_port(>sc_channels[bit]);
+			ahci_intr_port_common(>sc_channels[bit].ata_channel);
 			ports &= ~(1U << bit);
 		}
 		AHCI_WRITE(sc, AHCI_IS, is);
@@ -617,6 +618,20 @@ ahci_intr_port(void *v)
 	struct ahci_channel *achp = v;
 	struct ata_channel *chp = >ata_channel;
 	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
+	int ret;
+
+	ret = ahci_intr_port_common(chp);
+	if (ret) {
+		AHCI_WRITE(sc, AHCI_IS, 1U << chp->ch_channel);
+	}
+
+	return ret;
+}
+
+static int
+ahci_intr_port_common(struct ata_channel *chp)
+{
+	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
 	uint32_t is, tfd, sact;
 	struct ata_xfer *xfer;
 	int slot = -1;
@@ -626,8 +641,8 @@ ahci_intr_port(void *v)
 	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 SACT 0x%x TFD 0x%x\n",
+	AHCIDEBUG_PRINT(("ahci_intr_port_common %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)),



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 10:26:23 UTC 2020

Added Files:
src/tests/usr.bin/xlint/lint1: d_struct_init_nested.exp

Log Message:
lint1: add expected output for test d_struct_init_nested


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp

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

Added files:

Index: src/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp:1.1
--- /dev/null	Mon Dec 28 10:26:23 2020
+++ src/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp	Mon Dec 28 10:26:23 2020
@@ -0,0 +1,4 @@
+d_struct_init_nested.c(27): initialisation type mismatch (enum I1) and (struct Inner1) [185]
+d_struct_init_nested.c(29): too many struct/union initializers [172]
+d_struct_init_nested.c(54): initialisation type mismatch (enum I1) and (struct Inner2) [185]
+d_struct_init_nested.c(56): warning: enum type mismatch in initialisation [210]



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 10:22:21 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
Added Files:
src/tests/usr.bin/xlint/lint1: d_struct_init_nested.c

Log Message:
lint1: add test for initializing nested structs

Discovered in var.c 1.774 from 2020-12-28.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_struct_init_nested.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.17 src/tests/usr.bin/xlint/lint1/Makefile:1.18
--- src/tests/usr.bin/xlint/lint1/Makefile:1.17	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Dec 28 10:22:21 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2020/12/28 09:58:56 rillig Exp $
+# $NetBSD: Makefile,v 1.18 2020/12/28 10:22:21 rillig Exp $
 
 NOMAN=		# defined
 
@@ -60,6 +60,7 @@ FILES+=		d_nested_structs.c
 FILES+=		d_nolimit_init.c
 FILES+=		d_packed_structs.c
 FILES+=		d_shift_to_narrower_type.c
+FILES+=		d_struct_init_nested.c
 FILES+=		d_type_conv1.c
 FILES+=		d_type_conv1.exp
 FILES+=		d_type_conv2.c

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.6 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.7
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.6	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 10:22:21 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.6 2020/12/28 09:58:56 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.7 2020/12/28 10:22:21 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -71,6 +71,8 @@ test_case check_valid c9x_recursive_init
 "init, with nested union and trailing member"
 test_case check_valid nested_structs "Checks nested structs"
 test_case check_valid packed_structs "Checks packed structs"
+test_case check_invalid struct_init_nested \
+"Initialization of nested structures"
 
 test_case check_valid cast_init "Checks cast initialization"
 test_case check_valid cast_init2 "Checks cast initialization as the rhs of a" \

Added files:

Index: src/tests/usr.bin/xlint/lint1/d_struct_init_nested.c
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_struct_init_nested.c:1.1
--- /dev/null	Mon Dec 28 10:22:21 2020
+++ src/tests/usr.bin/xlint/lint1/d_struct_init_nested.c	Mon Dec 28 10:22:21 2020
@@ -0,0 +1,59 @@
+# 2 "d_struct_init_nested.c"
+
+typedef enum O1 { O1C = 101 } O1;
+typedef enum O2 { O2C = 102 } O2;
+typedef enum O3 { O3C = 103 } O3;
+typedef enum I1 { I1C = 201 } I1;
+typedef enum I2 { I2C = 202 } I2;
+
+struct Inner1 {
+	I1 i1;
+};
+
+struct Outer3Inner1 {
+	O1 o1;
+	struct Inner1 inner;
+	O3 o3;
+};
+
+O1
+funcOuter3Inner1(void)
+{
+	struct Inner1 inner = {
+		I1C
+	};
+	struct Outer3Inner1 o3i1 = {
+	O1C,
+	inner,
+	O3C
+	};
+
+	return o3i1.o1;
+}
+
+struct Inner2 {
+	I1 i1;
+	I2 i2;
+};
+
+struct Outer3Inner2 {
+	O1 o1;
+	struct Inner2 inner;
+	O3 o3;
+};
+
+O1
+funcOuter3Inner2(void)
+{
+	struct Inner2 inner = {
+		I1C,
+		I2C
+	};
+	struct Outer3Inner2 o3i2 = {
+	O1C,
+	inner,
+	O3C
+	};
+
+	return o3i2.o1;
+}



CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 09:58:56 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
Added Files:
src/tests/usr.bin/xlint/lint1: d_constant_conv1.exp
d_constant_conv2.exp d_incorrect_array_size.exp
d_long_double_int.exp d_type_conv1.exp d_type_conv2.exp
d_type_conv3.exp

Log Message:
lint: for tests with output, ensure that the output matches


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_constant_conv1.exp \
src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp \
src/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp \
src/tests/usr.bin/xlint/lint1/d_long_double_int.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv1.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv2.exp \
src/tests/usr.bin/xlint/lint1/d_type_conv3.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/t_integration.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.16 src/tests/usr.bin/xlint/lint1/Makefile:1.17
--- src/tests/usr.bin/xlint/lint1/Makefile:1.16	Mon Dec 28 09:57:14 2020
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Dec 28 09:58:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2020/12/28 09:57:14 rillig Exp $
+# $NetBSD: Makefile,v 1.17 2020/12/28 09:58:56 rillig Exp $
 
 NOMAN=		# defined
 
@@ -19,7 +19,7 @@ FILES+=		d_c99_compound_literal_comma.c
 FILES+=		d_c99_decls_after_stmt.c
 FILES+=		d_c99_decls_after_stmt2.c
 FILES+=		d_c99_decls_after_stmt3.c
-FILES+=		d_c99_flex_array_packed.c 
+FILES+=		d_c99_flex_array_packed.c
 FILES+=		d_c99_for_loops.c
 FILES+=		d_c99_func.c
 FILES+=		d_c99_nested_struct.c
@@ -40,7 +40,9 @@ FILES+=		d_cast_typeof.c
 FILES+=		d_compound_literals1.c
 FILES+=		d_compound_literals2.c
 FILES+=		d_constant_conv1.c
+FILES+=		d_constant_conv1.exp
 FILES+=		d_constant_conv2.c
+FILES+=		d_constant_conv2.exp
 FILES+=		d_cvt_constant.c
 FILES+=		d_cvt_in_ternary.c
 FILES+=		d_ellipsis_in_switch.c
@@ -51,14 +53,19 @@ FILES+=		d_gcc_extension.c
 FILES+=		d_gcc_func.c
 FILES+=		d_gcc_variable_array_init.c
 FILES+=		d_incorrect_array_size.c
+FILES+=		d_incorrect_array_size.exp
 FILES+=		d_long_double_int.c
+FILES+=		d_long_double_int.exp
 FILES+=		d_nested_structs.c
 FILES+=		d_nolimit_init.c
 FILES+=		d_packed_structs.c
 FILES+=		d_shift_to_narrower_type.c
 FILES+=		d_type_conv1.c
+FILES+=		d_type_conv1.exp
 FILES+=		d_type_conv2.c
+FILES+=		d_type_conv2.exp
 FILES+=		d_type_conv3.c
+FILES+=		d_type_conv3.exp
 FILES+=		d_type_question_colon.c
 FILES+=		d_typefun.c
 FILES+=		d_typename_as_var.c

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.5 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.6
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.5	Thu Jun 25 11:12:03 2020
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Mon Dec 28 09:58:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.5 2020/06/25 11:12:03 jruoho Exp $
+# $NetBSD: t_integration.sh,v 1.6 2020/12/28 09:58:56 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,8 +36,11 @@ check_valid()
 
 check_invalid()
 {
-	atf_check -s not-exit:0 -o ignore -e ignore ${LINT1} -g -S -w \
-	"$(atf_get_srcdir)/$1" /dev/null
+	local src="$(atf_get_srcdir)/$1"
+	local exp="${src%.c}.exp"
+
+	atf_check -s not-exit:0 -o "file:${exp}" -e empty \
+	${LINT1} -g -S -w "${src}" /dev/null
 }
 
 test_case()

Added files:

Index: src/tests/usr.bin/xlint/lint1/d_constant_conv1.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_constant_conv1.exp:1.1
--- /dev/null	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/d_constant_conv1.exp	Mon Dec 28 09:58:56 2020
@@ -0,0 +1 @@
+(11): warning: conversion of negative constant to unsigned type, arg #1 [296]
Index: src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.1
--- /dev/null	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp	Mon Dec 28 09:58:56 2020
@@ -0,0 +1 @@
+(11): warning: conversion to 'unsigned int' due to prototype, arg #1 [259]
Index: src/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp:1.1
--- /dev/null	Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/d_incorrect_array_size.exp	Mon Dec 28 09:58:56 2020
@@ -0,0 +1 @@
+(5): negative array dimension (-1) [20]
Index: src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.1
--- /dev/null	Mon Dec 28 09:58:56 2020
+++ 

CVS commit: src/tests/usr.bin/xlint/lint1

2020-12-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 28 09:57:14 UTC 2020

Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile

Log Message:
lint: sort tests by name


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/usr.bin/xlint/lint1/Makefile

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.15 src/tests/usr.bin/xlint/lint1/Makefile:1.16
--- src/tests/usr.bin/xlint/lint1/Makefile:1.15	Mon Mar  6 21:02:47 2017
+++ src/tests/usr.bin/xlint/lint1/Makefile	Mon Dec 28 09:57:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2017/03/06 21:02:47 christos Exp $
+# $NetBSD: Makefile,v 1.16 2020/12/28 09:57:14 rillig Exp $
 
 NOMAN=		# defined
 
@@ -22,9 +22,9 @@ FILES+=		d_c99_decls_after_stmt3.c
 FILES+=		d_c99_flex_array_packed.c 
 FILES+=		d_c99_for_loops.c
 FILES+=		d_c99_func.c
+FILES+=		d_c99_nested_struct.c
 FILES+=		d_c99_recursive_init.c
 FILES+=		d_c99_struct_init.c
-FILES+=		d_c99_nested_struct.c
 FILES+=		d_c99_union_cast.c
 FILES+=		d_c99_union_init1.c
 FILES+=		d_c99_union_init2.c
@@ -41,8 +41,8 @@ FILES+=		d_compound_literals1.c
 FILES+=		d_compound_literals2.c
 FILES+=		d_constant_conv1.c
 FILES+=		d_constant_conv2.c
-FILES+=		d_cvt_in_ternary.c
 FILES+=		d_cvt_constant.c
+FILES+=		d_cvt_in_ternary.c
 FILES+=		d_ellipsis_in_switch.c
 FILES+=		d_gcc_compound_statements1.c
 FILES+=		d_gcc_compound_statements2.c
@@ -60,8 +60,8 @@ FILES+=		d_type_conv1.c
 FILES+=		d_type_conv2.c
 FILES+=		d_type_conv3.c
 FILES+=		d_type_question_colon.c
-FILES+=		d_typename_as_var.c
 FILES+=		d_typefun.c
+FILES+=		d_typename_as_var.c
 FILES+=		d_zero_sized_arrays.c
 
 .include