CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 14:41:05 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674 (not really so much any more)

Correct previous.

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

Turns out that it used to be an XSI function, back in the dark ages
('twas removed in POSIX issue 7, back in 2008, after being marked
obsolete in issue 6 (2001)).

So, make it visible to any applications that request a suitable
X/Open version (and of course, for _NETBSD_SOURCE).

Still no effect on the issue for the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/sys/signal.h

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

Modified files:

Index: src/sys/sys/signal.h
diff -u src/sys/sys/signal.h:1.77 src/sys/sys/signal.h:1.78
--- src/sys/sys/signal.h:1.77	Thu Sep 19 13:16:30 2024
+++ src/sys/sys/signal.h	Thu Sep 19 14:41:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.77 2024/09/19 13:16:30 kre Exp $	*/
+/*	$NetBSD: signal.h,v 1.78 2024/09/19 14:41:05 kre Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -321,8 +321,21 @@ void	(*signal(int, void (*)(int)))(int);
 #if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_NETBSD_SOURCE)
 int	sigqueue(pid_t, int, const union sigval);
 #endif
-#if defined(_NETBSD_SOURCE)
+
+#if defined(_NETBSD_SOURCE) ||	\
+(!defined (_XOPEN_SOURCE) && defined(_XOPEN_VERSION) &&	\
+	(_XOPEN_VERSION - 0) >= 4) ||\
+(defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) <= 600)
+/*
+ * bsd_signal() was added to the standards in POSIX issue 4 (SusV4)
+ * (release 2 of SusV4) and then removed in POSIX issue 7 (2008),
+ * after being marked obsolete in POSIX issue 6 (2001).  It was
+ * always an X/Open extension function (though was moved to the
+ * base POSIX spec in issue 5, but still as an extension).
+ */
 void	(*bsd_signal(int, void (*)(int)))(int);
+#endif
+#if defined(_NETBSD_SOURCE)
 int	sigqueueinfo(pid_t, const siginfo_t *);
 #endif
 __END_DECLS



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 14:41:05 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674 (not really so much any more)

Correct previous.

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

Turns out that it used to be an XSI function, back in the dark ages
('twas removed in POSIX issue 7, back in 2008, after being marked
obsolete in issue 6 (2001)).

So, make it visible to any applications that request a suitable
X/Open version (and of course, for _NETBSD_SOURCE).

Still no effect on the issue for the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/sys/signal.h

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



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 13:16:30 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

This change inspired by the PR, but doesn't fix it in any way, the tools
config script for gmake doesn't care if the function is visible in any
header, merely if present in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/signal.h

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



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 13:16:30 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

This change inspired by the PR, but doesn't fix it in any way, the tools
config script for gmake doesn't care if the function is visible in any
header, merely if present in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/signal.h

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

Modified files:

Index: src/sys/sys/signal.h
diff -u src/sys/sys/signal.h:1.76 src/sys/sys/signal.h:1.77
--- src/sys/sys/signal.h:1.76	Mon Sep  9 12:01:16 2024
+++ src/sys/sys/signal.h	Thu Sep 19 13:16:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.76 2024/09/09 12:01:16 riastradh Exp $	*/
+/*	$NetBSD: signal.h,v 1.77 2024/09/19 13:16:30 kre Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -318,11 +318,11 @@ struct	sigevent {
  */
 __BEGIN_DECLS
 void	(*signal(int, void (*)(int)))(int);
-void	(*bsd_signal(int, void (*)(int)))(int);
 #if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_NETBSD_SOURCE)
 int	sigqueue(pid_t, int, const union sigval);
 #endif
 #if defined(_NETBSD_SOURCE)
+void	(*bsd_signal(int, void (*)(int)))(int);
 int	sigqueueinfo(pid_t, const siginfo_t *);
 #endif
 __END_DECLS



CVS commit: src/sys/dev/raidframe

2024-09-19 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Sep 19 06:13:03 UTC 2024

Modified Files:
src/sys/dev/raidframe: rf_driver.c

Log Message:
s/conficts/conflicts/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/raidframe/rf_driver.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.143 src/sys/dev/raidframe/rf_driver.c:1.144
--- src/sys/dev/raidframe/rf_driver.c:1.143	Mon Oct  9 22:00:38 2023
+++ src/sys/dev/raidframe/rf_driver.c	Thu Sep 19 06:13:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.143 2023/10/09 22:00:38 oster Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.144 2024/09/19 06:13:03 andvar Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,13 +60,13 @@
  *
  * rf_driver.c -- main setup, teardown, and access routines for the RAID driver
  *
- * all routines are prefixed with rf_ (raidframe), to avoid conficts.
+ * all routines are prefixed with rf_ (raidframe), to avoid conflicts.
  *
  **/
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.143 2023/10/09 22:00:38 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.144 2024/09/19 06:13:03 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_diagnostic.h"



CVS commit: src/sys/stand/efiboot

2024-09-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 19 06:26:12 UTC 2024

Modified Files:
src/sys/stand/efiboot: exec.c

Log Message:
when freeing pages, pass page count instead of byte count.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/stand/efiboot/exec.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/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.25 src/sys/stand/efiboot/exec.c:1.26
--- src/sys/stand/efiboot/exec.c:1.25	Thu Aug 15 05:59:49 2024
+++ src/sys/stand/efiboot/exec.c	Thu Sep 19 06:26:11 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.25 2024/08/15 05:59:49 skrll Exp $ */
+/* $NetBSD: exec.c,v 1.26 2024/09/19 06:26:11 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -154,7 +154,8 @@ generate_efirng(void)
 
 	/* Fill the page with whatever the EFI RNG will do.  */
 	if (efi_rng((void *)(uintptr_t)addr, size)) {
-		uefi_call_wrapper(BS->FreePages, 2, addr, size);
+		uefi_call_wrapper(BS->FreePages, 2, addr,
+		EFI_SIZE_TO_PAGES(size));
 		return;
 	}
 



CVS commit: src/sys/stand/efiboot

2024-09-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 19 06:26:12 UTC 2024

Modified Files:
src/sys/stand/efiboot: exec.c

Log Message:
when freeing pages, pass page count instead of byte count.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/stand/efiboot/exec.c

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



CVS commit: src/sys/dev/raidframe

2024-09-18 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Sep 19 06:13:03 UTC 2024

Modified Files:
src/sys/dev/raidframe: rf_driver.c

Log Message:
s/conficts/conflicts/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/raidframe/rf_driver.c

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



CVS commit: src/sys/net

2024-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 23:20:20 UTC 2024

Modified Files:
src/sys/net: if_tun.c

Log Message:
tun(4): Mark tunread_filtops `FILTEROP_MPSAFE`

Filter handlers have already been MP-safe since 2018:
https://mail-index.netbsd.org/source-changes/2018/08/06/msg097317.html

Note that we do not expect deadlocks similar to bpf(4) (PR kern/58531),
b/w KERNEL_LOCK and spin mutex for TX queue.

For tun(4), filt_tunread() acquires adaptive mutex. This is forbidden
when spin mutex is already held.

Such a path must have already been detected if present.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/net/if_tun.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/net/if_tun.c
diff -u src/sys/net/if_tun.c:1.176 src/sys/net/if_tun.c:1.177
--- src/sys/net/if_tun.c:1.176	Fri Jul  5 04:31:53 2024
+++ src/sys/net/if_tun.c	Wed Sep 18 23:20:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.176 2024/07/05 04:31:53 rin Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.177 2024/09/18 23:20:20 rin Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions 
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.176 2024/07/05 04:31:53 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.177 2024/09/18 23:20:20 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1097,7 +1097,7 @@ filt_tunread(struct knote *kn, long hint
 }
 
 static const struct filterops tunread_filtops = {
-	.f_flags = FILTEROP_ISFD,
+	.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
 	.f_attach = NULL,
 	.f_detach = filt_tunrdetach,
 	.f_event = filt_tunread,



CVS commit: src/sys/net

2024-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 23:20:20 UTC 2024

Modified Files:
src/sys/net: if_tun.c

Log Message:
tun(4): Mark tunread_filtops `FILTEROP_MPSAFE`

Filter handlers have already been MP-safe since 2018:
https://mail-index.netbsd.org/source-changes/2018/08/06/msg097317.html

Note that we do not expect deadlocks similar to bpf(4) (PR kern/58531),
b/w KERNEL_LOCK and spin mutex for TX queue.

For tun(4), filt_tunread() acquires adaptive mutex. This is forbidden
when spin mutex is already held.

Such a path must have already been detected if present.

Thanks ozaki-r@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/net/if_tun.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/i386/i386

2024-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 22:29:39 UTC 2024

Modified Files:
src/sys/arch/i386/i386: db_interface.c

Log Message:
i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused

as already done for amd64:
https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html

`pause` insn has been introduced to Pentium 4. However, its opcode is
consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore
interpreted as `nop` for older processors. Intel assured this behavior [1].

Also note that we already use `pause` unconditionally for i386.

Briefly tested on QEMU.

[1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and
Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001)


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/i386/i386/db_interface.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/i386/i386

2024-09-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 22:29:39 UTC 2024

Modified Files:
src/sys/arch/i386/i386: db_interface.c

Log Message:
i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused

as already done for amd64:
https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html

`pause` insn has been introduced to Pentium 4. However, its opcode is
consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore
interpreted as `nop` for older processors. Intel assured this behavior [1].

Also note that we already use `pause` unconditionally for i386.

Briefly tested on QEMU.

[1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and
Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001)


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/i386/i386/db_interface.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/i386/i386/db_interface.c
diff -u src/sys/arch/i386/i386/db_interface.c:1.88 src/sys/arch/i386/i386/db_interface.c:1.89
--- src/sys/arch/i386/i386/db_interface.c:1.88	Wed Oct 26 23:38:07 2022
+++ src/sys/arch/i386/i386/db_interface.c	Wed Sep 18 22:29:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.89 2024/09/18 22:29:39 rin Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.89 2024/09/18 22:29:39 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -369,7 +369,7 @@ ddb_suspend(struct trapframe *frame)
 	atomic_or_32(&ci->ci_flags, CPUF_PAUSE);
 
 	while (ci->ci_flags & CPUF_PAUSE)
-		;
+		x86_pause();
 	ci->ci_ddb_regs = 0;
 	tlbflushg();
 }



Re: CVS commit: src/sys/arch/i386/stand/lib

2024-09-18 Thread Rin Okuyama

Hi,

On 2024/09/19 3:33, Andrius V wrote:

On Wed, Sep 18, 2024 at 3:44 AM Rin Okuyama  wrote:


Module Name:src
Committed By:   rin
Date:   Wed Sep 18 00:44:03 UTC 2024

Modified Files:
 src/sys/arch/i386/stand/lib: libi386.h

Log Message:
i386/stand: Remove XMS leftover from libi386.h, NFC

PR port-i386/58624


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/libi386.h

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



Thanks, not sure how it slipped (I have definitely seen the code,
either forgot to copy to cvs directory or just forgot about it).



It can be... Your work was otherwise perfect. Thank you very much for
cleaning up things including tiny comments!

rin


CVS commit: src/sys/stand/efiboot/bootarm

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 19:43:29 UTC 2024

Modified Files:
src/sys/stand/efiboot/bootarm: cache.S efibootarm.c

Log Message:
Clean and invalidate the full data cache as the armv6_start.S code assumes
that the caches are disabled on entry which armv7_exec_kernel ensures.
When caches are disabled armv6_start.S will invalidate (not clean) the
cache and this can lose u-boot data for the u-boots that now don't
perform their own cache maintenance.

An example of such a u-boot is the banana pro that chuq@ has tried which
has

commit 8b5dea33584261cc5d600614970d1cbed6d99f91
Author: Heinrich Schuchardt 
Date:   Wed Mar 3 14:05:05 2021 +0100

efi_loader: disable GRUB_ARM32_WORKAROUND on ARCH_SUNXI

applied.

Improving things so that the architected caches could remain on would be
better, but that's a much bigger change / set of changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/bootarm/cache.S
cvs rdiff -u -r1.4 -r1.5 src/sys/stand/efiboot/bootarm/efibootarm.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/stand/efiboot/bootarm/cache.S
diff -u src/sys/stand/efiboot/bootarm/cache.S:1.1 src/sys/stand/efiboot/bootarm/cache.S:1.2
--- src/sys/stand/efiboot/bootarm/cache.S:1.1	Sat Mar 30 12:48:50 2019
+++ src/sys/stand/efiboot/bootarm/cache.S	Wed Sep 18 19:43:29 2024
@@ -53,6 +53,67 @@ ENTRY(armv7_dcache_wbinv_range)
 	bx	lr
 END(armv7_dcache_wbinv_range)
 
+/* LINTSTUB: void armv7_dcache_wbinv_all(void); */
+ENTRY_NP(armv7_dcache_wbinv_all)
+	mrc	p15, 1, r0, c0, c0, 1	@ read CLIDR
+	tst	r0, #0x0700
+	bxeq	lr
+	mov	r3, #0			@ start with L1
+
+.Lstart_wbinv:
+	add	r2, r3, r3, lsr #1	@ r2 = level * 3 / 2
+	mov	r1, r0, lsr r2		@ r1 = cache type
+	tst	r1, #6			@ is it unified or data?
+	beq	.Lnext_level_wbinv	@ nope, skip level
+
+	mcr	p15, 2, r3, c0, c0, 0	@ select cache level
+	isb
+	mrc	p15, 1, r0, c0, c0, 0	@ read CCSIDR
+
+	ubfx	ip, r0, #0, #3		@ get linesize from CCSIDR
+	add	ip, ip, #4		@ apply bias
+	ubfx	r2, r0, #13, #15	@ get numsets - 1 from CCSIDR
+	lsl	r2, r2, ip		@ shift to set position
+	orr	r3, r3, r2		@ merge set into way/set/level
+	mov	r1, #1
+	lsl	r1, r1, ip		@ r1 = set decr
+
+	ubfx	ip, r0, #3, #10		@ get numways - 1 from [to be discarded] CCSIDR
+	clz	r2, ip			@ number of bits to MSB of way
+	lsl	ip, ip, r2		@ shift by that into way position
+	mov	r0, #1			@
+	lsl	r2, r0, r2		@ r2 now contains the way decr
+	mov	r0, r3 			@ get sets/level (no way yet)
+	orr	r3, r3, ip		@ merge way into way/set/level
+	bfc	r0, #0, #4		@ clear low 4 bits (level) to get numset - 1
+	sub	r2, r2, r0		@ subtract from way decr
+
+	/* r3 = ways/sets/level, r2 = way decr, r1 = set decr, r0 and ip are free */
+1:	mcr	p15, 0, r3, c7, c14, 2	@ DCCISW (data cache clean and invalidate by set/way)
+	cmp	r3, #15			@ are we done with this level (way/set == 0)
+	bls	.Lnext_level_wbinv	@ yes, go to next level
+	ubfx	r0, r3, #4, #18		@ extract set bits
+	cmp	r0, #0			@ compare
+	subne	r3, r3, r1		@ non-zero?, decrement set #
+	subeq	r3, r3, r2		@ zero?, decrement way # and restore set count
+	b	1b
+
+.Lnext_level_wbinv:
+	dsb
+	mrc	p15, 1, r0, c0, c0, 1	@ read CLIDR
+	ubfx	ip, r0, #24, #3		@ narrow to LoC
+	add	r3, r3, #2		@ go to next level
+	cmp	r3, ip, lsl #1		@ compare
+	blt	.Lstart_wbinv		@ not done, next level (r0 == CLIDR)
+
+.Ldone_wbinv:
+	mov	r0, #0			@ default back to cache level 0
+	mcr	p15, 2, r0, c0, c0, 0	@ select cache level
+	dsb
+	isb
+	bx	lr
+END(armv7_dcache_wbinv_all)
+
 /* * LINTSTUB: void armv7_icache_inv_all(void); */
 ENTRY_NP(armv7_icache_inv_all)
 	mov	r0, #0

Index: src/sys/stand/efiboot/bootarm/efibootarm.c
diff -u src/sys/stand/efiboot/bootarm/efibootarm.c:1.4 src/sys/stand/efiboot/bootarm/efibootarm.c:1.5
--- src/sys/stand/efiboot/bootarm/efibootarm.c:1.4	Thu Aug 15 06:15:17 2024
+++ src/sys/stand/efiboot/bootarm/efibootarm.c	Wed Sep 18 19:43:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: efibootarm.c,v 1.4 2024/08/15 06:15:17 skrll Exp $ */
+/* $NetBSD: efibootarm.c,v 1.5 2024/09/18 19:43:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -35,6 +35,7 @@
 
 /* cache.S */
 void armv7_dcache_wbinv_range(vaddr_t, vsize_t);
+void armv7_dcache_wbinv_all(void);
 void armv7_icache_inv_all(void);
 void armv7_exec_kernel(register_t, register_t);
 
@@ -47,13 +48,7 @@ efi_dcache_flush(u_long start, u_long si
 void
 efi_boot_kernel(u_long marks[MARK_MAX])
 {
-	u_long kernel_size;
-
-	kernel_size = marks[MARK_END] - marks[MARK_START];
-
-	armv7_dcache_wbinv_range(marks[MARK_START], kernel_size);
-	if (efi_fdt_size() > 0)
-		armv7_dcache_wbinv_range((u_long)efi_fdt_data(), efi_fdt_size());
+	armv7_dcache_wbinv_all();
 	armv7_icache_inv_all();
 
 	armv7_exec_kernel((register_t)marks[MARK_ENTRY], (register_t)efi_fdt_data());



CVS commit: src/sys/stand/efiboot/bootarm

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 19:43:29 UTC 2024

Modified Files:
src/sys/stand/efiboot/bootarm: cache.S efibootarm.c

Log Message:
Clean and invalidate the full data cache as the armv6_start.S code assumes
that the caches are disabled on entry which armv7_exec_kernel ensures.
When caches are disabled armv6_start.S will invalidate (not clean) the
cache and this can lose u-boot data for the u-boots that now don't
perform their own cache maintenance.

An example of such a u-boot is the banana pro that chuq@ has tried which
has

commit 8b5dea33584261cc5d600614970d1cbed6d99f91
Author: Heinrich Schuchardt 
Date:   Wed Mar 3 14:05:05 2021 +0100

efi_loader: disable GRUB_ARM32_WORKAROUND on ARCH_SUNXI

applied.

Improving things so that the architected caches could remain on would be
better, but that's a much bigger change / set of changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/stand/efiboot/bootarm/cache.S
cvs rdiff -u -r1.4 -r1.5 src/sys/stand/efiboot/bootarm/efibootarm.c

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/i386/stand/lib

2024-09-18 Thread Andrius V
On Wed, Sep 18, 2024 at 3:44 AM Rin Okuyama  wrote:
>
> Module Name:src
> Committed By:   rin
> Date:   Wed Sep 18 00:44:03 UTC 2024
>
> Modified Files:
> src/sys/arch/i386/stand/lib: libi386.h
>
> Log Message:
> i386/stand: Remove XMS leftover from libi386.h, NFC
>
> PR port-i386/58624
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/libi386.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>

Thanks, not sure how it slipped (I have definitely seen the code,
either forgot to copy to cvs directory or just forgot about it).


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

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 10:37:03 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7110_clkc.c jh71x0_clkc.h

Log Message:
risc-v: add reset support to the JH7110 SOC clock controller driver


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/starfive/jh7110_clkc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/starfive/jh71x0_clkc.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/riscv/starfive/jh7110_clkc.c
diff -u src/sys/arch/riscv/starfive/jh7110_clkc.c:1.4 src/sys/arch/riscv/starfive/jh7110_clkc.c:1.5
--- src/sys/arch/riscv/starfive/jh7110_clkc.c:1.4	Wed Sep 18 10:33:35 2024
+++ src/sys/arch/riscv/starfive/jh7110_clkc.c	Wed Sep 18 10:37:03 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: jh7110_clkc.c,v 1.4 2024/09/18 10:33:35 skrll Exp $ */
+/* $NetBSD: jh7110_clkc.c,v 1.5 2024/09/18 10:37:03 skrll Exp $ */
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jh7110_clkc.c,v 1.4 2024/09/18 10:33:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jh7110_clkc.c,v 1.5 2024/09/18 10:37:03 skrll Exp $");
 
 #include 
 
@@ -841,9 +841,66 @@ static struct jh7110_clock_config jh7110
 };
 
 
+#define JH7110_SYSRST_ASSERT			0x2f8
+#define JH7110_SYSRST_STATUS			0x308
+#define JH7110_SYSRST_NRESETS			126
+
+#define JH7110_AONRST_ASSERT			0x38
+#define JH7110_AONRST_STATUS			0x3c
+#define JH7110_AONRST_NRESETS			8
+
+#define JH7110_STGRST_ASSERT			0x74
+#define JH7110_STGRST_STATUS			0x78
+#define JH7110_STGRST_NRESETS			23
+
+#define JH7110_ISPRST_ASSERT			0x38
+#define JH7110_ISPRST_STATUS			0x3c
+#define JH7110_ISPRST_NRESETS			12
+
+#define JH7110_VOUTRST_ASSERT			0x48
+#define JH7110_VOUTRST_STATUS			0x4c
+#define JH7110_VOUTRST_NRESETS			12
+
+struct jh7110_reset_config {
+	size_t jhcr_nresets;
+	bus_size_t jhcr_assert;
+	bus_size_t jhcr_status;
+};
+
+static struct jh7110_reset_config jh7110_sysrst_config = {
+	.jhcr_nresets = JH7110_SYSRST_NRESETS,
+	.jhcr_assert = JH7110_SYSRST_ASSERT,
+	.jhcr_status = JH7110_SYSRST_STATUS,
+};
+
+static struct jh7110_reset_config jh7110_aonrst_config = {
+	.jhcr_nresets = JH7110_AONRST_NRESETS,
+	.jhcr_assert = JH7110_AONRST_ASSERT,
+	.jhcr_status = JH7110_AONRST_STATUS,
+};
+
+static struct jh7110_reset_config jh7110_stgrst_config = {
+	.jhcr_nresets = JH7110_STGRST_NRESETS,
+	.jhcr_assert = JH7110_STGRST_ASSERT,
+	.jhcr_status = JH7110_STGRST_STATUS,
+};
+
+static struct jh7110_reset_config jh7110_isprst_config = {
+	.jhcr_nresets = JH7110_ISPRST_NRESETS,
+	.jhcr_assert = JH7110_ISPRST_ASSERT,
+	.jhcr_status = JH7110_ISPRST_STATUS,
+};
+
+static struct jh7110_reset_config jh7110_voutrst_config = {
+	.jhcr_nresets = JH7110_VOUTRST_NRESETS,
+	.jhcr_assert = JH7110_VOUTRST_ASSERT,
+	.jhcr_status = JH7110_VOUTRST_STATUS,
+};
+
 struct jh7110_crg {
 	const char *jhc_name;
 	struct jh7110_clock_config *jhc_clk;
+	struct jh7110_reset_config *jhc_rst;
 	bool jhc_debug;
 };
 
@@ -851,6 +908,7 @@ struct jh7110_crg {
 static struct jh7110_crg jh7110_sys_config = {
 	.jhc_name = "System",
 	.jhc_clk = &jh7110_sysclk_config,
+	.jhc_rst = &jh7110_sysrst_config,
 	.jhc_debug = true,
 };
 
@@ -858,22 +916,26 @@ static struct jh7110_crg jh7110_sys_conf
 static struct jh7110_crg jh7110_aon_config = {
 	.jhc_name = "Always-On",
 	.jhc_clk = &jh7110_aonclk_config,
+	.jhc_rst = &jh7110_aonrst_config,
 	.jhc_debug = true,
 };
 
 static struct jh7110_crg jh7110_isp_config = {
 	.jhc_name = "Image-Signal-Process",
 	.jhc_clk = &jh7110_ispclk_config,
+	.jhc_rst = &jh7110_isprst_config,
 };
 
 static struct jh7110_crg jh7110_stg_config = {
 	.jhc_name = "System-Top-Group",
 	.jhc_clk = &jh7110_stgclk_config,
+	.jhc_rst = &jh7110_stgrst_config,
 };
 
 static struct jh7110_crg jh7110_vout_config = {
 	.jhc_name = "Video Output",
 	.jhc_clk = &jh7110_voutclk_config,
+	.jhc_rst = &jh7110_voutrst_config,
 };
 
 
@@ -886,11 +948,108 @@ static const struct device_compatible_en
 	DEVICE_COMPAT_EOL
 };
 
+#define CLK_LOCK(sc)			\
+	mutex_enter(&sc->sc_lock);
+#define CLK_UNLOCK(sc)			\
+	mutex_exit(&sc->sc_lock);
+
 #define RD4(sc, reg)			\
 	bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
 #define WR4(sc, reg, val)		\
 	bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
 
+#define JH7110_RESET_RETRIES 1000
+
+static void *
+jh7110_clkc_reset_acquire(device_t dev, const void *data, size_t len)
+{
+	struct jh71x0_clkc_softc * const sc = device_private(dev);
+
+	if (len != sizeof(uint32_t))
+		return NULL;
+
+	const uint32_t reset_id = be32dec(data);
+	if (reset_id >= sc->sc_nrsts)
+		return NULL;
+
+	uint32_t *reset = kmem_alloc(sizeof(uint32_t), KM_SLEEP);
+	*reset = reset_id;
+
+	return reset;
+}
+
+static void
+jh7110_clkc_reset_release(device_t dev, void *priv)
+{
+
+	kmem_free(priv, sizeof(uint32_t));
+}
+
+static int
+jh7110_clkc_re

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

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 10:37:03 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7110_clkc.c jh71x0_clkc.h

Log Message:
risc-v: add reset support to the JH7110 SOC clock controller driver


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/starfive/jh7110_clkc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/starfive/jh71x0_clkc.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/riscv/starfive

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 10:33:36 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7110_clkc.c

Log Message:
Match "Image-Signal-Process" clock controller and only aprint_debug the
state of "System" and "Always-On" clocks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/starfive/jh7110_clkc.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/starfive/jh7110_clkc.c
diff -u src/sys/arch/riscv/starfive/jh7110_clkc.c:1.3 src/sys/arch/riscv/starfive/jh7110_clkc.c:1.4
--- src/sys/arch/riscv/starfive/jh7110_clkc.c:1.3	Wed Sep 18 08:31:50 2024
+++ src/sys/arch/riscv/starfive/jh7110_clkc.c	Wed Sep 18 10:33:35 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: jh7110_clkc.c,v 1.3 2024/09/18 08:31:50 skrll Exp $ */
+/* $NetBSD: jh7110_clkc.c,v 1.4 2024/09/18 10:33:35 skrll Exp $ */
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jh7110_clkc.c,v 1.3 2024/09/18 08:31:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jh7110_clkc.c,v 1.4 2024/09/18 10:33:35 skrll Exp $");
 
 #include 
 
@@ -739,7 +739,6 @@ static struct jh71x0_clkc_clk jh7110_stg
 	JH71X0CLKC_GATE(JH7110_STGCLK_DMA1P_AHB, "dma1p_ahb", "stg_axiahb"),
 };
 
-#if 0
 static const char *vin_p_axi_wr_parents[] = {
 	"mipi_rx0_pxl", "dvp_inv",
 };
@@ -767,7 +766,6 @@ static struct jh71x0_clkc_clk jh7110_isp
 	/* ispv2_top_wrapper */
 	JH71X0CLKC_MUXGATE(JH7110_ISPCLK_ISPV2_TOP_WRAPPER_C, "ispv2_top_wrapper_c", ispv2_top_wrapper_c_parents),
 };
-#endif
 
 static const char *dc8200_pix0_parents[] = {
 	"dc8200_pix", "hdmitx0_pixelclk",
@@ -822,12 +820,10 @@ static struct jh7110_clock_config jh7110
 	.jhcc_nclks = __arraycount(jh7110_aonclk_clocks),
 };
 
-#if 0
 static struct jh7110_clock_config jh7110_ispclk_config = {
 	.jhcc_clocks = jh7110_ispclk_clocks,
 	.jhcc_nclks = __arraycount(jh7110_ispclk_clocks),
 };
-#endif
 
 static struct jh7110_clock_config jh7110_stgclk_config = {
 	.jhcc_clocks = jh7110_stgclk_clocks,
@@ -848,26 +844,27 @@ static struct jh7110_clock_config jh7110
 struct jh7110_crg {
 	const char *jhc_name;
 	struct jh7110_clock_config *jhc_clk;
+	bool jhc_debug;
 };
 
 
 static struct jh7110_crg jh7110_sys_config = {
 	.jhc_name = "System",
 	.jhc_clk = &jh7110_sysclk_config,
+	.jhc_debug = true,
 };
 
 
 static struct jh7110_crg jh7110_aon_config = {
 	.jhc_name = "Always-On",
 	.jhc_clk = &jh7110_aonclk_config,
+	.jhc_debug = true,
 };
 
-#if 0
 static struct jh7110_crg jh7110_isp_config = {
 	.jhc_name = "Image-Signal-Process",
 	.jhc_clk = &jh7110_ispclk_config,
 };
-#endif
 
 static struct jh7110_crg jh7110_stg_config = {
 	.jhc_name = "System-Top-Group",
@@ -883,30 +880,25 @@ static struct jh7110_crg jh7110_vout_con
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "starfive,jh7110-syscrg", .data = &jh7110_sys_config },
 	{ .compat = "starfive,jh7110-aoncrg", .data = &jh7110_aon_config },
-#if 0
 	{ .compat = "starfive,jh7110-ispcrg", .data = &jh7110_isp_config },
-#endif
 	{ .compat = "starfive,jh7110-stgcrg", .data = &jh7110_stg_config },
 	{ .compat = "starfive,jh7110-voutcrg", .data = &jh7110_vout_config },
 	DEVICE_COMPAT_EOL
 };
 
-
 #define RD4(sc, reg)			\
 	bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
 #define WR4(sc, reg, val)		\
 	bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
 
-
 static struct clk *
 jh7110_clkc_clock_decode(device_t dev, int phandle, const void *data,
 size_t len)
 {
 	struct jh71x0_clkc_softc * const sc = device_private(dev);
 
-	if (len != 4) {
+	if (len != sizeof(uint32_t))
 		return NULL;
-	}
 
 	u_int id = be32dec(data);
 	if (id >= sc->sc_nclks) {
@@ -978,14 +970,16 @@ jh7110_clkc_attach(device_t parent, devi
 	aprint_normal(": JH7110 %s Clock and Reset Generator\n",
 	jhc->jhc_name);
 
-	for (size_t id = 0; id < sc->sc_nclks; id++) {
-		if (sc->sc_clk[id].jcc_type == JH71X0CLK_UNKNOWN)
-			continue;
-
-		struct clk * const clk = &sc->sc_clk[id].jcc_clk;
-
-		aprint_debug_dev(self, "id %zu [%s]: %u Hz\n", id,
-		clk->name ? clk->name : "", clk_get_rate(clk));
+	if (jhc->jhc_debug) {
+		for (size_t id = 0; id < sc->sc_nclks; id++) {
+			if (sc->sc_clk[id].jcc_type == JH71X0CLK_UNKNOWN)
+continue;
+
+			struct clk * const clk = &sc->sc_clk[id].jcc_clk;
+
+			aprint_debug_dev(self, "id %zu [%s]: %u Hz\n", id,
+			clk->name ? clk->name : "", clk_get_rate(clk));
+		}
 	}
 
 	fdtbus_register_clock_controller(self, phandle, &jh7110_clkc_fdtclock_funcs);



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

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 10:33:36 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7110_clkc.c

Log Message:
Match "Image-Signal-Process" clock controller and only aprint_debug the
state of "System" and "Always-On" clocks.


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

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 08:31:50 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7100_clkc.c jh7100_pinctrl.c
jh7110_clkc.c jh71x0_clkc.c jh71x0_usb.c

Log Message:
#define consistency


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/starfive/jh7100_clkc.c \
src/sys/arch/riscv/starfive/jh71x0_clkc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/starfive/jh7100_pinctrl.c \
src/sys/arch/riscv/starfive/jh7110_clkc.c \
src/sys/arch/riscv/starfive/jh71x0_usb.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/starfive/jh7100_clkc.c
diff -u src/sys/arch/riscv/starfive/jh7100_clkc.c:1.3 src/sys/arch/riscv/starfive/jh7100_clkc.c:1.4
--- src/sys/arch/riscv/starfive/jh7100_clkc.c:1.3	Sat Jul 27 07:09:50 2024
+++ src/sys/arch/riscv/starfive/jh7100_clkc.c	Wed Sep 18 08:31:50 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: jh7100_clkc.c,v 1.3 2024/07/27 07:09:50 skrll Exp $ */
+/* $NetBSD: jh7100_clkc.c,v 1.4 2024/09/18 08:31:50 skrll Exp $ */
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jh7100_clkc.c,v 1.3 2024/07/27 07:09:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jh7100_clkc.c,v 1.4 2024/09/18 08:31:50 skrll Exp $");
 
 #include 
 
@@ -44,94 +44,94 @@ __KERNEL_RCSID(0, "$NetBSD: jh7100_clkc.
 #include 
 
 
-#define	JH7100_CLK_CPUNDBUS_ROOT	0
-#define	JH7100_CLK_DSP_ROOT		2
-#define	JH7100_CLK_GMACUSB_ROOT		3
-#define	JH7100_CLK_PERH0_ROOT		4
-#define	JH7100_CLK_PERH1_ROOT		5
-#define	JH7100_CLK_VOUT_ROOT		7
-#define	JH7100_CLK_AUDIO_ROOT		8
-#define	JH7100_CLK_VOUTBUS_ROOT		11
-#define	JH7100_CLK_CPUNBUS_ROOT_DIV	12
-#define	JH7100_CLK_DSP_ROOT_DIV		13
-#define	JH7100_CLK_PERH0_SRC		14
-#define	JH7100_CLK_PERH1_SRC		15
-#define	JH7100_CLK_PLL2_REF		19
-#define	JH7100_CLK_CPU_CORE		20
-#define	JH7100_CLK_CPU_AXI		21
-#define	JH7100_CLK_AHB_BUS		22
-#define	JH7100_CLK_APB1_BUS		23
-#define	JH7100_CLK_APB2_BUS		24
-#define	JH7100_CLK_DOM7AHB_BUS		26
-#define	JH7100_CLK_SGDMA2P_AXI		31
-#define	JH7100_CLK_SGDMA2P_AHB		33
-#define	JH7100_CLK_VP6_CORE		38
-#define	JH7100_CLK_JPEG_APB		50
-#define	JH7100_CLK_SGDMA1P_BUS		84
-#define	JH7100_CLK_SGDMA1P_AXI		85
-#define	JH7100_CLK_AUDIO_DIV		95
-#define	JH7100_CLK_AUDIO_SRC		96
-#define	JH7100_CLK_AUDIO_12288		97
-#define	JH7100_CLK_VOUT_SRC		109
-#define	JH7100_CLK_DISPBUS_SRC		110
-#define	JH7100_CLK_DISP_BUS		111
-#define	JH7100_CLK_DISP_AXI		112
-#define	JH7100_CLK_SDIO0_AHB		114
-#define	JH7100_CLK_SDIO0_CCLKINT	115
-#define	JH7100_CLK_SDIO0_CCLKINT_INV	116
-#define	JH7100_CLK_SDIO1_AHB		117
-#define	JH7100_CLK_SDIO1_CCLKINT	118
-#define	JH7100_CLK_SDIO1_CCLKINT_INV	119
-#define	JH7100_CLK_GMAC_AHB		120
-#define	JH7100_CLK_GMAC_ROOT_DIV	121
-#define	JH7100_CLK_GMAC_PTP_REF		122
-#define	JH7100_CLK_GMAC_GTX		123
-#define	JH7100_CLK_GMAC_RMII_TX		124
-#define	JH7100_CLK_GMAC_RMII_RX		125
-#define	JH7100_CLK_GMAC_TX		126
-#define	JH7100_CLK_GMAC_TX_INV		127
-#define	JH7100_CLK_GMAC_RX_PRE		128
-#define	JH7100_CLK_GMAC_RX_INV		129
-#define	JH7100_CLK_GMAC_RMII		130
-#define	JH7100_CLK_GMAC_TOPHYREF	131
-#define	JH7100_CLK_QSPI_AHB		137
-#define	JH7100_CLK_SEC_AHB		140
-#define	JH7100_CLK_TRNG_APB		144
-#define	JH7100_CLK_OTP_APB		145
-#define	JH7100_CLK_UART0_APB		146
-#define	JH7100_CLK_UART0_CORE		147
-#define	JH7100_CLK_UART1_APB		148
-#define	JH7100_CLK_UART1_CORE		149
-#define	JH7100_CLK_SPI0_APB		150
-#define	JH7100_CLK_SPI0_CORE		151
-#define	JH7100_CLK_SPI1_APB		152
-#define	JH7100_CLK_SPI1_CORE		153
-#define	JH7100_CLK_I2C0_APB		154
-#define	JH7100_CLK_I2C0_CORE		155
-#define	JH7100_CLK_I2C1_APB		156
-#define	JH7100_CLK_I2C1_CORE		157
-#define	JH7100_CLK_GPIO_APB		158
-#define	JH7100_CLK_UART2_APB		159
-#define	JH7100_CLK_UART2_CORE		160
-#define	JH7100_CLK_UART3_APB		161
-#define	JH7100_CLK_UART3_CORE		162
-#define	JH7100_CLK_SPI2_APB		163
-#define	JH7100_CLK_SPI2_CORE		164
-#define	JH7100_CLK_SPI3_APB		165
-#define	JH7100_CLK_SPI3_CORE		166
-#define	JH7100_CLK_I2C2_APB		167
-#define	JH7100_CLK_I2C2_CORE		168
-#define	JH7100_CLK_I2C3_APB		169
-#define	JH7100_CLK_I2C3_CORE		170
-#define	JH7100_CLK_WDTIMER_APB		171
-#define	JH7100_CLK_WDT_CORE		172
-#define	JH7100_CLK_PWM_APB		181
-
-#define	JH7100_CLK_PLL0_OUT		186
-#define	JH7100_CLK_PLL1_OUT		187
-#define	JH7100_CLK_PLL2_OUT		188
+#define JH7100_CLK_CPUNDBUS_ROOT	0
+#define JH7100_CLK_DSP_ROOT		2
+#define JH7100_CLK_GMACUSB_ROOT		3
+#define JH7100_CLK_PERH0_ROOT		4
+#define JH7100_CLK_PERH1_ROOT		5
+#define JH7100_CLK_VOUT_ROOT		7
+#define JH7100_CLK_AUDIO_ROOT		8
+#define JH7100_CLK_VOUTBUS_ROOT		11
+#define JH7100_CLK_CPUNBUS_ROOT_DIV	12
+#define JH7100_CLK_DSP_ROOT_DIV		13
+#define JH7100_CLK_PERH0_SRC		14
+#define JH7100_CLK_PERH1_SRC		15
+#define JH7100_CLK_PLL2_REF		19
+#define JH7100_CLK_CPU_CORE		20
+#define JH7100_CLK_C

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

2024-09-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 18 08:31:50 UTC 2024

Modified Files:
src/sys/arch/riscv/starfive: jh7100_clkc.c jh7100_pinctrl.c
jh7110_clkc.c jh71x0_clkc.c jh71x0_usb.c

Log Message:
#define consistency


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/starfive/jh7100_clkc.c \
src/sys/arch/riscv/starfive/jh71x0_clkc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/starfive/jh7100_pinctrl.c \
src/sys/arch/riscv/starfive/jh7110_clkc.c \
src/sys/arch/riscv/starfive/jh71x0_usb.c

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

2024-09-17 Thread Rin Okuyama

Thank you very much for kind & rapid response!!

rin

On 2024/09/18 10:34, Nathanial Sloss wrote:

Module Name:src
Committed By:   nat
Date:   Wed Sep 18 01:34:08 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
The delay is only required for machines with built-in floppy drives.

I doubt the vibration from an external drive on the Duos would affect adb
before it attaches.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mac68k/dev/adb.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/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.61 src/sys/arch/mac68k/dev/adb.c:1.62
--- src/sys/arch/mac68k/dev/adb.c:1.61  Wed Sep 18 01:29:02 2024
+++ src/sys/arch/mac68k/dev/adb.c   Wed Sep 18 01:34:08 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $ */
+/* $NetBSD: adb.c,v 1.62 2024/09/18 01:34:08 nat Exp $ */
  
  /*

   * Copyright (C) 1994 Bradley A. Grantham
@@ -26,7 +26,7 @@
   */
  
  #include 

-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.62 2024/09/18 01:34:08 nat Exp $");
  
  #include "opt_adb.h"
  
@@ -104,12 +104,6 @@ adbattach(device_t parent, device_t self

case MACH_MACPB180:
case MACH_MACPB180C:
case MACH_MACPB150:
-   case MACH_MACPB210:
-   case MACH_MACPB230:
-   case MACH_MACPB250:
-   case MACH_MACPB270:
-   case MACH_MACPB280:
-   case MACH_MACPB280C:
/* Reqired on machines with in-built trackballs. */
printf("...  Waiting 5 seconds for adb devices to "
 "settle.");





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

2024-09-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Sep 18 01:34:08 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
The delay is only required for machines with built-in floppy drives.

I doubt the vibration from an external drive on the Duos would affect adb
before it attaches.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mac68k/dev/adb.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/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.61 src/sys/arch/mac68k/dev/adb.c:1.62
--- src/sys/arch/mac68k/dev/adb.c:1.61	Wed Sep 18 01:29:02 2024
+++ src/sys/arch/mac68k/dev/adb.c	Wed Sep 18 01:34:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $	*/
+/*	$NetBSD: adb.c,v 1.62 2024/09/18 01:34:08 nat Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.62 2024/09/18 01:34:08 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -104,12 +104,6 @@ adbattach(device_t parent, device_t self
 		case MACH_MACPB180:
 		case MACH_MACPB180C:
 		case MACH_MACPB150:
-		case MACH_MACPB210:
-		case MACH_MACPB230:
-		case MACH_MACPB250:
-		case MACH_MACPB270:
-		case MACH_MACPB280:
-		case MACH_MACPB280C:
 			/* Reqired on machines with in-built trackballs. */
 			printf("...  Waiting 5 seconds for adb devices to "
 			 "settle.");



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

2024-09-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Sep 18 01:34:08 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
The delay is only required for machines with built-in floppy drives.

I doubt the vibration from an external drive on the Duos would affect adb
before it attaches.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mac68k/dev/adb.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/dev

2024-09-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Sep 18 01:29:02 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
Use attach delay only on affected machines.

It is only required for machines with built-in trackballs.

Requested by rin@.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/mac68k/dev/adb.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/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.60 src/sys/arch/mac68k/dev/adb.c:1.61
--- src/sys/arch/mac68k/dev/adb.c:1.60	Sat Sep 14 20:56:50 2024
+++ src/sys/arch/mac68k/dev/adb.c	Wed Sep 18 01:29:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb.c,v 1.60 2024/09/14 20:56:50 nat Exp $	*/
+/*	$NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.60 2024/09/14 20:56:50 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.61 2024/09/18 01:29:02 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -94,8 +94,30 @@ static void
 adbattach(device_t parent, device_t self, void *aux)
 {
 
-	printf("...  Waiting 5 seconds for adb devices to settle.");
-	kpause("adb-slp", false, mstohz(5000), NULL);
+	switch (mac68k_machine.machineid) {
+		case MACH_MACPB140:
+		case MACH_MACPB145:
+		case MACH_MACPB160:
+		case MACH_MACPB165:
+		case MACH_MACPB165C:
+		case MACH_MACPB170:
+		case MACH_MACPB180:
+		case MACH_MACPB180C:
+		case MACH_MACPB150:
+		case MACH_MACPB210:
+		case MACH_MACPB230:
+		case MACH_MACPB250:
+		case MACH_MACPB270:
+		case MACH_MACPB280:
+		case MACH_MACPB280C:
+			/* Reqired on machines with in-built trackballs. */
+			printf("...  Waiting 5 seconds for adb devices to "
+			 "settle.");
+			kpause("adb-slp", false, mstohz(5000), NULL);
+			break;
+		default:
+			break;
+	}
 
 	adb_softintr_cookie = softint_establish(SOFTINT_SERIAL,
 	(void (*)(void *))adb_soft_intr, NULL);



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

2024-09-17 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Sep 18 01:29:02 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
Use attach delay only on affected machines.

It is only required for machines with built-in trackballs.

Requested by rin@.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/mac68k/dev/adb.c

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

2024-09-17 Thread Rin Okuyama

Hi,

Can you please localize this quirk only for the affected machines?
It seems too much to me, to have 5 sec delay for irrelevant machines.

Thanks,
rin

On 2024/09/15 5:56, Nathanial Sloss wrote:

Module Name:src
Committed By:   nat
Date:   Sat Sep 14 20:56:51 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
Allow a few seconds for adb devices to settle.

The spin up of the floppy drive motor would cause a crash on my PowerBook
when adb was attached.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/dev/adb.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/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.59 src/sys/arch/mac68k/dev/adb.c:1.60
--- src/sys/arch/mac68k/dev/adb.c:1.59  Sat Aug  7 16:18:57 2021
+++ src/sys/arch/mac68k/dev/adb.c   Sat Sep 14 20:56:50 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: adb.c,v 1.59 2021/08/07 16:18:57 thorpej Exp $ */
+/* $NetBSD: adb.c,v 1.60 2024/09/14 20:56:50 nat Exp $ */
  
  /*

   * Copyright (C) 1994 Bradley A. Grantham
@@ -26,7 +26,7 @@
   */
  
  #include 

-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.59 2021/08/07 16:18:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.60 2024/09/14 20:56:50 nat Exp $");
  
  #include "opt_adb.h"
  
@@ -94,6 +94,9 @@ static void

  adbattach(device_t parent, device_t self, void *aux)
  {
  
+	printf("...  Waiting 5 seconds for adb devices to settle.");

+   kpause("adb-slp", false, mstohz(5000), NULL);
+
adb_softintr_cookie = softint_establish(SOFTINT_SERIAL,
(void (*)(void *))adb_soft_intr, NULL);
printf("\n");





CVS commit: src/sys/arch/i386/stand/lib

2024-09-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 00:44:03 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
i386/stand: Remove XMS leftover from libi386.h, NFC

PR port-i386/58624


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/libi386.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/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.53 src/sys/arch/i386/stand/lib/libi386.h:1.54
--- src/sys/arch/i386/stand/lib/libi386.h:1.53	Sat Jun 29 13:46:40 2024
+++ src/sys/arch/i386/stand/lib/libi386.h	Wed Sep 18 00:44:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.53 2024/06/29 13:46:40 rin Exp $	*/
+/*	$NetBSD: libi386.h,v 1.54 2024/09/18 00:44:03 rin Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -98,12 +98,6 @@ struct multiboot_package *probe_multiboo
 /* this is in "user code"! */
 int parsebootfile(const char *, char **, char **, int *, int *, const char **);
 
-#ifdef XMS
-physaddr_t ppbcopy(physaddr_t, physaddr_t, int);
-int checkxms(void);
-physaddr_t xmsalloc(int);
-#endif
-
 /* parseutils.c */
 char *gettrailer(char *);
 int parseopts(const char *, int *);



CVS commit: src/sys/arch/i386/stand/lib

2024-09-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Sep 18 00:44:03 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
i386/stand: Remove XMS leftover from libi386.h, NFC

PR port-i386/58624


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/libi386.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/evbppc/conf

2024-09-17 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Sep 17 13:47:30 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: WII

Log Message:
Add DKWEDGE_AUTODISCOVER and DKWEDGE_METHOD_GPT to WII

>From Guilherme Janczak in PR 58676


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/conf/WII

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



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

2024-09-17 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Sep 17 13:47:30 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: WII

Log Message:
Add DKWEDGE_AUTODISCOVER and DKWEDGE_METHOD_GPT to WII

>From Guilherme Janczak in PR 58676


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/conf/WII

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/evbppc/conf/WII
diff -u src/sys/arch/evbppc/conf/WII:1.4 src/sys/arch/evbppc/conf/WII:1.5
--- src/sys/arch/evbppc/conf/WII:1.4	Thu Jan 25 11:47:53 2024
+++ src/sys/arch/evbppc/conf/WII	Tue Sep 17 13:47:30 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: WII,v 1.4 2024/01/25 11:47:53 jmcneill Exp $
+#	$NetBSD: WII,v 1.5 2024/09/17 13:47:30 jakllsch Exp $
 #
 #	Nintendo Wii
 #
@@ -46,6 +46,10 @@ makeoptions DEBUG="-g"	# compile full sy
 include 	"conf/compat_netbsd50.config"
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



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

2024-09-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Sep 16 23:37:13 UTC 2024

Modified Files:
src/sys/arch/arm/sunxi: sunxi_ccu.h

Log Message:
set CLK_SET_RATE_PARENT for mux type clocks so clk_set_rate() can work
with this my pinebook can change cpu speed again
ok jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/sunxi/sunxi_ccu.h

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_ccu.h
diff -u src/sys/arch/arm/sunxi/sunxi_ccu.h:1.23 src/sys/arch/arm/sunxi/sunxi_ccu.h:1.24
--- src/sys/arch/arm/sunxi/sunxi_ccu.h:1.23	Sun Nov  7 17:13:12 2021
+++ src/sys/arch/arm/sunxi/sunxi_ccu.h	Mon Sep 16 23:37:13 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.h,v 1.23 2021/11/07 17:13:12 jmcneill Exp $ */
+/* $NetBSD: sunxi_ccu.h,v 1.24 2024/09/16 23:37:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -432,6 +432,7 @@ const char *sunxi_ccu_mux_get_parent(str
 	[_id] = {		\
 		.type = SUNXI_CCU_MUX,\
 		.base.name = (_name),\
+		.base.flags = CLK_SET_RATE_PARENT,		\
 		.u.mux.reg = (_reg),\
 		.u.mux.parents = (_parents),			\
 		.u.mux.nparents = __arraycount(_parents),	\



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

2024-09-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Sep 16 23:37:13 UTC 2024

Modified Files:
src/sys/arch/arm/sunxi: sunxi_ccu.h

Log Message:
set CLK_SET_RATE_PARENT for mux type clocks so clk_set_rate() can work
with this my pinebook can change cpu speed again
ok jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/sunxi/sunxi_ccu.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/x86/x86

2024-09-16 Thread Valery Ushakov
On Wed, Sep 11, 2024 at 05:17:45 +, matthew green wrote:

> Module Name:  src
> Committed By: mrg
> Date: Wed Sep 11 05:17:45 UTC 2024
> 
> Modified Files:
>   src/sys/arch/x86/x86: intr.c
> 
> Log Message:
> apply some more diagnostic checks for x86 interrupts

How does this mix with KDTRACE_HOOKS?  To paraphrase:

#define IS_I8254_CLOCKINTR \
(handler == __FPTRCAST(int (*)(void *), i8254_clockintr))

#ifdef KDTRACE_HOOKS
if (!IS_I8254_CLOCKINTR) {
ih->ih_fun = intr_kdtrace_wrapper;
ih->ih_arg = ih;
}
#endif
#ifdef MULTIPROCESSOR
if (!mpsafe) {
KASSERT(!IS_I8254_CLOCKINTR);
ih->ih_fun = intr_biglock_wrapper;
ih->ih_arg = ih;
}
#ifdef DIAGNOSTIC   /* wrap all interrupts */
else if (!IS_I8254_CLOCKINTR) {
ih->ih_fun = intr_wrapper;
ih->ih_arg = ih;
}
#endif
#endif /* MULTIPROCESSOR */

and MULTIPROCESSOR case overwrites whatever KDTRACE_HOOKS did, doesn't
it?

-uwe


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

2024-09-15 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Sep 15 19:19:58 UTC 2024

Modified Files:
src/sys/arch/sparc/conf: KRUPS

Log Message:
sparc/conf/KRUPS: sync with GENERIC clean up

Not much to do to actually sync it, as changes done to GENERIC were
also applied to KRUPS, but update the GENERIC version we are supposed
to be in sync with.

While here, comment out most of the more exotic file-system and all
verbose options.

Leave the wsconf section as is.  The one in GENERIC is messy and is
not in sync with other wsons ports.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sparc/conf/KRUPS

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/conf/KRUPS
diff -u src/sys/arch/sparc/conf/KRUPS:1.81 src/sys/arch/sparc/conf/KRUPS:1.82
--- src/sys/arch/sparc/conf/KRUPS:1.81	Fri Apr 26 22:46:04 2019
+++ src/sys/arch/sparc/conf/KRUPS	Sun Sep 15 19:19:58 2024
@@ -1,5 +1,5 @@
-# $NetBSD: KRUPS,v 1.81 2019/04/26 22:46:04 sevan Exp $
-# From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
+# $NetBSD: KRUPS,v 1.82 2024/09/15 19:19:58 uwe Exp $
+# From  NetBSD: GENERIC,v 1.273 2023/02/12 14:50:41 abs Exp
 #
 # Krups (JavaStation-NC) machine description file
 #
@@ -8,7 +8,7 @@ include 	"arch/sparc/conf/std.sparc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"KRUPS-$Revision: 1.81 $"
+#ident 		"KRUPS-$Revision: 1.82 $"
 
 maxusers	32
 
@@ -55,7 +55,10 @@ options 	SYSVSEM		# System V semaphores
 #options 	SEMUME=10	# max number of undo entries per process
 #options 	SEMMNU=30	# number of undo structures in system
 options 	SYSVSHM		# System V shared memory
+#options 	SHMMAXPGS=1024	# default is max(%25 physmem, 1024 pages)
 
+options 	MODULAR		# new style module(7) framework
+options 	MODULAR_DEFAULT_AUTOLOAD
 #options 	USERCONF	# userconf(4) support
 #options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
@@ -143,7 +146,7 @@ makeoptions	CPUFLAGS="-mcpu=supersparc"
 #options 	LOCKDEBUG
 #options 	SYSCALL_DEBUG
 
-options 	MIIVERBOSE	# verbose PHY autoconfig messages
+#options 	MIIVERBOSE	# verbose PHY autoconfig messages
 
 ## `INSECURE' turns off the kernel security level (securelevel = 0 always).
 ## This allows writing to /dev/mem, loading kernel modules while multi-user,
@@ -167,19 +170,19 @@ include 	"conf/compat_netbsd10.config"
 options 	COMPAT_SUNOS	# SunOS 4.x binary compatibility
 
 ## File systems.  You probably need at least one of FFS or NFS.
-file-system	FFS		# Berkeley Fast Filesystem
+#file-system	FFS		# Berkeley Fast Filesystem
 file-system	NFS		# Sun NFS-compatible filesystem client
 file-system	KERNFS		# kernel data-structure filesystem
-file-system	NULLFS		# NULL layered filesystem
-file-system 	OVERLAY		# overlay file system
-file-system	MFS		# memory-based filesystem
-file-system	FDESC		# user file descriptor filesystem
-file-system	UMAPFS		# uid/gid remapping filesystem
+#file-system	NULLFS		# NULL layered filesystem
+#file-system 	OVERLAY		# overlay file system
+#file-system	MFS		# memory-based filesystem
+#file-system	FDESC		# user file descriptor filesystem
+#file-system	UMAPFS		# uid/gid remapping filesystem
 #file-system	LFS		# Log-based filesystem (still experimental)
 file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
 file-system	PROCFS		# /proc
 #file-system	CD9660		# ISO 9660 + Rock Ridge file system
-file-system	UNION		# union file system
+#file-system	UNION		# union file system
 #file-system	MSDOSFS		# MS-DOS FAT filesystem(s).
 #file-system	CODA		# Coda File System; also needs vcoda (below)
 file-system	PTYFS		# /dev/pts/N support
@@ -220,7 +223,7 @@ msiiep0	at mainbus0	# microSPARC-IIep PC
 
 mspcic0	at msiiep0	# PCI tree
 pci0	at mspcic0
-options 	PCIVERBOSE
+#options 	PCIVERBOSE
 #options 	PCI_CONFIG_DUMP	# hangs reading IGA1682 config past offset 64
 
 ebus*	at pci?	dev ? function ?		# ebus devices
@@ -245,13 +248,13 @@ com*	at ebus?
 ## A disk-like interface to files.  Can be used to create floppy, CD,
 ## miniroot images, etc.
 
-#pseudo-device	vnd	
+#pseudo-device	vnd
 #options 	VND_COMPRESSION		# compressed vnd(4)
 
 ## Memory disk device, used on boot floppies with compressed
 ## kernel-plus-root-disk images.
 
-#pseudo-device	md	
+#pseudo-device	md
 
 
  Network interfaces
@@ -266,17 +269,17 @@ qsphy*		at mii? phy ?		# Quality Semicon
 pseudo-device	loop
 
 ## SLIP and CSLIP interfaces, for IP over a serial line.
-#pseudo-device	sl		
+#pseudo-device	sl
 
 ## PPP, the successor to SLIP.  See pppd(8).
-#pseudo-device	ppp		
+#pseudo-device	ppp
 
 ## PPP over Ethernet (RFC 2516)
 #pseudo-device	pppoe
 
 ## Network "tunnel" device, allowing protocol stacks to run in the userland.
 ## This is used by the third-party user-mode "ppp" program, and others.
-#pseudo-device	tun		
+#pseudo-device	tun
 #pseudo-devi

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

2024-09-15 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Sep 15 19:19:58 UTC 2024

Modified Files:
src/sys/arch/sparc/conf: KRUPS

Log Message:
sparc/conf/KRUPS: sync with GENERIC clean up

Not much to do to actually sync it, as changes done to GENERIC were
also applied to KRUPS, but update the GENERIC version we are supposed
to be in sync with.

While here, comment out most of the more exotic file-system and all
verbose options.

Leave the wsconf section as is.  The one in GENERIC is messy and is
not in sync with other wsons ports.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sparc/conf/KRUPS

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

2024-09-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Sep 15 19:08:34 UTC 2024

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
remove DIAGNOSTIC guard around ipl definition in e500_extintr().

It is used only for KASSERTMSG() only in this method, but still expects it
to exist, even if DIAGNOSTIC is not enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.48 src/sys/arch/powerpc/booke/e500_intr.c:1.49
--- src/sys/arch/powerpc/booke/e500_intr.c:1.48	Sun Sep  8 10:16:04 2024
+++ src/sys/arch/powerpc/booke/e500_intr.c	Sun Sep 15 19:08:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.48 2024/09/08 10:16:04 andvar Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.49 2024/09/15 19:08:34 andvar Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.48 2024/09/08 10:16:04 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.49 2024/09/15 19:08:34 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mpc85xx.h"
@@ -982,9 +982,7 @@ e500_extintr(struct trapframe *tf)
 			__func__, tf, __LINE__, old_ipl, 
 			15 - IPL_HIGH, openpic_read(cpu, OPENPIC_CTPR));
 		const uint32_t iack = openpic_read(cpu, OPENPIC_IACK);
-#ifdef DIAGNOSTIC
 		const int ipl = iack & 0xf;
-#endif
 		const int irq = (iack >> 4) - 1;
 #if 0
 		printf("%s: iack=%d ipl=%d irq=%d <%s>\n",



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

2024-09-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Sep 15 19:08:34 UTC 2024

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
remove DIAGNOSTIC guard around ipl definition in e500_extintr().

It is used only for KASSERTMSG() only in this method, but still expects it
to exist, even if DIAGNOSTIC is not enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/booke/e500_intr.c

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



CVS commit: src/sys/net

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 09:46:45 UTC 2024

Modified Files:
src/sys/net: if_gif.c

Log Message:
Drop locks before freeing unreferenced memory in gif_set_tunnel


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/net/if_gif.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/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.158 src/sys/net/if_gif.c:1.159
--- src/sys/net/if_gif.c:1.158	Sat Feb 10 18:43:53 2024
+++ src/sys/net/if_gif.c	Sun Sep 15 09:46:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.158 2024/02/10 18:43:53 andvar Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.159 2024/09/15 09:46:45 skrll Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.158 2024/02/10 18:43:53 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.159 2024/09/15 09:46:45 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1160,12 +1160,13 @@ gif_set_tunnel(struct ifnet *ifp, struct
 	return 0;
 
  out:
+	mutex_exit(&sc->gif_lock);
+	encap_lock_exit();
+
 	sockaddr_free(nsrc);
 	sockaddr_free(ndst);
 	kmem_free(nvar, sizeof(*nvar));
 
-	mutex_exit(&sc->gif_lock);
-	encap_lock_exit();
 #ifndef GIF_MPSAFE
 	splx(s);
 #endif



CVS commit: src/sys/net

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 09:46:45 UTC 2024

Modified Files:
src/sys/net: if_gif.c

Log Message:
Drop locks before freeing unreferenced memory in gif_set_tunnel


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/net/if_gif.c

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



CVS commit: src/sys/net

2024-09-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Sep 15 08:33:13 UTC 2024

Modified Files:
src/sys/net: ether_sw_offload.c

Log Message:
s/chanks/chunks/ and s/chekcsum/checksum/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/net/ether_sw_offload.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/net/ether_sw_offload.c
diff -u src/sys/net/ether_sw_offload.c:1.8 src/sys/net/ether_sw_offload.c:1.9
--- src/sys/net/ether_sw_offload.c:1.8	Fri Sep  3 21:55:00 2021
+++ src/sys/net/ether_sw_offload.c	Sun Sep 15 08:33:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ether_sw_offload.c,v 1.8 2021/09/03 21:55:00 andvar Exp $	*/
+/*	$NetBSD: ether_sw_offload.c,v 1.9 2024/09/15 08:33:13 andvar Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ether_sw_offload.c,v 1.8 2021/09/03 21:55:00 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ether_sw_offload.c,v 1.9 2024/09/15 08:33:13 andvar Exp $");
 
 #include 
 #include 
@@ -69,7 +69,7 @@ static struct timeval eso_err_lasttime;
 
 /*
  * Handle TX offload in software. For TSO, split the packet into
- * chanks with payloads of size MSS. For chekcsum offload, update
+ * chunks with payloads of size MSS. For checksum offload, update
  * required checksum fields. The results are more than one packet
  * in general. Return a mbuf queue consists of them.
  */



CVS commit: src/sys/net

2024-09-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Sep 15 08:33:13 UTC 2024

Modified Files:
src/sys/net: ether_sw_offload.c

Log Message:
s/chanks/chunks/ and s/chekcsum/checksum/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/net/ether_sw_offload.c

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



CVS commit: src/sys/dev

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 08:30:01 UTC 2024

Modified Files:
src/sys/dev/acpi: genet_acpi.c
src/sys/dev/fdt: genet_fdt.c

Log Message:
genet(4): Remove the non-MP-safe scaffolding...

I forgot two files in the previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/acpi/genet_acpi.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/genet_fdt.c

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

Modified files:

Index: src/sys/dev/acpi/genet_acpi.c
diff -u src/sys/dev/acpi/genet_acpi.c:1.5 src/sys/dev/acpi/genet_acpi.c:1.6
--- src/sys/dev/acpi/genet_acpi.c:1.5	Mon May  3 10:28:26 2021
+++ src/sys/dev/acpi/genet_acpi.c	Sun Sep 15 08:30:01 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: genet_acpi.c,v 1.5 2021/05/03 10:28:26 rin Exp $ */
+/* $NetBSD: genet_acpi.c,v 1.6 2024/09/15 08:30:01 skrll Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill 
@@ -26,10 +26,8 @@
  * SUCH DAMAGE.
  */
 
-#include "opt_net_mpsafe.h"
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genet_acpi.c,v 1.5 2021/05/03 10:28:26 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genet_acpi.c,v 1.6 2024/09/15 08:30:01 skrll Exp $");
 
 #include 
 #include 
@@ -51,12 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: genet_acpi.c
 #include 
 #include 
 
-#ifdef NET_MPSAFE
-#define	GENET_INTR_MPSAFE	true
-#else
-#define	GENET_INTR_MPSAFE	false
-#endif
-
 static const struct device_compatible_entry compat_data[] = {
 	{ .compat = "BCM6E4E" },	/* Broadcom GENET v5 */
 	DEVICE_COMPAT_EOL
@@ -144,7 +136,7 @@ genet_acpi_attach(device_t parent, devic
 		goto done;
 
 ih = acpi_intr_establish(self, (uint64_t)(uintptr_t)handle, IPL_NET,
-	GENET_INTR_MPSAFE, genet_intr, sc, device_xname(self));
+	true, genet_intr, sc, device_xname(self));
 	if (ih == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt\n");
 		goto done;

Index: src/sys/dev/fdt/genet_fdt.c
diff -u src/sys/dev/fdt/genet_fdt.c:1.6 src/sys/dev/fdt/genet_fdt.c:1.7
--- src/sys/dev/fdt/genet_fdt.c:1.6	Mon May  3 10:28:26 2021
+++ src/sys/dev/fdt/genet_fdt.c	Sun Sep 15 08:30:01 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: genet_fdt.c,v 1.6 2021/05/03 10:28:26 rin Exp $ */
+/* $NetBSD: genet_fdt.c,v 1.7 2024/09/15 08:30:01 skrll Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill 
@@ -26,10 +26,8 @@
  * SUCH DAMAGE.
  */
 
-#include "opt_net_mpsafe.h"
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.6 2021/05/03 10:28:26 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.7 2024/09/15 08:30:01 skrll Exp $");
 
 #include 
 #include 
@@ -51,12 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,
 
 #include 
 
-#ifdef NET_MPSAFE
-#define	FDT_INTR_FLAGS	FDT_INTR_MPSAFE
-#else
-#define	FDT_INTR_FLAGS	0
-#endif
-
 static int	genet_fdt_match(device_t, cfdata_t, void *);
 static void	genet_fdt_attach(device_t, device_t, void *);
 



CVS commit: src/sys/dev

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 08:30:01 UTC 2024

Modified Files:
src/sys/dev/acpi: genet_acpi.c
src/sys/dev/fdt: genet_fdt.c

Log Message:
genet(4): Remove the non-MP-safe scaffolding...

I forgot two files in the previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/acpi/genet_acpi.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/genet_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/dev/ic

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 07:38:08 UTC 2024

Modified Files:
src/sys/dev/ic: bcmgenet.c bcmgenetvar.h

Log Message:
genet(4): Remove the non-MP-safe scaffolding.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/bcmgenet.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/bcmgenetvar.h

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

Modified files:

Index: src/sys/dev/ic/bcmgenet.c
diff -u src/sys/dev/ic/bcmgenet.c:1.19 src/sys/dev/ic/bcmgenet.c:1.20
--- src/sys/dev/ic/bcmgenet.c:1.19	Sun Aug 25 12:38:20 2024
+++ src/sys/dev/ic/bcmgenet.c	Sun Sep 15 07:38:08 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: bcmgenet.c,v 1.19 2024/08/25 12:38:20 mlelstv Exp $ */
+/* $NetBSD: bcmgenet.c,v 1.20 2024/09/15 07:38:08 skrll Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill 
@@ -30,11 +30,10 @@
  * Broadcom GENETv5
  */
 
-#include "opt_net_mpsafe.h"
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.19 2024/08/25 12:38:20 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.20 2024/09/15 07:38:08 skrll Exp $");
 
 #include 
 #include 
@@ -67,13 +66,6 @@ CTASSERT(MCLBYTES == 2048);
 #define	DPRINTF(...)	((void)0)
 #endif
 
-#ifdef NET_MPSAFE
-#define	GENET_MPSAFE		1
-#define	CALLOUT_FLAGS		CALLOUT_MPSAFE
-#else
-#define	CALLOUT_FLAGS		0
-#endif
-
 #define	TX_MAX_SEGS		128
 #define	TX_DESC_COUNT		256 /* GENET_DMA_DESC_COUNT */
 #define	RX_DESC_COUNT		256 /* GENET_DMA_DESC_COUNT */
@@ -84,9 +76,9 @@ CTASSERT(MCLBYTES == 2048);
 #define	TX_NEXT(n)		TX_SKIP(n, 1)
 #define	RX_NEXT(n)		(((n) + 1) % RX_DESC_COUNT)
 
-#define	GENET_LOCK(sc)		mutex_enter(&(sc)->sc_lock)
-#define	GENET_UNLOCK(sc)	mutex_exit(&(sc)->sc_lock)
-#define	GENET_ASSERT_LOCKED(sc)	KASSERT(mutex_owned(&(sc)->sc_lock))
+#define	GENET_LOCK(sc)			mutex_enter(&(sc)->sc_lock)
+#define	GENET_UNLOCK(sc)		mutex_exit(&(sc)->sc_lock)
+#define	GENET_ASSERT_LOCKED(sc)		KASSERT(mutex_owned(&(sc)->sc_lock))
 
 #define	GENET_TXLOCK(sc)		mutex_enter(&(sc)->sc_txlock)
 #define	GENET_TXUNLOCK(sc)		mutex_exit(&(sc)->sc_txlock)
@@ -324,18 +316,12 @@ genet_tick(void *softc)
 {
 	struct genet_softc *sc = softc;
 	struct mii_data *mii = &sc->sc_mii;
-#ifndef GENET_MPSAFE
-	int s = splnet();
-#endif
 
 	GENET_LOCK(sc);
 	mii_tick(mii);
-	callout_schedule(&sc->sc_stat_ch, hz);
+	if (sc->sc_running)
+		callout_schedule(&sc->sc_stat_ch, hz);
 	GENET_UNLOCK(sc);
-
-#ifndef GENET_MPSAFE
-	splx(s);
-#endif
 }
 
 static void
@@ -584,6 +570,7 @@ genet_init_locked(struct genet_softc *sc
 	WR4(sc, GENET_UMAC_MAC1, val);
 
 	/* Setup RX filter */
+	sc->sc_promisc = ifp->if_flags & IFF_PROMISC;
 	genet_setup_rxfilter(sc);
 
 	/* Setup TX/RX rings */
@@ -598,6 +585,10 @@ genet_init_locked(struct genet_softc *sc
 	/* Enable interrupts */
 	genet_enable_intr(sc);
 
+	GENET_ASSERT_TXLOCKED(sc);
+	sc->sc_txrunning = true;
+
+	sc->sc_running = true;
 	ifp->if_flags |= IFF_RUNNING;
 
 	mii_mediachg(mii);
@@ -651,7 +642,12 @@ genet_stop_locked(struct genet_softc *sc
 
 	GENET_ASSERT_LOCKED(sc);
 
-	callout_stop(&sc->sc_stat_ch);
+	GENET_TXLOCK(sc);
+	sc->sc_txrunning = false;
+	GENET_TXUNLOCK(sc);
+
+	sc->sc_running = false;
+	callout_halt(&sc->sc_stat_ch, &sc->sc_lock);
 
 	mii_down(&sc->sc_mii);
 
@@ -824,7 +820,7 @@ genet_start_locked(struct genet_softc *s
 
 	GENET_ASSERT_TXLOCKED(sc);
 
-	if ((ifp->if_flags & IFF_RUNNING) == 0)
+	if (!sc->sc_txrunning)
 		return;
 
 	const int qid = GENET_DMA_DEFAULT_QUEUE;
@@ -904,42 +900,26 @@ static int
 genet_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct genet_softc *sc = ifp->if_softc;
-	int error, s;
+	int error;
 
-#ifndef GENET_MPSAFE
-	s = splnet();
-#endif
+	const int s = splnet();
+	error = ether_ioctl(ifp, cmd, data);
+	splx(s);
 
-	switch (cmd) {
-	default:
-#ifdef GENET_MPSAFE
-		s = splnet();
-#endif
-		error = ether_ioctl(ifp, cmd, data);
-#ifdef GENET_MPSAFE
-		splx(s);
-#endif
-		if (error != ENETRESET)
-			break;
+	if (error != ENETRESET)
+		return error;
 
-		error = 0;
+	error = 0;
 
-		if (cmd == SIOCSIFCAP)
-			error = if_init(ifp);
-		else if (cmd != SIOCADDMULTI && cmd != SIOCDELMULTI)
-			;
-		else if ((ifp->if_flags & IFF_RUNNING) != 0) {
-			GENET_LOCK(sc);
+	if (cmd == SIOCSIFCAP)
+		error = if_init(ifp);
+	else if (cmd == SIOCADDMULTI || cmd == SIOCDELMULTI) {
+		GENET_LOCK(sc);
+		sc->sc_promisc = ifp->if_flags & IFF_PROMISC;
+		if (sc->sc_running)
 			genet_setup_rxfilter(sc);
-			GENET_UNLOCK(sc);
-		}
-		break;
+		GENET_UNLOCK(sc);
 	}
-
-#ifndef GENET_MPSAFE
-	splx(s);
-#endif
-
 	return error;
 }
 
@@ -1082,7 +1062,7 @@ genet_attach(struct genet_softc *sc)
 
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NET);
 	mutex_init(&sc->sc_txlock, MUTEX_DEFAULT, IPL_NET);
-	callout_init(&sc->sc_stat_ch, CALLOUT_FLAGS);
+	callout_init(&sc->sc_stat_ch, CALLOUT_MPSAFE);
 	callout_setfunc(&sc->sc_stat_ch, genet_tick, sc);
 
 	genet_get_eaddr(sc, eaddr);
@@ -1101,9

CVS commit: src/sys/dev/ic

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 07:38:08 UTC 2024

Modified Files:
src/sys/dev/ic: bcmgenet.c bcmgenetvar.h

Log Message:
genet(4): Remove the non-MP-safe scaffolding.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/bcmgenet.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/bcmgenetvar.h

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



CVS commit: src/sys/dev/ic

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 07:33:33 UTC 2024

Modified Files:
src/sys/dev/ic: dwc_eqos_var.h

Log Message:
Remove unused struct eqos_softc member


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/dwc_eqos_var.h

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



CVS commit: src/sys/dev/ic

2024-09-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 15 07:33:33 UTC 2024

Modified Files:
src/sys/dev/ic: dwc_eqos_var.h

Log Message:
Remove unused struct eqos_softc member


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/dwc_eqos_var.h

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

Modified files:

Index: src/sys/dev/ic/dwc_eqos_var.h
diff -u src/sys/dev/ic/dwc_eqos_var.h:1.9 src/sys/dev/ic/dwc_eqos_var.h:1.10
--- src/sys/dev/ic/dwc_eqos_var.h:1.9	Thu Nov  2 13:50:02 2023
+++ src/sys/dev/ic/dwc_eqos_var.h	Sun Sep 15 07:33:33 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos_var.h,v 1.9 2023/11/02 13:50:02 riastradh Exp $ */
+/* $NetBSD: dwc_eqos_var.h,v 1.10 2024/09/15 07:33:33 skrll Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -73,7 +73,6 @@ struct eqos_softc {
 	bool			sc_running;
 	bool			sc_txrunning;
 	bool			sc_promisc;
-	bool			sc_allmulti;
 
 	struct eqos_ring	sc_tx;
 	struct eqos_ring	sc_rx;



CVS commit: src/sys/arch/macppc/stand/installboot

2024-09-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 15 04:05:32 UTC 2024

Modified Files:
src/sys/arch/macppc/stand/installboot: Makefile

Log Message:
Add a comment this MD installboot(8) should be merged into MI one.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/macppc/stand/installboot/Makefile

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



CVS commit: src/sys/arch/macppc/stand/installboot

2024-09-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Sep 15 04:05:32 UTC 2024

Modified Files:
src/sys/arch/macppc/stand/installboot: Makefile

Log Message:
Add a comment this MD installboot(8) should be merged into MI one.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/macppc/stand/installboot/Makefile

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

Modified files:

Index: src/sys/arch/macppc/stand/installboot/Makefile
diff -u src/sys/arch/macppc/stand/installboot/Makefile:1.5 src/sys/arch/macppc/stand/installboot/Makefile:1.6
--- src/sys/arch/macppc/stand/installboot/Makefile:1.5	Sun Sep 15 03:56:57 2024
+++ src/sys/arch/macppc/stand/installboot/Makefile	Sun Sep 15 04:05:32 2024
@@ -1,4 +1,14 @@
-#	$NetBSD: Makefile,v 1.5 2024/09/15 03:56:57 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.6 2024/09/15 04:05:32 tsutsui Exp $
+
+# XXX
+# This installboot(8) tool for macppc is prepared to handle quirks on
+# creating bootable ISO using mkhybrid(8) for OpenFirmware 1.x and 2.x
+# machines that require "bootable partition" info the Apple Partition map
+# entry even on HFS/ISO9660 hybrid images.
+#
+# This should be merge into MI installboot(8) once after we have proper
+# defintitions how Apple Partition Map should be handled on creating
+# a new label on fresh disks in MD macppc/disksubr.c etc.
 
 NOMAN=	# defined
 PROG=	macppc_installboot



CVS commit: src/sys/external/bsd/acpica

2024-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 15 00:11:54 UTC 2024

Modified Files:
src/sys/external/bsd/acpica: acpica2netbsd

Log Message:
fix typo, noted by RVP


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/acpica/acpica2netbsd

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



CVS commit: src/sys/external/bsd/acpica

2024-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 15 00:11:54 UTC 2024

Modified Files:
src/sys/external/bsd/acpica: acpica2netbsd

Log Message:
fix typo, noted by RVP


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/acpica/acpica2netbsd

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

Modified files:

Index: src/sys/external/bsd/acpica/acpica2netbsd
diff -u src/sys/external/bsd/acpica/acpica2netbsd:1.2 src/sys/external/bsd/acpica/acpica2netbsd:1.3
--- src/sys/external/bsd/acpica/acpica2netbsd:1.2	Fri Sep 13 19:16:48 2024
+++ src/sys/external/bsd/acpica/acpica2netbsd	Sat Sep 14 20:11:54 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: acpica2netbsd,v 1.2 2024/09/13 23:16:48 christos Exp $
+# $NetBSD: acpica2netbsd,v 1.3 2024/09/15 00:11:54 christos Exp $
 #
 #  Copyright (c) 2014 The NetBSD Foundation.
 #  All rights reserved.
@@ -46,4 +46,4 @@ mv components/* .
 rmdir source components
 echo; echo
 find . -type -f -exec chmod a-x {} +
-mv include/ACPIXF.h include/ascpxf.h
+mv include/ACPIXF.h include/acpixf.h



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

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:38:28 UTC 2024

Modified Files:
src/sys/arch/vax/include: qduser.h

Log Message:
s/programmming/programming/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/qduser.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/vax/include/qduser.h
diff -u src/sys/arch/vax/include/qduser.h:1.5 src/sys/arch/vax/include/qduser.h:1.6
--- src/sys/arch/vax/include/qduser.h:1.5	Mon Oct  9 18:42:59 2006
+++ src/sys/arch/vax/include/qduser.h	Sat Sep 14 21:38:28 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: qduser.h,v 1.5 2006/10/09 18:42:59 oster Exp $	*/
+/*	$NetBSD: qduser.h,v 1.6 2024/09/14 21:38:28 andvar Exp $	*/
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -396,7 +396,7 @@ struct qdinput {
 **/
 
 /*---
-* LK201 programmming definitions  */
+* LK201 programming definitions  */
 
 #define LK_UPDOWN 	0x86		/* bits for setting lk201 modes */
 #define LK_AUTODOWN 	0x82



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

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:38:28 UTC 2024

Modified Files:
src/sys/arch/vax/include: qduser.h

Log Message:
s/programmming/programming/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/qduser.h

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



CVS commit: src/sys/dev

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:22:38 UTC 2024

Modified Files:
src/sys/dev/ic: hd64570.c i82365var.h
src/sys/dev/pci: cs4281.c
src/sys/dev/sun: kbdsun.c

Log Message:
s/intterupt/interrupt/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/ic/hd64570.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/i82365var.h
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/cs4281.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/sun/kbdsun.c

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



CVS commit: src/sys/dev

2024-09-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 14 21:22:38 UTC 2024

Modified Files:
src/sys/dev/ic: hd64570.c i82365var.h
src/sys/dev/pci: cs4281.c
src/sys/dev/sun: kbdsun.c

Log Message:
s/intterupt/interrupt/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/ic/hd64570.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/i82365var.h
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/cs4281.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/sun/kbdsun.c

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

Modified files:

Index: src/sys/dev/ic/hd64570.c
diff -u src/sys/dev/ic/hd64570.c:1.61 src/sys/dev/ic/hd64570.c:1.62
--- src/sys/dev/ic/hd64570.c:1.61	Sat Sep 14 21:12:10 2024
+++ src/sys/dev/ic/hd64570.c	Sat Sep 14 21:22:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64570.c,v 1.61 2024/09/14 21:12:10 andvar Exp $	*/
+/*	$NetBSD: hd64570.c,v 1.62 2024/09/14 21:22:37 andvar Exp $	*/
 
 /*
  * Copyright (c) 1999 Christian E. Hopps
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.61 2024/09/14 21:12:10 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.62 2024/09/14 21:22:37 andvar Exp $");
 
 #include "opt_inet.h"
 
@@ -1205,7 +1205,7 @@ sca_hardintr(struct sca_softc *sc)
 			 (isr1 & 0xf0) >> 4);
 
 		/*
-		 * mcsi intterupts
+		 * msci interrupts
 		 */
 		if (isr0 & 0x0f)
 			ret += sca_msci_intr(&sc->sc_ports[0], isr0 & 0x0f);

Index: src/sys/dev/ic/i82365var.h
diff -u src/sys/dev/ic/i82365var.h:1.32 src/sys/dev/ic/i82365var.h:1.33
--- src/sys/dev/ic/i82365var.h:1.32	Sat Oct 27 17:18:20 2012
+++ src/sys/dev/ic/i82365var.h	Sat Sep 14 21:22:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365var.h,v 1.32 2012/10/27 17:18:20 chs Exp $	*/
+/*	$NetBSD: i82365var.h,v 1.33 2024/09/14 21:22:37 andvar Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -155,7 +155,7 @@ struct pcic_softc {
 
 	/* for use by underlying chip code for discovering irqs */
 	int intr_detect, intr_false;
-	int intr_mask[PCIC_NSLOTS / 2];	/* probed intterupts if possible */
+	int intr_mask[PCIC_NSLOTS / 2];	/* probed interrupts if possible */
 };
 
 

Index: src/sys/dev/pci/cs4281.c
diff -u src/sys/dev/pci/cs4281.c:1.59 src/sys/dev/pci/cs4281.c:1.60
--- src/sys/dev/pci/cs4281.c:1.59	Wed Dec 20 05:08:34 2023
+++ src/sys/dev/pci/cs4281.c	Sat Sep 14 21:22:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4281.c,v 1.59 2023/12/20 05:08:34 thorpej Exp $	*/
+/*	$NetBSD: cs4281.c,v 1.60 2024/09/14 21:22:37 andvar Exp $	*/
 
 /*
  * Copyright (c) 2000 Tatoku Ogaito.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.59 2023/12/20 05:08:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.60 2024/09/14 21:22:37 andvar Exp $");
 
 #include 
 #include 
@@ -670,7 +670,7 @@ cs4281_resume(device_t dv, const pmf_qua
 		BA0WRITE4(sc, CS4281_DMR1, sc->sc_suspend_state.cs4281.dmr1);
 		BA0WRITE4(sc, CS4281_DCR1, sc->sc_suspend_state.cs4281.dcr1);
 	}
-	/* enable intterupts */
+	/* enable interrupts */
 	if (sc->sc_prun || sc->sc_rrun)
 		BA0WRITE4(sc, CS4281_HICR, HICR_IEV | HICR_CHGM);
 

Index: src/sys/dev/sun/kbdsun.c
diff -u src/sys/dev/sun/kbdsun.c:1.11 src/sys/dev/sun/kbdsun.c:1.12
--- src/sys/dev/sun/kbdsun.c:1.11	Sat Mar 29 19:15:36 2008
+++ src/sys/dev/sun/kbdsun.c	Sat Sep 14 21:22:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbdsun.c,v 1.11 2008/03/29 19:15:36 tsutsui Exp $	*/
+/*	$NetBSD: kbdsun.c,v 1.12 2024/09/14 21:22:37 andvar Exp $	*/
 /*	NetBSD: kbd.c,v 1.29 2001/11/13 06:54:32 lukem Exp	*/
 
 /*
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbdsun.c,v 1.11 2008/03/29 19:15:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbdsun.c,v 1.12 2024/09/14 21:22:37 andvar Exp $");
 
 #include 
 #include 
@@ -273,7 +273,7 @@ kbd_sun_set_leds(struct kbd_softc *kbd, 
 
 
 /*
- * Safe to call from intterupt handler.  Called at spltty()
+ * Safe to call from interrupt handler.  Called at spltty()
  * by kbd_sun_iocsled and kbd_sun_input (via kbd_update_leds).
  */
 static void



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

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 21:11:07 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: sbc.c

Log Message:
Use smaller size when sending PDMA data, and check that the next block can
be sent before sending it.

This fixes PDMA support (which previously has been flakey at best).

These changes provide maximum performance and importantly reliablity.

The lack of support for the PDMA intr should now be revisited on the PowerBook
5xx series (Unfortunately I don't have the hw to test with).

These changes have been tested on emulated (PiSCSI/BlueSCSI) and real hw.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/dev/sbc.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-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 21:04:25 UTC 2024

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k
src/sys/arch/mac68k/dev: pm_direct.c

Log Message:
Add support for the power button on the PowerBook 160/180.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mac68k/dev/pm_direct.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-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 21:04:25 UTC 2024

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k
src/sys/arch/mac68k/dev: pm_direct.c

Log Message:
Add support for the power button on the PowerBook 160/180.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mac68k/dev/pm_direct.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/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.133 src/sys/arch/mac68k/conf/files.mac68k:1.134
--- src/sys/arch/mac68k/conf/files.mac68k:1.133	Wed Mar 13 07:55:28 2024
+++ src/sys/arch/mac68k/conf/files.mac68k	Sat Sep 14 21:04:24 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.133 2024/03/13 07:55:28 nat Exp $
+#	$NetBSD: files.mac68k,v 1.134 2024/09/14 21:04:24 nat Exp $
 
 # mac68k-specific configuration info
 
@@ -24,7 +24,7 @@ device	obio { [addr = -1] }
 attach	obio at mainbus
 file	arch/mac68k/obio/obio.c		obio
 
-device	adb { }
+device	adb { }: sysmon_power
 attach	adb at obio
 file	arch/mac68k/dev/adb.c		adb
 file	arch/mac68k/dev/adbsysasm.s

Index: src/sys/arch/mac68k/dev/pm_direct.c
diff -u src/sys/arch/mac68k/dev/pm_direct.c:1.34 src/sys/arch/mac68k/dev/pm_direct.c:1.35
--- src/sys/arch/mac68k/dev/pm_direct.c:1.34	Sat Sep 14 21:02:46 2024
+++ src/sys/arch/mac68k/dev/pm_direct.c	Sat Sep 14 21:04:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm_direct.c,v 1.34 2024/09/14 21:02:46 nat Exp $	*/
+/*	$NetBSD: pm_direct.c,v 1.35 2024/09/14 21:04:24 nat Exp $	*/
 
 /*
  * Copyright (c) 2024 Nathanial Sloss 
@@ -35,7 +35,7 @@
 /* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.34 2024/09/14 21:02:46 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.35 2024/09/14 21:04:24 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: pm_direct.c,
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -88,6 +90,7 @@ u_short	pm_existent_ADB_devices = 0x0;	/
 u_int	pm_LCD_brightness = 0x0;
 u_int	pm_LCD_contrast = 0x0;
 u_int	pm_counter = 0;			/* clock count */
+struct sysmon_pswitch pbutton;
 
 /* these values shows that number of data returned after 'send' cmd is sent */
 char pm_send_cmd_type[] = {
@@ -260,6 +263,12 @@ pm_setup_adb(void)
 		case MACH_MACPB180:
 		case MACH_MACPB180C:
 			pmHardware = PM_HW_PB1XX;
+
+			memset(&pbutton, 0, sizeof(struct sysmon_pswitch));
+			pbutton.smpsw_name = "PB";
+			pbutton.smpsw_type = PSWITCH_TYPE_POWER;
+			if (sysmon_pswitch_register(&pbutton) != 0)
+printf("Unable to register soft power\n");
 			break;
 		case MACH_MACPB150:
 		case MACH_MACPB210:
@@ -272,6 +281,13 @@ pm_setup_adb(void)
 		case MACH_MACPB190:
 		case MACH_MACPB190CS:
 			pmHardware = PM_HW_PB5XX;
+#if notyet
+			memset(&pbutton, 0, sizeof(struct sysmon_pswitch));
+			pbutton.smpsw_name = "PB";
+			pbutton.smpsw_type = PSWITCH_TYPE_POWER;
+			if (sysmon_pswitch_register(&pbutton) != 0)
+printf("Unable to register soft power\n");
+#endif
 			break;
 		default:
 			break;
@@ -579,6 +595,9 @@ pm_intr_pm1(void *arg)
 			/* ADB device event */
 			pm_adb_get_ADB_data(&pmdata);
 		}
+	} else if ((pmdata.num_data == 0x1) && (pmdata.data[0] == 0)) {
+		/* PowerBook 160/180 Power button. */
+		sysmon_pswitch_event(&pbutton, PSWITCH_EVENT_PRESSED);
 	} else {
 #ifdef ADB_DEBUG
 		if (adb_debug)



CVS commit: src/sys/arch/mac68k

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 21:02:46 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: pm_direct.c pm_direct.h
src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Add support for poweroff on PowerBook 1xx.

This excludes the PowerBook 150 and 190, which are more similar to the 500
series.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/mac68k/dev/pm_direct.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mac68k/dev/pm_direct.h
cvs rdiff -u -r1.369 -r1.370 src/sys/arch/mac68k/mac68k/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/mac68k/dev/pm_direct.c
diff -u src/sys/arch/mac68k/dev/pm_direct.c:1.33 src/sys/arch/mac68k/dev/pm_direct.c:1.34
--- src/sys/arch/mac68k/dev/pm_direct.c:1.33	Sat Sep 14 20:59:45 2024
+++ src/sys/arch/mac68k/dev/pm_direct.c	Sat Sep 14 21:02:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm_direct.c,v 1.33 2024/09/14 20:59:45 nat Exp $	*/
+/*	$NetBSD: pm_direct.c,v 1.34 2024/09/14 21:02:46 nat Exp $	*/
 
 /*
  * Copyright (c) 2024 Nathanial Sloss 
@@ -35,7 +35,7 @@
 /* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.33 2024/09/14 20:59:45 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.34 2024/09/14 21:02:46 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -1151,6 +1151,26 @@ pm_adb_poll_next_device_pm1(PMData *pmda
 	tmp_pmdata.data[2] = 0x00;
 	pmgrop(&tmp_pmdata);
 }
+
+void 
+pm_poweroff(void)
+{
+	PMData pmdata;
+	int attempt = 3;
+
+	while (pmHardware == PM_HW_PB1XX && attempt > 0) {
+		pmdata.command = 0x7e;
+		pmdata.num_data = 0;
+		pmdata.data[0] = pmdata.data[1] = 0;
+		pmdata.s_buf = &pmdata.data[2];
+		pmdata.r_buf = &pmdata.data[2];
+		(void)pm_pmgrop_pm1(&pmdata);
+		attempt--;
+	}	
+
+	return;
+}
+
 u_int
 pm_set_brightness(u_int brightness)
 {

Index: src/sys/arch/mac68k/dev/pm_direct.h
diff -u src/sys/arch/mac68k/dev/pm_direct.h:1.2 src/sys/arch/mac68k/dev/pm_direct.h:1.3
--- src/sys/arch/mac68k/dev/pm_direct.h:1.2	Sat Sep 14 20:59:45 2024
+++ src/sys/arch/mac68k/dev/pm_direct.h	Sat Sep 14 21:02:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm_direct.h,v 1.2 2024/09/14 20:59:45 nat Exp $	*/
+/*	$NetBSD: pm_direct.h,v 1.3 2024/09/14 21:02:46 nat Exp $	*/
 
 /*
  * Copyright (c) 2024 Nathanial Sloss 
@@ -48,4 +48,5 @@ typedef	struct	{
 }	PMData;
 
 int		pmgrop(PMData *);
+void		pm_poweroff(void);
 u_int		pm_set_brightness(u_int);

Index: src/sys/arch/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.369 src/sys/arch/mac68k/mac68k/machdep.c:1.370
--- src/sys/arch/mac68k/mac68k/machdep.c:1.369	Fri Jun  7 02:51:45 2024
+++ src/sys/arch/mac68k/mac68k/machdep.c	Sat Sep 14 21:02:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.369 2024/06/07 02:51:45 nat Exp $	*/
+/*	$NetBSD: machdep.c,v 1.370 2024/09/14 21:02:46 nat Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.369 2024/06/07 02:51:45 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.370 2024/09/14 21:02:46 nat Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -156,6 +156,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #if NMACFB > 0
 #include 
 #endif
+#include 
 #include 
 
 #include "ksyms.h"
@@ -493,6 +494,11 @@ cpu_reboot(int howto, char *bootstr)
 		adb_poweroff();
 #endif
 		/*
+		 * Try to shutdown via the power manager (PowerBooks mainly).
+		 */
+		pm_poweroff();
+
+		/*
 		 * RB_POWERDOWN implies RB_HALT... fall into it...
 		 */
 	}



CVS commit: src/sys/arch/mac68k

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 21:02:46 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: pm_direct.c pm_direct.h
src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Add support for poweroff on PowerBook 1xx.

This excludes the PowerBook 150 and 190, which are more similar to the 500
series.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/mac68k/dev/pm_direct.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mac68k/dev/pm_direct.h
cvs rdiff -u -r1.369 -r1.370 src/sys/arch/mac68k/mac68k/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/mac68k/dev

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 20:59:46 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: aed.c pm_direct.c pm_direct.h

Log Message:
Add support for brightness control on Powerbook 1xx.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mac68k/dev/aed.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mac68k/dev/pm_direct.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mac68k/dev/pm_direct.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/dev/aed.c
diff -u src/sys/arch/mac68k/dev/aed.c:1.39 src/sys/arch/mac68k/dev/aed.c:1.40
--- src/sys/arch/mac68k/dev/aed.c:1.39	Wed Jun  5 11:01:47 2024
+++ src/sys/arch/mac68k/dev/aed.c	Sat Sep 14 20:59:45 2024
@@ -1,6 +1,9 @@
-/*	$NetBSD: aed.c,v 1.39 2024/06/05 11:01:47 nat Exp $	*/
+/*	$NetBSD: aed.c,v 1.40 2024/09/14 20:59:45 nat Exp $	*/
 
 /*
+ * Copyright (c) 2024 Nathanial Sloss 
+ * All rights reserved.
+ *
  * Copyright (C) 1994	Bradley A. Grantham
  * All rights reserved.
  *
@@ -26,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.39 2024/06/05 11:01:47 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.40 2024/09/14 20:59:45 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -48,6 +51,11 @@ __KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.39
 #include 
 #include 
 #include 
+#include 
+
+#define BRIGHTNESS_MAX	31
+#define BRIGHTNESS_MIN	0
+#define BRIGHTNESS_STEP	4
 
 /*
  * Function declarations.
@@ -60,11 +68,15 @@ static void	aed_dokeyupdown(adb_event_t 
 static void	aed_handoff(adb_event_t *);
 static void	aed_enqevent(adb_event_t *);
 
+static void	aed_brightness_down(device_t);
+static void	aed_brightness_up(device_t);
+
 /*
  * Local variables.
  */
 static struct aed_softc *aed_sc;
 static int aed_options = 0 | AED_MSEMUL;
+static int brightness = BRIGHTNESS_MAX;
 
 /* Driver definition */
 CFATTACH_DECL_NEW(aed, sizeof(struct aed_softc),
@@ -139,6 +151,11 @@ aedattach(device_t parent, device_t self
 
 	aed_sc = sc;
 
+	pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_UP,
+	aed_brightness_up, TRUE);
+	pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_DOWN,
+	aed_brightness_down, TRUE);
+
 	printf("ADB Event device\n");
 
 	return;
@@ -268,6 +285,12 @@ aed_emulate_mouse(adb_event_t *event)
 			microtime(&new_event.timestamp);
 			aed_handoff(&new_event);
 			break;
+		case ADBK_KEYUP(ADBK_UP):
+			pmf_event_inject(NULL, PMFE_DISPLAY_BRIGHTNESS_UP);
+			break;
+		case ADBK_KEYUP(ADBK_DOWN):
+			pmf_event_inject(NULL, PMFE_DISPLAY_BRIGHTNESS_DOWN);
+			break;
 		case ADBK_KEYUP(ADBK_SHIFT):
 		case ADBK_KEYDOWN(ADBK_SHIFT):
 		case ADBK_KEYUP(ADBK_CONTROL):
@@ -628,3 +651,33 @@ aedkqfilter(dev_t dev, struct knote *kn)
 
 	return (0);
 }
+
+static void
+aed_brightness_down(device_t dev)
+{
+	int level, step;
+
+	level = brightness;
+	if (level <= 4) 	 /* logarithmic brightness curve. */
+		step = 1;
+	else
+		step = BRIGHTNESS_STEP;
+
+	level = uimax(BRIGHTNESS_MIN, level - step);
+	brightness = pm_set_brightness(level);
+}
+
+static void
+aed_brightness_up(device_t dev)
+{
+	int level, step;
+
+	level = brightness;
+	if (level <= 4) 	 /* logarithmic brightness curve. */
+		step = 1;
+	else
+		step = BRIGHTNESS_STEP;
+
+	level = uimin(BRIGHTNESS_MAX, level + step);
+	brightness = pm_set_brightness(level);
+}

Index: src/sys/arch/mac68k/dev/pm_direct.c
diff -u src/sys/arch/mac68k/dev/pm_direct.c:1.32 src/sys/arch/mac68k/dev/pm_direct.c:1.33
--- src/sys/arch/mac68k/dev/pm_direct.c:1.32	Sun Jun  2 13:28:45 2024
+++ src/sys/arch/mac68k/dev/pm_direct.c	Sat Sep 14 20:59:45 2024
@@ -1,6 +1,9 @@
-/*	$NetBSD: pm_direct.c,v 1.32 2024/06/02 13:28:45 andvar Exp $	*/
+/*	$NetBSD: pm_direct.c,v 1.33 2024/09/14 20:59:45 nat Exp $	*/
 
 /*
+ * Copyright (c) 2024 Nathanial Sloss 
+ * All rights reserved.
+ *
  * Copyright (C) 1997 Takashi Hamada
  * All rights reserved.
  *
@@ -32,7 +35,7 @@
 /* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.32 2024/06/02 13:28:45 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.33 2024/09/14 20:59:45 nat Exp $");
 
 #include "opt_adb.h"
 
@@ -845,18 +848,8 @@ pm_intr_pm2(void *arg)
 			rval = pm_pmgrop_pm2(&pmdata);
 			pm_printerr("#33", rval, pmdata.num_data, pmdata.data);
 */
-			/* this is an experimental code */
-			pmdata.command = 0x41;
-			pmdata.num_data = 1;
-			pmdata.s_buf = pmdata.data;
-			pmdata.r_buf = pmdata.data;
-			pm_LCD_brightness = 0x7f - pm_LCD_brightness / 2;
-			if (pm_LCD_brightness < 0x25)
-pm_LCD_brightness = 0x25;
-			if (pm_LCD_brightness > 0x5a)
-pm_LCD_brightness = 0x7f;
-			pmdata.data[0] = pm_LCD_brightness;
-			rval = pm_pmgrop_pm2(&pmdata);
+			pm_LCD_brightness =
+			pm_set_brightness(pm_LCD_brightness);
 			break;
 		case 0x10:			/* ADB data that were requested by TALK command */
 		case 0x14:
@@ -1158,3 +1151,42 @@ pm_adb_poll_next_device_pm1(PMData

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

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 20:59:46 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: aed.c pm_direct.c pm_direct.h

Log Message:
Add support for brightness control on Powerbook 1xx.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mac68k/dev/aed.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mac68k/dev/pm_direct.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mac68k/dev/pm_direct.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/mac68k/dev

2024-09-14 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Sep 14 20:56:51 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
Allow a few seconds for adb devices to settle.

The spin up of the floppy drive motor would cause a crash on my PowerBook
when adb was attached.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/dev/adb.c

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



CVS commit: src/sys/dev/ic

2024-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 14 07:30:41 UTC 2024

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

Log Message:
Update sc_promisc in eqos_ioctl before calling eqos_setup_rxfilter so the
new value is used.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/ic/dwc_eqos.c

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



CVS commit: src/sys/dev/ic

2024-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 14 07:30:41 UTC 2024

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

Log Message:
Update sc_promisc in eqos_ioctl before calling eqos_setup_rxfilter so the
new value is used.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/ic/dwc_eqos.c

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

Modified files:

Index: src/sys/dev/ic/dwc_eqos.c
diff -u src/sys/dev/ic/dwc_eqos.c:1.38 src/sys/dev/ic/dwc_eqos.c:1.39
--- src/sys/dev/ic/dwc_eqos.c:1.38	Mon Aug 26 18:25:29 2024
+++ src/sys/dev/ic/dwc_eqos.c	Sat Sep 14 07:30:41 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos.c,v 1.38 2024/08/26 18:25:29 bsiegert Exp $ */
+/* $NetBSD: dwc_eqos.c,v 1.39 2024/09/14 07:30:41 skrll Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.38 2024/08/26 18:25:29 bsiegert Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.39 2024/09/14 07:30:41 skrll Exp $");
 
 #include 
 #include 
@@ -1234,6 +1234,7 @@ eqos_ioctl(struct ifnet *ifp, u_long cmd
 			error = (*ifp->if_init)(ifp);
 		else if (cmd == SIOCADDMULTI || cmd == SIOCDELMULTI) {
 			EQOS_LOCK(sc);
+			sc->sc_promisc = ifp->if_flags & IFF_PROMISC;
 			if (sc->sc_running)
 eqos_setup_rxfilter(sc);
 			EQOS_UNLOCK(sc);



CVS commit: src/sys/dev/pci

2024-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 14 07:01:33 UTC 2024

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

Log Message:
Update bge_if_flags in bge_ifflags_cb before calling bge_setmulti so the
new setting of IFF_PROMISC is used by bge_setmulti


To generate a diff of this commit:
cvs rdiff -u -r1.395 -r1.396 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.395 src/sys/dev/pci/if_bge.c:1.396
--- src/sys/dev/pci/if_bge.c:1.395	Sat Sep  7 06:25:27 2024
+++ src/sys/dev/pci/if_bge.c	Sat Sep 14 07:01:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.395 2024/09/07 06:25:27 skrll Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.396 2024/09/14 07:01:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.395 2024/09/07 06:25:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.396 2024/09/14 07:01:33 skrll Exp $");
 
 #include 
 #include 
@@ -5934,6 +5934,7 @@ bge_ifflags_cb(struct ethercom *ec)
 	mutex_enter(sc->sc_mcast_lock);
 
 	u_short change = ifp->if_flags ^ sc->bge_if_flags;
+	sc->bge_if_flags = ifp->if_flags;
 
 	if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) {
 		ret = ENETRESET;
@@ -5946,7 +5947,6 @@ bge_ifflags_cb(struct ethercom *ec)
 		bge_setmulti(sc);
 	}
 
-	sc->bge_if_flags = ifp->if_flags;
 	mutex_exit(sc->sc_mcast_lock);
 
 	return ret;



CVS commit: src/sys/dev/pci

2024-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Sep 14 07:01:33 UTC 2024

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

Log Message:
Update bge_if_flags in bge_ifflags_cb before calling bge_setmulti so the
new setting of IFF_PROMISC is used by bge_setmulti


To generate a diff of this commit:
cvs rdiff -u -r1.395 -r1.396 src/sys/dev/pci/if_bge.c

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



Re: CVS commit: src/sys/miscfs/procfs

2024-09-13 Thread Paul Goyette

This was also supposed to include in the log message:

Include mqueue-based entries only if built with MQUEUE option.


On Sat, 14 Sep 2024, Paul Goyette wrote:


Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 14 01:37:42 UTC 2024

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

Log Message:
Define dependencies based on build options.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -u -r1.119 -r1.120 src/sys/miscfs/procfs/procfs_vfsops.c

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


!DSPAM:66e4e8e8182295181515653!




+-+--+--+
| Paul Goyette (.sig) | PGP Key fingerprint: | E-mail addresses:|
| (Retired)   | 1B11 1849 721C 56C8 F63A | p...@whooppee.com|
| Software Developer  | 6E2E 05FD 15CE 9F2D 5102 | pgoye...@netbsd.org  |
| & Network Engineer  |  | pgoyett...@gmail.com |
+-+--+--+


CVS commit: src/sys/miscfs/procfs

2024-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 14 01:37:42 UTC 2024

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

Log Message:
Define dependencies based on build options.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -u -r1.119 -r1.120 src/sys/miscfs/procfs/procfs_vfsops.c

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

Modified files:

Index: src/sys/miscfs/procfs/procfs_linux.c
diff -u src/sys/miscfs/procfs/procfs_linux.c:1.89 src/sys/miscfs/procfs/procfs_linux.c:1.90
--- src/sys/miscfs/procfs/procfs_linux.c:1.89	Mon Jul  1 01:35:53 2024
+++ src/sys/miscfs/procfs/procfs_linux.c	Sat Sep 14 01:37:42 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: procfs_linux.c,v 1.89 2024/07/01 01:35:53 christos Exp $  */
+/*  $NetBSD: procfs_linux.c,v 1.90 2024/09/14 01:37:42 pgoyette Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,10 +36,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.89 2024/07/01 01:35:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.90 2024/09/14 01:37:42 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sysv.h"
+#include "opt_mqueue.h"
 #endif
 
 #include 
@@ -71,7 +72,9 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_linux
 #ifdef SYSVSHM
 #include 
 #endif
+#ifdef MQUEUE
 #include 
+#endif
 
 #include 
 
@@ -83,10 +86,12 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_linux
 
 extern struct devsw_conv *devsw_conv;
 extern int max_devsw_convs;
+#ifdef MQUEUE
 extern u_int mq_open_max;
 extern u_int mq_max_msgsize;
 extern u_int mq_def_maxmsg;
 extern u_int mq_max_maxmsg;
+#endif
 
 
 #define PGTOB(p)	((unsigned long)(p) << PAGE_SHIFT)
@@ -904,8 +909,11 @@ out:
 	return error;
 }
 
+#ifdef MQUEUE
+#define print_uint(value, uio) PFS_print_uint(value, uio);
+
 static int
-print_uint(unsigned int value, struct uio *uio)
+PFS_print_uint(unsigned int value, struct uio *uio)
 {
 	char *bf;
 	int offset = 0;
@@ -921,6 +929,11 @@ out:
 	free(bf, M_TEMP);
 	return error;
 }
+#else
+
+#define print_uint(value, uio) EINVAL
+
+#endif
 
 int
 procfs_domq_msg_def(struct lwp *curl, struct proc *p,

Index: src/sys/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.119 src/sys/miscfs/procfs/procfs_vfsops.c:1.120
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.119	Mon Sep  9 15:53:33 2024
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Sat Sep 14 01:37:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.119 2024/09/09 15:53:33 pgoyette Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.120 2024/09/14 01:37:42 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,10 +76,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.119 2024/09/09 15:53:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.120 2024/09/14 01:37:42 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
+#include "opt_sysv_ipc.h"
+#include "opt_mqueue.h"
 #endif
 
 #include 
@@ -107,7 +109,14 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_vfsop
 
 #include 			/* for PAGE_SIZE */
 
-MODULE(MODULE_CLASS_VFS, procfs, "ptrace_common,mqueue,sysv_ipc");
+MODULE(MODULE_CLASS_VFS, procfs, "ptrace_common"
+#if defined(MQUEUE)
+ ",mqueue"
+#endif
+#if defined(SYSVSHM) || defined(SYSVSEM) || defined(SYSVMSG)
+ ",sysv_ipc"
+#endif
+);
 
 VFS_PROTOS(procfs);
 



CVS commit: src/sys/miscfs/procfs

2024-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 14 01:37:42 UTC 2024

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

Log Message:
Define dependencies based on build options.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -u -r1.119 -r1.120 src/sys/miscfs/procfs/procfs_vfsops.c

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



CVS commit: src/sys/modules/procfs

2024-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 14 01:36:11 UTC 2024

Modified Files:
src/sys/modules/procfs: Makefile

Log Message:
Update module build options to match with GENERIC kernel options


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/procfs/Makefile

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



CVS commit: src/sys/modules/procfs

2024-09-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 14 01:36:11 UTC 2024

Modified Files:
src/sys/modules/procfs: Makefile

Log Message:
Update module build options to match with GENERIC kernel options


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/procfs/Makefile

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

Modified files:

Index: src/sys/modules/procfs/Makefile
diff -u src/sys/modules/procfs/Makefile:1.8 src/sys/modules/procfs/Makefile:1.9
--- src/sys/modules/procfs/Makefile:1.8	Mon Sep  9 15:52:31 2024
+++ src/sys/modules/procfs/Makefile	Sat Sep 14 01:36:11 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2024/09/09 15:52:31 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.9 2024/09/14 01:36:11 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -9,8 +9,8 @@
 .PATH:  ${S}/arch/x86/x86
 .endif
 
-# enable the SYSV linux nodes
-COPTS+=	-D SYSVSHM -D SYSVSEM -D SYSVMSG
+# enable the SYSV and MQUEUE linux nodes
+COPTS+=	-D SYSVSHM -D SYSVSEM -D SYSVMSG -D MQUEUE
 
 KMOD=	procfs
 SRCS=	procfs_note.c procfs_status.c procfs_subr.c \



CVS commit: src/sys/external/bsd/acpica

2024-09-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 13 23:16:48 UTC 2024

Modified Files:
src/sys/external/bsd/acpica: acpica2netbsd

Log Message:
fix more windows damage: remove executable bit, fix capitalized file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/acpica/acpica2netbsd

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

Modified files:

Index: src/sys/external/bsd/acpica/acpica2netbsd
diff -u src/sys/external/bsd/acpica/acpica2netbsd:1.1 src/sys/external/bsd/acpica/acpica2netbsd:1.2
--- src/sys/external/bsd/acpica/acpica2netbsd:1.1	Sat Oct 25 17:00:06 2014
+++ src/sys/external/bsd/acpica/acpica2netbsd	Fri Sep 13 19:16:48 2024
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: acpica2netbsd,v 1.1 2014/10/25 21:00:06 christos Exp $
+# $NetBSD: acpica2netbsd,v 1.2 2024/09/13 23:16:48 christos Exp $
 #
 #  Copyright (c) 2014 The NetBSD Foundation.
 #  All rights reserved.
@@ -45,3 +45,5 @@ mv source/* .
 mv components/* .
 rmdir source components
 echo; echo
+find . -type -f -exec chmod a-x {} +
+mv include/ACPIXF.h include/ascpxf.h



CVS commit: src/sys/external/bsd/acpica

2024-09-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 13 23:16:48 UTC 2024

Modified Files:
src/sys/external/bsd/acpica: acpica2netbsd

Log Message:
fix more windows damage: remove executable bit, fix capitalized file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/acpica/acpica2netbsd

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



CVS commit: src/sys/external/bsd/acpica/dist

2024-09-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 13 23:13:25 UTC 2024

Modified Files:
src/sys/external/bsd/acpica/dist/common: dmtables.c dmtbdump.c
src/sys/external/bsd/acpica/dist/compiler: aslcompile.c aslcompiler.h
aslcompiler.l aslfiles.c asloptions.c dtfield.c dtutils.c prutils.c
src/sys/external/bsd/acpica/dist/debugger: dbnames.c
src/sys/external/bsd/acpica/dist/disassembler: dmwalk.c
src/sys/external/bsd/acpica/dist/executer: exsystem.c
src/sys/external/bsd/acpica/dist/hardware: hwxfsleep.c
src/sys/external/bsd/acpica/dist/include: acdisasm.h acglobal.h
aclocal.h acoutput.h acpixf.h actbl1.h actypes.h
src/sys/external/bsd/acpica/dist/include/platform: acgcc.h
src/sys/external/bsd/acpica/dist/resources: rsdump.c
src/sys/external/bsd/acpica/dist/tables: tbfadt.c tbutils.c
src/sys/external/bsd/acpica/dist/tools/acpixtract: acpixtract.c
src/sys/external/bsd/acpica/dist/utilities: utdebug.c utdelete.c
utosi.c

Log Message:
Merge conflicts between 20230628 and 20240827


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/acpica/dist/common/dmtables.c
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/acpica/dist/common/dmtbdump.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/external/bsd/acpica/dist/compiler/aslcompile.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.l \
src/sys/external/bsd/acpica/dist/compiler/dtfield.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/external/bsd/acpica/dist/compiler/aslfiles.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/compiler/asloptions.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/acpica/dist/compiler/dtutils.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/compiler/prutils.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/debugger/dbnames.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/disassembler/dmwalk.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/acpica/dist/executer/exsystem.c
cvs rdiff -u -r1.18 -r1.19 \
src/sys/external/bsd/acpica/dist/hardware/hwxfsleep.c
cvs rdiff -u -r1.27 -r1.28 \
src/sys/external/bsd/acpica/dist/include/acdisasm.h \
src/sys/external/bsd/acpica/dist/include/acglobal.h
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/acpica/dist/include/aclocal.h
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/include/acoutput.h
cvs rdiff -u -r1.35 -r1.36 src/sys/external/bsd/acpica/dist/include/acpixf.h
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/acpica/dist/include/actbl1.h
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/acpica/dist/include/actypes.h
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/acpica/dist/include/platform/acgcc.h
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/resources/rsdump.c
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/acpica/dist/tables/tbfadt.c
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/acpica/dist/tables/tbutils.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/external/bsd/acpica/dist/utilities/utdebug.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/acpica/dist/utilities/utdelete.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/acpica/dist/utilities/utosi.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/external/bsd/acpica/dist/common/dmtables.c
diff -u src/sys/external/bsd/acpica/dist/common/dmtables.c:1.8 src/sys/external/bsd/acpica/dist/common/dmtables.c:1.9
--- src/sys/external/bsd/acpica/dist/common/dmtables.c:1.8	Fri Sep  1 14:37:29 2023
+++ src/sys/external/bsd/acpica/dist/common/dmtables.c	Fri Sep 13 19:13:23 2024
@@ -82,7 +82,7 @@ extern ACPI_PARSE_OBJECT*AcpiGbl_Par
  * RETURN:  None
  *
  * DESCRIPTION: Create the disassembler header, including ACPICA signon with
- *  current time and date.
+ *  optional current time and date.
  *
  */
 
@@ -94,8 +94,6 @@ AdDisassemblerHeader (
 time_t  Timer;
 
 
-time (&Timer);
-
 /* Header and input table info */
 
 AcpiOsPrintf ("/*\n");
@@ -117,7 +115,15 @@ AdDisassemblerHeader (
 }
 }
 
-AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
+if (AslGbl_Deterministic)
+{
+AcpiOsPrintf (" * Disassembly of %s\n", Filename);
+}
+else
+{
+time (&Timer);
+AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
+}
 AcpiOsPrintf (" *\n");
 }
 

Index: src/sys/external/bsd/acpica/dist/common/dmtbdump.c
diff -u src/sys/external/bsd/acpi

CVS commit: src/sys/external/bsd/acpica/dist

2024-09-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 13 23:13:25 UTC 2024

Modified Files:
src/sys/external/bsd/acpica/dist/common: dmtables.c dmtbdump.c
src/sys/external/bsd/acpica/dist/compiler: aslcompile.c aslcompiler.h
aslcompiler.l aslfiles.c asloptions.c dtfield.c dtutils.c prutils.c
src/sys/external/bsd/acpica/dist/debugger: dbnames.c
src/sys/external/bsd/acpica/dist/disassembler: dmwalk.c
src/sys/external/bsd/acpica/dist/executer: exsystem.c
src/sys/external/bsd/acpica/dist/hardware: hwxfsleep.c
src/sys/external/bsd/acpica/dist/include: acdisasm.h acglobal.h
aclocal.h acoutput.h acpixf.h actbl1.h actypes.h
src/sys/external/bsd/acpica/dist/include/platform: acgcc.h
src/sys/external/bsd/acpica/dist/resources: rsdump.c
src/sys/external/bsd/acpica/dist/tables: tbfadt.c tbutils.c
src/sys/external/bsd/acpica/dist/tools/acpixtract: acpixtract.c
src/sys/external/bsd/acpica/dist/utilities: utdebug.c utdelete.c
utosi.c

Log Message:
Merge conflicts between 20230628 and 20240827


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/acpica/dist/common/dmtables.c
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/acpica/dist/common/dmtbdump.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/external/bsd/acpica/dist/compiler/aslcompile.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.l \
src/sys/external/bsd/acpica/dist/compiler/dtfield.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/external/bsd/acpica/dist/compiler/aslfiles.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/compiler/asloptions.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/external/bsd/acpica/dist/compiler/dtutils.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/compiler/prutils.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/debugger/dbnames.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/disassembler/dmwalk.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/acpica/dist/executer/exsystem.c
cvs rdiff -u -r1.18 -r1.19 \
src/sys/external/bsd/acpica/dist/hardware/hwxfsleep.c
cvs rdiff -u -r1.27 -r1.28 \
src/sys/external/bsd/acpica/dist/include/acdisasm.h \
src/sys/external/bsd/acpica/dist/include/acglobal.h
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/acpica/dist/include/aclocal.h
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/include/acoutput.h
cvs rdiff -u -r1.35 -r1.36 src/sys/external/bsd/acpica/dist/include/acpixf.h
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/acpica/dist/include/actbl1.h
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/acpica/dist/include/actypes.h
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/acpica/dist/include/platform/acgcc.h
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/resources/rsdump.c
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/acpica/dist/tables/tbfadt.c
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/acpica/dist/tables/tbutils.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.c
cvs rdiff -u -r1.21 -r1.22 \
src/sys/external/bsd/acpica/dist/utilities/utdebug.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/acpica/dist/utilities/utdelete.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/acpica/dist/utilities/utosi.c

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



Re: CVS commit: src/sys/sys

2024-09-11 Thread Ryo ONODERA
Hi,

Christos Zoulas  writes:

> And committed.

Thank you very much for your quick fix.
It works fine for me now.

> christos
>
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/sys/arch/i386/stand

2024-09-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Sep 11 20:15:37 UTC 2024

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile main.c start_dos.S version
src/sys/arch/i386/stand/lib: exec.c

Log Message:
dosboot(8): remove XMS-specific code. The boot process has been broken for over
a decade, and its relevance has diminished due to the availability of other boot
options.

PR port-i386/58624


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/main.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/start_dos.S
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/version
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/i386/stand/lib/exec.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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.38 src/sys/arch/i386/stand/dosboot/Makefile:1.39
--- src/sys/arch/i386/stand/dosboot/Makefile:1.38	Sat Jun 29 13:46:40 2024
+++ src/sys/arch/i386/stand/dosboot/Makefile	Wed Sep 11 20:15:36 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.38 2024/06/29 13:46:40 rin Exp $
+#	$NetBSD: Makefile,v 1.39 2024/09/11 20:15:36 andvar Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -14,7 +14,6 @@ SRCS+=	exec_multiboot1.c exec_multiboot2
 
 #CPPFLAGS+= -DSLOW	# for libz; no longer available
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
-CPPFLAGS+= -DXMS
 CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
 CPPFLAGS+= -DNO_MULTIBOOT2 # keep the binary small
 #uncomment if there are problems with memory detection

Index: src/sys/arch/i386/stand/dosboot/main.c
diff -u src/sys/arch/i386/stand/dosboot/main.c:1.33 src/sys/arch/i386/stand/dosboot/main.c:1.34
--- src/sys/arch/i386/stand/dosboot/main.c:1.33	Mon May 13 17:50:30 2019
+++ src/sys/arch/i386/stand/dosboot/main.c	Wed Sep 11 20:15:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.33 2019/05/13 17:50:30 maxv Exp $	 */
+/*	$NetBSD: main.c,v 1.34 2024/09/11 20:15:36 andvar Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -191,31 +191,14 @@ static void
 print_banner(void)
 {
 	int extmem = getextmem();
-	char *s = "";
 
 	clear_pc_screen();
 
-#ifdef XMS
-	u_long xmsmem;
-	if (getextmem1() == 0 && (xmsmem = checkxms()) != 0) {
-		/*
-		 * With "CONSERVATIVE_MEMDETECT", extmem is 0 because
-		 *  getextmem() is getextmem1(). Without, the "smart"
-		 *  methods could fail to report all memory as well.
-		 * xmsmem is a few kB less than the actual size, but
-		 *  better than nothing.
-		 */
-		if ((int)xmsmem > extmem)
-			extmem = xmsmem;
-		s = "(xms) ";
-	}
-#endif
-
 	printf("\n"
 	   ">> %s, Revision %s (from NetBSD %s)\n"
-	   ">> Memory: %d/%d %sk\n",
+	   ">> Memory: %d/%d k\n",
 	   bootprog_name, bootprog_rev, bootprog_kernrev,
-	   getbasemem(), extmem, s);
+	   getbasemem(), extmem);
 }
 
 void 

Index: src/sys/arch/i386/stand/dosboot/start_dos.S
diff -u src/sys/arch/i386/stand/dosboot/start_dos.S:1.1 src/sys/arch/i386/stand/dosboot/start_dos.S:1.2
--- src/sys/arch/i386/stand/dosboot/start_dos.S:1.1	Sat Jun 29 13:45:14 2024
+++ src/sys/arch/i386/stand/dosboot/start_dos.S	Wed Sep 11 20:15:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: start_dos.S,v 1.1 2024/06/29 13:45:14 rin Exp $	*/
+/*	$NetBSD: start_dos.S,v 1.2 2024/09/11 20:15:36 andvar Exp $	*/
 	
 /*
  * startup for DOS .COM programs
@@ -6,7 +6,6 @@
  * netbsd:sys/arch/i386/boot/start.S
  * Tor Egge's patches for NetBSD boot (pr port-i386/1002)
  * freebsd:sys/i386/boot/netboot/start2.S
- * XMS support by Martin Husemann
  */
 
 /*
@@ -484,137 +483,3 @@ _C_LABEL(trace_str):
 	.code32
 	popl	%esi
 	ret
-
-#ifdef XMS
-
-/* pointer to XMS driver, 0 if no XMS used */
-
-	.data
-_C_LABEL(xmsdrv):
-	.long	0
-
-	.text
-ENTRY(checkxms)
-	.code32
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%ebx
-	pushl	%edx
-	pushl	%es
-	pushl	%esi
-	pushl	%edi
-
-	call	_C_LABEL(prot_to_real)	# enter real mode
-	.code16
-
-	movw	$0x4300, %ax
-	int	$0x2f			/* check if XMS installed */
-	cmpb	$0x80, %al
-	jnz	noxms
-
-	movw	$0x4310, %ax
-	int	$0x2f			/* get driver address */
-
-	movw	%bx, _C_LABEL(xmsdrv)	/* save es:bx to _xmsdrv */
-	movw	%es, _C_LABEL(xmsdrv) + 2
-
-	movb	$0x08, %ah		/* XMS: query free extended memory */
-#if 0
-	movb	$0x00, %bl
-#endif
-	lcall	*_C_LABEL(xmsdrv)
-	jmp	xdone
-
-noxms:		/* no XMS manager found */
-	mov	$0, %dx
-
-xdone:
-	calll	_C_LABEL(real_to_prot) # back to protected mode
-	.code32
-
-	xorl	%eax, %eax
-	movw	%dx, %ax
-
-	popl	%edi
-	popl	%esi
-	popl	%es
-	popl	%edx
-	popl	%ebx
-	popl	%ebp
-	ret
-
-/*
-	Allocate a block of XMS memory with the requested size
-		void *xmsalloc(long int kBytes);
-
-	Depends on _xmsdrv being set by getextmem() before first call
-	to this function.
-
-	Return value: a physical address.
-*/
-ENTRY(xmsalloc)
-	.code32
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%ebx
-	pushl	%edx
-	pushl	%esi
-	pushl	%e

CVS commit: src/sys/arch/i386/stand

2024-09-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Sep 11 20:15:37 UTC 2024

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile main.c start_dos.S version
src/sys/arch/i386/stand/lib: exec.c

Log Message:
dosboot(8): remove XMS-specific code. The boot process has been broken for over
a decade, and its relevance has diminished due to the availability of other boot
options.

PR port-i386/58624


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/main.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/start_dos.S
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/version
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/i386/stand/lib/exec.c

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



Re: CVS commit: src/sys/sys

2024-09-11 Thread Christos Zoulas
And committed.

christos




Re: CVS commit: src/sys/sys

2024-09-11 Thread Christos Zoulas

On 2024-09-11 11:18 am, Taylor R Campbell wrote:

Date: Thu, 12 Sep 2024 00:05:24 +0900
From: Ryo ONODERA 

"Taylor R Campbell"  writes:

> sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
>
> These are non-standard extensions, so they should not be exposed by,
> e.g., _XOPEN_SOURCE=700.
>
> PR standards/57807: #include  spuriously defines
> le32enc/be32enc/... under _XOPEN_SOURCE=700

After this change, -current build on -current is broken,
because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
cause conflicts.

I think HAVE_NBTOOLS_CONFIG_H part in 
external/cddl/osnet/sys/sys/types.h

may be problematic. However it is not clear how to fix properly.

Could you take a look at this problem?


christos was looking at this yesterday -- christos, did you make
progress after our discussion?


P.S.
I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.


Yes, except I think that whole stanza under HAVE_NBTOOL[S]_CONFIG_H is
wrong and should be replaced by an _unconditional_

#include_next 
#include_next 

without any _NETBSD_SOURCE games (which the tools build should never
play; we go out of our way to use _XOPEN_SOURCE=600 in compat_defs.h
so that _NETBSD_SOURCE does not get used everywhere else in the tools
build, in order to keep the tools build clean and portable).


Yes, close to finish the build and commit changes.

--
christos


Re: CVS commit: src/sys/sys

2024-09-11 Thread Taylor R Campbell
> Date: Thu, 12 Sep 2024 00:05:24 +0900
> From: Ryo ONODERA 
> 
> "Taylor R Campbell"  writes:
> 
> > sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
> >
> > These are non-standard extensions, so they should not be exposed by,
> > e.g., _XOPEN_SOURCE=700.
> >
> > PR standards/57807: #include  spuriously defines
> > le32enc/be32enc/... under _XOPEN_SOURCE=700
> 
> After this change, -current build on -current is broken,
> because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
> cause conflicts.
> 
> I think HAVE_NBTOOLS_CONFIG_H part in external/cddl/osnet/sys/sys/types.h
> may be problematic. However it is not clear how to fix properly.
> 
> Could you take a look at this problem?

christos was looking at this yesterday -- christos, did you make
progress after our discussion?

> P.S.
> I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.

Yes, except I think that whole stanza under HAVE_NBTOOL[S]_CONFIG_H is
wrong and should be replaced by an _unconditional_

#include_next 
#include_next 

without any _NETBSD_SOURCE games (which the tools build should never
play; we go out of our way to use _XOPEN_SOURCE=600 in compat_defs.h
so that _NETBSD_SOURCE does not get used everywhere else in the tools
build, in order to keep the tools build clean and portable).


CVS commit: src/sys/external/bsd/libnv/dist

2024-09-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 11 15:01:11 UTC 2024

Modified Files:
src/sys/external/bsd/libnv/dist: nvlist.c

Log Message:
libnv: Fix pointer/struct confusion in bounds check.

No impact to NetBSD because the path where this bounds check matters
is not used in NetBSD.

Matches upstream FreeBSD change by Mariusz Zaborski
.

CVE-2024-45287

PR security/58652: libnv: Integer overflow and buffer overrun
vulnerabilities


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/libnv/dist/nvlist.c

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



Re: CVS commit: src/sys/sys

2024-09-11 Thread Ryo ONODERA
Hi,

"Taylor R Campbell"  writes:

> Module Name:  src
> Committed By: riastradh
> Date: Mon Sep  9 18:17:14 UTC 2024
>
> Modified Files:
>   src/sys/sys: endian.h
>
> Log Message:
> sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
>
> These are non-standard extensions, so they should not be exposed by,
> e.g., _XOPEN_SOURCE=700.
>
> PR standards/57807: #include  spuriously defines
> le32enc/be32enc/... under _XOPEN_SOURCE=700

After this change, -current build on -current is broken,
because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
cause conflicts.

I think HAVE_NBTOOLS_CONFIG_H part in external/cddl/osnet/sys/sys/types.h
may be problematic. However it is not clear how to fix properly.

Could you take a look at this problem?

P.S.
I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.

Thank you.

> To generate a diff of this commit:
> cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
> Modified files:
>
> Index: src/sys/sys/endian.h
> diff -u src/sys/sys/endian.h:1.33 src/sys/sys/endian.h:1.34
> --- src/sys/sys/endian.h:1.33 Mon Sep  9 15:22:50 2024
> +++ src/sys/sys/endian.h  Mon Sep  9 18:17:14 2024
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $*/
> +/*   $NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $*/
>  
>  /*
>   * Copyright (c) 1987, 1991, 1993
> @@ -192,6 +192,8 @@ __END_DECLS
>   * to/from an octet stream.
>   */
>  
> +#ifdef _NETBSD_SOURCE
> +
>  #if __GNUC_PREREQ__(2, 95)
>  
>  #define __GEN_ENDIAN_ENC(bits, endian) \
> @@ -337,6 +339,8 @@ le64dec(const void *buf)
>  
>  #endif   /* GCC >= 2.95 */
>  
> +#endif   /* _NETBSD_SOURCE */
> +
>  #endif /* !_LOCORE */
>  #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
>  #endif /* !_SYS_ENDIAN_H_ */
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/sys/external/bsd/libnv/dist

2024-09-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 11 15:01:11 UTC 2024

Modified Files:
src/sys/external/bsd/libnv/dist: nvlist.c

Log Message:
libnv: Fix pointer/struct confusion in bounds check.

No impact to NetBSD because the path where this bounds check matters
is not used in NetBSD.

Matches upstream FreeBSD change by Mariusz Zaborski
.

CVE-2024-45287

PR security/58652: libnv: Integer overflow and buffer overrun
vulnerabilities


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/libnv/dist/nvlist.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/external/bsd/libnv/dist/nvlist.c
diff -u src/sys/external/bsd/libnv/dist/nvlist.c:1.10 src/sys/external/bsd/libnv/dist/nvlist.c:1.11
--- src/sys/external/bsd/libnv/dist/nvlist.c:1.10	Wed Sep  4 12:57:00 2024
+++ src/sys/external/bsd/libnv/dist/nvlist.c	Wed Sep 11 15:01:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvlist.c,v 1.10 2024/09/04 12:57:00 riastradh Exp $	*/
+/*	$NetBSD: nvlist.c,v 1.11 2024/09/11 15:01:11 riastradh Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvlist.c 335347 2018-06-18 22:57:32Z oshogbo $");
 #else
-__RCSID("$NetBSD: nvlist.c,v 1.10 2024/09/04 12:57:00 riastradh Exp $");
+__RCSID("$NetBSD: nvlist.c,v 1.11 2024/09/11 15:01:11 riastradh Exp $");
 #endif
 
 #include 
@@ -1074,7 +1074,7 @@ static bool
 nvlist_check_header(struct nvlist_header *nvlhdrp)
 {
 
-	if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) {
+	if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) {
 		ERRNO_SET(EINVAL);
 		return (false);
 	}



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

2024-09-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Sep 11 13:31:13 UTC 2024

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

Log Message:
now that we know how, draw characters by hardware


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/dev/hyperfb.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/hyperfb.c
diff -u src/sys/arch/hppa/dev/hyperfb.c:1.14 src/sys/arch/hppa/dev/hyperfb.c:1.15
--- src/sys/arch/hppa/dev/hyperfb.c:1.14	Wed Sep  4 10:35:43 2024
+++ src/sys/arch/hppa/dev/hyperfb.c	Wed Sep 11 13:31:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperfb.c,v 1.14 2024/09/04 10:35:43 macallan Exp $	*/
+/*	$NetBSD: hyperfb.c,v 1.15 2024/09/11 13:31:13 macallan Exp $	*/
 
 /*
  * Copyright (c) 2024 Michael Lorenz
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.14 2024/09/04 10:35:43 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperfb.c,v 1.15 2024/09/11 13:31:13 macallan Exp $");
 
 #include "opt_cputype.h"
 #include "opt_hyperfb.h"
@@ -1122,8 +1122,9 @@ hyperfb_putchar(void *cookie, int row, i
 	struct wsdisplay_font *font = PICK_FONT(ri, c);
 	struct vcons_screen *scr = ri->ri_hw;
 	struct hyperfb_softc *sc = scr->scr_cookie;
-	int x, y, wi, he/*, rv = GC_NOPE*/;
-	uint32_t bg;
+	uint8_t *data;
+	int i, x, y, wi, he/*, rv = GC_NOPE*/;
+	uint32_t bg, fg, mask;
 
 	if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
 		return;
@@ -1142,19 +1143,54 @@ hyperfb_putchar(void *cookie, int row, i
 	y = ri->ri_yorigin + row * he;
 
 	bg = ri->ri_devcmap[(attr >> 16) & 0xf];
+	fg = ri->ri_devcmap[(attr >> 24) & 0x0f];
 
-	if (c == 0x20) {
-		hyperfb_rectfill(sc, x, y, wi, he, bg);
+	/* clear the character cell */
+	hyperfb_rectfill(sc, x, y, wi, he, bg);
+
+	/* if we're drawing a space we're done here */
+	if (c == 0x20) 
 		return;
-	}
 
 #if 0
 	rv = glyphcache_try(&sc->sc_gc, c, x, y, attr);
 	if (rv == GC_OK)
 		return;
 #endif
-	if (sc->sc_hwmode != HW_FB) hyperfb_setup_fb(sc);
-	sc->sc_putchar(cookie, row, col, c, attr);
+
+	data = WSFONT_GLYPH(c, font);
+
+	hyperfb_wait_fifo(sc, 2);
+
+	/* character colour */
+	hyperfb_write4(sc, NGLE_REG_35, fg);
+	/* dst XY */
+	hyperfb_write4(sc, NGLE_REG_6, (x << 16) | y);
+
+	/*
+	 * drawing a rectangle moves the starting coordinates down the
+	 * y-axis so we can just hammer the wi/he register to draw a full
+	 * character
+	 */
+	if (ri->ri_font->stride == 1) {
+		for (i = 0; i < he; i++) {
+			hyperfb_wait_fifo(sc, 2);
+			mask = ((uint32_t)*data) << 24;
+			hyperfb_write4(sc, NGLE_REG_8, mask);	
+			hyperfb_write4(sc, NGLE_REG_9, (wi << 16) | 1);
+			data++;
+		}
+	} else {
+		for (i = 0; i < he; i++) {
+			hyperfb_wait_fifo(sc, 2);
+			mask = ((uint32_t)*data) << 8;
+			data++;
+			mask |= *data;
+			data++;
+			hyperfb_write4(sc, NGLE_REG_8, mask << 16);	
+			hyperfb_write4(sc, NGLE_REG_9, (wi << 16) | 1);
+		}
+	}
 #if 0
 	if (rv == GC_ADD)
 		glyphcache_add(&sc->sc_gc, c, x, y);



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

2024-09-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Sep 11 13:31:13 UTC 2024

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

Log Message:
now that we know how, draw characters by hardware


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/dev/hyperfb.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-09-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Sep 11 05:17:45 UTC 2024

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

Log Message:
apply some more diagnostic checks for x86 interrupts

convert intr_biglock_wrapper() into a slight less complete
intr_wrapper(), and move the kernel lock/unlock points into
the new intr_biglock_wrapper().

add curlwp->l_nopreempt checking for interrupt handlers,
including the dtrace wrapper.

XXX: has to copy the i8254_clockintr hack.

tested for a few months by myself, and recently by rin@ on both
current and netbsd-10. thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/x86/x86/intr.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-09-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Sep 11 05:17:45 UTC 2024

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

Log Message:
apply some more diagnostic checks for x86 interrupts

convert intr_biglock_wrapper() into a slight less complete
intr_wrapper(), and move the kernel lock/unlock points into
the new intr_biglock_wrapper().

add curlwp->l_nopreempt checking for interrupt handlers,
including the dtrace wrapper.

XXX: has to copy the i8254_clockintr hack.

tested for a few months by myself, and recently by rin@ on both
current and netbsd-10. thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.168 src/sys/arch/x86/x86/intr.c:1.169
--- src/sys/arch/x86/x86/intr.c:1.168	Mon Apr 22 22:29:28 2024
+++ src/sys/arch/x86/x86/intr.c	Wed Sep 11 05:17:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.168 2024/04/22 22:29:28 andvar Exp $	*/
+/*	$NetBSD: intr.c,v 1.169 2024/09/11 05:17:45 mrg Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.168 2024/04/22 22:29:28 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.169 2024/09/11 05:17:45 mrg Exp $");
 
 #include "opt_acpi.h"
 #include "opt_intrdebug.h"
@@ -659,21 +659,25 @@ intr_source_free(struct cpu_info *ci, in
 
 #ifdef MULTIPROCESSOR
 static int intr_biglock_wrapper(void *);
+static int intr_wrapper(void *);
 
 /*
+ * intr_wrapper: perform diagnostic checks before and after calling the
+ * real handler.
  * intr_biglock_wrapper: grab biglock and call a real interrupt handler.
  */
 
 static int
-intr_biglock_wrapper(void *vp)
+intr_wrapper(void *vp)
 {
 	struct intrhand *ih = vp;
+	struct lwp *l = curlwp;
 	int locks;
+	int nopreempt;
 	int ret;
 
-	KERNEL_LOCK(1, NULL);
-
 	locks = curcpu()->ci_biglock_count;
+	nopreempt = l->l_nopreempt;
 	SDT_PROBE3(sdt, kernel, intr, entry,
 	ih->ih_realfun, ih->ih_realarg, ih);
 	ret = (*ih->ih_realfun)(ih->ih_realarg);
@@ -682,11 +686,28 @@ intr_biglock_wrapper(void *vp)
 	KASSERTMSG(locks == curcpu()->ci_biglock_count,
 	"%s @ %p slipped locks %d -> %d",
 	ih->ih_xname, ih->ih_realfun, locks, curcpu()->ci_biglock_count);
+	KASSERTMSG(nopreempt == l->l_nopreempt,
+	"%s @ %p slipped nopreempt %d -> %d lwp %p/%p func %p",
+	ih->ih_xname, ih->ih_realfun, nopreempt, l->l_nopreempt, l, curlwp,
+	ih->ih_realfun);
+
+	return ret;
+}
+
+static int
+intr_biglock_wrapper(void *vp)
+{
+	int ret;
+
+	KERNEL_LOCK(1, NULL);
+
+	ret = intr_wrapper(vp);
 
 	KERNEL_UNLOCK_ONE(NULL);
 
 	return ret;
 }
+
 #endif /* MULTIPROCESSOR */
 
 #ifdef KDTRACE_HOOKS
@@ -694,13 +715,19 @@ static int
 intr_kdtrace_wrapper(void *vp)
 {
 	struct intrhand *ih = vp;
+	struct lwp *l = curlwp;
 	int ret;
 
+	int nopreempt;
+	nopreempt = l->l_nopreempt;
 	SDT_PROBE3(sdt, kernel, intr, entry,
 	ih->ih_realfun, ih->ih_realarg, ih);
 	ret = (*ih->ih_realfun)(ih->ih_realarg);
 	SDT_PROBE4(sdt, kernel, intr, return,
 	ih->ih_realfun, ih->ih_realarg, ih, ret);
+	KASSERTMSG(nopreempt == l->l_nopreempt,
+	"%s @ %p slipped nopreempt %d -> %d  lwp %p/%p",
+	ih->ih_xname, ih->ih_realfun, nopreempt, l->l_nopreempt, l, curlwp);
 
 	return ret;
 }
@@ -966,6 +993,15 @@ intr_establish_xname(int legacy_irq, str
 		__FPTRCAST(int (*)(void *), i8254_clockintr));
 		ih->ih_fun = intr_biglock_wrapper;
 		ih->ih_arg = ih;
+	} else {
+		if (handler !=
+		__FPTRCAST(int (*)(void *), i8254_clockintr)) { /* XXX */
+#ifdef DIAGNOSTIC
+			/* wrap all interrupts */
+			ih->ih_fun = intr_wrapper;
+			ih->ih_arg = ih;
+#endif
+		}
 	}
 #endif /* MULTIPROCESSOR */
 



CVS commit: src/sys/fs/msdosfs

2024-09-10 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Wed Sep 11 00:27:54 UTC 2024

Modified Files:
src/sys/fs/msdosfs: msdosfs_vnops.c

Log Message:
Move the comment intended to introduce msdosfs_fsync back above
msdosfs_fsync (it has been above the wrong function since 1996).
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/fs/msdosfs/msdosfs_vnops.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/fs/msdosfs/msdosfs_vnops.c
diff -u src/sys/fs/msdosfs/msdosfs_vnops.c:1.112 src/sys/fs/msdosfs/msdosfs_vnops.c:1.113
--- src/sys/fs/msdosfs/msdosfs_vnops.c:1.112	Fri Aug 18 21:05:44 2023
+++ src/sys/fs/msdosfs/msdosfs_vnops.c	Wed Sep 11 00:27:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.112 2023/08/18 21:05:44 mrg Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.113 2024/09/11 00:27:54 perseant Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.112 2023/08/18 21:05:44 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.113 2024/09/11 00:27:54 perseant Exp $");
 
 #include 
 #include 
@@ -707,12 +707,6 @@ msdosfs_update(struct vnode *vp, const s
 	}
 }
 
-/*
- * Flush the blocks of a file to disk.
- *
- * This function is worthless for vnodes that represent directories. Maybe we
- * could just do a sync if they try an fsync on a directory file.
- */
 int
 msdosfs_remove(void *v)
 {
@@ -1394,6 +1388,12 @@ msdosfs_pathconf(void *v)
 	/* NOTREACHED */
 }
 
+/*
+ * Flush the blocks of a file to disk.
+ *
+ * This function is worthless for vnodes that represent directories. Maybe we
+ * could just do a sync if they try an fsync on a directory file.
+ */
 int
 msdosfs_fsync(void *v)
 {



CVS commit: src/sys/fs/msdosfs

2024-09-10 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Wed Sep 11 00:27:54 UTC 2024

Modified Files:
src/sys/fs/msdosfs: msdosfs_vnops.c

Log Message:
Move the comment intended to introduce msdosfs_fsync back above
msdosfs_fsync (it has been above the wrong function since 1996).
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/fs/msdosfs/msdosfs_vnops.c

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



CVS commit: src/sys/dev/marvell

2024-09-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Sep 10 17:56:35 UTC 2024

Modified Files:
src/sys/dev/marvell: gtmpsc.c

Log Message:
Fix wrong KGDB condition and remove unused gtmpsc_kgdb_addr variable.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/marvell/gtmpsc.c

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

Modified files:

Index: src/sys/dev/marvell/gtmpsc.c
diff -u src/sys/dev/marvell/gtmpsc.c:1.49 src/sys/dev/marvell/gtmpsc.c:1.50
--- src/sys/dev/marvell/gtmpsc.c:1.49	Wed Jun 12 09:51:27 2024
+++ src/sys/dev/marvell/gtmpsc.c	Tue Sep 10 17:56:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtmpsc.c,v 1.49 2024/06/12 09:51:27 andvar Exp $	*/
+/*	$NetBSD: gtmpsc.c,v 1.50 2024/09/10 17:56:35 andvar Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.49 2024/06/12 09:51:27 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.50 2024/09/10 17:56:35 andvar Exp $");
 
 #include "opt_kgdb.h"
 
@@ -177,7 +177,6 @@ STATIC uint32_t sdma_imask;		/* soft cop
 STATIC struct cnm_state gtmpsc_cnm_state;
 
 #ifdef KGDB
-static int gtmpsc_kgdb_addr;
 static int gtmpsc_kgdb_attached;
 
 STATIC int  gtmpsc_kgdb_getc(void *);
@@ -1220,7 +1219,7 @@ gtmpscshutdown(struct gtmpsc_softc *sc)
 	struct tty *tp;
 
 #ifdef KGDB
-	if (sc->sc_flags & GTMPSCF_KGDB != 0)
+	if (sc->sc_flags & GTMPSC_KGDB)
 		return;
 #endif
 	tp = sc->sc_tty;



CVS commit: src/sys/dev/marvell

2024-09-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Sep 10 17:56:35 UTC 2024

Modified Files:
src/sys/dev/marvell: gtmpsc.c

Log Message:
Fix wrong KGDB condition and remove unused gtmpsc_kgdb_addr variable.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/marvell/gtmpsc.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-09-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 10 08:49:33 UTC 2024

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

Log Message:
as suspected the Visualize EG's rectangle fill function works exactly the same
as HCRX's, so apply the same trick to draw less than 32 pixel wide rectangles
and get rid of the workaround


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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.19 src/sys/arch/hppa/dev/gftfb.c:1.20
--- src/sys/arch/hppa/dev/gftfb.c:1.19	Wed Aug 28 06:20:30 2024
+++ src/sys/arch/hppa/dev/gftfb.c	Tue Sep 10 08:49:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gftfb.c,v 1.19 2024/08/28 06:20:30 macallan Exp $	*/
+/*	$NetBSD: gftfb.c,v 1.20 2024/09/10 08:49:33 macallan Exp $	*/
 
 /*	$OpenBSD: sti_pci.c,v 1.7 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -85,7 +85,6 @@ 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;
@@ -223,8 +222,6 @@ 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);
@@ -654,8 +651,6 @@ 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);
@@ -869,7 +864,6 @@ gftfb_mmap(void *v, void *vs, off_t offs
 	struct sti_rom *rom = sc->sc_base.sc_rom;
 	paddr_t pa = -1;
 
-
 	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)
 		return -1;
 
@@ -1038,28 +1032,32 @@ gftfb_wait_fifo(struct gftfb_softc *sc, 
 }
 
 static void
-gftfb_real_rectfill(struct gftfb_softc *sc, int x, int y, int wi, int he,
+gftfb_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;
 	bus_space_tag_t memt = rom->memt;
 	bus_space_handle_t memh = rom->regh[2];
+	uint32_t mask = 0x;
 
 	if (sc->sc_hwmode != HW_FILL) {
-		gftfb_wait_fifo(sc, 4);
-		/* transfer data */
-		bus_space_write_stream_4(memt, memh, NGLE_REG_8, 0x);
+		gftfb_wait_fifo(sc, 3);
 		/* plane mask */
 		bus_space_write_stream_4(memt, memh, NGLE_REG_13, 0xff);
 		/* bitmap op */
 		bus_space_write_stream_4(memt, memh, NGLE_REG_14, 
-		IBOvals(RopSrc, 0, BitmapExtent08, 0, DataDynamic, MaskOtc, 0, 0));
+		IBOvals(RopSrc, 0, BitmapExtent08, 0, DataDynamic, MaskOtc, 1, 0));
 		/* dst bitmap access */
 		bus_space_write_stream_4(memt, memh, NGLE_REG_11,
 		BA(IndexedDcd, Otc32, OtsIndirect, AddrLong, 0, BINapp0I, 0));
 		sc->sc_hwmode = HW_FILL;
 	}
-	gftfb_wait_fifo(sc, 3);
+	gftfb_wait_fifo(sc, 4);
+
+	if (wi < 32)
+		mask = 0x << (32 - wi);
+	/* transfer data */
+	bus_space_write_stream_4(memt, memh, NGLE_REG_8, mask);
 	bus_space_write_stream_4(memt, memh, NGLE_REG_35, bg);
 	/* dst XY */
 	bus_space_write_stream_4(memt, memh, NGLE_REG_6, (x << 16) | y);
@@ -1069,31 +1067,6 @@ gftfb_real_rectfill(struct gftfb_softc *
 }
 
 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,
 			int he, int rop)
 {



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

2024-09-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 10 08:49:33 UTC 2024

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

Log Message:
as suspected the Visualize EG's rectangle fill function works exactly the same
as HCRX's, so apply the same trick to draw less than 32 pixel wide rectangles
and get rid of the workaround


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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/sys

2024-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep  9 18:38:38 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: sync comment with code


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.34 src/sys/sys/endian.h:1.35
--- src/sys/sys/endian.h:1.34	Mon Sep  9 18:17:14 2024
+++ src/sys/sys/endian.h	Mon Sep  9 18:38:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $	*/
+/*	$NetBSD: endian.h,v 1.35 2024/09/09 18:38:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -74,7 +74,7 @@ uint16_t ntohs(uint16_t) __constfunc;
 __END_DECLS
 
 #endif /* !_LOCORE */
-#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200809L || _NETBSD_SOURCE */
+#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200112L || _NETBSD_SOURCE */
 
 
 #include 



CVS commit: src/sys/sys

2024-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep  9 18:38:38 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: sync comment with code


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/endian.h

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



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 18:17:14 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.

These are non-standard extensions, so they should not be exposed by,
e.g., _XOPEN_SOURCE=700.

PR standards/57807: #include  spuriously defines
le32enc/be32enc/... under _XOPEN_SOURCE=700


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.33 src/sys/sys/endian.h:1.34
--- src/sys/sys/endian.h:1.33	Mon Sep  9 15:22:50 2024
+++ src/sys/sys/endian.h	Mon Sep  9 18:17:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $	*/
+/*	$NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -192,6 +192,8 @@ __END_DECLS
  * to/from an octet stream.
  */
 
+#ifdef _NETBSD_SOURCE
+
 #if __GNUC_PREREQ__(2, 95)
 
 #define __GEN_ENDIAN_ENC(bits, endian) \
@@ -337,6 +339,8 @@ le64dec(const void *buf)
 
 #endif	/* GCC >= 2.95 */
 
+#endif	/* _NETBSD_SOURCE */
+
 #endif /* !_LOCORE */
 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
 #endif /* !_SYS_ENDIAN_H_ */



  1   2   3   4   5   6   7   8   9   10   >