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

2024-01-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jan 23 04:15:54 UTC 2024

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

Log Message:
powerpc/ieee.h: Protect from multiple includes

Fix build failure triggered by import of libm long-double functions.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/ieee.h

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



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

2024-01-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jan 23 04:15:54 UTC 2024

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

Log Message:
powerpc/ieee.h: Protect from multiple includes

Fix build failure triggered by import of libm long-double functions.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/ieee.h

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

Modified files:

Index: src/sys/arch/powerpc/include/ieee.h
diff -u src/sys/arch/powerpc/include/ieee.h:1.6 src/sys/arch/powerpc/include/ieee.h:1.7
--- src/sys/arch/powerpc/include/ieee.h:1.6	Wed Oct 22 10:32:50 2014
+++ src/sys/arch/powerpc/include/ieee.h	Tue Jan 23 04:15:54 2024
@@ -1,4 +1,7 @@
-/*	$NetBSD: ieee.h,v 1.6 2014/10/22 10:32:50 joerg Exp $	*/
+/*	$NetBSD: ieee.h,v 1.7 2024/01/23 04:15:54 rin Exp $	*/
+
+#ifndef _POWERPC_IEEE_H_
+#define _POWERPC_IEEE_H_
 
 #include 
 
@@ -16,3 +19,5 @@ union ldbl_u {
 	long double	ldblu_ld;
 	double		ldblu_d[2];
 };
+
+#endif /* !_POWERPC_IEEE_H_ */



CVS commit: src/sys/arch/evbppc

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jan 23 00:13:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
wii: Use screen dimming register for screen blanking.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/dev/wiifb.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/evbppc/include/wii.h
diff -u src/sys/arch/evbppc/include/wii.h:1.3 src/sys/arch/evbppc/include/wii.h:1.4
--- src/sys/arch/evbppc/include/wii.h:1.3	Mon Jan 22 21:28:15 2024
+++ src/sys/arch/evbppc/include/wii.h	Tue Jan 23 00:13:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wii.h,v 1.3 2024/01/22 21:28:15 jmcneill Exp $ */
+/* $NetBSD: wii.h,v 1.4 2024/01/23 00:13:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -101,6 +101,10 @@
 #define PI_IRQ_HOLLYWOOD		14
 
 /* Hollywood registers */
+#define HW_VIDIM			(HOLLYWOOD_PRIV_BASE + 0x01c)
+#define  VIDIM_E			__BIT(7)
+#define  VIDIM_Y			__BITS(5,3)
+#define  VIDIM_C			__BITS(2,0)
 #define HW_PPCIRQFLAGS			(HOLLYWOOD_BASE + 0x030)
 #define HW_PPCIRQMASK			(HOLLYWOOD_BASE + 0x034)
 #define HW_ARMIRQFLAGS			(HOLLYWOOD_PRIV_BASE + 0x038)

Index: src/sys/arch/evbppc/wii/dev/wiifb.c
diff -u src/sys/arch/evbppc/wii/dev/wiifb.c:1.3 src/sys/arch/evbppc/wii/dev/wiifb.c:1.4
--- src/sys/arch/evbppc/wii/dev/wiifb.c:1.3	Mon Jan 22 23:07:43 2024
+++ src/sys/arch/evbppc/wii/dev/wiifb.c	Tue Jan 23 00:13:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wiifb.c,v 1.3 2024/01/22 23:07:43 jmcneill Exp $ */
+/* $NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.3 2024/01/22 23:07:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $");
 
 #include 
 #include 
@@ -118,7 +118,6 @@ static void	wiifb_attach(device_t, devic
 static void	wiifb_init(struct wiifb_softc *);
 static void	wiifb_set_mode(struct wiifb_softc *, uint8_t, bool);
 static void	wiifb_set_fb(struct wiifb_softc *);
-static void	wiifb_set_picconf(struct wiifb_softc *, u_int, bool);
 
 static int	wiifb_ioctl(void *, void *, u_long, void *, int, lwp_t *);
 static paddr_t	wiifb_mmap(void *, void *, off_t, int);
@@ -203,6 +202,7 @@ static void
 wiifb_set_mode(struct wiifb_softc *sc, uint8_t format, bool interlaced)
 {
 	u_int modeidx;
+	u_int strides, reads;
 
 	modeidx = WIIFB_MODE_INDEX(format, interlaced);
 	if (modeidx >= WIIFB_NMODES || wiifb_modes[modeidx].name == NULL) {
@@ -238,7 +238,11 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 	}
 
 	/* Picture configuration */
-	wiifb_set_picconf(sc, sc->sc_curmode->width, interlaced);
+	strides = (sc->sc_curmode->width * 2) / (interlaced ? 16 : 32);
+	reads = (sc->sc_curmode->width * 2) / 32;
+	WR2(sc, VI_PICCONF,
+	__SHIFTIN(strides, VI_PICCONF_STRIDES) |
+	__SHIFTIN(reads, VI_PICCONF_READS));
 
 	/* Horizontal scaler configuration */
 	if (interlaced) {
@@ -278,18 +282,6 @@ wiifb_set_fb(struct wiifb_softc *sc)
 	WR4(sc, VI_BFBR, 0);
 }
 
-static void
-wiifb_set_picconf(struct wiifb_softc *sc, u_int width, bool interlaced)
-{
-	u_int strides, reads;
-
-	strides = (width * 2) / (interlaced ? 16 : 32);
-	reads = (width * 2) / 32;
-	WR2(sc, VI_PICCONF,
-	__SHIFTIN(strides, VI_PICCONF_STRIDES) |
-	__SHIFTIN(reads, VI_PICCONF_READS));
-}
-
 static int
 wiifb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
 {
@@ -328,11 +320,12 @@ wiifb_ioctl(void *v, void *vs, u_long cm
 		video = *(u_int *)data;
 		switch (video) {
 		case WSDISPLAYIO_VIDEO_OFF:
-			wiifb_set_picconf(sc, 0, sc->sc_interlaced);
+			out32(HW_VIDIM, __SHIFTIN(7, VIDIM_Y) |
+	__SHIFTIN(7, VIDIM_C) |
+	VIDIM_E);
 			return 0;
 		case WSDISPLAYIO_VIDEO_ON:
-			wiifb_set_picconf(sc, sc->sc_curmode->width,
-			sc->sc_interlaced);
+			out32(HW_VIDIM, 0);
 			return 0;
 		default:
 			return EINVAL;



CVS commit: src/sys/arch/evbppc

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jan 23 00:13:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
wii: Use screen dimming register for screen blanking.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/dev/wiifb.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/evbppc/wii/dev

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 23:07:43 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
wii: Add screenblank support.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/wii/dev/wiifb.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/evbppc/wii/dev/wiifb.c
diff -u src/sys/arch/evbppc/wii/dev/wiifb.c:1.2 src/sys/arch/evbppc/wii/dev/wiifb.c:1.3
--- src/sys/arch/evbppc/wii/dev/wiifb.c:1.2	Sun Jan 21 13:05:29 2024
+++ src/sys/arch/evbppc/wii/dev/wiifb.c	Mon Jan 22 23:07:43 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wiifb.c,v 1.2 2024/01/21 13:05:29 jmcneill Exp $ */
+/* $NetBSD: wiifb.c,v 1.3 2024/01/22 23:07:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.2 2024/01/21 13:05:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.3 2024/01/22 23:07:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -118,6 +118,7 @@ static void	wiifb_attach(device_t, devic
 static void	wiifb_init(struct wiifb_softc *);
 static void	wiifb_set_mode(struct wiifb_softc *, uint8_t, bool);
 static void	wiifb_set_fb(struct wiifb_softc *);
+static void	wiifb_set_picconf(struct wiifb_softc *, u_int, bool);
 
 static int	wiifb_ioctl(void *, void *, u_long, void *, int, lwp_t *);
 static paddr_t	wiifb_mmap(void *, void *, off_t, int);
@@ -202,7 +203,6 @@ static void
 wiifb_set_mode(struct wiifb_softc *sc, uint8_t format, bool interlaced)
 {
 	u_int modeidx;
-	u_int strides, reads;
 
 	modeidx = WIIFB_MODE_INDEX(format, interlaced);
 	if (modeidx >= WIIFB_NMODES || wiifb_modes[modeidx].name == NULL) {
@@ -238,11 +238,7 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 	}
 
 	/* Picture configuration */
-	strides = (sc->sc_curmode->width * 2) / (interlaced ? 16 : 32);
-	reads = (sc->sc_curmode->width * 2) / 32;
-	WR2(sc, VI_PICCONF,
-	__SHIFTIN(strides, VI_PICCONF_STRIDES) |
-	__SHIFTIN(reads, VI_PICCONF_READS));
+	wiifb_set_picconf(sc, sc->sc_curmode->width, interlaced);
 
 	/* Horizontal scaler configuration */
 	if (interlaced) {
@@ -282,6 +278,18 @@ wiifb_set_fb(struct wiifb_softc *sc)
 	WR4(sc, VI_BFBR, 0);
 }
 
+static void
+wiifb_set_picconf(struct wiifb_softc *sc, u_int width, bool interlaced)
+{
+	u_int strides, reads;
+
+	strides = (width * 2) / (interlaced ? 16 : 32);
+	reads = (width * 2) / 32;
+	WR2(sc, VI_PICCONF,
+	__SHIFTIN(strides, VI_PICCONF_STRIDES) |
+	__SHIFTIN(reads, VI_PICCONF_READS));
+}
+
 static int
 wiifb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
 {
@@ -289,6 +297,7 @@ wiifb_ioctl(void *v, void *vs, u_long cm
 	struct wsdisplayio_bus_id *busid;
 	struct wsdisplayio_fbinfo *fbi;
 	struct vi_regs *vr;
+	u_int video;
 
 	switch (cmd) {
 	case WSDISPLAYIO_GTYPE:
@@ -315,6 +324,20 @@ wiifb_ioctl(void *v, void *vs, u_long cm
 		fbi->fbi_flags = WSFB_VRAM_IS_RAM;
 		return 0;
 
+	case WSDISPLAYIO_SVIDEO:
+		video = *(u_int *)data;
+		switch (video) {
+		case WSDISPLAYIO_VIDEO_OFF:
+			wiifb_set_picconf(sc, 0, sc->sc_interlaced);
+			return 0;
+		case WSDISPLAYIO_VIDEO_ON:
+			wiifb_set_picconf(sc, sc->sc_curmode->width,
+			sc->sc_interlaced);
+			return 0;
+		default:
+			return EINVAL;
+		}
+
 	case VIIO_GETREGS:
 	case VIIO_SETREGS:
 		vr = data;



CVS commit: src/sys/arch/evbppc/wii/dev

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 23:07:43 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
wii: Add screenblank support.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/wii/dev/wiifb.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/evbppc

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 21:28:15 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: WII files.wii
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii: machdep.c mainbus.c
Added Files:
src/sys/arch/evbppc/wii/dev: bwai.c bwai.h bwdsp.c

Log Message:
wii: Add drivers for Broadway DSP and Audio interface.

0: [*] audio0 @ bwdsp0: Broadway DSP
   playback: 16, 2ch, 48000Hz
   record:   unavailable
   (P-) slinear_be 16/16, 2ch, { 48000 }


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/conf/WII \
src/sys/arch/evbppc/conf/files.wii
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/wii/machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/mainbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbppc/wii/dev/bwai.c \
src/sys/arch/evbppc/wii/dev/bwai.h src/sys/arch/evbppc/wii/dev/bwdsp.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/evbppc/conf/WII
diff -u src/sys/arch/evbppc/conf/WII:1.1 src/sys/arch/evbppc/conf/WII:1.2
--- src/sys/arch/evbppc/conf/WII:1.1	Sat Jan 20 21:35:59 2024
+++ src/sys/arch/evbppc/conf/WII	Mon Jan 22 21:28:15 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: WII,v 1.1 2024/01/20 21:35:59 jmcneill Exp $
+#	$NetBSD: WII,v 1.2 2024/01/22 21:28:15 jmcneill Exp $
 #
 #	Nintendo Wii
 #
@@ -128,6 +128,8 @@ options 	WSDISPLAY_DEFAULTSCREENS=4
 options 	WSDISPLAY_SCROLLSUPPORT
 
 hollywood0 	at mainbus0 irq 14
+bwai0		at mainbus0 addr 0x0d006c00 irq 5	# Audio interface
+bwdsp0		at mainbus0 addr 0x0c005000 irq 6	# DSP
 
 #iosipc0 	at hollywood0 addr 0x0d00 irq 30	# IOS IPC
 resetbtn0	at hollywood0 irq 17			# Reset button
Index: src/sys/arch/evbppc/conf/files.wii
diff -u src/sys/arch/evbppc/conf/files.wii:1.1 src/sys/arch/evbppc/conf/files.wii:1.2
--- src/sys/arch/evbppc/conf/files.wii:1.1	Sat Jan 20 21:35:59 2024
+++ src/sys/arch/evbppc/conf/files.wii	Mon Jan 22 21:28:15 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.wii,v 1.1 2024/01/20 21:35:59 jmcneill Exp $
+#	$NetBSD: files.wii,v 1.2 2024/01/22 21:28:15 jmcneill Exp $
 #
 #
 maxpartitions 16
@@ -39,6 +39,14 @@ file	arch/evbppc/wii/mainbus.c		mainbus 
 attach	genfb at mainbus with wiifb
 file	arch/evbppc/wii/dev/wiifb.c		wiifb
 
+device	bwai
+attach	bwai at mainbus
+file	arch/evbppc/wii/dev/bwai.c		bwai
+
+device	bwdsp: audiobus
+attach	bwdsp at mainbus
+file	arch/evbppc/wii/dev/bwdsp.c		bwdsp
+
 define	hollywood { [addr=-1], [irq=-1] }
 device	hollywood: hollywood
 attach	hollywood at mainbus

Index: src/sys/arch/evbppc/include/wii.h
diff -u src/sys/arch/evbppc/include/wii.h:1.2 src/sys/arch/evbppc/include/wii.h:1.3
--- src/sys/arch/evbppc/include/wii.h:1.2	Sun Jan 21 01:41:54 2024
+++ src/sys/arch/evbppc/include/wii.h	Mon Jan 22 21:28:15 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wii.h,v 1.2 2024/01/21 01:41:54 jmcneill Exp $ */
+/* $NetBSD: wii.h,v 1.3 2024/01/22 21:28:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -42,18 +42,24 @@
 
 #define WII_IOMEM_BASE			0x0c00
 
-#define	GLOBAL_BASE			0x
+#define GLOBAL_BASE			0x
 #define GLOBAL_SIZE			0x3400
 
 #define BROADWAY_BASE			0x0c00
 #define BROADWAY_SIZE			0x0004
 
-#define	VI_BASE0x0c002000
-#define	VI_SIZE0x0100
+#define VI_BASE0x0c002000
+#define VI_SIZE0x0100
 
 #define PI_BASE0x0c003000
 #define PI_SIZE0x0100
 
+#define DSP_BASE			0x0c005000
+#define DSP_SIZE			0x0200
+
+#define AI_BASE0x0d006c00
+#define AI_SIZE0x0020
+
 #define HOLLYWOOD_BASE			0x0d00
 #define HOLLYWOOD_PRIV_BASE		0x0d80
 #define HOLLYWOOD_SIZE			0x8000
@@ -61,8 +67,8 @@
 #define XFB_START			0x01698000
 #define XFB_SIZE			0x00168000
 
-#define DSP_START			0x1000
-#define DSP_SIZE			0x4000
+#define DSP_MEM_START			0x1000
+#define DSP_MEM_SIZE			0x4000
 
 #define IPC_START			0x133e
 #define IPC_SIZE			0x0002
@@ -90,12 +96,14 @@
 #define PI_INTMR			(PI_BASE + 0x04)
 
 /* Processor IRQs */
-#define	PI_IRQ_HOLLYWOOD		14
+#define PI_IRQ_AI			5
+#define PI_IRQ_DSP			6
+#define PI_IRQ_HOLLYWOOD		14
 
 /* Hollywood registers */
 #define HW_PPCIRQFLAGS			(HOLLYWOOD_BASE + 0x030)
 #define HW_PPCIRQMASK			(HOLLYWOOD_BASE + 0x034)
-#define	HW_ARMIRQFLAGS			(HOLLYWOOD_PRIV_BASE + 0x038)
+#define HW_ARMIRQFLAGS			(HOLLYWOOD_PRIV_BASE + 0x038)
 #define HW_ARMIRQMASK			(HOLLYWOOD_PRIV_BASE + 0x03c)
 #define HW_AHBPROT			(HOLLYWOOD_PRIV_BASE + 0x064)
 #define HW_GPIOB_OUT			(HOLLYWOOD_BASE + 0x0c0)

Index: src/sys/arch/evbppc/wii/machdep.c
diff -u src/sys/arch/evbppc/wii/machdep.c:1.2 src/sys/arch/evbppc/wii/machdep.c:1.3
--- src/sys/arch/evbppc/wii/machdep.c:1.2	Sun Jan 21 01:41:54 2024
+++ src/sys/arch/evbppc/wii/machdep.c	Mon Jan 22 21:28:15 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.2 2024/01/21 01:41:54 jmcneill Exp $ */
+/* 

CVS commit: src/sys/arch/evbppc

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 21:28:15 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: WII files.wii
src/sys/arch/evbppc/include: wii.h
src/sys/arch/evbppc/wii: machdep.c mainbus.c
Added Files:
src/sys/arch/evbppc/wii/dev: bwai.c bwai.h bwdsp.c

Log Message:
wii: Add drivers for Broadway DSP and Audio interface.

0: [*] audio0 @ bwdsp0: Broadway DSP
   playback: 16, 2ch, 48000Hz
   record:   unavailable
   (P-) slinear_be 16/16, 2ch, { 48000 }


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/conf/WII \
src/sys/arch/evbppc/conf/files.wii
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/include/wii.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/wii/machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/mainbus.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbppc/wii/dev/bwai.c \
src/sys/arch/evbppc/wii/dev/bwai.h src/sys/arch/evbppc/wii/dev/bwdsp.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/evbppc/conf

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 21:23:03 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: std.wii

Log Message:
wii: Fix a comment


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

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

Modified files:

Index: src/sys/arch/evbppc/conf/std.wii
diff -u src/sys/arch/evbppc/conf/std.wii:1.1 src/sys/arch/evbppc/conf/std.wii:1.2
--- src/sys/arch/evbppc/conf/std.wii:1.1	Sat Jan 20 21:35:59 2024
+++ src/sys/arch/evbppc/conf/std.wii	Mon Jan 22 21:23:03 2024
@@ -1,11 +1,11 @@
-#	$NetBSD: std.wii,v 1.1 2024/01/20 21:35:59 jmcneill Exp $
+#	$NetBSD: std.wii,v 1.2 2024/01/22 21:23:03 jmcneill Exp $
 #
 # standard, required NetBSD/wii 'options'
 
 machine		evbppc powerpc
 include		"conf/std"	# MI standard options
 
-options 	PPC_OEA		# Nintendo Wii uses IBM PPC750CXe CPUs
+options 	PPC_OEA		# Nintendo Wii uses IBM PPC750CL CPUs
 makeoptions 	PPCDIR="oea"	# Tell Makefile.powerpc what dir to use
 
 # Executable support:



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

2024-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 22 21:23:03 UTC 2024

Modified Files:
src/sys/arch/evbppc/conf: std.wii

Log Message:
wii: Fix a comment


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

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-wsfb/dist/src

2024-01-22 Thread Jared D. McNeill
Module Name:xsrc
Committed By:   jmcneill
Date:   Mon Jan 22 21:17:01 UTC 2024

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb.h wsfb_driver.c

Log Message:
xf86-video-wsfb: Add support for Nintendo Wii

The Wii's framebuffer is YUY2, so add a custom shadowproc that converts
from RGB565 to YUY2 on the fly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h
cvs rdiff -u -r1.47 -r1.48 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.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-wsfb/dist/src/wsfb.h
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h:1.10 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h:1.11
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h:1.10	Sat Sep 10 19:23:03 2022
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h	Mon Jan 22 21:17:01 2024
@@ -73,6 +73,7 @@ typedef struct {
 	void *			shadow;
 	Bool			HWCursor;
 	Bool			useSwap32;
+	Bool			useRGB16ToYUY2;
 #ifdef HAVE_SHADOW_AFB
 	Bool			planarAfb;
 #endif

Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.47 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.48
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.47	Sat Sep 10 19:25:44 2022
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c	Mon Jan 22 21:17:01 2024
@@ -133,6 +133,7 @@ static void WsfbDGASetViewport(ScrnInfoP
 static Bool WsfbDGAInit(ScrnInfoPtr, ScreenPtr);
 #endif
 
+static void WsfbShadowUpdateRGB16ToYUY2(ScreenPtr, shadowBufPtr);
 static void WsfbShadowUpdateSwap32(ScreenPtr, shadowBufPtr);
 static void WsfbShadowUpdateSplit(ScreenPtr, shadowBufPtr);
 
@@ -154,6 +155,13 @@ enum { WSFB_ROTATE_NONE = 0,
  */
 static int pix24bpp = 0;
 
+/*
+ * Screen-independent lookup table for RGB16 to YUV conversions.
+ */
+static unsigned char *mapRGB16ToY = NULL;
+static unsigned char *mapRGB16ToU = NULL;
+static unsigned char *mapRGB16ToV = NULL;
+
 #define WSFB_VERSION		4000
 #define WSFB_NAME		"wsfb"
 #define WSFB_DRIVER_NAME	"wsfb"
@@ -610,6 +618,25 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
 			fPtr->shadowFB = TRUE;
 		}
 	}
+
+	fPtr->useRGB16ToYUY2 = FALSE;
+#ifdef WSDISPLAY_TYPE_HOLLYWOOD
+	if (wstype == WSDISPLAY_TYPE_HOLLYWOOD) {
+		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+			   "Enabling RGB16->YUY2 conversion for Hollywood\n");
+		fPtr->useRGB16ToYUY2 = TRUE;
+		if (!fPtr->shadowFB) {
+			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+   "Shadow FB forced on for RGB16->YUY2 conversion\n");
+			fPtr->shadowFB = TRUE;
+		}
+		/*
+		 * Hollywood has a YUY2 framebuffer, but we treat it as
+		 * RGB565 and convert with a custom shadowproc.
+		 */
+		fPtr->fbi.fbi_pixeltype = WSFB_RGB;
+	}
+#endif
 	/* Rotation */
 	fPtr->rotate = WSFB_ROTATE_NONE;
 	if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE))) {
@@ -823,6 +850,35 @@ WsfbCreateScreenResources(ScreenPtr pScr
 	pPixmap = pScreen->GetScreenPixmap(pScreen);
 	if (fPtr->fbi.fbi_flags & WSFB_VRAM_IS_SPLIT) {
 		shadowproc = WsfbShadowUpdateSplit;
+	} else if (fPtr->useRGB16ToYUY2) {
+		/* Build RGB16 to Y, U, and V lookup tables */
+		if (mapRGB16ToY == NULL) {
+			mapRGB16ToY = malloc(0x3);
+			if (mapRGB16ToY == NULL) {
+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+"Cannot malloc %d bytes for RGB16->YUY2\n",
+0x3);
+return FALSE;
+			}
+			mapRGB16ToU = mapRGB16ToY + 0x1;
+			mapRGB16ToV = mapRGB16ToY + 0x2;
+		for (unsigned int n = 0; n < 0x1; n++) {
+		/* RGB565 values, scaled to 8 bits */
+		const double R = (((n >> 11) & 0x1f) * 255) / 31;
+		const double G = (((n >> 5) & 0x3f) * 255) / 63;
+		const double B = (((n >> 0) & 0x1f) * 255) / 31;
+
+/* Convert to YUV */
+		mapRGB16ToY[n] =
+0.257 * R + 0.504 * G + 0.098 * B +  16;
+		mapRGB16ToU[n] =
+   -0.148 * R - 0.291 * G + 0.439 * B + 128;
+		mapRGB16ToV[n] =
+0.439 * R - 0.368 * G - 0.071 * B + 128;
+			}
+		}
+
+		shadowproc = WsfbShadowUpdateRGB16ToYUY2;
 	} else if (fPtr->useSwap32) {
 		shadowproc = WsfbShadowUpdateSwap32;
 	} else if (fPtr->rotate) {
@@ -1682,6 +1738,101 @@ WsfbDriverFunc(ScrnInfoPtr pScrn, xorgDr
 }
 
 static inline void
+WsfbCopyRGB16ToYUY2(void *dest, void *src, int len)
+{
+	uint16_t *src16 = src;
+	uint32_t *dest32 = dest;
+
+	while (len > 0) {
+		const uint16_t rgb0 = src16[0];
+		const uint16_t rgb1 = src16[1];
+		const uint16_t rgb = ((rgb0 >> 1) & ~0x8410) +
+ ((rgb1 >> 1) & ~0x8410) +
+ ((rgb0 & rgb1) & 0x0841);
+		const uint32_t y0 = mapRGB16ToY[rgb0];
+		const uint32_t y1 = mapRGB16ToY[rgb1];
+		const uint32_t u = mapRGB16ToU[rgb];
+		const uint32_t v = mapRGB16ToV[rgb];
+

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

2024-01-22 Thread Jared D. McNeill
Module Name:xsrc
Committed By:   jmcneill
Date:   Mon Jan 22 21:17:01 UTC 2024

Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb.h wsfb_driver.c

Log Message:
xf86-video-wsfb: Add support for Nintendo Wii

The Wii's framebuffer is YUY2, so add a custom shadowproc that converts
from RGB565 to YUY2 on the fly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h
cvs rdiff -u -r1.47 -r1.48 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c

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



CVS commit: src/sys/sys

2024-01-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Jan 22 21:15:02 UTC 2024

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

Log Message:
fix M_CSUM_BITS bitfield for M_CSUM_BLANK - \37 is the bit before \40

noticed by rillig@ thanks


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mbuf.h

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



CVS commit: src/sys/sys

2024-01-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Jan 22 21:15:02 UTC 2024

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

Log Message:
fix M_CSUM_BITS bitfield for M_CSUM_BLANK - \37 is the bit before \40

noticed by rillig@ thanks


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.238 src/sys/sys/mbuf.h:1.239
--- src/sys/sys/mbuf.h:1.238	Wed Apr 12 06:48:08 2023
+++ src/sys/sys/mbuf.h	Mon Jan 22 21:15:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.238 2023/04/12 06:48:08 riastradh Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.239 2024/01/22 21:15:02 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -226,7 +226,7 @@ struct pkthdr {
 
 #define M_CSUM_BITS \
 "\20\1TCPv4\2UDPv4\3TCP_UDP_BAD\4DATA\5TCPv6\6UDPv6\7IPv4\10IPv4_BAD" \
-"\11TSOv4\12TSOv6\39BLANK\40NO_PSEUDOHDR"
+"\11TSOv4\12TSOv6\37BLANK\40NO_PSEUDOHDR"
 
 /*
  * Macros for manipulating csum_data on outgoing packets. These are



CVS commit: src/sys/sys

2024-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 22 18:50:46 UTC 2024

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

Log Message:
PR/57871: Haelwenn Monnier: Don't use u_char because it is not defined in with
POSIX_C_SOURCE


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/sys/socket.h

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



CVS commit: src/sys/sys

2024-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 22 18:50:46 UTC 2024

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

Log Message:
PR/57871: Haelwenn Monnier: Don't use u_char because it is not defined in with
POSIX_C_SOURCE


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/sys/socket.h

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

Modified files:

Index: src/sys/sys/socket.h
diff -u src/sys/sys/socket.h:1.131 src/sys/sys/socket.h:1.132
--- src/sys/sys/socket.h:1.131	Tue Nov  2 16:35:51 2021
+++ src/sys/sys/socket.h	Mon Jan 22 13:50:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.131 2021/11/02 20:35:51 christos Exp $	*/
+/*	$NetBSD: socket.h,v 1.132 2024/01/22 18:50:46 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -527,7 +527,7 @@ struct cmsghdr {
 	socklen_t	cmsg_len;	/* data byte count, including hdr */
 	int		cmsg_level;	/* originating protocol */
 	int		cmsg_type;	/* protocol-specific type */
-/* followed by	u_char  cmsg_data[]; */
+/* followed by unsigned char cmsg_data[]; */
 };
 
 /*
@@ -552,8 +552,8 @@ struct cmsghdr {
 (__CASTV(char *, (mhdr)->msg_control) + (mhdr)->msg_controllen)
 
 /* given pointer to struct cmsghdr, return pointer to data */
-#define	CMSG_DATA(cmsg) (__CASTV(u_char *, cmsg) + __CMSG_ASIZE)
-#define	CCMSG_DATA(cmsg) (__CASTCV(const u_char *, cmsg) + __CMSG_ASIZE)
+#define	CMSG_DATA(cmsg) (__CASTV(unsigned char *, cmsg) + __CMSG_ASIZE)
+#define	CCMSG_DATA(cmsg) (__CASTCV(const unsigned char *, cmsg) + __CMSG_ASIZE)
 
 /* given pointer to struct cmsghdr, return pointer to next cmsghdr */
 #define	CMSG_NXTHDR(mhdr, cmsg)	\



CVS commit: src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 15:19:39 UTC 2024

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi
src/lib/libm: shlib_version

Log Message:
Bump libm minor rev (libm.so.0.13 -> libm.so.0.14) after addition of
all the long double functions (with actual implementations).


To generate a diff of this commit:
cvs rdiff -u -r1.973 -r1.974 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.334 -r1.335 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.18 -r1.19 src/lib/libm/shlib_version

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.973 src/distrib/sets/lists/base/shl.mi:1.974
--- src/distrib/sets/lists/base/shl.mi:1.973	Wed Dec 20 17:17:21 2023
+++ src/distrib/sets/lists/base/shl.mi	Mon Jan 22 15:19:38 2024
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.973 2023/12/20 17:17:21 christos Exp $
+# $NetBSD: shl.mi,v 1.974 2024/01/22 15:19:38 kre Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -66,7 +66,7 @@
 ./lib/liblzma.so.2.0base-sys-shlib		dynamicroot
 ./lib/libm.so	base-sys-shlib		dynamicroot
 ./lib/libm.so.0	base-sys-shlib		dynamicroot
-./lib/libm.so.0.13base-sys-shlib		dynamicroot
+./lib/libm.so.0.14base-sys-shlib		dynamicroot
 ./lib/libnpf.so	base-npf-shlib		dynamicroot,npf
 ./lib/libnpf.so.0base-npf-shlib		dynamicroot,npf
 ./lib/libnpf.so.0.1base-npf-shlib		dynamicroot,npf
@@ -444,7 +444,7 @@
 ./usr/lib/liblzma.so.2.0			base-sys-shlib		compatfile
 ./usr/lib/libm.sobase-sys-shlib		compatfile
 ./usr/lib/libm.so.0base-sys-shlib		compatfile
-./usr/lib/libm.so.0.13base-sys-shlib		compatfile
+./usr/lib/libm.so.0.14base-sys-shlib		compatfile
 ./usr/lib/libmagic.sobase-sys-shlib		compatfile
 ./usr/lib/libmagic.so.8base-sys-shlib		compatfile
 ./usr/lib/libmagic.so.8.0			base-sys-shlib		compatfile

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.334 src/distrib/sets/lists/debug/shl.mi:1.335
--- src/distrib/sets/lists/debug/shl.mi:1.334	Wed Dec 20 17:17:21 2023
+++ src/distrib/sets/lists/debug/shl.mi	Mon Jan 22 15:19:39 2024
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.334 2023/12/20 17:17:21 christos Exp $
+# $NetBSD: shl.mi,v 1.335 2024/01/22 15:19:39 kre Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
@@ -18,7 +18,7 @@
 ./usr/libdata/debug/lib/libkvm.so.6.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/liblzf.so.1.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/liblzma.so.2.0.debug			comp-sys-debug	debug,dynamicroot
-./usr/libdata/debug/lib/libm.so.0.13.debug			comp-sys-debug	debug,dynamicroot
+./usr/libdata/debug/lib/libm.so.0.14.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libnpf.so.0.1.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libnvpair.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
 ./usr/libdata/debug/lib/libpcap.so.9.0.debug			comp-sys-debug	debug,dynamicroot
@@ -146,7 +146,7 @@
 ./usr/libdata/debug/usr/lib/liblutok.so.3.0.debug		comp-kyua-debug	debug,compatfile,kyua
 ./usr/libdata/debug/usr/lib/liblzf.so.1.0.debug			comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/liblzma.so.2.0.debug		comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/libm.so.0.13.debug			comp-sys-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libm.so.0.14.debug			comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmagic.so.8.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmenu.so.8.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libmj.so.1.0.debug			comp-crypto-debug	debug,compatfile

Index: src/lib/libm/shlib_version
diff -u src/lib/libm/shlib_version:1.18 src/lib/libm/shlib_version:1.19
--- src/lib/libm/shlib_version:1.18	Thu Mar 23 12:38:13 2023
+++ src/lib/libm/shlib_version	Mon Jan 22 15:19:38 2024
@@ -1,8 +1,8 @@
-#	$NetBSD: shlib_version,v 1.18 2023/03/23 12:38:13 riastradh Exp $
+#	$NetBSD: shlib_version,v 1.19 2024/01/22 15:19:38 kre Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
 # - remove compatibility cabs
 # - not provide isinff / isnanf (only provide __isinff version)
 major=0
-minor=13
+minor=14



CVS commit: src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 15:19:39 UTC 2024

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi
src/lib/libm: shlib_version

Log Message:
Bump libm minor rev (libm.so.0.13 -> libm.so.0.14) after addition of
all the long double functions (with actual implementations).


To generate a diff of this commit:
cvs rdiff -u -r1.973 -r1.974 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.334 -r1.335 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.18 -r1.19 src/lib/libm/shlib_version

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



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

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:37:25 UTC 2024

Modified Files:
src/sys/arch/m68k/include: ieee.h

Log Message:
Add multiple inclusion protection guard - the long double math routines
have a tendency to sometimes make that happen.

This seems to fix the sun3 build, and probably other m68k builds which
were working before the libm upgrades (it will do nothing for any that
were failing before that).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/ieee.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/m68k/include

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:37:25 UTC 2024

Modified Files:
src/sys/arch/m68k/include: ieee.h

Log Message:
Add multiple inclusion protection guard - the long double math routines
have a tendency to sometimes make that happen.

This seems to fix the sun3 build, and probably other m68k builds which
were working before the libm upgrades (it will do nothing for any that
were failing before that).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/include/ieee.h

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

Modified files:

Index: src/sys/arch/m68k/include/ieee.h
diff -u src/sys/arch/m68k/include/ieee.h:1.16 src/sys/arch/m68k/include/ieee.h:1.17
--- src/sys/arch/m68k/include/ieee.h:1.16	Mon Sep 20 16:13:35 2010
+++ src/sys/arch/m68k/include/ieee.h	Mon Jan 22 14:37:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee.h,v 1.16 2010/09/20 16:13:35 christos Exp $	*/
+/*	$NetBSD: ieee.h,v 1.17 2024/01/22 14:37:25 kre Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,6 +40,9 @@
  *	@(#)ieee.h	8.1 (Berkeley) 6/11/93
  */
 
+#ifndef	__68K_IEEE_H_INCLUDED
+#define	__68K_IEEE_H_INCLUDED
+
 /*
  * ieee.h defines the machine-dependent layout of the machine's IEEE
  * floating point.  It does *not* define (yet?) any of the rounding
@@ -111,3 +114,5 @@ union ieee_ext_u {
 #define LDBL_NBIT	0x8000
 #define mask_nbit_l(u)	((u).extu_frach &= ~LDBL_NBIT)
 #endif /* !__mc68010__ || _KERNEL */
+
+#endif /* __68K_IEEE_H_INCLUDED */



CVS commit: src/doc

2024-01-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan 22 14:33:26 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
postfix-3.8.5 is out


To generate a diff of this commit:
cvs rdiff -u -r1.1976 -r1.1977 src/doc/3RDPARTY

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



CVS commit: src/doc

2024-01-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jan 22 14:33:26 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
postfix-3.8.5 is out


To generate a diff of this commit:
cvs rdiff -u -r1.1976 -r1.1977 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1976 src/doc/3RDPARTY:1.1977
--- src/doc/3RDPARTY:1.1976	Tue Jan 16 09:42:44 2024
+++ src/doc/3RDPARTY	Mon Jan 22 14:33:26 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1976 2024/01/16 09:42:44 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1977 2024/01/22 14:33:26 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1230,11 +1230,11 @@ now to do a new import.
 
 Package:	Postfix
 Version:	3.8.4
-Current Vers:	3.8.4
+Current Vers:	3.8.5
 Maintainer:	Wietse Venema 
 Archive Site:
 Home Page:	http://www.postfix.org/
-Date: 		2023-12-23
+Date: 		2024-01-22
 Mailing List:	postfix-us...@postfix.org
 Responsible:	christos
 License:	IBM Public License. See also src/external/ibm-public/postfix/dist.



CVS commit: src/lib/libm/src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:26:18 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
Simply an overly complex way of saying "0 or 1" into a cleaner version.

While here add a commment about how the __i386__ magic LD80C macro
might no longer work on all other arch's as well (if someone can verify
that it still does, or can fix it so that it still works on i386, but
also works everywhere else, then please remove that XXX comment.
The issue I am (perhaps imagining) is the (uint32_t) cast.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libm/src/math_private.h

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

Modified files:

Index: src/lib/libm/src/math_private.h
diff -u src/lib/libm/src/math_private.h:1.29 src/lib/libm/src/math_private.h:1.30
--- src/lib/libm/src/math_private.h:1.29	Mon Jan 22 12:15:19 2024
+++ src/lib/libm/src/math_private.h	Mon Jan 22 14:26:18 2024
@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $NetBSD: math_private.h,v 1.29 2024/01/22 12:15:19 kre Exp $
+ * $NetBSD: math_private.h,v 1.30 2024/01/22 14:26:18 kre Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_
@@ -321,9 +321,10 @@ do {\
 	.extu_fracl = (uint32_t)(__CONCAT(m, ULL)),			\
 	.extu_frach = __CONCAT(m, ULL) >> EXT_FRACLBITS,		\
 	.extu_exp = (0x3fff + (ex)),	\
-	.extu_sign = ((v) < 0 ? 0x8000 : 0) >> EXT_EXPBITS,		\
+	.extu_sign = ((v) < 0),		\
 }
 #else
+/**XXX: the following comment may no longer be true:  kre 20240122 **/
 /* The above works on non-i386 too, but we use this to check v. */
 #define	LD80C(m, ex, v)	{ .extu_ld = (v), }
 #endif



CVS commit: src/lib/libm/src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:26:18 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
Simply an overly complex way of saying "0 or 1" into a cleaner version.

While here add a commment about how the __i386__ magic LD80C macro
might no longer work on all other arch's as well (if someone can verify
that it still does, or can fix it so that it still works on i386, but
also works everywhere else, then please remove that XXX comment.
The issue I am (perhaps imagining) is the (uint32_t) cast.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libm/src/math_private.h

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



CVS commit: src/include

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:01:50 UTC 2024

Modified Files:
src/include: math.h

Log Message:
It seems that we need prototypes for long double math functions, even
when !__HAVE_LONG_DOUBLE -- they still exist, but just aren't...

This might unbreak several more builds.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/include/math.h

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



CVS commit: src/include

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:01:50 UTC 2024

Modified Files:
src/include: math.h

Log Message:
It seems that we need prototypes for long double math functions, even
when !__HAVE_LONG_DOUBLE -- they still exist, but just aren't...

This might unbreak several more builds.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/include/math.h

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

Modified files:

Index: src/include/math.h
diff -u src/include/math.h:1.68 src/include/math.h:1.69
--- src/include/math.h:1.68	Mon Jan 22 12:15:19 2024
+++ src/include/math.h	Mon Jan 22 14:01:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: math.h,v 1.68 2024/01/22 12:15:19 kre Exp $	*/
+/*	$NetBSD: math.h,v 1.69 2024/01/22 14:01:50 kre Exp $	*/
 
 /*
  * 
@@ -599,12 +599,10 @@ float	sinpif(float);
 double	tanpi(double);
 float	tanpif(float);
 
-#ifdef __HAVE_LONG_DOUBLE
 long double	cospil(long double);
 long double	lgammal_r(long double, int *);
 long double	sinpil(long double);
 long double	tanpil(long double);
-#endif
 
 __END_DECLS
 



Re: CVS commit: src/bin/date

2024-01-22 Thread Christos Zoulas
In article <19118.1705868...@jacaranda.noi.kre.to>,
Robert Elz   wrote:
>Date:Sun, 21 Jan 2024 18:16:28 - (UTC)
>From:chris...@astron.com (Christos Zoulas)
>Message-ID:  
>
>  | I think this is the yacc used by the build process, not the yacc
>  | to build tools with? I.e. will this yacc produce c files usable in
>  | the host compilation environment?
>
>I was also looking at that problem, but in a different direction.
>Rather than making -d work in the tools date (either by somehow
>making parsedate work - which really isn't worth the effort for
>this, or via your hack) but by using -j and specifying the date
>in canonincal form instead of parsedate random form.
>
>That is, it is trivial to make
>
>   date -j '+whatever format you like' 202401220314
>
>work (including in the tools date), provided you can convert the date
>string you're starting with into that canonical form - that takes make
>magic, a topic of which I am barely aware exists, let alone competant,
>so that was as far as I took it...

I should have thought of that, duh. This means adding 4 0's in the Makefile...

christos



CVS commit: src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 12:15:19 UTC 2024

Modified Files:
src/include: math.h
src/lib/libm/ld80: b_expl.c b_logl.c b_tgammal.c
src/lib/libm/src: math_private.h s_atanl.c s_remquol.c

Log Message:
This set of changes seem to be sufficient to make at least the
amd64 port build again after the long double math function infusion
from yesterday.

Feel free (without consulting me, I'm just hacking about) to revert
any of this and do it a better way.

Note: this is not intended to be complete, in particular, in 
I added prototypes only for the functions that are needed for a
successful build, not all of the new ones...


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/include/math.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/ld80/b_expl.c \
src/lib/libm/ld80/b_logl.c src/lib/libm/ld80/b_tgammal.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c

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



CVS commit: src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 12:15:19 UTC 2024

Modified Files:
src/include: math.h
src/lib/libm/ld80: b_expl.c b_logl.c b_tgammal.c
src/lib/libm/src: math_private.h s_atanl.c s_remquol.c

Log Message:
This set of changes seem to be sufficient to make at least the
amd64 port build again after the long double math function infusion
from yesterday.

Feel free (without consulting me, I'm just hacking about) to revert
any of this and do it a better way.

Note: this is not intended to be complete, in particular, in 
I added prototypes only for the functions that are needed for a
successful build, not all of the new ones...


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/include/math.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/ld80/b_expl.c \
src/lib/libm/ld80/b_logl.c src/lib/libm/ld80/b_tgammal.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c

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

Modified files:

Index: src/include/math.h
diff -u src/include/math.h:1.67 src/include/math.h:1.68
--- src/include/math.h:1.67	Sat Aug 27 08:31:59 2022
+++ src/include/math.h	Mon Jan 22 12:15:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: math.h,v 1.67 2022/08/27 08:31:59 christos Exp $	*/
+/*	$NetBSD: math.h,v 1.68 2024/01/22 12:15:19 kre Exp $	*/
 
 /*
  * 
@@ -591,6 +591,21 @@ int	__isnanl(long double);
 int	__signbitl(long double);
 #endif
 
+/* XXX: Probable temporary hacks for new math functions - 20240122 */
+double	cospi(double);
+float	cospif(float);
+double	sinpi(double);
+float	sinpif(float);
+double	tanpi(double);
+float	tanpif(float);
+
+#ifdef __HAVE_LONG_DOUBLE
+long double	cospil(long double);
+long double	lgammal_r(long double, int *);
+long double	sinpil(long double);
+long double	tanpil(long double);
+#endif
+
 __END_DECLS
 
 #endif /* _MATH_H_ */

Index: src/lib/libm/ld80/b_expl.c
diff -u src/lib/libm/ld80/b_expl.c:1.1 src/lib/libm/ld80/b_expl.c:1.2
--- src/lib/libm/ld80/b_expl.c:1.1	Sun Jan 21 18:53:16 2024
+++ src/lib/libm/ld80/b_expl.c	Mon Jan 22 12:15:19 2024
@@ -29,6 +29,7 @@
  * SUCH DAMAGE.
  */
 
+#include 
 /*
  * See bsdsrc/b_exp.c for implementation details.
  *
Index: src/lib/libm/ld80/b_logl.c
diff -u src/lib/libm/ld80/b_logl.c:1.1 src/lib/libm/ld80/b_logl.c:1.2
--- src/lib/libm/ld80/b_logl.c:1.1	Sun Jan 21 18:53:16 2024
+++ src/lib/libm/ld80/b_logl.c	Mon Jan 22 12:15:19 2024
@@ -29,12 +29,16 @@
  * SUCH DAMAGE.
  */
 
+#include 
+
 /*
  * See bsdsrc/b_log.c for implementation details.
  *
  * bsdrc/b_log.c converted to long double by Steven G. Kargl.
  */
 
+#include "math_private.h"
+
 #define N 128
 
 /*
Index: src/lib/libm/ld80/b_tgammal.c
diff -u src/lib/libm/ld80/b_tgammal.c:1.1 src/lib/libm/ld80/b_tgammal.c:1.2
--- src/lib/libm/ld80/b_tgammal.c:1.1	Sun Jan 21 18:53:16 2024
+++ src/lib/libm/ld80/b_tgammal.c	Mon Jan 22 12:15:19 2024
@@ -41,6 +41,8 @@
  * bsdrc/b_tgamma.c converted to long double by Steven G. Kargl.
  */
 
+#include 
+
 /*
  * See bsdsrc/t_tgamma.c for implementation details.
  */

Index: src/lib/libm/src/math_private.h
diff -u src/lib/libm/src/math_private.h:1.28 src/lib/libm/src/math_private.h:1.29
--- src/lib/libm/src/math_private.h:1.28	Sun Jan 21 18:53:18 2024
+++ src/lib/libm/src/math_private.h	Mon Jan 22 12:15:19 2024
@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $NetBSD: math_private.h,v 1.28 2024/01/21 18:53:18 christos Exp $
+ * $NetBSD: math_private.h,v 1.29 2024/01/22 12:15:19 kre Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_
@@ -318,10 +318,10 @@ do {\
 #ifdef __i386__
 /* Long double constants are broken on i386. */
 #define	LD80C(m, ex, v) {		\
-	.extu_fracl = __CONCAT(m, ULL);	\
-	.extu_frach = __CONCAT(m, ULL) >> EXT_FRACLBITS;		\
-	.extu_exp = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0),		\
-	.extu_sign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0) >> EXP_EXPBITS,\
+	.extu_fracl = (uint32_t)(__CONCAT(m, ULL)),			\
+	.extu_frach = __CONCAT(m, ULL) >> EXT_FRACLBITS,		\
+	.extu_exp = (0x3fff + (ex)),	\
+	.extu_sign = ((v) < 0 ? 0x8000 : 0) >> EXT_EXPBITS,		\
 }
 #else
 /* The above works on non-i386 too, but we use this to check v. */

Index: src/lib/libm/src/s_atanl.c
diff -u src/lib/libm/src/s_atanl.c:1.1 src/lib/libm/src/s_atanl.c:1.2
--- src/lib/libm/src/s_atanl.c:1.1	Sun Jan 21 18:53:18 2024
+++ src/lib/libm/src/s_atanl.c	Mon Jan 22 12:15:19 2024
@@ -15,6 +15,9 @@
 
 #include 
 
+#include "math.h"
+#include "math_private.h"
+
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(atanl, _atanl)
 
@@ -31,8 +34,6 @@ __weak_alias(atanl, _atanl)
 #else
 #error "Unsupported long double format"
 #endif
-#include "math.h"
-#include "math_private.h"
 
 #ifdef LDBL_IM