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

2024-04-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 18 04:52:43 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
allow mapping of blitter registers


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/dev/gftfb.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/hppa/dev/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.13 src/sys/arch/hppa/dev/gftfb.c:1.14
--- src/sys/arch/hppa/dev/gftfb.c:1.13	Mon Apr  1 09:48:58 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Thu Apr 18 04:52:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.13 2024/04/01 09:48:58 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.14 2024/04/18 04:52:43 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -237,7 +237,8 @@ gftfb_attach(device_t parent, device_t s
 	}
 	rom = (struct sti_rom *)kmem_zalloc(sizeof(*rom), KM_SLEEP);
 	rom->rom_softc = >sc_base;
-	ret = sti_rom_setup(rom, paa->pa_iot, paa->pa_memt, sc->sc_romh, sc->sc_base.bases, STI_CODEBASE_MAIN);
+	ret = sti_rom_setup(rom, paa->pa_iot, paa->pa_memt, sc->sc_romh,
+	sc->sc_base.bases, STI_CODEBASE_MAIN);
 	if (ret != 0) {
 		kmem_free(rom, sizeof(*rom));
 		return;
@@ -889,16 +890,22 @@ gftfb_mmap(void *v, void *vs, off_t offs
 	struct vcons_data *vd = v;
 	struct gftfb_softc *sc = vd->cookie;
 	struct sti_rom *rom = sc->sc_base.sc_rom;
-	paddr_t pa;
+	paddr_t pa = -1;
 
-	if (offset < 0 || offset >= sc->sc_scr.fblen)
-		return -1;
 
-	if (sc->sc_mode != WSDISPLAYIO_MODE_DUMBFB)
+	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)
 		return -1;
 
-	pa = bus_space_mmap(rom->memt, sc->sc_scr.fbaddr, offset, prot,
-	BUS_SPACE_MAP_LINEAR);
+	if (offset >= 0 || offset < sc->sc_scr.fblen) {
+		/* framebuffer */
+		pa = bus_space_mmap(rom->memt, sc->sc_scr.fbaddr, offset,
+		prot, BUS_SPACE_MAP_LINEAR);
+	} else if (offset >= 0x8000 && offset < 0x804) {
+		/* blitter registers etc. */
+		pa = bus_space_mmap(rom->memt, rom->regh[2],
+		offset - 0x8000, prot, BUS_SPACE_MAP_LINEAR);
+	}
+
 	return pa;
 }
 



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

2024-04-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 18 04:52:43 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
allow mapping of blitter registers


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/dev/gftfb.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/hppa/hppa

2024-04-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 17 07:47:48 UTC 2024

Modified Files:
src/sys/arch/hppa/hppa: machdep.c

Log Message:
turn LEDs off when shutting down


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/hppa/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/hppa/hppa/machdep.c
diff -u src/sys/arch/hppa/hppa/machdep.c:1.20 src/sys/arch/hppa/hppa/machdep.c:1.21
--- src/sys/arch/hppa/hppa/machdep.c:1.20	Tue Mar  5 14:15:32 2024
+++ src/sys/arch/hppa/hppa/machdep.c	Wed Apr 17 07:47:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.20 2024/03/05 14:15:32 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.21 2024/04/17 07:47:48 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2024/03/05 14:15:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.21 2024/04/17 07:47:48 macallan Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -1415,6 +1415,8 @@ cpu_reboot(int howto, char *user_boot_st
 	if (cold_hook)
 		(*cold_hook)(HPPA_COLD_COLD);
 
+	hppa_led_ctl(0xf, 0, 0);
+
 	if (howto & RB_HALT) {
 		if ((howto & RB_POWERDOWN) == RB_POWERDOWN && cold_hook) {
 			printf("Powering off...");



CVS commit: src/sys/arch/hppa/hppa

2024-04-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 17 07:47:48 UTC 2024

Modified Files:
src/sys/arch/hppa/hppa: machdep.c

Log Message:
turn LEDs off when shutting down


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/hppa/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/riscv/conf

2024-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 17 06:11:56 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC.common

Log Message:
Re-enable HEARTBEAT


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/riscv/conf/GENERIC.common

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

2024-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 17 06:11:56 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC.common

Log Message:
Re-enable HEARTBEAT


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/riscv/conf/GENERIC.common

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/conf/GENERIC.common
diff -u src/sys/arch/riscv/conf/GENERIC.common:1.13 src/sys/arch/riscv/conf/GENERIC.common:1.14
--- src/sys/arch/riscv/conf/GENERIC.common:1.13	Sat Apr  6 13:42:46 2024
+++ src/sys/arch/riscv/conf/GENERIC.common	Wed Apr 17 06:11:56 2024
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.common,v 1.13 2024/04/06 13:42:46 skrll Exp $
+#	$NetBSD: GENERIC.common,v 1.14 2024/04/17 06:11:56 skrll Exp $
 #
 #	GENERIC common RISC-V kernel config items shared between 32 and 64
 #	kernels
@@ -17,8 +17,8 @@ options 	NTP		# NTP phase/frequency lock
 options 	KTRACE		# system call tracing via ktrace(1)
 
 # Heartbeat checks
-#options 	HEARTBEAT
-#options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
+options 	HEARTBEAT
+options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
 
 # Note: SysV IPC parameters could be changed dynamically, see sysctl(8).
 options 	SYSVMSG		# System V-like message queues



CVS commit: src/sys/arch/vax/vax

2024-04-15 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Apr 16 00:03:30 UTC 2024

Modified Files:
src/sys/arch/vax/vax: unimpl_emul.S

Log Message:
vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/vax/unimpl_emul.S

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

Modified files:

Index: src/sys/arch/vax/vax/unimpl_emul.S
diff -u src/sys/arch/vax/vax/unimpl_emul.S:1.4 src/sys/arch/vax/vax/unimpl_emul.S:1.5
--- src/sys/arch/vax/vax/unimpl_emul.S:1.4	Mon May 22 16:53:05 2017
+++ src/sys/arch/vax/vax/unimpl_emul.S	Tue Apr 16 00:03:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: unimpl_emul.S,v 1.4 2017/05/22 16:53:05 ragge Exp $	*/
+/*	$NetBSD: unimpl_emul.S,v 1.5 2024/04/16 00:03:30 kalvisd Exp $	*/
 
 /*
  * Copyright (c) 2001 Brandon Creighton.  All rights reserved.
@@ -683,7 +683,7 @@ emodd:	bsbw	touser
 	 * there aren't any bits left for the fraction.  Therefore we're
 	 * done here;  TMPFRAC1 is equal to TMPFRACTGT and TMPFRAC2 is 0.
 	 */
-	movq $0f0.0, TMPFRAC2
+	movq $0d0.0, TMPFRAC2
 	jmp 9f		/* we're done, move on */
 1:	
 	/*
@@ -727,7 +727,7 @@ emodd:	bsbw	touser
 	 * We are less than 1.0; TMPFRAC1 should be 0, and TMPFRAC2 should
 	 * be equal to TMPFRACTGT.
 	 */
-	movd $0f0.0, TMPFRAC1
+	movd $0d0.0, TMPFRAC1
 	movd TMPFRACTGT, TMPFRAC2
 9:			
 	/*
@@ -763,7 +763,7 @@ zeroexit:
 	bsbw getaddr_byte
 	movl $0x0, (%r0)
 	bsbw getaddr_byte
-	movd $0f0, (%r0)
+	movd $0d0, (%r0)
 	brw goback
 
 



CVS commit: src/sys/arch/vax/vax

2024-04-15 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Apr 16 00:03:30 UTC 2024

Modified Files:
src/sys/arch/vax/vax: unimpl_emul.S

Log Message:
vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/vax/unimpl_emul.S

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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 12:51:17 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64: cpu_machdep.c sig_machdep.c

Log Message:
kern/58149: aarch64: Cannot return from a signal handler if SP was misaligned 
when the signal arrived

Apply the kernel diff from the PR

1. sendsig_siginfo() previously assumed that user SP was always aligned to
   16 bytes and could call signal handlers with SP misaligned. This is a
   wrong assumption because aarch64 demands that SP is aligned *only while*
   it's being used to access memory. Now it properly aligns it before
   pusing anything on the stack.

2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
   considered the ucontext invalid otherwise. This meant if a signal was
   sent to a process whose SP was misaligned, the signal handler would fail
   to return because the ucontext passed from the kernel was an invalid
   one. Now setcontext(2) doesn't complain about misaligned SP.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/sig_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/cpu_machdep.c
diff -u src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.14 src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.15
--- src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.14	Sat Feb 25 00:40:22 2023
+++ src/sys/arch/aarch64/aarch64/cpu_machdep.c	Sun Apr 14 12:51:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_machdep.c,v 1.14 2023/02/25 00:40:22 riastradh Exp $ */
+/* $NetBSD: cpu_machdep.c,v 1.15 2024/04/14 12:51:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.14 2023/02/25 00:40:22 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.15 2024/04/14 12:51:16 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -158,9 +158,13 @@ dosoftints(void)
 int
 cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp)
 {
+	/*
+	 * We intentionally don't verify that _REG_SP is aligned to
+	 * 16-bytes boundaries because it can be legally misaligned as long
+	 * as it's not used for accessing memory.
+	 */
 	if ((mcp->__gregs[_REG_SPSR] & ~SPSR_NZCV)
-	|| (mcp->__gregs[_REG_PC] & 3)
-	|| (mcp->__gregs[_REG_SP] & 15))
+	|| (mcp->__gregs[_REG_PC] & 3))
 		return EINVAL;
 
 	return 0;

Index: src/sys/arch/aarch64/aarch64/sig_machdep.c
diff -u src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8 src/sys/arch/aarch64/aarch64/sig_machdep.c:1.9
--- src/sys/arch/aarch64/aarch64/sig_machdep.c:1.8	Mon Nov  1 05:07:15 2021
+++ src/sys/arch/aarch64/aarch64/sig_machdep.c	Sun Apr 14 12:51:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.9 2024/04/14 12:51:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.8 2021/11/01 05:07:15 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.9 2024/04/14 12:51:16 skrll Exp $");
 
 #include 
 #include 
@@ -58,8 +58,14 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 
 	vaddr_t sp;
 
-	sp = onstack_p ? ((vaddr_t)ss->ss_sp + ss->ss_size) & -16 : tf->tf_sp;
+	/*
+	 * The user stack isn't guaranteed to be aligned to 16 bytes. Align
+	 * it before pushing anything onto it.
+	 */
+	sp = onstack_p ? ((vaddr_t)ss->ss_sp + ss->ss_size) : tf->tf_sp;
+	sp &= -16;
 
+	__CTASSERT(sizeof(ucontext_t) % 16 == 0);
 	sp -= sizeof(ucontext_t);
 	const vaddr_t ucp = sp;
 



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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 12:51:17 UTC 2024

Modified Files:
src/sys/arch/aarch64/aarch64: cpu_machdep.c sig_machdep.c

Log Message:
kern/58149: aarch64: Cannot return from a signal handler if SP was misaligned 
when the signal arrived

Apply the kernel diff from the PR

1. sendsig_siginfo() previously assumed that user SP was always aligned to
   16 bytes and could call signal handlers with SP misaligned. This is a
   wrong assumption because aarch64 demands that SP is aligned *only while*
   it's being used to access memory. Now it properly aligns it before
   pusing anything on the stack.

2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
   considered the ucontext invalid otherwise. This meant if a signal was
   sent to a process whose SP was misaligned, the signal handler would fail
   to return because the ucontext passed from the kernel was an invalid
   one. Now setcontext(2) doesn't complain about misaligned SP.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/sig_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/mips/mips

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:45 UTC 2024

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/mips/sig_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/mips/mips/sig_machdep.c
diff -u src/sys/arch/mips/mips/sig_machdep.c:1.24 src/sys/arch/mips/mips/sig_machdep.c:1.25
--- src/sys/arch/mips/mips/sig_machdep.c:1.24	Tue Nov 27 14:09:54 2018
+++ src/sys/arch/mips/mips/sig_machdep.c	Sun Apr 14 07:56:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.24 2018/11/27 14:09:54 maxv Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.25 2024/04/14 07:56:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,8 +30,8 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-	
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.24 2018/11/27 14:09:54 maxv Exp $"); 
+
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.25 2024/04/14 07:56:45 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -48,12 +48,12 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep.
 #include 
 #include 
 
-void *	
+void *
 getframe(struct lwp *l, int sig, int *onstack)
 {
 	struct proc * const p = l->l_proc;
 	struct trapframe * const tf = l->l_md.md_utf;
- 
+
 	/* Do we need to jump onto the signal stack? */
 	*onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
 	&& (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;



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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:45 UTC 2024

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/mips/sig_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/arm/arm

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:13 UTC 2024

Modified Files:
src/sys/arch/arm/arm: sig_machdep.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/arm/arm/sig_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/arm/arm/sig_machdep.c
diff -u src/sys/arch/arm/arm/sig_machdep.c:1.52 src/sys/arch/arm/arm/sig_machdep.c:1.53
--- src/sys/arch/arm/arm/sig_machdep.c:1.52	Mon Feb  1 19:31:34 2021
+++ src/sys/arch/arm/arm/sig_machdep.c	Sun Apr 14 07:56:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.52 2021/02/01 19:31:34 skrll Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.53 2024/04/14 07:56:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.52 2021/02/01 19:31:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.53 2024/04/14 07:56:13 skrll Exp $");
 
 #include 		/* XXX only needed by syscallargs.h */
 #include 
@@ -97,10 +97,10 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
 	fp = getframe(l, sig, );
-	
+
 	/* make room on the stack */
 	fp--;
-	
+
 	/* make the stack aligned */
 	fp = (struct sigframe_siginfo *)STACK_ALIGN(fp, STACK_ALIGNBYTES);
 
@@ -134,7 +134,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	 * trampoline version numbers are coordinated with machine-
 	 * dependent code in libc.
 	 */
-	
+
 	tf->tf_r0 = sig;
 	tf->tf_r1 = (int)>sf_si;
 	tf->tf_r2 = (int)>sf_uc;



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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:13 UTC 2024

Modified Files:
src/sys/arch/arm/arm: sig_machdep.c

Log Message:
Trailing whitespace.


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

2024-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 13 12:28:01 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
port-arm/58135: reproducible pmap KASSERT failure for armv7 with NFS root

Don't unconditionally set XN in pmap_clearbit - only set it if a mapping
exists VM_PROT_EXEC is being cleared.

I've simplified the #ifdefs in the patch from the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.442 -r1.443 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.442 src/sys/arch/arm/arm32/pmap.c:1.443
--- src/sys/arch/arm/arm32/pmap.c:1.442	Sat Apr 13 10:36:01 2024
+++ src/sys/arch/arm/arm32/pmap.c	Sat Apr 13 12:28:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.442 2024/04/13 10:36:01 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.443 2024/04/13 12:28:01 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -193,7 +193,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.442 2024/04/13 10:36:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.443 2024/04/13 12:28:01 skrll Exp $");
 
 #include 
 #include 
@@ -2330,15 +2330,10 @@ pmap_clearbit(struct vm_page_md *md, pad
 #ifdef PMAP_CACHE_VIPT
 	const bool want_syncicache = PV_IS_EXEC_P(md->pvh_attrs);
 	bool need_syncicache = false;
-#ifdef ARM_MMU_EXTENDED
-	const u_int execbits = (maskbits & PVF_EXEC) ? L2_XS_XN : 0;
-#else
-	const u_int execbits = 0;
+#ifndef ARM_MMU_EXTENDED
 	bool need_vac_me_harder = false;
 #endif
-#else
-	const u_int execbits = 0;
-#endif
+#endif /* PMAP_CACHE_VIPT */
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLARGS(maphist, "md %#jx pa %#jx maskbits %#jx",
@@ -2421,9 +2416,14 @@ pmap_clearbit(struct vm_page_md *md, pad
 
 		pt_entry_t * const ptep = >l2b_kva[l2pte_index(va)];
 		const pt_entry_t opte = *ptep;
-		pt_entry_t npte = opte | execbits;
+		pt_entry_t npte = opte;
+
+#if defined(ARM_MMU_EXTENDED)
+		if ((maskbits & PVF_EXEC) != 0 && l2pte_valid_p(opte)) {
+			KASSERT((opte & L2_TYPE_S) != 0);
+			npte |= L2_XS_XN;
+		}
 
-#ifdef ARM_MMU_EXTENDED
 		KASSERT((opte & L2_XS_nG) == (pm == pmap_kernel() ? 0 : L2_XS_nG));
 #endif
 



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

2024-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 13 12:28:01 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
port-arm/58135: reproducible pmap KASSERT failure for armv7 with NFS root

Don't unconditionally set XN in pmap_clearbit - only set it if a mapping
exists VM_PROT_EXEC is being cleared.

I've simplified the #ifdefs in the patch from the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.442 -r1.443 src/sys/arch/arm/arm32/pmap.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/arm32

2024-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 13 10:36:01 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Restore a space I accidentally removed from a copyright with

$NetBSD: pmap.c,v 1.396 2020/03/13 16:14:18 skrll Exp $


To generate a diff of this commit:
cvs rdiff -u -r1.441 -r1.442 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.441 src/sys/arch/arm/arm32/pmap.c:1.442
--- src/sys/arch/arm/arm32/pmap.c:1.441	Wed Dec 13 06:42:40 2023
+++ src/sys/arch/arm/arm32/pmap.c	Sat Apr 13 10:36:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.441 2023/12/13 06:42:40 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.442 2024/04/13 10:36:01 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  * 3. The name of the company nor the name of the author may be used to
- *   endorse or promote products derived from this software without specific
+ *endorse or promote products derived from this software without specific
  *prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
@@ -193,7 +193,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.441 2023/12/13 06:42:40 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.442 2024/04/13 10:36:01 skrll Exp $");
 
 #include 
 #include 



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

2024-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 13 10:36:01 UTC 2024

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Restore a space I accidentally removed from a copyright with

$NetBSD: pmap.c,v 1.396 2020/03/13 16:14:18 skrll Exp $


To generate a diff of this commit:
cvs rdiff -u -r1.441 -r1.442 src/sys/arch/arm/arm32/pmap.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/x86/x86

2024-04-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr 13 09:12:09 UTC 2024

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

Log Message:
viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.

XXX pullup-10, -9, -8


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/viac7temp.c

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

Modified files:

Index: src/sys/arch/x86/x86/viac7temp.c
diff -u src/sys/arch/x86/x86/viac7temp.c:1.9 src/sys/arch/x86/x86/viac7temp.c:1.10
--- src/sys/arch/x86/x86/viac7temp.c:1.9	Thu Oct  7 12:52:27 2021
+++ src/sys/arch/x86/x86/viac7temp.c	Sat Apr 13 09:12:09 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $ */
+/* $NetBSD: viac7temp.c,v 1.10 2024/04/13 09:12:09 andvar Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -27,11 +27,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.10 2024/04/13 09:12:09 andvar Exp $");
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -162,3 +163,32 @@ viac7temp_refresh_xcall(void *arg0, void
 	edata->value_cur += 27315;
 	edata->state = ENVSYS_SVALID;
 }
+
+MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+viac7temp_modcmd(modcmd_t cmd, void *arg __unused)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	case MODULE_CMD_FINI:
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_viac7temp,
+		cfattach_ioconf_viac7temp, cfdata_ioconf_viac7temp);
+#endif
+		return error;
+	default:
+		return ENOTTY;
+	}
+}



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

2024-04-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr 13 09:12:09 UTC 2024

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

Log Message:
viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.

XXX pullup-10, -9, -8


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/viac7temp.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

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:59:13 UTC 2024

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

Log Message:
riscv: Schedule next hardclock tick in the future, not the past.

If we have missed hardclock ticks, schedule up to one tick interval
in the future anyway; don't try to play hardclock catchup by
scheduling for when the next hardclock tick _should_ have been, in
the past, leading to ticking as fast as possible until we've caught
up.  as fast as possible until we've caught up.

Playing hardclock catchup triggers heartbeat panics when continuing
from ddb, if you've been in ddb for >15sec.  Other hardclock drivers
like x86 lapic don't play hardclock catchup either.

PR kern/57920


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/riscv/riscv/clock_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/riscv/riscv/clock_machdep.c
diff -u src/sys/arch/riscv/riscv/clock_machdep.c:1.7 src/sys/arch/riscv/riscv/clock_machdep.c:1.8
--- src/sys/arch/riscv/riscv/clock_machdep.c:1.7	Thu Jan 18 07:41:50 2024
+++ src/sys/arch/riscv/riscv/clock_machdep.c	Sun Apr  7 22:59:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $	*/
+/*	$NetBSD: clock_machdep.c,v 1.8 2024/04/07 22:59:13 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $");
+__RCSID("$NetBSD: clock_machdep.c,v 1.8 2024/04/07 22:59:13 riastradh Exp $");
 
 #include 
 #include 
@@ -124,6 +124,10 @@ riscv_timer_intr(void *arg)
 	ci->ci_ev_timer.ev_count++;
 
 	ci->ci_lastintr_scheduled += timer_ticks_per_hz;
+	while (__predict_false(ci->ci_lastintr_scheduled < now)) {
+		ci->ci_lastintr_scheduled += timer_ticks_per_hz;
+		/* XXX count missed timer interrupts */
+	}
 	sbi_set_timer(ci->ci_lastintr_scheduled);
 
 	hardclock(cf);



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

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:59:13 UTC 2024

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

Log Message:
riscv: Schedule next hardclock tick in the future, not the past.

If we have missed hardclock ticks, schedule up to one tick interval
in the future anyway; don't try to play hardclock catchup by
scheduling for when the next hardclock tick _should_ have been, in
the past, leading to ticking as fast as possible until we've caught
up.  as fast as possible until we've caught up.

Playing hardclock catchup triggers heartbeat panics when continuing
from ddb, if you've been in ddb for >15sec.  Other hardclock drivers
like x86 lapic don't play hardclock catchup either.

PR kern/57920


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

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:52:53 UTC 2024

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

Log Message:
riscv: Make sure cpu0->ci_cpu_freq is initialized by cpu_attach.

Otherwise this stays zero, which screws up cpu_ipi_wait.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/cpu.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/cpu.c
diff -u src/sys/arch/riscv/riscv/cpu.c:1.5 src/sys/arch/riscv/riscv/cpu.c:1.6
--- src/sys/arch/riscv/riscv/cpu.c:1.5	Sun Sep  3 08:48:20 2023
+++ src/sys/arch/riscv/riscv/cpu.c	Sun Apr  7 22:52:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.5 2023/09/03 08:48:20 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.6 2024/04/07 22:52:53 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.5 2023/09/03 08:48:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.6 2024/04/07 22:52:53 riastradh Exp $");
 
 #include 
 
@@ -184,6 +184,7 @@ cpu_attach(device_t dv, cpuid_t hartid)
 		ci = curcpu();
 		KASSERTMSG(ci == _info_store[0], "ci %p", ci);
 		ci->ci_cpuid = hartid;
+		ci->ci_cpu_freq = riscv_timer_frequency_get();
 	} else {
 #ifdef MULTIPROCESSOR
 		if ((boothowto & RB_MD1) != 0) {



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

2024-04-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr  7 22:52:53 UTC 2024

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

Log Message:
riscv: Make sure cpu0->ci_cpu_freq is initialized by cpu_attach.

Otherwise this stays zero, which screws up cpu_ipi_wait.


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

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:51:49 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Remove extra whitespace after P-4032.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/conf/README.evbmips

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/evbmips/conf/README.evbmips
diff -u src/sys/arch/evbmips/conf/README.evbmips:1.1 src/sys/arch/evbmips/conf/README.evbmips:1.2
--- src/sys/arch/evbmips/conf/README.evbmips:1.1	Sun Apr  7 19:39:24 2024
+++ src/sys/arch/evbmips/conf/README.evbmips	Sun Apr  7 19:51:49 2024
@@ -1,4 +1,4 @@
-$NetBSD: README.evbmips,v 1.1 2024/04/07 19:39:24 andvar Exp $
+$NetBSD: README.evbmips,v 1.2 2024/04/07 19:51:49 andvar Exp $
 
 The documentation is not final, more updates are coming.
 
@@ -29,7 +29,7 @@ MIPSSIM64	2021/01/27	evbmips(n)64-el,eb	
 MTX-1		2006/02/23	evbmips-el		4G Systems MTX-1 (MeshCube / AccessCube, Alchemy Au1500).
 OCTEON		2015/04/29	evbmips(n)64-eb		Cavium Octeon and Octeon Plus SoC based devices like Ubiquiti Networks EdgeRouter Lite.
 OMSAL400	2006/02/23	evbmips-el		Plat'Home OpenMicroServer (OMS-AL400, Alchemy Au1550).
-P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032  evaluation board (QED RM4xxx).
+P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032 evaluation board (QED RM4xxx).
 P5064		2001/05/28	evbmips-el		Algorithmics MIPS P-5064 evaluation board (QED RM52xx).
 P5064-64	2009/12/14	evbmips(n)64-el		P5064 64-bit kernel configuration.
 P6032		2001/06/22	evbmips-el		Algorithmics MIPS P-6032 evaluation board.



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

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:51:49 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Remove extra whitespace after P-4032.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/conf/README.evbmips

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



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

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:39:24 UTC 2024

Added Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Initial version of evbmips kernel configuration files documentation.
The goal is to give a better understanding which hardware they represent
and how to build them. Also not to lose this information over the years.

Loosely based on a README.evbarm, however has additional notes on building
targets. The file is not final, some discussion came up about the need of
*32 kernel configs. simon is planning to review.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/README.evbmips

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

Added files:

Index: src/sys/arch/evbmips/conf/README.evbmips
diff -u /dev/null src/sys/arch/evbmips/conf/README.evbmips:1.1
--- /dev/null	Sun Apr  7 19:39:24 2024
+++ src/sys/arch/evbmips/conf/README.evbmips	Sun Apr  7 19:39:24 2024
@@ -0,0 +1,64 @@
+$NetBSD: README.evbmips,v 1.1 2024/04/07 19:39:24 andvar Exp $
+
+The documentation is not final, more updates are coming.
+
+config		date		targets			boards
+-
+ADM5210		2007/03/20	evbmips-el		Infineon ADM5120 (MIPS32 4Kc) based boards and routers, 
+			including RouterBOARD 100 series.
+ADM5210-NB	2007/03/20	evbmips-el		ADM5120 netboot kernel.
+ADM5210-USB	2007/03/20	evbmips-el		ADM5120 netboot kernel with USB support.
+AP30		2006/06/06	evbmips-el,eb		Atheros AP30 development board (AR5312).
+CI20		2014/11/22	evbmips-eb		MIPS Creator CI20 (Ingenic JZ4780).
+CPMBR1400	2011/07/28	evbmips-el		CradlePoint MBR1400 Router (Ralink RT3883 MIPS74K).
+DB120		2011/07/07	evbmips-eb		Qualcomm Atheros AR9344 (MIPS74K) DB120 evaluation board.
+DBAU1500	2006/02/08	evbmips-el,eb		AMD Alchemy DBAu1500 evaluation board.
+DBAU1550	2006/02/08	evbmips-el,eb		AMD Alchemy DBAu1550 evaluation board.
+GDIUM		2009/08/06	evbmips-el		EMTEC Gdium netbook 32-bit kernel.
+GDIUM64		2011/08/24	evbmips(n)64-el		EMTEC Gdium netbook 64-bit kernel.
+LINKITSMART7688	2016/10/05	evbmips-el		Seeed Studio LinkIt Smart 7688 compact controller board (MediaTek MT7688).
+LOONGSON	2011/08/27	evbmips64-el		Loongson 2F/2E based devices (Lemote Fuloong, Yeelong).
+MALTA		2002/03/07	evbmips-el,eb		MIPS Malta evaluation board 4Kc (MIPS32) or 5Kc (MIPS64).
+MALTA32		2009/12/14	evbmips64-el,eb		MALTA N32 ABI kernel configuration.
+MALTA32.MP	2009/12/14	evbmips64-el,eb		MALTA N32 ABI MP kernel configuration.
+MALTA64		2009/12/14	evbmips(n)64-el,eb	MALTA 64-bit kernel configuration.
+MALTA64.MP	2009/12/14	evbmips(n)64-el,eb	MALTA MP 64-bit kernel configuration.
+MERAKI		2006/09/26	evbmips-eb		Meraki Mini (Atheros AR2315).
+MIPSSIM		2021/01/27	evbmips-el,eb		QEMU MIPS "mipssim" simulator.
+MIPSSIM64	2021/01/27	evbmips(n)64-el,eb	MIPSSIM 64-bit kernel.
+MTX-1		2006/02/23	evbmips-el		4G Systems MTX-1 (MeshCube / AccessCube, Alchemy Au1500).
+OCTEON		2015/04/29	evbmips(n)64-eb		Cavium Octeon and Octeon Plus SoC based devices like Ubiquiti Networks EdgeRouter Lite.
+OMSAL400	2006/02/23	evbmips-el		Plat'Home OpenMicroServer (OMS-AL400, Alchemy Au1550).
+P4032		2001/06/01	evbmips-el		Algorithmics MIPS P-4032  evaluation board (QED RM4xxx).
+P5064		2001/05/28	evbmips-el		Algorithmics MIPS P-5064 evaluation board (QED RM52xx).
+P5064-64	2009/12/14	evbmips(n)64-el		P5064 64-bit kernel configuration.
+P6032		2001/06/22	evbmips-el		Algorithmics MIPS P-6032 evaluation board.
+RB153		2007/03/20	evbmips-el		MikroTik RouterBOARD 153 (Infineon ADM5120).
+RB433UAH	2011/07/07	evbmips-eb		MikroTik RouterBOARD 433(UAH) AR71xx (MIPS24K core).
+SBMIPS		2002/03/06	evbmips-el,eb		Broadcom/SiByte SB1250 evaluation board.
+SBMIPS.MP	2011/02/20	evbmips-el,eb		SBMIPS MP kernel configuration.
+SBMIPS64	2009/12/14	evbmips(n)64-el,eb	SBMIPS 64-bit kernel configuration.
+SBMIPS64.MP	2011/02/20	evbmips(n)64-el,eb	SBMIPS 64-bit MP kernel configuration.
+WGT624V3	2007/02/18	evbmips-eb		Netgear WGT624 v3 wireless router (example config).
+XLSATX		2009/12/14RMI (NetLogic) XLS/XLR models (base for other XLSATX* kernel configs).
+XLSATX32	2011/02/20	evbmips64-el,eb		XLSATX N32 kernel configuration.
+XLSATX64	2009/12/14	evbmips(n)64-el,eb	XLSATX 64-bit kernel configuration.
+XLSATX64.MP	2011/02/20	evbmips(n)64-el,eb	XLSATX 64-bit MP kernel configuration.
+ZYXELKX		2014/04/30	evbmips-el		Zyxel Keenetic Extra router (MediaTek MT7620A).
+
+Configuration file notes:
+* "INSALL_*"	installation kernel configuration files.
+		(typically enables hooks for initializing the root memory-disk).
+* "*.MP"	configuration files with the multiprocessor support enabled.
+* "*32"		N32 ABI kernel configuration files
+		(can be built using evbmips64-* targets).
+Building target notes:
+* "*-el"	represent targets for building little-endian 

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

2024-04-07 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Apr  7 19:39:24 UTC 2024

Added Files:
src/sys/arch/evbmips/conf: README.evbmips

Log Message:
Initial version of evbmips kernel configuration files documentation.
The goal is to give a better understanding which hardware they represent
and how to build them. Also not to lose this information over the years.

Loosely based on a README.evbarm, however has additional notes on building
targets. The file is not final, some discussion came up about the need of
*32 kernel configs. simon is planning to review.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/conf/README.evbmips

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



CVS commit: src/sys/arch

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 17:08:00 UTC 2024

Modified Files:
src/sys/arch/sparc/include: psl.h
src/sys/arch/sparc/sparc: memeccreg.h
src/sys/arch/sparc64/include: psl.h

Log Message:
sparc: fix typos and omissions in PSTATE_BITS and ECC_AFR_BITS

Fixes PR 57869.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc/include/psl.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/sparc/memeccreg.h
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc64/include/psl.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

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 17:08:00 UTC 2024

Modified Files:
src/sys/arch/sparc/include: psl.h
src/sys/arch/sparc/sparc: memeccreg.h
src/sys/arch/sparc64/include: psl.h

Log Message:
sparc: fix typos and omissions in PSTATE_BITS and ECC_AFR_BITS

Fixes PR 57869.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc/include/psl.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/sparc/memeccreg.h
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc64/include/psl.h

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

Modified files:

Index: src/sys/arch/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.52 src/sys/arch/sparc/include/psl.h:1.53
--- src/sys/arch/sparc/include/psl.h:1.52	Tue Jul 11 13:10:08 2023
+++ src/sys/arch/sparc/include/psl.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.52 2023/07/11 13:10:08 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.53 2024/04/07 17:08:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -113,8 +113,11 @@
 #define PSTATE_IE	0x002	/* interrupt enable */
 #define PSTATE_AG	0x001	/* enable alternate globals */
 
-#define PSTATE_BITS "\20\14IG\13MG\12CLE\11TLE\10\7MM\6RED\5PEF\4AM\3PRIV\2IE\1AG"
-
+#define PSTATE_BITS "\177\020"		\
+	"b\013IG\0"	"b\012MG\0"	"b\011CLE\0"	"b\010TLE\0"	\
+			"F\006\002\0"	":\000MM_TSO\0"	":\001MM_PSO\0"	\
+	":\002MM_RMO\0"	"*?\0"		"b\005RED\0"	"b\004PEF\0"	\
+	"b\003AM\0"	"b\002PRIV\0"	"b\001IE\0"	"b\000AG\0"
 
 /*
  * 32-bit code requires TSO or at best PSO since that's what's supported on

Index: src/sys/arch/sparc/sparc/memeccreg.h
diff -u src/sys/arch/sparc/sparc/memeccreg.h:1.2 src/sys/arch/sparc/sparc/memeccreg.h:1.3
--- src/sys/arch/sparc/sparc/memeccreg.h:1.2	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/memeccreg.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: memeccreg.h,v 1.2 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: memeccreg.h,v 1.3 2024/04/07 17:08:00 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 #define ECC_AFR_S	0x0800	/* Access was in supervisor mode */
 #define ECC_AFR_MID	0xf000	/* Module code */
 #define ECC_AFR_BITS	"\177\020"\
-			"f\0\4VAH\0f\4\4TYPE\0f\10\3SIZE\0"	\
+			"f\0\4PAH\0f\4\4TYPE\0f\10\3SIZE\0"	\
 			"b\13C\0b\14LOCK\0b\15MBL\0"		\
 			"f\16\10VA\0b\33S\0f\34\4MID\0"
 

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.64 src/sys/arch/sparc64/include/psl.h:1.65
--- src/sys/arch/sparc64/include/psl.h:1.64	Sat Sep  2 05:51:57 2023
+++ src/sys/arch/sparc64/include/psl.h	Sun Apr  7 17:08:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.64 2023/09/02 05:51:57 jdc Exp $ */
+/*	$NetBSD: psl.h,v 1.65 2024/04/07 17:08:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -129,7 +129,11 @@
 #define PSTATE_IE	0x002	/* interrupt enable */
 #define PSTATE_AG	0x001	/* enable alternate globals */
 
-#define PSTATE_BITS "\20\14IG\13MG\12CLE\11TLE\10\7MM\6RED\5PEF\4AM\3PRIV\2IE\1AG"
+#define PSTATE_BITS "\177\020"		\
+	"b\013IG\0"	"b\012MG\0"	"b\011CLE\0"	"b\010TLE\0"	\
+			"F\006\002\0"	":\000MM_TSO\0"	":\001MM_PSO\0"	\
+	":\002MM_RMO\0"	"*?\0"		"b\005RED\0"	"b\004PEF\0"	\
+	"b\003AM\0"	"b\002PRIV\0"	"b\001IE\0"	"b\000AG\0"
 
 
 /*



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

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:42:46 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC.common

Log Message:
Attach qemufwcfg


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/riscv/conf/GENERIC.common

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/conf/GENERIC.common
diff -u src/sys/arch/riscv/conf/GENERIC.common:1.12 src/sys/arch/riscv/conf/GENERIC.common:1.13
--- src/sys/arch/riscv/conf/GENERIC.common:1.12	Tue Apr  2 22:56:51 2024
+++ src/sys/arch/riscv/conf/GENERIC.common	Sat Apr  6 13:42:46 2024
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.common,v 1.12 2024/04/02 22:56:51 charlotte Exp $
+#	$NetBSD: GENERIC.common,v 1.13 2024/04/06 13:42:46 skrll Exp $
 #
 #	GENERIC common RISC-V kernel config items shared between 32 and 64
 #	kernels
@@ -144,7 +144,7 @@ plic* 		at fdt? pass 2
 com* 		at fdt?			# UART
 
 # Firmware devices
-#qemufwcfg* 	at fdt?			# QEMU Firmware Configuration device
+qemufwcfg* 	at fdt?			# QEMU Firmware Configuration device
 
 # RTC devices
 gfrtc* 		at fdt?			# Google Goldfish RTC



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

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:42:46 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC.common

Log Message:
Attach qemufwcfg


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/riscv/conf/GENERIC.common

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

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:41:03 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: copy.S

Log Message:
Fix riscv32 build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/copy.S

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

Modified files:

Index: src/sys/arch/riscv/riscv/copy.S
diff -u src/sys/arch/riscv/riscv/copy.S:1.1 src/sys/arch/riscv/riscv/copy.S:1.2
--- src/sys/arch/riscv/riscv/copy.S:1.1	Sat Apr  6 10:08:54 2024
+++ src/sys/arch/riscv/riscv/copy.S	Sat Apr  6 13:41:03 2024
@@ -118,6 +118,7 @@ ENTRY(_ucas_32)
 END(_ucas_32)
 
 
+#ifdef _LP64
 /*
  * int _ucas_64(volatile uint64_t *ptr, uint64_t old,
  *	uint64_t new, uint64_t *ret)
@@ -156,3 +157,4 @@ ENTRY(_ucas_64)
 	li	a0, EFAULT
 	ret
 END(_ucas_64)
+#endif



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

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:41:03 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: copy.S

Log Message:
Fix riscv32 build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/riscv/copy.S

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

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 10:08:54 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: files.riscv
src/sys/arch/riscv/include: types.h
src/sys/arch/riscv/riscv: genassym.cf
Added Files:
src/sys/arch/riscv/riscv: copy.S

Log Message:
Provide and use _ucas_{32,64} implementations


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/include/types.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/riscv/riscv/copy.S
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/riscv/riscv/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/riscv/conf/files.riscv
diff -u src/sys/arch/riscv/conf/files.riscv:1.14 src/sys/arch/riscv/conf/files.riscv:1.15
--- src/sys/arch/riscv/conf/files.riscv:1.14	Sun Sep  3 08:48:19 2023
+++ src/sys/arch/riscv/conf/files.riscv	Sat Apr  6 10:08:54 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.riscv,v 1.14 2023/09/03 08:48:19 skrll Exp $
+#	$NetBSD: files.riscv,v 1.15 2024/04/06 10:08:54 skrll Exp $
 #
 
 maxpartitions	16
@@ -25,6 +25,7 @@ file	arch/riscv/riscv/bus_space_generic.
 file	arch/riscv/riscv/bus_space_notimpl.S
 file	arch/riscv/riscv/bus_stubs.c
 file	arch/riscv/riscv/clock_machdep.c
+file	arch/riscv/riscv/copy.S
 file	arch/riscv/riscv/core_machdep.c		coredump
 file	arch/riscv/riscv/cpu.c			cpu
 file	arch/riscv/riscv/cpu_subr.c

Index: src/sys/arch/riscv/include/types.h
diff -u src/sys/arch/riscv/include/types.h:1.16 src/sys/arch/riscv/include/types.h:1.17
--- src/sys/arch/riscv/include/types.h:1.16	Sun May  7 12:41:48 2023
+++ src/sys/arch/riscv/include/types.h	Sat Apr  6 10:08:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.16 2023/05/07 12:41:48 skrll Exp $ */
+/* $NetBSD: types.h,v 1.17 2024/04/06 10:08:54 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -98,6 +98,7 @@ typedef __int32_t	__register_t;
 #define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_SYSCALL_INTERN
 #define	__HAVE_TLS_VARIANT_I
+#define	__HAVE_UCAS_FULL
 /* XXX temporary */
 #define	__HAVE_UNLOCKED_PMAP
 #define	__HAVE___LWP_GETPRIVATE_FAST

Index: src/sys/arch/riscv/riscv/genassym.cf
diff -u src/sys/arch/riscv/riscv/genassym.cf:1.15 src/sys/arch/riscv/riscv/genassym.cf:1.16
--- src/sys/arch/riscv/riscv/genassym.cf:1.15	Mon Jun 12 19:04:14 2023
+++ src/sys/arch/riscv/riscv/genassym.cf	Sat Apr  6 10:08:54 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.15 2023/06/12 19:04:14 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.16 2024/04/06 10:08:54 skrll Exp $
 
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -148,6 +148,7 @@ define	CI_MTX_COUNT	offsetof(struct cpu_
 define	CI_MTX_OLDSPL	offsetof(struct cpu_info, ci_mtx_oldspl)
 define	CI_SOFTINTS	offsetof(struct cpu_info, ci_softints)
 
+define	FB_LEN		sizeof(struct faultbuf)
 define	FB_A0		offsetof(struct faultbuf, fb_reg[FB_A0])
 define	FB_RA		offsetof(struct faultbuf, fb_reg[FB_RA])
 define	FB_S0		offsetof(struct faultbuf, fb_reg[FB_S0])
@@ -165,6 +166,8 @@ define	FB_S11		offsetof(struct faultbuf,
 define	FB_SP		offsetof(struct faultbuf, fb_reg[FB_SP])
 define	FB_SR		offsetof(struct faultbuf, fb_sr)
 
+define	EFAULT		EFAULT
+
 define	PAGE_SIZE	PAGE_SIZE
 define	PAGE_MASK	PAGE_MASK
 define	PAGE_SHIFT	PAGE_SHIFT
@@ -192,6 +195,7 @@ define	RW_WRITE_LOCKED	RW_WRITE_LOCKED
 define	RW_READ_INCR	RW_READ_INCR
 define	RW_READER	RW_READER
 
+define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS
 define	VM_MIN_KERNEL_ADDRESS	VM_MIN_KERNEL_ADDRESS
 define	VM_MAX_KERNEL_ADDRESS	VM_MAX_KERNEL_ADDRESS
 define	VM_KERNEL_BASE		VM_KERNEL_BASE

Added files:

Index: src/sys/arch/riscv/riscv/copy.S
diff -u /dev/null src/sys/arch/riscv/riscv/copy.S:1.1
--- /dev/null	Sat Apr  6 10:08:54 2024
+++ src/sys/arch/riscv/riscv/copy.S	Sat Apr  6 10:08:54 2024
@@ -0,0 +1,158 @@
+/*-
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 

CVS commit: src/sys/arch/riscv

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 10:08:54 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: files.riscv
src/sys/arch/riscv/include: types.h
src/sys/arch/riscv/riscv: genassym.cf
Added Files:
src/sys/arch/riscv/riscv: copy.S

Log Message:
Provide and use _ucas_{32,64} implementations


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/include/types.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/riscv/riscv/copy.S
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/riscv/riscv/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/alpha/pci

2024-04-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr  3 04:30:30 UTC 2024

Modified Files:
src/sys/arch/alpha/pci: irongate_pci.c

Log Message:
Add a missing barrier in irongate_conf_read0().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/pci/irongate_pci.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/alpha/pci

2024-04-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr  3 04:30:30 UTC 2024

Modified Files:
src/sys/arch/alpha/pci: irongate_pci.c

Log Message:
Add a missing barrier in irongate_conf_read0().


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/pci/irongate_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/arch/alpha/pci/irongate_pci.c
diff -u src/sys/arch/alpha/pci/irongate_pci.c:1.12 src/sys/arch/alpha/pci/irongate_pci.c:1.13
--- src/sys/arch/alpha/pci/irongate_pci.c:1.12	Fri Jun 25 03:45:59 2021
+++ src/sys/arch/alpha/pci/irongate_pci.c	Wed Apr  3 04:30:30 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: irongate_pci.c,v 1.12 2021/06/25 03:45:59 thorpej Exp $ */
+/* $NetBSD: irongate_pci.c,v 1.13 2024/04/03 04:30:30 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.12 2021/06/25 03:45:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irongate_pci.c,v 1.13 2024/04/03 04:30:30 thorpej Exp $");
 
 #include 
 #include 
@@ -106,6 +106,7 @@ irongate_conf_read0(void *ipv, pcitag_t 
 	REGVAL(PCI_CONF_ADDR) = (CONFADDR_ENABLE | tag | (offset & 0xff));
 	alpha_mb();
 	data = REGVAL(PCI_CONF_DATA);
+	alpha_mb();
 	REGVAL(PCI_CONF_ADDR) = 0;
 	alpha_mb();
 	PCI_CONF_UNLOCK(s);



CVS commit: src/sys/arch

2024-04-02 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Tue Apr  2 22:56:51 UTC 2024

Modified Files:
src/sys/arch/amd64/conf: GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/i386/conf: GENERIC XEN3PAE_DOM0 XEN3PAE_DOMU
src/sys/arch/macppc/conf: GENERIC GENERIC_601 POWERMAC_G5
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/riscv/conf: GENERIC.common
src/sys/arch/sandpoint/conf: GENERIC
src/sys/arch/sparc64/conf: GENERIC
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Mention DKWEDGE_METHOD_TOS in several kernel config files


To generate a diff of this commit:
cvs rdiff -u -r1.609 -r1.610 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.202 -r1.203 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.1253 -r1.1254 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/conf/XEN3PAE_DOMU
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/macppc/conf/GENERIC_601
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/macppc/conf/POWERMAC_G5
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/ofppc/conf/GENERIC
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/conf/GENERIC.common
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/sandpoint/conf/GENERIC
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/zaurus/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.609 src/sys/arch/amd64/conf/GENERIC:1.610
--- src/sys/arch/amd64/conf/GENERIC:1.609	Mon Jan 29 18:27:10 2024
+++ src/sys/arch/amd64/conf/GENERIC	Tue Apr  2 22:56:50 2024
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.609 2024/01/29 18:27:10 christos Exp $
+# $NetBSD: GENERIC,v 1.610 2024/04/02 22:56:50 charlotte Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.609 $"
+#ident		"GENERIC-$Revision: 1.610 $"
 
 maxusers	64		# estimated number of users
 
@@ -198,6 +198,7 @@ options 	DKWEDGE_METHOD_GPT	# Supports G
 #options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
 options 	DKWEDGE_METHOD_APPLE	# Support Apple partitions as wedges
 #options 	DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges
+#options 	DKWEDGE_METHOD_TOS	# Support Atari "TOS" partitions as wedges
 
 # File systems
 include "conf/filesystems.config"

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.202 src/sys/arch/amd64/conf/XEN3_DOM0:1.203
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.202	Mon Jan 29 18:27:10 2024
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Tue Apr  2 22:56:50 2024
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.202 2024/01/29 18:27:10 christos Exp $
+# $NetBSD: XEN3_DOM0,v 1.203 2024/04/02 22:56:50 charlotte Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -14,7 +14,7 @@ include 	"arch/amd64/conf/std.xen"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"XEN3_DOM0-$Revision: 1.202 $"
+#ident		"XEN3_DOM0-$Revision: 1.203 $"
 
 maxusers	32		# estimated number of users
 
@@ -193,6 +193,7 @@ options 	DKWEDGE_METHOD_GPT	# Supports G
 #options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
 options 	DKWEDGE_METHOD_APPLE	# Support Apple partitions as wedges
 #options 	DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges
+#options 	DKWEDGE_METHOD_TOS	# Support Atari "TOS" partitions as wedges
 
 # File systems
 include "conf/filesystems.config"

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.104 src/sys/arch/amd64/conf/XEN3_DOMU:1.105
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.104	Mon Jan 29 18:27:10 2024
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Tue Apr  2 22:56:50 2024
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.104 2024/01/29 18:27:10 christos Exp $
+# $NetBSD: XEN3_DOMU,v 1.105 2024/04/02 22:56:50 charlotte Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -11,7 +11,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 #options 	UVMHIST_PRINT
 #options 	SYSCALL_DEBUG
 
-#ident		"XEN3_DOMU-$Revision: 1.104 $"
+#ident		"XEN3_DOMU-$Revision: 1.105 $"
 
 maxusers	32		# estimated number of users
 
@@ -74,6 +74,7 @@ options 	DKWEDGE_METHOD_GPT	# Supports G
 #options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
 options 	DKWEDGE_METHOD_APPLE	# Support Apple partitions as wedges
 #options 	DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges
+#options 	DKWEDGE_METHOD_TOS	# Support Atari "TOS" partitions as wedges
 
 # File systems
 include "conf/filesystems.config"

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1253 src/sys/arch/i386/conf/GENERIC:1.1254
--- 

CVS commit: src/sys/arch

2024-04-02 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Tue Apr  2 22:56:51 UTC 2024

Modified Files:
src/sys/arch/amd64/conf: GENERIC XEN3_DOM0 XEN3_DOMU
src/sys/arch/i386/conf: GENERIC XEN3PAE_DOM0 XEN3PAE_DOMU
src/sys/arch/macppc/conf: GENERIC GENERIC_601 POWERMAC_G5
src/sys/arch/ofppc/conf: GENERIC
src/sys/arch/riscv/conf: GENERIC.common
src/sys/arch/sandpoint/conf: GENERIC
src/sys/arch/sparc64/conf: GENERIC
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Mention DKWEDGE_METHOD_TOS in several kernel config files


To generate a diff of this commit:
cvs rdiff -u -r1.609 -r1.610 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.202 -r1.203 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.1253 -r1.1254 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/conf/XEN3PAE_DOMU
cvs rdiff -u -r1.379 -r1.380 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/macppc/conf/GENERIC_601
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/macppc/conf/POWERMAC_G5
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/ofppc/conf/GENERIC
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/conf/GENERIC.common
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/sandpoint/conf/GENERIC
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/zaurus/conf/GENERIC

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



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

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 14:21:29 UTC 2024

Modified Files:
src/sys/arch/powerpc/include: limits.h

Log Message:
harmonize with the rest of MD limits files.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/limits.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/include

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 14:21:29 UTC 2024

Modified Files:
src/sys/arch/powerpc/include: limits.h

Log Message:
harmonize with the rest of MD limits files.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/limits.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/include/limits.h
diff -u src/sys/arch/powerpc/include/limits.h:1.20 src/sys/arch/powerpc/include/limits.h:1.21
--- src/sys/arch/powerpc/include/limits.h:1.20	Mon Jan 21 15:28:18 2019
+++ src/sys/arch/powerpc/include/limits.h	Tue Apr  2 10:21:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.20 2019/01/21 20:28:18 dholland Exp $	*/
+/*	$NetBSD: limits.h,v 1.21 2024/04/02 14:21:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -94,18 +94,9 @@
 #define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
 #endif
 
-#ifdef _LP64
-/* Quads and longs are the same on LP64. */
-#define	UQUAD_MAX	(ULONG_MAX)
-#define	QUAD_MAX	(LONG_MAX)
-#define	QUAD_MIN	(LONG_MIN)
-#else
-/* GCC requires that quad constants be written as expressions. */
-#define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
-	/* max value for a quad_t */
-#define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
-#define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
-#endif
+#define	UQUAD_MAX	0xULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */



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

2024-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  1 16:24:01 UTC 2024

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

Log Message:
Return the correct error from {fetch,store}_user_data and fix

futex_wake_op_op: [0.273033s] Failed: 
/usr/src/tests/lib/libc/sys/t_futex_ops.c:942: Expected errno 14, got 1, in 
__futex(_word, FUTEX_WAKE_OP | flags, 0, NULL, NULL, 0, op) == -1


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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

2024-04-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr  1 16:24:01 UTC 2024

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

Log Message:
Return the correct error from {fetch,store}_user_data and fix

futex_wake_op_op: [0.273033s] Failed: 
/usr/src/tests/lib/libc/sys/t_futex_ops.c:942: Expected errno 14, got 1, in 
__futex(_word, FUTEX_WAKE_OP | flags, 0, NULL, NULL, 0, op) == -1


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/arch/riscv/riscv/trap.c:1.25
--- src/sys/arch/riscv/riscv/trap.c:1.24	Thu Sep  7 12:48:49 2023
+++ src/sys/arch/riscv/riscv/trap.c	Mon Apr  1 16:24:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.24 2023/09/07 12:48:49 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.25 2024/04/01 16:24:01 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	__PMAP_PRIVATE
 #define	__UFETCHSTORE_PRIVATE
 
-__RCSID("$NetBSD: trap.c,v 1.24 2023/09/07 12:48:49 skrll Exp $");
+__RCSID("$NetBSD: trap.c,v 1.25 2024/04/01 16:24:01 skrll Exp $");
 
 #include 
 
@@ -672,7 +672,7 @@ fetch_user_data(const void *uaddr, void 
 	if (__predict_false(uva > VM_MAXUSER_ADDRESS - size))
 		return EFAULT;
 
-	if ((error = cpu_set_onfault(, 1)) != 0)
+	if ((error = cpu_set_onfault(, EFAULT)) != 0)
 		return error;
 
 	csr_sstatus_set(SR_SUM);
@@ -737,7 +737,7 @@ store_user_data(void *uaddr, const void 
 	if (__predict_false(uva > VM_MAXUSER_ADDRESS - size))
 		return EFAULT;
 
-	if ((error = cpu_set_onfault(, 1)) != 0)
+	if ((error = cpu_set_onfault(, EFAULT)) != 0)
 		return error;
 
 	csr_sstatus_set(SR_SUM);



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

2024-04-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Apr  1 15:52:08 UTC 2024

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

Log Message:
ti_gpio: add gpio(4) interrupt support

tested with gpiopps(4) on Beagle Bone Black


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/ti/ti_gpio.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/ti_gpio.c
diff -u src/sys/arch/arm/ti/ti_gpio.c:1.14 src/sys/arch/arm/ti/ti_gpio.c:1.15
--- src/sys/arch/arm/ti/ti_gpio.c:1.14	Sat Aug  7 16:18:46 2021
+++ src/sys/arch/arm/ti/ti_gpio.c	Mon Apr  1 15:52:08 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_gpio.c,v 1.14 2021/08/07 16:18:46 thorpej Exp $ */
+/* $NetBSD: ti_gpio.c,v 1.15 2024/04/01 15:52:08 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.14 2021/08/07 16:18:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.15 2024/04/01 15:52:08 jakllsch Exp $");
 
 #include 
 #include 
@@ -262,10 +262,8 @@ static struct fdtbus_gpio_controller_fun
 };
 
 static void
-ti_gpio_intr_disestablish(device_t dev, void *ih)
+ti_gpio_intr_disable(struct ti_gpio_softc * const sc, struct ti_gpio_intr * const intr)
 {
-	struct ti_gpio_softc * const sc = device_private(dev);
-	struct ti_gpio_intr *intr = ih;
 	const u_int pin = intr->intr_pin;
 	const uint32_t pin_mask = __BIT(pin);
 	uint32_t val;
@@ -280,6 +278,7 @@ ti_gpio_intr_disestablish(device_t dev, 
 
 	intr->intr_func = NULL;
 	intr->intr_arg = NULL;
+	intr->intr_mpsafe = false;
 }
 
 static void *
@@ -359,6 +358,15 @@ ti_gpio_intr_establish(device_t dev, u_i
 	return >sc_intr[pin];
 }
 
+static void
+ti_gpio_intr_disestablish(device_t dev, void *ih)
+{
+	struct ti_gpio_softc * const sc = device_private(dev);
+	struct ti_gpio_intr * const intr = ih;
+	
+	ti_gpio_intr_disable(sc, intr);
+}
+
 static bool
 ti_gpio_intrstr(device_t dev, u_int *specifier, char *buf, size_t buflen)
 {
@@ -423,6 +431,106 @@ ti_gpio_pin_ctl(void *priv, int pin, int
 	mutex_exit(>sc_lock);
 }
 
+static void *
+ti_gpio_gp_intr_establish(void *vsc, int pin, int ipl, int irqmode,
+int (*func)(void *), void *arg)
+{
+	struct ti_gpio_softc * const sc = vsc;
+	uint32_t val;
+
+	if (ipl != IPL_VM || pin < 0 || pin >= __arraycount(sc->sc_pins))
+		return NULL;
+
+	if (sc->sc_intr[pin].intr_func != NULL)
+		return NULL;
+
+	/*
+	 * Enabling both high and low level triggers will cause the GPIO
+	 * controller to always assert the interrupt.
+	 */
+	if ((irqmode & (GPIO_INTR_LOW_LEVEL|GPIO_INTR_HIGH_LEVEL)) ==
+	(GPIO_INTR_LOW_LEVEL|GPIO_INTR_HIGH_LEVEL))
+		return NULL;
+
+	/* Set pin as input */
+	mutex_enter(>sc_lock);
+	if (ti_gpio_ctl(sc, pin, GPIO_PIN_INPUT) != 0) {
+		mutex_exit(>sc_lock);
+		return NULL;
+	}
+
+	sc->sc_intr[pin].intr_pin = pin;
+	sc->sc_intr[pin].intr_func = func;
+	sc->sc_intr[pin].intr_arg = arg;
+	sc->sc_intr[pin].intr_mpsafe = (irqmode & GPIO_INTR_MPSAFE) != 0;
+
+	const uint32_t pin_mask = __BIT(pin);
+
+	/* Configure triggers */
+	val = RD4(sc, GPIO_LEVELDETECT0);
+	if ((irqmode & GPIO_INTR_LOW_LEVEL) != 0)
+		val |= pin_mask;
+	else
+		val &= ~pin_mask;
+	WR4(sc, GPIO_LEVELDETECT0, val);
+
+	val = RD4(sc, GPIO_LEVELDETECT1);
+	if ((irqmode & GPIO_INTR_HIGH_LEVEL) != 0)
+		val |= pin_mask;
+	else
+		val &= ~pin_mask;
+	WR4(sc, GPIO_LEVELDETECT1, val);
+
+	val = RD4(sc, GPIO_RISINGDETECT);
+	if ((irqmode & GPIO_INTR_POS_EDGE) != 0 ||
+	(irqmode & GPIO_INTR_DOUBLE_EDGE) != 0)
+		val |= pin_mask;
+	else
+		val &= ~pin_mask;
+	WR4(sc, GPIO_RISINGDETECT, val);
+
+	val = RD4(sc, GPIO_FALLINGDETECT);
+	if ((irqmode & GPIO_INTR_NEG_EDGE) != 0 ||
+	(irqmode & GPIO_INTR_DOUBLE_EDGE) != 0)
+		val |= pin_mask;
+	else
+		val &= ~pin_mask;
+	WR4(sc, GPIO_FALLINGDETECT, val);
+
+	/* Enable interrupts */
+	if (sc->sc_type == TI_GPIO_OMAP3) {
+		val = RD4(sc, GPIO_IRQENABLE1);
+		WR4(sc, GPIO_IRQENABLE1, val | pin_mask);
+	} else {
+		WR4(sc, GPIO_IRQENABLE1_SET, pin_mask);
+	}
+
+	mutex_exit(>sc_lock);
+	
+	return >sc_intr[pin];
+}
+
+static void
+ti_gpio_gp_intr_disestablish(void *vsc, void *ih)
+{
+	struct ti_gpio_softc * const sc = vsc;
+	struct ti_gpio_intr * const intr = ih;
+
+	ti_gpio_intr_disable(sc, intr);
+}
+
+static bool
+ti_gpio_gp_intrstr(void *vsc, int pin, int irqmode, char *buf, size_t buflen)
+{
+	struct ti_gpio_softc * const sc = vsc;
+
+	if (pin < 0 || pin >= TI_GPIO_NPINS)
+		return false;
+
+	snprintf(buf, buflen, "%s pin %d", sc->sc_modname, pin);
+	return true;
+}
+
 static void
 ti_gpio_attach_ports(struct ti_gpio_softc *sc)
 {
@@ -434,10 +542,17 @@ ti_gpio_attach_ports(struct ti_gpio_soft
 	gp->gp_pin_read = ti_gpio_pin_read;
 	gp->gp_pin_write = ti_gpio_pin_write;
 	gp->gp_pin_ctl = ti_gpio_pin_ctl;
+	gp->gp_intr_establish = ti_gpio_gp_intr_establish;
+	gp->gp_intr_disestablish = ti_gpio_gp_intr_disestablish;
+	

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

2024-04-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Apr  1 15:52:08 UTC 2024

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

Log Message:
ti_gpio: add gpio(4) interrupt support

tested with gpiopps(4) on Beagle Bone Black


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/ti/ti_gpio.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/hppa/dev

2024-04-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Apr  1 09:48:58 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
make gftfb_restore_palette() grab the default colour map from rasops instead
of just writing the driver's map into the hardware ( which may have been
modified by the likes of wsfb )
With this we get a readable console even when exiting X in a less than
graceful manner.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/dev/gftfb.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/hppa/dev/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.12 src/sys/arch/hppa/dev/gftfb.c:1.13
--- src/sys/arch/hppa/dev/gftfb.c:1.12	Thu Mar 28 12:50:31 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Mon Apr  1 09:48:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.12 2024/03/28 12:50:31 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.13 2024/04/01 09:48:58 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -212,8 +212,7 @@ gftfb_attach(device_t parent, device_t s
 	struct rasops_info *ri;
 	struct wsemuldisplaydev_attach_args aa;
 	unsigned long defattr = 0;
-	int ret, is_console = 0, i, j;
-	uint8_t cmap[768];
+	int ret, is_console = 0;
 
 	sc->sc_dev = self;
 
@@ -329,15 +328,7 @@ gftfb_attach(device_t parent, device_t s
 defattr);
 	}
 
-	j = 0;
-	rasops_get_cmap(ri, cmap, sizeof(cmap));
-	for (i = 0; i < 256; i++) {
-		sc->sc_cmap_red[i] = cmap[j];
-		sc->sc_cmap_green[i] = cmap[j + 1];
-		sc->sc_cmap_blue[i] = cmap[j + 2];
-		gftfb_putpalreg(sc, i, cmap[j], cmap[j + 1], cmap[j + 2]);
-		j += 3;
-	}
+	gftfb_restore_palette(sc);
 
 	/* no suspend/resume support yet */
 	if (!pmf_device_register(sc->sc_dev, NULL, NULL))
@@ -1008,11 +999,17 @@ gftfb_getcmap(struct gftfb_softc *sc, st
 static void
 gftfb_restore_palette(struct gftfb_softc *sc)
 {
-	int i;
+	uint8_t cmap[768];
+	int i, j;
 
+	j = 0;
+	rasops_get_cmap(>sc_console_screen.scr_ri, cmap, sizeof(cmap));
 	for (i = 0; i < 256; i++) {
-		gftfb_putpalreg(sc, i, sc->sc_cmap_red[i],
-		sc->sc_cmap_green[i], sc->sc_cmap_blue[i]);
+		sc->sc_cmap_red[i] = cmap[j];
+		sc->sc_cmap_green[i] = cmap[j + 1];
+		sc->sc_cmap_blue[i] = cmap[j + 2];
+		gftfb_putpalreg(sc, i, cmap[j], cmap[j + 1], cmap[j + 2]);
+		j += 3;
 	}
 }
 



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

2024-04-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Apr  1 09:48:58 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
make gftfb_restore_palette() grab the default colour map from rasops instead
of just writing the driver's map into the hardware ( which may have been
modified by the likes of wsfb )
With this we get a readable console even when exiting X in a less than
graceful manner.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/dev/gftfb.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/alpha

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 19:11:21 UTC 2024

Modified Files:
src/sys/arch/alpha/alpha: dec_6600.c
src/sys/arch/alpha/include: rpb.h

Log Message:
In dec_6600_device_register(): If we're running on a DS10, set the
"pciide-disable-dma" property on the on-board "aceride" to true.  This
is intended to be a temporary measure until the issue that makes it not
work correctly is found and fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/include/rpb.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

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 19:11:21 UTC 2024

Modified Files:
src/sys/arch/alpha/alpha: dec_6600.c
src/sys/arch/alpha/include: rpb.h

Log Message:
In dec_6600_device_register(): If we're running on a DS10, set the
"pciide-disable-dma" property on the on-board "aceride" to true.  This
is intended to be a temporary measure until the issue that makes it not
work correctly is found and fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/alpha/include/rpb.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/alpha/dec_6600.c
diff -u src/sys/arch/alpha/alpha/dec_6600.c:1.37 src/sys/arch/alpha/alpha/dec_6600.c:1.38
--- src/sys/arch/alpha/alpha/dec_6600.c:1.37	Sun Mar 31 19:06:30 2024
+++ src/sys/arch/alpha/alpha/dec_6600.c	Sun Mar 31 19:11:21 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_6600.c,v 1.37 2024/03/31 19:06:30 thorpej Exp $ */
+/* $NetBSD: dec_6600.c,v 1.38 2024/03/31 19:11:21 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.37 2024/03/31 19:06:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.38 2024/03/31 19:11:21 thorpej Exp $");
 
 #include 
 #include 
@@ -101,15 +101,36 @@ static const char *kgdb_devlist[] = {
 };
 #endif /* KGDB */
 
+static const struct alpha_variation_table dec_6600_variations[] = {
+	{ SV_ST_DP264, "AlphaPC DP264" },
+	{ SV_ST_CLIPPER, "AlphaServer ES40 (\"Clipper\")" },
+	{ SV_ST_GOLDRUSH, "AlphaServer DS20 (\"GoldRush\")" },
+	{ SV_ST_WEBBRICK, "AlphaServer DS10 (\"WebBrick\")" },
+	{ SV_ST_SHARK, "AlphaServer DS20L (\"Shark\")" },
+	{ 0, NULL },
+};
+
+static const struct alpha_variation_table dec_titan_variations[] = {
+	{ 0, NULL },
+};
+
 void
 dec_6600_init(void)
 {
+	uint64_t variation;
 
-	platform.family = "6600";
+	platform.family = (hwrpb->rpb_type == ST_DEC_TITAN) ? "Titan"
+			: "6600";
 
 	if ((platform.model = alpha_dsr_sysname()) == NULL) {
-		/* XXX Don't know the system variations, yet. */
-		platform.model = alpha_unknown_sysname();
+		const struct alpha_variation_table *vartab =
+		(hwrpb->rpb_type == ST_DEC_TITAN) ? dec_titan_variations
+		  : dec_6600_variations;
+		variation = hwrpb->rpb_variation & SV_ST_MASK;
+		if ((platform.model = alpha_variation_name(variation,
+			   vartab)) == NULL) {
+			platform.model = alpha_unknown_sysname();
+		}
 	}
 
 	platform.iobus = "tsc";
@@ -203,6 +224,37 @@ dec_6600_device_register(device_t dev, v
 	struct bootdev_data *b = bootdev_data;
 	device_t parent = device_parent(dev);
 
+	/*
+	 * First section: Deal with system-specific quirks.
+	 */
+
+	if ((hwrpb->rpb_variation & SV_ST_MASK) == SV_ST_WEBBRICK) {
+		/*
+		 * DMA on the on-board ALI IDE controller is not
+		 * working correctly; disable it for now to let
+		 * the systems at least hobble along.
+		 *
+		 * N.B. There's only one Pchip on a DS10, do there
+		 * is not need to determine which hose we have here.
+		 *
+		 * XXX This is meant to be temporary until we can find
+		 * XXX and fix the issue with bus-master DMA.
+		 */
+		if (device_is_a(parent, "pci") && device_is_a(dev, "aceride")) {
+			struct pci_attach_args *pa = aux;
+
+			if (pa->pa_bus == 0 && pa->pa_device == 13 &&
+			pa->pa_function == 0) {
+prop_dictionary_set_bool(device_properties(dev),
+"pciide-disable-dma", true);
+			}
+		}
+	}
+
+	/*
+	 * Second section: Boot device detection.
+	 */
+
 	if (b == NULL || found)
 		return;
 

Index: src/sys/arch/alpha/include/rpb.h
diff -u src/sys/arch/alpha/include/rpb.h:1.44 src/sys/arch/alpha/include/rpb.h:1.45
--- src/sys/arch/alpha/include/rpb.h:1.44	Sat Oct  3 17:33:23 2020
+++ src/sys/arch/alpha/include/rpb.h	Sun Mar 31 19:11:21 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: rpb.h,v 1.44 2020/10/03 17:33:23 thorpej Exp $ */
+/* $NetBSD: rpb.h,v 1.45 2024/03/31 19:11:21 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -185,6 +185,23 @@ struct rpb {
  */
 #define	SV_ST_MIATA_1_5		0x4c00	/* Miata 1.5 */
 
+/*
+ * System types for the Tsunami family.
+ * XXX These are not very complete!
+ */
+#define	SV_ST_DP264		0x0400	/* AlphaPC DP264 */
+#define	SV_ST_WARHOL		0x0800
+#define	SV_ST_WINDJAMMER	0x0c00
+#define	SV_ST_MONET		0x1000
+#define	SV_ST_CLIPPER		0x1400	/* AlphaServer ES40 */
+#define	SV_ST_GOLDRUSH		0x1800	/* AlphaServer DS20 */
+#define	SV_ST_WEBBRICK		0x1c00	/* AlphaServer DS10 */
+#define	SV_ST_CATAMARAN		0x2000
+#define	SV_ST_BRISBANE		0x2400
+#define	SV_ST_MALBOURNE		0x2800
+#define	SV_ST_FLYINGCLIPPER	0x2c00
+#define	SV_ST_SHARK		0x3000	/* AlphaServer DS20L */
+
 	uint64_t	rpb_variation;		/*  58 */
 
 	

CVS commit: src/sys/arch/alpha/alpha

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 19:06:31 UTC 2024

Modified Files:
src/sys/arch/alpha/alpha: api_up1000.c autoconf.c dec_1000a.c
dec_2000_300.c dec_2100_a50.c dec_2100_a500.c dec_3000_300.c
dec_3000_500.c dec_550.c dec_6600.c dec_alphabook1.c
dec_axppci_33.c dec_eb164.c dec_eb64plus.c dec_eb66.c dec_kn20aa.c
dec_kn300.c dec_kn8ae.c

Log Message:
Always call platform.device_register(), even if bootdev_data is NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/alpha/alpha/api_up1000.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/alpha/alpha/autoconf.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/alpha/alpha/dec_1000a.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/alpha/alpha/dec_2000_300.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/alpha/alpha/dec_2100_a50.c \
src/sys/arch/alpha/alpha/dec_axppci_33.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/alpha/alpha/dec_2100_a500.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/alpha/alpha/dec_3000_300.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/alpha/alpha/dec_3000_500.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/alpha/dec_550.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/alpha/alpha/dec_alphabook1.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/alpha/alpha/dec_eb164.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/alpha/alpha/dec_eb64plus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/alpha/dec_eb66.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/alpha/alpha/dec_kn20aa.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/alpha/alpha/dec_kn300.c \
src/sys/arch/alpha/alpha/dec_kn8ae.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/alpha/alpha/api_up1000.c
diff -u src/sys/arch/alpha/alpha/api_up1000.c:1.32 src/sys/arch/alpha/alpha/api_up1000.c:1.33
--- src/sys/arch/alpha/alpha/api_up1000.c:1.32	Mon Dec  4 00:32:10 2023
+++ src/sys/arch/alpha/alpha/api_up1000.c	Sun Mar 31 19:06:30 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: api_up1000.c,v 1.32 2023/12/04 00:32:10 thorpej Exp $ */
+/* $NetBSD: api_up1000.c,v 1.33 2024/03/31 19:06:30 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -34,7 +34,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.32 2023/12/04 00:32:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: api_up1000.c,v 1.33 2024/03/31 19:06:30 thorpej Exp $");
 
 #include 
 #include 
@@ -178,7 +178,7 @@ api_up1000_device_register(device_t dev,
 	struct bootdev_data *b = bootdev_data;
 	device_t parent = device_parent(dev);
 
-	if (found)
+	if (b == NULL || found)
 		return;
 
 	if (!initted) {

Index: src/sys/arch/alpha/alpha/autoconf.c
diff -u src/sys/arch/alpha/alpha/autoconf.c:1.58 src/sys/arch/alpha/alpha/autoconf.c:1.59
--- src/sys/arch/alpha/alpha/autoconf.c:1.58	Fri Jul  9 01:29:20 2021
+++ src/sys/arch/alpha/alpha/autoconf.c	Sun Mar 31 19:06:30 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.58 2021/07/09 01:29:20 thorpej Exp $ */
+/* $NetBSD: autoconf.c,v 1.59 2024/03/31 19:06:30 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.58 2021/07/09 01:29:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.59 2024/03/31 19:06:30 thorpej Exp $");
 
 #include "pci.h"
 
@@ -324,13 +324,6 @@ device_register(device_t dev, void *aux)
 	if (parent != NULL && device_is_a(parent, "pci"))
 		device_pci_register(dev, aux);
 #endif
-
-	if (bootdev_data == NULL) {
-		/*
-		 * There is no hope.
-		 */
-		return;
-	}
 	if (platform.device_register)
 		(*platform.device_register)(dev, aux);
 }

Index: src/sys/arch/alpha/alpha/dec_1000a.c
diff -u src/sys/arch/alpha/alpha/dec_1000a.c:1.34 src/sys/arch/alpha/alpha/dec_1000a.c:1.35
--- src/sys/arch/alpha/alpha/dec_1000a.c:1.34	Mon Dec  4 00:32:10 2023
+++ src/sys/arch/alpha/alpha/dec_1000a.c	Sun Mar 31 19:06:30 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_1000a.c,v 1.34 2023/12/04 00:32:10 thorpej Exp $ */
+/* $NetBSD: dec_1000a.c,v 1.35 2024/03/31 19:06:30 thorpej Exp $ */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.34 2023/12/04 00:32:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.35 2024/03/31 19:06:30 thorpej Exp $");
 
 #include 
 #include 
@@ -254,7 +254,7 @@ dec_1000a_device_register(device_t dev, 
 	struct bootdev_data *b = bootdev_data;
 	device_t parent = device_parent(dev);
 
-	if (found)
+	if (b == NULL || found)
 		return;
 
 	if (!initted) {

Index: src/sys/arch/alpha/alpha/dec_2000_300.c
diff -u src/sys/arch/alpha/alpha/dec_2000_300.c:1.21 src/sys/arch/alpha/alpha/dec_2000_300.c:1.22
--- src/sys/arch/alpha/alpha/dec_2000_300.c:1.21	Mon 

CVS commit: src/sys/arch/alpha/alpha

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 19:06:31 UTC 2024

Modified Files:
src/sys/arch/alpha/alpha: api_up1000.c autoconf.c dec_1000a.c
dec_2000_300.c dec_2100_a50.c dec_2100_a500.c dec_3000_300.c
dec_3000_500.c dec_550.c dec_6600.c dec_alphabook1.c
dec_axppci_33.c dec_eb164.c dec_eb64plus.c dec_eb66.c dec_kn20aa.c
dec_kn300.c dec_kn8ae.c

Log Message:
Always call platform.device_register(), even if bootdev_data is NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/alpha/alpha/api_up1000.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/alpha/alpha/autoconf.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/alpha/alpha/dec_1000a.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/alpha/alpha/dec_2000_300.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/alpha/alpha/dec_2100_a50.c \
src/sys/arch/alpha/alpha/dec_axppci_33.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/alpha/alpha/dec_2100_a500.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/alpha/alpha/dec_3000_300.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/alpha/alpha/dec_3000_500.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/alpha/dec_550.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/alpha/alpha/dec_alphabook1.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/alpha/alpha/dec_eb164.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/alpha/alpha/dec_eb64plus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/alpha/dec_eb66.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/alpha/alpha/dec_kn20aa.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/alpha/alpha/dec_kn300.c \
src/sys/arch/alpha/alpha/dec_kn8ae.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/alpha

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 17:13:29 UTC 2024

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

Log Message:
Add machdep.rpb_type and machdep.rpb_variation sysctl nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.105 -r1.106 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/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.378 src/sys/arch/alpha/alpha/machdep.c:1.379
--- src/sys/arch/alpha/alpha/machdep.c:1.378	Tue Mar  5 14:15:28 2024
+++ src/sys/arch/alpha/alpha/machdep.c	Sun Mar 31 17:13:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.378 2024/03/05 14:15:28 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.379 2024/03/31 17:13:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2019, 2020 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.378 2024/03/05 14:15:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.379 2024/03/31 17:13:29 thorpej Exp $");
 
 #include 
 #include 
@@ -1652,6 +1652,16 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 		   CTLTYPE_INT, "fp_complete_debug", NULL,
 		   NULL, 0, _fp_complete_debug, 0,
 		   CTL_MACHDEP, CPU_FP_COMPLETE_DEBUG, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_QUAD, "rpb_type", NULL,
+		   NULL, 0, >rpb_type, 0,
+		   CTL_MACHDEP, CPU_RPB_TYPE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_QUAD, "rpb_variation", NULL,
+		   NULL, 0, >rpb_variation, 0,
+		   CTL_MACHDEP, CPU_RPB_VARIATION, CTL_EOL);
 }
 
 /*

Index: src/sys/arch/alpha/include/cpu.h
diff -u src/sys/arch/alpha/include/cpu.h:1.105 src/sys/arch/alpha/include/cpu.h:1.106
--- src/sys/arch/alpha/include/cpu.h:1.105	Wed Nov 22 01:56:14 2023
+++ src/sys/arch/alpha/include/cpu.h	Sun Mar 31 17:13:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.105 2023/11/22 01:56:14 thorpej Exp $ */
+/* $NetBSD: cpu.h,v 1.106 2024/03/31 17:13:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -241,6 +241,8 @@ void	cpu_signotify(struct lwp *);
 #define	CPU_CCTR		8	/* int: using CC timecounter */
 #define	CPU_IS_QEMU		9	/* int: running under Qemu */
 #define	CPU_FP_COMPLETE_DEBUG	10	/* int: enable FP completion debug */
+#define	CPU_RPB_TYPE		11	/* quad: system type (from RPB) */
+#define	CPU_RPB_VARIATION	12	/* quad: system variation (from RPB) */
 
 
 #ifdef _KERNEL



CVS commit: src/sys/arch/alpha

2024-03-31 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 31 17:13:29 UTC 2024

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

Log Message:
Add machdep.rpb_type and machdep.rpb_variation sysctl nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.378 -r1.379 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.105 -r1.106 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/hppa/dev

2024-03-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 28 12:50:31 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
For some reason the drawing engine occasionally scribbles past the right
boundary when filling rectangles, especially annoying when we draw whitespaces
As a workaround we draw all rectangles less than 50 pixels wide by drawing
a 50 pixel rectangle into off-screen memory to the right of the visible fb and
then copy the portion we want. Keeps track of the colour and size of the
off-screen rectangle so we can avoid redrawing it whenever possible.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/dev/gftfb.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/hppa/dev

2024-03-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 28 12:50:31 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
For some reason the drawing engine occasionally scribbles past the right
boundary when filling rectangles, especially annoying when we draw whitespaces
As a workaround we draw all rectangles less than 50 pixels wide by drawing
a 50 pixel rectangle into off-screen memory to the right of the visible fb and
then copy the portion we want. Keeps track of the colour and size of the
off-screen rectangle so we can avoid redrawing it whenever possible.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/dev/gftfb.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/hppa/dev/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.11 src/sys/arch/hppa/dev/gftfb.c:1.12
--- src/sys/arch/hppa/dev/gftfb.c:1.11	Wed Mar 27 09:08:38 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Thu Mar 28 12:50:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.11 2024/03/27 09:08:38 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.12 2024/03/28 12:50:31 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -88,6 +88,7 @@ struct	gftfb_softc {
 #define HW_FB	0
 #define HW_FILL	1
 #define HW_BLIT	2
+	uint32_t sc_rect_colour, sc_rect_height;
 	/* cursor stuff */
 	int sc_cursor_x, sc_cursor_y;
 	int sc_hot_x, sc_hot_y, sc_enabled;
@@ -250,7 +251,9 @@ gftfb_attach(device_t parent, device_t s
 
 	sc->sc_width = sc->sc_scr.scr_cfg.scr_width;
 	sc->sc_height = sc->sc_scr.scr_cfg.scr_height;
-	
+	sc->sc_rect_colour = 0xf000;
+	sc->sc_rect_height = 0;
+
 	aprint_normal_dev(sc->sc_dev, "%s at %dx%d\n", sc->sc_scr.name, 
 	sc->sc_width, sc->sc_height);
 	gftfb_setup(sc);
@@ -687,6 +690,9 @@ gftfb_setup(struct gftfb_softc *sc)
 	sc->sc_enabled = 0;
 	sc->sc_video_on = 1;
 
+	sc->sc_rect_colour = 0xf000;
+	sc->sc_rect_height = 0;
+
 	/* set Bt458 read mask register to all planes */
 	gftfb_wait(sc);
 	ngle_bt458_write(memt, memh, 0x08, 0x04);
@@ -1051,7 +1057,7 @@ gftfb_wait_fifo(struct gftfb_softc *sc, 
 }
 
 static void
-gftfb_rectfill(struct gftfb_softc *sc, int x, int y, int wi, int he,
+gftfb_real_rectfill(struct gftfb_softc *sc, int x, int y, int wi, int he,
 		  uint32_t bg)
 {
 	struct sti_rom *rom = sc->sc_base.sc_rom;
@@ -1081,6 +1087,30 @@ gftfb_rectfill(struct gftfb_softc *sc, i
 
 }
 
+static void
+gftfb_rectfill(struct gftfb_softc *sc, int x, int y, int wi, int he,
+		  uint32_t bg)
+{
+	/*
+	 * For some reason my 4MB VisEG always draws rectangles at least 32
+	 * pixels wide - no idea why, the bitblt command doesn't have this
+	 * problem.
+	 * So, as a workaround, we draw a 50xFontHeight rectangle to the right
+	 * of the visible fb, keep track of the colour so we don't need to
+	 * redraw every time, and bitblt the portion we need
+	 */
+	if (wi < 50) {
+		if ((bg != sc->sc_rect_colour) ||
+		(he > sc->sc_rect_height)) {
+			gftfb_real_rectfill(sc, sc->sc_width + 10, 0, 50, 
+			he, bg);
+			sc->sc_rect_colour = bg;
+			sc->sc_rect_height = he;
+		}
+		gftfb_bitblt(sc, sc->sc_width + 10, 0, x, y, wi, he, RopSrc);
+	} else
+		gftfb_real_rectfill(sc, x, y, wi, he, bg);
+}
 
 static void
 gftfb_bitblt(void *cookie, int xs, int ys, int xd, int yd, int wi,
@@ -1161,9 +1191,8 @@ gftfb_putchar(void *cookie, int row, int
 	struct vcons_screen *scr = ri->ri_hw;
 	struct gftfb_softc *sc = scr->scr_cookie;
 	int x, y, wi, he, rv = GC_NOPE;
-#if 0
 	uint32_t bg;
-#endif
+
 	if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
 		return;
 
@@ -1179,20 +1208,14 @@ gftfb_putchar(void *cookie, int row, int
 
 	x = ri->ri_xorigin + col * wi;
 	y = ri->ri_yorigin + row * he;
-#if 0
+
 	bg = ri->ri_devcmap[(attr >> 16) & 0xf];
 
-	/* XXX
-	 * rectfill currently draws rectangles less than 32 pixels wide as
-	 * 32 pixels wide, no idea why. So until I figure that one out we 
-	 * draw blanks by software
-	 * bitblt doesn't seem to have this problem
-	 */
 	if (c == 0x20) {
 		gftfb_rectfill(sc, x, y, wi, he, bg);
 		return;
 	}
-#endif
+
 	rv = glyphcache_try(>sc_gc, c, x, y, attr);
 	if (rv == GC_OK)
 		return;



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

2024-03-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 27 09:08:38 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
fix brainfart - only update fbi_fbsize, not the size of the visible fb...


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/dev/gftfb.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/hppa/dev

2024-03-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 27 09:08:38 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
fix brainfart - only update fbi_fbsize, not the size of the visible fb...


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/dev/gftfb.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/hppa/dev/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.10 src/sys/arch/hppa/dev/gftfb.c:1.11
--- src/sys/arch/hppa/dev/gftfb.c:1.10	Wed Mar 27 06:52:03 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Wed Mar 27 09:08:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.10 2024/03/27 06:52:03 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.11 2024/03/27 09:08:38 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -839,7 +839,6 @@ gftfb_ioctl(void *v, void *vs, u_long cm
 			int ret;
 
 			ret = wsdisplayio_get_fbinfo(>scr_ri, fbi);
-			fbi->fbi_height = sc->sc_scr.fbheight;
 			fbi->fbi_fbsize = sc->sc_scr.fbheight * 2048;
 			return ret;
 		}



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

2024-03-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 27 06:52:03 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
in gftfb_ioctl():
- identify ourselves as WSDISPLAY_TYPE_STI
- return full fb geometry in WSDISPLAYIO_GET_FBINFO


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/dev/gftfb.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/hppa/dev

2024-03-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 27 06:52:03 UTC 2024

Modified Files:
src/sys/arch/hppa/dev: gftfb.c

Log Message:
in gftfb_ioctl():
- identify ourselves as WSDISPLAY_TYPE_STI
- return full fb geometry in WSDISPLAYIO_GET_FBINFO


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/dev/gftfb.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/hppa/dev/gftfb.c
diff -u src/sys/arch/hppa/dev/gftfb.c:1.9 src/sys/arch/hppa/dev/gftfb.c:1.10
--- src/sys/arch/hppa/dev/gftfb.c:1.9	Wed Mar  6 08:19:44 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Wed Mar 27 06:52:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.9 2024/03/06 08:19:44 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.10 2024/03/27 06:52:03 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -780,7 +780,7 @@ gftfb_ioctl(void *v, void *vs, u_long cm
 
 	switch (cmd) {
 	case WSDISPLAYIO_GTYPE:
-		*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+		*(u_int *)data = WSDISPLAY_TYPE_STI;
 		return 0;
 
 	/* PCI config read/write passthrough. */
@@ -834,11 +834,15 @@ gftfb_ioctl(void *v, void *vs, u_long cm
 		return 0;
 
 	case WSDISPLAYIO_GET_FBINFO:
-	{
+		{
 			struct wsdisplayio_fbinfo *fbi = data;
+			int ret;
 
-		return wsdisplayio_get_fbinfo(>scr_ri, fbi);
-	}
+			ret = wsdisplayio_get_fbinfo(>scr_ri, fbi);
+			fbi->fbi_height = sc->sc_scr.fbheight;
+			fbi->fbi_fbsize = sc->sc_scr.fbheight * 2048;
+			return ret;
+		}
 
 	case WSDISPLAYIO_GCURPOS:
 		{



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

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 26 10:51:16 UTC 2024

Modified Files:
src/sys/arch/mips/conf: files.octeon

Log Message:
mips/conf/files.octeon: octrnm does not depend on rnd

Whether or not we have /dev/random and /dev/urandom baked into the
kernel, configuring `octrnm* at ...' in the kernel config requires
octeon_rnm.c.

Related to PR kern/46728.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/conf/files.octeon

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

2024-03-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 26 10:51:16 UTC 2024

Modified Files:
src/sys/arch/mips/conf: files.octeon

Log Message:
mips/conf/files.octeon: octrnm does not depend on rnd

Whether or not we have /dev/random and /dev/urandom baked into the
kernel, configuring `octrnm* at ...' in the kernel config requires
octeon_rnm.c.

Related to PR kern/46728.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/conf/files.octeon

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/conf/files.octeon
diff -u src/sys/arch/mips/conf/files.octeon:1.12 src/sys/arch/mips/conf/files.octeon:1.13
--- src/sys/arch/mips/conf/files.octeon:1.12	Thu Jul 16 21:34:52 2020
+++ src/sys/arch/mips/conf/files.octeon	Tue Mar 26 10:51:16 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.octeon,v 1.12 2020/07/16 21:34:52 jmcneill Exp $
+#	$NetBSD: files.octeon,v 1.13 2024/03/26 10:51:16 riastradh Exp $
 
 file	arch/mips/mips/locore_octeon.S
 file	arch/mips/mips/bus_dma.c
@@ -60,7 +60,7 @@ options 	COM_REGMAP
 
 device	octrnm
 attach	octrnm at iobus
-file	arch/mips/cavium/dev/octeon_rnm.c	octrnm & rnd
+file	arch/mips/cavium/dev/octeon_rnm.c	octrnm
 
 device	octtwsi: i2cbus
 attach	octtwsi at iobus



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

2024-03-26 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 26 10:23:42 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: ADM5120-NB

Log Message:
Revert accidental change for root file system in previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbmips/conf/ADM5120-NB

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/evbmips/conf/ADM5120-NB
diff -u src/sys/arch/evbmips/conf/ADM5120-NB:1.33 src/sys/arch/evbmips/conf/ADM5120-NB:1.34
--- src/sys/arch/evbmips/conf/ADM5120-NB:1.33	Tue Mar 26 10:16:47 2024
+++ src/sys/arch/evbmips/conf/ADM5120-NB	Tue Mar 26 10:23:42 2024
@@ -1,11 +1,11 @@
-#	$NetBSD: ADM5120-NB,v 1.33 2024/03/26 10:16:47 andvar Exp $
+#	$NetBSD: ADM5120-NB,v 1.34 2024/03/26 10:23:42 andvar Exp $
 #
 # Kernel config for the ADM5120 based boards and routers,
 # including the RouterBOARD 100 series.
 
 include 	"arch/evbmips/conf/std.adm5120"
 
-#ident 		"GENERIC-$Revision: 1.33 $"
+#ident 		"GENERIC-$Revision: 1.34 $"
 
 maxusers	32
 
@@ -101,7 +101,7 @@ options 	INET		# Internet protocols
 options 	NFS_BOOT_DHCP
 
 # Pretty much only one device to use for the root file system.
-config		netbsd		root on ? type ?
+config		netbsd-admsw0	root on admsw0 type nfs
 
 mainbus0 	at root
 



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

2024-03-26 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 26 10:23:42 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: ADM5120-NB

Log Message:
Revert accidental change for root file system in previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbmips/conf/ADM5120-NB

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



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

2024-03-26 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 26 10:16:47 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: ADM5120-NB

Log Message:
Remove netgraph options which are not supported and have no effect in NetBSD.

While here, reposition extio to reduce diff between ADM5120 and ADM5120-NB.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/conf/ADM5120-NB

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/evbmips/conf/ADM5120-NB
diff -u src/sys/arch/evbmips/conf/ADM5120-NB:1.32 src/sys/arch/evbmips/conf/ADM5120-NB:1.33
--- src/sys/arch/evbmips/conf/ADM5120-NB:1.32	Mon Jan 29 18:27:11 2024
+++ src/sys/arch/evbmips/conf/ADM5120-NB	Tue Mar 26 10:16:47 2024
@@ -1,11 +1,11 @@
-#	$NetBSD: ADM5120-NB,v 1.32 2024/01/29 18:27:11 christos Exp $
+#	$NetBSD: ADM5120-NB,v 1.33 2024/03/26 10:16:47 andvar Exp $
 #
 # Kernel config for the ADM5120 based boards and routers,
 # including the RouterBOARD 100 series.
 
 include 	"arch/evbmips/conf/std.adm5120"
 
-#ident 		"GENERIC-$Revision: 1.32 $"
+#ident 		"GENERIC-$Revision: 1.33 $"
 
 maxusers	32
 
@@ -77,30 +77,6 @@ options 	BUFQ_PRIOCSCAN
 # Networking options
 options 	GATEWAY		# IP packet forwarding
 options 	INET		# Internet protocols
-options 	NETGRAPH	# Netgraph
-options 	NETGRAPH_ASYNC
-options 	NETGRAPH_BPF
-options 	NETGRAPH_CISCO
-options 	NETGRAPH_ECHO
-options 	NETGRAPH_EIFACE
-options 	NETGRAPH_ETF
-options 	NETGRAPH_ETHER
-options 	NETGRAPH_FRAME_RELAY
-options 	NETGRAPH_HOLE
-options 	NETGRAPH_HUB
-options 	NETGRAPH_IFACE
-options 	NETGRAPH_KSOCKET
-options 	NETGRAPH_L2TP
-options 	NETGRAPH_LMI
-options 	NETGRAPH_ONE2MANY
-options 	NETGRAPH_PPP
-options 	NETGRAPH_PPPOE
-options 	NETGRAPH_PPTPGRE
-options 	NETGRAPH_RFC1490
-options 	NETGRAPH_TEE
-options 	NETGRAPH_UI
-options 	NETGRAPH_VJC
-options 	NETGRAPH_VLAN
 #options 	INET6		# IPV6
 #options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
@@ -125,7 +101,7 @@ options 	NETGRAPH_VLAN
 options 	NFS_BOOT_DHCP
 
 # Pretty much only one device to use for the root file system.
-config		netbsd-admsw0	root on admsw0 type nfs
+config		netbsd		root on ? type ?
 
 mainbus0 	at root
 
@@ -151,9 +127,8 @@ pseudo-device	pty# pseudo-terminals
 pseudo-device	ksyms
 
 obio*		at mainbus?
-extio*		at mainbus?
 gpio*		at mainbus?
-
+extio*		at mainbus?
 uart*		at obio? addr ?
 admsw*		at obio? addr ?
 #admflash*	at obio? addr ?



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

2024-03-26 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 26 10:16:47 UTC 2024

Modified Files:
src/sys/arch/evbmips/conf: ADM5120-NB

Log Message:
Remove netgraph options which are not supported and have no effect in NetBSD.

While here, reposition extio to reduce diff between ADM5120 and ADM5120-NB.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/conf/ADM5120-NB

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

2024-03-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 24 08:34:20 UTC 2024

Modified Files:
src/sys/arch/riscv/dev: plic.c plic_fdt.c

Log Message:
Pretty print plic attachment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/dev/plic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/dev/plic_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/riscv/dev

2024-03-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 24 08:34:20 UTC 2024

Modified Files:
src/sys/arch/riscv/dev: plic.c plic_fdt.c

Log Message:
Pretty print plic attachment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/dev/plic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/dev/plic_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/riscv/dev/plic.c
diff -u src/sys/arch/riscv/dev/plic.c:1.4 src/sys/arch/riscv/dev/plic.c:1.5
--- src/sys/arch/riscv/dev/plic.c:1.4	Mon Dec 25 13:01:59 2023
+++ src/sys/arch/riscv/dev/plic.c	Sun Mar 24 08:34:20 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: plic.c,v 1.4 2023/12/25 13:01:59 skrll Exp $ */
+/* $NetBSD: plic.c,v 1.5 2024/03/24 08:34:20 skrll Exp $ */
 
 /*-
  * Copyright (c) 2022 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plic.c,v 1.4 2023/12/25 13:01:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plic.c,v 1.5 2024/03/24 08:34:20 skrll Exp $");
 
 #include 
 
@@ -204,7 +204,7 @@ plic_attach_common(struct plic_softc *sc
 	}
 
 	aprint_naive("\n");
-	aprint_normal("RISC-V PLIC (%u IRQs)\n", sc->sc_ndev);
+	aprint_normal(": RISC-V PLIC (%u IRQs)\n", sc->sc_ndev);
 
 	plic_sc = sc;
 

Index: src/sys/arch/riscv/dev/plic_fdt.c
diff -u src/sys/arch/riscv/dev/plic_fdt.c:1.5 src/sys/arch/riscv/dev/plic_fdt.c:1.6
--- src/sys/arch/riscv/dev/plic_fdt.c:1.5	Fri Feb  9 18:39:53 2024
+++ src/sys/arch/riscv/dev/plic_fdt.c	Sun Mar 24 08:34:20 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: plic_fdt.c,v 1.5 2024/02/09 18:39:53 andvar Exp $ */
+/* $NetBSD: plic_fdt.c,v 1.6 2024/03/24 08:34:20 skrll Exp $ */
 
 /*-
  * Copyright (c) 2022 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plic_fdt.c,v 1.5 2024/02/09 18:39:53 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plic_fdt.c,v 1.6 2024/03/24 08:34:20 skrll Exp $");
 
 #include 
 
@@ -240,7 +240,7 @@ plic_fdt_attach(device_t parent, device_
 		context++;
 	}
 
-	aprint_verbose_dev(self, "");
+	aprint_verbose_dev(self, "attaching");
 	error = plic_attach_common(sc, addr, size);
 	if (error != 0) {
 		return;



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

2024-03-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 23 18:48:31 UTC 2024

Modified Files:
src/sys/arch/sparc/include: pmap.h

Log Message:
s/ignorning/ignoring/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/include/pmap.h

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

Modified files:

Index: src/sys/arch/sparc/include/pmap.h
diff -u src/sys/arch/sparc/include/pmap.h:1.97 src/sys/arch/sparc/include/pmap.h:1.98
--- src/sys/arch/sparc/include/pmap.h:1.97	Mon Jan 25 20:05:29 2021
+++ src/sys/arch/sparc/include/pmap.h	Sat Mar 23 18:48:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.97 2021/01/25 20:05:29 mrg Exp $ */
+/*	$NetBSD: pmap.h,v 1.98 2024/03/23 18:48:31 andvar Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -74,7 +74,7 @@ struct vm_page;
  * User space begins at 0x and runs through 0x1fff,
  * then has a `hole', then resumes at 0xe000 and runs until it
  * hits the kernel space at 0xf800.  This can be mapped
- * contiguously by ignorning the top two bits and pretending the
+ * contiguously by ignoring the top two bits and pretending the
  * space goes from 0 to 37ff.  Typically the lower range is
  * used for text+data and the upper for stack, but the code here
  * makes no such distinction.



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

2024-03-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 23 18:48:31 UTC 2024

Modified Files:
src/sys/arch/sparc/include: pmap.h

Log Message:
s/ignorning/ignoring/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/include/pmap.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/conf

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:35:21 UTC 2024

Modified Files:
src/sys/arch/powerpc/conf: Makefile.powerpc

Log Message:
Fix reproducible builds (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/conf/Makefile.powerpc

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/conf/Makefile.powerpc
diff -u src/sys/arch/powerpc/conf/Makefile.powerpc:1.61 src/sys/arch/powerpc/conf/Makefile.powerpc:1.62
--- src/sys/arch/powerpc/conf/Makefile.powerpc:1.61	Sat Sep 22 08:24:03 2018
+++ src/sys/arch/powerpc/conf/Makefile.powerpc	Tue Mar 19 20:35:21 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.powerpc,v 1.61 2018/09/22 12:24:03 rin Exp $
+#	$NetBSD: Makefile.powerpc,v 1.62 2024/03/20 00:35:21 christos Exp $
 #
 # Makefile for NetBSD
 #
@@ -114,6 +114,9 @@ _OSRELEASE!=		${HOST_SH} $S/conf/osrelea
 MKUBOOTIMAGEARGS=   -A powerpc -T kernel -C gz
 MKUBOOTIMAGEARGS+=  -a ${TEXTADDR:C/$//} -e $(TEXTADDR)
 MKUBOOTIMAGEARGS+=  -n "NetBSD/$(MACHINE) ${_OSRELEASE} ($(KERNEL_BUILD:T))"
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MKUBOOTIMAGEARGS+=	-t "${MKREPRO_TIMESTAMP}"
+.endif
 
 SYSTEM_LD_TAIL_EXTRA+=; \
 	echo ${TOOL_GZIP_N} -9c $@.bin '>' $@.bin.gz; \



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

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:35:21 UTC 2024

Modified Files:
src/sys/arch/powerpc/conf: Makefile.powerpc

Log Message:
Fix reproducible builds (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/conf/Makefile.powerpc

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



CVS commit: src/sys/arch/hppa/stand/mkboot

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:34:33 UTC 2024

Modified Files:
src/sys/arch/hppa/stand/mkboot: mkboot.c

Log Message:
remove extra stat (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/stand/mkboot/mkboot.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/hppa/stand/mkboot/mkboot.c
diff -u src/sys/arch/hppa/stand/mkboot/mkboot.c:1.3 src/sys/arch/hppa/stand/mkboot/mkboot.c:1.4
--- src/sys/arch/hppa/stand/mkboot/mkboot.c:1.3	Thu Feb  8 14:24:43 2024
+++ src/sys/arch/hppa/stand/mkboot/mkboot.c	Tue Mar 19 20:34:32 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkboot.c,v 1.3 2024/02/08 19:24:43 christos Exp $	*/
+/*	$NetBSD: mkboot.c,v 1.4 2024/03/20 00:34:32 christos Exp $	*/
 
 /*	$OpenBSD: mkboot.c,v 1.9 2001/05/17 00:57:55 pvalchev Exp $	*/
 
@@ -421,8 +421,6 @@ bcddate(char *file, char *toc)
 		stat(file, );
 		tm = localtime(_ctime);
 	}
-	stat(file, );
-	tm = localtime(_ctime);
 	tm->tm_year %= 100;
 	*toc = (tm->tm_year / 10) << 4;
 	*toc++ |= tm->tm_year % 10;



CVS commit: src/sys/arch/hppa/stand/mkboot

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:34:33 UTC 2024

Modified Files:
src/sys/arch/hppa/stand/mkboot: mkboot.c

Log Message:
remove extra stat (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/stand/mkboot/mkboot.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

2024-03-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 16 21:50:47 UTC 2024

Modified Files:
src/sys/arch/ia64/include: limits.h
src/sys/arch/mips/include: limits.h
src/sys/arch/sparc/include: limits.h

Log Message:
make all QUAD constants look the same.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/limits.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mips/include/limits.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/include/limits.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/limits.h
diff -u src/sys/arch/ia64/include/limits.h:1.9 src/sys/arch/ia64/include/limits.h:1.10
--- src/sys/arch/ia64/include/limits.h:1.9	Mon Jan 21 15:28:17 2019
+++ src/sys/arch/ia64/include/limits.h	Sat Mar 16 17:50:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.9 2019/01/21 20:28:17 dholland Exp $	*/
+/*	$NetBSD: limits.h,v 1.10 2024/03/16 21:50:47 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -68,11 +68,9 @@
 #define	SSIZE_MIN	LONG_MIN	/* min value for a ssize_t */
 #define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
 
-/* GCC requires that quad constants be written as expressions. */
-#define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
-	/* max value for a quad_t */
-#define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
-#define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
+#define	UQUAD_MAX	0xULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */

Index: src/sys/arch/mips/include/limits.h
diff -u src/sys/arch/mips/include/limits.h:1.28 src/sys/arch/mips/include/limits.h:1.29
--- src/sys/arch/mips/include/limits.h:1.28	Sun Jul 26 04:08:41 2020
+++ src/sys/arch/mips/include/limits.h	Sat Mar 16 17:50:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.28 2020/07/26 08:08:41 simonb Exp $	*/
+/*	$NetBSD: limits.h,v 1.29 2024/03/16 21:50:47 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -94,18 +94,9 @@
 #define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
 #endif
 
-#ifdef _LP64
-/* Quads and longs are the same on LP64. */
-#define	UQUAD_MAX	(ULONG_MAX)
-#define	QUAD_MAX	(LONG_MAX)
-#define	QUAD_MIN	(LONG_MIN)
-#else
-/* GCC requires that quad constants be written as expressions. */
-#define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
-	/* max value for a quad_t */
-#define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
-#define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
-#endif
+#define	UQUAD_MAX	0xULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */

Index: src/sys/arch/sparc/include/limits.h
diff -u src/sys/arch/sparc/include/limits.h:1.24 src/sys/arch/sparc/include/limits.h:1.25
--- src/sys/arch/sparc/include/limits.h:1.24	Thu Mar 14 11:51:10 2024
+++ src/sys/arch/sparc/include/limits.h	Sat Mar 16 17:50:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.24 2024/03/14 15:51:10 christos Exp $ */
+/*	$NetBSD: limits.h,v 1.25 2024/03/16 21:50:47 christos Exp $ */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -75,9 +75,9 @@
 #define	SSIZE_MIN	LONG_MIN	/* min value for a ssize_t */
 #define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
 
-#define UQUAD_MAX	0xULL		/* max unsigned quad */
-#define QUAD_MAX	0x7fffLL		/* max signed quad */
-#define QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
+#define	UQUAD_MAX	0xULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */



CVS commit: src/sys/arch

2024-03-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 16 21:50:47 UTC 2024

Modified Files:
src/sys/arch/ia64/include: limits.h
src/sys/arch/mips/include: limits.h
src/sys/arch/sparc/include: limits.h

Log Message:
make all QUAD constants look the same.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/limits.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mips/include/limits.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/include/limits.h

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



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

2024-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 15:51:10 UTC 2024

Modified Files:
src/sys/arch/sparc/include: limits.h

Log Message:
Sync with x86_64 the quad constants. No reason to be different


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/include/limits.h

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



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

2024-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 15:51:10 UTC 2024

Modified Files:
src/sys/arch/sparc/include: limits.h

Log Message:
Sync with x86_64 the quad constants. No reason to be different


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/include/limits.h

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

Modified files:

Index: src/sys/arch/sparc/include/limits.h
diff -u src/sys/arch/sparc/include/limits.h:1.23 src/sys/arch/sparc/include/limits.h:1.24
--- src/sys/arch/sparc/include/limits.h:1.23	Mon Jan 21 15:28:18 2019
+++ src/sys/arch/sparc/include/limits.h	Thu Mar 14 11:51:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.23 2019/01/21 20:28:18 dholland Exp $ */
+/*	$NetBSD: limits.h,v 1.24 2024/03/14 15:51:10 christos Exp $ */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -75,11 +75,9 @@
 #define	SSIZE_MIN	LONG_MIN	/* min value for a ssize_t */
 #define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
 
-/* GCC requires that quad constants be written as expressions. */
-#define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
-	/* max value for a quad_t */
-#define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
-#define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
+#define UQUAD_MAX	0xULL		/* max unsigned quad */
+#define QUAD_MAX	0x7fffLL		/* max signed quad */
+#define QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */



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

2024-03-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 14 13:18:36 UTC 2024

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

Log Message:
add gftfb


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hppa/conf/GENERIC

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

Modified files:

Index: src/sys/arch/hppa/conf/GENERIC
diff -u src/sys/arch/hppa/conf/GENERIC:1.43 src/sys/arch/hppa/conf/GENERIC:1.44
--- src/sys/arch/hppa/conf/GENERIC:1.43	Mon Jan 29 18:27:12 2024
+++ src/sys/arch/hppa/conf/GENERIC	Thu Mar 14 13:18:35 2024
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.43 2024/01/29 18:27:12 christos Exp $
+# $NetBSD: GENERIC,v 1.44 2024/03/14 13:18:35 macallan Exp $
 #
 # GENERIC machine description file
 #
@@ -23,7 +23,7 @@ include 	"arch/hppa/conf/std.hppa"
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
-#ident 		"GENERIC-$Revision: 1.43 $"
+#ident 		"GENERIC-$Revision: 1.44 $"
 
 maxusers	32		# estimated number of users
 
@@ -283,6 +283,7 @@ sti*	at mainbus0		# [H]CRX-{8,24,48}[Z] 
 sti*	at phantomas?		# [H]CRX-{8,24,48}[Z] and Visualize graphics
 sti*	at uturn?
 sti*	at pci?			# EG-PCI, FX*
+gftfb* 	at pci?			# PCI Visualize EG
 
 # Human Interface Loop
 hil*		at gsc? irq 1	# Human Interface Loop, kbd and mouse
@@ -298,7 +299,9 @@ wskbd*		at pckbd? console ?
 wsmouse*	at pms? mux 0
 wskbd*		at hilkbd? console ?
 wsmouse*	at hilms? mux 0
-wsdisplay*	at sti?
+# make sure the console display is always wsdisplay0
+wsdisplay0	at wsemuldisplaydev? console 1
+wsdisplay*	at wsemuldisplaydev?
 
 # Serial Devices
 



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

2024-03-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 14 13:18:36 UTC 2024

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

Log Message:
add gftfb


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hppa/conf/GENERIC

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



CVS commit: src/sys/arch/evbmips/evbmips

2024-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 13 12:44:30 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
evbmips/interrupt.c: No need for __diagused with KASSERT.

KASSERT already references all the variables even in !DIAGNOSTIC
builds (but evaluates nothing at run-time in that case).

That said: Is the curlwp->l_blcnt assertion correct?  Can't curlwp be
changed in this interrupt handler by preemption?


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.27 src/sys/arch/evbmips/evbmips/interrupt.c:1.28
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.27	Wed Mar 13 06:59:01 2024
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Wed Mar 13 12:44:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.27 2024/03/13 06:59:01 skrll Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.28 2024/03/13 12:44:30 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.27 2024/03/13 06:59:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.28 2024/03/13 12:44:30 riastradh Exp $");
 
 #include 
 #include 
@@ -53,9 +53,9 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 	struct cpu_info * const ci = curcpu();
 	uint32_t pending;
 	int ipl;
-	const int mtx_count __diagused = ci->ci_mtx_count;
-	const u_int biglock_count __diagused = ci->ci_biglock_count;
-	const u_int blcnt __diagused = curlwp->l_blcnt;
+	const int mtx_count = ci->ci_mtx_count;
+	const u_int biglock_count = ci->ci_biglock_count;
+	const u_int blcnt = curlwp->l_blcnt;
 
 	KASSERT(ci->ci_cpl == IPL_HIGH);
 	KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);



CVS commit: src/sys/arch/evbmips/evbmips

2024-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar 13 12:44:30 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
evbmips/interrupt.c: No need for __diagused with KASSERT.

KASSERT already references all the variables even in !DIAGNOSTIC
builds (but evaluates nothing at run-time in that case).

That said: Is the curlwp->l_blcnt assertion correct?  Can't curlwp be
changed in this interrupt handler by preemption?


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbmips/evbmips/interrupt.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/mac68k

2024-03-13 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Mar 13 07:55:29 UTC 2024

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k majors.mac68k
Added Files:
src/sys/arch/mac68k/conf: AUDIO AUDIOSBC
src/sys/arch/mac68k/obio: ascaudio.c ascaudiovar.h ascreg.h

Log Message:
Apple Sound Chip audio support for 68k Macintoshoes.

This provies a sound device and support for wsbell(4).

Manual page to be added in a followup commit.

As posted to port-mac68k.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/mac68k/conf/AUDIO \
src/sys/arch/mac68k/conf/AUDIOSBC
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mac68k/conf/majors.mac68k
cvs rdiff -u -r0 -r1.1 src/sys/arch/mac68k/obio/ascaudio.c \
src/sys/arch/mac68k/obio/ascaudiovar.h src/sys/arch/mac68k/obio/ascreg.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/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.132 src/sys/arch/mac68k/conf/files.mac68k:1.133
--- src/sys/arch/mac68k/conf/files.mac68k:1.132	Tue Jan  9 04:16:25 2024
+++ src/sys/arch/mac68k/conf/files.mac68k	Wed Mar 13 07:55:28 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.132 2024/01/09 04:16:25 thorpej Exp $
+#	$NetBSD: files.mac68k,v 1.133 2024/03/13 07:55:28 nat Exp $
 
 # mac68k-specific configuration info
 
@@ -43,10 +43,16 @@ device	ams: wsmousedev
 attach	ams at adb
 file	arch/mac68k/dev/ams.c		ams needs-flag
 
+# ASC (beeper)
 device	asc
 attach	asc at obio
 file	arch/mac68k/obio/asc.c		asc needs-flag
 
+#ASC audio
+device	ascaudio: audiobus, auconv, mulaw, aurateconv, auvolconv
+attach	ascaudio at obio
+file	arch/mac68k/obio/ascaudio.c	ascaudio needs-flag
+
 device	nubus { }
 attach	nubus at mainbus
 file	arch/mac68k/nubus/nubus.c	nubus

Index: src/sys/arch/mac68k/conf/majors.mac68k
diff -u src/sys/arch/mac68k/conf/majors.mac68k:1.27 src/sys/arch/mac68k/conf/majors.mac68k:1.28
--- src/sys/arch/mac68k/conf/majors.mac68k:1.27	Sat Apr  4 16:06:14 2020
+++ src/sys/arch/mac68k/conf/majors.mac68k	Wed Mar 13 07:55:28 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.mac68k,v 1.27 2020/04/04 16:06:14 jdolecek Exp $
+#	$NetBSD: majors.mac68k,v 1.28 2024/03/13 07:55:28 nat Exp $
 #
 # Device majors for mac68k
 #
@@ -52,6 +52,7 @@ device-major	ksyms		char 52			ksyms
 device-major	wsfont		char 53			wsfont
 device-major	cpi		char 54			cpi
 device-major	sysmon		char 55			sysmon
+device-major	audio		char 56			audio
 
 #device-major	obsolete	char 98			obsolete (nsmb)
 

Added files:

Index: src/sys/arch/mac68k/conf/AUDIO
diff -u /dev/null src/sys/arch/mac68k/conf/AUDIO:1.1
--- /dev/null	Wed Mar 13 07:55:29 2024
+++ src/sys/arch/mac68k/conf/AUDIO	Wed Mar 13 07:55:28 2024
@@ -0,0 +1,17 @@
+# $NetBSD: AUDIO,v 1.1 2024/03/13 07:55:28 nat Exp $
+#
+# WSFB with audio enabled.
+
+include 	"arch/mac68k/conf/WSFB"
+
+no asc0 at obio?
+
+# DEFQUALTY	0x0	22257 Monaural playback.
+# LOWQUALITY	0x1	Half playback rate.
+# HIGHQUALITY	0x2	Best Quality supported by ASC.
+
+ascaudio*	at obio? flags 0x0		# ASC/EASC audio
+audio*		at audiobus?
+spkr*		at audio?			# PC speaker (synthesized)
+wsbell*		at spkr? 			# Console beep
+
Index: src/sys/arch/mac68k/conf/AUDIOSBC
diff -u /dev/null src/sys/arch/mac68k/conf/AUDIOSBC:1.1
--- /dev/null	Wed Mar 13 07:55:29 2024
+++ src/sys/arch/mac68k/conf/AUDIOSBC	Wed Mar 13 07:55:28 2024
@@ -0,0 +1,17 @@
+# $NetBSD: AUDIOSBC,v 1.1 2024/03/13 07:55:28 nat Exp $
+#
+# WSFB with audio enabled.
+
+include 	"arch/mac68k/conf/WSFBSBC"
+
+no asc0 at obio?
+
+# DEFQUALTY	0x0	22257 Monaural playback.
+# LOWQUALITY	0x1	Half playback rate.
+# HIGHQUALITY	0x2	Best Quality supported by ASC.
+
+ascaudio*	at obio? flags 0x0		# ASC/EASC audio
+audio*		at audiobus?
+spkr*		at audio?			# PC speaker (synthesized)
+wsbell*		at spkr? 			# Console beep
+

Index: src/sys/arch/mac68k/obio/ascaudio.c
diff -u /dev/null src/sys/arch/mac68k/obio/ascaudio.c:1.1
--- /dev/null	Wed Mar 13 07:55:29 2024
+++ src/sys/arch/mac68k/obio/ascaudio.c	Wed Mar 13 07:55:28 2024
@@ -0,0 +1,970 @@
+/* $NetBSD: ascaudio.c,v 1.1 2024/03/13 07:55:28 nat Exp $ */
+
+/*-
+ * Copyright (c) 2017, 2023 Nathanial Sloss 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 

CVS commit: src/sys/arch/mac68k

2024-03-13 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Mar 13 07:55:29 UTC 2024

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k majors.mac68k
Added Files:
src/sys/arch/mac68k/conf: AUDIO AUDIOSBC
src/sys/arch/mac68k/obio: ascaudio.c ascaudiovar.h ascreg.h

Log Message:
Apple Sound Chip audio support for 68k Macintoshoes.

This provies a sound device and support for wsbell(4).

Manual page to be added in a followup commit.

As posted to port-mac68k.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/mac68k/conf/AUDIO \
src/sys/arch/mac68k/conf/AUDIOSBC
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mac68k/conf/majors.mac68k
cvs rdiff -u -r0 -r1.1 src/sys/arch/mac68k/obio/ascaudio.c \
src/sys/arch/mac68k/obio/ascaudiovar.h src/sys/arch/mac68k/obio/ascreg.h

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



Re: CVS commit: src/sys/arch/evbmips/evbmips

2024-03-13 Thread Andrius V
Thanks, should take remember this for the future reference.

On Wed, Mar 13, 2024 at 8:59 AM Nick Hudson  wrote:
>
> Module Name:src
> Committed By:   skrll
> Date:   Wed Mar 13 06:59:01 UTC 2024
>
> Modified Files:
> src/sys/arch/evbmips/evbmips: interrupt.c
>
> Log Message:
> Remove #ifdef DIAGNOSTIC by using __diagused. NFCI.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips

2024-03-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 13 06:59:01 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Remove #ifdef DIAGNOSTIC by using __diagused. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.26 src/sys/arch/evbmips/evbmips/interrupt.c:1.27
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.26	Tue Mar 12 21:27:14 2024
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Wed Mar 13 06:59:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.27 2024/03/13 06:59:01 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.27 2024/03/13 06:59:01 skrll Exp $");
 
 #include 
 #include 
@@ -53,11 +53,10 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 	struct cpu_info * const ci = curcpu();
 	uint32_t pending;
 	int ipl;
-#ifdef DIAGNOSTIC
-	const int mtx_count = ci->ci_mtx_count;
-	const u_int biglock_count = ci->ci_biglock_count;
-	const u_int blcnt = curlwp->l_blcnt;
-#endif
+	const int mtx_count __diagused = ci->ci_mtx_count;
+	const u_int biglock_count __diagused = ci->ci_biglock_count;
+	const u_int blcnt __diagused = curlwp->l_blcnt;
+
 	KASSERT(ci->ci_cpl == IPL_HIGH);
 	KDASSERT(mips_cp0_status_read() & MIPS_SR_INT_IE);
 
@@ -94,11 +93,9 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 			/* Process I/O and error interrupts. */
 			evbmips_iointr(ipl, pending, );
 		}
-#ifdef DIAGNOSTIC
 		KASSERT(biglock_count == ci->ci_biglock_count);
 		KASSERT(blcnt == curlwp->l_blcnt);
 		KASSERT(mtx_count == ci->ci_mtx_count);
-#endif
 
 		/*
 		 * If even our spl is higher now (due to interrupting while



CVS commit: src/sys/arch/evbmips/evbmips

2024-03-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 13 06:59:01 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Remove #ifdef DIAGNOSTIC by using __diagused. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips

2024-03-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 12 21:27:14 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Fix non-DIAGNOSTIC build for evbmips.

mtx_count, biglock_count and blcnt are defined inside DIAGNOSTIC block, thus
KASSERTs using them should be guarded as well.

Seemingly introduced with matt-nb5-mips64 merge in 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips

2024-03-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 12 21:27:14 UTC 2024

Modified Files:
src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Fix non-DIAGNOSTIC build for evbmips.

mtx_count, biglock_count and blcnt are defined inside DIAGNOSTIC block, thus
KASSERTs using them should be guarded as well.

Seemingly introduced with matt-nb5-mips64 merge in 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbmips/evbmips/interrupt.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/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.25 src/sys/arch/evbmips/evbmips/interrupt.c:1.26
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.25	Sat Jun 10 07:30:57 2023
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Tue Mar 12 21:27:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.25 2023/06/10 07:30:57 skrll Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.25 2023/06/10 07:30:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.26 2024/03/12 21:27:14 andvar Exp $");
 
 #include 
 #include 
@@ -94,9 +94,11 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 			/* Process I/O and error interrupts. */
 			evbmips_iointr(ipl, pending, );
 		}
+#ifdef DIAGNOSTIC
 		KASSERT(biglock_count == ci->ci_biglock_count);
 		KASSERT(blcnt == curlwp->l_blcnt);
 		KASSERT(mtx_count == ci->ci_mtx_count);
+#endif
 
 		/*
 		 * If even our spl is higher now (due to interrupting while



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

2024-03-11 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 12 02:26:16 UTC 2024

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

Log Message:
coretemp.c: don't accept impossibly low TjMax values

r. 1.39 introduced a regression where instead of applying a reasonable
default maximum (as was done prior to that change), incorrect values
were accepted and applied, as failures to retrieve an expected MSR
value weren't accounted for.

Apply different logic for unexpectedly low vs. high maximums, with
distinct warnings for each. Also add another warning about a retrieval
failure right at the outset (which also just uses the default, then).

This change fundamentally doesn't address the fact that
__SHIFTOUT(msr, MSR_TEMP_TARGET_READOUT)
doesn't necessarily return a valid value. It just restores prior
behaviour, which is more reasonable than applying a zero value, which
started happening on some older hardware. (I infer this is most likely
an issue with dated generations of Intel hardware with this feature.)
The challenge is that this evidently isn't all documented properly
anywhere. Various "magic values" in this driver need further
investigation.

While here, also fix output so warnings are cleanly formatted, rather
than the slightly scrambled way they were appearing.

Tested on older Intel hardware I had on hand:
E7500 (now falls back to default 100 rather than 0)
E5540 (successfully retrieves 97, as before)
i5-3340M (successfully retrieves 105, as before)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/x86/coretemp.c

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

Modified files:

Index: src/sys/arch/x86/x86/coretemp.c
diff -u src/sys/arch/x86/x86/coretemp.c:1.40 src/sys/arch/x86/x86/coretemp.c:1.41
--- src/sys/arch/x86/x86/coretemp.c:1.40	Thu Feb 29 01:59:11 2024
+++ src/sys/arch/x86/x86/coretemp.c	Tue Mar 12 02:26:16 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: coretemp.c,v 1.40 2024/02/29 01:59:11 gutteridge Exp $ */
+/* $NetBSD: coretemp.c,v 1.41 2024/03/12 02:26:16 gutteridge Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.40 2024/02/29 01:59:11 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.41 2024/03/12 02:26:16 gutteridge Exp $");
 
 #include 
 #include 
@@ -110,7 +110,7 @@ static int	coretemp_match(device_t, cfda
 static void	coretemp_attach(device_t, device_t, void *);
 static int	coretemp_detach(device_t, int);
 static int	coretemp_quirks(struct cpu_info *);
-static void	coretemp_tjmax(device_t);
+static int	coretemp_tjmax(device_t);
 static void	coretemp_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void	coretemp_refresh_xcall(void *, void *);
 
@@ -194,9 +194,10 @@ coretemp_attach(device_t parent, device_
 	if (sysmon_envsys_register(sc->sc_sme) != 0)
 		goto fail;
 
-	coretemp_tjmax(self);
-	aprint_verbose(", Tjmax=%d", sc->sc_tjmax);
-	aprint_normal("\n");
+	if (coretemp_tjmax(self) == 0) {
+		aprint_verbose(", Tjmax=%d", sc->sc_tjmax);
+		aprint_normal("\n");
+	}
 	return;
 
 fail:
@@ -258,7 +259,7 @@ coretemp_quirks(struct cpu_info *ci)
 	return 1;
 }
 
-void
+static int
 coretemp_tjmax(device_t self)
 {
 	struct coretemp_softc *sc = device_private(self);
@@ -288,17 +289,19 @@ coretemp_tjmax(device_t self)
 		if ((model < 0x17) && ((msr & __BIT(28)) == 0))
 			goto notee;
 
-		if (rdmsr_safe(MSR_IA32_EXT_CONFIG, ) == EFAULT)
-			return;
+		if (rdmsr_safe(MSR_IA32_EXT_CONFIG, ) == EFAULT) {
+			aprint_normal("\n");
+			aprint_error_dev(sc->sc_dev,
+			"Failed to read MSR_IA32_EXT_CONFIG MSR. "
+			"Using default (%d)\n", sc->sc_tjmax);
+			return 1;
+		}
 
-		if ((msr & __BIT(30)) != 0) {
+		if ((msr & __BIT(30)) != 0)
 			sc->sc_tjmax = 85;
-			return;
-		}
 	} else if (model == 0x17 && stepping == 0x06) {
 		/* The mobile Penryn family. */
 		sc->sc_tjmax = 105;
-		return;
 	} else if (model == 0x1c) {
 		if (stepping == 0x0a) {
 			/* 45nm Atom D400, N400 and D500 series */
@@ -307,21 +310,39 @@ coretemp_tjmax(device_t self)
 			sc->sc_tjmax = 90;
 	} else {
 notee:
-		/* Attempt to get Tj(max) from IA32_TEMPERATURE_TARGET. */
+		/* 
+		 * Attempt to get Tj(max) from IA32_TEMPERATURE_TARGET.
+		 * It is not fully known which CPU models have the MSR.
+		 */
 		if (rdmsr_safe(MSR_TEMPERATURE_TARGET, ) == EFAULT) {
+			aprint_normal("\n");
 			aprint_error_dev(sc->sc_dev,
 			"Failed to read TEMPERATURE_TARGET MSR. "
-			"Use the default (%d)\n", sc->sc_tjmax);
-			return;
+			"Using default (%d)\n", sc->sc_tjmax);
+			return 1;
 		}
 
 		tjmax = __SHIFTOUT(msr, MSR_TEMP_TARGET_READOUT);
-		if ((tjmax < TJMAX_LIMIT_LOW) || (tjmax > TJMAX_LIMIT_HIGH))
+		if (tjmax < TJMAX_LIMIT_LOW) {
+			aprint_normal("\n");
+			aprint_error_dev(sc->sc_dev,
+			"WARNING: Tjmax(%d) retrieved was below expected range, "
+"using default (%d).\n", tjmax, 

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

2024-03-11 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 12 02:26:16 UTC 2024

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

Log Message:
coretemp.c: don't accept impossibly low TjMax values

r. 1.39 introduced a regression where instead of applying a reasonable
default maximum (as was done prior to that change), incorrect values
were accepted and applied, as failures to retrieve an expected MSR
value weren't accounted for.

Apply different logic for unexpectedly low vs. high maximums, with
distinct warnings for each. Also add another warning about a retrieval
failure right at the outset (which also just uses the default, then).

This change fundamentally doesn't address the fact that
__SHIFTOUT(msr, MSR_TEMP_TARGET_READOUT)
doesn't necessarily return a valid value. It just restores prior
behaviour, which is more reasonable than applying a zero value, which
started happening on some older hardware. (I infer this is most likely
an issue with dated generations of Intel hardware with this feature.)
The challenge is that this evidently isn't all documented properly
anywhere. Various "magic values" in this driver need further
investigation.

While here, also fix output so warnings are cleanly formatted, rather
than the slightly scrambled way they were appearing.

Tested on older Intel hardware I had on hand:
E7500 (now falls back to default 100 rather than 0)
E5540 (successfully retrieves 97, as before)
i5-3340M (successfully retrieves 105, as before)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/x86/coretemp.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

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:34:47 UTC 2024

Modified Files:
src/sys/arch/sparc/include: ctlreg.h
src/sys/arch/sparc64/include: ctlreg.h

Log Message:
sparc: fix snprintb formats for SFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc/include/ctlreg.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc64/include/ctlreg.h

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

Modified files:

Index: src/sys/arch/sparc/include/ctlreg.h
diff -u src/sys/arch/sparc/include/ctlreg.h:1.31 src/sys/arch/sparc/include/ctlreg.h:1.32
--- src/sys/arch/sparc/include/ctlreg.h:1.31	Mon Sep  6 21:56:03 2021
+++ src/sys/arch/sparc/include/ctlreg.h	Sun Mar 10 17:34:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.31 2021/09/06 21:56:03 andvar Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.32 2024/03/10 17:34:46 rillig Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -376,7 +376,7 @@
 #define	SFSR_BITS	"\177\020"		\
 	"b\21EM\0b\20CS\0b\17SB\0f\15\2PERR\0"	\
 	"b\14UC\0b\13TO\0b\12BE\0f\10\2LVL\0"	\
-	"f\05\3AT\0f\02\3FT\0b\01FAV\0b\01OW\0"
+	"f\05\3AT\0f\02\3FT\0b\01FAV\0b\00OW\0"
 
 /* [4m] Synchronous Fault Types */
 #define SFSR_FT_NONE		(0 << 2) 	/* no fault */

Index: src/sys/arch/sparc64/include/ctlreg.h
diff -u src/sys/arch/sparc64/include/ctlreg.h:1.70 src/sys/arch/sparc64/include/ctlreg.h:1.71
--- src/sys/arch/sparc64/include/ctlreg.h:1.70	Fri Feb  2 22:33:42 2024
+++ src/sys/arch/sparc64/include/ctlreg.h	Sun Mar 10 17:34:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.70 2024/02/02 22:33:42 andvar Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.71 2024/03/10 17:34:47 rillig Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -306,9 +306,10 @@
 		SFSR_ILL_ASI|SFSR_FT_IO_ATOMIC|SFSR_FT_ILL_NF|SFSR_FT_PRIV)
 
 #define	SFSR_BITS "\177\20" \
-	"f\20\30ASI\0" "b\16VAT\0" "b\15VAD\0" "b\14NFO\0" "b\13ASI\0" "b\12A\0" \
-	"b\11NF\0" "b\10PRIV\0" "b\7E\0" "b\6NUCLEUS\0" "b\5SECONDCTX\0" "b\4PRIV\0" \
-	"b\3W\0" "b\2OW\0" "b\1FV\0"
+	"f\20\30ASI\0"			"b\15VAT\0"	"b\14VAD\0" \
+	"b\13NFO\0"	"b\12ASI\0"	"b\11A\0"	"b\10NF\0" \
+	"b\07PRIV\0"	"b\06E\0"	"b\05NUCLEUS\0"	"b\04SECONDCTX\0" \
+	"b\03PRIV\0"	"b\02W\0"	"b\01OW\0"	"b\00FV\0"
 
 /* ASFR bits */
 #define	ASFR_ME			0x1LL



CVS commit: src/sys/arch

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:34:47 UTC 2024

Modified Files:
src/sys/arch/sparc/include: ctlreg.h
src/sys/arch/sparc64/include: ctlreg.h

Log Message:
sparc: fix snprintb formats for SFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc/include/ctlreg.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc64/include/ctlreg.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/include/oea

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:07:31 UTC 2024

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h

Log Message:
powerpc/hid: fix snprintb format for HID0_970_BITMASK_U


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/oea/hid.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/include/oea/hid.h
diff -u src/sys/arch/powerpc/include/oea/hid.h:1.14 src/sys/arch/powerpc/include/oea/hid.h:1.15
--- src/sys/arch/powerpc/include/oea/hid.h:1.14	Sat Jan 20 09:47:35 2024
+++ src/sys/arch/powerpc/include/oea/hid.h	Sun Mar 10 17:07:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.14 2024/01/20 09:47:35 jmcneill Exp $	*/
+/*	$NetBSD: hid.h,v 1.15 2024/03/10 17:07:31 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -112,7 +112,7 @@
 "\040EMCP"
 
 #define HID0_970_BITMASK_U "\020" \
-"\040ONEPPC\036DOSNGL\036ISYNCSC\035SERGP\034res\033res\032res\031DEEPNAP" \
+"\040ONEPPC\037DOSNGL\036ISYNCSC\035SERGP\034res\033res\032res\031DEEPNAP" \
 "\030DOZE\027NAP\026res\025DPM\024res\023TG\022HNGDIS\021NHR" \
 "\020INORDER\017res\016TBCTRL\015EXTBEN\014res\013res\012CIABREN\011HDICEEN" \
 "\001ENATTN"



CVS commit: src/sys/arch/powerpc/include/oea

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:07:31 UTC 2024

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h

Log Message:
powerpc/hid: fix snprintb format for HID0_970_BITMASK_U


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/oea/hid.h

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



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

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:02:24 UTC 2024

Modified Files:
src/sys/arch/sparc/dev: sbusreg.h

Log Message:
sparc/sbusreg: fix snprintb format for SBUS_AFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc/dev/sbusreg.h

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

Modified files:

Index: src/sys/arch/sparc/dev/sbusreg.h
diff -u src/sys/arch/sparc/dev/sbusreg.h:1.6 src/sys/arch/sparc/dev/sbusreg.h:1.7
--- src/sys/arch/sparc/dev/sbusreg.h:1.6	Wed Nov 16 00:49:03 2005
+++ src/sys/arch/sparc/dev/sbusreg.h	Sun Mar 10 17:02:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbusreg.h,v 1.6 2005/11/16 00:49:03 uwe Exp $ */
+/*	$NetBSD: sbusreg.h,v 1.7 2024/03/10 17:02:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -94,7 +94,7 @@ struct sbusreg {
 #define SBUS_AFSR_ERR	0x8000	/* Summary bit: one of LE,TO,BERR */
 #define SBUS_AFSR_BITS	"\177\020"	\
 			"f\0\4PAH\0b\10WM\0f\11\3SSIZ\0f\14\5SA\0"	\
-			"b\11FAV\0b\12RD\0b\13ME\0f\14\4MID\0b\30S\0"	\
+			"b\21FAV\0b\22RD\0b\23ME\0f\24\4MID\0b\30S\0"	\
 			"f\31\3SIZ\0b\34BERR\0b\35TO\0b\36LE\0b\37ERR\0"
 
 /* Arbiter Enable register */



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

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 17:02:24 UTC 2024

Modified Files:
src/sys/arch/sparc/dev: sbusreg.h

Log Message:
sparc/sbusreg: fix snprintb format for SBUS_AFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc/dev/sbusreg.h

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



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

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 16:58:08 UTC 2024

Modified Files:
src/sys/arch/sparc/dev: vmereg.h

Log Message:
sparc/vmereg: fix snprintb format VMEBUS_AFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/dev/vmereg.h

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

Modified files:

Index: src/sys/arch/sparc/dev/vmereg.h
diff -u src/sys/arch/sparc/dev/vmereg.h:1.7 src/sys/arch/sparc/dev/vmereg.h:1.8
--- src/sys/arch/sparc/dev/vmereg.h:1.7	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/dev/vmereg.h	Sun Mar 10 16:58:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmereg.h,v 1.7 2008/04/28 20:23:36 martin Exp $ */
+/*	$NetBSD: vmereg.h,v 1.8 2024/03/10 16:58:08 rillig Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ struct vmebusreg {
 #define VMEBUS_AFSR_ME	0x0080	/* Multiple error */
 #define VMEBUS_AFSR_RSVD 0x007f	/* reserved */
 #define VMEBUS_AFSR_BITS "\177\020"	\
-			 "b\27ME\0b\30S\0b\31ERR\0b\32WB\0\33TO\0f\34\3SZ\0"
+	"b\27ME\0b\30S\0b\31ERR\0b\32WB\0b\33BERR\0b\34TO\0f\35\3SZ\0"
 
 struct vmebusvec {
 	volatile uint8_t	vmebusvec[16];



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

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 16:58:08 UTC 2024

Modified Files:
src/sys/arch/sparc/dev: vmereg.h

Log Message:
sparc/vmereg: fix snprintb format VMEBUS_AFSR_BITS


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/dev/vmereg.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/virt68k/dev

2024-03-09 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Mar  9 11:16:31 UTC 2024

Modified Files:
src/sys/arch/virt68k/dev: virtio_mainbus.c

Log Message:
Fix a null dereference.
free_interrupts may be called even when sc_ih has not been assigned yet.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/virt68k/dev/virtio_mainbus.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/virt68k/dev/virtio_mainbus.c
diff -u src/sys/arch/virt68k/dev/virtio_mainbus.c:1.1 src/sys/arch/virt68k/dev/virtio_mainbus.c:1.2
--- src/sys/arch/virt68k/dev/virtio_mainbus.c:1.1	Tue Jan  2 07:40:59 2024
+++ src/sys/arch/virt68k/dev/virtio_mainbus.c	Sat Mar  9 11:16:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio_mainbus.c,v 1.1 2024/01/02 07:40:59 thorpej Exp $	*/
+/*	$NetBSD: virtio_mainbus.c,v 1.2 2024/03/09 11:16:31 isaki Exp $	*/
 
 /*
  * Copyright (c) 2021, 2024 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_mainbus.c,v 1.1 2024/01/02 07:40:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mainbus.c,v 1.2 2024/03/09 11:16:31 isaki Exp $");
 
 #include 
 #include 
@@ -170,6 +170,8 @@ virtio_mainbus_alloc_interrupts(struct v
 static void
 virtio_mainbus_free_interrupts(struct virtio_mmio_softc *msc)
 {
-	intr_disestablish(msc->sc_ih);
-	msc->sc_ih = NULL;
+	if (msc->sc_ih) {
+		intr_disestablish(msc->sc_ih);
+		msc->sc_ih = NULL;
+	}
 }



  1   2   3   4   5   6   7   8   9   10   >