CVS commit: [netbsd-9] src/doc

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:52:54 UTC 2019

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

Log Message:
 Ticket #466 and #471.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-9.0

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.0
diff -u src/doc/CHANGES-9.0:1.1.2.116 src/doc/CHANGES-9.0:1.1.2.117
--- src/doc/CHANGES-9.0:1.1.2.116	Sun Nov 24 08:34:28 2019
+++ src/doc/CHANGES-9.0	Mon Nov 25 05:52:54 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.116 2019/11/24 08:34:28 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.117 2019/11/25 05:52:54 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6247,3 +6247,64 @@ doc/3RDPARTY	1.1655 (patch)
 	Import tzdata2019c.
 	[kre, ticket #468]
 
+sys/arch/evbarm/beagle/beagle_machdep.c		1.80
+
+	Fix compile error when DIAGNOSTIC is not used.
+	[martin, ticket #466]
+
+distrib/notes/Makefile.inc			1.45
+distrib/notes/acorn32/contents			1.6
+distrib/notes/alpha/contents			1.20
+distrib/notes/amd64/contents			1.9
+distrib/notes/amiga/contents			1.24
+distrib/notes/arc/contents			1.6
+distrib/notes/arc/prep1.5
+distrib/notes/atari/contents			1.24
+distrib/notes/bebox/contents			1.6
+distrib/notes/cats/contents			1.6
+distrib/notes/cats/prep1.14
+distrib/notes/common/contents			1.180
+distrib/notes/common/main			1.554
+distrib/notes/common/postinstall		1.85
+distrib/notes/common/sysinst			1.109
+distrib/notes/common/upgrade			1.31
+distrib/notes/emips/contents			1.6
+distrib/notes/evbarm/contents			1.6
+distrib/notes/evbppc/contents			1.7
+distrib/notes/ews4800mips/contents		1.6
+distrib/notes/hp300/contents			1.21
+distrib/notes/hpcarm/contents			1.7
+distrib/notes/hpcmips/contents			1.14
+distrib/notes/hpcsh/contents			1.7
+distrib/notes/hppa/contents			1.6
+distrib/notes/i386/contents			1.33
+distrib/notes/landisk/contents			1.7
+distrib/notes/mac68k/contents			1.24
+distrib/notes/macppc/contents			1.18
+distrib/notes/macppc/prep.OPENFIRMWARE		1.21
+distrib/notes/mmeye/contents			1.7
+distrib/notes/mvme68k/contents			1.17
+distrib/notes/news68k/contents			1.10
+distrib/notes/newsmips/contents			1.6
+distrib/notes/next68k/contents			1.11
+distrib/notes/ofppc/contents			1.7
+distrib/notes/pmax/contents			1.21
+distrib/notes/prep/contents			1.6
+distrib/notes/rs6000/contents			1.6
+distrib/notes/sandpoint/contents		1.6
+distrib/notes/sandpoint/xfer			1.4
+distrib/notes/sgimips/contents			1.6
+distrib/notes/shark/contents			1.6
+distrib/notes/sparc/contents			1.25
+distrib/notes/sparc64/contents			1.9
+distrib/notes/sparc64/upgrade			1.7
+distrib/notes/sun2/contents			1.6
+distrib/notes/sun3/contents			1.20
+distrib/notes/vax/contents			1.15
+distrib/notes/x68k/contents			1.21
+
+	Modernize release notes:
+	 - Use https where possible.
+	 - Adapt to cdn/nycdn and our current auto-build conventions.
+	 - Automate where possible.
+	[martin, ticket #471]



CVS commit: [netbsd-9] src/doc

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:52:54 UTC 2019

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

Log Message:
 Ticket #466 and #471.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-9.0

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



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

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:50:21 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/acorn32 [netbsd-9]: contents
src/distrib/notes/alpha [netbsd-9]: contents
src/distrib/notes/amd64 [netbsd-9]: contents
src/distrib/notes/amiga [netbsd-9]: contents
src/distrib/notes/arc [netbsd-9]: contents prep
src/distrib/notes/atari [netbsd-9]: contents
src/distrib/notes/bebox [netbsd-9]: contents
src/distrib/notes/cats [netbsd-9]: contents prep
src/distrib/notes/common [netbsd-9]: contents main postinstall sysinst
upgrade
src/distrib/notes/emips [netbsd-9]: contents
src/distrib/notes/evbarm [netbsd-9]: contents
src/distrib/notes/evbppc [netbsd-9]: contents
src/distrib/notes/ews4800mips [netbsd-9]: contents
src/distrib/notes/hp300 [netbsd-9]: contents
src/distrib/notes/hpcarm [netbsd-9]: contents
src/distrib/notes/hpcmips [netbsd-9]: contents
src/distrib/notes/hpcsh [netbsd-9]: contents
src/distrib/notes/hppa [netbsd-9]: contents
src/distrib/notes/i386 [netbsd-9]: contents
src/distrib/notes/landisk [netbsd-9]: contents
src/distrib/notes/mac68k [netbsd-9]: contents
src/distrib/notes/macppc [netbsd-9]: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye [netbsd-9]: contents
src/distrib/notes/mvme68k [netbsd-9]: contents
src/distrib/notes/news68k [netbsd-9]: contents
src/distrib/notes/newsmips [netbsd-9]: contents
src/distrib/notes/next68k [netbsd-9]: contents
src/distrib/notes/ofppc [netbsd-9]: contents
src/distrib/notes/pmax [netbsd-9]: contents
src/distrib/notes/prep [netbsd-9]: contents
src/distrib/notes/rs6000 [netbsd-9]: contents
src/distrib/notes/sandpoint [netbsd-9]: contents xfer
src/distrib/notes/sgimips [netbsd-9]: contents
src/distrib/notes/shark [netbsd-9]: contents
src/distrib/notes/sparc [netbsd-9]: contents
src/distrib/notes/sparc64 [netbsd-9]: contents upgrade
src/distrib/notes/sun2 [netbsd-9]: contents
src/distrib/notes/sun3 [netbsd-9]: contents
src/distrib/notes/vax [netbsd-9]: contents
src/distrib/notes/x68k [netbsd-9]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
distrib/notes/sandpoint/xfer: revision 1.4
distrib/notes/newsmips/contents: revision 1.6
distrib/notes/Makefile.inc: revision 1.45
distrib/notes/landisk/contents: revision 1.7
distrib/notes/sparc/contents: revision 1.25
distrib/notes/arc/contents: revision 1.6
distrib/notes/sun2/contents: revision 1.6
distrib/notes/common/sysinst: revision 1.109
distrib/notes/common/postinstall: revision 1.85
distrib/notes/vax/contents: revision 1.15
distrib/notes/mac68k/contents: revision 1.24
distrib/notes/alpha/contents: revision 1.20
distrib/notes/cats/contents: revision 1.6
distrib/notes/sparc64/contents: revision 1.9
distrib/notes/mvme68k/contents: revision 1.17
distrib/notes/i386/contents: revision 1.33
distrib/notes/common/main: revision 1.554
distrib/notes/rs6000/contents: revision 1.6
distrib/notes/hpcmips/contents: revision 1.14
distrib/notes/evbppc/contents: revision 1.7
distrib/notes/hpcarm/contents: revision 1.7
distrib/notes/emips/contents: revision 1.6
distrib/notes/sun3/contents: revision 1.20
distrib/notes/macppc/contents: revision 1.18
distrib/notes/amd64/contents: revision 1.9
distrib/notes/x68k/contents: revision 1.21
distrib/notes/sgimips/contents: revision 1.6
distrib/notes/sandpoint/contents: revision 1.6
distrib/notes/mmeye/contents: revision 1.7
distrib/notes/arc/prep: revision 1.5
distrib/notes/pmax/contents: revision 1.21
distrib/notes/shark/contents: revision 1.6
distrib/notes/news68k/contents: revision 1.10
distrib/notes/cats/prep: revision 1.14
distrib/notes/hp300/contents: revision 1.21
distrib/notes/common/upgrade: revision 1.31
distrib/notes/next68k/contents: revision 1.11
distrib/notes/amiga/contents: revision 1.24
distrib/notes/common/contents: revision 1.180
distrib/notes/evbarm/contents: revision 1.6
distrib/notes/sparc64/upgrade: revision 1.7
distrib/notes/hppa/contents: revision 1.6
distrib/notes/acorn32/contents: revision 1.6
distrib/notes/ofppc/contents: revision 1.7
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.21
distrib/notes/atari/contents: revision 1.24
distrib/notes/bebox/contents: revision 1.6
distrib/notes/prep/contents: revision 1.6
distrib/notes/hpcsh/contents: 

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

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:50:21 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/acorn32 [netbsd-9]: contents
src/distrib/notes/alpha [netbsd-9]: contents
src/distrib/notes/amd64 [netbsd-9]: contents
src/distrib/notes/amiga [netbsd-9]: contents
src/distrib/notes/arc [netbsd-9]: contents prep
src/distrib/notes/atari [netbsd-9]: contents
src/distrib/notes/bebox [netbsd-9]: contents
src/distrib/notes/cats [netbsd-9]: contents prep
src/distrib/notes/common [netbsd-9]: contents main postinstall sysinst
upgrade
src/distrib/notes/emips [netbsd-9]: contents
src/distrib/notes/evbarm [netbsd-9]: contents
src/distrib/notes/evbppc [netbsd-9]: contents
src/distrib/notes/ews4800mips [netbsd-9]: contents
src/distrib/notes/hp300 [netbsd-9]: contents
src/distrib/notes/hpcarm [netbsd-9]: contents
src/distrib/notes/hpcmips [netbsd-9]: contents
src/distrib/notes/hpcsh [netbsd-9]: contents
src/distrib/notes/hppa [netbsd-9]: contents
src/distrib/notes/i386 [netbsd-9]: contents
src/distrib/notes/landisk [netbsd-9]: contents
src/distrib/notes/mac68k [netbsd-9]: contents
src/distrib/notes/macppc [netbsd-9]: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye [netbsd-9]: contents
src/distrib/notes/mvme68k [netbsd-9]: contents
src/distrib/notes/news68k [netbsd-9]: contents
src/distrib/notes/newsmips [netbsd-9]: contents
src/distrib/notes/next68k [netbsd-9]: contents
src/distrib/notes/ofppc [netbsd-9]: contents
src/distrib/notes/pmax [netbsd-9]: contents
src/distrib/notes/prep [netbsd-9]: contents
src/distrib/notes/rs6000 [netbsd-9]: contents
src/distrib/notes/sandpoint [netbsd-9]: contents xfer
src/distrib/notes/sgimips [netbsd-9]: contents
src/distrib/notes/shark [netbsd-9]: contents
src/distrib/notes/sparc [netbsd-9]: contents
src/distrib/notes/sparc64 [netbsd-9]: contents upgrade
src/distrib/notes/sun2 [netbsd-9]: contents
src/distrib/notes/sun3 [netbsd-9]: contents
src/distrib/notes/vax [netbsd-9]: contents
src/distrib/notes/x68k [netbsd-9]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
distrib/notes/sandpoint/xfer: revision 1.4
distrib/notes/newsmips/contents: revision 1.6
distrib/notes/Makefile.inc: revision 1.45
distrib/notes/landisk/contents: revision 1.7
distrib/notes/sparc/contents: revision 1.25
distrib/notes/arc/contents: revision 1.6
distrib/notes/sun2/contents: revision 1.6
distrib/notes/common/sysinst: revision 1.109
distrib/notes/common/postinstall: revision 1.85
distrib/notes/vax/contents: revision 1.15
distrib/notes/mac68k/contents: revision 1.24
distrib/notes/alpha/contents: revision 1.20
distrib/notes/cats/contents: revision 1.6
distrib/notes/sparc64/contents: revision 1.9
distrib/notes/mvme68k/contents: revision 1.17
distrib/notes/i386/contents: revision 1.33
distrib/notes/common/main: revision 1.554
distrib/notes/rs6000/contents: revision 1.6
distrib/notes/hpcmips/contents: revision 1.14
distrib/notes/evbppc/contents: revision 1.7
distrib/notes/hpcarm/contents: revision 1.7
distrib/notes/emips/contents: revision 1.6
distrib/notes/sun3/contents: revision 1.20
distrib/notes/macppc/contents: revision 1.18
distrib/notes/amd64/contents: revision 1.9
distrib/notes/x68k/contents: revision 1.21
distrib/notes/sgimips/contents: revision 1.6
distrib/notes/sandpoint/contents: revision 1.6
distrib/notes/mmeye/contents: revision 1.7
distrib/notes/arc/prep: revision 1.5
distrib/notes/pmax/contents: revision 1.21
distrib/notes/shark/contents: revision 1.6
distrib/notes/news68k/contents: revision 1.10
distrib/notes/cats/prep: revision 1.14
distrib/notes/hp300/contents: revision 1.21
distrib/notes/common/upgrade: revision 1.31
distrib/notes/next68k/contents: revision 1.11
distrib/notes/amiga/contents: revision 1.24
distrib/notes/common/contents: revision 1.180
distrib/notes/evbarm/contents: revision 1.6
distrib/notes/sparc64/upgrade: revision 1.7
distrib/notes/hppa/contents: revision 1.6
distrib/notes/acorn32/contents: revision 1.6
distrib/notes/ofppc/contents: revision 1.7
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.21
distrib/notes/atari/contents: revision 1.24
distrib/notes/bebox/contents: revision 1.6
distrib/notes/prep/contents: revision 1.6
distrib/notes/hpcsh/contents: 

CVS commit: [netbsd-9] src/sys/arch/evbarm/beagle

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:47:13 UTC 2019

Modified Files:
src/sys/arch/evbarm/beagle [netbsd-9]: beagle_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #466):
sys/arch/evbarm/beagle/beagle_machdep.c: revision 1.80
"rv" is only used on some boards and only with options DIAGNOSTIC.
So move the declaration into the proper #ifdef block.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 \
src/sys/arch/evbarm/beagle/beagle_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/evbarm/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.1 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.2
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.1	Fri Nov 22 15:28:18 2019
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Mon Nov 25 05:47:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.78.2.1 2019/11/22 15:28:18 bouyer Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.78.2.2 2019/11/25 05:47:13 msaitoh Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.78.2.1 2019/11/22 15:28:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.78.2.2 2019/11/25 05:47:13 msaitoh Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -1075,7 +1075,6 @@ void
 beagle_device_register(device_t self, void *aux)
 {
 	prop_dictionary_t dict = device_properties(self);
-	int rv __diagused;
 
 	if (device_is_a(self, "armperiph")
 	&& device_is_a(device_parent(self), "mainbus")) {
@@ -1170,6 +1169,7 @@ beagle_device_register(device_t self, vo
 		prop_dictionary_set_int16(dict, "port2-gpio", -1);
 #endif
 #if defined(OMAP_5430)
+		int rv __diagused;
 		bus_space_tag_t iot = _bs_tag;
 		bus_space_handle_t ioh;
 		omap2_gpio_ctl(80, GPIO_PIN_OUTPUT);



CVS commit: [netbsd-9] src/sys/arch/evbarm/beagle

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:47:13 UTC 2019

Modified Files:
src/sys/arch/evbarm/beagle [netbsd-9]: beagle_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #466):
sys/arch/evbarm/beagle/beagle_machdep.c: revision 1.80
"rv" is only used on some boards and only with options DIAGNOSTIC.
So move the declaration into the proper #ifdef block.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 \
src/sys/arch/evbarm/beagle/beagle_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-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:35:26 UTC 2019

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

Log Message:
 Modify PHY initialization code. This change fix a bug that SK-9D21 doesn't
detect MII PHY.
 - Add error check to bge_miibus_writereg().
 - Change return value of bge_miibus_readreg() when a read error occurred.
   It also add error message using with aprint_debug_dev(). This error occurs
   on some devices while detecting MII devices.
 - Move the location of BGE_MI_MODE register's initialization to next to
   bge_chipinit().
 - Set BGE_MAC_MODE before calling ifmedia_init() and/or mii_attach().
 - Add retry code for mii_attach() failed. Same as FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/sys/dev/pci/if_bge.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-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:35:26 UTC 2019

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

Log Message:
 Modify PHY initialization code. This change fix a bug that SK-9D21 doesn't
detect MII PHY.
 - Add error check to bge_miibus_writereg().
 - Change return value of bge_miibus_readreg() when a read error occurred.
   It also add error message using with aprint_debug_dev(). This error occurs
   on some devices while detecting MII devices.
 - Move the location of BGE_MI_MODE register's initialization to next to
   bge_chipinit().
 - Set BGE_MAC_MODE before calling ifmedia_init() and/or mii_attach().
 - Add retry code for mii_attach() failed. Same as FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/sys/dev/pci/if_bge.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/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.341 src/sys/dev/pci/if_bge.c:1.342
--- src/sys/dev/pci/if_bge.c:1.341	Mon Nov 25 05:18:59 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 05:35:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.342 2019/11/25 05:35:26 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.342 2019/11/25 05:35:26 msaitoh Exp $");
 
 #include 
 #include 
@@ -1113,9 +1113,11 @@ bge_miibus_readreg(device_t dev, int phy
 	if (i == BGE_TIMEOUT) {
 		aprint_error_dev(sc->bge_dev, "PHY read timed out\n");
 		rv = ETIMEDOUT;
-	} else if ((data & BGE_MICOMM_READFAIL) != 0)
-		rv = -1;
-	else
+	} else if ((data & BGE_MICOMM_READFAIL) != 0) {
+		/* XXX This error occurs on some devices while attaching. */
+		aprint_debug_dev(sc->bge_dev, "PHY read I/O error\n");
+		rv = EIO;
+	} else
 		*val = data & BGE_MICOMM_DATA;
 
 	if (autopoll & BGE_MIMODE_AUTOPOLL) {
@@ -1133,7 +1135,8 @@ static int
 bge_miibus_writereg(device_t dev, int phy, int reg, uint16_t val)
 {
 	struct bge_softc *sc = device_private(dev);
-	uint32_t autopoll;
+	uint32_t data, autopoll;
+	int rv = 0;
 	int i;
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 &&
@@ -1156,13 +1159,22 @@ bge_miibus_writereg(device_t dev, int ph
 
 	for (i = 0; i < BGE_TIMEOUT; i++) {
 		delay(10);
-		if (!(CSR_READ_4(sc, BGE_MI_COMM) & BGE_MICOMM_BUSY)) {
+		data = CSR_READ_4(sc, BGE_MI_COMM);
+		if (!(data & BGE_MICOMM_BUSY)) {
 			delay(5);
-			CSR_READ_4(sc, BGE_MI_COMM);
+			data = CSR_READ_4(sc, BGE_MI_COMM);
 			break;
 		}
 	}
 
+	if (i == BGE_TIMEOUT) {
+		aprint_error_dev(sc->bge_dev, "PHY write timed out\n");
+		rv = ETIMEDOUT;
+	} else if ((data & BGE_MICOMM_READFAIL) != 0) {
+		aprint_error_dev(sc->bge_dev, "PHY write I/O error\n");
+		rv = EIO;
+	}
+
 	if (autopoll & BGE_MIMODE_AUTOPOLL) {
 		BGE_STS_SETBIT(sc, BGE_STS_AUTOPOLL);
 		BGE_SETBIT_FLUSH(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL);
@@ -1176,7 +1188,7 @@ bge_miibus_writereg(device_t dev, int ph
 		return ETIMEDOUT;
 	}
 
-	return 0;
+	return rv;
 }
 
 static void
@@ -3176,14 +3188,14 @@ bge_attach(device_t parent, device_t sel
 	uint32_t		command;
 	struct ifnet		*ifp;
 	struct mii_data * const mii = >bge_mii;
-	uint32_t		misccfg, mimode;
+	uint32_t		misccfg, mimode, macmode;
 	void *			kva;
 	u_char			eaddr[ETHER_ADDR_LEN];
 	pcireg_t		memtype, subid, reg;
 	bus_addr_t		memaddr;
 	uint32_t		pm_ctl;
 	bool			no_seeprom;
-	int			capmask;
+	int			capmask, trys;
 	int			mii_flags;
 	int			map_flags;
 	char intrbuf[PCI_INTRSTR_LEN];
@@ -3427,15 +3439,6 @@ bge_attach(device_t parent, device_t sel
 	BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
 		sc->bge_flags |= BGEF_CPMU_PRESENT;
 
-	/* Set MI_MODE */
-	mimode = BGE_MIMODE_PHYADDR(sc->bge_phy_addr);
-	if ((sc->bge_flags & BGEF_CPMU_PRESENT) != 0)
-		mimode |= BGE_MIMODE_500KHZ_CONST;
-	else
-		mimode |= BGE_MIMODE_BASE;
-	CSR_WRITE_4(sc, BGE_MI_MODE, mimode);
-	DELAY(80);
-
 	/*
 	 * When using the BCM5701 in PCI-X mode, data corruption has
 	 * been observed in the first few bytes of some received packets.
@@ -3680,6 +3683,21 @@ bge_attach(device_t parent, device_t sel
 		return;
 	}
 
+	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700) {
+		BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL,
+		BGE_MLC_MISCIO_OUT1 | BGE_MLC_MISCIO_OUTEN1);
+		DELAY(100);
+	}
+
+	/* Set MI_MODE */
+	mimode = BGE_MIMODE_PHYADDR(sc->bge_phy_addr);
+	if ((sc->bge_flags & BGEF_CPMU_PRESENT) != 0)
+		mimode |= BGE_MIMODE_500KHZ_CONST;
+	else
+		mimode |= BGE_MIMODE_BASE;
+	CSR_WRITE_4_FLUSH(sc, BGE_MI_MODE, mimode);
+	DELAY(80);
+
 	/*
 	 * Get station address from the EEPROM.
 	 */
@@ -3866,8 +3884,14 @@ bge_attach(device_t parent, device_t sel
 	prop_dictionary_set_uint32(dict, "phyflags", sc->bge_phy_flags);
 	prop_dictionary_set_uint32(dict, "chipid", 

CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:18:59 UTC 2019

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

Log Message:
- Use *_FLUSH() more. The main purpose is to wait following delay() correctly.
- Add missing DELAY(80) after writing BGE_MI_MODE register.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/dev/pci/if_bge.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/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.340 src/sys/dev/pci/if_bge.c:1.341
--- src/sys/dev/pci/if_bge.c:1.340	Mon Nov 25 04:52:27 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 05:18:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -1027,10 +1027,10 @@ bge_eeprom_getbyte(struct bge_softc *sc,
 	 * Enable use of auto EEPROM access so we can avoid
 	 * having to use the bitbang method.
 	 */
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	/* Reset the EEPROM, load the clock period. */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	DELAY(20);
 
@@ -2280,7 +2280,7 @@ bge_chipinit(struct bge_softc *sc)
 #endif
 
 	/* Set the timer prescaler (always 66MHz) */
-	CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
+	CSR_WRITE_4_FLUSH(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
 		DELAY(40);	/* XXX */
@@ -3434,6 +3434,7 @@ bge_attach(device_t parent, device_t sel
 	else
 		mimode |= BGE_MIMODE_BASE;
 	CSR_WRITE_4(sc, BGE_MI_MODE, mimode);
+	DELAY(80);
 
 	/*
 	 * When using the BCM5701 in PCI-X mode, data corruption has
@@ -3630,10 +3631,10 @@ bge_attach(device_t parent, device_t sel
 	 * Reset NVRAM before bge_reset(). It's required to acquire NVRAM
 	 * lock in bge_reset().
 	 */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	delay(1000);
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	bge_stop_fw(sc);
 	bge_sig_pre_reset(sc, BGE_RESET_START);
@@ -5670,10 +5671,10 @@ bge_ifmedia_upd(struct ifnet *ifp)
 			break;
 		case IFM_1000_SX:
 			if ((ifm->ifm_media & IFM_FDX) != 0) {
-BGE_CLRBIT(sc, BGE_MAC_MODE,
+BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			} else {
-BGE_SETBIT(sc, BGE_MAC_MODE,
+BGE_SETBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			}
 			DELAY(40);
@@ -6071,7 +6072,7 @@ bge_link_upd(struct bge_softc *sc)
 BGE_STS_SETBIT(sc, BGE_STS_LINK);
 if (BGE_ASICREV(sc->bge_chipid)
 == BGE_ASICREV_BCM5704) {
-	BGE_CLRBIT(sc, BGE_MAC_MODE,
+	BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 	BGE_MACMODE_TBI_SEND_CFGS);
 	DELAY(40);
 }



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:18:59 UTC 2019

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

Log Message:
- Use *_FLUSH() more. The main purpose is to wait following delay() correctly.
- Add missing DELAY(80) after writing BGE_MI_MODE register.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/dev/pci/if_bge.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-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 04:52:27 UTC 2019

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

Log Message:
 Fix a bug that SK-9D41 can't detect fiber media. Check the subsystem ID
correctly. This bug was added in if_bge.c rev. 1.161.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/sys/dev/pci/if_bge.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-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 04:52:27 UTC 2019

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

Log Message:
 Fix a bug that SK-9D41 can't detect fiber media. Check the subsystem ID
correctly. This bug was added in if_bge.c rev. 1.161.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/sys/dev/pci/if_bge.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/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.339 src/sys/dev/pci/if_bge.c:1.340
--- src/sys/dev/pci/if_bge.c:1.339	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 04:52:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.339 2019/11/10 21:16:36 chs Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.339 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $");
 
 #include 
 #include 
@@ -3847,7 +3847,7 @@ bge_attach(device_t parent, device_t sel
 	 * by its PCI subsystem ID, as we do below for the SysKonnect SK-9D41.
 	 * The SysKonnect SK-9D41 is a 1000baseSX card.
 	 */
-	if (PCI_PRODUCT(pa->pa_id) == SK_SUBSYSID_9D41 ||
+	if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
 	(hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
 		if (BGE_IS_5705_PLUS(sc)) {
 			sc->bge_flags |= BGEF_FIBER_MII;



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

2019-11-24 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Nov 25 00:54:47 UTC 2019

Modified Files:
src/sys/arch/arm/imx: if_enet_imx6.c

Log Message:
Fixed bug.

* typo


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/if_enet_imx6.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/arm/imx

2019-11-24 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Mon Nov 25 00:54:47 UTC 2019

Modified Files:
src/sys/arch/arm/imx: if_enet_imx6.c

Log Message:
Fixed bug.

* typo


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/if_enet_imx6.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/imx/if_enet_imx6.c
diff -u src/sys/arch/arm/imx/if_enet_imx6.c:1.7 src/sys/arch/arm/imx/if_enet_imx6.c:1.8
--- src/sys/arch/arm/imx/if_enet_imx6.c:1.7	Tue Nov 12 05:09:29 2019
+++ src/sys/arch/arm/imx/if_enet_imx6.c	Mon Nov 25 00:54:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_enet_imx6.c,v 1.7 2019/11/12 05:09:29 hkenken Exp $	*/
+/*	$NetBSD: if_enet_imx6.c,v 1.8 2019/11/25 00:54:47 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_enet_imx6.c,v 1.7 2019/11/12 05:09:29 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet_imx6.c,v 1.8 2019/11/25 00:54:47 hkenken Exp $");
 
 #include "locators.h"
 #include "imxccm.h"
@@ -132,7 +132,7 @@ enet_attach(device_t parent, device_t se
 	}
 
 	sc->sc_clk_ipg = imx6_get_clock("enet");
-	if (sc->sc_clk_enet == NULL) {
+	if (sc->sc_clk_ipg == NULL) {
 		aprint_error(": couldn't get clock ipg\n");
 		return;
 	}



CVS commit: src/distrib/notes/sparc

2019-11-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Nov 24 23:26:43 UTC 2019

Modified Files:
src/distrib/notes/sparc: prep

Log Message:
Quote long .Ss2 title to avoid troff's limitation.

Troff is limited to 9 macro parameters and this title is 10 words, so
we lose the last word here when we pass arguments around.  We have
more titles like that but for now I wanted to commit only one just to
flag the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/notes/sparc/prep

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/sparc/prep
diff -u src/distrib/notes/sparc/prep:1.27 src/distrib/notes/sparc/prep:1.28
--- src/distrib/notes/sparc/prep:1.27	Tue May 19 19:30:29 2015
+++ src/distrib/notes/sparc/prep	Sun Nov 24 23:26:43 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prep,v 1.27 2015/05/19 19:30:29 snj Exp $
+.\"	$NetBSD: prep,v 1.28 2019/11/24 23:26:43 uwe Exp $
 .
 .Ss2 Configuring your PROM
 .
@@ -212,7 +212,7 @@ kernel) to ensure that your disks remain
 .Nx
 device unit numbers even if you add disks to your system at a later time.
 .
-.Ss2 Determining how to access your SCSI disk from the PROM
+.Ss2 "Determining how to access your SCSI disk from the PROM"
 .
 sunmon and OpenBoot PROM 1 use an archaic
 .Li sd( Ns Ar c,u,p Ns Ic \&)



CVS commit: src/distrib/notes/sparc

2019-11-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Nov 24 23:26:43 UTC 2019

Modified Files:
src/distrib/notes/sparc: prep

Log Message:
Quote long .Ss2 title to avoid troff's limitation.

Troff is limited to 9 macro parameters and this title is 10 words, so
we lose the last word here when we pass arguments around.  We have
more titles like that but for now I wanted to commit only one just to
flag the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/notes/sparc/prep

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



CVS commit: src/distrib/notes/common

2019-11-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Nov 24 16:16:21 UTC 2019

Modified Files:
src/distrib/notes/common: main

Log Message:
Add "Oxford comma"


To generate a diff of this commit:
cvs rdiff -u -r1.554 -r1.555 src/distrib/notes/common/main

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/common/main
diff -u src/distrib/notes/common/main:1.554 src/distrib/notes/common/main:1.555
--- src/distrib/notes/common/main:1.554	Sun Nov 24 11:15:33 2019
+++ src/distrib/notes/common/main	Sun Nov 24 16:16:21 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.554 2019/11/24 11:15:33 martin Exp $
+.\"	$NetBSD: main,v 1.555 2019/11/24 16:16:21 pgoyette Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -520,7 +520,7 @@ would not exist.
 .ie \n[RELEASE_BRANCH] .Ss Changes Between The NetBSD \n[oldvers] \
 and \n[major] Releases
 .el .Ss Changes Between The NetBSD \n[oldvers], \
-the \n[major] Releases and newer.
+the \n[major] Releases, and newer.
 .Pp
 The
 .Nx



CVS commit: src/distrib/notes/common

2019-11-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Nov 24 16:16:21 UTC 2019

Modified Files:
src/distrib/notes/common: main

Log Message:
Add "Oxford comma"


To generate a diff of this commit:
cvs rdiff -u -r1.554 -r1.555 src/distrib/notes/common/main

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



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

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:53:47 UTC 2019

Modified Files:
src/sys/arch/sun68k/include: cpu.h

Log Message:
Correction to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sun68k/include/cpu.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/sun68k/include/cpu.h
diff -u src/sys/arch/sun68k/include/cpu.h:1.25 src/sys/arch/sun68k/include/cpu.h:1.26
--- src/sys/arch/sun68k/include/cpu.h:1.25	Sat Nov 23 19:40:37 2019
+++ src/sys/arch/sun68k/include/cpu.h	Sun Nov 24 15:53:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.25 2019/11/23 19:40:37 ad Exp $	*/
+/*	$NetBSD: cpu.h,v 1.26 2019/11/24 15:53:47 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -132,7 +132,7 @@ extern int astpending;	 /* need to trap 
  * Preempt the current process if in interrupt from user mode,
  * or after the current trap/syscall if in system mode.
  */
-#define	cpu_need_resched(ci,flags)	do {	\
+#define	cpu_need_resched(ci,l,flags)	do {	\
 	__USE(flags); \
 	aston();\
 } while (/*CONSTCOND*/0)



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

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:53:47 UTC 2019

Modified Files:
src/sys/arch/sun68k/include: cpu.h

Log Message:
Correction to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sun68k/include/cpu.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/powerpc/pic

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:49:12 UTC 2019

Modified Files:
src/sys/arch/powerpc/pic: ipi.c ipivar.h

Log Message:
Add IPI_AST.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/ipi.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/pic/ipivar.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/powerpc/pic/ipi.c
diff -u src/sys/arch/powerpc/pic/ipi.c:1.12 src/sys/arch/powerpc/pic/ipi.c:1.13
--- src/sys/arch/powerpc/pic/ipi.c:1.12	Fri Jan 23 07:27:05 2015
+++ src/sys/arch/powerpc/pic/ipi.c	Sun Nov 24 15:49:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ipi.c,v 1.12 2015/01/23 07:27:05 nonaka Exp $ */
+/* $NetBSD: ipi.c,v 1.13 2019/11/24 15:49:12 ad Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.12 2015/01/23 07:27:05 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.13 2019/11/24 15:49:12 ad Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_pic.h"
@@ -78,6 +78,9 @@ ipi_intr(void *v)
 	if (ipi & IPI_SUSPEND)
 		cpu_pause(NULL);
 
+	if (ipi & IPI_AST)
+		ci->ci_data.cpu_onproc->l_md.md_astpending = 1;
+
 	if (ipi & IPI_HALT) {
 		struct cpuset_info * const csi = _info;
 		aprint_normal("halting CPU %d\n", cpu_id);

Index: src/sys/arch/powerpc/pic/ipivar.h
diff -u src/sys/arch/powerpc/pic/ipivar.h:1.9 src/sys/arch/powerpc/pic/ipivar.h:1.10
--- src/sys/arch/powerpc/pic/ipivar.h:1.9	Thu Apr 19 21:50:07 2018
+++ src/sys/arch/powerpc/pic/ipivar.h	Sun Nov 24 15:49:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ipivar.h,v 1.9 2018/04/19 21:50:07 christos Exp $ */
+/* $NetBSD: ipivar.h,v 1.10 2019/11/24 15:49:12 ad Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipivar.h,v 1.9 2018/04/19 21:50:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipivar.h,v 1.10 2019/11/24 15:49:12 ad Exp $");
 
 #ifndef _IPI_VAR_H_
 #define _IPI_VAR_H_
@@ -56,6 +56,7 @@ struct ipi_ops {
 #define IPI_KPREEMPT		0x0004
 #define IPI_GENERIC		0x0008
 #define IPI_SUSPEND		0x0010
+#define	IPI_AST			0x0020
 
 /* OpenPIC */
 void setup_openpic_ipi(void);



CVS commit: src/sys/arch/powerpc/pic

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:49:12 UTC 2019

Modified Files:
src/sys/arch/powerpc/pic: ipi.c ipivar.h

Log Message:
Add IPI_AST.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/pic/ipi.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/pic/ipivar.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/ia64/include

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:45:41 UTC 2019

Modified Files:
src/sys/arch/ia64/include: cpu.h

Log Message:
Make ci_want_resched a u_int.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/ia64/include/cpu.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/ia64/include/cpu.h
diff -u src/sys/arch/ia64/include/cpu.h:1.18 src/sys/arch/ia64/include/cpu.h:1.19
--- src/sys/arch/ia64/include/cpu.h:1.18	Sat Nov 23 19:40:35 2019
+++ src/sys/arch/ia64/include/cpu.h	Sun Nov 24 15:45:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.18 2019/11/23 19:40:35 ad Exp $	*/
+/*	$NetBSD: cpu.h,v 1.19 2019/11/24 15:45:41 ad Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -107,7 +107,8 @@ struct cpu_info {
 	struct lwp *ci_fpcurlwp;	/* current owner of the FPU */
 	paddr_t ci_curpcb;		/* PA of current HW PCB */
 	struct pcb *ci_idle_pcb;	/* our idle PCB */
-	u_long ci_want_resched;		/* preempt current process */
+	u_int ci_want_resched;		/* preempt current process */
+	u_int ci_unused;		/* unused */
 	u_long ci_intrdepth;		/* interrupt trap depth */
 	struct trapframe *ci_db_regs;	/* registers for debuggers */
 	uint64_t ci_clock;		/* clock counter */



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

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:45:41 UTC 2019

Modified Files:
src/sys/arch/ia64/include: cpu.h

Log Message:
Make ci_want_resched a u_int.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/ia64/include/cpu.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/alpha/include

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:40:24 UTC 2019

Modified Files:
src/sys/arch/alpha/include: cpu.h

Log Message:
Make ci_want_resched a u_int.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/alpha/include/cpu.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/alpha/include

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:40:24 UTC 2019

Modified Files:
src/sys/arch/alpha/include: cpu.h

Log Message:
Make ci_want_resched a u_int.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/alpha/include/cpu.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/alpha/include/cpu.h
diff -u src/sys/arch/alpha/include/cpu.h:1.84 src/sys/arch/alpha/include/cpu.h:1.85
--- src/sys/arch/alpha/include/cpu.h:1.84	Wed Aug 22 01:05:21 2018
+++ src/sys/arch/alpha/include/cpu.h	Sun Nov 24 15:40:24 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.84 2018/08/22 01:05:21 msaitoh Exp $ */
+/* $NetBSD: cpu.h,v 1.85 2019/11/24 15:40:24 ad Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -121,7 +121,8 @@ struct cpu_info {
 	struct mchkinfo ci_mcinfo;	/* machine check info */
 	cpuid_t ci_cpuid;		/* our CPU ID */
 	struct cpu_softc *ci_softc;	/* pointer to our device */
-	u_long ci_want_resched;		/* preempt current process */
+	u_int ci_want_resched;		/* preempt current process */
+	u_int ci_unused;		/* unused */
 	u_long ci_intrdepth;		/* interrupt trap depth */
 	struct trapframe *ci_db_regs;	/* registers for debuggers */
 	uint64_t ci_pcc_freq;		/* cpu cycles/second */



CVS commit: src/sys/arch/mips/mips

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:37:39 UTC 2019

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/mips/cpu_subr.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/mips/mips

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:37:39 UTC 2019

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/mips/cpu_subr.c

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

Modified files:

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.36 src/sys/arch/mips/mips/cpu_subr.c:1.37
--- src/sys/arch/mips/mips/cpu_subr.c:1.36	Sat Nov 23 19:40:35 2019
+++ src/sys/arch/mips/mips/cpu_subr.c	Sun Nov 24 15:37:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.36 2019/11/23 19:40:35 ad Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.37 2019/11/24 15:37:39 ad Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.36 2019/11/23 19:40:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.37 2019/11/24 15:37:39 ad Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -495,7 +495,7 @@ cpu_need_resched(struct cpu_info *ci, st
 #endif
 		return;
 	}
-	if ((flags & RESSCHED_REMOTE) != 0) {
+	if ((flags & RESCHED_REMOTE) != 0) {
 #ifdef MULTIPROCESSOR
 		cpu_send_ipi(ci, IPI_AST);
 #endif



CVS commit: src/sys/kern

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 13:23:57 UTC 2019

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

Log Message:
lwp_start(): don't try to change the target CPU.  Fixes potential panic
in setrunnable(). Oops, experimental change that escaped.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/sys/kern/kern_lwp.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-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 13:23:57 UTC 2019

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

Log Message:
lwp_start(): don't try to change the target CPU.  Fixes potential panic
in setrunnable(). Oops, experimental change that escaped.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/sys/kern/kern_lwp.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_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.213 src/sys/kern/kern_lwp.c:1.214
--- src/sys/kern/kern_lwp.c:1.213	Sun Nov 24 13:14:23 2019
+++ src/sys/kern/kern_lwp.c	Sun Nov 24 13:23:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.213 2019/11/24 13:14:23 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.214 2019/11/24 13:23:57 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -209,7 +209,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.213 2019/11/24 13:14:23 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.214 2019/11/24 13:23:57 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -1003,7 +1003,6 @@ lwp_start(lwp_t *l, int flags)
 		p->p_nrlwps--;
 		lwp_unlock(l);
 	} else {
-		l->l_cpu = curcpu();
 		setrunnable(l);
 		/* LWP now unlocked */
 	}



CVS commit: src/sys/kern

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 13:14:23 UTC 2019

Modified Files:
src/sys/kern: kern_lwp.c kern_turnstile.c

Log Message:
Put section attribute for turnstile0 in the correct place.  For LLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_turnstile.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-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 13:14:23 UTC 2019

Modified Files:
src/sys/kern: kern_lwp.c kern_turnstile.c

Log Message:
Put section attribute for turnstile0 in the correct place.  For LLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_turnstile.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_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.212 src/sys/kern/kern_lwp.c:1.213
--- src/sys/kern/kern_lwp.c:1.212	Sat Nov 23 19:42:52 2019
+++ src/sys/kern/kern_lwp.c	Sun Nov 24 13:14:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.212 2019/11/23 19:42:52 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.213 2019/11/24 13:14:23 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -209,7 +209,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.212 2019/11/23 19:42:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.213 2019/11/24 13:14:23 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -259,7 +259,7 @@ SDT_PROBE_DEFINE1(proc, kernel, , lwp__c
 SDT_PROBE_DEFINE1(proc, kernel, , lwp__start, "struct lwp *");
 SDT_PROBE_DEFINE1(proc, kernel, , lwp__exit, "struct lwp *");
 
-struct turnstile turnstile0;
+struct turnstile turnstile0 __cacheline_aligned;
 struct lwp lwp0 __aligned(MIN_LWP_ALIGNMENT) = {
 #ifdef LWP0_CPU_INFO
 	.l_cpu = LWP0_CPU_INFO,

Index: src/sys/kern/kern_turnstile.c
diff -u src/sys/kern/kern_turnstile.c:1.33 src/sys/kern/kern_turnstile.c:1.34
--- src/sys/kern/kern_turnstile.c:1.33	Thu Nov 21 18:56:55 2019
+++ src/sys/kern/kern_turnstile.c	Sun Nov 24 13:14:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_turnstile.c,v 1.33 2019/11/21 18:56:55 ad Exp $	*/
+/*	$NetBSD: kern_turnstile.c,v 1.34 2019/11/24 13:14:23 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2009, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.33 2019/11/21 18:56:55 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.34 2019/11/24 13:14:23 ad Exp $");
 
 #include 
 #include 
@@ -82,7 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_turnsti
 static tschain_t	turnstile_chains[TS_HASH_SIZE] __cacheline_aligned;
 static kmutex_t		*turnstile_locks[TS_HASH_SIZE] __read_mostly;
 pool_cache_t		turnstile_cache __read_mostly;
-extern turnstile_t	turnstile0 __cacheline_aligned;
+extern turnstile_t	turnstile0;
 
 static int		turnstile_ctor(void *, void *, int);
 



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

2019-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 24 12:21:14 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_drm.c

Log Message:
Reclaim bootloader FB memory for CMA pool.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sunxi/sunxi_drm.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/sunxi/sunxi_drm.c
diff -u src/sys/arch/arm/sunxi/sunxi_drm.c:1.8 src/sys/arch/arm/sunxi/sunxi_drm.c:1.9
--- src/sys/arch/arm/sunxi/sunxi_drm.c:1.8	Tue Nov  5 23:31:23 2019
+++ src/sys/arch/arm/sunxi/sunxi_drm.c	Sun Nov 24 12:21:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_drm.c,v 1.8 2019/11/05 23:31:23 jmcneill Exp $ */
+/* $NetBSD: sunxi_drm.c,v 1.9 2019/11/24 12:21:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.8 2019/11/05 23:31:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.9 2019/11/24 12:21:14 jmcneill Exp $");
 
 #include 
 #include 
@@ -296,6 +296,27 @@ static struct drm_mode_config_funcs sunx
 };
 
 static int
+sunxi_drm_simplefb_lookup(bus_addr_t *paddr, bus_size_t *psize)
+{
+	static const char * compat[] = { "simple-framebuffer", NULL };
+	int chosen, child;
+
+	chosen = OF_finddevice("/chosen");
+	if (chosen == -1)
+		return ENOENT;
+
+	for (child = OF_child(chosen); child; child = OF_peer(child)) {
+		if (!fdtbus_status_okay(child))
+			continue;
+		if (!of_match_compatible(child, compat))
+			continue;
+		return fdtbus_get_reg(child, 0, paddr, psize);
+	}
+
+	return ENOENT;
+}
+
+static int
 sunxi_drm_fb_probe(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes)
 {
 	struct sunxi_drm_softc * const sc = sunxi_drm_private(helper->dev);
@@ -303,6 +324,8 @@ sunxi_drm_fb_probe(struct drm_fb_helper 
 	struct sunxi_drm_framebuffer *sfb = to_sunxi_drm_framebuffer(helper->fb);
 	struct drm_framebuffer *fb = helper->fb;
 	struct sunxi_drmfb_attach_args sfa;
+	bus_addr_t sfb_addr;
+	bus_size_t sfb_size;
 	size_t cma_size;
 	int error;
 
@@ -312,14 +335,31 @@ sunxi_drm_fb_probe(struct drm_fb_helper 
 
 	const size_t size = roundup(height * pitch, PAGE_SIZE);
 
-	/* Reserve enough memory for the FB console plus a 4K plane, rounded to 1MB */
-	cma_size = size;
-	cma_size += (SUNXI_DRM_MAX_WIDTH * SUNXI_DRM_MAX_HEIGHT * 4);
+	if (sunxi_drm_simplefb_lookup(_addr, _size) != 0)
+		sfb_size = 0;
+
+	/* Reserve enough memory for a 4K plane, rounded to 1MB */
+	cma_size = (SUNXI_DRM_MAX_WIDTH * SUNXI_DRM_MAX_HEIGHT * 4);
+	if (sfb_size == 0) {
+		/* Add memory for FB console if we cannot reclaim bootloader memory */
+		cma_size += size;
+	}
 	cma_size = roundup(cma_size, 1024 * 1024);
 	sc->sc_ddev->cma_pool = sunxi_drm_alloc_cma_pool(sc->sc_ddev, cma_size);
-	if (sc->sc_ddev->cma_pool != NULL)
-		aprint_normal_dev(sc->sc_dev, "reserved %u MB DRAM for CMA\n",
-		(u_int)(cma_size / (1024 * 1024)));
+	if (sc->sc_ddev->cma_pool != NULL) {
+		if (sfb_size != 0) {
+			error = vmem_add(sc->sc_ddev->cma_pool, sfb_addr,
+			sfb_size, VM_SLEEP);
+			if (error != 0)
+sfb_size = 0;
+		}
+		aprint_normal_dev(sc->sc_dev, "reserved %u MB DRAM for CMA",
+		(u_int)((cma_size + sfb_size) / (1024 * 1024)));
+		if (sfb_size != 0)
+			aprint_normal(" (%u MB reclaimed from bootloader)",
+			(u_int)(sfb_size / (1024 * 1024)));
+		aprint_normal("\n");
+	}
 
 	sfb->obj = drm_gem_cma_create(ddev, size);
 	if (sfb->obj == NULL) {



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

2019-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 24 12:21:14 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_drm.c

Log Message:
Reclaim bootloader FB memory for CMA pool.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sunxi/sunxi_drm.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/aarch64/aarch64

2019-11-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Nov 24 11:45:00 UTC 2019

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

Log Message:
part of PR port-arm/54702

Make sure that md_march32 and ep_machine_arch have same size.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/exec_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/arch/aarch64/aarch64

2019-11-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Nov 24 11:45:00 UTC 2019

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

Log Message:
part of PR port-arm/54702

Make sure that md_march32 and ep_machine_arch have same size.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/exec_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/exec_machdep.c
diff -u src/sys/arch/aarch64/aarch64/exec_machdep.c:1.5 src/sys/arch/aarch64/aarch64/exec_machdep.c:1.6
--- src/sys/arch/aarch64/aarch64/exec_machdep.c:1.5	Sun Nov 24 04:08:36 2019
+++ src/sys/arch/aarch64/aarch64/exec_machdep.c	Sun Nov 24 11:45:00 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_machdep.c,v 1.5 2019/11/24 04:08:36 rin Exp $ */
+/* $NetBSD: exec_machdep.c,v 1.6 2019/11/24 11:45:00 rin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.5 2019/11/24 04:08:36 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.6 2019/11/24 11:45:00 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -86,6 +86,8 @@ aarch64_netbsd_elf32_probe(struct lwp *l
 	/*
 	 * Copy (if any) the machine_arch of the executable to the proc.
 	 */
+	CTASSERT(sizeof(l->l_proc->p_md.md_march32) ==
+	sizeof(epp->ep_machine_arch));
 	if (epp->ep_machine_arch[0] != 0)
 		strlcpy(l->l_proc->p_md.md_march32, epp->ep_machine_arch,
 		sizeof(l->l_proc->p_md.md_march32));



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

2019-11-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Nov 24 11:28:40 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: proc.h

Log Message:
part of PR port-arm/54702

Having md_march32 unconditionally in struct mdproc, in order to
make libkvm happy.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/proc.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/aarch64/include/proc.h
diff -u src/sys/arch/aarch64/include/proc.h:1.4 src/sys/arch/aarch64/include/proc.h:1.5
--- src/sys/arch/aarch64/include/proc.h:1.4	Sun Nov 24 04:08:36 2019
+++ src/sys/arch/aarch64/include/proc.h	Sun Nov 24 11:28:40 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.h,v 1.4 2019/11/24 04:08:36 rin Exp $ */
+/* $NetBSD: proc.h,v 1.5 2019/11/24 11:28:40 rin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,9 +47,7 @@ struct mdlwp {
 
 struct mdproc {
 	void (*md_syscall)(struct trapframe *);
-#ifdef COMPAT_NETBSD32
 	char md_march32[12];	/* machine arch of executable */
-#endif
 };
 
 #ifdef COMPAT_NETBSD32



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

2019-11-24 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Nov 24 11:28:40 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: proc.h

Log Message:
part of PR port-arm/54702

Having md_march32 unconditionally in struct mdproc, in order to
make libkvm happy.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/proc.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

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:23:16 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: genassym.cf
src/sys/arch/arm/arm32: genassym.cf

Log Message:
corect #include order


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/aarch64/genassym.cf
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/arm/arm32/genassym.cf

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



CVS commit: src/sys/arch

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:23:16 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: genassym.cf
src/sys/arch/arm/arm32: genassym.cf

Log Message:
corect #include order


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/aarch64/genassym.cf
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/arm/arm32/genassym.cf

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/genassym.cf
diff -u src/sys/arch/aarch64/aarch64/genassym.cf:1.14 src/sys/arch/aarch64/aarch64/genassym.cf:1.15
--- src/sys/arch/aarch64/aarch64/genassym.cf:1.14	Sat Sep  7 11:15:25 2019
+++ src/sys/arch/aarch64/aarch64/genassym.cf	Sun Nov 24 11:23:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.14 2019/09/07 11:15:25 ryo Exp $
+# $NetBSD: genassym.cf,v 1.15 2019/11/24 11:23:16 skrll Exp $
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,6 +28,12 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #-
 
+if defined(_KERNEL_OPT)
+include "opt_multiprocessor.h"
+include "opt_compat_netbsd.h"
+include "opt_execfmt.h"
+endif
+
 include 
 include 
 include 
@@ -52,12 +58,6 @@ include 
 include 
 include 
 
-if defined(_KERNEL_OPT)
-include "opt_multiprocessor.h"
-include "opt_compat_netbsd.h"
-include "opt_execfmt.h"
-endif
-
 define	__HAVE_FAST_SOFTINTS	1
 
 #ifdef __HAVE_PIC_FAST_SOFTINTS

Index: src/sys/arch/arm/arm32/genassym.cf
diff -u src/sys/arch/arm/arm32/genassym.cf:1.81 src/sys/arch/arm/arm32/genassym.cf:1.82
--- src/sys/arch/arm/arm32/genassym.cf:1.81	Sat Nov 23 19:40:34 2019
+++ src/sys/arch/arm/arm32/genassym.cf	Sun Nov 24 11:23:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.81 2019/11/23 19:40:34 ad Exp $
+#	$NetBSD: genassym.cf,v 1.82 2019/11/24 11:23:16 skrll Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -30,6 +30,12 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 
+if defined(_KERNEL_OPT)
+include "opt_multiprocessor.h"
+include "opt_compat_netbsd.h"
+include "opt_execfmt.h"
+endif
+
 include 
 include 
 include 
@@ -55,12 +61,6 @@ include 
 include 
 include 
 
-if defined(_KERNEL_OPT)
-include "opt_multiprocessor.h"
-include "opt_compat_netbsd.h"
-include "opt_execfmt.h"
-endif
-
 define	__PROG32		1
 ifdef __ARM_FIQ_INDIRECT
 define	__ARM_FIQ_INDIRECT	1



CVS commit: src/distrib/notes

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 11:15:36 UTC 2019

Modified Files:
src/distrib/notes: Makefile.inc
src/distrib/notes/acorn32: contents
src/distrib/notes/alpha: contents
src/distrib/notes/amd64: contents
src/distrib/notes/amiga: contents
src/distrib/notes/arc: contents prep
src/distrib/notes/atari: contents
src/distrib/notes/bebox: contents
src/distrib/notes/cats: contents prep
src/distrib/notes/common: contents main postinstall sysinst upgrade
src/distrib/notes/emips: contents
src/distrib/notes/evbarm: contents
src/distrib/notes/evbppc: contents
src/distrib/notes/ews4800mips: contents
src/distrib/notes/hp300: contents
src/distrib/notes/hpcarm: contents
src/distrib/notes/hpcmips: contents
src/distrib/notes/hpcsh: contents
src/distrib/notes/hppa: contents
src/distrib/notes/i386: contents
src/distrib/notes/landisk: contents
src/distrib/notes/mac68k: contents
src/distrib/notes/macppc: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye: contents
src/distrib/notes/mvme68k: contents
src/distrib/notes/news68k: contents
src/distrib/notes/newsmips: contents
src/distrib/notes/next68k: contents
src/distrib/notes/ofppc: contents
src/distrib/notes/pmax: contents
src/distrib/notes/prep: contents
src/distrib/notes/rs6000: contents
src/distrib/notes/sandpoint: contents xfer
src/distrib/notes/sgimips: contents
src/distrib/notes/shark: contents
src/distrib/notes/sparc: contents
src/distrib/notes/sparc64: contents upgrade
src/distrib/notes/sun2: contents
src/distrib/notes/sun3: contents
src/distrib/notes/vax: contents
src/distrib/notes/x68k: contents

Log Message:
Modernize release notes:
 - use https where possible
 - adapt to cdn/nycdn and our current auto-build conventions
 - automate where possible
Many thanks to uwe for lots of *roff help.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/notes/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/acorn32/contents
cvs rdiff -u -r1.19 -r1.20 src/distrib/notes/alpha/contents
cvs rdiff -u -r1.8 -r1.9 src/distrib/notes/amd64/contents
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/amiga/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/arc/contents
cvs rdiff -u -r1.4 -r1.5 src/distrib/notes/arc/prep
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/atari/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/bebox/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/cats/contents
cvs rdiff -u -r1.13 -r1.14 src/distrib/notes/cats/prep
cvs rdiff -u -r1.179 -r1.180 src/distrib/notes/common/contents
cvs rdiff -u -r1.553 -r1.554 src/distrib/notes/common/main
cvs rdiff -u -r1.84 -r1.85 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.108 -r1.109 src/distrib/notes/common/sysinst
cvs rdiff -u -r1.30 -r1.31 src/distrib/notes/common/upgrade
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/emips/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/evbarm/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/evbppc/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/ews4800mips/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/hp300/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/hpcarm/contents
cvs rdiff -u -r1.13 -r1.14 src/distrib/notes/hpcmips/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/hpcsh/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/hppa/contents
cvs rdiff -u -r1.32 -r1.33 src/distrib/notes/i386/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/landisk/contents
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/mac68k/contents
cvs rdiff -u -r1.17 -r1.18 src/distrib/notes/macppc/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/macppc/prep.OPENFIRMWARE
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/mmeye/contents
cvs rdiff -u -r1.16 -r1.17 src/distrib/notes/mvme68k/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/news68k/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/newsmips/contents
cvs rdiff -u -r1.10 -r1.11 src/distrib/notes/next68k/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/ofppc/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/pmax/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/prep/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/rs6000/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sandpoint/contents
cvs rdiff -u -r1.3 -r1.4 src/distrib/notes/sandpoint/xfer
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sgimips/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/shark/contents
cvs rdiff -u -r1.24 -r1.25 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.8 -r1.9 src/distrib/notes/sparc64/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/sparc64/upgrade
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sun2/contents
cvs rdiff -u -r1.19 -r1.20 

CVS commit: src/distrib/notes

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 11:15:36 UTC 2019

Modified Files:
src/distrib/notes: Makefile.inc
src/distrib/notes/acorn32: contents
src/distrib/notes/alpha: contents
src/distrib/notes/amd64: contents
src/distrib/notes/amiga: contents
src/distrib/notes/arc: contents prep
src/distrib/notes/atari: contents
src/distrib/notes/bebox: contents
src/distrib/notes/cats: contents prep
src/distrib/notes/common: contents main postinstall sysinst upgrade
src/distrib/notes/emips: contents
src/distrib/notes/evbarm: contents
src/distrib/notes/evbppc: contents
src/distrib/notes/ews4800mips: contents
src/distrib/notes/hp300: contents
src/distrib/notes/hpcarm: contents
src/distrib/notes/hpcmips: contents
src/distrib/notes/hpcsh: contents
src/distrib/notes/hppa: contents
src/distrib/notes/i386: contents
src/distrib/notes/landisk: contents
src/distrib/notes/mac68k: contents
src/distrib/notes/macppc: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye: contents
src/distrib/notes/mvme68k: contents
src/distrib/notes/news68k: contents
src/distrib/notes/newsmips: contents
src/distrib/notes/next68k: contents
src/distrib/notes/ofppc: contents
src/distrib/notes/pmax: contents
src/distrib/notes/prep: contents
src/distrib/notes/rs6000: contents
src/distrib/notes/sandpoint: contents xfer
src/distrib/notes/sgimips: contents
src/distrib/notes/shark: contents
src/distrib/notes/sparc: contents
src/distrib/notes/sparc64: contents upgrade
src/distrib/notes/sun2: contents
src/distrib/notes/sun3: contents
src/distrib/notes/vax: contents
src/distrib/notes/x68k: contents

Log Message:
Modernize release notes:
 - use https where possible
 - adapt to cdn/nycdn and our current auto-build conventions
 - automate where possible
Many thanks to uwe for lots of *roff help.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/notes/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/acorn32/contents
cvs rdiff -u -r1.19 -r1.20 src/distrib/notes/alpha/contents
cvs rdiff -u -r1.8 -r1.9 src/distrib/notes/amd64/contents
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/amiga/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/arc/contents
cvs rdiff -u -r1.4 -r1.5 src/distrib/notes/arc/prep
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/atari/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/bebox/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/cats/contents
cvs rdiff -u -r1.13 -r1.14 src/distrib/notes/cats/prep
cvs rdiff -u -r1.179 -r1.180 src/distrib/notes/common/contents
cvs rdiff -u -r1.553 -r1.554 src/distrib/notes/common/main
cvs rdiff -u -r1.84 -r1.85 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.108 -r1.109 src/distrib/notes/common/sysinst
cvs rdiff -u -r1.30 -r1.31 src/distrib/notes/common/upgrade
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/emips/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/evbarm/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/evbppc/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/ews4800mips/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/hp300/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/hpcarm/contents
cvs rdiff -u -r1.13 -r1.14 src/distrib/notes/hpcmips/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/hpcsh/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/hppa/contents
cvs rdiff -u -r1.32 -r1.33 src/distrib/notes/i386/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/landisk/contents
cvs rdiff -u -r1.23 -r1.24 src/distrib/notes/mac68k/contents
cvs rdiff -u -r1.17 -r1.18 src/distrib/notes/macppc/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/macppc/prep.OPENFIRMWARE
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/mmeye/contents
cvs rdiff -u -r1.16 -r1.17 src/distrib/notes/mvme68k/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/news68k/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/newsmips/contents
cvs rdiff -u -r1.10 -r1.11 src/distrib/notes/next68k/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/ofppc/contents
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/pmax/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/prep/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/rs6000/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sandpoint/contents
cvs rdiff -u -r1.3 -r1.4 src/distrib/notes/sandpoint/xfer
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sgimips/contents
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/shark/contents
cvs rdiff -u -r1.24 -r1.25 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.8 -r1.9 src/distrib/notes/sparc64/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/sparc64/upgrade
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sun2/contents
cvs rdiff -u -r1.19 -r1.20 

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

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:10:13 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: gic_fdt.c

Log Message:
Remove unnecessary cast and wrap a long line.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/fdt/gic_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/arch/arm/fdt/gic_fdt.c
diff -u src/sys/arch/arm/fdt/gic_fdt.c:1.17 src/sys/arch/arm/fdt/gic_fdt.c:1.18
--- src/sys/arch/arm/fdt/gic_fdt.c:1.17	Fri Jul 19 12:14:15 2019
+++ src/sys/arch/arm/fdt/gic_fdt.c	Sun Nov 24 11:10:12 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.17 2019/07/19 12:14:15 hkenken Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.18 2019/11/24 11:10:12 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.17 2019/07/19 12:14:15 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.18 2019/11/24 11:10:12 skrll Exp $");
 
 #include 
 #include 
@@ -226,9 +226,9 @@ gic_fdt_attach_v2m(struct gic_fdt_softc 
 	if (gic_v2m_init(frame, sc->sc_gicdev, sc->sc_v2m_count++) != 0) {
 		aprint_error_dev(sc->sc_gicdev, "failed to initialize GICv2m\n");
 	} else {
-		aprint_normal_dev(sc->sc_gicdev, "GICv2m @ %#" PRIx64 ", SPIs %u-%u\n",
-		(uint64_t)frame->frame_reg, frame->frame_base,
-		frame->frame_base + frame->frame_count);
+		aprint_normal_dev(sc->sc_gicdev, "GICv2m @ %#" PRIx64
+		", SPIs %u-%u\n", frame->frame_reg,
+		frame->frame_base, frame->frame_base + frame->frame_count);
 	}
 }
 #endif



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

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:10:13 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: gic_fdt.c

Log Message:
Remove unnecessary cast and wrap a long line.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/fdt/gic_fdt.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/arm/imx

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:07:19 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_usbphy.c
src/sys/arch/arm/imx/fdt: imx6_gpio.c imx6_sdhc.c imx6_usb.c
imx6_usbphy.c

Log Message:
Use PRIxBUSADDR


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx6_usbphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/fdt/imx6_gpio.c \
src/sys/arch/arm/imx/fdt/imx6_usb.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/fdt/imx6_sdhc.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/fdt/imx6_usbphy.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/arm/imx

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 11:07:19 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_usbphy.c
src/sys/arch/arm/imx/fdt: imx6_gpio.c imx6_sdhc.c imx6_usb.c
imx6_usbphy.c

Log Message:
Use PRIxBUSADDR


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx6_usbphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/fdt/imx6_gpio.c \
src/sys/arch/arm/imx/fdt/imx6_usb.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/fdt/imx6_sdhc.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/fdt/imx6_usbphy.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/imx/imx6_usbphy.c
diff -u src/sys/arch/arm/imx/imx6_usbphy.c:1.2 src/sys/arch/arm/imx/imx6_usbphy.c:1.3
--- src/sys/arch/arm/imx/imx6_usbphy.c:1.2	Thu Jun 20 08:16:19 2019
+++ src/sys/arch/arm/imx/imx6_usbphy.c	Sun Nov 24 11:07:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usbphy.c,v 1.2 2019/06/20 08:16:19 hkenken Exp $	*/
+/*	$NetBSD: imx6_usbphy.c,v 1.3 2019/11/24 11:07:19 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017  Genetec Corporation.  All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.2 2019/06/20 08:16:19 hkenken Exp $");
+__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.3 2019/11/24 11:07:19 skrll Exp $");
 
 #include 
 #include 
@@ -144,8 +144,8 @@ imx6_usbphy_attach(device_t parent, devi
 
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
-		aprint_error(": couldn't map %#llx: %d",
-		(uint64_t)addr, error);
+		aprint_error(": couldn't map %#" PRIxBUSADDR ": %d",
+		addr, error);
 		return;
 	}
 

Index: src/sys/arch/arm/imx/fdt/imx6_gpio.c
diff -u src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.2 src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.3
--- src/sys/arch/arm/imx/fdt/imx6_gpio.c:1.2	Mon Aug 19 03:45:51 2019
+++ src/sys/arch/arm/imx/fdt/imx6_gpio.c	Sun Nov 24 11:07:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_gpio.c,v 1.2 2019/08/19 03:45:51 hkenken Exp $	*/
+/*	$NetBSD: imx6_gpio.c,v 1.3 2019/11/24 11:07:19 skrll Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_gpio.c,v 1.2 2019/08/19 03:45:51 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_gpio.c,v 1.3 2019/11/24 11:07:19 skrll Exp $");
 
 #include "opt_fdt.h"
 #include "gpio.h"
@@ -107,7 +107,7 @@ imxgpio_attach(device_t parent, device_t
 
 	error = bus_space_map(faa->faa_bst, addr, size, 0, );
 	if (error) {
-		aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+		aprint_error(": couldn't map %#" PRIxBUSADDR ": %d", addr, error);
 		return;
 	}
 
Index: src/sys/arch/arm/imx/fdt/imx6_usb.c
diff -u src/sys/arch/arm/imx/fdt/imx6_usb.c:1.2 src/sys/arch/arm/imx/fdt/imx6_usb.c:1.3
--- src/sys/arch/arm/imx/fdt/imx6_usb.c:1.2	Mon Aug 19 03:45:51 2019
+++ src/sys/arch/arm/imx/fdt/imx6_usb.c	Sun Nov 24 11:07:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_usb.c,v 1.2 2019/08/19 03:45:51 hkenken Exp $	*/
+/*	$NetBSD: imx6_usb.c,v 1.3 2019/11/24 11:07:19 skrll Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.2 2019/08/19 03:45:51 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.3 2019/11/24 11:07:19 skrll Exp $");
 
 #include "opt_fdt.h"
 
@@ -111,7 +111,7 @@ imx6_usb_attach(device_t parent, device_
 
 	error = bus_space_map(bst, addr, size, 0, );
 	if (error) {
-		aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+		aprint_error(": couldn't map %#" PRIxBUSADDR ": %d", addr, error);
 		return;
 	}
 

Index: src/sys/arch/arm/imx/fdt/imx6_sdhc.c
diff -u src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.4 src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.5
--- src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.4	Wed Oct 23 05:20:52 2019
+++ src/sys/arch/arm/imx/fdt/imx6_sdhc.c	Sun Nov 24 11:07:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_sdhc.c,v 1.4 2019/10/23 05:20:52 hkenken Exp $	*/
+/*	$NetBSD: imx6_sdhc.c,v 1.5 2019/11/24 11:07:19 skrll Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_sdhc.c,v 1.4 2019/10/23 05:20:52 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_sdhc.c,v 1.5 2019/11/24 11:07:19 skrll Exp $");
 
 #include "opt_fdt.h"
 
@@ -133,7 +133,7 @@ imx6_sdhc_attach(device_t parent, device
 	sc->sc_bst = faa->faa_bst;
 	error = bus_space_map(sc->sc_bst, addr, size, 0, >sc_bsh);
 	if (error) {
-		aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+		aprint_error(": couldn't map %#" PRIxBUSADDR ": %d", 

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

2019-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 24 10:27:37 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_ccu.c sunxi_dwhdmi.c
sunxi_platform.c

Log Message:
Try to avoid changing hardware settings when the "nomodeset" kernel arg
is present.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_dwhdmi.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/sunxi/sunxi_platform.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/arm/sunxi

2019-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 24 10:27:37 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_ccu.c sunxi_dwhdmi.c
sunxi_platform.c

Log Message:
Try to avoid changing hardware settings when the "nomodeset" kernel arg
is present.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_dwhdmi.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/sunxi/sunxi_platform.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/sunxi/sun50i_a64_ccu.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.19 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.20
--- src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.19	Sat Nov 23 22:46:53 2019
+++ src/sys/arch/arm/sunxi/sun50i_a64_ccu.c	Sun Nov 24 10:27:37 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_ccu.c,v 1.19 2019/11/23 22:46:53 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_ccu.c,v 1.20 2019/11/24 10:27:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.19 2019/11/23 22:46:53 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.20 2019/11/24 10:27:37 jmcneill Exp $");
 
 #include 
 #include 
@@ -601,6 +601,8 @@ sun50i_a64_ccu_attach(device_t parent, d
 {
 	struct sunxi_ccu_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
+	prop_dictionary_t prop = device_properties(self);
+	bool nomodeset;
 
 	sc->sc_dev = self;
 	sc->sc_phandle = faa->faa_phandle;
@@ -618,19 +620,23 @@ sun50i_a64_ccu_attach(device_t parent, d
 	aprint_naive("\n");
 	aprint_normal(": A64 CCU\n");
 
-	/* Set DE parent to PLL_DE */
-	clk_set_parent(>sc_clks[A64_CLK_DE].base, >sc_clks[A64_CLK_PLL_DE].base);
-	clk_set_rate(>sc_clks[A64_CLK_PLL_DE].base, 42000);
-
-	/* Set video PLLs to 297 MHz */
-	clk_set_rate(>sc_clks[A64_CLK_PLL_VIDEO0].base, 29700);
-	clk_set_rate(>sc_clks[A64_CLK_PLL_VIDEO1].base, 29700);
-
-	/* Set TCON1 parent to PLL_VIDEO1(1X) */
-	clk_set_parent(>sc_clks[A64_CLK_TCON1].base, >sc_clks[A64_CLK_PLL_VIDEO1].base);
-
-	/* Set HDMI parent to PLL_VIDEO1(1X) */
-	clk_set_parent(>sc_clks[A64_CLK_HDMI].base, >sc_clks[A64_CLK_PLL_VIDEO1].base);
+	nomodeset = false;
+	prop_dictionary_get_bool(prop, "nomodeset", );
+	if (!nomodeset) {
+		/* Set DE parent to PLL_DE */
+		clk_set_parent(>sc_clks[A64_CLK_DE].base, >sc_clks[A64_CLK_PLL_DE].base);
+		clk_set_rate(>sc_clks[A64_CLK_PLL_DE].base, 42000);
+
+		/* Set video PLLs to 297 MHz */
+		clk_set_rate(>sc_clks[A64_CLK_PLL_VIDEO0].base, 29700);
+		clk_set_rate(>sc_clks[A64_CLK_PLL_VIDEO1].base, 29700);
+
+		/* Set TCON1 parent to PLL_VIDEO1(1X) */
+		clk_set_parent(>sc_clks[A64_CLK_TCON1].base, >sc_clks[A64_CLK_PLL_VIDEO1].base);
+
+		/* Set HDMI parent to PLL_VIDEO1(1X) */
+		clk_set_parent(>sc_clks[A64_CLK_HDMI].base, >sc_clks[A64_CLK_PLL_VIDEO1].base);
+	}
 
 	sunxi_ccu_print(sc);
 }

Index: src/sys/arch/arm/sunxi/sunxi_dwhdmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_dwhdmi.c:1.7 src/sys/arch/arm/sunxi/sunxi_dwhdmi.c:1.8
--- src/sys/arch/arm/sunxi/sunxi_dwhdmi.c:1.7	Sat Nov 23 18:55:08 2019
+++ src/sys/arch/arm/sunxi/sunxi_dwhdmi.c	Sun Nov 24 10:27:37 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_dwhdmi.c,v 1.7 2019/11/23 18:55:08 jmcneill Exp $ */
+/* $NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.7 2019/11/23 18:55:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $");
 
 #include 
 #include 
@@ -228,12 +228,20 @@ sunxi_dwhdmi_attach(device_t parent, dev
 {
 	struct sunxi_dwhdmi_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
+	prop_dictionary_t prop = device_properties(self);
 	const int phandle = faa->faa_phandle;
 	struct clk *clk_iahb, *clk_isfr, *clk_tmds;
 	struct fdtbus_reset *rst;
+	bool is_disabled;
 	bus_addr_t addr;
 	bus_size_t size;
 
+	if (prop_dictionary_get_bool(prop, "disabled", _disabled) && is_disabled) {
+		aprint_naive("\n");
+		aprint_normal(": HDMI TX (disabled)\n");
+		return;
+	}
+
 	if (fdtbus_get_reg(phandle, 0, , ) != 0) {
 		aprint_error(": couldn't get registers\n");
 		return;

Index: src/sys/arch/arm/sunxi/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.37 src/sys/arch/arm/sunxi/sunxi_platform.c:1.38
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.37	Mon Jun 17 05:27:01 2019
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Sun Nov 24 10:27:37 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.37 2019/06/17 05:27:01 mrg Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.38 2019/11/24 10:27:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 

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

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 09:37:05 UTC 2019

Modified Files:
src/sys/arch/arm/ti: if_cpsw.c

Log Message:
Fix KERNHIST build (and simplify)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/ti/if_cpsw.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/arm/ti

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 09:37:05 UTC 2019

Modified Files:
src/sys/arch/arm/ti: if_cpsw.c

Log Message:
Fix KERNHIST build (and simplify)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/ti/if_cpsw.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/ti/if_cpsw.c
diff -u src/sys/arch/arm/ti/if_cpsw.c:1.8 src/sys/arch/arm/ti/if_cpsw.c:1.9
--- src/sys/arch/arm/ti/if_cpsw.c:1.8	Sun Nov  3 10:09:04 2019
+++ src/sys/arch/arm/ti/if_cpsw.c	Sun Nov 24 09:37:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.8 2019/11/03 10:09:04 jmcneill Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.8 2019/11/03 10:09:04 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $");
 
 #include 
 #include 
@@ -174,19 +174,14 @@ static int cpsw_ale_update_addresses(str
 CFATTACH_DECL_NEW(cpsw, sizeof(struct cpsw_softc),
 cpsw_match, cpsw_attach, cpsw_detach, NULL);
 
-#undef KERNHIST
 #include 
 KERNHIST_DEFINE(cpswhist);
 
-#ifdef KERNHIST
-#define KERNHIST_CALLED_5(NAME, i, j, k, l) \
-do { \
-	_kernhist_call = atomic_inc_uint_nv(&_kernhist_cnt); \
-	KERNHIST_LOG(NAME, "called! %x %x %x %x", i, j, k, l); \
-} while (/*CONSTCOND*/ 0)
-#else
-#define KERNHIST_CALLED_5(NAME, i, j, k, l)
-#endif
+#define CPSWHIST_CALLARGS(A,B,C,D)	do {	\
+	KERNHIST_CALLARGS(cpswhist, "%jx %jx %jx %jx",			\
+		(uintptr_t)(A), (uintptr_t)(B), (uintptr_t)(C), (uintptr_t)(D));\
+	} while (0)
+
 
 static inline u_int
 cpsw_txdesc_adjust(u_int x, int y)
@@ -219,7 +214,7 @@ cpsw_set_txdesc_next(struct cpsw_softc *
 	const bus_size_t o = sizeof(struct cpsw_cpdma_bd) * i + 0;
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, n, 0);
+	CPSWHIST_CALLARGS(sc, i, n, 0);
 
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh_txdescs, o, n);
 }
@@ -230,7 +225,7 @@ cpsw_set_rxdesc_next(struct cpsw_softc *
 	const bus_size_t o = sizeof(struct cpsw_cpdma_bd) * i + 0;
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, n, 0);
+	CPSWHIST_CALLARGS(sc, i, n, 0);
 
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, n);
 }
@@ -244,7 +239,7 @@ cpsw_get_txdesc(struct cpsw_softc * cons
 	const bus_size_t c = __arraycount(bdp->word);
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+	CPSWHIST_CALLARGS(sc, i, bdp, 0);
 
 	bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_txdescs, o, dp, c);
 	KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
@@ -260,7 +255,7 @@ cpsw_set_txdesc(struct cpsw_softc * cons
 	const bus_size_t c = __arraycount(bdp->word);
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+	CPSWHIST_CALLARGS(sc, i, bdp, 0);
 	KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
 	dp[0], dp[1], dp[2], dp[3]);
 
@@ -276,7 +271,7 @@ cpsw_get_rxdesc(struct cpsw_softc * cons
 	const bus_size_t c = __arraycount(bdp->word);
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+	CPSWHIST_CALLARGS(sc, i, bdp, 0);
 
 	bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, dp, c);
 
@@ -293,7 +288,7 @@ cpsw_set_rxdesc(struct cpsw_softc * cons
 	const bus_size_t c = __arraycount(bdp->word);
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+	CPSWHIST_CALLARGS(sc, i, bdp, 0);
 	KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
 	dp[0], dp[1], dp[2], dp[3]);
 
@@ -607,7 +602,7 @@ cpsw_start(struct ifnet *ifp)
 	u_int mlen;
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+	CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
 	if (__predict_false((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) !=
 	IFF_RUNNING)) {
@@ -1140,7 +1135,7 @@ cpsw_rxintr(void *arg)
 	u_int len, off;
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+	CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
 	for (;;) {
 		KASSERT(sc->sc_rxhead < CPSW_NRXDESCS);
@@ -1225,7 +1220,7 @@ cpsw_txintr(void *arg)
 	u_int cpi;
 
 	KERNHIST_FUNC(__func__);
-	KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+	CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
 	KASSERT(sc->sc_txrun);
 



CVS commit: src/sys/dev/fdt

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 09:34:38 UTC 2019

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

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdt_port.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/fdt_port.c
diff -u src/sys/dev/fdt/fdt_port.c:1.3 src/sys/dev/fdt/fdt_port.c:1.4
--- src/sys/dev/fdt/fdt_port.c:1.3	Sat Nov 23 18:53:05 2019
+++ src/sys/dev/fdt/fdt_port.c	Sun Nov 24 09:34:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdt_port.c,v 1.3 2019/11/23 18:53:05 jmcneill Exp $	*/
+/*	$NetBSD: fdt_port.c,v 1.4 2019/11/24 09:34:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: fdt_port.c,v 1.3 2019/11/23 18:53:05 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: fdt_port.c,v 1.4 2019/11/24 09:34:38 skrll Exp $");
 
 #include 
 #include 
@@ -257,7 +257,7 @@ fdt_ports_register(struct fdt_device_por
 	int port_phandle, child;
 	int i;
 	char buf[20];
-	uint64_t id;
+	bus_addr_t id;
 
 	ports->dp_dev = self;
 	SLIST_INSERT_HEAD(_port_devices, ports, dp_list);



CVS commit: src/sys/dev/fdt

2019-11-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 24 09:34:38 UTC 2019

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

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdt_port.c

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



CVS commit: [netbsd-9] src/doc

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:34:29 UTC 2019

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

Log Message:
Tickets #464, #465, #467, #468


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:34:29 UTC 2019

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

Log Message:
Tickets #464, #465, #467, #468


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 src/doc/CHANGES-9.0

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.0
diff -u src/doc/CHANGES-9.0:1.1.2.115 src/doc/CHANGES-9.0:1.1.2.116
--- src/doc/CHANGES-9.0:1.1.2.115	Fri Nov 22 15:30:39 2019
+++ src/doc/CHANGES-9.0	Sun Nov 24 08:34:28 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.115 2019/11/22 15:30:39 bouyer Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.116 2019/11/24 08:34:28 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6199,3 +6199,51 @@ sys/arch/xen/xen/xenevt.c			1.54
 	Make these files compilable w/o options DIAGNOSTIC
 	[martin, ticket #463]
 
+sys/dev/hyperv/hvkbd.c1.5,1.6
+sys/dev/hyperv/if_hvn.c1.8,1.9
+sys/dev/hyperv/vmbus.c1.5
+
+	vmbus(4), hvn(4), hvkbd(4): fix wait time for tsleep(9).
+	hvn(4), hvkbd(4): only poll when cold.
+	[nonaka, ticket #464]
+
+sys/kern/sys_ptrace_common.c			1.73
+
+	Fix regression introduced to ptrace_regs() in rev 1.27:
+	Size of registers should be determined from tracer, NOT tracee.
+	[rin, ticket #465]
+
+bin/sh/expand.c	1.133
+
+	Fix quoting in character class names in patterns (e.g. [[:\alpha:]]).
+	[kre, ticket #467]
+
+external/public-domain/tz/dist/Makefile up to 1.1.1.25
+external/public-domain/tz/dist/NEWS up to 1.1.1.28
+external/public-domain/tz/dist/TZDATA_VERSION   up to 1.18
+external/public-domain/tz/dist/africa   up to 1.1.1.21
+external/public-domain/tz/dist/antarctica   up to 1.1.1.12
+external/public-domain/tz/dist/asia up to 1.1.1.24
+external/public-domain/tz/dist/australasia  up to 1.1.1.18
+external/public-domain/tz/dist/backzone up to 1.1.1.17
+external/public-domain/tz/dist/checktab.awk up to 1.1.1.10
+external/public-domain/tz/dist/europe   up to 1.1.1.25
+external/public-domain/tz/dist/factory  up to 1.1.1.4
+external/public-domain/tz/dist/leap-seconds.list up to 1.1.1.12
+external/public-domain/tz/dist/leapseconds  up to 1.1.1.14
+external/public-domain/tz/dist/leapseconds.awk  up to 1.1.1.9
+external/public-domain/tz/dist/northamerica up to 1.1.1.24
+external/public-domain/tz/dist/pacificnew   up to 1.1.1.3
+external/public-domain/tz/dist/southamerica up to 1.1.1.16
+external/public-domain/tz/dist/systemv  up to 1.1.1.3
+external/public-domain/tz/dist/theory.html  up to 1.1.1.9
+external/public-domain/tz/dist/version  up to 1.1.1.15
+external/public-domain/tz/dist/zishrink.awk up to 1.1.1.6
+external/public-domain/tz/dist/zone.tab up to 1.1.1.17
+external/public-domain/tz/dist/zone1970.tab up to 1.1.1.19
+external/public-domain/tz/dist/zoneinfo2tdf.pl  up to 1.1.1.3
+doc/3RDPARTY	1.1655 (patch)
+
+	Import tzdata2019c.
+	[kre, ticket #468]
+



CVS commit: [netbsd-9] src

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:30:28 UTC 2019

Modified Files:
src/doc [netbsd-9]: 3RDPARTY
src/external/public-domain/tz/dist [netbsd-9]: Makefile NEWS
TZDATA_VERSION africa antarctica asia australasia backzone
checktab.awk europe factory leap-seconds.list leapseconds
leapseconds.awk northamerica pacificnew southamerica systemv
theory.html version zishrink.awk zone.tab zone1970.tab
zoneinfo2tdf.pl

Log Message:
Pull up the following revisions, requested by kre in ticket #468:

external/public-domain/tz/dist/Makefile up to 1.1.1.25
external/public-domain/tz/dist/NEWS up to 1.1.1.28
external/public-domain/tz/dist/TZDATA_VERSION   up to 1.18
external/public-domain/tz/dist/africa   up to 1.1.1.21
external/public-domain/tz/dist/antarctica   up to 1.1.1.12
external/public-domain/tz/dist/asia up to 1.1.1.24
external/public-domain/tz/dist/australasia  up to 1.1.1.18
external/public-domain/tz/dist/backzone up to 1.1.1.17
external/public-domain/tz/dist/checktab.awk up to 1.1.1.10
external/public-domain/tz/dist/europe   up to 1.1.1.25
external/public-domain/tz/dist/factory  up to 1.1.1.4
external/public-domain/tz/dist/leap-seconds.list up to 1.1.1.12
external/public-domain/tz/dist/leapseconds  up to 1.1.1.14
external/public-domain/tz/dist/leapseconds.awk  up to 1.1.1.9
external/public-domain/tz/dist/northamerica up to 1.1.1.24
external/public-domain/tz/dist/pacificnew   up to 1.1.1.3
external/public-domain/tz/dist/southamerica up to 1.1.1.16
external/public-domain/tz/dist/systemv  up to 1.1.1.3
external/public-domain/tz/dist/theory.html  up to 1.1.1.9
external/public-domain/tz/dist/version  up to 1.1.1.15
external/public-domain/tz/dist/zishrink.awk up to 1.1.1.6
external/public-domain/tz/dist/zone.tab up to 1.1.1.17
external/public-domain/tz/dist/zone1970.tab up to 1.1.1.19
external/public-domain/tz/dist/zoneinfo2tdf.pl  up to 1.1.1.3
doc/3RDPARTY1.1655 (patch)

Import tzdata2019c from ftp://ftp.iana.org/tz/releases/tzdata2019c.tar.gz

Summary of changes in tzdata2019c (2019-09-11 08:59:48 -0700):
Fiji observes DST from 2019-11-10 to 2020-01-12
Norfolk Island starts observing Australian-style DST

Plus historic corrections to time in Turkey (1940-85)
South Korea (1948-51) Detroit (US) (1967-8), Perry County
(Indiana, US) (pre 1970) Edmonton (CA) (1967, 1969)
Vancouver (CA) (1946), Vienna (AT) (1946), Kaliningrad (1945-6).
Louisville (US) (1946-50).  Brussles (BE) (1892).
Hong Kong Winter Time (1941) now listed as being "DST".

Summary of changes in tzdata2019b (2019-07-01 00:09:53 -0700):

Brazil no longer observes DST
Predictions for Morocco extended to 2087.
Panestine (March 2019) time zone change date corrected
(and guesses for future transitions revised).

Historic updates:  Honk Kong (1941 - 1947), Italy (1866).


To generate a diff of this commit:
cvs rdiff -u -r1.1640.2.7 -r1.1640.2.8 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.24 -r1.1.1.24.2.1 \
src/external/public-domain/tz/dist/Makefile \
src/external/public-domain/tz/dist/europe
cvs rdiff -u -r1.1.1.27 -r1.1.1.27.2.1 \
src/external/public-domain/tz/dist/NEWS
cvs rdiff -u -r1.17 -r1.17.2.1 \
src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.20 -r1.1.1.20.2.1 \
src/external/public-domain/tz/dist/africa
cvs rdiff -u -r1.1.1.11 -r1.1.1.11.2.1 \
src/external/public-domain/tz/dist/antarctica \
src/external/public-domain/tz/dist/leap-seconds.list
cvs rdiff -u -r1.1.1.23 -r1.1.1.23.2.1 \
src/external/public-domain/tz/dist/asia \
src/external/public-domain/tz/dist/northamerica
cvs rdiff -u -r1.1.1.17 -r1.1.1.17.2.1 \
src/external/public-domain/tz/dist/australasia
cvs rdiff -u -r1.1.1.16 -r1.1.1.16.2.1 \
src/external/public-domain/tz/dist/backzone \
src/external/public-domain/tz/dist/zone.tab
cvs rdiff -u -r1.1.1.9 -r1.1.1.9.4.1 \
src/external/public-domain/tz/dist/checktab.awk
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.2.1 \
src/external/public-domain/tz/dist/factory
cvs rdiff -u -r1.1.1.13 -r1.1.1.13.2.1 \
src/external/public-domain/tz/dist/leapseconds
cvs rdiff -u -r1.1.1.8 -r1.1.1.8.2.1 \
src/external/public-domain/tz/dist/leapseconds.awk \
src/external/public-domain/tz/dist/theory.html
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.2.1 \
src/external/public-domain/tz/dist/pacificnew \
src/external/public-domain/tz/dist/systemv \
src/external/public-domain/tz/dist/zoneinfo2tdf.pl
cvs rdiff -u -r1.1.1.15 

CVS commit: [netbsd-9] src/bin/sh

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:24:06 UTC 2019

Modified Files:
src/bin/sh [netbsd-9]: expand.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #467):

bin/sh/expand.c: revision 1.133

Open code the validity test & copy of the character class name in
a bracket expression in a pattern (ie: [[:THISNAME:]]).   Previously
the code used strspn() to look for invalid chars in the name, and
then memcpy(), now we do the test and copy a character at a time.

This might, or might not, be faster, but it now correctly handles
\ quoted characters in the name (' and " quoting were already
dealt with, \ was too in an earlier version, but when the \ handling
changes were made, this piece of code broke).

Not exactly a vital bug fix (who writes [[:\alpha:]] or similar?)
but it should work correctly regardless of how obscure the usage is.

Problem noted by Harald van Dijk

XXX pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.132.2.1 src/bin/sh/expand.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/expand.c
diff -u src/bin/sh/expand.c:1.132 src/bin/sh/expand.c:1.132.2.1
--- src/bin/sh/expand.c:1.132	Wed Apr 10 08:13:11 2019
+++ src/bin/sh/expand.c	Sun Nov 24 08:24:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.132 2019/04/10 08:13:11 kre Exp $	*/
+/*	$NetBSD: expand.c,v 1.132.2.1 2019/11/24 08:24:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c	8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.132 2019/04/10 08:13:11 kre Exp $");
+__RCSID("$NetBSD: expand.c,v 1.132.2.1 2019/11/24 08:24:06 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1792,24 +1792,44 @@ match_charclass(const char *p, wchar_t c
 	char name[20];
 	char *nameend;
 	wctype_t cclass;
+	char *q;
 
 	*end = NULL;
 	p++;
+	q = [0];
 	nameend = strstr(p, ":]");
 	if (nameend == NULL || nameend == p)	/* not a valid class */
 		return 0;
 
-	if (!is_alpha(*p) || strspn(p,		/* '_' is a local extension */
-	"0123456789"  "_"
-	"abcdefghijklmnopqrstuvwxyz"
-	"ABCDEFGHIJKLMNOPQRSTUVWXYZ") != (size_t)(nameend - p))
+	if (*p == CTLESC) {
+		if (*++p == CTLESC)
+			return 0;
+		if (p == nameend)
+			return 0;
+	}
+	if (!is_alpha(*p))
 		return 0;
+	while (p < nameend) {
+		if (*p == CTLESC) {
+			p++;
+			if (p == nameend)
+return 0;
+		}
+		if (!is_in_name(*p))	/* '_' is a local extension */
+			return 0;
+		if (q < [sizeof name])
+			*q++ = *p++;
+		else
+			p++;
+	}
 
 	*end = nameend + 2;		/* committed to it being a char class */
-	if ((size_t)(nameend - p) >= sizeof(name))	/* but too long */
-		return 0;/* so no match */
-	memcpy(name, p, nameend - p);
-	name[nameend - p] = '\0';
+
+	if (q < [sizeof name])	/* a usable name found */
+		*q++ = '\0';
+	else/* too long, valid, but no match */
+		return 0;
+
 	cclass = wctype(name);
 	/* An unknown class matches nothing but is valid nevertheless. */
 	if (cclass == 0)



CVS commit: [netbsd-9] src/bin/sh

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:24:06 UTC 2019

Modified Files:
src/bin/sh [netbsd-9]: expand.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #467):

bin/sh/expand.c: revision 1.133

Open code the validity test & copy of the character class name in
a bracket expression in a pattern (ie: [[:THISNAME:]]).   Previously
the code used strspn() to look for invalid chars in the name, and
then memcpy(), now we do the test and copy a character at a time.

This might, or might not, be faster, but it now correctly handles
\ quoted characters in the name (' and " quoting were already
dealt with, \ was too in an earlier version, but when the \ handling
changes were made, this piece of code broke).

Not exactly a vital bug fix (who writes [[:\alpha:]] or similar?)
but it should work correctly regardless of how obscure the usage is.

Problem noted by Harald van Dijk

XXX pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.132.2.1 src/bin/sh/expand.c

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



CVS commit: [netbsd-9] src/sys/kern

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:16:53 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: sys_ptrace_common.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #465):

sys/kern/sys_ptrace_common.c: revision 1.73

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.

XXX
pullup to netbsd-9 and -8.


To generate a diff of this commit:
cvs rdiff -u -r1.58.2.11 -r1.58.2.12 src/sys/kern/sys_ptrace_common.c

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



CVS commit: [netbsd-9] src/sys/kern

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:16:53 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: sys_ptrace_common.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #465):

sys/kern/sys_ptrace_common.c: revision 1.73

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.

XXX
pullup to netbsd-9 and -8.


To generate a diff of this commit:
cvs rdiff -u -r1.58.2.11 -r1.58.2.12 src/sys/kern/sys_ptrace_common.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/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.58.2.11 src/sys/kern/sys_ptrace_common.c:1.58.2.12
--- src/sys/kern/sys_ptrace_common.c:1.58.2.11	Tue Nov 19 13:22:01 2019
+++ src/sys/kern/sys_ptrace_common.c	Sun Nov 24 08:16:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.58.2.11 2019/11/19 13:22:01 martin Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.58.2.12 2019/11/24 08:16:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.58.2.11 2019/11/19 13:22:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.58.2.12 2019/11/24 08:16:52 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -831,9 +831,12 @@ ptrace_regs(struct lwp *l, struct lwp **
 void *addr, size_t data)
 {
 	int error;
-	struct proc *t = (*lt)->l_proc;
+	struct proc *p, *t;
 	struct vmspace *vm;
 
+	p = l->l_proc;		/* tracer */
+	t = (*lt)->l_proc;	/* traced */
+
 	if ((error = ptrace_update_lwp(t, lt, data)) != 0)
 		return error;
 
@@ -849,7 +852,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETREGS
 		if (!process_validregs(*lt))
 			return EINVAL;
-		size = PROC_REGSZ(t);
+		size = PROC_REGSZ(p);
 		func = ptm->ptm_doregs;
 		break;
 #endif
@@ -858,7 +861,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETFPREGS
 		if (!process_validfpregs(*lt))
 			return EINVAL;
-		size = PROC_FPREGSZ(t);
+		size = PROC_FPREGSZ(p);
 		func = ptm->ptm_dofpregs;
 		break;
 #endif
@@ -867,7 +870,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETDBREGS
 		if (!process_validdbregs(*lt))
 			return EINVAL;
-		size = PROC_DBREGSZ(t);
+		size = PROC_DBREGSZ(p);
 		func = ptm->ptm_dodbregs;
 		break;
 #endif



CVS commit: [netbsd-8] src/doc

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:16:11 UTC 2019

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

Log Message:
Tickets #1455 and #1456


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/doc

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:16:11 UTC 2019

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

Log Message:
Tickets #1455 and #1456


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-8.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-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.70 src/doc/CHANGES-8.2:1.1.2.71
--- src/doc/CHANGES-8.2:1.1.2.70	Thu Nov 21 14:07:52 2019
+++ src/doc/CHANGES-8.2	Sun Nov 24 08:16:11 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.70 2019/11/21 14:07:52 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.71 2019/11/24 08:16:11 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1672,3 +1672,17 @@ sys/dev/mii/miivar.h			1.69 via patch
 	- Code cleanup.
 	[msaitoh, ticket #1454]
 
+sys/dev/hyperv/hvkbd.c1.5,1.6
+sys/dev/hyperv/if_hvn.c1.8,1.9
+sys/dev/hyperv/vmbus.c1.5
+
+	vmbus(4), hvn(4), hvkbd(4): fix wait time for tsleep(9).
+	hvn(4), hvkbd(4): only poll when cold.
+	[nonaka, ticket #1455]
+
+sys/kern/sys_ptrace_common.c			1.73
+
+	Fix regression introduced to ptrace_regs() in rev 1.27:
+	Size of registers should be determined from tracer, NOT tracee.
+	[rin, ticket #1456]
+



CVS commit: [netbsd-8] src/sys/kern

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:15:17 UTC 2019

Modified Files:
src/sys/kern [netbsd-8]: sys_ptrace_common.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1456):

sys/kern/sys_ptrace_common.c: revision 1.73

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.

XXX
pullup to netbsd-9 and -8.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.7 -r1.22.2.8 src/sys/kern/sys_ptrace_common.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/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.22.2.7 src/sys/kern/sys_ptrace_common.c:1.22.2.8
--- src/sys/kern/sys_ptrace_common.c:1.22.2.7	Tue Nov 19 10:50:25 2019
+++ src/sys/kern/sys_ptrace_common.c	Sun Nov 24 08:15:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.7 2019/11/19 10:50:25 martin Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.22.2.8 2019/11/24 08:15:17 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.7 2019/11/19 10:50:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22.2.8 2019/11/24 08:15:17 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -775,9 +775,12 @@ ptrace_regs(struct lwp *l, struct lwp **
 void *addr, size_t data)
 {
 	int error;
-	struct proc *t = (*lt)->l_proc;
+	struct proc *p, *t;
 	struct vmspace *vm;
 
+	p = l->l_proc;		/* tracer */
+	t = (*lt)->l_proc;	/* traced */
+
 	if ((error = ptrace_update_lwp(t, lt, data)) != 0)
 		return error;
 
@@ -791,7 +794,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETREGS
 		if (!process_validregs(*lt))
 			return EINVAL;
-		size = PROC_REGSZ(t);
+		size = PROC_REGSZ(p);
 		func = ptm->ptm_doregs;
 		break;
 #endif
@@ -800,7 +803,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETFPREGS
 		if (!process_validfpregs(*lt))
 			return EINVAL;
-		size = PROC_FPREGSZ(t);
+		size = PROC_FPREGSZ(p);
 		func = ptm->ptm_dofpregs;
 		break;
 #endif
@@ -809,7 +812,7 @@ ptrace_regs(struct lwp *l, struct lwp **
 	case_PT_SETDBREGS
 		if (!process_validdbregs(*lt))
 			return EINVAL;
-		size = PROC_DBREGSZ(t);
+		size = PROC_DBREGSZ(p);
 		func = ptm->ptm_dodbregs;
 		break;
 #endif



CVS commit: [netbsd-8] src/sys/kern

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:15:17 UTC 2019

Modified Files:
src/sys/kern [netbsd-8]: sys_ptrace_common.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1456):

sys/kern/sys_ptrace_common.c: revision 1.73

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.

XXX
pullup to netbsd-9 and -8.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.7 -r1.22.2.8 src/sys/kern/sys_ptrace_common.c

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



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

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:13:07 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-9]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #464):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/hyperv/vmbus.c

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



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

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:13:07 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-9]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #464):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/hyperv/vmbus.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/hyperv/hvkbd.c
diff -u src/sys/dev/hyperv/hvkbd.c:1.2.2.1 src/sys/dev/hyperv/hvkbd.c:1.2.2.2
--- src/sys/dev/hyperv/hvkbd.c:1.2.2.1	Sat Nov 16 16:51:45 2019
+++ src/sys/dev/hyperv/hvkbd.c	Sun Nov 24 08:13:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hvkbd.c,v 1.2.2.1 2019/11/16 16:51:45 martin Exp $	*/
+/*	$NetBSD: hvkbd.c,v 1.2.2.2 2019/11/24 08:13:07 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 Microsoft Corp.
@@ -36,7 +36,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.2.2.1 2019/11/16 16:51:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.2.2.2 2019/11/24 08:13:07 martin Exp $");
 
 #include 
 #include 
@@ -359,13 +359,13 @@ hvkbd_connect(struct hvkbd_softc *sc)
 	}
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", 1);
-		s = spltty();
-		hvkbd_intr(sc);
-		splx(s);
+			s = spltty();
+			hvkbd_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", mstohz(1));
 	} while (--timo > 0 && sc->sc_connected == 0);
 
 	if (timo == 0 && sc->sc_connected == 0) {

Index: src/sys/dev/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.4.2.2 src/sys/dev/hyperv/if_hvn.c:1.4.2.3
--- src/sys/dev/hyperv/if_hvn.c:1.4.2.2	Mon Nov 18 19:46:33 2019
+++ src/sys/dev/hyperv/if_hvn.c	Sun Nov 24 08:13:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.4.2.2 2019/11/18 19:46:33 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.4.2.3 2019/11/24 08:13:07 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.2 2019/11/18 19:46:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.3 2019/11/24 08:13:07 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1069,7 +1069,7 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			if (cold)
 delay(1000);
 			else
-tsleep(cmd, PRIBIO, "nvsout", 1);
+tsleep(cmd, PRIBIO, "nvsout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: NVSP operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->nvs_type, rv);
@@ -1087,13 +1087,13 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 		return 0;
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {
@@ -1391,7 +1391,7 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 			if (cold)
 delay(1000);
 			else
-tsleep(rc, PRIBIO, "rndisout", 1);
+tsleep(rc, PRIBIO, "rndisout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: RNDIS operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->rm_type, rv);
@@ -1410,13 +1410,13 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 	BUS_DMASYNC_POSTWRITE);
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", mstohz(1));
 	} while (--timo > 0 && rc->rc_done != 1);
 
 	bus_dmamap_sync(sc->sc_dmat, rc->rc_dmap, 0, PAGE_SIZE,

Index: src/sys/dev/hyperv/vmbus.c
diff -u src/sys/dev/hyperv/vmbus.c:1.4 src/sys/dev/hyperv/vmbus.c:1.4.2.1
--- src/sys/dev/hyperv/vmbus.c:1.4	Tue Jul  9 10:07:11 2019
+++ src/sys/dev/hyperv/vmbus.c	Sun Nov 24 08:13:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $	*/
+/*	$NetBSD: vmbus.c,v 1.4.2.1 2019/11/24 08:13:07 martin Exp $	*/
 /*	$OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.4.2.1 2019/11/24 08:13:07 martin Exp $");
 
 #include 
 #include 
@@ -604,7 +604,7 @@ 

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

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:11:06 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1455):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.5 -r1.1.4.6 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.4 -r1.2.2.5 src/sys/dev/hyperv/if_hvn.c \
src/sys/dev/hyperv/vmbus.c

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/hyperv

2019-11-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 24 08:11:06 UTC 2019

Modified Files:
src/sys/dev/hyperv [netbsd-8]: hvkbd.c if_hvn.c vmbus.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1455):

sys/dev/hyperv/if_hvn.c: revision 1.8
sys/dev/hyperv/if_hvn.c: revision 1.9
sys/dev/hyperv/hvkbd.c: revision 1.5
sys/dev/hyperv/hvkbd.c: revision 1.6
sys/dev/hyperv/vmbus.c: revision 1.5

vmbus(4), hvn(4), hvkbd(4): Fixed wait time for tsleep(9).
hvn(4), hvkbd(4): Only need to poll when cold.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.5 -r1.1.4.6 src/sys/dev/hyperv/hvkbd.c
cvs rdiff -u -r1.2.2.4 -r1.2.2.5 src/sys/dev/hyperv/if_hvn.c \
src/sys/dev/hyperv/vmbus.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/hyperv/hvkbd.c
diff -u src/sys/dev/hyperv/hvkbd.c:1.1.4.5 src/sys/dev/hyperv/hvkbd.c:1.1.4.6
--- src/sys/dev/hyperv/hvkbd.c:1.1.4.5	Sat Nov 16 16:23:31 2019
+++ src/sys/dev/hyperv/hvkbd.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $	*/
+/*	$NetBSD: hvkbd.c,v 1.1.4.6 2019/11/24 08:11:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017 Microsoft Corp.
@@ -36,7 +36,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.5 2019/11/16 16:23:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.1.4.6 2019/11/24 08:11:06 martin Exp $");
 
 #include 
 #include 
@@ -357,13 +357,13 @@ hvkbd_connect(struct hvkbd_softc *sc)
 	}
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", 1);
-		s = spltty();
-		hvkbd_intr(sc);
-		splx(s);
+			s = spltty();
+			hvkbd_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", mstohz(1));
 	} while (--timo > 0 && sc->sc_connected == 0);
 
 	if (timo == 0 && sc->sc_connected == 0) {

Index: src/sys/dev/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.2.2.4 src/sys/dev/hyperv/if_hvn.c:1.2.2.5
--- src/sys/dev/hyperv/if_hvn.c:1.2.2.4	Mon Nov 18 19:27:56 2019
+++ src/sys/dev/hyperv/if_hvn.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.2.2.4 2019/11/18 19:27:56 martin Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.4 2019/11/18 19:27:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1075,7 +1075,7 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 			if (cold)
 delay(1000);
 			else
-tsleep(cmd, PRIBIO, "nvsout", 1);
+tsleep(cmd, PRIBIO, "nvsout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: NVSP operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->nvs_type, rv);
@@ -1093,13 +1093,13 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *
 		return 0;
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(sc, PRIBIO | PCATCH, "nvscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1));
 	} while (--timo > 0 && sc->sc_nvsdone != 1);
 
 	if (timo == 0 && sc->sc_nvsdone != 1) {
@@ -1397,7 +1397,7 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 			if (cold)
 delay(1000);
 			else
-tsleep(rc, PRIBIO, "rndisout", 1);
+tsleep(rc, PRIBIO, "rndisout", mstohz(1));
 		} else if (rv) {
 			DPRINTF("%s: RNDIS operation %u send error %d\n",
 			device_xname(sc->sc_dev), hdr->rm_type, rv);
@@ -1416,13 +1416,13 @@ hvn_rndis_cmd(struct hvn_softc *sc, stru
 	BUS_DMASYNC_POSTWRITE);
 
 	do {
-		if (cold)
+		if (cold) {
 			delay(1000);
-		else
-			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", 1);
-		s = splnet();
-		hvn_nvs_intr(sc);
-		splx(s);
+			s = splnet();
+			hvn_nvs_intr(sc);
+			splx(s);
+		} else
+			tsleep(rc, PRIBIO | PCATCH, "rndiscmd", mstohz(1));
 	} while (--timo > 0 && rc->rc_done != 1);
 
 	bus_dmamap_sync(sc->sc_dmat, rc->rc_dmap, 0, PAGE_SIZE,
Index: src/sys/dev/hyperv/vmbus.c
diff -u src/sys/dev/hyperv/vmbus.c:1.2.2.4 src/sys/dev/hyperv/vmbus.c:1.2.2.5
--- src/sys/dev/hyperv/vmbus.c:1.2.2.4	Tue Jul  9 15:16:45 2019
+++ src/sys/dev/hyperv/vmbus.c	Sun Nov 24 08:11:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $	*/
+/*	$NetBSD: vmbus.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $	*/
 /*	$OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.4 2019/07/09 15:16:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.2.2.5 2019/11/24 08:11:06 martin Exp $");
 
 #include 
 #include 
@@ -604,7 +604,7 @@