CVS commit: src/external/mpl/bind/include

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 18:44:50 UTC 2019

Modified Files:
src/external/mpl/bind/include: config.h

Log Message:
Enable stdatomic.h in all except lint (thanks joerg@)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/bind/include/config.h

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



CVS commit: src/external/mpl/bind/include

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 18:44:50 UTC 2019

Modified Files:
src/external/mpl/bind/include: config.h

Log Message:
Enable stdatomic.h in all except lint (thanks joerg@)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/bind/include/config.h

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

Modified files:

Index: src/external/mpl/bind/include/config.h
diff -u src/external/mpl/bind/include/config.h:1.3 src/external/mpl/bind/include/config.h:1.4
--- src/external/mpl/bind/include/config.h:1.3	Wed Jan  9 11:55:22 2019
+++ src/external/mpl/bind/include/config.h	Thu Jan 17 13:44:50 2019
@@ -373,7 +373,9 @@
 /* #undef HAVE_STAT_NSEC */
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_STDATOMIC_H */
+#ifndef __lint__
+#define HAVE_STDATOMIC_H 1
+#endif
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_STDINT_H 1



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

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:23:03 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: makphy.c makphyreg.h miidevs

Log Message:
Pull up the following (requested by msaitoh in ticket #1164):

sys/dev/mii/miidevs 1.128, 1.132 (patch)
sys/dev/mii/makphy.c1.43-1.51
sys/dev/mii/makphyreg.h 1.7-1.9

- miidevs: Add E1000 with model id 0x0006, it exists according to
  OpenBSD rename E1000 model 0x to E1000_0 for consistency.
- Match 88E1112, 88E1118, 88E1512, 88E3082 and G65G.
- Match 88E3016 and add some 88E3016 specific code. Fixes part of
  PR kern/49270 and PR kern/53301.
- Make sure page 0 is selected when we initialize the PHY. Fixes
  problems with the eephy(4) that attaches to nfe(4) on machines like
  the Sun Ultra 40. (we had condition for this, now the page 0 is
  selected for any PHY type)
- If autonegotiation is not enabled, we need a software reset for the
  settings to take effect in makphy_service().
- Don't set PSCR_CRS_ON_TX on newer. Those chips have no this bit.
- Control BMCR_PDOWN for IFM_NONE. Some chips still don't work as
  expected. It would be required to modify PSCR and/or other register.
- Set mii_media_active correctly on non-autonego mode.
- Remove obsolete comment.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.6 -r1.6.20.1 src/sys/dev/mii/makphyreg.h
cvs rdiff -u -r1.125.6.3 -r1.125.6.4 src/sys/dev/mii/miidevs

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/mii/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.42 src/sys/dev/mii/makphy.c:1.42.8.1
--- src/sys/dev/mii/makphy.c:1.42	Tue Nov  8 08:48:35 2016
+++ src/sys/dev/mii/makphy.c	Thu Jan 17 17:23:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.42 2016/11/08 08:48:35 msaitoh Exp $	*/
+/*	$NetBSD: makphy.c,v 1.42.8.1 2019/01/17 17:23:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.42 2016/11/08 08:48:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.42.8.1 2019/01/17 17:23:02 martin Exp $");
 
 #include 
 #include 
@@ -92,44 +92,79 @@ static const struct mii_phy_funcs makphy
 };
 
 static const struct mii_phydesc makphys[] = {
+	{ MII_OUI_MARVELL,		MII_MODEL_MARVELL_E1000_0,
+	  MII_STR_MARVELL_E1000_0 },
+
+	{ MII_OUI_MARVELL,		MII_MODEL_MARVELL_E1000_3,
+	  MII_STR_MARVELL_E1000_3 },
+
+	{ MII_OUI_MARVELL,		MII_MODEL_MARVELL_E1000_5,
+	  MII_STR_MARVELL_E1000_5 },
+
+	{ MII_OUI_MARVELL,		MII_MODEL_MARVELL_E1000_6,
+	  MII_STR_MARVELL_E1000_6 },
+
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1000_3,
 	  MII_STR_xxMARVELL_E1000_3 },
 
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1000_5,
 	  MII_STR_xxMARVELL_E1000_5 },
 
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1000S,
+	  MII_STR_xxMARVELL_E1000S },
+
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1011,
 	  MII_STR_xxMARVELL_E1011 },
 
-	/* XXX: reported not to work on eg. HP XW9400 */
-	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1149,
-	  MII_STR_xxMARVELL_E1149 },
-
-	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1149R,
-	  MII_STR_xxMARVELL_E1149R },
-
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E,
 	  MII_STR_xxMARVELL_E },
 
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1112,
+	  MII_STR_xxMARVELL_E1112 },
+
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1116,
 	  MII_STR_xxMARVELL_E1116 },
 
-	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1145,
-	  MII_STR_xxMARVELL_E1145 },
-
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1116R,
 	  MII_STR_xxMARVELL_E1116R },
 
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1116R_29,
 	  MII_STR_xxMARVELL_E1116R_29 },
 
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1118,
+	  MII_STR_xxMARVELL_E1118 },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1145,
+	  MII_STR_xxMARVELL_E1145 },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1149,
+	  MII_STR_xxMARVELL_E1149 },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1149R,
+	  MII_STR_xxMARVELL_E1149R },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1512,
+	  MII_STR_xxMARVELL_E1512 },
+
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1543,
 	  MII_STR_xxMARVELL_E1543 },
 
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E3016,
+	  MII_STR_xxMARVELL_E3016 },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E3082,
+	  MII_STR_xxMARVELL_E3082 },
+
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_PHYG65G,
+	  MII_STR_xxMARVELL_PHYG65G },
+
 	{ 0,0,
 	  NULL },
 };
 
+#define MAKARG_PDOWN	true	/* Power DOWN */
+#define MAKARG_PUP	false	/* Power UP */
+
 static int
 makphymatch(device_t parent, cfdata_t match, void *aux)
 {
@@ -164,26 +199,14 @@ makphyattach(device_t parent, device_t s
 	sc->mii_flags = ma->mii_flags;
 	sc->mii_anegticks = MII_ANEGTICKS;
 
+	/* Make 

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

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:23:03 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: makphy.c makphyreg.h miidevs

Log Message:
Pull up the following (requested by msaitoh in ticket #1164):

sys/dev/mii/miidevs 1.128, 1.132 (patch)
sys/dev/mii/makphy.c1.43-1.51
sys/dev/mii/makphyreg.h 1.7-1.9

- miidevs: Add E1000 with model id 0x0006, it exists according to
  OpenBSD rename E1000 model 0x to E1000_0 for consistency.
- Match 88E1112, 88E1118, 88E1512, 88E3082 and G65G.
- Match 88E3016 and add some 88E3016 specific code. Fixes part of
  PR kern/49270 and PR kern/53301.
- Make sure page 0 is selected when we initialize the PHY. Fixes
  problems with the eephy(4) that attaches to nfe(4) on machines like
  the Sun Ultra 40. (we had condition for this, now the page 0 is
  selected for any PHY type)
- If autonegotiation is not enabled, we need a software reset for the
  settings to take effect in makphy_service().
- Don't set PSCR_CRS_ON_TX on newer. Those chips have no this bit.
- Control BMCR_PDOWN for IFM_NONE. Some chips still don't work as
  expected. It would be required to modify PSCR and/or other register.
- Set mii_media_active correctly on non-autonego mode.
- Remove obsolete comment.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.6 -r1.6.20.1 src/sys/dev/mii/makphyreg.h
cvs rdiff -u -r1.125.6.3 -r1.125.6.4 src/sys/dev/mii/miidevs

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



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

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:23:36 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs.h miidevs_data.h

Log Message:
regen (ticket #1164)


To generate a diff of this commit:
cvs rdiff -u -r1.128.6.3 -r1.128.6.4 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.116.6.3 -r1.116.6.4 src/sys/dev/mii/miidevs_data.h

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



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

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:23:36 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs.h miidevs_data.h

Log Message:
regen (ticket #1164)


To generate a diff of this commit:
cvs rdiff -u -r1.128.6.3 -r1.128.6.4 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.116.6.3 -r1.116.6.4 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.128.6.3 src/sys/dev/mii/miidevs.h:1.128.6.4
--- src/sys/dev/mii/miidevs.h:1.128.6.3	Tue Dec  4 11:16:33 2018
+++ src/sys/dev/mii/miidevs.h	Thu Jan 17 17:23:36 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.128.6.3 2018/12/04 11:16:33 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.128.6.4 2019/01/17 17:23:36 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.125.6.3 2018/12/04 11:15:20 martin Exp
+ *	NetBSD: miidevs,v 1.125.6.4 2019/01/17 17:23:02 martin Exp
  */
 
 /*-
@@ -423,15 +423,17 @@
 #define	MII_MODEL_xxMARVELL_E1116R_29	0x0029
 #define	MII_STR_xxMARVELL_E1116R_29	"Marvell 88E1116R Gigabit PHY"
 #define	MII_MODEL_xxMARVELL_E1543	0x002a
-#define	MII_STR_xxMARVELL_E1543	"Marvell 88E1543 Alaska Quad Port Gb PHY"
-#define	MII_MODEL_MARVELL_E1000	0x
-#define	MII_STR_MARVELL_E1000	"Marvell 88E1000 Gigabit PHY"
+#define	MII_STR_xxMARVELL_E1543	"Marvell 88E154[358] Alaska Quad Port Gb PHY"
+#define	MII_MODEL_MARVELL_E1000_0	0x
+#define	MII_STR_MARVELL_E1000_0	"Marvell 88E1000 Gigabit PHY"
 #define	MII_MODEL_MARVELL_E1011	0x0002
 #define	MII_STR_MARVELL_E1011	"Marvell 88E1011 Gigabit PHY"
 #define	MII_MODEL_MARVELL_E1000_3	0x0003
 #define	MII_STR_MARVELL_E1000_3	"Marvell 88E1000 Gigabit PHY"
 #define	MII_MODEL_MARVELL_E1000_5	0x0005
 #define	MII_STR_MARVELL_E1000_5	"Marvell 88E1000 Gigabit PHY"
+#define	MII_MODEL_MARVELL_E1000_6	0x0006
+#define	MII_STR_MARVELL_E1000_6	"Marvell 88E1000 Gigabit PHY"
 #define	MII_MODEL_MARVELL_E	0x000c
 #define	MII_STR_MARVELL_E	"Marvell 88E Gigabit PHY"
 

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.116.6.3 src/sys/dev/mii/miidevs_data.h:1.116.6.4
--- src/sys/dev/mii/miidevs_data.h:1.116.6.3	Tue Dec  4 11:16:33 2018
+++ src/sys/dev/mii/miidevs_data.h	Thu Jan 17 17:23:36 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.116.6.3 2018/12/04 11:16:33 martin Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.116.6.4 2019/01/17 17:23:36 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.125.6.3 2018/12/04 11:15:20 martin Exp
+ *	NetBSD: miidevs,v 1.125.6.4 2019/01/17 17:23:02 martin Exp
  */
 
 /*-
@@ -171,10 +171,11 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_PHYG65G, MII_STR_xxMARVELL_PHYG65G },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1116R_29, MII_STR_xxMARVELL_E1116R_29 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1543, MII_STR_xxMARVELL_E1543 },
- { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000, MII_STR_MARVELL_E1000 },
+ { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_0, MII_STR_MARVELL_E1000_0 },
  { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1011, MII_STR_MARVELL_E1011 },
  { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_3, MII_STR_MARVELL_E1000_3 },
  { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_5, MII_STR_MARVELL_E1000_5 },
+ { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_6, MII_STR_MARVELL_E1000_6 },
  { MII_OUI_MARVELL, MII_MODEL_MARVELL_E, MII_STR_MARVELL_E },
  { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9021RNI, MII_STR_MICREL_KSZ9021RNI },
  { MII_OUI_xxMYSON, MII_MODEL_xxMYSON_MTD972, MII_STR_xxMYSON_MTD972 },



CVS commit: [netbsd-8] src/doc

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:25:53 UTC 2019

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

Log Message:
Ticket #1164


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.89 -r1.1.2.90 src/doc/CHANGES-8.1

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.1
diff -u src/doc/CHANGES-8.1:1.1.2.89 src/doc/CHANGES-8.1:1.1.2.90
--- src/doc/CHANGES-8.1:1.1.2.89	Tue Jan 15 18:41:22 2019
+++ src/doc/CHANGES-8.1	Thu Jan 17 17:25:53 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.89 2019/01/15 18:41:22 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.90 2019/01/17 17:25:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2233,3 +2233,28 @@ sys/arch/sparc/sparc/pmap.c			1.366
 	Fix deadlocks on machines with more than two cpus.
 	[mrg, ticket #1163]
 
+sys/dev/mii/miidevs			1.128, 1.132 (patch)
+sys/dev/mii/miidevs.h			regen
+sys/dev/mii/miidevs_data.h		regen
+sys/dev/mii/makphy.c			1.43-1.51 (patch)
+sys/dev/mii/makphyreg.h			1.7-1.9 (patch)
+
+	- miidevs: Add E1000 with model id 0x0006, it exists according to
+	  OpenBSD rename E1000 model 0x to E1000_0 for consistency.
+	- Match 88E1112, 88E1118, 88E1512, 88E3082 and G65G.
+	- Match 88E3016 and add some 88E3016 specific code. Fixes part of
+	  PR kern/49270 and PR kern/53301.
+	- Make sure page 0 is selected when we initialize the PHY. Fixes
+	  problems with the eephy(4) that attaches to nfe(4) on machines like
+	  the Sun Ultra 40. (we had condition for this, now the page 0 is
+	  selected for any PHY type)
+	- If autonegotiation is not enabled, we need a software reset for the
+	  settings to take effect in makphy_service().
+	- Don't set PSCR_CRS_ON_TX on newer. Those chips have no this bit.
+	- Control BMCR_PDOWN for IFM_NONE. Some chips still don't work as
+	  expected. It would be required to modify PSCR and/or other register.
+	- Set mii_media_active correctly on non-autonego mode.
+	- Remove obsolete comment.
+	- Whitespace fix.
+	[msaitoh, ticket #1164]
+



CVS commit: [netbsd-8] src/doc

2019-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 17 17:25:53 UTC 2019

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

Log Message:
Ticket #1164


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.89 -r1.1.2.90 src/doc/CHANGES-8.1

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



CVS commit: src/usr.sbin/btpand

2019-01-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jan 17 08:53:18 UTC 2019

Modified Files:
src/usr.sbin/btpand: btpand.8

Log Message:
Add missing width argument to Bl. Remove Pp before It.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/btpand.8

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



CVS commit: src/usr.sbin/btpand

2019-01-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jan 17 08:53:18 UTC 2019

Modified Files:
src/usr.sbin/btpand: btpand.8

Log Message:
Add missing width argument to Bl. Remove Pp before It.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btpand/btpand.8

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

Modified files:

Index: src/usr.sbin/btpand/btpand.8
diff -u src/usr.sbin/btpand/btpand.8:1.7 src/usr.sbin/btpand/btpand.8:1.8
--- src/usr.sbin/btpand/btpand.8:1.7	Thu Jan 17 05:52:21 2019
+++ src/usr.sbin/btpand/btpand.8	Thu Jan 17 08:53:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: btpand.8,v 1.7 2019/01/17 05:52:21 gutteridge Exp $
+.\" $NetBSD: btpand.8,v 1.8 2019/01/17 08:53:17 wiz Exp $
 .\"
 .\" Copyright (c) 2008 Iain Hibbert
 .\" All rights reserved.
@@ -128,7 +128,7 @@ and 1 for a PANU server.
 Set L2CAP connection link mode.
 Supported modes are:
 .Pp
-.Bl -tag -compact
+.Bl -tag -compact -width secure
 .It auth
 require devices to be paired.
 .It encrypt
@@ -148,7 +148,7 @@ Name of
 .Ar service
 to provide or connect to, the following services are recognised:
 .Pp
-.Bl -tag -compact
+.Bl -tag -compact -width PANU
 .It GN
 Group ad-hoc Network.
 .It NAP
@@ -156,7 +156,6 @@ Network Access Point.
 .It PANU
 Personal Area Networking User.
 .El
-.Pp
 .It Fl S Ar service
 As per
 .Fl s
@@ -179,7 +178,7 @@ has set up the client or server connecti
 .Xr tap 4
 interface, it will create a pid file and detach.
 .Sh FILES
-.Bl -tag -compact
+.Bl -tag -compact -width /etc/bluetooth/hosts
 .It Pa /dev/tap
 .It Pa /etc/bluetooth/hosts
 .It Pa /var/run/sdp



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:36:51 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc
diff -u src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.4 src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.5
--- src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc:1.4	Wed Aug  1 20:03:18 2018
+++ src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc	Thu Jan 17 15:36:51 2019
@@ -9,6 +9,10 @@
 //
 // Thread-related code.
 //===--===//
+
+#define __EXPOSE_STACK
+#include 
+
 #include "asan_allocator.h"
 #include "asan_interceptors.h"
 #include "asan_poisoning.h"
@@ -221,7 +225,10 @@ bool AsanThread::GetStackFrameAccessByAd
 access->frame_descr = (const char *)((uptr*)bottom)[1];
 return true;
   }
-  uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1);  // align addr.
+#ifndef STACK_ALIGNBYTES
+# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+#endif
+  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 



CVS commit: src/external/gpl3/gcc.old/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:36:51 UTC 2019

Modified Files:
src/external/gpl3/gcc.old/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:37:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.1.1.3 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.1.1.3	Thu Feb  1 20:58:47 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc	Thu Jan 17 15:37:20 2019
@@ -9,6 +9,10 @@
 //
 // Thread-related code.
 //===--===//
+
+#define __EXPOSE_STACK
+#include 
+
 #include "asan_allocator.h"
 #include "asan_interceptors.h"
 #include "asan_poisoning.h"
@@ -221,7 +225,10 @@ bool AsanThread::GetStackFrameAccessByAd
 access->frame_descr = (const char *)((uptr*)bottom)[1];
 return true;
   }
-  uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1);  // align addr.
+#ifndef STACK_ALIGNBYTES
+# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+#endif
+  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2019-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 17 20:37:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc

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



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

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 17 21:32:42 UTC 2019

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

Log Message:
The return value of a hook is not necessarily an error code, so
rename the variable appropriately.

NFCI


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

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



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

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 17 21:32:42 UTC 2019

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

Log Message:
The return value of a hook is not necessarily an error code, so
rename the variable appropriately.

NFCI


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

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

Modified files:

Index: src/sys/sys/module_hook.h
diff -u src/sys/sys/module_hook.h:1.1.2.10 src/sys/sys/module_hook.h:1.1.2.11
--- src/sys/sys/module_hook.h:1.1.2.10	Mon Jan 14 13:34:28 2019
+++ src/sys/sys/module_hook.h	Thu Jan 17 21:32:42 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: module_hook.h,v 1.1.2.10 2019/01/14 13:34:28 pgoyette Exp $	*/
+/* $NetBSD: module_hook.h,v 1.1.2.11 2019/01/17 21:32:42 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@ int\
 hook ## _call decl		\
 {\
 	bool __hooked;		\
-	int __hook_error, __hook_s;\
+	int __hook_retval, __hook_s;\
 \
 	__hook_s = pserialize_read_enter();			\
 	__hooked = hook.hooked;	\
@@ -128,13 +128,13 @@ hook ## _call decl		\
 	pserialize_read_exit(__hook_s);\
 \
 	if (__hooked) {		\
-		__hook_error = (*hook.f)args;			\
+		__hook_retval = (*hook.f)args;			\
 		localcount_release(, ,		\
 		);	\
 	} else {		\
-		__hook_error = default;\
+		__hook_retval = default;			\
 	}			\
-	return __hook_error;	\
+	return __hook_retval;	\
 }
 
 #define MODULE_CALL_VOID_HOOK(hook, decl, args, default)	\



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

2019-01-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 17 19:26:03 UTC 2019

Modified Files:
src/sys/arch/amd64/include: vmparam.h

Log Message:
Increase VM_PHYSSEG_MAX from 32 to 64. Saw an example on tech-kern@ of a
heavily fragmented memory map.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amd64/include/vmparam.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/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.49 src/sys/arch/amd64/include/vmparam.h:1.50
--- src/sys/arch/amd64/include/vmparam.h:1.49	Mon Oct 29 19:43:16 2018
+++ src/sys/arch/amd64/include/vmparam.h	Thu Jan 17 19:26:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.49 2018/10/29 19:43:16 maya Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.50 2019/01/17 19:26:03 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -159,7 +159,7 @@ extern vaddr_t vm_max_kernel_address;
 /* virtual sizes (bytes) for various kernel submaps */
 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
 
-#define VM_PHYSSEG_MAX		32	/* 1 "hole" + 31 free lists */
+#define VM_PHYSSEG_MAX		64	/* 1 "hole" + 63 free lists */
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BIGFIRST
 
 #define	VM_NFREELIST		6



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

2019-01-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 17 19:26:03 UTC 2019

Modified Files:
src/sys/arch/amd64/include: vmparam.h

Log Message:
Increase VM_PHYSSEG_MAX from 32 to 64. Saw an example on tech-kern@ of a
heavily fragmented memory map.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/amd64/include/vmparam.h

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



CVS commit: src/sys/modules/examples

2019-01-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jan 17 20:47:42 UTC 2019

Modified Files:
src/sys/modules/examples: Makefile README
Added Files:
src/sys/modules/examples/mapper: Makefile cmd_mapper.c mapper.c

Log Message:
Add a new example kernel module: mapper

Basic implementation of mmap.

Submitted by Akul Pillai.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/examples/Makefile
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/mapper/Makefile \
src/sys/modules/examples/mapper/cmd_mapper.c \
src/sys/modules/examples/mapper/mapper.c

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

Modified files:

Index: src/sys/modules/examples/Makefile
diff -u src/sys/modules/examples/Makefile:1.6 src/sys/modules/examples/Makefile:1.7
--- src/sys/modules/examples/Makefile:1.6	Tue May 29 16:53:56 2018
+++ src/sys/modules/examples/Makefile	Thu Jan 17 20:47:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2018/05/29 16:53:56 kamil Exp $
+#	$NetBSD: Makefile,v 1.7 2019/01/17 20:47:42 kamil Exp $
 
 .include 
 
@@ -6,6 +6,7 @@ SUBDIR+=	executor
 SUBDIR+=	hello
 #SUBDIR+=	luahello		# Nothing to build here, only text files
 SUBDIR+=	luareadhappy		# Needs an additional Lua script
+SUBDIR+=	mapper			# Needs an additional helper program
 SUBDIR+=	panic_string		# Crashes the system
 SUBDIR+=	ping			# Needs an additional helper program
 SUBDIR+=	properties

Index: src/sys/modules/examples/README
diff -u src/sys/modules/examples/README:1.8 src/sys/modules/examples/README:1.9
--- src/sys/modules/examples/README:1.8	Tue May 29 16:53:56 2018
+++ src/sys/modules/examples/README	Thu Jan 17 20:47:42 2019
@@ -1,4 +1,4 @@
-	$NetBSD: README,v 1.8 2018/05/29 16:53:56 kamil Exp $
+	$NetBSD: README,v 1.9 2019/01/17 20:47:42 kamil Exp $
 
Kernel Developer's Manual
 
@@ -10,6 +10,7 @@ DESCRIPTION
  * hello   - the simplest `hello world' module
  * luahello- the simplest `hello world' Lua module
  * luareadhappy- demonstrates calling Lua code from C
+ * mapper  - basic implementation of mmap
  * panic_string- shows how panic is being called through a device
  * ping- basic ioctl(9)
  * properties  - handle incoming properties during the module load
@@ -66,5 +67,8 @@ HISTORY
  The panic_string module first appeared in NetBSD 9.0 and was authored by
  Harry Pantazis.
 
+ The mapper module first appeared in NetBSD 9.0 and was authored by
+ Akul Pillai.
+
 AUTHORS
  This document was written by Kamil Rytarowski.

Added files:

Index: src/sys/modules/examples/mapper/Makefile
diff -u /dev/null src/sys/modules/examples/mapper/Makefile:1.1
--- /dev/null	Thu Jan 17 20:47:42 2019
+++ src/sys/modules/examples/mapper/Makefile	Thu Jan 17 20:47:42 2019
@@ -0,0 +1,17 @@
+#	$NetBSD: Makefile,v 1.1 2019/01/17 20:47:42 kamil Exp $
+
+.include "../Makefile.inc"
+
+#S?=	/usr/src/sys
+
+KMOD=	mapper
+SRCS=	mapper.c
+
+.include 
+
+# To make use of this module, you'll need to separately build the
+# cmd_mapper program, with a Makefile similar to
+#
+#	MKMAN=	NO
+#	PROG=	cmd_mapper
+#	.include 
Index: src/sys/modules/examples/mapper/cmd_mapper.c
diff -u /dev/null src/sys/modules/examples/mapper/cmd_mapper.c:1.1
--- /dev/null	Thu Jan 17 20:47:42 2019
+++ src/sys/modules/examples/mapper/cmd_mapper.c	Thu Jan 17 20:47:42 2019
@@ -0,0 +1,64 @@
+/*	$NetBSD: cmd_mapper.c,v 1.1 2019/01/17 20:47:42 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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
+ 

CVS commit: src/sys/modules/examples

2019-01-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jan 17 20:47:42 UTC 2019

Modified Files:
src/sys/modules/examples: Makefile README
Added Files:
src/sys/modules/examples/mapper: Makefile cmd_mapper.c mapper.c

Log Message:
Add a new example kernel module: mapper

Basic implementation of mmap.

Submitted by Akul Pillai.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/examples/Makefile
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/mapper/Makefile \
src/sys/modules/examples/mapper/cmd_mapper.c \
src/sys/modules/examples/mapper/mapper.c

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



CVS commit: [pgoyette-compat] src/sys

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 00:01:02 UTC 2019

Modified Files:
src/sys/arch/sparc/fpu [pgoyette-compat]: fpu.c
src/sys/compat/common [pgoyette-compat]: if_43.c uipc_usrreq_70.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_module.c
src/sys/compat/sys [pgoyette-compat]: socket.h
src/sys/dev [pgoyette-compat]: bio.c ccd.c clockctl.c vnd.c
src/sys/dev/raidframe [pgoyette-compat]: rf_netbsdkintf.c
src/sys/dev/usb [pgoyette-compat]: ugen.c uhid.c usb.c
src/sys/dev/wscons [pgoyette-compat]: wsevent.c
src/sys/fs/puffs [pgoyette-compat]: puffs_msgif.c
src/sys/kern [pgoyette-compat]: kern_proc.c kern_rndq.c sys_module.c
sysv_ipc.c tty.c tty_ptm.c uipc_usrreq.c vfs_syscalls.c
src/sys/net [pgoyette-compat]: if.c if_spppsubr.c rtsock.c
rtsock_shared.c
src/sys/net80211 [pgoyette-compat]: ieee80211_ioctl.c
src/sys/opencrypto [pgoyette-compat]: cryptodev.c
src/sys/sys [pgoyette-compat]: compat_stub.h module_hook.h

Log Message:
Don't restrict hooks to having only int or void types.  Pass the hook's
type to the various macros, as needed.

Allows us to reduce diffs to original in at least one or two places (we
no longer have to provide an additional parameter to the hook routine
for returning a non-int return value).


To generate a diff of this commit:
cvs rdiff -u -r1.27.46.3 -r1.27.46.4 src/sys/arch/sparc/fpu/fpu.c
cvs rdiff -u -r1.14.2.12 -r1.14.2.13 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.1.20.4 -r1.1.20.5 src/sys/compat/common/uipc_usrreq_70.c
cvs rdiff -u -r1.6.2.11 -r1.6.2.12 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 src/sys/compat/sys/socket.h
cvs rdiff -u -r1.13.16.7 -r1.13.16.8 src/sys/dev/bio.c
cvs rdiff -u -r1.175.2.10 -r1.175.2.11 src/sys/dev/ccd.c
cvs rdiff -u -r1.35.14.10 -r1.35.14.11 src/sys/dev/clockctl.c
cvs rdiff -u -r1.263.2.12 -r1.263.2.13 src/sys/dev/vnd.c
cvs rdiff -u -r1.356.2.8 -r1.356.2.9 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.139.2.8 -r1.139.2.9 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.101.2.7 -r1.101.2.8 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.168.2.9 -r1.168.2.10 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.37.2.8 -r1.37.2.9 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.101.10.8 -r1.101.10.9 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.209.2.12 -r1.209.2.13 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.89.16.6 -r1.89.16.7 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.23.2.15 -r1.23.2.16 src/sys/kern/sys_module.c
cvs rdiff -u -r1.32.16.8 -r1.32.16.9 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.275.2.7 -r1.275.2.8 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.4 -r1.37.16.5 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.8 -r1.183.2.9 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.518.2.4 -r1.518.2.5 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.419.2.20 -r1.419.2.21 src/sys/net/if.c
cvs rdiff -u -r1.179.2.9 -r1.179.2.10 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.238.2.22 -r1.238.2.23 src/sys/net/rtsock.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/net/rtsock_shared.c
cvs rdiff -u -r1.60.16.6 -r1.60.16.7 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.98.2.9 -r1.98.2.10 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/sys/module_hook.h

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

Modified files:

Index: src/sys/arch/sparc/fpu/fpu.c
diff -u src/sys/arch/sparc/fpu/fpu.c:1.27.46.3 src/sys/arch/sparc/fpu/fpu.c:1.27.46.4
--- src/sys/arch/sparc/fpu/fpu.c:1.27.46.3	Mon Jan 14 13:34:26 2019
+++ src/sys/arch/sparc/fpu/fpu.c	Fri Jan 18 00:01:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.27.46.3 2019/01/14 13:34:26 pgoyette Exp $ */
+/*	$NetBSD: fpu.c,v 1.27.46.4 2019/01/18 00:01:00 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.27.46.3 2019/01/14 13:34:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.27.46.4 2019/01/18 00:01:00 pgoyette Exp $");
 
 #include 
 #include 
@@ -122,8 +122,8 @@ static u_char fpu_codes_sunos[] = {
 /*
  * HOOK for checking if the lwp's emul matches sunos
  */
-MODULE_CALL_INT_HOOK_DECL(get_emul_sunos_hook, (const struct emul **emul));
-MODULE_CALL_INT_HOOK(get_emul_sunos_hook, (const struct emul ** emul), (emul),
+MODULE_CALL_HOOK_DECL(get_emul_sunos_hook, int, (const struct emul **emul));
+MODULE_CALL_HOOK(get_emul_sunos_hook, int, (const struct emul ** emul), (emul),
 enosys());
 
 /*

Index: src/sys/compat/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.14.2.12 src/sys/compat/common/if_43.c:1.14.2.13
--- src/sys/compat/common/if_43.c:1.14.2.12	Mon Jan 14 13:34:27 2019
+++ src/sys/compat/common/if_43.c	Fri Jan 18 00:01:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.14.2.12 2019/01/14 13:34:27 pgoyette Exp 

CVS commit: [pgoyette-compat] src/sys

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 00:01:02 UTC 2019

Modified Files:
src/sys/arch/sparc/fpu [pgoyette-compat]: fpu.c
src/sys/compat/common [pgoyette-compat]: if_43.c uipc_usrreq_70.c
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_module.c
src/sys/compat/sys [pgoyette-compat]: socket.h
src/sys/dev [pgoyette-compat]: bio.c ccd.c clockctl.c vnd.c
src/sys/dev/raidframe [pgoyette-compat]: rf_netbsdkintf.c
src/sys/dev/usb [pgoyette-compat]: ugen.c uhid.c usb.c
src/sys/dev/wscons [pgoyette-compat]: wsevent.c
src/sys/fs/puffs [pgoyette-compat]: puffs_msgif.c
src/sys/kern [pgoyette-compat]: kern_proc.c kern_rndq.c sys_module.c
sysv_ipc.c tty.c tty_ptm.c uipc_usrreq.c vfs_syscalls.c
src/sys/net [pgoyette-compat]: if.c if_spppsubr.c rtsock.c
rtsock_shared.c
src/sys/net80211 [pgoyette-compat]: ieee80211_ioctl.c
src/sys/opencrypto [pgoyette-compat]: cryptodev.c
src/sys/sys [pgoyette-compat]: compat_stub.h module_hook.h

Log Message:
Don't restrict hooks to having only int or void types.  Pass the hook's
type to the various macros, as needed.

Allows us to reduce diffs to original in at least one or two places (we
no longer have to provide an additional parameter to the hook routine
for returning a non-int return value).


To generate a diff of this commit:
cvs rdiff -u -r1.27.46.3 -r1.27.46.4 src/sys/arch/sparc/fpu/fpu.c
cvs rdiff -u -r1.14.2.12 -r1.14.2.13 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.1.20.4 -r1.1.20.5 src/sys/compat/common/uipc_usrreq_70.c
cvs rdiff -u -r1.6.2.11 -r1.6.2.12 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 src/sys/compat/sys/socket.h
cvs rdiff -u -r1.13.16.7 -r1.13.16.8 src/sys/dev/bio.c
cvs rdiff -u -r1.175.2.10 -r1.175.2.11 src/sys/dev/ccd.c
cvs rdiff -u -r1.35.14.10 -r1.35.14.11 src/sys/dev/clockctl.c
cvs rdiff -u -r1.263.2.12 -r1.263.2.13 src/sys/dev/vnd.c
cvs rdiff -u -r1.356.2.8 -r1.356.2.9 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.139.2.8 -r1.139.2.9 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.101.2.7 -r1.101.2.8 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.168.2.9 -r1.168.2.10 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.37.2.8 -r1.37.2.9 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.101.10.8 -r1.101.10.9 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.209.2.12 -r1.209.2.13 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.89.16.6 -r1.89.16.7 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.23.2.15 -r1.23.2.16 src/sys/kern/sys_module.c
cvs rdiff -u -r1.32.16.8 -r1.32.16.9 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.275.2.7 -r1.275.2.8 src/sys/kern/tty.c
cvs rdiff -u -r1.37.16.4 -r1.37.16.5 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.183.2.8 -r1.183.2.9 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.518.2.4 -r1.518.2.5 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.419.2.20 -r1.419.2.21 src/sys/net/if.c
cvs rdiff -u -r1.179.2.9 -r1.179.2.10 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.238.2.22 -r1.238.2.23 src/sys/net/rtsock.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/net/rtsock_shared.c
cvs rdiff -u -r1.60.16.6 -r1.60.16.7 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.98.2.9 -r1.98.2.10 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/sys/module_hook.h

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



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

2019-01-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 17 23:05:15 UTC 2019

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
don't crash when we're not the console


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sparc/dev/cgfourteen.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/sparc/dev/cgfourteen.c
diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.86 src/sys/arch/sparc/dev/cgfourteen.c:1.87
--- src/sys/arch/sparc/dev/cgfourteen.c:1.86	Mon Sep  3 16:29:27 2018
+++ src/sys/arch/sparc/dev/cgfourteen.c	Thu Jan 17 23:05:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.86 2018/09/03 16:29:27 riastradh Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.87 2019/01/17 23:05:15 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -284,7 +284,7 @@ cgfourteenattach(device_t parent, device
 	if (sbus_bus_map(sa->sa_bustag, sa->sa_slot,
 			 sa->sa_offset,
 			 sa->sa_size,
-			 0 /*BUS_SPACE_MAP_LINEAR*/,
+			 BUS_SPACE_MAP_LINEAR,
 			 ) != 0) {
 		printf("%s: cannot map control registers\n",
 		device_xname(self));
@@ -744,7 +744,7 @@ cg14_setup_wsdisplay(struct cgfourteen_s
 	sc->sc_gc.gc_blitcookie = sc;
 	sc->sc_gc.gc_rectfill = cg14_rectfill_a;
 	sc->sc_gc.gc_rop = 0xc;
-	if (is_cons) {
+
 		vcons_init_screen(>sc_vd, >sc_console_screen, 1,
 		);
 
@@ -770,21 +770,10 @@ cg14_setup_wsdisplay(struct cgfourteen_s
 			ri->ri_font->fontwidth,
 			ri->ri_font->fontheight,
 			defattr);
+	if (is_cons) {
 		wsdisplay_cnattach(>sc_defaultscreen_descr, ri, 0, 0,
 		defattr);
 		vcons_replay_msgbuf(>sc_console_screen);
-	} else {
-		/*
-		 * since we're not the console we can postpone the rest
-		 * until someone actually allocates a screen for us
-		 */
-		glyphcache_init(>sc_gc, sc->sc_fb.fb_type.fb_height + 5,
-			(sc->sc_vramsize / sc->sc_fb.fb_type.fb_width) -
-			 sc->sc_fb.fb_type.fb_height - 5,
-			sc->sc_fb.fb_type.fb_width,
-			ri->ri_font->fontwidth,
-			ri->ri_font->fontheight,
-			DEFATTR);
 	}
 
 	cg14_init_cmap(sc);



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

2019-01-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 17 23:05:15 UTC 2019

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
don't crash when we're not the console


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sparc/dev/cgfourteen.c

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



CVS commit: src/sys/dev/pci

2019-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Jan 17 10:20:01 UTC 2019

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

Log Message:
Use cv_broadcast() on "sc_sync_wait" to prevent deadlock
when more than one thread try to "DIOCCACHESYNC" at the
same time.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ld_virtio.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/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.26 src/sys/dev/pci/ld_virtio.c:1.27
--- src/sys/dev/pci/ld_virtio.c:1.26	Fri Nov 23 18:08:11 2018
+++ src/sys/dev/pci/ld_virtio.c	Thu Jan 17 10:20:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.26 2018/11/23 18:08:11 jmcneill Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.27 2019/01/17 10:20:01 hannken Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.26 2018/11/23 18:08:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.27 2019/01/17 10:20:01 hannken Exp $");
 
 #include 
 #include 
@@ -465,7 +465,7 @@ ld_virtio_vq_done1(struct ld_virtio_soft
 		mutex_enter(>sc_sync_wait_lock);
 		sc->sc_sync_status = vr->vr_status;
 		sc->sc_sync_use = SYNC_DONE;
-		cv_signal(>sc_sync_wait);
+		cv_broadcast(>sc_sync_wait);
 		mutex_exit(>sc_sync_wait_lock);
 		virtio_dequeue_commit(vsc, vq, slot);
 		return;
@@ -716,7 +716,7 @@ ld_virtio_flush(struct ld_softc *ld, boo
 		r = EIO;
 
 	sc->sc_sync_use = SYNC_FREE;
-	cv_signal(>sc_sync_wait);
+	cv_broadcast(>sc_sync_wait);
 	mutex_exit(>sc_sync_wait_lock);
 
 	return r;



CVS commit: src/sys/dev/pci

2019-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Jan 17 10:20:01 UTC 2019

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

Log Message:
Use cv_broadcast() on "sc_sync_wait" to prevent deadlock
when more than one thread try to "DIOCCACHESYNC" at the
same time.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ld_virtio.c

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



CVS commit: src/sys/kern

2019-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Jan 17 10:18:52 UTC 2019

Modified Files:
src/sys/kern: kern_threadpool.c

Log Message:
Use PRIu64 for "uint64_t tp_refcnt".


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/kern_threadpool.c

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



CVS commit: src/sys/kern

2019-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Jan 17 10:18:52 UTC 2019

Modified Files:
src/sys/kern: kern_threadpool.c

Log Message:
Use PRIu64 for "uint64_t tp_refcnt".


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/kern_threadpool.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/kern/kern_threadpool.c
diff -u src/sys/kern/kern_threadpool.c:1.14 src/sys/kern/kern_threadpool.c:1.15
--- src/sys/kern/kern_threadpool.c:1.14	Sat Dec 29 04:39:14 2018
+++ src/sys/kern/kern_threadpool.c	Thu Jan 17 10:18:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_threadpool.c,v 1.14 2018/12/29 04:39:14 thorpej Exp $	*/
+/*	$NetBSD: kern_threadpool.c,v 1.15 2019/01/17 10:18:52 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2018 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_threadpool.c,v 1.14 2018/12/29 04:39:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_threadpool.c,v 1.15 2019/01/17 10:18:52 hannken Exp $");
 
 #include 
 #include 
@@ -364,7 +364,7 @@ threadpool_destroy(struct threadpool *po
 	TAILQ_FOREACH(thread, >tp_idle_threads, tpt_entry)
 		cv_broadcast(>tpt_cv);
 	while (0 < pool->tp_refcnt) {
-		TP_LOG(("%s: draining %u references...\n", __func__,
+		TP_LOG(("%s: draining %" PRIu64 " references...\n", __func__,
 		pool->tp_refcnt));
 		cv_wait(>tp_overseer.tpt_cv, >tp_lock);
 	}



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

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 17 12:49:53 UTC 2019

Modified Files:
src/sys/arch/arm/altera: cycv_clkmgr.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/altera/cycv_clkmgr.c

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

Modified files:

Index: src/sys/arch/arm/altera/cycv_clkmgr.c
diff -u src/sys/arch/arm/altera/cycv_clkmgr.c:1.1 src/sys/arch/arm/altera/cycv_clkmgr.c:1.2
--- src/sys/arch/arm/altera/cycv_clkmgr.c:1.1	Wed Sep 19 17:31:38 2018
+++ src/sys/arch/arm/altera/cycv_clkmgr.c	Thu Jan 17 12:49:53 2019
@@ -1,9 +1,9 @@
-/* $NetBSD: cycv_clkmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $ */
+/* $NetBSD: cycv_clkmgr.c,v 1.2 2019/01/17 12:49:53 skrll Exp $ */
 
 /* This file is in the public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.1 2018/09/19 17:31:38 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.2 2019/01/17 12:49:53 skrll Exp $");
 
 #include 
 #include 
@@ -323,7 +323,8 @@ cycv_clkmgr_clocks_traverse(struct cycv_
 }
 
 static struct cycv_clk_mux_info *
-cycv_clkmgr_get_mux_info(const char *name) {
+cycv_clkmgr_get_mux_info(const char *name)
+{
 	size_t i;
 
 	for (i = 0; i < __arraycount(cycv_clk_mux_tree); i++) {
@@ -363,7 +364,8 @@ cycv_clkmgr_clock_lookup_by_name(struct 
 }
 
 static void
-cycv_clkmgr_clock_print(struct cycv_clkmgr_softc *sc, struct cycv_clk *clk) {
+cycv_clkmgr_clock_print(struct cycv_clkmgr_softc *sc, struct cycv_clk *clk)
+{
 	uint32_t numer;
 	uint32_t denom;
 	uint32_t tmp;
@@ -510,7 +512,8 @@ cycv_clkmgr_clock_set_rate(void *priv, s
 }
 
 static int
-cycv_clkmgr_clock_set(void *priv, struct clk *base_clk, int val) {
+cycv_clkmgr_clock_set(void *priv, struct clk *base_clk, int val)
+{
 	struct cycv_clkmgr_softc *sc = priv;
 	struct cycv_clk *clk = (struct cycv_clk *) base_clk;
 
@@ -602,7 +605,8 @@ update:
  */
 
 uint32_t
-cycv_clkmgr_early_get_mpu_clk(void) {
+cycv_clkmgr_early_get_mpu_clk(void)
+{
 	bus_space_tag_t bst = _generic_bs_tag;
 	bus_space_handle_t bsh;
 	uint32_t tmp;
@@ -620,7 +624,8 @@ cycv_clkmgr_early_get_mpu_clk(void) {
 }
 
 uint32_t
-cycv_clkmgr_early_get_l4_sp_clk(void) {
+cycv_clkmgr_early_get_l4_sp_clk(void)
+{
 	bus_space_tag_t bst = _generic_bs_tag;
 	bus_space_handle_t bsh;
 	uint32_t tmp;



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

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 17 12:49:53 UTC 2019

Modified Files:
src/sys/arch/arm/altera: cycv_clkmgr.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/altera/cycv_clkmgr.c

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



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

2019-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan 17 13:51:25 UTC 2019

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

Log Message:
Add exynos5422-odroidhc1.dts


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/GENERIC

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.17 src/sys/arch/evbarm/conf/GENERIC:1.18
--- src/sys/arch/evbarm/conf/GENERIC:1.17	Sat Jan  5 16:50:22 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Thu Jan 17 13:51:25 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.17 2019/01/05 16:50:22 skrll Exp $
+#	$NetBSD: GENERIC,v 1.18 2019/01/17 13:51:25 jmcneill Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -25,6 +25,7 @@ makeoptions	DTS="
 	exynos4412-odroidx2.dts
 	exynos5410-odroidxu.dts
 	exynos5410-smdk5410.dts
+	exynos5422-odroidhc1.dts
 	exynos5422-odroidxu3-lite.dts
 	exynos5422-odroidxu3.dts
 	exynos5422-odroidxu4.dts



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

2019-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan 17 13:51:25 UTC 2019

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

Log Message:
Add exynos5422-odroidhc1.dts


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/conf/GENERIC

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



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

2019-01-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 17 14:24:51 UTC 2019

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

Log Message:
Simplify pmap_sync_pv: just pass a pa, and build the pte inside.


To generate a diff of this commit:
cvs rdiff -u -r1.315 -r1.316 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.315 src/sys/arch/x86/x86/pmap.c:1.316
--- src/sys/arch/x86/x86/pmap.c:1.315	Mon Dec 17 07:10:07 2018
+++ src/sys/arch/x86/x86/pmap.c	Thu Jan 17 14:24:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.315 2018/12/17 07:10:07 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.316 2019/01/17 14:24:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.315 2018/12/17 07:10:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.316 2019/01/17 14:24:51 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -3579,8 +3579,7 @@ pmap_remove(struct pmap *pmap, vaddr_t s
  * => issues tlb shootdowns if necessary.
  */
 static int
-pmap_sync_pv(struct pv_pte *pvpte, pt_entry_t expect, int clearbits,
-pt_entry_t *optep)
+pmap_sync_pv(struct pv_pte *pvpte, paddr_t pa, int clearbits, pt_entry_t *optep)
 {
 	struct pmap *pmap;
 	struct vm_page *ptp;
@@ -3588,16 +3587,16 @@ pmap_sync_pv(struct pv_pte *pvpte, pt_en
 	pt_entry_t *ptep;
 	pt_entry_t opte;
 	pt_entry_t npte;
+	pt_entry_t expect;
 	bool need_shootdown;
 
+	expect = pmap_pa2pte(pa) | PG_V;
 	ptp = pvpte->pte_ptp;
 	va = pvpte->pte_va;
 	KASSERT(ptp == NULL || ptp->uobject != NULL);
 	KASSERT(ptp == NULL || ptp_va2o(va, 1) == ptp->offset);
 	pmap = ptp_to_pmap(ptp);
 
-	KASSERT((expect & ~(PG_FRAME | PG_V)) == 0);
-	KASSERT((expect & PG_V) != 0);
 	KASSERT(clearbits == ~0 || (clearbits & ~(PG_M | PG_U | PG_RW)) == 0);
 	KASSERT(kpreempt_disabled());
 
@@ -3608,16 +3607,14 @@ pmap_sync_pv(struct pv_pte *pvpte, pt_en
 		KASSERT((opte & (PG_U | PG_V)) != PG_U);
 		KASSERT(opte == 0 || (opte & PG_V) != 0);
 		if ((opte & (PG_FRAME | PG_V)) != expect) {
-
 			/*
-			 * we lost a race with a V->P operation like
-			 * pmap_remove().  wait for the competitor
+			 * We lost a race with a V->P operation like
+			 * pmap_remove().  Wait for the competitor
 			 * reflecting pte bits into mp_attrs.
 			 *
-			 * issue a redundant TLB shootdown so that
+			 * Issue a redundant TLB shootdown so that
 			 * we can wait for its completion.
 			 */
-
 			pmap_unmap_pte();
 			if (clearbits != 0) {
 pmap_tlb_shootdown(pmap, va,
@@ -3628,30 +3625,26 @@ pmap_sync_pv(struct pv_pte *pvpte, pt_en
 		}
 
 		/*
-		 * check if there's anything to do on this pte.
+		 * Check if there's anything to do on this PTE.
 		 */
-
 		if ((opte & clearbits) == 0) {
 			need_shootdown = false;
 			break;
 		}
 
 		/*
-		 * we need a shootdown if the pte is cached. (PG_U)
-		 *
-		 * ...unless we are clearing only the PG_RW bit and
-		 * it isn't cached as RW. (PG_M)
+		 * We need a shootdown if the PTE is cached (PG_U) ...
+		 * ... Unless we are clearing only the PG_RW bit and
+		 * it isn't cached as RW (PG_M).
 		 */
-
 		need_shootdown = (opte & PG_U) != 0 &&
 		!(clearbits == PG_RW && (opte & PG_M) == 0);
 
 		npte = opte & ~clearbits;
 
 		/*
-		 * if we need a shootdown anyway, clear PG_U and PG_M.
+		 * If we need a shootdown anyway, clear PG_U and PG_M.
 		 */
-
 		if (need_shootdown) {
 			npte &= ~(PG_U | PG_M);
 		}
@@ -3675,10 +3668,8 @@ pmap_pp_remove(struct pmap_page *pp, pad
 	struct pv_pte *pvpte;
 	struct pv_entry *killlist = NULL;
 	struct vm_page *ptp;
-	pt_entry_t expect;
 	int count;
 
-	expect = pmap_pa2pte(pa) | PG_V;
 	count = SPINLOCK_BACKOFF_MIN;
 	kpreempt_disable();
 startover:
@@ -3690,17 +3681,16 @@ startover:
 		int error;
 
 		/*
-		 * add a reference to the pmap before clearing the pte.
-		 * otherwise the pmap can disappear behind us.
+		 * Add a reference to the pmap before clearing the pte.
+		 * Otherwise the pmap can disappear behind us.
 		 */
-
 		ptp = pvpte->pte_ptp;
 		pmap = ptp_to_pmap(ptp);
 		if (ptp != NULL) {
 			pmap_reference(pmap);
 		}
 
-		error = pmap_sync_pv(pvpte, expect, ~0, );
+		error = pmap_sync_pv(pvpte, pa, ~0, );
 		if (error == EAGAIN) {
 			int hold_count;
 			KERNEL_UNLOCK_ALL(curlwp, _count);
@@ -3716,7 +3706,7 @@ startover:
 		va = pvpte->pte_va;
 		pve = pmap_remove_pv(pp, ptp, va);
 
-		/* update the PTP reference count.  free if last reference. */
+		/* Update the PTP reference count. Free if last reference. */
 		if (ptp != NULL) {
 			struct pmap *pmap2;
 			pt_entry_t *ptes;
@@ -3798,8 +3788,8 @@ pmap_test_attrs(struct vm_page *pg, unsi
 {
 	struct pmap_page *pp;
 	struct pv_pte *pvpte;
-	pt_entry_t expect;
 	u_int result;
+	paddr_t pa;
 
 	KASSERT(uvm_page_locked_p(pg));
 
@@ -3807,7 

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

2019-01-17 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 17 14:24:51 UTC 2019

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

Log Message:
Simplify pmap_sync_pv: just pass a pa, and build the pte inside.


To generate a diff of this commit:
cvs rdiff -u -r1.315 -r1.316 src/sys/arch/x86/x86/pmap.c

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



CVS commit: src/doc

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 04:14:47 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
add missing notable things i've done since netbsd-8:

fsdb(8): Add "saveblks" command. [mrg 20170804]
gzip(1): Add SIGINFO support. [mrg 20170804]
sparc: Fix time goes backwards. [mrg 20180112]
midiplay: Add -s option to send all sounds off. [mrg 20180503]
usb(4): Many fixes to abort issues fixed for all USB controllers.
[mrg/skrll/riastradh 20180809]
nullfs(4): Add 32-bit support. [mrg 20180811]
i915(4): Pull in support for KabyLake CPUs. [mrg 20180913]
usb(4): Handle most cases of early boot USB keyboard. [mrg 20180916]
httpd(8): Update to bozohttpd-20181215. [mrg 20181215]
crashme(9): Add framework for testing kernel crash dumps. [mrg 20190109]


To generate a diff of this commit:
cvs rdiff -u -r1.2490 -r1.2491 src/doc/CHANGES

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



CVS commit: src/doc

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 04:14:47 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
add missing notable things i've done since netbsd-8:

fsdb(8): Add "saveblks" command. [mrg 20170804]
gzip(1): Add SIGINFO support. [mrg 20170804]
sparc: Fix time goes backwards. [mrg 20180112]
midiplay: Add -s option to send all sounds off. [mrg 20180503]
usb(4): Many fixes to abort issues fixed for all USB controllers.
[mrg/skrll/riastradh 20180809]
nullfs(4): Add 32-bit support. [mrg 20180811]
i915(4): Pull in support for KabyLake CPUs. [mrg 20180913]
usb(4): Handle most cases of early boot USB keyboard. [mrg 20180916]
httpd(8): Update to bozohttpd-20181215. [mrg 20181215]
crashme(9): Add framework for testing kernel crash dumps. [mrg 20190109]


To generate a diff of this commit:
cvs rdiff -u -r1.2490 -r1.2491 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/CHANGES
diff -u src/doc/CHANGES:1.2490 src/doc/CHANGES:1.2491
--- src/doc/CHANGES:1.2490	Sat Jan 12 17:30:28 2019
+++ src/doc/CHANGES	Fri Jan 18 04:14:47 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2490 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2491 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -37,6 +37,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	bind: Import version 9.10.5-P2. [christos 20170630]
 	sunxiemac(4): Add support for Allwinner Gigabit Ethernet (EMAC).
 		[jmcneill 20170701]
+	fsdb(8): Add "saveblks" command. [mrg 20170804]
 	wbsio(4): Add support for Winbond W83627DHG-P, W83627SF, W83627UHG,
 		W83667HGB, W83687THF, W83697UG,	Nuvoton NCT5104D, NCT6775,
 		NCT6779, NCT6791, NCT6792 and NCT6793. [msaitoh 20170707]
@@ -47,6 +48,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lm(4): Add support for NCT5174D, NCT6775F, NCT6779D and NCT679[1235]D.
 		[msaitoh 20170711]
 	arm: Add support for NVIDIA Tegra X1 SoC. [jmcneill 20170720]
+	gzip(1): Add SIGINFO support. [mrg 20170804]
 	i386: Remove vm86. [maxv 20170812]
 	itesio(4): Add support IT8628E. [hauke 20170814]
 	ichsmb(4): Add support for Intel C3000. [msaitoh 20170817]
@@ -91,6 +93,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	gdb(1): Updated to 8.0.1.  [christos 20171128]
 	dhcpcd(8): Import dhcpcd-7.0.0-rc4. [roy 20171206]
 	ihidev(4), ims(4): Added drivers for i2c HID mice. [bouyer 20171210]
+	sparc: Fix time goes backwards. [mrg 20180112]
 	lua: Applied 6th bugfix to Lua 5.3.4 from lua.org/bugs.html.
 		[mbalmer 20171213]
 	sstk: Remove the "stack section size change" syscall [kamil 20171219]
@@ -150,6 +153,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	netpgp(3lua): Add Lua binding for libnetpgp(3). [sevan 20180429]
 	arm: Add support for Allwinner H6 SoC. [jmcneill 20180501]
 	dhcpcd: Import 7.0.4. [roy 20180502]
+	midiplay: Add -s option to send all sounds off. [mrg 20180503]
 	libbozohttpd(3): Add the embeddable version of bozohttpd [sevan 20180503]
 	bozohttpd(3lua): Add Lua binding for libbozohttpd(3lua) [sevan 20180503]
 	tzdata: Updated to 2017e. [kre 20180504]
@@ -196,6 +200,9 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lua: Import version 5.3.5. [alnsn 20180804]
 	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]
 	kernel: Remove the n8 driver. [maya 20180808]
+	usb(4): Many fixes to abort issues fixed for all USB controllers.
+		[mrg/skrll/riastradh 20180809]
+	nullfs(4): Add 32-bit support. [mrg 20180811]
 	bind: Import version 9.12.2-P1. [christos 20180812]
 	arm: Add support for Rockchip RK3399 SoC. [jmcneill 20180812]
 	amd64: Randomize by default all the randomizable VM areas in the kernel.
@@ -223,6 +230,8 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	kernel: Remove en(4). [maxv 20180906]
 	kernel: Remove the NATM code. [maxv 20180906]
 	libnv: Imported from FreeBSD [christos 20180908]
+	i915(4): Pull in support for KabyLake CPUs. [mrg 20180913]
+	usb(4): Handle most cases of early boot USB keyboard. [mrg 20180916]
 	rkpmic(4): Add support for Rockchip RK805 Power Management IC.
 		[jmcneill 20180920]
 	kernel: Remove the ISDN code, including daic(4), iavc(4), isic(4),
@@ -265,6 +274,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	amdtemp(4): Add support for AMD family 16h temperature sensors.
 		[is 20181213]
 	arm: Add support for NVIDIA Tegra X1 SoC SATA. [skrll 20181214]
+	httpd(8): Update to bozohttpd-20181215. [mrg 20181215]
 	kernel: Remove COMPAT_SVR4 and COMPAT_SVR4_32. [maxv 20181219]
 	sqlite3: Import 3.26.0. [christos 20181219]
 	network: Add SIOCSETHERCAP ioctl. [msaitoh 20181221]
@@ -294,6 +304,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	tpm-tools: Import tpm-tools-1.3.9.1 [christos 20190107]
 	compiler-rt: Import compiler-rt r350590 LLVM sanitizers [kamil 20190108]
 	bind: Import version 

CVS commit: src/libexec/httpd

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 05:48:31 UTC 2019

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
fix a few problems pointed out by clang static analyzer, from rajeev_v_pillai:

- bozostrnsep() may return with "in = NULL", so check for it.
- nul terminating in bozo_escape_rfc3986() can be simpler
- don't use uniinit variables in check_remap()
- don't use re-used freed data in check_virtual().  this one is tricky as
  the original code was:
free(request->hr_file);
request->hr_file = bozostrdup(httpd, request, s ? s : "/");
  however, bozostrdup() may reference request->hr_file.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.108 src/libexec/httpd/bozohttpd.c:1.109
--- src/libexec/httpd/bozohttpd.c:1.108	Thu Jan 17 07:46:16 2019
+++ src/libexec/httpd/bozohttpd.c	Fri Jan 18 05:48:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.108 2019/01/17 07:46:16 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.109 2019/01/18 05:48:31 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -245,10 +245,8 @@ bozo_set_pref(bozohttpd_t *httpd, bozopr
 		bozoprefs->name[i] = bozostrdup(httpd, NULL, name);
 	} else {
 		/* replace the element in the array */
-		if (bozoprefs->value[i]) {
+		if (bozoprefs->value[i])
 			free(bozoprefs->value[i]);
-			bozoprefs->value[i] = NULL;
-		}
 	}
 	bozoprefs->value[i] = bozostrdup(httpd, NULL, value);
 	return 1;
@@ -297,7 +295,7 @@ parse_request(bozohttpd_t *httpd, char *
 
 	len = (ssize_t)strlen(in);
 	val = bozostrnsep(, " \t\n\r", );
-	if (len < 1 || val == NULL)
+	if (len < 1 || val == NULL || in == NULL)
 		return;
 	*method = val;
 
@@ -996,7 +994,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		buf = bozorealloc(httpd, buf, buflen);
 	}
 
-	for (len = 0, s = url, d = buf; *s;) {
+	for (s = url, d = buf; *s;) {
 		if (*s & 0x80)
 			goto encode_it;
 		switch (*s) {
@@ -1028,16 +1026,14 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		encode_it:
 			snprintf(d, 4, "%%%02X", (unsigned char)*s++);
 			d += 3;
-			len += 3;
 			break;
 		default:
 		leave_it:
 			*d++ = *s++;
-			len++;
 			break;
 		}
 	}
-	buf[len] = 0;
+	*d = 0;
 
 	return buf;
 }
@@ -1195,7 +1191,7 @@ check_remap(bozo_httpreq_t *request)
 	bozohttpd_t *httpd = request->hr_httpd;
 	char *file = request->hr_file, *newfile;
 	void *fmap;
-	const char *replace, *map_to, *p;
+	const char *replace = NULL, *map_to = NULL, *p;
 	struct stat st;
 	int mapfile;
 	size_t avail, len, rlen, reqlen, num_esc = 0;
@@ -1324,6 +1320,9 @@ check_virtual(bozo_httpreq_t *request)
 	debug((httpd, DEBUG_OBESE,
 	   "checking for http:// virtual host in '%s'", file));
 	if (strncasecmp(file, "http://;, 7) == 0) {
+		/* bozostrdup() might access it. */
+		char *old_file = request->hr_file;
+
 		/* we would do virtual hosting here? */
 		file += 7;
 		/* RFC 2616 (HTTP/1.1), 5.2: URI takes precedence over Host: */
@@ -1332,8 +1331,8 @@ check_virtual(bozo_httpreq_t *request)
 		if ((s = strchr(request->hr_host, '/')) != NULL)
 			*s = '\0';
 		s = strchr(file, '/');
-		free(request->hr_file);
 		request->hr_file = bozostrdup(httpd, request, s ? s : "/");
+		free(old_file);
 		debug((httpd, DEBUG_OBESE, "got host '%s' file is now '%s'",
 		request->hr_host, request->hr_file));
 	} else if (!request->hr_host)
@@ -1357,7 +1356,10 @@ check_virtual(bozo_httpreq_t *request)
 		if (request->hr_host) {
 			s = strrchr(request->hr_host, ':');
 			if (s != NULL)
-/* truncate Host: as we want to copy it without port part */
+/*
+ * truncate Host: as we want to copy it
+ * without port part
+ */
 *s = '\0';
 			request->hr_virthostname = bozostrdup(httpd, request,
 			  request->hr_host);



CVS commit: src/libexec/httpd

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 05:48:31 UTC 2019

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
fix a few problems pointed out by clang static analyzer, from rajeev_v_pillai:

- bozostrnsep() may return with "in = NULL", so check for it.
- nul terminating in bozo_escape_rfc3986() can be simpler
- don't use uniinit variables in check_remap()
- don't use re-used freed data in check_virtual().  this one is tricky as
  the original code was:
free(request->hr_file);
request->hr_file = bozostrdup(httpd, request, s ? s : "/");
  however, bozostrdup() may reference request->hr_file.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/libexec/httpd/bozohttpd.c

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



CVS commit: [pgoyette-compat] src/doc

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 05:53:58 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Add some details to some of the entries.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/TODO.compat-module

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

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.24 src/doc/TODO.compat-module:1.1.2.25
--- src/doc/TODO.compat-module:1.1.2.24	Fri Jan 18 05:42:34 2019
+++ src/doc/TODO.compat-module	Fri Jan 18 05:53:58 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.24 2019/01/18 05:42:34 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.25 2019/01/18 05:53:58 pgoyette Exp $ */
 
 DONE
 
@@ -20,17 +20,17 @@ DONE
 built-in dependencies get resolved.
 
 7.  Fixed limits on the number of module dependencies and maximum
-recursion level have been removed.  Previous code for reporting
-module status to userland has been versioned and moved to the
-(new) compat_80 module.
+recursion level (for auto-loading) have been removed.  Previous code
+for reporting module status to userland has been versioned and moved
+to the (new) compat_80 module.
 
 8.  The old monolithic compat module has been broken into multiple
-modules, one for each old NetBSD version.  The monolithic module
-is no longer available.
+modules, one for each old NetBSD version.  The monolithic compat
+module is no longer available.
 
-Similarly, the compat_sysv module has also been split into several
-version-specific modules, and the mini-monolithic compat_sysv module
-is no longer provided.
+Similarly, the compat_sysv and compat_netbsd32 modules have also
+been split into several version-specific modules, and the mini-
+monolithic versions of these modules are no longer provided.
 
 9.  syscalls.master has been updated to autoload the version-specific
 compat modules rather than the monolithic modules.
@@ -39,34 +39,33 @@ DONE
 built regardless.
 
 11. Implemented a MP-safe mechanism for installing and removing function
-pointers.  Thanks to riastradh@ for the template code.
+pointers, preventing them from being unloaded (via modunload) while
+in use.  Thanks to riastradh@ for the template code.
 
-12. Replace version-specific parts of the compat_netbsd32 module (and
-also the compat_netbsd32_sysv module) with individual modules.  Update
-dependencies accordingly.  (Done, but see #19 below.)
-
-13. Finished splitting the vnd_30 and vnd_50 compat code into separate
+12. Finished splitting the vnd_30 and vnd_50 compat code into separate
 modules.
 
-14. Cleaned up some previous vectored routines (related to if_43.c) to
+13. Cleaned up some previous vectored routines (related to if_43.c) to
 use the MP-safe mechanism.
 
-15. Organized (some of) the netbsd32 machine-dependent code to fit a
+14. Organized (some of) the netbsd32 machine-dependent code to fit a
 common build framework, and split version-specific code from baseline
-code as needed.
+code as needed.  More work may be needed here (see #18 below).
 
-16. The rtsock.c code has been split into two separate source files,
+15. The rtsock.c code has been split into two separate source files,
 one for use in -current and one which is shared with COMPAT_50 (the
 code is shared with -current, but macros are used to define version-
-specific routine names and variable types).
+specific routine names and variable types).  Version-specific parts
+of rtsock.c for compat_14 and compat_70 have also been split out and
+included in the relevant version-specific compat modules.
 
 TODO - Not required for branch merge
 
-17. Audit the entire code base for any remaining embedded #ifdef's for
+16. Audit the entire code base for any remaining embedded #ifdef's for
 COMPAT_xx.  When found, move the actual compat code into the compat
 hierarchy and replace originals with indirect (vectored) calls.
 
-18. The compat_60 module still needs some work for XEN systems.  We
+17. The compat_60 module still needs some work for XEN systems.  We
 probably need some build infrastructure changes to ensure that
 XEN (and, for i386, XEN-PAE) modules are build with the correct
 macros defined and with -I directories specified in the same order
@@ -74,7 +73,7 @@ TODO - Not required for branch merge
 prevents loading of micro-code updates for amd64 processors running
 XEN kernels.  This limitation also exists on HEAD.
 
-19. There seems to be quite a bit of MD compat_xx code, in the various
+18. There seems to be quite a bit of MD compat_xx code, in the various
 sys/arch/ directories.  I haven't yet looked at any of this.  But it
 seems to me that the 

CVS commit: [pgoyette-compat] src/doc

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 05:53:58 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Add some details to some of the entries.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/TODO.compat-module

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



CVS commit: src/libexec/httpd

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 06:04:10 UTC 2019

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
rework size_arrays():
- avoid calloc, use bozomalloc
- minor CSE
- fix bozoprefs->size setting when increasing the size (new total was
  being added to the prior total.)  found by clang static analyzer
  from rajeev_v_pillai.

pass httpd to size_arrays() now.
free(NULL) is legal.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.109 src/libexec/httpd/bozohttpd.c:1.110
--- src/libexec/httpd/bozohttpd.c:1.109	Fri Jan 18 05:48:31 2019
+++ src/libexec/httpd/bozohttpd.c	Fri Jan 18 06:04:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.109 2019/01/18 05:48:31 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.110 2019/01/18 06:04:10 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -190,33 +190,21 @@ volatile sig_atomic_t	timeout_hit;
  * check there's enough space in the prefs and names arrays.
  */
 static int
-size_arrays(bozoprefs_t *bozoprefs, size_t needed)
+size_arrays(bozohttpd_t *httpd, bozoprefs_t *bozoprefs, size_t needed)
 {
-	char	**temp;
+	size_t	len = sizeof(char *) * needed;
 
 	if (bozoprefs->size == 0) {
 		/* only get here first time around */
-		bozoprefs->name = calloc(sizeof(char *), needed);
-		if (bozoprefs->name == NULL)
-			return 0;
-		bozoprefs->value = calloc(sizeof(char *), needed);
-		if (bozoprefs->value == NULL) {
-			free(bozoprefs->name);
-			return 0;
-		}
-		bozoprefs->size = needed;
+		bozoprefs->name = bozomalloc(httpd, len);
+		bozoprefs->value = bozomalloc(httpd, len);
 	} else if (bozoprefs->count == bozoprefs->size) {
 		/* only uses 'needed' when filled array */
-		temp = realloc(bozoprefs->name, sizeof(char *) * needed);
-		if (temp == NULL)
-			return 0;
-		bozoprefs->name = temp;
-		temp = realloc(bozoprefs->value, sizeof(char *) * needed);
-		if (temp == NULL)
-			return 0;
-		bozoprefs->value = temp;
-		bozoprefs->size += needed;
+		bozoprefs->name = bozorealloc(httpd, bozoprefs->name, len);
+		bozoprefs->value = bozorealloc(httpd, bozoprefs->value, len);
 	}
+
+	bozoprefs->size = needed;
 	return 1;
 }
 
@@ -239,14 +227,13 @@ bozo_set_pref(bozohttpd_t *httpd, bozopr
 
 	if ((i = findvar(bozoprefs, name)) < 0) {
 		/* add the element to the array */
-		if (!size_arrays(bozoprefs, bozoprefs->size + 15))
+		if (!size_arrays(httpd, bozoprefs, bozoprefs->size + 15))
 			return 0;
 		i = bozoprefs->count++;
 		bozoprefs->name[i] = bozostrdup(httpd, NULL, name);
 	} else {
 		/* replace the element in the array */
-		if (bozoprefs->value[i])
-			free(bozoprefs->value[i]);
+		free(bozoprefs->value[i]);
 	}
 	bozoprefs->value[i] = bozostrdup(httpd, NULL, value);
 	return 1;



CVS commit: src/libexec/httpd

2019-01-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 18 06:04:10 UTC 2019

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
rework size_arrays():
- avoid calloc, use bozomalloc
- minor CSE
- fix bozoprefs->size setting when increasing the size (new total was
  being added to the prior total.)  found by clang static analyzer
  from rajeev_v_pillai.

pass httpd to size_arrays() now.
free(NULL) is legal.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/libexec/httpd/bozohttpd.c

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



CVS commit: src/bin/sh

2019-01-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Jan 18 06:28:09 UTC 2019

Modified Files:
src/bin/sh: trap.c

Log Message:
Finish (hopefully) the second half of 1.47 ... make sure
that when traps are marked as invalid, we never use them
for anything except output from the trap command.

Fixes issues where sub-shells of shells which use traps
(eg: to trap SIGPIPE) can end up looping forever if the
signal occurs in a sub-shell (where the trap is supposed
to be reset to its default).   Reported, and mostly
analyzed by Martijn Dekker.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/trap.c

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



CVS commit: [pgoyette-compat] src/doc

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 05:42:34 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Some tweaks, some typos.  General clean-up, no significant changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/TODO.compat-module

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

Modified files:

Index: src/doc/TODO.compat-module
diff -u src/doc/TODO.compat-module:1.1.2.23 src/doc/TODO.compat-module:1.1.2.24
--- src/doc/TODO.compat-module:1.1.2.23	Tue Jan 15 22:06:34 2019
+++ src/doc/TODO.compat-module	Fri Jan 18 05:42:34 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.compat-module,v 1.1.2.23 2019/01/15 22:06:34 pgoyette Exp $ */
+/* $NetBSD: TODO.compat-module,v 1.1.2.24 2019/01/18 05:42:34 pgoyette Exp $ */
 
 DONE
 
@@ -19,10 +19,10 @@ DONE
 defopt/defflag lines in the config files* as needed, to insure that
 built-in dependencies get resolved.
 
-7.  Fixed limits on the number of module depedencies and maximum
+7.  Fixed limits on the number of module dependencies and maximum
 recursion level have been removed.  Previous code for reporting
 module status to userland has been versioned and moved to the
-compat_80 module.
+(new) compat_80 module.
 
 8.  The old monolithic compat module has been broken into multiple
 modules, one for each old NetBSD version.  The monolithic module
@@ -43,7 +43,7 @@ DONE
 
 12. Replace version-specific parts of the compat_netbsd32 module (and
 also the compat_netbsd32_sysv module) with individual modules.  Update
-dependencies accordingly.  (Done, but see #13 below.)
+dependencies accordingly.  (Done, but see #19 below.)
 
 13. Finished splitting the vnd_30 and vnd_50 compat code into separate
 modules.
@@ -51,14 +51,14 @@ DONE
 14. Cleaned up some previous vectored routines (related to if_43.c) to
 use the MP-safe mechanism.
 
-15. Organized netbsd32 machine-dependent code to fit a common build
-framework, and split version-specific code from baseline code as
-needed.
+15. Organized (some of) the netbsd32 machine-dependent code to fit a
+common build framework, and split version-specific code from baseline
+code as needed.
 
 16. The rtsock.c code has been split into two separate source files,
-one for use -current and one which is shared with COMPAT_50 (the
-code is shared, but macros are used to define version-specific
-routine names and variable types).
+one for use in -current and one which is shared with COMPAT_50 (the
+code is shared with -current, but macros are used to define version-
+specific routine names and variable types).
 
 TODO - Not required for branch merge
 



CVS commit: [pgoyette-compat] src/doc

2019-01-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 18 05:42:34 UTC 2019

Modified Files:
src/doc [pgoyette-compat]: TODO.compat-module

Log Message:
Some tweaks, some typos.  General clean-up, no significant changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/TODO.compat-module

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



CVS commit: src/bin/sh

2019-01-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Jan 18 06:28:09 UTC 2019

Modified Files:
src/bin/sh: trap.c

Log Message:
Finish (hopefully) the second half of 1.47 ... make sure
that when traps are marked as invalid, we never use them
for anything except output from the trap command.

Fixes issues where sub-shells of shells which use traps
(eg: to trap SIGPIPE) can end up looping forever if the
signal occurs in a sub-shell (where the trap is supposed
to be reset to its default).   Reported, and mostly
analyzed by Martijn Dekker.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/trap.c

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

Modified files:

Index: src/bin/sh/trap.c
diff -u src/bin/sh/trap.c:1.50 src/bin/sh/trap.c:1.51
--- src/bin/sh/trap.c:1.50	Wed Dec 12 20:22:43 2018
+++ src/bin/sh/trap.c	Fri Jan 18 06:28:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.50 2018/12/12 20:22:43 kre Exp $	*/
+/*	$NetBSD: trap.c,v 1.51 2019/01/18 06:28:09 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)trap.c	8.5 (Berkeley) 6/5/95";
 #else
-__RCSID("$NetBSD: trap.c,v 1.50 2018/12/12 20:22:43 kre Exp $");
+__RCSID("$NetBSD: trap.c,v 1.51 2019/01/18 06:28:09 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -452,7 +452,7 @@ setsignal(int signo, int vforked)
 	sig_t sigact = SIG_DFL, sig;
 	char *t, tsig;
 
-	if ((t = trap[signo]) == NULL)
+	if (traps_invalid || (t = trap[signo]) == NULL)
 		action = S_DFL;
 	else if (*t != '\0')
 		action = S_CATCH;
@@ -609,7 +609,7 @@ child_trap(void)
 
 	p = trap[SIGCHLD];
 
-	if (p != NULL && *p == '\0')
+	if (traps_invalid || (p != NULL && *p == '\0'))
 		p = NULL;
 
 	return p;
@@ -654,7 +654,7 @@ onsig(int signo)
 	signal(signo, onsig);
 	*/
 
-	if (signo == SIGINT && trap[SIGINT] == NULL) {
+	if (signo == SIGINT && (traps_invalid || trap[SIGINT] == NULL)) {
 		onint();
 		return;
 	}
@@ -662,7 +662,7 @@ onsig(int signo)
 	/*
 	 * if the signal will do nothing, no point reporting it
 	 */
-	if (trap[signo] != NULL && trap[signo][0] != '\0' &&
+	if (!traps_invalid && trap[signo] != NULL && trap[signo][0] != '\0' &&
 	signo != SIGCHLD) {
 		gotsig[signo] = 1;
 		pendingsigs++;



CVS commit: src/sys/dev/pci

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 18 07:03:02 UTC 2019

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

Log Message:
Default to USBREV_3_0 if usbrev is unknown.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/xhci_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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.19 src/sys/dev/pci/xhci_pci.c:1.20
--- src/sys/dev/pci/xhci_pci.c:1.19	Fri Dec  7 08:28:44 2018
+++ src/sys/dev/pci/xhci_pci.c	Fri Jan 18 07:03:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.19 2018/12/07 08:28:44 msaitoh Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.20 2019/01/18 07:03:02 skrll Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.19 2018/12/07 08:28:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.20 2019/01/18 07:03:02 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -227,9 +227,9 @@ xhci_pci_attach(device_t parent, device_
 		break;
 	default:
 		if (usbrev < PCI_USBREV_3_0) {
-			aprint_error_dev(self, "Unknown revision (%02x)\n",
+			aprint_error_dev(self, "Unknown revision (%02x). Set to 3.0.\n",
 			usbrev);
-			sc->sc_bus.ub_revision = USBREV_UNKNOWN;
+			sc->sc_bus.ub_revision = USBREV_3_0;
 		} else {
 			/* Default to the latest revision */
 			aprint_normal_dev(self,



CVS commit: src/sys/arch/aarch64/aarch64

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 18 07:05:36 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.26 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.27
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.26	Thu Dec 27 21:48:01 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Fri Jan 18 07:05:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.26 2018/12/27 21:48:01 mrg Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.27 2019/01/18 07:05:36 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.26 2018/12/27 21:48:01 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.27 2019/01/18 07:05:36 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -41,15 +41,16 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach
 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
 
 #include 
 



CVS commit: src/sys/arch/aarch64/aarch64

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 18 07:05:36 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

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



CVS commit: src/sys/dev/pci

2019-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 18 07:03:02 UTC 2019

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

Log Message:
Default to USBREV_3_0 if usbrev is unknown.


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

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