CVS commit: src/usr.bin/mail

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 23 03:49:00 UTC 2023

Modified Files:
src/usr.bin/mail: fio.c thread.c

Log Message:
mail: Fix regression for recent use-after-free fix

For makemessage(), do not skip thread_fix_old_links() for
newly-allocated message as before.

Thanks jun@ for report.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/mail/fio.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/mail/thread.c

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

Modified files:

Index: src/usr.bin/mail/fio.c
diff -u src/usr.bin/mail/fio.c:1.44 src/usr.bin/mail/fio.c:1.45
--- src/usr.bin/mail/fio.c:1.44	Thu Aug 10 20:36:28 2023
+++ src/usr.bin/mail/fio.c	Wed Aug 23 03:49:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fio.c,v 1.44 2023/08/10 20:36:28 mrg Exp $	*/
+/*	$NetBSD: fio.c,v 1.45 2023/08/23 03:49:00 rin Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)fio.c	8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: fio.c,v 1.44 2023/08/10 20:36:28 mrg Exp $");
+__RCSID("$NetBSD: fio.c,v 1.45 2023/08/23 03:49:00 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -126,6 +126,7 @@ makemessage(FILE *f, int omsgCount, int 
 	struct message *omessage;	/* old message structure array */
 	struct message *nmessage;
 	ptrdiff_t off;
+	int need_init;
 
 	omessage = get_abs_message(1);
 
@@ -135,13 +136,15 @@ makemessage(FILE *f, int omsgCount, int 
 		off = 0;
 	else
 		off = dot - omessage;
+	need_init = (omessage == NULL);
 	nmessage = realloc(omessage, size);
 	if (nmessage == NULL)
 		err(EXIT_FAILURE,
 		"Insufficient memory for %d messages", nmsgCount);
 	dot = nmessage + off;
 
-	thread_fix_old_links(nmessage, off, omsgCount);
+	if (off != 0 || need_init != 0)
+		thread_fix_old_links(nmessage, off, omsgCount);
 
 #ifndef THREAD_SUPPORT
 	message = nmessage;

Index: src/usr.bin/mail/thread.c
diff -u src/usr.bin/mail/thread.c:1.15 src/usr.bin/mail/thread.c:1.16
--- src/usr.bin/mail/thread.c:1.15	Thu Aug 10 20:36:28 2023
+++ src/usr.bin/mail/thread.c	Wed Aug 23 03:49:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: thread.c,v 1.15 2023/08/10 20:36:28 mrg Exp $	*/
+/*	$NetBSD: thread.c,v 1.16 2023/08/23 03:49:00 rin Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef __lint__
-__RCSID("$NetBSD: thread.c,v 1.15 2023/08/10 20:36:28 mrg Exp $");
+__RCSID("$NetBSD: thread.c,v 1.16 2023/08/23 03:49:00 rin Exp $");
 #endif /* not __lint__ */
 
 #include 
@@ -443,8 +443,6 @@ PUBLIC void
 thread_fix_old_links(struct message *nmessage, ptrdiff_t off, int omsgCount)
 {
 	int i;
-	if (off == 0)
-		return;
 
 #ifndef NDEBUG
 	message_array.t_head = nmessage; /* for assert check in thread_fix_new_links */



CVS commit: src/usr.bin/mail

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug 23 03:49:00 UTC 2023

Modified Files:
src/usr.bin/mail: fio.c thread.c

Log Message:
mail: Fix regression for recent use-after-free fix

For makemessage(), do not skip thread_fix_old_links() for
newly-allocated message as before.

Thanks jun@ for report.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/mail/fio.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/mail/thread.c

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



CVS commit: src/tests/crypto/libcrypto

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 17:27:49 UTC 2023

Modified Files:
src/tests/crypto/libcrypto/ec: Makefile
src/tests/crypto/libcrypto/threads: Makefile

Log Message:
Remove PROGDPLIBSSTATIC from ec and threads; dh still needs it because it
references internal symbols in libcrypto like ossl_dh_compute_key which
have been made static by the linker script (they are still visible in the
archive version).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/crypto/libcrypto/ec/Makefile
cvs rdiff -u -r1.7 -r1.8 src/tests/crypto/libcrypto/threads/Makefile

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

Modified files:

Index: src/tests/crypto/libcrypto/ec/Makefile
diff -u src/tests/crypto/libcrypto/ec/Makefile:1.2 src/tests/crypto/libcrypto/ec/Makefile:1.3
--- src/tests/crypto/libcrypto/ec/Makefile:1.2	Thu May 11 10:34:30 2023
+++ src/tests/crypto/libcrypto/ec/Makefile	Tue Aug 22 13:27:48 2023
@@ -1,6 +1,5 @@
-# $NetBSD: Makefile,v 1.2 2023/05/11 14:34:30 christos Exp $
+# $NetBSD: Makefile,v 1.3 2023/08/22 17:27:48 christos Exp $
 
-PROGDPLIBSSTATIC=yes
 HELPER_NAME=	ectest
 HELPER_DIR=	ec
 

Index: src/tests/crypto/libcrypto/threads/Makefile
diff -u src/tests/crypto/libcrypto/threads/Makefile:1.7 src/tests/crypto/libcrypto/threads/Makefile:1.8
--- src/tests/crypto/libcrypto/threads/Makefile:1.7	Sat May 13 13:46:10 2023
+++ src/tests/crypto/libcrypto/threads/Makefile	Tue Aug 22 13:27:49 2023
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.7 2023/05/13 17:46:10 riastradh Exp $
+# $NetBSD: Makefile,v 1.8 2023/08/22 17:27:49 christos Exp $
 
 .include 
-PROGDPLIBSSTATIC=yes
 HELPER_NAME=	threadstest
 HELPER_DIR=	threads
 



CVS commit: src/tests/crypto/libcrypto

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 17:27:49 UTC 2023

Modified Files:
src/tests/crypto/libcrypto/ec: Makefile
src/tests/crypto/libcrypto/threads: Makefile

Log Message:
Remove PROGDPLIBSSTATIC from ec and threads; dh still needs it because it
references internal symbols in libcrypto like ossl_dh_compute_key which
have been made static by the linker script (they are still visible in the
archive version).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/crypto/libcrypto/ec/Makefile
cvs rdiff -u -r1.7 -r1.8 src/tests/crypto/libcrypto/threads/Makefile

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



CVS commit: [netbsd-10] src/tests/crypto/libcrypto/conf

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:54:11 UTC 2023

Removed Files:
src/tests/crypto/libcrypto/conf [netbsd-10]: d_conf.out

Log Message:
Remove file accidently not removed when processing ticket #317


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/tests/crypto/libcrypto/conf/d_conf.out

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



CVS commit: [netbsd-10] src/tests/crypto/libcrypto/conf

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:54:11 UTC 2023

Removed Files:
src/tests/crypto/libcrypto/conf [netbsd-10]: d_conf.out

Log Message:
Remove file accidently not removed when processing ticket #317


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/tests/crypto/libcrypto/conf/d_conf.out

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

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:22:01 UTC 2023

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

Log Message:
Tickets #1888 and #1889


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

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

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:22:01 UTC 2023

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

Log Message:
Tickets #1888 and #1889


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

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.192 src/doc/CHANGES-8.3:1.1.2.193
--- src/doc/CHANGES-8.3:1.1.2.192	Mon Aug 21 12:41:29 2023
+++ src/doc/CHANGES-8.3	Tue Aug 22 16:22:00 2023
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.192 2023/08/21 12:41:29 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.193 2023/08/22 16:22:00 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -3821,3 +3821,15 @@ sys/dev/pci/pcidevs_data.h			regen
 	- Fix description of Intel 0x37d0.
 	[msaitoh, ticket #1887]
 
+sys/arch/x86/pci/amdsmn.c			1.17
+sys/arch/x86/pci/amdzentemp.c			1.19,1.20
+
+	amdsmn(4),amdzentemp(4): Add support for Zen2 Mendocino(17h/Axh) and
+	Zen4 Phoenix(19h/7xh).
+	[msaitoh, ticket #1888]
+
+sys/dev/pci/sdhc_pci.c1.21
+
+	Add quirk setting for some Intel eMMC devices to make them work.
+	[msaitoh, ticket #1889]
+



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

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:19:57 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1889):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/sdhc_pci.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/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:19:57 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1889):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/sdhc_pci.c

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

Modified files:

Index: src/sys/dev/pci/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.14.2.2 src/sys/dev/pci/sdhc_pci.c:1.14.2.3
--- src/sys/dev/pci/sdhc_pci.c:1.14.2.2	Wed Jan 18 19:31:43 2023
+++ src/sys/dev/pci/sdhc_pci.c	Tue Aug 22 16:19:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.14.2.2 2023/01/18 19:31:43 martin Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.14.2.3 2023/08/22 16:19:57 martin Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.2.2 2023/01/18 19:31:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.2.3 2023/08/22 16:19:57 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -155,7 +155,8 @@ static const struct sdhc_pci_quirk {
 		0x,
 		0x,
 		~0,
-		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
 	},
 
 	{
@@ -166,6 +167,97 @@ static const struct sdhc_pci_quirk {
 		~0,
 		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
 	},
+
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_C3K_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC2,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_APL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_GLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_3HS_U_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_495_YU_PCIE_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_CMTLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_JSL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_EHL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
 };
 
 static void sdhc_pci_quirk_ti_hack(struct pci_attach_args *);



CVS commit: [netbsd-9] src/doc

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:18:28 UTC 2023

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

Log Message:
Tickets #1720 and #1721


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-9.4

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.4
diff -u src/doc/CHANGES-9.4:1.1.2.93 src/doc/CHANGES-9.4:1.1.2.94
--- src/doc/CHANGES-9.4:1.1.2.93	Mon Aug 21 12:34:48 2023
+++ src/doc/CHANGES-9.4	Tue Aug 22 16:18:28 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.93 2023/08/21 12:34:48 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.94 2023/08/22 16:18:28 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -2058,3 +2058,15 @@ sys/dev/pci/pcidevs_data.h			regen
 	- Fix description of Intel 0x37d0.
 	[msaitoh, ticket #1719]
 
+sys/arch/x86/pci/amdsmn.c			1.17
+sys/arch/x86/pci/amdzentemp.c			1.19,1.20
+
+	amdsmn(4),amdzentemp(4): Add support for Zen2 Mendocino(17h/Axh) and
+	Zen4 Phoenix(19h/7xh).
+	[msaitoh, ticket #1720]
+
+sys/dev/pci/sdhc_pci.c1.21
+
+	Add quirk setting for some Intel eMMC devices to make them work.
+	[msaitoh, ticket #1721]
+



CVS commit: [netbsd-9] src/doc

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:18:28 UTC 2023

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

Log Message:
Tickets #1720 and #1721


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-9.4

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

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:17:30 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1721):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.16.2 -r1.14.16.3 src/sys/dev/pci/sdhc_pci.c

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

Modified files:

Index: src/sys/dev/pci/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.14.16.2 src/sys/dev/pci/sdhc_pci.c:1.14.16.3
--- src/sys/dev/pci/sdhc_pci.c:1.14.16.2	Wed Jan 18 19:26:30 2023
+++ src/sys/dev/pci/sdhc_pci.c	Tue Aug 22 16:17:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.14.16.2 2023/01/18 19:26:30 martin Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.14.16.3 2023/08/22 16:17:29 martin Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.16.2 2023/01/18 19:26:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.16.3 2023/08/22 16:17:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -155,7 +155,8 @@ static const struct sdhc_pci_quirk {
 		0x,
 		0x,
 		~0,
-		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
 	},
 
 	{
@@ -166,6 +167,97 @@ static const struct sdhc_pci_quirk {
 		~0,
 		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
 	},
+
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_C3K_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC2,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_APL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_GLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_3HS_U_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_495_YU_PCIE_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_CMTLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_JSL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_EHL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
 };
 
 static void sdhc_pci_quirk_ti_hack(struct pci_attach_args *);



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

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:17:30 UTC 2023

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1721):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.16.2 -r1.14.16.3 src/sys/dev/pci/sdhc_pci.c

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



CVS commit: [netbsd-10] src/doc

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:16:21 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #334 - #336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.111 -r1.1.2.112 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/doc

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:16:21 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #334 - #336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.111 -r1.1.2.112 src/doc/CHANGES-10.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-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.111 src/doc/CHANGES-10.0:1.1.2.112
--- src/doc/CHANGES-10.0:1.1.2.111	Mon Aug 21 12:30:46 2023
+++ src/doc/CHANGES-10.0	Tue Aug 22 16:16:20 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.111 2023/08/21 12:30:46 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.112 2023/08/22 16:16:20 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -11218,3 +11218,20 @@ sys/dev/pci/pcidevs_data.h			regen
 	- Fix description of Intel 0x37d0.
 	[msaitoh, ticket #333]
 
+sys/dev/pci/ahcisata_pci.c			1.69
+
+	ahcisata(4): ASM106x needs EXTRA_DELAY quirk.
+	[tnn, ticket #334]
+
+sys/arch/x86/pci/amdsmn.c			1.17
+sys/arch/x86/pci/amdzentemp.c			1.19,1.20
+
+	amdsmn(4),amdzentemp(4): Add support for Zen2 Mendocino(17h/Axh) and
+	Zen4 Phoenix(19h/7xh).
+	[msaitoh, ticket #335]
+
+sys/dev/pci/sdhc_pci.c1.21
+
+	Add quirk setting for some Intel eMMC devices to make them work.
+	[msaitoh, ticket #336]
+



CVS commit: [netbsd-10] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:14:55 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #336):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/dev/pci/sdhc_pci.c

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

Modified files:

Index: src/sys/dev/pci/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.19.2.1 src/sys/dev/pci/sdhc_pci.c:1.19.2.2
--- src/sys/dev/pci/sdhc_pci.c:1.19.2.1	Wed Jan 18 19:21:49 2023
+++ src/sys/dev/pci/sdhc_pci.c	Tue Aug 22 16:14:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.19.2.1 2023/01/18 19:21:49 martin Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.19.2.2 2023/08/22 16:14:55 martin Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.19.2.1 2023/01/18 19:21:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.19.2.2 2023/08/22 16:14:55 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -161,7 +161,8 @@ static const struct sdhc_pci_quirk {
 		0x,
 		0x,
 		~0,
-		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
 	},
 
 	{
@@ -172,6 +173,97 @@ static const struct sdhc_pci_quirk {
 		~0,
 		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
 	},
+
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_C3K_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC2,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_APL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_GLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_3HS_U_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_495_YU_PCIE_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_CMTLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_JSL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_EHL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
 };
 
 static void sdhc_pci_quirk_ti_hack(struct pci_attach_args *);



CVS commit: [netbsd-10] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:14:55 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #336):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/dev/pci/sdhc_pci.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/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:12:55 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1888):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.6 -r1.3.2.7 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.7.2.5 -r1.7.2.6 src/sys/arch/x86/pci/amdzentemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.3.2.6 src/sys/arch/x86/pci/amdsmn.c:1.3.2.7
--- src/sys/arch/x86/pci/amdsmn.c:1.3.2.6	Wed Jun 21 18:58:22 2023
+++ src/sys/arch/x86/pci/amdsmn.c	Tue Aug 22 16:12:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.3.2.6 2023/06/21 18:58:22 martin Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.3.2.7 2023/08/22 16:12:54 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2019 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.3.2.6 2023/06/21 18:58:22 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.3.2.7 2023/08/22 16:12:54 martin Exp $ ");
 
 /*
  * Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -112,6 +112,11 @@ static const struct pciid {
 		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
 		.amdsmn_data_reg = F17H_SMN_DATA_REG,
 	},
+	{
+		.amdsmn_deviceid = PCI_PRODUCT_AMD_F19_7X_RC,
+		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
+		.amdsmn_data_reg = F17H_SMN_DATA_REG,
+	},
 };
 
 static int amdsmn_match(device_t, cfdata_t, void *);

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.7.2.5 src/sys/arch/x86/pci/amdzentemp.c:1.7.2.6
--- src/sys/arch/x86/pci/amdzentemp.c:1.7.2.5	Wed Jun 21 18:58:22 2023
+++ src/sys/arch/x86/pci/amdzentemp.c	Tue Aug 22 16:12:54 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.7.2.5 2023/06/21 18:58:22 martin Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.7.2.6 2023/08/22 16:12:54 martin Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7.2.5 2023/06/21 18:58:22 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7.2.6 2023/08/22 16:12:54 martin Exp $ ");
 
 #include 
 #include 
@@ -370,15 +370,19 @@ amdzentemp_probe_ccd_sensors17h(struct a
 {
 	int maxreg;
 
-	sc->sc_ccd_offset = 0x154;
-
 	switch (model) {
 	case 0x00 ... 0x2f: /* Zen1, Zen+ */
+		sc->sc_ccd_offset = 0x154;
 		maxreg = 4;
 		break;
 	case 0x30 ... 0x3f: /* Zen2 TR (Castle Peak)/EPYC (Rome) */
 	case 0x60 ... 0x7f: /* Zen2 Ryzen (Renoir APU, Matisse) */
 	case 0x90 ... 0x9f: /* Zen2 Ryzen (Van Gogh APU) */
+		sc->sc_ccd_offset = 0x154;
+		maxreg = 8;
+		break;
+	case 0xa0 ... 0xaf: /* Zen2 Ryzen (Mendocino APU) */
+		sc->sc_ccd_offset = 0x300;
 		maxreg = 8;
 		break;
 	default:
@@ -403,6 +407,7 @@ amdzentemp_probe_ccd_sensors19h(struct a
 		maxreg = 8;
 		break;
 	case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */
+	case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */
 		sc->sc_ccd_offset = 0x308;
 		maxreg = 8;
 		break;



CVS commit: [netbsd-8] src/sys/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:12:55 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1888):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.6 -r1.3.2.7 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.7.2.5 -r1.7.2.6 src/sys/arch/x86/pci/amdzentemp.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/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:10:21 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1720):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.4 -r1.5.2.5 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.9.2.4 -r1.9.2.5 src/sys/arch/x86/pci/amdzentemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.5.2.4 src/sys/arch/x86/pci/amdsmn.c:1.5.2.5
--- src/sys/arch/x86/pci/amdsmn.c:1.5.2.4	Wed Jun 21 18:56:58 2023
+++ src/sys/arch/x86/pci/amdsmn.c	Tue Aug 22 16:10:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.5.2.4 2023/06/21 18:56:58 martin Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.5.2.5 2023/08/22 16:10:21 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2019 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.5.2.4 2023/06/21 18:56:58 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.5.2.5 2023/08/22 16:10:21 martin Exp $ ");
 
 /*
  * Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -112,6 +112,11 @@ static const struct pciid {
 		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
 		.amdsmn_data_reg = F17H_SMN_DATA_REG,
 	},
+	{
+		.amdsmn_deviceid = PCI_PRODUCT_AMD_F19_7X_RC,
+		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
+		.amdsmn_data_reg = F17H_SMN_DATA_REG,
+	},
 };
 
 static int amdsmn_match(device_t, cfdata_t, void *);

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.9.2.4 src/sys/arch/x86/pci/amdzentemp.c:1.9.2.5
--- src/sys/arch/x86/pci/amdzentemp.c:1.9.2.4	Wed Jun 21 18:56:58 2023
+++ src/sys/arch/x86/pci/amdzentemp.c	Tue Aug 22 16:10:21 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.9.2.4 2023/06/21 18:56:58 martin Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.9.2.5 2023/08/22 16:10:21 martin Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.9.2.4 2023/06/21 18:56:58 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.9.2.5 2023/08/22 16:10:21 martin Exp $ ");
 
 #include 
 #include 
@@ -370,15 +370,19 @@ amdzentemp_probe_ccd_sensors17h(struct a
 {
 	int maxreg;
 
-	sc->sc_ccd_offset = 0x154;
-
 	switch (model) {
 	case 0x00 ... 0x2f: /* Zen1, Zen+ */
+		sc->sc_ccd_offset = 0x154;
 		maxreg = 4;
 		break;
 	case 0x30 ... 0x3f: /* Zen2 TR (Castle Peak)/EPYC (Rome) */
 	case 0x60 ... 0x7f: /* Zen2 Ryzen (Renoir APU, Matisse) */
 	case 0x90 ... 0x9f: /* Zen2 Ryzen (Van Gogh APU) */
+		sc->sc_ccd_offset = 0x154;
+		maxreg = 8;
+		break;
+	case 0xa0 ... 0xaf: /* Zen2 Ryzen (Mendocino APU) */
+		sc->sc_ccd_offset = 0x300;
 		maxreg = 8;
 		break;
 	default:
@@ -403,6 +407,7 @@ amdzentemp_probe_ccd_sensors19h(struct a
 		maxreg = 8;
 		break;
 	case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */
+	case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */
 		sc->sc_ccd_offset = 0x308;
 		maxreg = 8;
 		break;



CVS commit: [netbsd-9] src/sys/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:10:21 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1720):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.4 -r1.5.2.5 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.9.2.4 -r1.9.2.5 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: [netbsd-10] src/sys/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:07:34 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-10]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #335):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.16.2.1 -r1.16.2.2 src/sys/arch/x86/pci/amdzentemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.14.4.2 src/sys/arch/x86/pci/amdsmn.c:1.14.4.3
--- src/sys/arch/x86/pci/amdsmn.c:1.14.4.2	Wed Jun 21 16:58:11 2023
+++ src/sys/arch/x86/pci/amdsmn.c	Tue Aug 22 16:07:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.14.4.2 2023/06/21 16:58:11 martin Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.14.4.3 2023/08/22 16:07:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2019 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.14.4.2 2023/06/21 16:58:11 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.14.4.3 2023/08/22 16:07:34 martin Exp $ ");
 
 /*
  * Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -112,6 +112,11 @@ static const struct pciid {
 		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
 		.amdsmn_data_reg = F17H_SMN_DATA_REG,
 	},
+	{
+		.amdsmn_deviceid = PCI_PRODUCT_AMD_F19_7X_RC,
+		.amdsmn_addr_reg = F17H_SMN_ADDR_REG,
+		.amdsmn_data_reg = F17H_SMN_DATA_REG,
+	},
 };
 
 static int amdsmn_match(device_t, cfdata_t, void *);

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.16.2.1 src/sys/arch/x86/pci/amdzentemp.c:1.16.2.2
--- src/sys/arch/x86/pci/amdzentemp.c:1.16.2.1	Wed Jun 21 16:58:11 2023
+++ src/sys/arch/x86/pci/amdzentemp.c	Tue Aug 22 16:07:34 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.16.2.1 2023/06/21 16:58:11 martin Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.16.2.2 2023/08/22 16:07:34 martin Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.16.2.1 2023/06/21 16:58:11 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.16.2.2 2023/08/22 16:07:34 martin Exp $ ");
 
 #include 
 #include 
@@ -370,15 +370,19 @@ amdzentemp_probe_ccd_sensors17h(struct a
 {
 	int maxreg;
 
-	sc->sc_ccd_offset = 0x154;
-
 	switch (model) {
 	case 0x00 ... 0x2f: /* Zen1, Zen+ */
+		sc->sc_ccd_offset = 0x154;
 		maxreg = 4;
 		break;
 	case 0x30 ... 0x3f: /* Zen2 TR (Castle Peak)/EPYC (Rome) */
 	case 0x60 ... 0x7f: /* Zen2 Ryzen (Renoir APU, Matisse) */
 	case 0x90 ... 0x9f: /* Zen2 Ryzen (Van Gogh APU) */
+		sc->sc_ccd_offset = 0x154;
+		maxreg = 8;
+		break;
+	case 0xa0 ... 0xaf: /* Zen2 Ryzen (Mendocino APU) */
+		sc->sc_ccd_offset = 0x300;
 		maxreg = 8;
 		break;
 	default:
@@ -403,6 +407,7 @@ amdzentemp_probe_ccd_sensors19h(struct a
 		maxreg = 8;
 		break;
 	case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */
+	case 0x70 ... 0x7f: /* Zen4 Ryzen "Phoenix" */
 		sc->sc_ccd_offset = 0x308;
 		maxreg = 8;
 		break;



CVS commit: [netbsd-10] src/sys/arch/x86/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:07:34 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-10]: amdsmn.c amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #335):

sys/arch/x86/pci/amdzentemp.c: revision 1.20
sys/arch/x86/pci/amdsmn.c: revision 1.17
sys/arch/x86/pci/amdzentemp.c: revision 1.19

Add Zen4 Ryzen "Phoenix" support.
Add Zen2 Mendocino APU support.
Add Zen4 Phoenix support.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.16.2.1 -r1.16.2.2 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: [netbsd-10] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 15:57:38 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #334):

sys/dev/pci/ahcisata_pci.c: revision 1.69

ahcisata: ASM106x needs EXTRA_DELAY quirk


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.2.1 src/sys/dev/pci/ahcisata_pci.c

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

Modified files:

Index: src/sys/dev/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.68 src/sys/dev/pci/ahcisata_pci.c:1.68.2.1
--- src/sys/dev/pci/ahcisata_pci.c:1.68	Wed Oct 12 12:50:02 2022
+++ src/sys/dev/pci/ahcisata_pci.c	Tue Aug 22 15:57:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.68 2022/10/12 12:50:02 macallan Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.68.2.1 2023/08/22 15:57:38 martin Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.68 2022/10/12 12:50:02 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.68.2.1 2023/08/22 15:57:38 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -217,6 +217,8 @@ static const struct ahci_pci_quirk ahci_
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_9SERIES_SATA_AHCI,
 	AHCI_QUIRK_EXTRA_DELAY },
 	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_FCH_SATA_D, AHCI_QUIRK_EXTRA_DELAY },
+	{ PCI_VENDOR_ASMEDIA, PCI_PRODUCT_ASMEDIA_ASM106X,
+	AHCI_QUIRK_EXTRA_DELAY },
 
 #if 0
 	/*



CVS commit: [netbsd-10] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 15:57:38 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #334):

sys/dev/pci/ahcisata_pci.c: revision 1.69

ahcisata: ASM106x needs EXTRA_DELAY quirk


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.68.2.1 src/sys/dev/pci/ahcisata_pci.c

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



CVS commit: [netbsd-10] src/tests/crypto/libcrypto/conf

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 15:55:26 UTC 2023

Added Files:
src/tests/crypto/libcrypto/conf [netbsd-10]: d_conf-1x.out

Log Message:
Add file accidently not added when processing ticket #317


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/tests/crypto/libcrypto/conf/d_conf-1x.out

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



CVS commit: [netbsd-10] src/tests/crypto/libcrypto/conf

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 15:55:26 UTC 2023

Added Files:
src/tests/crypto/libcrypto/conf [netbsd-10]: d_conf-1x.out

Log Message:
Add file accidently not added when processing ticket #317


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/tests/crypto/libcrypto/conf/d_conf-1x.out

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

Added files:

Index: src/tests/crypto/libcrypto/conf/d_conf-1x.out
diff -u /dev/null src/tests/crypto/libcrypto/conf/d_conf-1x.out:1.1.2.2
--- /dev/null	Tue Aug 22 15:55:27 2023
+++ src/tests/crypto/libcrypto/conf/d_conf-1x.out	Tue Aug 22 15:55:26 2023
@@ -0,0 +1,94 @@
+num_items = 47
+num_nodes = 24
+num_alloc_nodes   = 32
+num_expands   = 16
+num_expand_reallocs   = 1
+num_contracts = 0
+num_contract_reallocs = 0
+num_hash_calls= 60
+num_comp_calls= 5
+num_insert= 47
+num_replace   = 0
+num_delete= 0
+num_no_delete = 0
+num_retrieve  = 5
+num_retrieve_miss = 8
+num_hash_comps= 132
+node  0 ->   4
+node  1 ->   1
+node  2 ->   1
+node  3 ->   4
+node  4 ->   0
+node  5 ->   2
+node  6 ->   1
+node  7 ->   1
+node  8 ->   6
+node  9 ->   2
+node 10 ->   1
+node 11 ->   1
+node 12 ->   3
+node 13 ->   1
+node 14 ->   4
+node 15 ->   3
+node 16 ->   5
+node 17 ->   0
+node 18 ->   2
+node 19 ->   0
+node 20 ->   2
+node 21 ->   2
+node 22 ->   0
+node 23 ->   1
+20 nodes used out of 24
+47 items
+load 1.95  actual load 2.35
+init2=10
+cipher1=NULL
+s_client:cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2		= DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+ DUMP 
+[req] Attribute_text_7=Email Address
+[req] Attribute_text_2=State or Province Name (full name)
+[default] tmp_cert_dir=/tmp/eay/.ca_certs
+[req] Attribute_text_1=Country Name (2 letter code)
+[[genrsa]]
+[req] Attribute_default_5=TR
+[req] Attribute_text_6=Common Name (eg, YOUR name)
+[req] Attribute_default_1=AU
+[[req]]
+[[special]]
+[[gendh]]
+[req] Attribute_text_3=Locality Name (eg, city)
+[req] Attribute_type_1=countryName
+[default] init5==10' again
+[req] Attribute_type_3=localityName
+[s_client] cipher3=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] in\#it1=10
+[req] Attribute_text_4=Organization Name (eg, company)
+[req] Attribute_type_7=emailAddress
+[gendh] def_generator=2
+[default] HOME=/tmp/eay
+[s_client] cipher4=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] init=5
+[SSLeay] version=0.5.0
+[req] Attribute_type_4=organizationName
+[default] tmp2_cert_dir=thisis/tmp/eaystuff
+[req] Attribute_type_5=organizationalUnitName
+[[SSLEAY]]
+[default] init4=10'
+[[default]]
+[default] LOGNAME=Eric Young (home=/tmp/eay)
+[special] RANDFILE=/tmp/eay/.rand
+[req] default_keyfile=privkey.pem
+[req] Attribute_default_4=Mincom Pty Ltd
+[req] Attribute_default_2=Queensland
+[gendh] default_bits=512
+[req] default_bits=512
+[default] init2=10
+[SSLEAY] version=0.5.0
+[s_client] cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2		= DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[req] Attribute_text_5=Organizational Unit Name (eg, section)
+[req] Attribute_type_2=stateOrProvinceName
+[genrsa] default_bits=512
+[default] init3=10'
+[[SSLeay]]
+[[s_client]]
+[req] Attribute_type_6=commonName



CVS commit: src/sys/compat/linux/common

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 12:02:34 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
aarch64 does not have sys_inotify_init()...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/common/linux_inotify.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/compat/linux/common/linux_inotify.c
diff -u src/sys/compat/linux/common/linux_inotify.c:1.2 src/sys/compat/linux/common/linux_inotify.c:1.3
--- src/sys/compat/linux/common/linux_inotify.c:1.2	Sun Aug 20 14:09:25 2023
+++ src/sys/compat/linux/common/linux_inotify.c	Tue Aug 22 08:02:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $	*/
+/*	$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.2 2023/08/20 18:09:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_inotify.c,v 1.3 2023/08/22 12:02:34 christos Exp $");
 
 #include 
 #include 
@@ -331,6 +331,7 @@ leave0:
 	return error;
 }
 
+#ifndef __aarch64__
 /*
  * inotify_init(2).  Initialize a new inotify fd with flags=0.
  */
@@ -339,6 +340,7 @@ linux_sys_inotify_init(struct lwp *l, co
 {
 	return do_inotify_init(l, retval, 0);
 }
+#endif
 
 /*
  * inotify_init(2).  Initialize a new inotify fd with the given flags.



CVS commit: src/sys/compat/linux/common

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 12:02:34 UTC 2023

Modified Files:
src/sys/compat/linux/common: linux_inotify.c

Log Message:
aarch64 does not have sys_inotify_init()...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/linux/common/linux_inotify.c

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



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

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 11:56:49 UTC 2023

Modified Files:
src/distrib/sets/lists/debug: md.amd64

Log Message:
remove compat linux debugging sets (again)


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/distrib/sets/lists/debug/md.amd64

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

Modified files:

Index: src/distrib/sets/lists/debug/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.122 src/distrib/sets/lists/debug/md.amd64:1.123
--- src/distrib/sets/lists/debug/md.amd64:1.122	Mon Aug 21 18:37:17 2023
+++ src/distrib/sets/lists/debug/md.amd64	Tue Aug 22 07:56:49 2023
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.122 2023/08/21 22:37:17 christos Exp $
+# $NetBSD: md.amd64,v 1.123 2023/08/22 11:56:49 christos Exp $
 ./usr/lib/i386/12.202++_g.a			comp-c-debuglib		debuglib,compat,12.202xx
 ./usr/lib/i386/libi386_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/i386/libiberty_g.a			comp-obsolete		obsolete
@@ -17,10 +17,6 @@
 ./usr/libdata/debug/usr/lib/libx86_64.so.0.0.debug	comp-sys-shlib		pic,debug
 ./usr/libdata/debug/usr/libexec/ld.elf_so-i386	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/libexec/ld.elf_so-i386.debug	comp-sys-debug		debug,compat
-./usr/libdata/debug/usr/tests/compat/linux/h_inotify_directory.debug	tests-sys-debug	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/compat/linux/h_inotify_init.debug		tests-sys-debug	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/compat/linux/h_inotify_single_file.debug	tests-sys-debug	debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/compat/linux/h_inotify_watch_change.debug	tests-sys-debug	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait.debug	tests-obsolete	obsolete
 ./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait3.debug	tests-obsolete	obsolete
 ./usr/libdata/debug/usr/tests/kernel/arch/x86/t_ptrace_wait4.debug	tests-obsolete	obsolete



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

2023-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 22 11:56:49 UTC 2023

Modified Files:
src/distrib/sets/lists/debug: md.amd64

Log Message:
remove compat linux debugging sets (again)


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/distrib/sets/lists/debug/md.amd64

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



CVS commit: src/sys/arch/newsmips/apbus

2023-08-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 22 08:33:50 UTC 2023

Modified Files:
src/sys/arch/newsmips/apbus: if_sn.c

Log Message:
remove global sndebug definition. looks like historical leftover replaced
by SNDEBUG definition.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/newsmips/apbus/if_sn.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/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.53 src/sys/arch/newsmips/apbus/if_sn.c:1.54
--- src/sys/arch/newsmips/apbus/if_sn.c:1.53	Tue Aug 22 07:13:33 2023
+++ src/sys/arch/newsmips/apbus/if_sn.c	Tue Aug 22 08:33:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.53 2023/08/22 07:13:33 andvar Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.54 2023/08/22 08:33:50 andvar Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.53 2023/08/22 07:13:33 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.54 2023/08/22 08:33:50 andvar Exp $");
 
 #include "opt_inet.h"
 
@@ -84,8 +84,6 @@ static inline u_int	sonicput(struct sn_s
 static inline int	sonic_read(struct sn_softc *, void *, int);
 static inline struct mbuf *sonic_get(struct sn_softc *, void *, int);
 
-int sndebug = 0;
-
 /*
  * SONIC buffers need to be aligned 16 or 32 bit aligned.
  * These macros calculate and verify alignment.



CVS commit: src/sys/arch/newsmips/apbus

2023-08-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 22 08:33:50 UTC 2023

Modified Files:
src/sys/arch/newsmips/apbus: if_sn.c

Log Message:
remove global sndebug definition. looks like historical leftover replaced
by SNDEBUG definition.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/newsmips/apbus/if_sn.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/newsmips/apbus

2023-08-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 22 07:13:33 UTC 2023

Modified Files:
src/sys/arch/newsmips/apbus: if_sn.c

Log Message:
newsmips: fix build with SNDEBUG option enabled.

It was broken since rev 1.21 24 years ago, and got more broken code later on:
remove leftover device_xname(sc->sc_dev) param from aprint_debug_dev in one 
block.
fix wrong method name devoce_xname to device_xname in second block.
rename et to eh for consistency, and define it (definition was removed in the 
past).
while here, improve the code with riastradh help to make it safer.

pullup to at least netbsd-10 is needed.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/newsmips/apbus/if_sn.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/newsmips/apbus

2023-08-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 22 07:13:33 UTC 2023

Modified Files:
src/sys/arch/newsmips/apbus: if_sn.c

Log Message:
newsmips: fix build with SNDEBUG option enabled.

It was broken since rev 1.21 24 years ago, and got more broken code later on:
remove leftover device_xname(sc->sc_dev) param from aprint_debug_dev in one 
block.
fix wrong method name devoce_xname to device_xname in second block.
rename et to eh for consistency, and define it (definition was removed in the 
past).
while here, improve the code with riastradh help to make it safer.

pullup to at least netbsd-10 is needed.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/newsmips/apbus/if_sn.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/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.52 src/sys/arch/newsmips/apbus/if_sn.c:1.53
--- src/sys/arch/newsmips/apbus/if_sn.c:1.52	Sun Sep 18 12:49:34 2022
+++ src/sys/arch/newsmips/apbus/if_sn.c	Tue Aug 22 07:13:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.52 2022/09/18 12:49:34 thorpej Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.53 2023/08/22 07:13:33 andvar Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.52 2022/09/18 12:49:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.53 2023/08/22 07:13:33 andvar Exp $");
 
 #include "opt_inet.h"
 
@@ -202,7 +202,7 @@ snsetup(struct sn_softc	*sc, uint8_t *ll
 
 #ifdef SNDEBUG
 	aprint_debug_dev(sc->sc_dev, "buffers: rra=%p cda=%p rda=%p tda=%p\n",
-	device_xname(sc->sc_dev), sc->p_rra[0], sc->p_cda,
+	sc->p_rra[0], sc->p_cda,
 	sc->p_rda, sc->mtda[0].mtd_txp);
 #endif
 
@@ -1033,15 +1033,6 @@ sonic_read(struct sn_softc *sc, void *pk
 	struct ifnet *ifp = >sc_if;
 	struct mbuf *m;
 
-#ifdef SNDEBUG
-	{
-		printf("%s: rcvd %p len=%d type=0x%x from %s",
-		devoce_xname(sc->sc_dev), et, len, htons(et->ether_type),
-		ether_sprintf(et->ether_shost));
-		printf(" (to %s)\n", ether_sprintf(et->ether_dhost));
-	}
-#endif /* SNDEBUG */
-
 	if (len < (ETHER_MIN_LEN - ETHER_CRC_LEN) ||
 	len > (ETHER_MAX_LEN - ETHER_CRC_LEN)) {
 		printf("%s: invalid packet length %d bytes\n",
@@ -1049,6 +1040,18 @@ sonic_read(struct sn_softc *sc, void *pk
 		return 0;
 	}
 
+#ifdef SNDEBUG
+	{   
+		struct ether_header eh_s, *eh = _s;
+		memcpy(eh, pkt, sizeof(*eh));
+		CTASSERT(sizeof(*eh) <= ETHER_MIN_LEN);
+		printf("%s: rcvd %p len=%d type=0x%x from %s",
+		device_xname(sc->sc_dev), eh, len, htons(eh->ether_type),
+		ether_sprintf(eh->ether_shost));
+		printf(" (to %s)\n", ether_sprintf(eh->ether_dhost));
+	}   
+#endif /* SNDEBUG */
+
 	m = sonic_get(sc, pkt, len);
 	if (m == NULL)
 		return 0;



CVS commit: src/sys/arch/riscv/riscv

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 07:11:15 UTC 2023

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
riscv/trap.c: Dump cause register for unhandled page fault


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/riscv/riscv/trap.c

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

Modified files:

Index: src/sys/arch/riscv/riscv/trap.c
diff -u src/sys/arch/riscv/riscv/trap.c:1.22 src/sys/arch/riscv/riscv/trap.c:1.23
--- src/sys/arch/riscv/riscv/trap.c:1.22	Tue Aug 22 07:10:39 2023
+++ src/sys/arch/riscv/riscv/trap.c	Tue Aug 22 07:11:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.22 2023/08/22 07:10:39 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.23 2023/08/22 07:11:15 rin Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	__PMAP_PRIVATE
 #define	__UFETCHSTORE_PRIVATE
 
-__RCSID("$NetBSD: trap.c,v 1.22 2023/08/22 07:10:39 rin Exp $");
+__RCSID("$NetBSD: trap.c,v 1.23 2023/08/22 07:11:15 rin Exp $");
 
 #include 
 
@@ -380,7 +380,8 @@ trap_pagefault_fixup(struct trapframe *t
 #endif
 			break;
 		default:
-			panic("%s: Unhandled cause!", __func__);
+			panic("%s: Unhandled cause! 0x%016lx (%s)", __func__,
+			(long)cause, cause_name(cause));
 		}
 		if (attr == 0)
 			return false;



CVS commit: src/sys/arch/riscv/riscv

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 07:11:15 UTC 2023

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
riscv/trap.c: Dump cause register for unhandled page fault


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/riscv/riscv/trap.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/riscv/riscv

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 07:10:39 UTC 2023

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
riscv/trap.c: Handle userland breakpoint exception

Now, gdb 13 works for riscv64 to some extent :)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/riscv/riscv/trap.c

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

Modified files:

Index: src/sys/arch/riscv/riscv/trap.c
diff -u src/sys/arch/riscv/riscv/trap.c:1.21 src/sys/arch/riscv/riscv/trap.c:1.22
--- src/sys/arch/riscv/riscv/trap.c:1.21	Sun May  7 12:41:49 2023
+++ src/sys/arch/riscv/riscv/trap.c	Tue Aug 22 07:10:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.21 2023/05/07 12:41:49 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.22 2023/08/22 07:10:39 rin Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	__PMAP_PRIVATE
 #define	__UFETCHSTORE_PRIVATE
 
-__RCSID("$NetBSD: trap.c,v 1.21 2023/05/07 12:41:49 skrll Exp $");
+__RCSID("$NetBSD: trap.c,v 1.22 2023/08/22 07:10:39 rin Exp $");
 
 #include 
 
@@ -541,6 +541,26 @@ trap_misalignment(struct trapframe *tf, 
 	return false;
 }
 
+static bool
+trap_breakpoint(struct trapframe *tf, register_t epc, register_t status,
+register_t cause, register_t tval, bool usertrap_p, ksiginfo_t *ksi)
+{
+	if (usertrap_p) {
+		trap_ksi_init(ksi, SIGTRAP, TRAP_BRKPT,
+		(intptr_t)tval, cause);
+	} else {
+		dump_trapframe(tf, printf);
+#if defined(DDB)
+		kdb_trap(cause, tf);
+		PC_BREAK_ADVANCE(tf);
+#else
+		panic("%s: unknown kernel trap", __func__);
+#endif
+		return true;
+	}
+	return false;
+}
+
 void
 cpu_trap(struct trapframe *tf, register_t epc, register_t status,
 register_t cause, register_t tval)
@@ -583,15 +603,8 @@ cpu_trap(struct trapframe *tf, register_
 		ok = trap_misalignment(tf, epc, status, cause, addr,
 		usertrap_p, );
 	} else if (fault_mask & BREAKPOINT_TRAP_MASK) {
-		if (!usertrap_p) {
-			dump_trapframe(tf, printf);
-#if defined(DDB)
-			kdb_trap(cause, tf);
-			PC_BREAK_ADVANCE(tf);
-			return;	/* KERN */
-#endif
-			panic("%s: unknown kernel trap", __func__);
-		}
+		ok = trap_breakpoint(tf, epc, status, cause, addr,
+		usertrap_p, );
 	}
 
 	if (usertrap_p) {



CVS commit: src/sys/arch/riscv/riscv

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 07:10:39 UTC 2023

Modified Files:
src/sys/arch/riscv/riscv: trap.c

Log Message:
riscv/trap.c: Handle userland breakpoint exception

Now, gdb 13 works for riscv64 to some extent :)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/riscv/riscv/trap.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/macppc/dev

2023-08-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Aug 22 06:43:34 UTC 2023

Modified Files:
src/sys/arch/macppc/dev: pmu.c

Log Message:
tsleep()/wakeup() -> cv_*


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/macppc/dev/pmu.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/macppc/dev/pmu.c
diff -u src/sys/arch/macppc/dev/pmu.c:1.39 src/sys/arch/macppc/dev/pmu.c:1.40
--- src/sys/arch/macppc/dev/pmu.c:1.39	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/dev/pmu.c	Tue Aug 22 06:43:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmu.c,v 1.39 2021/08/07 16:18:58 thorpej Exp $ */
+/*	$NetBSD: pmu.c,v 1.40 2023/08/22 06:43:34 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.39 2021/08/07 16:18:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.40 2023/08/22 06:43:34 macallan Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.39
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -105,7 +106,8 @@ struct pmu_softc {
 	lwp_t *sc_thread;
 	int sc_pending;
 	/* signalling the event thread */
-	int sc_event;
+	kcondvar_t sc_event;
+	kmutex_t sc_evmtx;
 	/* ADB */
 	void (*sc_adb_handler)(void *, int, uint8_t *);
 	void *sc_adb_cookie;
@@ -296,6 +298,9 @@ pmu_attach(device_t parent, device_t sel
 	sc->sc_button = 0;
 	sc->sc_env_mask = 0xff;
 
+	cv_init(>sc_event, "pmu_event");
+	mutex_init(>sc_evmtx, MUTEX_DEFAULT, IPL_NONE);
+	
 	/*
 	 * core99 PowerMacs like to send environment messages with the lid
 	 * switch bit set - since that doesn't make any sense here and it
@@ -699,14 +704,14 @@ pmu_intr(void *arg)
 		DPRINTF("brightness: %d volume %d\n", resp[2], resp[3]);
 		sc->sc_brightness_wanted = resp[2];
 		sc->sc_volume_wanted = resp[3];
-		wakeup(>sc_event);
+		cv_signal(>sc_event);
 		goto done;
 	}
 	if (resp[1] & PMU_INT_PCEJECT) {
 		/* deal with PCMCIA eject buttons */
 		DPRINTF("card eject %d\n", resp[3]);
 		atomic_or_32(>sc_pending, (resp[3] & 3));
-		wakeup(>sc_event);
+		cv_signal(>sc_event);
 		goto done;
 	}
 	if (resp[1] & PMU_INT_BATTERY) {
@@ -719,7 +724,7 @@ pmu_intr(void *arg)
 	}
 	if (resp[1] & PMU_INT_ENVIRONMENT) {
 		uint8_t diff;
-#ifdef PMU_VERBOSE
+#ifdef PMU_DEBUG
 		/* deal with environment messages */
 		printf("environment:");
 		for (i = 2; i < len; i++)
@@ -732,12 +737,12 @@ pmu_intr(void *arg)
 		if (diff & PMU_ENV_LID_CLOSED) {
 			sc->sc_lid_closed = (resp[2] & PMU_ENV_LID_CLOSED) != 0;
 			atomic_or_32(>sc_pending, PMU_EV_LID);
-			wakeup(>sc_event);
+			cv_signal(>sc_event);
 		}
 		if (diff & PMU_ENV_POWER_BUTTON) {
 			sc->sc_button = (resp[2] & PMU_ENV_POWER_BUTTON) != 0;
 			atomic_or_32(>sc_pending, PMU_EV_BUTTON);
-			wakeup(>sc_event);
+			cv_signal(>sc_event);
 		}
 		goto done;
 	}
@@ -1054,7 +1059,8 @@ pmu_thread(void *cookie)
 	int ticks = hz, i;
 	
 	while (1) {
-		tsleep(>sc_event, PWAIT, "wait", ticks);
+		mutex_enter(>sc_evmtx);
+		cv_timedwait(>sc_event, >sc_evmtx, ticks);
 		if ((sc->sc_pending & 3) != 0) {
 			DPRINTF("eject %d\n", sc->sc_pending & 3);
 			for (i = 1; i < 3; i++) {
@@ -1062,7 +1068,7 @@ pmu_thread(void *cookie)
 	pmu_eject_card(sc, i);
 			}
 		}
-
+		mutex_exit(>sc_evmtx);
 		/* see if we need to update brightness */
 		if (sc->sc_brightness_wanted != sc->sc_brightness) {
 			pmu_update_brightness(sc);



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

2023-08-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Aug 22 06:43:34 UTC 2023

Modified Files:
src/sys/arch/macppc/dev: pmu.c

Log Message:
tsleep()/wakeup() -> cv_*


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/macppc/dev/pmu.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:22:36 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-netbsd-nat.c

Log Message:
gdb/aarch64: Fix misplaced comment. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:22:36 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-netbsd-nat.c

Log Message:
gdb/aarch64: Fix misplaced comment. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c:1.2	Thu Aug 17 07:25:52 2023
+++ src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c	Tue Aug 22 06:22:36 2023
@@ -34,8 +34,6 @@
 #include "bsd-kvm.h"
 #include "inf-ptrace.h"
 
-/* Determine if PT_GETREGS fetches REGNUM.  */
-
 struct aarch64_nbsd_nat_target final : public nbsd_nat_target
 {
   void fetch_registers (struct regcache *, int) override;
@@ -44,6 +42,8 @@ struct aarch64_nbsd_nat_target final : p
 
 static aarch64_nbsd_nat_target the_aarch64_nbsd_nat_target;
 
+/* Determine if PT_GETREGS fetches REGNUM.  */
+
 static bool
 getregs_supplies (struct gdbarch *gdbarch, int regnum)
 {



CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:20:32 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: riscv-netbsd-nat.c

Log Message:
gdb/riscv: Specify lwpid for PT_[GS]ETREGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:20:32 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: riscv-netbsd-nat.c

Log Message:
gdb/riscv: Specify lwpid for PT_[GS]ETREGS


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.1 src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.2
--- src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c:1.1	Mon Aug 14 20:42:27 2023
+++ src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c	Tue Aug 22 06:20:32 2023
@@ -71,7 +71,7 @@ riscv_nbsd_nat_target::fetch_registers (
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache->supply_regset (_nbsd_gregset, regnum, ,
@@ -104,13 +104,13 @@ riscv_nbsd_nat_target::store_registers (
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache->collect_regset (_nbsd_gregset, regnum, ,
 			   sizeof (regs));
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write registers"));
 }
 
@@ -118,13 +118,13 @@ riscv_nbsd_nat_target::store_registers (
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   regcache->collect_regset (_nbsd_fpregset, regnum, ,
 sizeof (fpregs));
 
-  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , 0) == -1)
+  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }
@@ -139,5 +139,3 @@ _initialize_riscv_nbsd_nat ()
 
 //  bsd_kvm_add_target (riscv_nbsd_supply_pcb);
 }
-
-



CVS commit: src/external/gpl3/gdb/dist/bfd

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:16:50 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf.c

Log Message:
gdb/bfd: Add support to NetBSD-style core file for riscv


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/bfd/elf.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/elf.c
diff -u src/external/gpl3/gdb/dist/bfd/elf.c:1.15 src/external/gpl3/gdb/dist/bfd/elf.c:1.16
--- src/external/gpl3/gdb/dist/bfd/elf.c:1.15	Thu Aug 17 06:44:56 2023
+++ src/external/gpl3/gdb/dist/bfd/elf.c	Tue Aug 22 06:16:50 2023
@@ -11190,6 +11190,7 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf
 
 case bfd_arch_aarch64:
 case bfd_arch_alpha:
+case bfd_arch_riscv:
 case bfd_arch_sparc:
   switch (note->type)
 	{



CVS commit: src/external/gpl3/gdb/dist/bfd

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:16:50 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf.c

Log Message:
gdb/bfd: Add support to NetBSD-style core file for riscv


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/bfd/elf.c

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



CVS commit: src/external/gpl3/gdb/lib/libbfd/arch

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:14:06 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/riscv32: defs.mk
src/external/gpl3/gdb/lib/libbfd/arch/riscv64: defs.mk

Log Message:
gdb/bfd: mknative riscv{64,32}


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk

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



CVS commit: src/external/gpl3/gdb/lib/libbfd/arch

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:14:06 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/riscv32: defs.mk
src/external/gpl3/gdb/lib/libbfd/arch/riscv64: defs.mk

Log Message:
gdb/bfd: mknative riscv{64,32}


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk

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

Modified files:

Index: src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk
diff -u src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk:1.3 src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk:1.4
--- src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk:1.3	Thu Aug 17 10:21:16 2023
+++ src/external/gpl3/gdb/lib/libbfd/arch/riscv32/defs.mk	Tue Aug 22 06:14:06 2023
@@ -2,7 +2,7 @@
 # Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp 
 # Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
 #
-G_libbfd_la_DEPENDENCIES=elf32-riscv.lo elfxx-riscv.lo elf-ifunc.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo elf-sframe.lo dwarf1.lo dwarf2.lo elf64-riscv.lo elf64.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo netbsd-core.lo archive64.lo ofiles ../libsframe/libsframe.la
+G_libbfd_la_DEPENDENCIES=elf32-riscv.lo elfxx-riscv.lo elf-ifunc.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo elf-sframe.lo dwarf1.lo dwarf2.lo elf64-riscv.lo elf64.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo  archive64.lo ofiles ../libsframe/libsframe.la
 G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo
 G_DEFS=-DHAVE_CONFIG_H
 G_INCLUDES=

Index: src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk
diff -u src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk:1.3 src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk:1.4
--- src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk:1.3	Thu Aug 17 10:21:16 2023
+++ src/external/gpl3/gdb/lib/libbfd/arch/riscv64/defs.mk	Tue Aug 22 06:14:06 2023
@@ -2,7 +2,7 @@
 # Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp 
 # Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
 #
-G_libbfd_la_DEPENDENCIES=elf64-riscv.lo elf64.lo elfxx-riscv.lo elf-ifunc.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo elf-sframe.lo dwarf1.lo dwarf2.lo elf32-riscv.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo netbsd-core.lo archive64.lo ofiles ../libsframe/libsframe.la
+G_libbfd_la_DEPENDENCIES=elf64-riscv.lo elf64.lo elfxx-riscv.lo elf-ifunc.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo elf-sframe.lo dwarf1.lo dwarf2.lo elf32-riscv.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo  archive64.lo ofiles ../libsframe/libsframe.la
 G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo
 G_DEFS=-DHAVE_CONFIG_H
 G_INCLUDES=



CVS commit: src/external/gpl3/gdb/dist/bfd

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:12:10 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/bfd: configure configure.ac

Log Message:
gdb/bfd: Stop compiling in useless netbsd-core.c for riscv

netbsd-core.c is for the old-style core format, which has
never been used for riscv.

Note that:
- binutils/bfd does not use this file for riscv.
- Up-to-date core file format is supported by elf.c.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/bfd/configure
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/bfd/configure.ac

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



CVS commit: src/external/gpl3/gdb/dist/bfd

2023-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 22 06:12:10 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/bfd: configure configure.ac

Log Message:
gdb/bfd: Stop compiling in useless netbsd-core.c for riscv

netbsd-core.c is for the old-style core format, which has
never been used for riscv.

Note that:
- binutils/bfd does not use this file for riscv.
- Up-to-date core file format is supported by elf.c.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/bfd/configure
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/bfd/configure.ac

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

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/configure
diff -u src/external/gpl3/gdb/dist/bfd/configure:1.17 src/external/gpl3/gdb/dist/bfd/configure:1.18
--- src/external/gpl3/gdb/dist/bfd/configure:1.17	Thu Aug 17 07:40:20 2023
+++ src/external/gpl3/gdb/dist/bfd/configure	Tue Aug 22 06:12:10 2023
@@ -14114,9 +14114,6 @@ if test "${target}" = "${host}"; then
   ns32k-*-netbsd* | ns32k-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
-  riscv*-*-netbsd*)
-	COREFILE=netbsd-core.lo
-	;;
   rs6000-*-lynx*)
 	COREFILE=lynx-core.lo
 	;;

Index: src/external/gpl3/gdb/dist/bfd/configure.ac
diff -u src/external/gpl3/gdb/dist/bfd/configure.ac:1.3 src/external/gpl3/gdb/dist/bfd/configure.ac:1.4
--- src/external/gpl3/gdb/dist/bfd/configure.ac:1.3	Mon Jul 31 16:59:49 2023
+++ src/external/gpl3/gdb/dist/bfd/configure.ac	Tue Aug 22 06:12:10 2023
@@ -914,9 +914,6 @@ changequote([,])dnl
   ns32k-*-netbsd* | ns32k-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
-  riscv*-*-netbsd*)
-	COREFILE=netbsd-core.lo
-	;;
   rs6000-*-lynx*)
 	COREFILE=lynx-core.lo
 	;;