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

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:09:08 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Drop no-longer-available -DSLOW for libz

It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.35 src/sys/arch/i386/stand/dosboot/Makefile:1.36
--- src/sys/arch/i386/stand/dosboot/Makefile:1.35	Mon Nov  6 07:02:17 2023
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 07:09:08 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2023/11/06 07:02:17 rin Exp $
+#	$NetBSD: Makefile,v 1.36 2023/11/06 07:09:08 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -10,7 +10,7 @@ RELOC=		0x100
 
 SRCS= main.c devopen.c exec.c exec_multiboot1.c exec_multiboot2.c
 
-CPPFLAGS+= -DSLOW	# for libz
+#CPPFLAGS+= -DSLOW	# for libz; no longer available
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
 CPPFLAGS+= -DXMS
 CPPFLAGS+= -DLIBSA_ENABLE_LS_OP



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

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:09:08 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Drop no-longer-available -DSLOW for libz

It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:02:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.34 src/sys/arch/i386/stand/dosboot/Makefile:1.35
--- src/sys/arch/i386/stand/dosboot/Makefile:1.34	Mon Nov  6 06:53:52 2023
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 07:02:17 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34 2023/11/06 06:53:52 rin Exp $
+#	$NetBSD: Makefile,v 1.35 2023/11/06 07:02:17 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -34,6 +34,9 @@ I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
 # DOS command line arguments are located at 0x.
 COPTS.doscommain.c+= -fno-delete-null-pointer-checks
 
+# Do not page-align data segment.
+LDFLAGS+= -Wl,-N
+
 VERSIONFILE= ${.CURDIR}/version
 
 .include 



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

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:02:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 06:53:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Allow NULL dereference to fetch command line arguments

DOS command line arguments are provided as struct psp at 0x;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 06:53:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Allow NULL dereference to fetch command line arguments

DOS command line arguments are provided as struct psp at 0x;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.33 src/sys/arch/i386/stand/dosboot/Makefile:1.34
--- src/sys/arch/i386/stand/dosboot/Makefile:1.33	Mon Sep 23 13:42:36 2019
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 06:53:52 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.33 2019/09/23 13:42:36 christos Exp $
+#	$NetBSD: Makefile,v 1.34 2023/11/06 06:53:52 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -31,6 +31,9 @@ SAMISCCPPFLAGS+= -DHEAP_START=0x2 -D
 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no SA_ENABLE_LS_OP=yes
 I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
 
+# DOS command line arguments are located at 0x.
+COPTS.doscommain.c+= -fno-delete-null-pointer-checks
+
 VERSIONFILE= ${.CURDIR}/version
 
 .include 



CVS commit: src

2023-11-05 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov  6 00:35:06 UTC 2023

Modified Files:
src/doc: CHANGES
src/etc: MAKEDEV.tmpl
src/share/man/man4: gpioirq.4
src/sys/conf: majors
src/sys/dev/gpio: gpio.c gpioirq.c gpiovar.h

Log Message:
gpioirq(4) version 2

This update makes this driver more than just an example and allows for:

o More than one pin to be attached to a gpioirq instance.  That is,
  the mask parameter can be greater than 0x01 now.

o A /dev/gpioirqN device that allows GPIO pin interrupts to be
  transported into userland.  This is a device that can be opened for
  reading with a simple fixed output indicating the device unit, pin
  number and current pin state.

This update was used as part of a physical intrusion detection system
where multiple switches (i.e. window magnetic reed switches and etc.)
are tied to a bunch of GPIO inputs with userland software that reacts
to the pins changing state.


To generate a diff of this commit:
cvs rdiff -u -r1.3015 -r1.3016 src/doc/CHANGES
cvs rdiff -u -r1.233 -r1.234 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/gpioirq.4
cvs rdiff -u -r1.102 -r1.103 src/sys/conf/majors
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/gpio/gpioirq.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/gpio/gpiovar.h

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3015 src/doc/CHANGES:1.3016
--- src/doc/CHANGES:1.3015	Sun Nov  5 18:32:01 2023
+++ src/doc/CHANGES	Mon Nov  6 00:35:06 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3015 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3016 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -258,3 +258,6 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		machines. [tsutsui 20231104]
 	ena(4): MP-enable always, add RSS support, and reliability fixes.
 		[jdolecek 20231105]
+	gpioirq(4): allow multiple pins per gpioirq instance, add the ability
+	to use a /dev/gpioirqN device to get pin interrupts into userland.
+		[brad 20231105]

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.233 src/etc/MAKEDEV.tmpl:1.234
--- src/etc/MAKEDEV.tmpl:1.233	Wed Dec 28 19:23:02 2022
+++ src/etc/MAKEDEV.tmpl	Mon Nov  6 00:35:05 2023
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.233 2022/12/28 19:23:02 jakllsch Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.234 2023/11/06 00:35:05 brad Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -232,6 +232,7 @@
 #	dtv*	Digital TV interface
 #	fb*	PMAX generic framebuffer pseudo-device
 #	fd	file descriptors
+#	gpioirq* Interrupts on GPIO pins
 #	gpiopps* 1PPS signals on GPIO pins
 #	grf*	graphics frame buffer device
 #	hdaudio* High Definition audio control device
@@ -830,7 +831,7 @@ all)
 	makedev srt0 srt1 srt2 srt3
 	makedev tap tap0 tap1 tap2 tap3
 	makedev gpio gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
-	makedev gpiopps0
+	makedev gpioirq0 gpiopps0
 	makedev pad pad0 pad1 pad2 pad3
 	makedev bthub
 	makedev putter
@@ -873,6 +874,10 @@ gpio)
 	lndev gpio0 gpio
 	;;
 
+gpioirq)
+	makedev gpioirq0
+	;;
+
 gpiopps)
 	makedev gpiopps0
 	lndev gpiopps0 gpiopps
@@ -1547,6 +1552,11 @@ gpio[0-9]*)
 	mkdev gpio$unit c %gpio_chr% $unit 664 $g_gpio
 	;;
 
+gpioirq[0-9]*)
+	unit=${i#gpioirq}
+	mkdev gpioirq$unit c %gpioirq_chr% $unit 444 $g_gpio
+	;;
+
 gpiopps[0-9]*)
 	unit=${i#gpiopps}
 	mkdev gpiopps$unit c %gpiopps_chr% $unit 664 $g_gpio

Index: src/share/man/man4/gpioirq.4
diff -u src/share/man/man4/gpioirq.4:1.3 src/share/man/man4/gpioirq.4:1.4
--- src/share/man/man4/gpioirq.4:1.3	Tue Aug  1 20:39:15 2023
+++ src/share/man/man4/gpioirq.4	Mon Nov  6 00:35:05 2023
@@ -1,6 +1,6 @@
-.\" $NetBSD: gpioirq.4,v 1.3 2023/08/01 20:39:15 andvar Exp $
+.\" $NetBSD: gpioirq.4,v 1.4 2023/11/06 00:35:05 brad Exp $
 .\"
-.\" Copyright (c) 2016 Brad Spencer 
+.\" Copyright (c) 2016, 2023 Brad Spencer 
 .\"
 .\" Permission to use, copy, modify, and distribute this software for any
 .\" purpose with or without fee is hereby granted, provided that the above
@@ -14,25 +14,26 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd May 11, 2018
+.Dd November 5, 2023
 .Dt GPIOIRQ 4
 .Os
 .Sh NAME
 .Nm gpioirq
-.Nd Install an interrupt handler on a GPIO pin
+.Nd Install an interrupt handler on GPIO pins
 .Sh SYNOPSIS
 .Cd "gpioirq* at gpio? offset 0 mask 0x1 flag 0x00"
 .Sh DESCRIPTION
 The
 .Nm
-driver attaches an interrupt handler to a single GPIO pin.
+driver attaches an interrupt handler to a one or more GPIO pins.
 .Pp
-The pin number is specified in the kernel configuration fil

CVS commit: src

2023-11-05 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov  6 00:35:06 UTC 2023

Modified Files:
src/doc: CHANGES
src/etc: MAKEDEV.tmpl
src/share/man/man4: gpioirq.4
src/sys/conf: majors
src/sys/dev/gpio: gpio.c gpioirq.c gpiovar.h

Log Message:
gpioirq(4) version 2

This update makes this driver more than just an example and allows for:

o More than one pin to be attached to a gpioirq instance.  That is,
  the mask parameter can be greater than 0x01 now.

o A /dev/gpioirqN device that allows GPIO pin interrupts to be
  transported into userland.  This is a device that can be opened for
  reading with a simple fixed output indicating the device unit, pin
  number and current pin state.

This update was used as part of a physical intrusion detection system
where multiple switches (i.e. window magnetic reed switches and etc.)
are tied to a bunch of GPIO inputs with userland software that reacts
to the pins changing state.


To generate a diff of this commit:
cvs rdiff -u -r1.3015 -r1.3016 src/doc/CHANGES
cvs rdiff -u -r1.233 -r1.234 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/gpioirq.4
cvs rdiff -u -r1.102 -r1.103 src/sys/conf/majors
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/gpio/gpioirq.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/gpio/gpiovar.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/playstation2/playstation2

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 22:05:07 UTC 2023

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

Log Message:
Return missing debug message text and remove obsolete sched_whichqs param.

Allows INTR_DEBUG code to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/playstation2/playstation2/interrupt.c

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

Modified files:

Index: src/sys/arch/playstation2/playstation2/interrupt.c
diff -u src/sys/arch/playstation2/playstation2/interrupt.c:1.18 src/sys/arch/playstation2/playstation2/interrupt.c:1.19
--- src/sys/arch/playstation2/playstation2/interrupt.c:1.18	Wed Oct  6 20:36:58 2021
+++ src/sys/arch/playstation2/playstation2/interrupt.c	Sun Nov  5 22:05:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.18 2021/10/06 20:36:58 andvar Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.19 2023/11/05 22:05:07 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.18 2021/10/06 20:36:58 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.19 2023/11/05 22:05:07 andvar Exp $");
 
 #include "debug_playstation2.h"
 #if defined INTR_DEBUG && !defined GSFB_DEBUG_MONITOR
@@ -271,7 +271,7 @@ _debug_print_intr(const char *ident)
 
 	__gsfb_print(0,
 	"CLOCK %-5lld SBUS %-5lld DMAC %-5lld "
-
+	"SR=%08x PC=%08x cpl=%08x intc=%08x dmac=%08x\n",
 	_playstation2_evcnt.clock.ev_count,
 	_playstation2_evcnt.sbus.ev_count,
 	_playstation2_evcnt.dmac.ev_count,
@@ -279,7 +279,7 @@ _debug_print_intr(const char *ident)
 	md_imask,
 	(_reg_read_4(I_MASK_REG) << 16) |
 	(_reg_read_4(I_STAT_REG) & 0x),
-	_reg_read_4(D_STAT_REG), sched_whichqs);
+	_reg_read_4(D_STAT_REG));
 }
 #endif /* INTR_DEBUG */
 



CVS commit: src/sys/arch/playstation2/playstation2

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 22:05:07 UTC 2023

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

Log Message:
Return missing debug message text and remove obsolete sched_whichqs param.

Allows INTR_DEBUG code to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/playstation2/playstation2/interrupt.c

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



CVS commit: src/sys/arch/playstation2

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:54:27 UTC 2023

Modified Files:
src/sys/arch/playstation2/ee: sif.c
src/sys/arch/playstation2/playstation2: clock.c

Log Message:
Fix format specifiers for debug code.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/playstation2/ee/sif.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/playstation2/playstation2/clock.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/playstation2/ee/sif.c
diff -u src/sys/arch/playstation2/ee/sif.c:1.12 src/sys/arch/playstation2/ee/sif.c:1.13
--- src/sys/arch/playstation2/ee/sif.c:1.12	Sat Apr 16 17:35:57 2022
+++ src/sys/arch/playstation2/ee/sif.c	Sun Nov  5 21:54:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sif.c,v 1.12 2022/04/16 17:35:57 andvar Exp $	*/
+/*	$NetBSD: sif.c,v 1.13 2023/11/05 21:54:27 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,10 +30,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sif.c,v 1.12 2022/04/16 17:35:57 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sif.c,v 1.13 2023/11/05 21:54:27 andvar Exp $");
 
 #include "debug_playstation2.h"
 
+#include 
 #include 
 #include 
 #include 
@@ -110,7 +111,7 @@ iopdma_allocate_buffer(struct iopdma_seg
 
 	if (seg->iop_paddr == 0) {
 		printf("%s: can't allocate IOP memory.\n", __func__);
-		DPRINTF("request = %d byte, current total = %#x\n",
+		DPRINTF("request = %lu byte, current total = %#x\n",
 		size, __spd_total_alloc);
 		return (1);
 	}
@@ -120,7 +121,7 @@ iopdma_allocate_buffer(struct iopdma_seg
 #ifdef SIF_DEBUG
 	__spd_total_alloc += size;
 #endif
-	DPRINTF("0x%08lx+%#x (total=%#x)\n", seg->iop_paddr, size,
+	DPRINTF("0x%08x+%#lx (total=%#x)\n", seg->iop_paddr, size,
 	__spd_total_alloc);
 
 	KDASSERT((seg->ee_vaddr & 63) == 0);
@@ -137,6 +138,6 @@ iopdma_free_buffer(struct iopdma_segment
 #ifdef SIF_DEBUG
 	__spd_total_alloc -= seg->size;
 #endif
-	DPRINTF("0x%08lx (total=%#x, result=%d)\n", seg->iop_paddr,
+	DPRINTF("0x%08x (total=%#x, result=%d)\n", seg->iop_paddr,
 	__spd_total_alloc, ret);
 }

Index: src/sys/arch/playstation2/playstation2/clock.c
diff -u src/sys/arch/playstation2/playstation2/clock.c:1.11 src/sys/arch/playstation2/playstation2/clock.c:1.12
--- src/sys/arch/playstation2/playstation2/clock.c:1.11	Thu Nov 20 16:34:25 2014
+++ src/sys/arch/playstation2/playstation2/clock.c	Sun Nov  5 21:54:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.11 2014/11/20 16:34:25 christos Exp $	*/
+/*	$NetBSD: clock.c,v 1.12 2023/11/05 21:54:27 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.11 2014/11/20 16:34:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.12 2023/11/05 21:54:27 andvar Exp $");
 
 #include "debug_playstation2.h"
 
@@ -93,7 +93,7 @@ get_bootinfo_tod(todr_chip_handle_t tch,
 	utc = clock_ymdhms_to_secs(dt) - 9*60*60;
 	clock_secs_to_ymdhms(utc, dt);
 #ifdef DEBUG
-printf("bootinfo: %d/%d/%d/%d/%d/%d rtc_offset %d\n", dt->dt_year,
+printf("bootinfo: %lld/%d/%d/%d/%d/%d rtc_offset %d\n", dt->dt_year,
 	dt->dt_mon, dt->dt_day, dt->dt_hour, dt->dt_min, dt->dt_sec,
 	rtc_offset);
 #endif



CVS commit: src/sys/arch/playstation2

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:54:27 UTC 2023

Modified Files:
src/sys/arch/playstation2/ee: sif.c
src/sys/arch/playstation2/playstation2: clock.c

Log Message:
Fix format specifiers for debug code.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/playstation2/ee/sif.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/playstation2/playstation2/clock.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/playstation2/dev

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:50:27 UTC 2023

Modified Files:
src/sys/arch/playstation2/dev: if_smap.c

Log Message:
Use DPRINTF instead of __gsfb_print() to print smap status.

__gsfb_printf() is defined only with the GSFB_DEBUG_MONITOR option.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/playstation2/dev/if_smap.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/playstation2/dev/if_smap.c
diff -u src/sys/arch/playstation2/dev/if_smap.c:1.35 src/sys/arch/playstation2/dev/if_smap.c:1.36
--- src/sys/arch/playstation2/dev/if_smap.c:1.35	Sun Sep 18 13:03:51 2022
+++ src/sys/arch/playstation2/dev/if_smap.c	Sun Nov  5 21:50:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $	*/
+/*	$NetBSD: if_smap.c,v 1.36 2023/11/05 21:50:27 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.35 2022/09/18 13:03:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.36 2023/11/05 21:50:27 andvar Exp $");
 
 #include "debug_playstation2.h"
 
@@ -712,7 +712,7 @@ void
 __smap_status(int msg)
 {
 	static int cnt;
-	__gsfb_print(1, "%d: tx=%d rx=%d txcnt=%d free=%d cnt=%d\n", msg,
+	DPRINTF("%d: tx=%d rx=%d txcnt=%d free=%d cnt=%d\n", msg,
 	_reg_read_1(SMAP_TXFIFO_FRAME_REG8),
 	_reg_read_1(SMAP_RXFIFO_FRAME_REG8), __sc->tx_desc_cnt,
 	__sc->tx_buf_freesize, cnt++);



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

2023-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Nov  5 21:50:27 UTC 2023

Modified Files:
src/sys/arch/playstation2/dev: if_smap.c

Log Message:
Use DPRINTF instead of __gsfb_print() to print smap status.

__gsfb_printf() is defined only with the GSFB_DEBUG_MONITOR option.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/playstation2/dev/if_smap.c

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



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 21:13:07 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Improve diagnostics when rounding mode tests fail.

Print the correct input, and print the rounding mode for clarity so
you don't have to cross-reference it by line number.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libm/t_fenv.c

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

Modified files:

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.10 src/tests/lib/libm/t_fenv.c:1.11
--- src/tests/lib/libm/t_fenv.c:1.10	Sun Nov  5 16:28:05 2023
+++ src/tests/lib/libm/t_fenv.c	Sun Nov  5 21:13:06 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.10 2023/11/05 16:28:05 riastradh Exp $ */
+/* $NetBSD: t_fenv.c,v 1.11 2023/11/05 21:13:06 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.10 2023/11/05 16:28:05 riastradh Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.11 2023/11/05 21:13:06 riastradh Exp $");
 
 #include 
 
@@ -37,7 +37,7 @@ __RCSID("$NetBSD: t_fenv.c,v 1.10 2023/1
 #ifdef __HAVE_FENV
 
 /* XXXGCC gcc lacks #pragma STDC FENV_ACCESS */
-/* XXXCLANG clang lacks #pragma STDC FENV_ACCESS on some ports */
+/* XXXclang clang lacks #pragma STDC FENV_ACCESS on some ports */
 #if !defined(__GNUC__)
 #pragma STDC FENV_ACCESS ON
 #endif
@@ -111,7 +111,7 @@ checkfltrounds(void)
 }
 
 static void
-checkrounding(int feround)
+checkrounding(int feround, const char *name)
 {
 	volatile double ulp1 = DBL_EPSILON;
 	double y1 = -1 + ulp1/4;
@@ -121,29 +121,45 @@ checkrounding(int feround)
 	case FE_TONEAREST: {
 		double z1 = -1;
 		double z2 = 1 + 2*ulp1;
-		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
-		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		ATF_CHECK_EQ_MSG(y1, z1, "%s[-1 + ulp(1)/4]"
+		" expected=%a actual=%a",
+		name, y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "%s[1 + 3*(ulp(1)/2)]"
+		" expected=%a actual=%a",
+		name, y2, z2);
 		break;
 	}
 	case FE_TOWARDZERO: {
 		double z1 = -1 + ulp1/2;
 		double z2 = 1 + ulp1;
-		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
-		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		ATF_CHECK_EQ_MSG(y1, z1, "%s[-1 + ulp(1)/4]"
+		" expected=%a actual=%a",
+		name, y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "%s[1 + 3*(ulp(1)/2)]"
+		" expected=%a actual=%a",
+		name, y2, z2);
 		break;
 	}
 	case FE_UPWARD: {
 		double z1 = -1 + ulp1/2;
 		double z2 = 1 + 2*ulp1;
-		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
-		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		ATF_CHECK_EQ_MSG(y1, z1, "%s[-1 + ulp(1)/4]"
+		" expected=%a actual=%a",
+		name, y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "%s[1 + 3*(ulp(1)/2)]"
+		" expected=%a actual=%a",
+		name, y2, z2);
 		break;
 	}
 	case FE_DOWNWARD: {
 		double z1 = -1;
 		double z2 = 1 + ulp1;
-		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
-		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		ATF_CHECK_EQ_MSG(y1, z1, "%s[-1 + ulp(1)/4]"
+		" expected=%a actual=%a",
+		name, y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "%s[1 + 3*(ulp(1)/2)]"
+		" expected=%a actual=%a",
+		name, y2, z2);
 		break;
 	}
 	}
@@ -162,35 +178,35 @@ ATF_TC_BODY(fegetround, tc)
 {
 	FPU_RND_PREREQ();
 
-	checkrounding(FE_TONEAREST);
+	checkrounding(FE_TONEAREST, "FE_TONEAREST");
 
 	fpsetround(FP_RZ);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TOWARDZERO,
 	"fegetround()=%d FE_TOWARDZERO=%d",
 	fegetround(), FE_TOWARDZERO);
 	checkfltrounds();
-	checkrounding(FE_TOWARDZERO);
+	checkrounding(FE_TOWARDZERO, "FE_TOWARDZERO");
 
 	fpsetround(FP_RM);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_DOWNWARD,
 	"fegetround()=%d FE_DOWNWARD=%d",
 	fegetround(), FE_DOWNWARD);
 	checkfltrounds();
-	checkrounding(FE_DOWNWARD);
+	checkrounding(FE_DOWNWARD, "FE_DOWNWARD");
 
 	fpsetround(FP_RN);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TONEAREST,
 	"fegetround()=%d FE_TONEAREST=%d",
 	fegetround(), FE_TONEAREST);
 	checkfltrounds();
-	checkrounding(FE_TONEAREST);
+	checkrounding(FE_TONEAREST, "FE_TONEAREST");
 
 	fpsetround(FP_RP);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_UPWARD,
 	"fegetround()=%d FE_UPWARD=%d",
 	fegetround(), FE_UPWARD);
 	checkfltrounds();
-	checkrounding(FE_UPWARD);
+	checkrounding(FE_UPWARD, "FE_UPWARD");
 }
 
 ATF_TC(fesetround);
@@ -206,35 +222,35 @@ ATF_TC_BODY(fesetround, tc)
 {
 	FPU_RND_PREREQ();
 
-	checkrounding(FE_TONEAREST);
+	checkrounding(FE_TONEAREST, "FE_TONEAREST");
 
 	fesetround(FE_TOWARDZERO);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RZ,
 	"fpgetround()=%d FP_RZ=%d",
 	(int)fpgetround(), (int)FP_RZ);
 	checkfltrounds();
-	

CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 21:13:07 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Improve diagnostics when rounding mode tests fail.

Print the correct input, and print the rounding mode for clarity so
you don't have to cross-reference it by line number.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libm/t_fenv.c

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



CVS commit: src/doc

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:32:01 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
ena(4) improvements committed

Pull request: https://github.com/maleic1618/NetBSD/pull/1:
"""
This PR fixes some bugs and MP-ifies ena(4), including RSS.

On t3.small instance, its forward throughput has grown as followings:

   64 bytes 256 bytes
-current 1flow  21.58   110.51
-current 8flow  28.27   123.19
patched 1flow   37.20   142.21
patched 8flow   92.26   366.85
(Unit: Mbps, NET_MPSAFE enabled, Using https://github.com/iij/ipgen)

It also worked well on a aarch64 machine.

Addendum: I forgot to mention that this PR is reviewed ozaki-r@n.o.
"""

Code contributed by KUSABA Takeshi 
Reviewed also by ozaki-r@n.o


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3014 src/doc/CHANGES:1.3015
--- src/doc/CHANGES:1.3014	Sat Nov  4 15:33:26 2023
+++ src/doc/CHANGES	Sun Nov  5 18:32:01 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3014 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3015 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -256,3 +256,5 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	OpenSSH: Import 9.5. [christos 20231025]
 	newsmips: Add support for LCD-MONO framebuffer on NWS-32x0 laptop
 		machines. [tsutsui 20231104]
+	ena(4): MP-enable always, add RSS support, and reliability fixes.
+		[jdolecek 20231105]



CVS commit: src/doc

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:32:01 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
ena(4) improvements committed

Pull request: https://github.com/maleic1618/NetBSD/pull/1:
"""
This PR fixes some bugs and MP-ifies ena(4), including RSS.

On t3.small instance, its forward throughput has grown as followings:

   64 bytes 256 bytes
-current 1flow  21.58   110.51
-current 8flow  28.27   123.19
patched 1flow   37.20   142.21
patched 8flow   92.26   366.85
(Unit: Mbps, NET_MPSAFE enabled, Using https://github.com/iij/ipgen)

It also worked well on a aarch64 machine.

Addendum: I forgot to mention that this PR is reviewed ozaki-r@n.o.
"""

Code contributed by KUSABA Takeshi 
Reviewed also by ozaki-r@n.o


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

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



CVS commit: [netbsd-10] src

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 18:30:08 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0
src/external/gpl2/groff/tmac [netbsd-10]: mdoc.local
src/sys/sys [netbsd-10]: param.h

Log Message:
Welcome to 10.0_RC1!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.157 -r1.1.2.158 src/doc/CHANGES-10.0
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.722.2.1 -r1.722.2.2 src/sys/sys/param.h

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.157 src/doc/CHANGES-10.0:1.1.2.158
--- src/doc/CHANGES-10.0:1.1.2.157	Sun Nov  5 17:45:25 2023
+++ src/doc/CHANGES-10.0	Sun Nov  5 18:30:08 2023
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-10.0,v 1.1.2.157 2023/11/05 17:45:25 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.158 2023/11/05 18:30:08 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -14077,3 +14077,8 @@ sys/arch/newsmips/dev/fb.c			1.30-1.34
 	newsmips: add NWS-3260 LCD-MONO support.
 	[tsutsui, ticket #459]
 
+distrib/notes/common/main			(manually edited)
+external/gpl2/groff/tmac/mdoc.local		(manually edited)
+sys/sys/param.h	(manually edited)
+
+	Welcome to 10.0_RC1

Index: src/external/gpl2/groff/tmac/mdoc.local
diff -u src/external/gpl2/groff/tmac/mdoc.local:1.7.6.1 src/external/gpl2/groff/tmac/mdoc.local:1.7.6.2
--- src/external/gpl2/groff/tmac/mdoc.local:1.7.6.1	Fri Dec 16 19:12:49 2022
+++ src/external/gpl2/groff/tmac/mdoc.local	Sun Nov  5 18:30:08 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdoc.local,v 1.7.6.1 2022/12/16 19:12:49 martin Exp $
+.\" $NetBSD: mdoc.local,v 1.7.6.2 2023/11/05 18:30:08 martin Exp $
 .\"
 .\" Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -46,7 +46,7 @@
 .\" Default .Os value
 .ds doc-operating-system NetBSD\~10.0_BETA
 .\" Default footer operating system value
-.ds doc-default-operating-system NetBSD\~10.0_BETA
+.ds doc-default-operating-system NetBSD\~10.0_RC1
 .\" Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.722.2.1 src/sys/sys/param.h:1.722.2.2
--- src/sys/sys/param.h:1.722.2.1	Fri Dec 16 19:12:49 2022
+++ src/sys/sys/param.h	Sun Nov  5 18:30:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.722.2.1 2022/12/16 19:12:49 martin Exp $	*/
+/*	$NetBSD: param.h,v 1.722.2.2 2023/11/05 18:30:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	10	/* NetBSD 10.0_BETA */
+#define	__NetBSD_Version__	10	/* NetBSD 10.0_RC1 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: [netbsd-10] src

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 18:30:08 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0
src/external/gpl2/groff/tmac [netbsd-10]: mdoc.local
src/sys/sys [netbsd-10]: param.h

Log Message:
Welcome to 10.0_RC1!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.157 -r1.1.2.158 src/doc/CHANGES-10.0
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.722.2.1 -r1.722.2.2 src/sys/sys/param.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/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:26:11 UTC 2023

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

Log Message:
ena(4): stop management first when detaching

Code contributed by KUSABA Takeshi 


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

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



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:26:11 UTC 2023

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

Log Message:
ena(4): stop management first when detaching

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_ena.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_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.39 src/sys/dev/pci/if_ena.c:1.40
--- src/sys/dev/pci/if_ena.c:1.39	Sun Nov  5 18:23:29 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:26:11 2023
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.39 2023/11/05 18:23:29 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.40 2023/11/05 18:26:11 jdolecek Exp $");
 
 #include 
 #include 
@@ -3885,6 +3885,7 @@ ena_detach(device_t pdev, int flags)
 		return (EBUSY);
 	}
 
+	ena_com_set_admin_running_state(ena_dev, false);
 	ENA_CORE_MTX_LOCK(adapter);
 	ena_down(adapter);
 	ENA_CORE_MTX_UNLOCK(adapter);



CVS commit: src/sys/external/bsd/ena-com

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:24:31 UTC 2023

Modified Files:
src/sys/external/bsd/ena-com: ena_com.c

Log Message:
ena(4): destroy all wait_event

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/ena-com/ena_com.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/ena-com/ena_com.c
diff -u src/sys/external/bsd/ena-com/ena_com.c:1.3 src/sys/external/bsd/ena-com/ena_com.c:1.4
--- src/sys/external/bsd/ena-com/ena_com.c:1.3	Sun Nov  5 18:21:54 2023
+++ src/sys/external/bsd/ena-com/ena_com.c	Sun Nov  5 18:24:31 2023
@@ -1584,13 +1584,20 @@ void ena_com_admin_destroy(struct ena_co
 	struct ena_com_admin_sq *sq = _queue->sq;
 	struct ena_com_aenq *aenq = _dev->aenq;
 	u16 size;
-
-	ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event);
+	int i;
 
 	ENA_SPINLOCK_DESTROY(admin_queue->q_lock);
 
 	if (admin_queue->comp_ctx) {
-		size_t s = admin_queue->q_depth * sizeof(struct ena_comp_ctx);
+		size_t s;
+
+		for (i = 0; i < admin_queue->q_depth; i++) {
+			struct ena_comp_ctx *comp_ctx = get_comp_ctxt(admin_queue, i, false);
+			if (comp_ctx != NULL)
+ENA_WAIT_EVENT_DESTROY(comp_ctx->wait_event);
+		}
+
+		s = admin_queue->q_depth * sizeof(struct ena_comp_ctx);
 		ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx, s);
 	}
 	admin_queue->comp_ctx = NULL;



CVS commit: src/sys/external/bsd/ena-com

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:24:31 UTC 2023

Modified Files:
src/sys/external/bsd/ena-com: ena_com.c

Log Message:
ena(4): destroy all wait_event

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/ena-com/ena_com.c

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



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:23:29 UTC 2023

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

Log Message:
ena(4): establish interrupt after setting up resources

Code contributed by KUSABA Takeshi 


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

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



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:23:29 UTC 2023

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

Log Message:
ena(4): establish interrupt after setting up resources

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/if_ena.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_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.38 src/sys/dev/pci/if_ena.c:1.39
--- src/sys/dev/pci/if_ena.c:1.38	Sun Nov  5 18:21:54 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:23:29 2023
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.38 2023/11/05 18:21:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.39 2023/11/05 18:23:29 jdolecek Exp $");
 
 #include 
 #include 
@@ -2243,13 +2243,6 @@ ena_up(struct ena_adapter *adapter)
 	if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) {
 		device_printf(adapter->pdev, "device is going UP\n");
 
-		/* setup interrupts for IO queues */
-		rc = ena_request_io_irq(adapter);
-		if (unlikely(rc != 0)) {
-			ena_trace(ENA_ALERT, "err_req_irq");
-			goto err_req_irq;
-		}
-
 		/* allocate transmit descriptors */
 		rc = ena_setup_all_tx_resources(adapter);
 		if (unlikely(rc != 0)) {
@@ -2272,6 +2265,13 @@ ena_up(struct ena_adapter *adapter)
 			goto err_io_que;
 		}
 
+		/* setup interrupts for IO queues */
+		rc = ena_request_io_irq(adapter);
+		if (unlikely(rc != 0)) {
+			ena_trace(ENA_ALERT, "err_req_irq");
+			goto err_req_irq;
+		}
+
 		if (unlikely(ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, adapter)))
 			if_link_state_change(adapter->ifp, LINK_STATE_UP);
 



CVS commit: src/sys

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:21:55 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c
src/sys/external/bsd/ena-com: ena_com.c

Log Message:
ena(4): prevent AENQ handler from use-after-free

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/ena-com/ena_com.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_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.37 src/sys/dev/pci/if_ena.c:1.38
--- src/sys/dev/pci/if_ena.c:1.37	Sun Nov  5 18:18:56 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:21:54 2023
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.37 2023/11/05 18:18:56 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.38 2023/11/05 18:21:54 jdolecek Exp $");
 
 #include 
 #include 
@@ -3896,21 +3896,8 @@ ena_detach(device_t pdev, int flags)
 	workqueue_destroy(adapter->reset_tq);
 	adapter->reset_tq = NULL;
 
-	if (adapter->ifp != NULL) {
-		ether_ifdetach(adapter->ifp);
-		if_detach(adapter->ifp);
-	}
-	ifmedia_fini(>media);
-
 	ena_free_all_io_rings_resources(adapter);
 
-	ena_free_counters((struct evcnt *)>hw_stats,
-	sizeof(struct ena_hw_stats),
-	offsetof(struct ena_hw_stats, rx_packets));
-	ena_free_counters((struct evcnt *)>dev_stats,
-	sizeof(struct ena_stats_dev),
-offsetof(struct ena_stats_dev, wd_expired));
-
 	if (likely(adapter->rss_support))
 		ena_com_rss_destroy(ena_dev);
 
@@ -3944,6 +3931,19 @@ ena_detach(device_t pdev, int flags)
 
 	ena_free_pci_resources(adapter);
 
+	ena_free_counters((struct evcnt *)>hw_stats,
+	sizeof(struct ena_hw_stats),
+	offsetof(struct ena_hw_stats, rx_packets));
+	ena_free_counters((struct evcnt *)>dev_stats,
+	sizeof(struct ena_stats_dev),
+offsetof(struct ena_stats_dev, wd_expired));
+
+	if (adapter->ifp != NULL) {
+		ether_ifdetach(adapter->ifp);
+		if_detach(adapter->ifp);
+	}
+	ifmedia_fini(>media);
+
 	mutex_destroy(>global_mtx);
 
 	if (ena_dev->bus != NULL)

Index: src/sys/external/bsd/ena-com/ena_com.c
diff -u src/sys/external/bsd/ena-com/ena_com.c:1.2 src/sys/external/bsd/ena-com/ena_com.c:1.3
--- src/sys/external/bsd/ena-com/ena_com.c:1.2	Sun Nov  5 18:15:02 2023
+++ src/sys/external/bsd/ena-com/ena_com.c	Sun Nov  5 18:21:54 2023
@@ -1392,6 +1392,12 @@ void ena_com_wait_for_abort_completion(s
 	struct ena_com_admin_queue *admin_queue = _dev->admin_queue;
 	unsigned long flags;
 
+	/*
+	 * XXX: workaround for missing synchronization mechanism of AENQ handler
+	 * Wait 20ms for safety though it have not panicked actually.
+	 */
+	ENA_MSLEEP(20);
+
 	ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags);
 	while (ATOMIC32_READ(_queue->outstanding_cmds) != 0) {
 		ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags);



CVS commit: src/sys

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:21:55 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c
src/sys/external/bsd/ena-com: ena_com.c

Log Message:
ena(4): prevent AENQ handler from use-after-free

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/ena-com/ena_com.c

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



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:18:56 UTC 2023

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

Log Message:
ena(4) is MP-ready, always use MPSAFE

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/if_ena.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_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.36 src/sys/dev/pci/if_ena.c:1.37
--- src/sys/dev/pci/if_ena.c:1.36	Sun Nov  5 18:17:41 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:18:56 2023
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.36 2023/11/05 18:17:41 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.37 2023/11/05 18:18:56 jdolecek Exp $");
 
 #include 
 #include 
@@ -61,14 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1
 
 #include 
 
-#ifdef NET_MPSAFE
-#define	WQ_FLAGS	WQ_MPSAFE
-#define	CALLOUT_FLAGS	CALLOUT_MPSAFE
-#else
-#define	WQ_FLAGS	0
-#define	CALLOUT_FLAGS	0
-#endif
-
 /*
  *  Function prototypes
  */
@@ -728,7 +720,7 @@ ena_setup_tx_resources(struct ena_adapte
 
 	/* Allocate workqueues */
 	int rc = workqueue_create(_ring->enqueue_tq, "ena_tx_enq",
-	ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
+	ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
 	if (unlikely(rc != 0)) {
 		ena_trace(ENA_ALERT,
 		"Unable to create workqueue for enqueue task\n");
@@ -923,7 +915,7 @@ ena_setup_rx_resources(struct ena_adapte
 
 	/* Allocate workqueues */
 	int rc = workqueue_create(_ring->cleanup_tq, "ena_rx_comp",
-	ena_cleanup, que, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
+	ena_cleanup, que, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
 	if (unlikely(rc != 0)) {
 		ena_trace(ENA_ALERT,
 		"Unable to create workqueue for RX completion task\n");
@@ -2013,6 +2005,9 @@ ena_request_mgmnt_irq(struct ena_adapter
 	KASSERT(adapter->sc_intrs != NULL);
 	KASSERT(adapter->sc_ihs[irq_slot] == NULL);
 
+	pci_intr_setattr(pc, >sc_intrs[irq_slot],
+	PCI_INTR_MPSAFE, true);
+
 	snprintf(intr_xname, sizeof(intr_xname), "%s mgmnt",
 	device_xname(adapter->pdev));
 	intrstr = pci_intr_string(pc, adapter->sc_intrs[irq_slot],
@@ -2058,6 +2053,9 @@ ena_request_io_irq(struct ena_adapter *a
 		KASSERT((void *)adapter->sc_intrs[irq_slot] != NULL);
 		KASSERT(adapter->sc_ihs[irq_slot] == NULL);
 
+		pci_intr_setattr(pc, >sc_intrs[irq_slot],
+		PCI_INTR_MPSAFE, true);
+
 		snprintf(intr_xname, sizeof(intr_xname), "%s ioq%d",
 		device_xname(adapter->pdev), i);
 		intrstr = pci_intr_string(pc, adapter->sc_intrs[irq_slot],
@@ -2552,6 +2550,7 @@ ena_setup_ifnet(device_t pdev, struct en
 	if_setsoftc(ifp, adapter);
 
 	if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
+	ifp->if_extflags = IFEF_MPSAFE;
 	if_setinitfn(ifp, ena_init);
 	ifp->if_stop = ena_stop;
 	if_settransmitfn(ifp, ena_mq_start);
@@ -3817,12 +3816,12 @@ ena_attach(device_t parent, device_t sel
 		goto err_ifp_free;
 	}
 
-	callout_init(>timer_service, CALLOUT_FLAGS);
+	callout_init(>timer_service, CALLOUT_MPSAFE);
 	callout_setfunc(>timer_service, ena_timer_service, adapter);
 
 	/* Initialize reset task queue */
 	rc = workqueue_create(>reset_tq, "ena_reset_enq",
-	ena_reset_task, adapter, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
+	ena_reset_task, adapter, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
 	if (unlikely(rc != 0)) {
 		ena_trace(ENA_ALERT,
 		"Unable to create workqueue for reset task\n");



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:18:56 UTC 2023

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

Log Message:
ena(4) is MP-ready, always use MPSAFE

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/if_ena.c

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



CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:17:41 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c if_enavar.h

Log Message:
ena(4): support RSS and delete FreeBSD-specified code

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_enavar.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/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.35 src/sys/dev/pci/if_ena.c:1.36
--- src/sys/dev/pci/if_ena.c:1.35	Sun Nov  5 18:15:02 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:17:41 2023
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.35 2023/11/05 18:15:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.36 2023/11/05 18:17:41 jdolecek Exp $");
 
 #include 
 #include 
@@ -106,6 +106,7 @@ static void	ena_free_all_io_rings_resour
 static int	ena_get_dev_offloads(struct ena_com_dev_get_features_ctx *);
 static int	ena_setup_ifnet(device_t, struct ena_adapter *,
 		struct ena_com_dev_get_features_ctx *);
+static void	ena_rss_init_default(device_t);
 
 static inline void	ena_alloc_counters_rx(struct ena_adapter *,
 			struct ena_stats_rx *, int);
@@ -217,8 +218,6 @@ static void	ena_rx_hash_mbuf(struct ena_
 struct mbuf *);
 static uint64_t	ena_get_counter(struct ifnet *, ift_counter);
 static void	ena_qflush(struct ifnet *);
-static int	ena_rss_init_default(struct ena_adapter *);
-static void	ena_rss_init_default_deferred(void *);
 #endif
 
 static const char ena_version[] =
@@ -693,9 +692,6 @@ ena_setup_tx_resources(struct ena_adapte
 	struct ena_que *que = >que[qid];
 	struct ena_ring *tx_ring = que->tx_ring;
 	int size, i, err;
-#ifdef	RSS
-	cpuset_t cpu_mask;
-#endif
 
 	size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size;
 	tx_ring->tx_buffer_info = kmem_zalloc(size, KM_SLEEP);
@@ -739,20 +735,6 @@ ena_setup_tx_resources(struct ena_adapte
 		i = tx_ring->ring_size;
 		goto err_buf_info_unmap;
 	}
-
-#if 0
-	/* RSS set cpu for thread */
-#ifdef RSS
-	CPU_SETOF(que->cpu, _mask);
-	taskqueue_start_threads_cpuset(_ring->enqueue_tq, 1, IPL_NET,
-	_mask, "%s tx_ring enq (bucket %d)",
-	device_xname(adapter->pdev), que->cpu);
-#else /* RSS */
-	taskqueue_start_threads(_ring->enqueue_tq, 1, IPL_NET,
-	"%s txeq %d", device_xname(adapter->pdev), que->cpu);
-#endif /* RSS */
-#endif
-
 	return (0);
 
 err_buf_info_unmap:
@@ -886,9 +868,6 @@ ena_setup_rx_resources(struct ena_adapte
 	struct ena_que *que = >que[qid];
 	struct ena_ring *rx_ring = que->rx_ring;
 	int size, err, i;
-#ifdef	RSS
-	cpuset_t cpu_mask;
-#endif
 
 	size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size;
 
@@ -951,19 +930,6 @@ ena_setup_rx_resources(struct ena_adapte
 		goto err_buf_info_unmap;
 	}
 
-#if 0
-	/* RSS set cpu for thread */
-#ifdef RSS
-	CPU_SETOF(que->cpu, _mask);
-	taskqueue_start_threads_cpuset(_ring->cmpl_tq, 1, IPL_NET, _mask,
-	"%s rx_ring cmpl (bucket %d)",
-	device_xname(adapter->pdev), que->cpu);
-#else
-	taskqueue_start_threads(_ring->cmpl_tq, 1, IPL_NET,
-	"%s rx_ring cmpl %d", device_xname(adapter->pdev), que->cpu);
-#endif
-#endif
-
 	return (0);
 
 err_buf_info_unmap:
@@ -3071,24 +3037,8 @@ ena_mq_start(struct ifnet *ifp, struct m
 	 * same bucket that the current CPU we're on is.
 	 * It should improve performance.
 	 */
-#if 0
-	if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
-#ifdef	RSS
-		if (rss_hash2bucket(m->m_pkthdr.flowid,
-		M_HASHTYPE_GET(m), ) == 0) {
-			i = i % adapter->num_queues;
+	i = cpu_index(curcpu()) % adapter->num_queues;
 
-		} else
-#endif
-		{
-			i = m->m_pkthdr.flowid % adapter->num_queues;
-		}
-	} else {
-#endif
-		i = cpu_index(curcpu()) % adapter->num_queues;
-#if 0
-	}
-#endif
 	tx_ring = >tx_ring[i];
 
 	/* Check if drbr is empty before putting packet */
@@ -3151,9 +3101,6 @@ ena_calc_io_queue_num(struct pci_attach_
 	/* 1 IRQ for mgmnt and 1 IRQ for each TX/RX pair */
 	io_queue_num = min_t(int, io_queue_num,
 	pci_msix_count(pa->pa_pc, pa->pa_tag) - 1);
-#ifdef	RSS
-	io_queue_num = min_t(int, io_queue_num, rss_getnumbuckets());
-#endif
 
 	return (io_queue_num);
 }
@@ -3197,10 +3144,10 @@ ena_calc_queue_size(struct ena_adapter *
 	return (queue_size);
 }
 
-#if 0
-static int
-ena_rss_init_default(struct ena_adapter *adapter)
+static void
+ena_rss_init_default(device_t self)
 {
+	struct ena_adapter *adapter = device_private(self);
 	struct ena_com_dev *ena_dev = adapter->ena_dev;
 	device_t dev = adapter->pdev;
 	int qid, rc, i;
@@ -3208,16 +3155,11 @@ ena_rss_init_default(struct ena_adapter 
 	rc = ena_com_rss_init(ena_dev, ENA_RX_RSS_TABLE_LOG_SIZE);
 	if (unlikely(rc != 0)) {
 		device_printf(dev, "Cannot init indirect table\n");
-		return (rc);
+		return;
 	}
 
 	for (i = 

CVS commit: src/sys/dev/pci

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:17:41 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c if_enavar.h

Log Message:
ena(4): support RSS and delete FreeBSD-specified code

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_enavar.h

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



CVS commit: src/sys

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:15:02 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c
src/sys/external/bsd/ena-com: ena_com.c ena_com.h ena_plat.h

Log Message:
ena(4): replace malloc(9) to kmem(9)

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/ena-com/ena_com.c \
src/sys/external/bsd/ena-com/ena_com.h
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/ena-com/ena_plat.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/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.34 src/sys/dev/pci/if_ena.c:1.35
--- src/sys/dev/pci/if_ena.c:1.34	Thu Sep 21 09:31:50 2023
+++ src/sys/dev/pci/if_ena.c	Sun Nov  5 18:15:02 2023
@@ -36,15 +36,15 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.34 2023/09/21 09:31:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.35 2023/11/05 18:15:02 jdolecek Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -698,10 +698,10 @@ ena_setup_tx_resources(struct ena_adapte
 #endif
 
 	size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size;
-	tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
+	tx_ring->tx_buffer_info = kmem_zalloc(size, KM_SLEEP);
 
 	size = sizeof(uint16_t) * tx_ring->ring_size;
-	tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
+	tx_ring->free_tx_ids = kmem_zalloc(size, KM_SLEEP);
 
 	/* Req id stack for TX OOO completions */
 	for (i = 0; i < tx_ring->ring_size; i++)
@@ -760,9 +760,11 @@ err_buf_info_unmap:
 		bus_dmamap_destroy(adapter->sc_dmat,
 		tx_ring->tx_buffer_info[i].map);
 	}
-	free(tx_ring->free_tx_ids, M_DEVBUF);
+	size = sizeof(uint16_t) * tx_ring->ring_size;
+	kmem_free(tx_ring->free_tx_ids, size);
 	tx_ring->free_tx_ids = NULL;
-	free(tx_ring->tx_buffer_info, M_DEVBUF);
+	size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size;
+	kmem_free(tx_ring->tx_buffer_info, size);
 	tx_ring->tx_buffer_info = NULL;
 
 	return (ENOMEM);
@@ -802,10 +804,11 @@ ena_free_tx_resources(struct ena_adapter
 	}
 
 	/* And free allocated memory. */
-	free(tx_ring->tx_buffer_info, M_DEVBUF);
+	kmem_free(tx_ring->tx_buffer_info,
+	sizeof(struct ena_tx_buffer) * tx_ring->ring_size);
 	tx_ring->tx_buffer_info = NULL;
 
-	free(tx_ring->free_tx_ids, M_DEVBUF);
+	kmem_free(tx_ring->free_tx_ids, sizeof(uint16_t) * tx_ring->ring_size);
 	tx_ring->free_tx_ids = NULL;
 }
 
@@ -895,10 +898,10 @@ ena_setup_rx_resources(struct ena_adapte
 	 */
 	size += sizeof(struct ena_rx_buffer);
 
-	rx_ring->rx_buffer_info = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
+	rx_ring->rx_buffer_info = kmem_zalloc(size, KM_SLEEP);
 
 	size = sizeof(uint16_t) * rx_ring->ring_size;
-	rx_ring->free_rx_ids = malloc(size, M_DEVBUF, M_WAITOK);
+	rx_ring->free_rx_ids = kmem_zalloc(size, KM_SLEEP);
 
 	for (i = 0; i < rx_ring->ring_size; i++)
 		rx_ring->free_rx_ids[i] = i;
@@ -969,9 +972,11 @@ err_buf_info_unmap:
 		rx_ring->rx_buffer_info[i].map);
 	}
 
-	free(rx_ring->free_rx_ids, M_DEVBUF);
+	size = sizeof(uint16_t) * rx_ring->ring_size;
+	kmem_free(rx_ring->free_rx_ids, size);
 	rx_ring->free_rx_ids = NULL;
-	free(rx_ring->rx_buffer_info, M_DEVBUF);
+	size = sizeof(struct ena_rx_buffer) * (rx_ring->ring_size + 1);
+	kmem_free(rx_ring->rx_buffer_info, size);
 	rx_ring->rx_buffer_info = NULL;
 	return (ENOMEM);
 }
@@ -1008,10 +1013,11 @@ ena_free_rx_resources(struct ena_adapter
 #endif
 
 	/* free allocated memory */
-	free(rx_ring->rx_buffer_info, M_DEVBUF);
+	kmem_free(rx_ring->rx_buffer_info,
+	sizeof(struct ena_rx_buffer) * (rx_ring->ring_size + 1));
 	rx_ring->rx_buffer_info = NULL;
 
-	free(rx_ring->free_rx_ids, M_DEVBUF);
+	kmem_free(rx_ring->free_rx_ids, sizeof(uint16_t) * rx_ring->ring_size);
 	rx_ring->free_rx_ids = NULL;
 }
 
@@ -3811,13 +3817,11 @@ ena_attach(device_t parent, device_t sel
 	}
 
 	/* Allocate memory for ena_dev structure */
-	ena_dev = malloc(sizeof(struct ena_com_dev), M_DEVBUF,
-	M_WAITOK | M_ZERO);
+	ena_dev = kmem_zalloc(sizeof(struct ena_com_dev), KM_SLEEP);
 
 	adapter->ena_dev = ena_dev;
 	ena_dev->dmadev = self;
-	ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF,
-	M_WAITOK | M_ZERO);
+	ena_dev->bus = kmem_zalloc(sizeof(struct ena_bus), KM_SLEEP);
 
 	/* Store register resources */
 	((struct ena_bus*)(ena_dev->bus))->reg_bar_t = adapter->sc_btag;
@@ -3941,8 +3945,8 @@ err_com_free:
 	ena_com_delete_host_info(ena_dev);
 	ena_com_mmio_reg_read_request_destroy(ena_dev);
 err_bus_free:
-	free(ena_dev->bus, M_DEVBUF);
-	free(ena_dev, M_DEVBUF);
+	kmem_free(ena_dev->bus, sizeof(struct ena_bus));
+	kmem_free(ena_dev, sizeof(struct ena_com_dev));
 	

CVS commit: src/sys

2023-11-05 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Nov  5 18:15:02 UTC 2023

Modified Files:
src/sys/dev/pci: if_ena.c
src/sys/external/bsd/ena-com: ena_com.c ena_com.h ena_plat.h

Log Message:
ena(4): replace malloc(9) to kmem(9)

Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/ena-com/ena_com.c \
src/sys/external/bsd/ena-com/ena_com.h
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/ena-com/ena_plat.h

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



CVS commit: [netbsd-10] src/distrib/notes/common

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 18:14:44 UTC 2023

Modified Files:
src/distrib/notes/common [netbsd-10]: main

Log Message:
Mention DRM/KMS update and open issues


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

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.570.2.1 src/distrib/notes/common/main:1.570.2.2
--- src/distrib/notes/common/main:1.570.2.1	Sat May 13 14:04:04 2023
+++ src/distrib/notes/common/main	Sun Nov  5 18:14:43 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.570.2.1 2023/05/13 14:04:04 martin Exp $
+.\"	$NetBSD: main,v 1.570.2.2 2023/11/05 18:14:43 martin Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -844,6 +844,14 @@ before booting the updated system multi-
 especially if you have never run
 .Nx -current .
 .Pp
+The display drivers used for modern GPUs and the whole subsystem supporting
+it (DRM/KMS) have been updated to a newer version.
+Unfortunately not all issues with this have been resolved before the
+.Nx 10.0 release.
+You can find a list of issues in the
+.Lk https://wiki.netbsd.org/releng/netbsd-10/ "Open issues with new DRM/KMS"
+section of the release engineering wiki page.
+.Pp
 A number of things have been removed from the
 .Nx
 \*V release.



CVS commit: [netbsd-10] src/distrib/notes/common

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 18:14:44 UTC 2023

Modified Files:
src/distrib/notes/common [netbsd-10]: main

Log Message:
Mention DRM/KMS update and open issues


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

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



CVS commit: src/share/man/man4

2023-11-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov  5 17:52:09 UTC 2023

Modified Files:
src/share/man/man4: cdce.4

Log Message:
add a note about realtek 8156* support working here.

(it can and should be better in the ure(4) driver, but the support
is not yet ported over.)

also add a note about USB 3 speeds.  this device is 2.5G, and i've
seen it do just over 1G speeds.  other 1G devices also use USB 3
speeds not mentioned here.

bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/cdce.4

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

Modified files:

Index: src/share/man/man4/cdce.4
diff -u src/share/man/man4/cdce.4:1.18 src/share/man/man4/cdce.4:1.19
--- src/share/man/man4/cdce.4:1.18	Fri Nov  3 18:24:41 2023
+++ src/share/man/man4/cdce.4	Sun Nov  5 17:52:09 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: cdce.4,v 1.18 2023/11/03 18:24:41 wiz Exp $
+.\" $NetBSD: cdce.4,v 1.19 2023/11/05 17:52:09 mrg Exp $
 .\"
 .\" Copyright (c) 2004 Daniel Hartmeier
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 3, 2023
+.Dd November 5, 2023
 .Dt CDCE 4
 .Os
 .Sh NAME
@@ -63,7 +63,7 @@ NetChip EthernetGadget
 .It
 Prolific PL-2501
 .It
-Realtek RTL8152B Ethernet controller
+Realtek RTL8152B, RTL8156, and RTL8156B Ethernet controllers
 .It
 Sharp Zaurus
 .El
@@ -74,8 +74,8 @@ transporting Ethernet frames.
 For more information on configuring this device, see
 .Xr ifconfig 8 .
 .Pp
-USB 1.x bridges support speeds of up to 12Mbps, and USB 2.0 speeds of
-up to 480Mbps.
+USB 1.x bridges support speeds of up to 12Mbps, USB 2.0 speeds of
+up to 480Mbps, and USB 3.0 speeds of up to 5Gbps.
 .Pp
 Packets are
 received and transmitted over separate USB bulk transfer endpoints.



CVS commit: src/share/man/man4

2023-11-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Nov  5 17:52:09 UTC 2023

Modified Files:
src/share/man/man4: cdce.4

Log Message:
add a note about realtek 8156* support working here.

(it can and should be better in the ure(4) driver, but the support
is not yet ported over.)

also add a note about USB 3 speeds.  this device is 2.5G, and i've
seen it do just over 1G speeds.  other 1G devices also use USB 3
speeds not mentioned here.

bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/cdce.4

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



CVS commit: [netbsd-9] src/doc

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:48:58 UTC 2023

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

Log Message:
Tickets #1759 - #1763


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

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

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.113 src/doc/CHANGES-9.4:1.1.2.114
--- src/doc/CHANGES-9.4:1.1.2.113	Sun Oct 29 16:49:54 2023
+++ src/doc/CHANGES-9.4	Sun Nov  5 17:48:58 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.113 2023/10/29 16:49:54 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.114 2023/11/05 17:48:58 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -2379,3 +2379,29 @@ xsrc/external/mit/xorg-server/dist/randr
 	Fixes CVE-2023-5367 and CVE-2023-5380.
 	[mrg, ticket #1758]
 
+sys/arch/newsmips/dev/zs_hb.c			1.30
+
+	newsmips: fix zs(4) attachment kernel messages.
+	[tsutsui, ticket #1760]
+
+sys/arch/newsmips/conf/DEJIKO			1.36
+sys/arch/newsmips/conf/GENERIC			1.144
+sys/arch/newsmips/conf/WAPIKO			1.50
+
+	Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used
+	on Sun.
+	[tsutsui, ticket #1759]
+
+share/examples/npf/host-npf.conf		1.12
+share/examples/npf/soho_gw-npf.conf		1.21
+
+	npf(7): fix examples.
+	[tsutsui, ticket #1762]
+
+sys/arch/newsmips/conf/GENERIC			1.146
+sys/arch/newsmips/conf/INSTALL			1.49
+sys/arch/newsmips/dev/fb.c			1.30-1.34
+
+	newsmips: add NWS-3260 LCD-MONO support.
+	[tsutsui, ticket #1763]
+



CVS commit: [netbsd-9] src/doc

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:48:58 UTC 2023

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

Log Message:
Tickets #1759 - #1763


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

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



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:47:07 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-9]: GENERIC INSTALL
src/sys/arch/newsmips/dev [netbsd-9]: fb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1763):

sys/arch/newsmips/dev/fb.c: revision 1.34
sys/arch/newsmips/conf/GENERIC: revision 1.146
sys/arch/newsmips/conf/INSTALL: revision 1.49
sys/arch/newsmips/dev/fb.c: revision 1.30
sys/arch/newsmips/dev/fb.c: revision 1.31
sys/arch/newsmips/dev/fb.c: revision 1.32
sys/arch/newsmips/dev/fb.c: revision 1.33

Make local functions and variables static.

Use proper C99 exact-width integer types.

Use C99 designated struct initializers.

Remove trailing spaces and tab.

Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines.

Tested on NWS-3260, which was sent from ryo@'s belongins and repaired
by me, and also tested on my NWS-3470D, including Xorg mono server.
(Note X.org server on NEWS machines requires keymap modifications)

Also add proper initialization on consinit() in NMB-253 case.


To generate a diff of this commit:
cvs rdiff -u -r1.137.2.1 -r1.137.2.2 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.26 -r1.26.34.1 src/sys/arch/newsmips/dev/fb.c

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

Modified files:

Index: src/sys/arch/newsmips/conf/GENERIC
diff -u src/sys/arch/newsmips/conf/GENERIC:1.137.2.1 src/sys/arch/newsmips/conf/GENERIC:1.137.2.2
--- src/sys/arch/newsmips/conf/GENERIC:1.137.2.1	Sun Nov  5 17:30:38 2023
+++ src/sys/arch/newsmips/conf/GENERIC	Sun Nov  5 17:47:07 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.137.2.1 2023/11/05 17:30:38 martin Exp $
+# $NetBSD: GENERIC,v 1.137.2.2 2023/11/05 17:47:07 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/newsmips/conf/std.newsmip
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.137.2.1 $"
+#ident 		"GENERIC-$Revision: 1.137.2.2 $"
 
 maxusers	16
 
@@ -166,6 +166,7 @@ zstty4	at zsc2 channel 0		# tty04
 zstty5	at zsc2 channel 1		# tty05
 
 fb0	at hb0 addr 0x8800		# NWB-253 frame buffer
+fb0	at hb0 addr 0x9020		# LCD-MONO on NWS-32x0
 wsdisplay0 at fb? console ?
 
 xafb*	at ap?# "XA" frame buffer

Index: src/sys/arch/newsmips/conf/INSTALL
diff -u src/sys/arch/newsmips/conf/INSTALL:1.47 src/sys/arch/newsmips/conf/INSTALL:1.47.4.1
--- src/sys/arch/newsmips/conf/INSTALL:1.47	Thu Feb  7 04:33:58 2019
+++ src/sys/arch/newsmips/conf/INSTALL	Sun Nov  5 17:47:07 2023
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.47 2019/02/07 04:33:58 mrg Exp $
+# 	$NetBSD: INSTALL,v 1.47.4.1 2023/11/05 17:47:07 martin Exp $
 #
 #	INSTALL kernel for RISC-NEWS
 
@@ -81,7 +81,8 @@ zsc0	at ap?
 zstty0	at zsc0 channel 0		# tty00
 zstty1	at zsc0 channel 1		# tty01
 
-fb0	at hb0 addr 0x8800		# frame buffer
+fb0	at hb0 addr 0x8800		# NWB-253 frame buffer
+fb0	at hb0 addr 0x9020		# LCD-MONO on NWS-32x0
 
 xafb*	at ap?
 kb0	at ap?

Index: src/sys/arch/newsmips/dev/fb.c
diff -u src/sys/arch/newsmips/dev/fb.c:1.26 src/sys/arch/newsmips/dev/fb.c:1.26.34.1
--- src/sys/arch/newsmips/dev/fb.c:1.26	Fri Jan 31 15:43:06 2014
+++ src/sys/arch/newsmips/dev/fb.c	Sun Nov  5 17:47:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fb.c,v 1.26 2014/01/31 15:43:06 tsutsui Exp $	*/
+/*	$NetBSD: fb.c,v 1.26.34.1 2023/11/05 17:47:07 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -25,9 +25,32 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+/*-
+ * Copyright (c) 2023 Izumi Tsutsui.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN 

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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:47:07 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-9]: GENERIC INSTALL
src/sys/arch/newsmips/dev [netbsd-9]: fb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1763):

sys/arch/newsmips/dev/fb.c: revision 1.34
sys/arch/newsmips/conf/GENERIC: revision 1.146
sys/arch/newsmips/conf/INSTALL: revision 1.49
sys/arch/newsmips/dev/fb.c: revision 1.30
sys/arch/newsmips/dev/fb.c: revision 1.31
sys/arch/newsmips/dev/fb.c: revision 1.32
sys/arch/newsmips/dev/fb.c: revision 1.33

Make local functions and variables static.

Use proper C99 exact-width integer types.

Use C99 designated struct initializers.

Remove trailing spaces and tab.

Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines.

Tested on NWS-3260, which was sent from ryo@'s belongins and repaired
by me, and also tested on my NWS-3470D, including Xorg mono server.
(Note X.org server on NEWS machines requires keymap modifications)

Also add proper initialization on consinit() in NMB-253 case.


To generate a diff of this commit:
cvs rdiff -u -r1.137.2.1 -r1.137.2.2 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.26 -r1.26.34.1 src/sys/arch/newsmips/dev/fb.c

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



CVS commit: [netbsd-10] src/doc

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:45:25 UTC 2023

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

Log Message:
Tickets #456 - #459


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

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.156 src/doc/CHANGES-10.0:1.1.2.157
--- src/doc/CHANGES-10.0:1.1.2.156	Fri Nov  3 10:27:30 2023
+++ src/doc/CHANGES-10.0	Sun Nov  5 17:45:25 2023
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-10.0,v 1.1.2.156 2023/11/03 10:27:30 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.157 2023/11/05 17:45:25 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -14049,3 +14049,31 @@ tests/net/if_vlan/t_vlan.sh			1.25
 	Support vlan(4) over l2tp(4).
 	[yamaguchi, ticket #455]
 
+sys/arch/newsmips/dev/zs_hb.c			1.30
+
+	newsmips: fix zs(4) attachment kernel messages.
+	[tsutsui, ticket #456]
+
+sys/arch/newsmips/conf/DEJIKO			1.36,1.37
+sys/arch/newsmips/conf/GENERIC			1.144,1.145
+sys/arch/newsmips/conf/INSTALL			1.48
+sys/arch/newsmips/conf/WAPIKO			1.50,1.51
+
+	newsmips: use FONT_SONY12x24 for Sony fans, rather than Gallant
+	fonts used on Sun.
+	Specify -fno-unwind-tables to shrink kernel binaries.
+	[tsutsui, ticket #457]
+
+share/examples/npf/host-npf.conf		1.12
+share/examples/npf/soho_gw-npf.conf		1.21
+
+	npf(7): fix examples.
+	[tsutsui, ticket #458]
+
+sys/arch/newsmips/conf/GENERIC			1.146
+sys/arch/newsmips/conf/INSTALL			1.49
+sys/arch/newsmips/dev/fb.c			1.30-1.34
+
+	newsmips: add NWS-3260 LCD-MONO support.
+	[tsutsui, ticket #459]
+



CVS commit: [netbsd-10] src/doc

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:45:25 UTC 2023

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

Log Message:
Tickets #456 - #459


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

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



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:43:59 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-10]: GENERIC INSTALL
src/sys/arch/newsmips/dev [netbsd-10]: fb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #459):

sys/arch/newsmips/dev/fb.c: revision 1.34
sys/arch/newsmips/conf/GENERIC: revision 1.146
sys/arch/newsmips/conf/INSTALL: revision 1.49
sys/arch/newsmips/dev/fb.c: revision 1.30
sys/arch/newsmips/dev/fb.c: revision 1.31
sys/arch/newsmips/dev/fb.c: revision 1.32
sys/arch/newsmips/dev/fb.c: revision 1.33

Make local functions and variables static.

Use proper C99 exact-width integer types.

Use C99 designated struct initializers.

Remove trailing spaces and tab.

Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines.

Tested on NWS-3260, which was sent from ryo@'s belongins and repaired
by me, and also tested on my NWS-3470D, including Xorg mono server.
(Note X.org server on NEWS machines requires keymap modifications)

Also add proper initialization on consinit() in NMB-253 case.


To generate a diff of this commit:
cvs rdiff -u -r1.142.4.1 -r1.142.4.2 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47.30.1 -r1.47.30.2 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/fb.c

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

Modified files:

Index: src/sys/arch/newsmips/conf/GENERIC
diff -u src/sys/arch/newsmips/conf/GENERIC:1.142.4.1 src/sys/arch/newsmips/conf/GENERIC:1.142.4.2
--- src/sys/arch/newsmips/conf/GENERIC:1.142.4.1	Sun Nov  5 17:17:03 2023
+++ src/sys/arch/newsmips/conf/GENERIC	Sun Nov  5 17:43:58 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.142.4.1 2023/11/05 17:17:03 martin Exp $
+# $NetBSD: GENERIC,v 1.142.4.2 2023/11/05 17:43:58 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/newsmips/conf/std.newsmip
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.142.4.1 $"
+#ident 		"GENERIC-$Revision: 1.142.4.2 $"
 
 makeoptions	COPTS="-O2 -fno-unwind-tables"
 
@@ -170,6 +170,7 @@ zstty4	at zsc2 channel 0		# tty04
 zstty5	at zsc2 channel 1		# tty05
 
 fb0	at hb0 addr 0x8800		# NWB-253 frame buffer
+fb0	at hb0 addr 0x9020		# LCD-MONO on NWS-32x0
 wsdisplay0 at fb? console ?
 
 xafb*	at ap?# "XA" frame buffer

Index: src/sys/arch/newsmips/conf/INSTALL
diff -u src/sys/arch/newsmips/conf/INSTALL:1.47.30.1 src/sys/arch/newsmips/conf/INSTALL:1.47.30.2
--- src/sys/arch/newsmips/conf/INSTALL:1.47.30.1	Sun Nov  5 17:17:03 2023
+++ src/sys/arch/newsmips/conf/INSTALL	Sun Nov  5 17:43:58 2023
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.47.30.1 2023/11/05 17:17:03 martin Exp $
+# 	$NetBSD: INSTALL,v 1.47.30.2 2023/11/05 17:43:58 martin Exp $
 #
 #	INSTALL kernel for RISC-NEWS
 
@@ -81,7 +81,8 @@ zsc0	at ap?
 zstty0	at zsc0 channel 0		# tty00
 zstty1	at zsc0 channel 1		# tty01
 
-fb0	at hb0 addr 0x8800		# frame buffer
+fb0	at hb0 addr 0x8800		# NWB-253 frame buffer
+fb0	at hb0 addr 0x9020		# LCD-MONO on NWS-32x0
 
 xafb*	at ap?
 kb0	at ap?

Index: src/sys/arch/newsmips/dev/fb.c
diff -u src/sys/arch/newsmips/dev/fb.c:1.29 src/sys/arch/newsmips/dev/fb.c:1.29.6.1
--- src/sys/arch/newsmips/dev/fb.c:1.29	Sat Aug  7 16:19:01 2021
+++ src/sys/arch/newsmips/dev/fb.c	Sun Nov  5 17:43:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $	*/
+/*	$NetBSD: fb.c,v 1.29.6.1 2023/11/05 17:43:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -25,9 +25,32 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+/*-
+ * Copyright (c) 2023 Izumi Tsutsui.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 

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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:43:59 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-10]: GENERIC INSTALL
src/sys/arch/newsmips/dev [netbsd-10]: fb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #459):

sys/arch/newsmips/dev/fb.c: revision 1.34
sys/arch/newsmips/conf/GENERIC: revision 1.146
sys/arch/newsmips/conf/INSTALL: revision 1.49
sys/arch/newsmips/dev/fb.c: revision 1.30
sys/arch/newsmips/dev/fb.c: revision 1.31
sys/arch/newsmips/dev/fb.c: revision 1.32
sys/arch/newsmips/dev/fb.c: revision 1.33

Make local functions and variables static.

Use proper C99 exact-width integer types.

Use C99 designated struct initializers.

Remove trailing spaces and tab.

Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines.

Tested on NWS-3260, which was sent from ryo@'s belongins and repaired
by me, and also tested on my NWS-3470D, including Xorg mono server.
(Note X.org server on NEWS machines requires keymap modifications)

Also add proper initialization on consinit() in NMB-253 case.


To generate a diff of this commit:
cvs rdiff -u -r1.142.4.1 -r1.142.4.2 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47.30.1 -r1.47.30.2 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/fb.c

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



CVS commit: [netbsd-9] src/share/examples/npf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:39:38 UTC 2023

Modified Files:
src/share/examples/npf [netbsd-9]: host-npf.conf soho_gw-npf.conf

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1762):

share/examples/npf/host-npf.conf: revision 1.12
share/examples/npf/soho_gw-npf.conf: revision 1.21

Use proper variables for interface names in examples.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/share/examples/npf/host-npf.conf
cvs rdiff -u -r1.12.2.1 -r1.12.2.2 src/share/examples/npf/soho_gw-npf.conf

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

Modified files:

Index: src/share/examples/npf/host-npf.conf
diff -u src/share/examples/npf/host-npf.conf:1.10.2.1 src/share/examples/npf/host-npf.conf:1.10.2.2
--- src/share/examples/npf/host-npf.conf:1.10.2.1	Tue Nov 19 10:58:30 2019
+++ src/share/examples/npf/host-npf.conf	Sun Nov  5 17:39:38 2023
@@ -1,4 +1,4 @@
-# $NetBSD: host-npf.conf,v 1.10.2.1 2019/11/19 10:58:30 martin Exp $
+# $NetBSD: host-npf.conf,v 1.10.2.2 2023/11/05 17:39:38 martin Exp $
 #
 # Simple ruleset for a host with (i.e., not routing) two interfaces,
 # ethernet and wifi.
@@ -16,8 +16,8 @@
 
 $wired_if = "wm0"
 $wifi_if  = "iwn0"
-$wired_addrs= ifaddrs(wm0)
-$wifi_addrs = ifaddrs(iwn0)
+$wired_addrs= ifaddrs($wired_if)
+$wifi_addrs = ifaddrs($wifi_if)
 
 alg "icmp"
 

Index: src/share/examples/npf/soho_gw-npf.conf
diff -u src/share/examples/npf/soho_gw-npf.conf:1.12.2.1 src/share/examples/npf/soho_gw-npf.conf:1.12.2.2
--- src/share/examples/npf/soho_gw-npf.conf:1.12.2.1	Tue Nov 19 10:56:35 2019
+++ src/share/examples/npf/soho_gw-npf.conf	Sun Nov  5 17:39:38 2023
@@ -1,4 +1,4 @@
-# $NetBSD: soho_gw-npf.conf,v 1.12.2.1 2019/11/19 10:56:35 martin Exp $
+# $NetBSD: soho_gw-npf.conf,v 1.12.2.2 2023/11/05 17:39:38 martin Exp $
 #
 # SOHO border
 #
@@ -7,8 +7,8 @@
 #
 
 $ext_if = "wm0"
-$ext_v4 = inet4(wm0)
-$ext_addrs = ifaddrs(wm0)
+$ext_v4 = inet4($ext_if)
+$ext_addrs = ifaddrs($ext_if)
 
 $int_if = "wm1"
 



CVS commit: [netbsd-9] src/share/examples/npf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:39:38 UTC 2023

Modified Files:
src/share/examples/npf [netbsd-9]: host-npf.conf soho_gw-npf.conf

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1762):

share/examples/npf/host-npf.conf: revision 1.12
share/examples/npf/soho_gw-npf.conf: revision 1.21

Use proper variables for interface names in examples.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/share/examples/npf/host-npf.conf
cvs rdiff -u -r1.12.2.1 -r1.12.2.2 src/share/examples/npf/soho_gw-npf.conf

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



CVS commit: [netbsd-10] src/share/examples/npf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:38:24 UTC 2023

Modified Files:
src/share/examples/npf [netbsd-10]: host-npf.conf soho_gw-npf.conf

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #458):

share/examples/npf/host-npf.conf: revision 1.12
share/examples/npf/soho_gw-npf.conf: revision 1.21

Use proper variables for interface names in examples.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/share/examples/npf/host-npf.conf
cvs rdiff -u -r1.20 -r1.20.8.1 src/share/examples/npf/soho_gw-npf.conf

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

Modified files:

Index: src/share/examples/npf/host-npf.conf
diff -u src/share/examples/npf/host-npf.conf:1.11 src/share/examples/npf/host-npf.conf:1.11.8.1
--- src/share/examples/npf/host-npf.conf:1.11	Sat Sep 21 11:46:25 2019
+++ src/share/examples/npf/host-npf.conf	Sun Nov  5 17:38:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: host-npf.conf,v 1.11 2019/09/21 11:46:25 sevan Exp $
+# $NetBSD: host-npf.conf,v 1.11.8.1 2023/11/05 17:38:24 martin Exp $
 #
 # Simple ruleset for a host with (i.e., not routing) two interfaces,
 # ethernet and wifi.
@@ -16,8 +16,8 @@
 
 $wired_if = "wm0"
 $wifi_if  = "iwn0"
-$wired_addrs= ifaddrs(wm0)
-$wifi_addrs = ifaddrs(iwn0)
+$wired_addrs= ifaddrs($wired_if)
+$wifi_addrs = ifaddrs($wifi_if)
 
 alg "icmp"
 

Index: src/share/examples/npf/soho_gw-npf.conf
diff -u src/share/examples/npf/soho_gw-npf.conf:1.20 src/share/examples/npf/soho_gw-npf.conf:1.20.8.1
--- src/share/examples/npf/soho_gw-npf.conf:1.20	Mon Nov 18 22:27:27 2019
+++ src/share/examples/npf/soho_gw-npf.conf	Sun Nov  5 17:38:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: soho_gw-npf.conf,v 1.20 2019/11/18 22:27:27 sevan Exp $
+# $NetBSD: soho_gw-npf.conf,v 1.20.8.1 2023/11/05 17:38:24 martin Exp $
 #
 # SOHO border
 #
@@ -7,8 +7,8 @@
 #
 
 $ext_if = "wm0"
-$ext_v4 = inet4(wm0)
-$ext_addrs = ifaddrs(wm0)
+$ext_v4 = inet4($ext_if)
+$ext_addrs = ifaddrs($ext_if)
 
 $int_if = "wm1"
 



CVS commit: [netbsd-10] src/share/examples/npf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:38:24 UTC 2023

Modified Files:
src/share/examples/npf [netbsd-10]: host-npf.conf soho_gw-npf.conf

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #458):

share/examples/npf/host-npf.conf: revision 1.12
share/examples/npf/soho_gw-npf.conf: revision 1.21

Use proper variables for interface names in examples.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/share/examples/npf/host-npf.conf
cvs rdiff -u -r1.20 -r1.20.8.1 src/share/examples/npf/soho_gw-npf.conf

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



CVS commit: [netbsd-9] src/sys/arch/newsmips/conf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:30:38 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-9]: DEJIKO GENERIC WAPIKO

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1759):

sys/arch/newsmips/conf/GENERIC: revision 1.144
sys/arch/newsmips/conf/WAPIKO: revision 1.50
sys/arch/newsmips/conf/DEJIKO: revision 1.36

Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.4.1 src/sys/arch/newsmips/conf/DEJIKO
cvs rdiff -u -r1.137 -r1.137.2.1 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.49 -r1.49.4.1 src/sys/arch/newsmips/conf/WAPIKO

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

Modified files:

Index: src/sys/arch/newsmips/conf/DEJIKO
diff -u src/sys/arch/newsmips/conf/DEJIKO:1.35 src/sys/arch/newsmips/conf/DEJIKO:1.35.4.1
--- src/sys/arch/newsmips/conf/DEJIKO:1.35	Wed Aug  1 20:04:13 2018
+++ src/sys/arch/newsmips/conf/DEJIKO	Sun Nov  5 17:30:38 2023
@@ -1,4 +1,4 @@
-# 	$NetBSD: DEJIKO,v 1.35 2018/08/01 20:04:13 maxv Exp $
+# 	$NetBSD: DEJIKO,v 1.35.4.1 2023/11/05 17:30:38 martin Exp $
 #
 #	Dejiko's sekai-seifuku NEWS5000 nyo.
 
@@ -45,7 +45,8 @@ include 	"conf/compat_netbsd14.config"
 # wscons options
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 config	netbsd root on ? type ?
 

Index: src/sys/arch/newsmips/conf/GENERIC
diff -u src/sys/arch/newsmips/conf/GENERIC:1.137 src/sys/arch/newsmips/conf/GENERIC:1.137.2.1
--- src/sys/arch/newsmips/conf/GENERIC:1.137	Fri Apr 26 21:40:31 2019
+++ src/sys/arch/newsmips/conf/GENERIC	Sun Nov  5 17:30:38 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.137 2019/04/26 21:40:31 sevan Exp $
+# $NetBSD: GENERIC,v 1.137.2.1 2023/11/05 17:30:38 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/newsmips/conf/std.newsmip
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.137 $"
+#ident 		"GENERIC-$Revision: 1.137.2.1 $"
 
 maxusers	16
 
@@ -124,7 +124,8 @@ options 	NFS_BOOT_DHCP
 # wscons options
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 config	netbsd	root on ? type ?
 

Index: src/sys/arch/newsmips/conf/WAPIKO
diff -u src/sys/arch/newsmips/conf/WAPIKO:1.49 src/sys/arch/newsmips/conf/WAPIKO:1.49.4.1
--- src/sys/arch/newsmips/conf/WAPIKO:1.49	Wed Aug  1 20:04:13 2018
+++ src/sys/arch/newsmips/conf/WAPIKO	Sun Nov  5 17:30:38 2023
@@ -1,7 +1,7 @@
 #
 # NEWS3400 config file
 #
-# 	$NetBSD: WAPIKO,v 1.49 2018/08/01 20:04:13 maxv Exp $
+# 	$NetBSD: WAPIKO,v 1.49.4.1 2023/11/05 17:30:38 martin Exp $
 #
 include 	"arch/newsmips/conf/std.newsmips"
 
@@ -84,7 +84,8 @@ sd*	at scsibus? target ? lun ?	# SCSI di
 
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 wsdisplay0 at fb? console ?
 wskbd0	at kb? console ?



CVS commit: [netbsd-9] src/sys/arch/newsmips/conf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:30:38 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-9]: DEJIKO GENERIC WAPIKO

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1759):

sys/arch/newsmips/conf/GENERIC: revision 1.144
sys/arch/newsmips/conf/WAPIKO: revision 1.50
sys/arch/newsmips/conf/DEJIKO: revision 1.36

Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.4.1 src/sys/arch/newsmips/conf/DEJIKO
cvs rdiff -u -r1.137 -r1.137.2.1 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.49 -r1.49.4.1 src/sys/arch/newsmips/conf/WAPIKO

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



CVS commit: [netbsd-10] src/sys/arch/newsmips/conf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:17:04 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-10]: DEJIKO GENERIC INSTALL WAPIKO

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #457):

sys/arch/newsmips/conf/GENERIC: revision 1.144
sys/arch/newsmips/conf/GENERIC: revision 1.145
sys/arch/newsmips/conf/WAPIKO: revision 1.50
sys/arch/newsmips/conf/WAPIKO: revision 1.51
sys/arch/newsmips/conf/INSTALL: revision 1.48
sys/arch/newsmips/conf/DEJIKO: revision 1.36
sys/arch/newsmips/conf/DEJIKO: revision 1.37

Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun.

Specify -fno-unwind-tables to shrink kernel binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.30.1 src/sys/arch/newsmips/conf/DEJIKO
cvs rdiff -u -r1.142 -r1.142.4.1 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47 -r1.47.30.1 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.49 -r1.49.30.1 src/sys/arch/newsmips/conf/WAPIKO

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

Modified files:

Index: src/sys/arch/newsmips/conf/DEJIKO
diff -u src/sys/arch/newsmips/conf/DEJIKO:1.35 src/sys/arch/newsmips/conf/DEJIKO:1.35.30.1
--- src/sys/arch/newsmips/conf/DEJIKO:1.35	Wed Aug  1 20:04:13 2018
+++ src/sys/arch/newsmips/conf/DEJIKO	Sun Nov  5 17:17:03 2023
@@ -1,4 +1,4 @@
-# 	$NetBSD: DEJIKO,v 1.35 2018/08/01 20:04:13 maxv Exp $
+# 	$NetBSD: DEJIKO,v 1.35.30.1 2023/11/05 17:17:03 martin Exp $
 #
 #	Dejiko's sekai-seifuku NEWS5000 nyo.
 
@@ -6,6 +6,8 @@ include 	"arch/newsmips/conf/std.newsmip
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
+makeoptions	COPTS="-O2 -fno-unwind-tables"
+
 maxusers	16
 
 options 	news5000
@@ -45,7 +47,8 @@ include 	"conf/compat_netbsd14.config"
 # wscons options
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 config	netbsd root on ? type ?
 

Index: src/sys/arch/newsmips/conf/GENERIC
diff -u src/sys/arch/newsmips/conf/GENERIC:1.142 src/sys/arch/newsmips/conf/GENERIC:1.142.4.1
--- src/sys/arch/newsmips/conf/GENERIC:1.142	Thu Sep 29 10:10:09 2022
+++ src/sys/arch/newsmips/conf/GENERIC	Sun Nov  5 17:17:03 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.142 2022/09/29 10:10:09 riastradh Exp $
+# $NetBSD: GENERIC,v 1.142.4.1 2023/11/05 17:17:03 martin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,9 @@ include 	"arch/newsmips/conf/std.newsmip
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.142 $"
+#ident 		"GENERIC-$Revision: 1.142.4.1 $"
+
+makeoptions	COPTS="-O2 -fno-unwind-tables"
 
 maxusers	16
 
@@ -126,7 +128,8 @@ options 	NFS_BOOT_DHCP
 # wscons options
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 config	netbsd	root on ? type ?
 

Index: src/sys/arch/newsmips/conf/INSTALL
diff -u src/sys/arch/newsmips/conf/INSTALL:1.47 src/sys/arch/newsmips/conf/INSTALL:1.47.30.1
--- src/sys/arch/newsmips/conf/INSTALL:1.47	Thu Feb  7 04:33:58 2019
+++ src/sys/arch/newsmips/conf/INSTALL	Sun Nov  5 17:17:03 2023
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.47 2019/02/07 04:33:58 mrg Exp $
+# 	$NetBSD: INSTALL,v 1.47.30.1 2023/11/05 17:17:03 martin Exp $
 #
 #	INSTALL kernel for RISC-NEWS
 
@@ -6,7 +6,7 @@ include 	"arch/newsmips/conf/std.newsmip
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-makeoptions	COPTS="-Os -mmemcpy"	# Optimise for space. Implies -O2
+makeoptions	COPTS="-Os -fno-unwind-tables -mmemcpy"	# Optimise for space. Implies -O2
 
 maxusers	8
 

Index: src/sys/arch/newsmips/conf/WAPIKO
diff -u src/sys/arch/newsmips/conf/WAPIKO:1.49 src/sys/arch/newsmips/conf/WAPIKO:1.49.30.1
--- src/sys/arch/newsmips/conf/WAPIKO:1.49	Wed Aug  1 20:04:13 2018
+++ src/sys/arch/newsmips/conf/WAPIKO	Sun Nov  5 17:17:03 2023
@@ -1,15 +1,15 @@
 #
 # NEWS3400 config file
 #
-# 	$NetBSD: WAPIKO,v 1.49 2018/08/01 20:04:13 maxv Exp $
+# 	$NetBSD: WAPIKO,v 1.49.30.1 2023/11/05 17:17:03 martin Exp $
 #
 include 	"arch/newsmips/conf/std.newsmips"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-maxusers	16
+makeoptions	COPTS="-O2 -fno-unwind-tables"
 
-makeoptions	COPTS="-O2 -pipe"
+maxusers	16
 
 options 	news3400
 options 	MIPS1			# R2000/R3000 support
@@ -84,7 +84,8 @@ sd*	at scsibus? target ? lun ?	# SCSI di
 
 options 	WSEMUL_VT100		# VT100 / VT220 emulation
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	FONT_GALLANT12x22
+#options 	FONT_GALLANT12x22
+options 	FONT_SONY12x24
 
 wsdisplay0 at fb? console ?
 wskbd0	at kb? console ?



CVS commit: [netbsd-10] src/sys/arch/newsmips/conf

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:17:04 UTC 2023

Modified Files:
src/sys/arch/newsmips/conf [netbsd-10]: DEJIKO GENERIC INSTALL WAPIKO

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #457):

sys/arch/newsmips/conf/GENERIC: revision 1.144
sys/arch/newsmips/conf/GENERIC: revision 1.145
sys/arch/newsmips/conf/WAPIKO: revision 1.50
sys/arch/newsmips/conf/WAPIKO: revision 1.51
sys/arch/newsmips/conf/INSTALL: revision 1.48
sys/arch/newsmips/conf/DEJIKO: revision 1.36
sys/arch/newsmips/conf/DEJIKO: revision 1.37

Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun.

Specify -fno-unwind-tables to shrink kernel binaries.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.30.1 src/sys/arch/newsmips/conf/DEJIKO
cvs rdiff -u -r1.142 -r1.142.4.1 src/sys/arch/newsmips/conf/GENERIC
cvs rdiff -u -r1.47 -r1.47.30.1 src/sys/arch/newsmips/conf/INSTALL
cvs rdiff -u -r1.49 -r1.49.30.1 src/sys/arch/newsmips/conf/WAPIKO

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



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:08:09 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-9]: zs_hb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1760):

sys/arch/newsmips/dev/zs_hb.c: revision 1.30

Don't use aprint_error(9) for a normal attach message.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.20.1 src/sys/arch/newsmips/dev/zs_hb.c

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

Modified files:

Index: src/sys/arch/newsmips/dev/zs_hb.c
diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.27 src/sys/arch/newsmips/dev/zs_hb.c:1.27.20.1
--- src/sys/arch/newsmips/dev/zs_hb.c:1.27	Thu Jul 21 19:49:58 2016
+++ src/sys/arch/newsmips/dev/zs_hb.c	Sun Nov  5 17:08:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_hb.c,v 1.27 2016/07/21 19:49:58 christos Exp $	*/
+/*	$NetBSD: zs_hb.c,v 1.27.20.1 2023/11/05 17:08:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.27 2016/07/21 19:49:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.27.20.1 2023/11/05 17:08:08 martin Exp $");
 
 #include 
 #include 
@@ -214,7 +214,7 @@ zs_hb_attach(device_t parent, device_t s
 #endif
 	}
 
-	aprint_error(" level %d\n", intlevel);
+	aprint_normal(" level %d\n", intlevel);
 
 	zs_delay = zs_hb_delay;
 



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:08:09 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-9]: zs_hb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1760):

sys/arch/newsmips/dev/zs_hb.c: revision 1.30

Don't use aprint_error(9) for a normal attach message.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.20.1 src/sys/arch/newsmips/dev/zs_hb.c

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



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:06:14 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-10]: zs_hb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #456):

sys/arch/newsmips/dev/zs_hb.c: revision 1.30

Don't use aprint_error(9) for a normal attach message.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/zs_hb.c

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



CVS commit: xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-05 Thread Julian Coleman
Module Name:xsrc
Committed By:   jdc
Date:   Sun Nov  5 17:06:15 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src: pnozz_exa.c

Log Message:
Add NetBSD keyword.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c
diff -u xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.5 xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.6
--- xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.5	Sun Nov  5 17:01:05 2023
+++ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c	Sun Nov  5 17:06:14 2023
@@ -29,6 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+/* $NetBSD: pnozz_exa.c,v 1.6 2023/11/05 17:06:14 jdc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"



CVS commit: xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-05 Thread Julian Coleman
Module Name:xsrc
Committed By:   jdc
Date:   Sun Nov  5 17:06:15 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src: pnozz_exa.c

Log Message:
Add NetBSD keyword.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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



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

2023-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov  5 17:06:14 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-10]: zs_hb.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #456):

sys/arch/newsmips/dev/zs_hb.c: revision 1.30

Don't use aprint_error(9) for a normal attach message.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/zs_hb.c

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

Modified files:

Index: src/sys/arch/newsmips/dev/zs_hb.c
diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.29 src/sys/arch/newsmips/dev/zs_hb.c:1.29.6.1
--- src/sys/arch/newsmips/dev/zs_hb.c:1.29	Sat Aug  7 16:19:01 2021
+++ src/sys/arch/newsmips/dev/zs_hb.c	Sun Nov  5 17:06:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_hb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $	*/
+/*	$NetBSD: zs_hb.c,v 1.29.6.1 2023/11/05 17:06:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.29.6.1 2023/11/05 17:06:14 martin Exp $");
 
 #include 
 #include 
@@ -214,7 +214,7 @@ zs_hb_attach(device_t parent, device_t s
 #endif
 	}
 
-	aprint_error(" level %d\n", intlevel);
+	aprint_normal(" level %d\n", intlevel);
 
 	zs_delay = zs_hb_delay;
 



CVS commit: xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-05 Thread Julian Coleman
Module Name:xsrc
Committed By:   jdc
Date:   Sun Nov  5 17:01:05 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src: pnozz_exa.c

Log Message:
Revert r1.4.
The changes are minimal and they cause redraw problems (as reported by
Maxim Devaev on port-sparc).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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



CVS commit: xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-05 Thread Julian Coleman
Module Name:xsrc
Committed By:   jdc
Date:   Sun Nov  5 17:01:05 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src: pnozz_exa.c

Log Message:
Revert r1.4.
The changes are minimal and they cause redraw problems (as reported by
Maxim Devaev on port-sparc).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c
diff -u xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4 xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.5
--- xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4	Wed Jun  9 07:25:57 2021
+++ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c	Sun Nov  5 17:01:05 2023
@@ -1,6 +1,7 @@
 /*
  * SBus Weitek P9100 EXA support
- *
+ */
+/*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -78,9 +79,11 @@ static CARD32 PnozzDrawROP[] = {
 #define waitReady(pPnozz) while((pnozz_read_4(pPnozz, ENGINE_STATUS) & \
 (ENGINE_BUSY | BLITTER_BUSY)) !=0 )
 
-/* From pnozz_accel.c */
+void PnozzInitEngine(PnozzPtr);
 void pnozz_write_colour(PnozzPtr pPnozz, int reg, CARD32 colour);
 
+extern CARD32 MaxClip, junk;
+
 static void
 PnozzWaitMarker(ScreenPtr pScreen, int Marker)
 {
@@ -107,10 +110,8 @@ PnozzPrepareCopy
 waitReady(pPnozz);
 pnozz_write_4(pPnozz, RASTER_OP, (PnozzCopyROP[alu] & 0xff));
 pnozz_write_4(pPnozz, PLANE_MASK, planemask);
-pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap);
+pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap) / pPnozz->width;
 
-if (exaGetPixmapPitch(pSrcPixmap) != exaGetPixmapPitch(pDstPixmap))
-	return FALSE;
 return TRUE;
 }
 
@@ -129,25 +130,24 @@ PnozzCopy
 ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
 PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);
 CARD32 src, dst, srcw, dstw;
-int soff = pPnozz->srcoff / exaGetPixmapPitch(pDstPixmap);
-int doff = exaGetPixmapOffset(pDstPixmap) / exaGetPixmapPitch(pDstPixmap);
+int doff = exaGetPixmapOffset(pDstPixmap) / pPnozz->width;
 
 src = (((xSrc << pPnozz->depthshift) & 0x1fff) << 16) |
-	((ySrc + soff) & 0x1fff);
+	((ySrc + pPnozz->srcoff) & 0x1fff);
 dst = (((xDst << pPnozz->depthshift) & 0x1fff) << 16) |
 	((yDst + doff) & 0x1fff);
-srcw = xSrc + w) << pPnozz->depthshift) - 1) << 16) |
-	((ySrc + soff + h) & 0x1fff);
+srcw = xSrc + w) << pPnozz->depthshift) - 1) << 16) | 
+((ySrc + pPnozz->srcoff + h - 1) & 0x1fff);
 dstw = xDst + w) << pPnozz->depthshift) - 1) << 16) |
-	((yDst + doff + h) & 0x1fff);
+((yDst + doff + h - 1) & 0x1fff);
 
 waitReady(pPnozz);
+
 pnozz_write_4(pPnozz, ABS_XY0, src);
 pnozz_write_4(pPnozz, ABS_XY1, srcw);
 pnozz_write_4(pPnozz, ABS_XY2, dst);
 pnozz_write_4(pPnozz, ABS_XY3, dstw);
-pnozz_read_4(pPnozz, COMMAND_BLIT);
-
+junk = pnozz_read_4(pPnozz, COMMAND_BLIT);
 exaMarkSync(pDstPixmap->drawable.pScreen);
 }
 
@@ -172,8 +172,7 @@ PnozzPrepareSolid(
 
 waitReady(pPnozz);
 pnozz_write_colour(pPnozz, FOREGROUND_COLOR, fg);
-pnozz_write_colour(pPnozz, BACKGROUND_COLOR, fg);
-pnozz_write_4(pPnozz, RASTER_OP, ROP_PAT);
+pnozz_write_4(pPnozz, RASTER_OP, PnozzDrawROP[alu] & 0xff);
 pnozz_write_4(pPnozz, PLANE_MASK, planemask);
 pnozz_write_4(pPnozz, COORD_INDEX, 0);
 
@@ -190,18 +189,15 @@ PnozzSolid(
 {
 ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
 PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);
-int doff = exaGetPixmapOffset(pPixmap);
+int w = x2 - x - 1;
+int h = y2 - y - 1;
 
 waitReady(pPnozz);
-pnozz_write_4(pPnozz, ABS_XY0, (((x + doff) & 0x1fff) << 16) |
-	(y & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY1, (((x + doff) & 0x1fff) << 16) |
-	(y2 & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY2, (((x2 + doff) & 0x1fff) << 16) |
-	(y2 & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY3, (((x2 + doff) & 0x1fff) << 16) |
-	(y & 0x1fff));
-pnozz_read_4(pPnozz, COMMAND_QUAD);
+pnozz_write_4(pPnozz, RECT_RTW_XY, ((x & 0x1fff) << 16) | 
+(y & 0x1fff));
+pnozz_write_4(pPnozz, RECT_RTP_XY, (((w & 0x1fff) << 16) | 
+(h & 0x1fff)));
+junk = pnozz_read_4(pPnozz, COMMAND_QUAD);
 exaMarkSync(pPixmap->drawable.pScreen);
 }
 
@@ -212,6 +208,8 @@ PnozzEXAInit(ScreenPtr pScreen)
 PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);
 ExaDriverPtr pExa;
 
+PnozzInitEngine(pPnozz);
+
 pExa = exaDriverAlloc();
 if (!pExa)
 	return FALSE;
@@ -225,8 +223,7 @@ PnozzEXAInit(ScreenPtr pScreen)
 
 /* round to multiple of pixmap pitch */
 pExa->memorySize = (pPnozz->vidmem / pPnozz->width) * pPnozz->width;
-pExa->offScreenBase = pPnozz->width * pPnozz->height *
-	

CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 16:28:05 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Add #pragma STDC FENV_ACCESS ON and verify FLT_RADIX is 2.

Except gcc doesn't implement this pragma, so make it conditional.

And clang only supports it on some architectures, so just leave it
out for now with a comment about why.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libm/t_fenv.c

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



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 16:28:05 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Add #pragma STDC FENV_ACCESS ON and verify FLT_RADIX is 2.

Except gcc doesn't implement this pragma, so make it conditional.

And clang only supports it on some architectures, so just leave it
out for now with a comment about why.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libm/t_fenv.c

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

Modified files:

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.9 src/tests/lib/libm/t_fenv.c:1.10
--- src/tests/lib/libm/t_fenv.c:1.9	Sun Nov  5 16:06:27 2023
+++ src/tests/lib/libm/t_fenv.c	Sun Nov  5 16:28:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.9 2023/11/05 16:06:27 riastradh Exp $ */
+/* $NetBSD: t_fenv.c,v 1.10 2023/11/05 16:28:05 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,17 +29,26 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.9 2023/11/05 16:06:27 riastradh Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.10 2023/11/05 16:28:05 riastradh Exp $");
 
 #include 
 
 #include 
 #ifdef __HAVE_FENV
 
+/* XXXGCC gcc lacks #pragma STDC FENV_ACCESS */
+/* XXXCLANG clang lacks #pragma STDC FENV_ACCESS on some ports */
+#if !defined(__GNUC__)
+#pragma STDC FENV_ACCESS ON
+#endif
+
 #include 
 #include 
 #include 
 
+#if FLT_RADIX != 2
+#error This test assumes binary floating-point arithmetic.
+#endif
 
 #if (__arm__ && !__SOFTFP__) || __aarch64__
 	/*



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 16:06:27 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Verify rounding mode takes effect.

At least for addition operations, anyway.

Somewhat redundant with the test t_fe_round added by maya@ but this
gives two minimal pairs to easily diagnose exactly what the rounding
mode is when the wrong one was selected.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_fenv.c

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

Modified files:

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.8 src/tests/lib/libm/t_fenv.c:1.9
--- src/tests/lib/libm/t_fenv.c:1.8	Sun Nov  5 15:28:17 2023
+++ src/tests/lib/libm/t_fenv.c	Sun Nov  5 16:06:27 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.8 2023/11/05 15:28:17 riastradh Exp $ */
+/* $NetBSD: t_fenv.c,v 1.9 2023/11/05 16:06:27 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.8 2023/11/05 15:28:17 riastradh Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.9 2023/11/05 16:06:27 riastradh Exp $");
 
 #include 
 
@@ -101,6 +101,45 @@ checkfltrounds(void)
 	FLT_ROUNDS, expected, feround);
 }
 
+static void
+checkrounding(int feround)
+{
+	volatile double ulp1 = DBL_EPSILON;
+	double y1 = -1 + ulp1/4;
+	double y2 = 1 + 3*(ulp1/2);
+
+	switch (feround) {
+	case FE_TONEAREST: {
+		double z1 = -1;
+		double z2 = 1 + 2*ulp1;
+		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		break;
+	}
+	case FE_TOWARDZERO: {
+		double z1 = -1 + ulp1/2;
+		double z2 = 1 + ulp1;
+		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		break;
+	}
+	case FE_UPWARD: {
+		double z1 = -1 + ulp1/2;
+		double z2 = 1 + 2*ulp1;
+		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		break;
+	}
+	case FE_DOWNWARD: {
+		double z1 = -1;
+		double z2 = 1 + ulp1;
+		ATF_CHECK_EQ_MSG(y1, z1, "expected=%a actual=%a", y1, z1);
+		ATF_CHECK_EQ_MSG(y2, z2, "expected=%a actual=%a", y1, z2);
+		break;
+	}
+	}
+}
+
 ATF_TC(fegetround);
 
 ATF_TC_HEAD(fegetround, tc)
@@ -114,29 +153,35 @@ ATF_TC_BODY(fegetround, tc)
 {
 	FPU_RND_PREREQ();
 
+	checkrounding(FE_TONEAREST);
+
 	fpsetround(FP_RZ);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TOWARDZERO,
 	"fegetround()=%d FE_TOWARDZERO=%d",
 	fegetround(), FE_TOWARDZERO);
 	checkfltrounds();
+	checkrounding(FE_TOWARDZERO);
 
 	fpsetround(FP_RM);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_DOWNWARD,
 	"fegetround()=%d FE_DOWNWARD=%d",
 	fegetround(), FE_DOWNWARD);
 	checkfltrounds();
+	checkrounding(FE_DOWNWARD);
 
 	fpsetround(FP_RN);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TONEAREST,
 	"fegetround()=%d FE_TONEAREST=%d",
 	fegetround(), FE_TONEAREST);
 	checkfltrounds();
+	checkrounding(FE_TONEAREST);
 
 	fpsetround(FP_RP);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_UPWARD,
 	"fegetround()=%d FE_UPWARD=%d",
 	fegetround(), FE_UPWARD);
 	checkfltrounds();
+	checkrounding(FE_UPWARD);
 }
 
 ATF_TC(fesetround);
@@ -152,29 +197,35 @@ ATF_TC_BODY(fesetround, tc)
 {
 	FPU_RND_PREREQ();
 
+	checkrounding(FE_TONEAREST);
+
 	fesetround(FE_TOWARDZERO);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RZ,
 	"fpgetround()=%d FP_RZ=%d",
 	(int)fpgetround(), (int)FP_RZ);
 	checkfltrounds();
+	checkrounding(FE_TOWARDZERO);
 
 	fesetround(FE_DOWNWARD);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RM,
 	"fpgetround()=%d FP_RM=%d",
 	(int)fpgetround(), (int)FP_RM);
 	checkfltrounds();
+	checkrounding(FE_DOWNWARD);
 
 	fesetround(FE_TONEAREST);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RN,
 	"fpgetround()=%d FP_RN=%d",
 	(int)fpgetround(), (int)FP_RN);
 	checkfltrounds();
+	checkrounding(FE_TONEAREST);
 
 	fesetround(FE_UPWARD);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RP,
 	"fpgetround()=%d FP_RP=%d",
 	(int)fpgetround(), (int)FP_RP);
 	checkfltrounds();
+	checkrounding(FE_UPWARD);
 }
 
 ATF_TC(fegetexcept);



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 16:06:27 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Verify rounding mode takes effect.

At least for addition operations, anyway.

Somewhat redundant with the test t_fe_round added by maya@ but this
gives two minimal pairs to easily diagnose exactly what the rounding
mode is when the wrong one was selected.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_fenv.c

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



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 15:28:17 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Check FLT_ROUNDS whenever we touch the rounding mode.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_fenv.c

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



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 15:28:17 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Check FLT_ROUNDS whenever we touch the rounding mode.

PR port-mips/57680

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_fenv.c

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

Modified files:

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.7 src/tests/lib/libm/t_fenv.c:1.8
--- src/tests/lib/libm/t_fenv.c:1.7	Sun Nov  5 15:27:40 2023
+++ src/tests/lib/libm/t_fenv.c	Sun Nov  5 15:28:17 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.7 2023/11/05 15:27:40 riastradh Exp $ */
+/* $NetBSD: t_fenv.c,v 1.8 2023/11/05 15:28:17 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,13 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.7 2023/11/05 15:27:40 riastradh Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.8 2023/11/05 15:28:17 riastradh Exp $");
 
 #include 
 
 #include 
 #ifdef __HAVE_FENV
 
+#include 
 #include 
 #include 
 
@@ -67,6 +68,39 @@ __RCSID("$NetBSD: t_fenv.c,v 1.7 2023/11
 #endif
 
 
+static int
+feround_to_fltrounds(int feround)
+{
+
+	/*
+	 * C99, Sec. 5.2.4.2.2 Characteristics of floating types
+	 * , p. 24, clause 7
+	 */
+	switch (feround) {
+	case FE_TOWARDZERO:
+		return 0;
+	case FE_TONEAREST:
+		return 1;
+	case FE_UPWARD:
+		return 2;
+	case FE_DOWNWARD:
+		return 3;
+	default:
+		return -1;
+	}
+}
+
+static void
+checkfltrounds(void)
+{
+	int feround = fegetround();
+	int expected = feround_to_fltrounds(feround);
+
+	ATF_CHECK_EQ_MSG(FLT_ROUNDS, expected,
+	"FLT_ROUNDS=%d expected=%d fegetround()=%d",
+	FLT_ROUNDS, expected, feround);
+}
+
 ATF_TC(fegetround);
 
 ATF_TC_HEAD(fegetround, tc)
@@ -84,18 +118,25 @@ ATF_TC_BODY(fegetround, tc)
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TOWARDZERO,
 	"fegetround()=%d FE_TOWARDZERO=%d",
 	fegetround(), FE_TOWARDZERO);
+	checkfltrounds();
+
 	fpsetround(FP_RM);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_DOWNWARD,
 	"fegetround()=%d FE_DOWNWARD=%d",
 	fegetround(), FE_DOWNWARD);
+	checkfltrounds();
+
 	fpsetround(FP_RN);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_TONEAREST,
 	"fegetround()=%d FE_TONEAREST=%d",
 	fegetround(), FE_TONEAREST);
+	checkfltrounds();
+
 	fpsetround(FP_RP);
 	ATF_CHECK_EQ_MSG(fegetround(), FE_UPWARD,
 	"fegetround()=%d FE_UPWARD=%d",
 	fegetround(), FE_UPWARD);
+	checkfltrounds();
 }
 
 ATF_TC(fesetround);
@@ -115,18 +156,25 @@ ATF_TC_BODY(fesetround, tc)
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RZ,
 	"fpgetround()=%d FP_RZ=%d",
 	(int)fpgetround(), (int)FP_RZ);
+	checkfltrounds();
+
 	fesetround(FE_DOWNWARD);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RM,
 	"fpgetround()=%d FP_RM=%d",
 	(int)fpgetround(), (int)FP_RM);
+	checkfltrounds();
+
 	fesetround(FE_TONEAREST);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RN,
 	"fpgetround()=%d FP_RN=%d",
 	(int)fpgetround(), (int)FP_RN);
+	checkfltrounds();
+
 	fesetround(FE_UPWARD);
 	ATF_CHECK_EQ_MSG(fpgetround(), FP_RP,
 	"fpgetround()=%d FP_RP=%d",
 	(int)fpgetround(), (int)FP_RP);
+	checkfltrounds();
 }
 
 ATF_TC(fegetexcept);



CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 15:27:40 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Print wrong values if tests fail.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libm/t_fenv.c

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

Modified files:

Index: src/tests/lib/libm/t_fenv.c
diff -u src/tests/lib/libm/t_fenv.c:1.6 src/tests/lib/libm/t_fenv.c:1.7
--- src/tests/lib/libm/t_fenv.c:1.6	Thu Apr 25 20:48:54 2019
+++ src/tests/lib/libm/t_fenv.c	Sun Nov  5 15:27:40 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fenv.c,v 1.6 2019/04/25 20:48:54 kamil Exp $ */
+/* $NetBSD: t_fenv.c,v 1.7 2023/11/05 15:27:40 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_fenv.c,v 1.6 2019/04/25 20:48:54 kamil Exp $");
+__RCSID("$NetBSD: t_fenv.c,v 1.7 2023/11/05 15:27:40 riastradh Exp $");
 
 #include 
 
@@ -81,13 +81,21 @@ ATF_TC_BODY(fegetround, tc)
 	FPU_RND_PREREQ();
 
 	fpsetround(FP_RZ);
-	ATF_CHECK(fegetround() == FE_TOWARDZERO);
+	ATF_CHECK_EQ_MSG(fegetround(), FE_TOWARDZERO,
+	"fegetround()=%d FE_TOWARDZERO=%d",
+	fegetround(), FE_TOWARDZERO);
 	fpsetround(FP_RM);
-	ATF_CHECK(fegetround() == FE_DOWNWARD);
+	ATF_CHECK_EQ_MSG(fegetround(), FE_DOWNWARD,
+	"fegetround()=%d FE_DOWNWARD=%d",
+	fegetround(), FE_DOWNWARD);
 	fpsetround(FP_RN);
-	ATF_CHECK(fegetround() == FE_TONEAREST);
+	ATF_CHECK_EQ_MSG(fegetround(), FE_TONEAREST,
+	"fegetround()=%d FE_TONEAREST=%d",
+	fegetround(), FE_TONEAREST);
 	fpsetround(FP_RP);
-	ATF_CHECK(fegetround() == FE_UPWARD);
+	ATF_CHECK_EQ_MSG(fegetround(), FE_UPWARD,
+	"fegetround()=%d FE_UPWARD=%d",
+	fegetround(), FE_UPWARD);
 }
 
 ATF_TC(fesetround);
@@ -104,13 +112,21 @@ ATF_TC_BODY(fesetround, tc)
 	FPU_RND_PREREQ();
 
 	fesetround(FE_TOWARDZERO);
-	ATF_CHECK(fpgetround() == FP_RZ);
+	ATF_CHECK_EQ_MSG(fpgetround(), FP_RZ,
+	"fpgetround()=%d FP_RZ=%d",
+	(int)fpgetround(), (int)FP_RZ);
 	fesetround(FE_DOWNWARD);
-	ATF_CHECK(fpgetround() == FP_RM);
+	ATF_CHECK_EQ_MSG(fpgetround(), FP_RM,
+	"fpgetround()=%d FP_RM=%d",
+	(int)fpgetround(), (int)FP_RM);
 	fesetround(FE_TONEAREST);
-	ATF_CHECK(fpgetround() == FP_RN);
+	ATF_CHECK_EQ_MSG(fpgetround(), FP_RN,
+	"fpgetround()=%d FP_RN=%d",
+	(int)fpgetround(), (int)FP_RN);
 	fesetround(FE_UPWARD);
-	ATF_CHECK(fpgetround() == FP_RP);
+	ATF_CHECK_EQ_MSG(fpgetround(), FP_RP,
+	"fpgetround()=%d FP_RP=%d",
+	(int)fpgetround(), (int)FP_RP);
 }
 
 ATF_TC(fegetexcept);
@@ -127,26 +143,38 @@ ATF_TC_BODY(fegetexcept, tc)
 	FPU_EXC_PREREQ();
 
 	fpsetmask(0);
-	ATF_CHECK(fegetexcept() == 0);
+	ATF_CHECK_EQ_MSG(fegetexcept(), 0,
+	"fegetexcept()=%d",
+	fegetexcept());
 
 	fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
 	ATF_CHECK(fegetexcept() == (FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW
 	|FE_UNDERFLOW|FE_INEXACT));
 
 	fpsetmask(FP_X_INV);
-	ATF_CHECK(fegetexcept() == FE_INVALID);
+	ATF_CHECK_EQ_MSG(fegetexcept(), FE_INVALID,
+	"fegetexcept()=%d FE_INVALID=%d",
+	fegetexcept(), FE_INVALID);
 
 	fpsetmask(FP_X_DZ);
-	ATF_CHECK(fegetexcept() == FE_DIVBYZERO);
+	ATF_CHECK_EQ_MSG(fegetexcept(), FE_DIVBYZERO,
+	"fegetexcept()=%d FE_DIVBYZERO=%d",
+	fegetexcept(), FE_DIVBYZERO);
 
 	fpsetmask(FP_X_OFL);
-	ATF_CHECK(fegetexcept() == FE_OVERFLOW);
+	ATF_CHECK_EQ_MSG(fegetexcept(), FE_OVERFLOW,
+	"fegetexcept()=%d FE_OVERFLOW=%d",
+	fegetexcept(), FE_OVERFLOW);
 
 	fpsetmask(FP_X_UFL);
-	ATF_CHECK(fegetexcept() == FE_UNDERFLOW);
+	ATF_CHECK_EQ_MSG(fegetexcept(), FE_UNDERFLOW,
+	"fegetexcept()=%d FE_UNDERFLOW=%d",
+	fegetexcept(), FE_UNDERFLOW);
 
 	fpsetmask(FP_X_IMP);
-	ATF_CHECK(fegetexcept() == FE_INEXACT);
+	ATF_CHECK_EQ_MSG(fegetexcept(), FE_INEXACT,
+	"fegetexcept()=%d FE_INEXACT=%d",
+	fegetexcept(), FE_INEXACT);
 }
 
 ATF_TC(feenableexcept);
@@ -163,26 +191,38 @@ ATF_TC_BODY(feenableexcept, tc)
 	FPU_EXC_PREREQ();
 
 	fedisableexcept(FE_ALL_EXCEPT);
-	ATF_CHECK(fpgetmask() == 0);
+	ATF_CHECK_EQ_MSG(fpgetmask(), 0,
+	"fpgetmask()=%d",
+	(int)fpgetmask());
 
 	feenableexcept(FE_UNDERFLOW);
-	ATF_CHECK(fpgetmask() == FP_X_UFL);
+	ATF_CHECK_EQ_MSG(fpgetmask(), FP_X_UFL,
+	"fpgetmask()=%d FP_X_UFL=%d",
+	(int)fpgetmask(), (int)FP_X_UFL);
 
 	fedisableexcept(FE_ALL_EXCEPT);
 	feenableexcept(FE_OVERFLOW);
-	ATF_CHECK(fpgetmask() == FP_X_OFL);
+	ATF_CHECK_EQ_MSG(fpgetmask(), FP_X_OFL,
+	"fpgetmask()=%d FP_X_OFL=%d",
+	(int)fpgetmask(), (int)FP_X_OFL);
 
 	fedisableexcept(FE_ALL_EXCEPT);
 	feenableexcept(FE_DIVBYZERO);
-	ATF_CHECK(fpgetmask() == FP_X_DZ);
+	ATF_CHECK_EQ_MSG(fpgetmask(), FP_X_DZ,
+	"fpgetmask()=%d FP_X_DZ=%d",
+	(int)fpgetmask(), (int)FP_X_DZ);
 
 	fedisableexcept(FE_ALL_EXCEPT);
 	feenableexcept(FE_INEXACT);
-	

CVS commit: src/tests/lib/libm

2023-11-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Nov  5 15:27:40 UTC 2023

Modified Files:
src/tests/lib/libm: t_fenv.c

Log Message:
t_fenv: Print wrong values if tests fail.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libm/t_fenv.c

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