CVS commit: src/usr.sbin/sysinst

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 07:38:13 UTC 2024

Modified Files:
src/usr.sbin/sysinst: Makefile
Added Files:
src/usr.sbin/sysinst/arch/virt68k: Makefile md.c md.h menus.md.en
menus.md.es menus.md.fr menus.md.pl msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
First crack at virt68k sysinst support, more-or-less cloned from mvme68k
with the names changed to protect the guilty and boot block installation
removed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/arch/virt68k/Makefile \
src/usr.sbin/sysinst/arch/virt68k/md.c \
src/usr.sbin/sysinst/arch/virt68k/md.h \
src/usr.sbin/sysinst/arch/virt68k/menus.md.en \
src/usr.sbin/sysinst/arch/virt68k/menus.md.es \
src/usr.sbin/sysinst/arch/virt68k/menus.md.fr \
src/usr.sbin/sysinst/arch/virt68k/menus.md.pl \
src/usr.sbin/sysinst/arch/virt68k/msg.md.de \
src/usr.sbin/sysinst/arch/virt68k/msg.md.en \
src/usr.sbin/sysinst/arch/virt68k/msg.md.es \
src/usr.sbin/sysinst/arch/virt68k/msg.md.fr \
src/usr.sbin/sysinst/arch/virt68k/msg.md.pl

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

Modified files:

Index: src/usr.sbin/sysinst/Makefile
diff -u src/usr.sbin/sysinst/Makefile:1.3 src/usr.sbin/sysinst/Makefile:1.4
--- src/usr.sbin/sysinst/Makefile:1.3	Wed Jan 24 09:04:46 2018
+++ src/usr.sbin/sysinst/Makefile	Sat Jan  6 07:38:13 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2018/01/24 09:04:46 skrll Exp $
+#	$NetBSD: Makefile,v 1.4 2024/01/06 07:38:13 thorpej Exp $
 #
 # sysinst is usually built when the crunched install binary is built,
 # but can be built here as a normal program for testing.
@@ -49,6 +49,7 @@ SUBDIR += arch/shark
 SUBDIR += arch/sparc
 SUBDIR += arch/sparc64
 SUBDIR += arch/vax
+SUBDIR += arch/virt68k
 SUBDIR += arch/x68k
 SUBDIR += arch/zaurus
 

Added files:

Index: src/usr.sbin/sysinst/arch/virt68k/Makefile
diff -u /dev/null src/usr.sbin/sysinst/arch/virt68k/Makefile:1.1
--- /dev/null	Sat Jan  6 07:38:14 2024
+++ src/usr.sbin/sysinst/arch/virt68k/Makefile	Sat Jan  6 07:38:13 2024
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2024/01/06 07:38:13 thorpej Exp $
+#
+# Makefile for virt68k
+#
+
+.include "../../Makefile.inc"
Index: src/usr.sbin/sysinst/arch/virt68k/md.c
diff -u /dev/null src/usr.sbin/sysinst/arch/virt68k/md.c:1.1
--- /dev/null	Sat Jan  6 07:38:14 2024
+++ src/usr.sbin/sysinst/arch/virt68k/md.c	Sat Jan  6 07:38:13 2024
@@ -0,0 +1,240 @@
+/*	$NetBSD: md.c,v 1.1 2024/01/06 07:38:13 thorpej Exp $	*/
+
+/*
+ * Copyright 1997 Piermont Information Systems Inc.
+ * All rights reserved.
+ *
+ * Based on code written by Philip A. Nelson for Piermont Information
+ * Systems Inc.
+ *
+ * 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.
+ * 3. The name of Piermont Information Systems Inc. may not be used to endorse
+ *or promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* md.c -- virt68k machine specific routines */
+/* This file is in close sync with hp300, pmax, sparc, vax and x68k md.c */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "defs.h"
+#include "md.h"
+#include "msg_defs.h"
+#include "menu_defs.h"
+
+void
+md_init(void)
+{
+}
+
+void
+md_init_set_status(int flags)
+{
+	(void)flags;
+}
+
+bool
+md_get_info(struct install_partition_desc *install)
+{
+	char buf[1024];
+	int fd;
+	char dev_name[100];
+	struct disklabel disklabel;
+
+	snprintf(dev_name, 100, "/dev/r%sc", pm->diskdev);
+
+	fd = open(dev_name, O_RDONLY, 0);
+	if (fd < 0) {
+		

CVS commit: src/usr.sbin/sysinst

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 07:38:13 UTC 2024

Modified Files:
src/usr.sbin/sysinst: Makefile
Added Files:
src/usr.sbin/sysinst/arch/virt68k: Makefile md.c md.h menus.md.en
menus.md.es menus.md.fr menus.md.pl msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
First crack at virt68k sysinst support, more-or-less cloned from mvme68k
with the names changed to protect the guilty and boot block installation
removed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/arch/virt68k/Makefile \
src/usr.sbin/sysinst/arch/virt68k/md.c \
src/usr.sbin/sysinst/arch/virt68k/md.h \
src/usr.sbin/sysinst/arch/virt68k/menus.md.en \
src/usr.sbin/sysinst/arch/virt68k/menus.md.es \
src/usr.sbin/sysinst/arch/virt68k/menus.md.fr \
src/usr.sbin/sysinst/arch/virt68k/menus.md.pl \
src/usr.sbin/sysinst/arch/virt68k/msg.md.de \
src/usr.sbin/sysinst/arch/virt68k/msg.md.en \
src/usr.sbin/sysinst/arch/virt68k/msg.md.es \
src/usr.sbin/sysinst/arch/virt68k/msg.md.fr \
src/usr.sbin/sysinst/arch/virt68k/msg.md.pl

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



CVS commit: src/distrib/sets/lists

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 07:35:39 UTC 2024

Added Files:
src/distrib/sets/lists/base: md.virt68k
src/distrib/sets/lists/comp: md.virt68k
src/distrib/sets/lists/debug: md.virt68k

Log Message:
First cut at set list for virt68k.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/base/md.virt68k
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/comp/md.virt68k
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/debug/md.virt68k

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

Added files:

Index: src/distrib/sets/lists/base/md.virt68k
diff -u /dev/null src/distrib/sets/lists/base/md.virt68k:1.1
--- /dev/null	Sat Jan  6 07:35:39 2024
+++ src/distrib/sets/lists/base/md.virt68k	Sat Jan  6 07:35:38 2024
@@ -0,0 +1,5 @@
+# $NetBSD: md.virt68k,v 1.1 2024/01/06 07:35:38 thorpej Exp $
+./usr/share/sysinst/catalog/sysinstmsgs.de	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.es	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.fr	base-util-share
+./usr/share/sysinst/catalog/sysinstmsgs.pl	base-util-share

Index: src/distrib/sets/lists/comp/md.virt68k
diff -u /dev/null src/distrib/sets/lists/comp/md.virt68k:1.1
--- /dev/null	Sat Jan  6 07:35:39 2024
+++ src/distrib/sets/lists/comp/md.virt68k	Sat Jan  6 07:35:38 2024
@@ -0,0 +1,47 @@
+# $NetBSD: md.virt68k,v 1.1 2024/01/06 07:35:38 thorpej Exp $
+./usr/include/ieeefp.hcomp-c-include
+./usr/include/virt68kcomp-c-include
+./usr/include/virt68k/ansi.h			comp-c-include
+./usr/include/virt68k/aout_machdep.h		comp-c-include
+./usr/include/virt68k/asm.h			comp-c-include
+./usr/include/virt68k/bootinfo.h		comp-c-include
+./usr/include/virt68k/bswap.h			comp-c-include
+./usr/include/virt68k/cdefs.h			comp-c-include
+./usr/include/virt68k/cpu.h			comp-c-include
+./usr/include/virt68k/disklabel.h		comp-c-include
+./usr/include/virt68k/elf_machdep.h		comp-c-include
+./usr/include/virt68k/endian.h			comp-c-include
+./usr/include/virt68k/endian_machdep.h		comp-c-include
+./usr/include/virt68k/fenv.h			comp-c-include
+./usr/include/virt68k/float.h			comp-c-include
+./usr/include/virt68k/frame.h			comp-c-include
+./usr/include/virt68k/ieee.h			comp-c-include
+./usr/include/virt68k/ieeefp.h			comp-c-include
+./usr/include/virt68k/int_const.h		comp-c-include
+./usr/include/virt68k/int_fmtio.h		comp-c-include
+./usr/include/virt68k/int_limits.h		comp-c-include
+./usr/include/virt68k/int_mwgwtypes.h		comp-c-include
+./usr/include/virt68k/int_types.h		comp-c-include
+./usr/include/virt68k/intr.h			comp-c-include
+./usr/include/virt68k/kcore.h			comp-c-include
+./usr/include/virt68k/limits.h			comp-c-include
+./usr/include/virt68k/lock.h			comp-c-include
+./usr/include/virt68k/math.h			comp-c-include
+./usr/include/virt68k/mcontext.h		comp-c-include
+./usr/include/virt68k/mutex.h			comp-c-include
+./usr/include/virt68k/param.h			comp-c-include
+./usr/include/virt68k/pcb.h			comp-c-include
+./usr/include/virt68k/pmap.h			comp-c-include
+./usr/include/virt68k/proc.h			comp-c-include
+./usr/include/virt68k/profile.h			comp-c-include
+./usr/include/virt68k/psl.h			comp-c-include
+./usr/include/virt68k/pte.h			comp-c-include
+./usr/include/virt68k/ptrace.h			comp-c-include
+./usr/include/virt68k/reg.h			comp-c-include
+./usr/include/virt68k/rwlock.h			comp-c-include
+./usr/include/virt68k/setjmp.h			comp-c-include
+./usr/include/virt68k/signal.h			comp-c-include
+./usr/include/virt68k/trap.h			comp-c-include
+./usr/include/virt68k/types.h			comp-c-include
+./usr/include/virt68k/vmparam.h			comp-c-include
+./usr/include/virt68k/wchar_limits.h		comp-c-include

Index: src/distrib/sets/lists/debug/md.virt68k
diff -u /dev/null src/distrib/sets/lists/debug/md.virt68k:1.1
--- /dev/null	Sat Jan  6 07:35:39 2024
+++ src/distrib/sets/lists/debug/md.virt68k	Sat Jan  6 07:35:39 2024
@@ -0,0 +1 @@
+# $NetBSD: md.virt68k,v 1.1 2024/01/06 07:35:39 thorpej Exp $



CVS commit: src/distrib/sets/lists

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 07:35:39 UTC 2024

Added Files:
src/distrib/sets/lists/base: md.virt68k
src/distrib/sets/lists/comp: md.virt68k
src/distrib/sets/lists/debug: md.virt68k

Log Message:
First cut at set list for virt68k.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/base/md.virt68k
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/comp/md.virt68k
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/debug/md.virt68k

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



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:35 UTC 2024

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

Log Message:
Remove funny blank line.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/mips/mips/mips_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.305 src/sys/arch/mips/mips/mips_machdep.c:1.306
--- src/sys/arch/mips/mips/mips_machdep.c:1.305	Sat Jan  6 07:27:05 2024
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jan  6 07:27:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.306 2024/01/06 07:27:35 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.306 2024/01/06 07:27:35 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2311,7 +2311,6 @@ mips_page_physload(vaddr_t vkernstart, v
 			 * Now we give this segment to uvm.
 			 */
 			printf("adding %#"PRIxPADDR" @ %#"PRIxPADDR" to freelist %d\n",
-
 			segend - segstart, segstart, freelist);
 			paddr_t first = atop(segstart);
 			paddr_t last = atop(segend);



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:35 UTC 2024

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

Log Message:
Remove funny blank line.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/mips/mips/mips_machdep.c

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



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:05 UTC 2024

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

Log Message:
Add Cavium CN68xx to list of known CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/arch/mips/mips/mips_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.304 src/sys/arch/mips/mips/mips_machdep.c:1.305
--- src/sys/arch/mips/mips/mips_machdep.c:1.304	Sun Oct 23 06:10:09 2022
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jan  6 07:27:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -671,6 +671,14 @@ static const struct pridtab cputab[] = {
 	  0,
 	  "CN50xx"		},
 
+	{ MIPS_PRID_CID_CAVIUM, MIPS_CN68XX, -1, -1, -1, 0,
+	  MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR,
+	  MIPS_CP0FL_USE |
+	  MIPS_CP0FL_CONFIG  | MIPS_CP0FL_CONFIG1 | MIPS_CP0FL_CONFIG2 |
+	  MIPS_CP0FL_CONFIG3 | MIPS_CP0FL_CONFIG4,
+	  0,
+	  "CN68xx"		},
+
 	{ MIPS_PRID_CID_CAVIUM, MIPS_CN70XX, -1, -1, -1, 0,
 	  MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR,
 	  MIPS_CP0FL_USE | MIPS_CP0FL_EBASE |



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:05 UTC 2024

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

Log Message:
Add Cavium CN68xx to list of known CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/arch/mips/mips/mips_machdep.c

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



CVS commit: src/sys/dev/virtio

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 06:59:33 UTC 2024

Modified Files:
src/sys/dev/virtio: virtio_mmio.c virtio_mmiovar.h

Log Message:
Perform VirtIO 1.0 feature negotation in the MMIO transport.  This is
required for HV's that have MMIO-v2 and don't support transitional devices.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/virtio/virtio_mmio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/virtio/virtio_mmiovar.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/virtio/virtio_mmio.c
diff -u src/sys/dev/virtio/virtio_mmio.c:1.12 src/sys/dev/virtio/virtio_mmio.c:1.13
--- src/sys/dev/virtio/virtio_mmio.c:1.12	Tue Jan  2 07:24:50 2024
+++ src/sys/dev/virtio/virtio_mmio.c	Sat Jan  6 06:59:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio_mmio.c,v 1.12 2024/01/02 07:24:50 thorpej Exp $	*/
+/*	$NetBSD: virtio_mmio.c,v 1.13 2024/01/06 06:59:33 thorpej Exp $	*/
 /*	$OpenBSD: virtio_mmio.c,v 1.2 2017/02/24 17:12:31 patrick Exp $	*/
 
 /*-
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.12 2024/01/02 07:24:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.13 2024/01/06 06:59:33 thorpej Exp $");
 
 #include 
 #include 
@@ -99,9 +99,6 @@ __KERNEL_RCSID(0, "$NetBSD: virtio_mmio.
 #define	VIRTIO_MMIO_V2_CONFIG_GEN	0x0fc
 #define VIRTIO_MMIO_CONFIG		0x100
 
-#define VIRTIO_MMIO_INT_VRING		(1 << 0)
-#define VIRTIO_MMIO_INT_CONFIG		(1 << 1)
-
 /*
  * MMIO configuration space for virtio-mmio v1 is in guest byte order.
  *
@@ -124,6 +121,7 @@ static void	virtio_mmio_kick(struct virt
 static uint16_t	virtio_mmio_read_queue_size(struct virtio_softc *, uint16_t);
 static void	virtio_mmio_v1_setup_queue(struct virtio_softc *, uint16_t, uint64_t);
 static void	virtio_mmio_v2_setup_queue(struct virtio_softc *, uint16_t, uint64_t);
+static int	virtio_mmio_get_status(struct virtio_softc *);
 static void	virtio_mmio_set_status(struct virtio_softc *, int);
 static void	virtio_mmio_negotiate_features(struct virtio_softc *, uint64_t);
 static int	virtio_mmio_alloc_interrupts(struct virtio_softc *);
@@ -232,6 +230,14 @@ virtio_mmio_v2_setup_queue(struct virtio
 	}
 }
 
+static int
+virtio_mmio_get_status(struct virtio_softc *vsc)
+{
+	struct virtio_mmio_softc *sc = (struct virtio_mmio_softc *)vsc;
+
+	return virtio_mmio_reg_read(sc, VIRTIO_MMIO_STATUS);
+}
+
 static void
 virtio_mmio_set_status(struct virtio_softc *vsc, int status)
 {
@@ -260,7 +266,8 @@ virtio_mmio_common_attach(struct virtio_
 {
 	struct virtio_softc *vsc = &sc->sc_sc;
 	device_t self = vsc->sc_dev;
-	uint32_t id, magic, ver;
+	uint32_t id, magic;
+	int virtio_vers;
 
 	magic = bus_space_read_4(sc->sc_iot, sc->sc_ioh,
 	VIRTIO_MMIO_MAGIC_VALUE);
@@ -276,25 +283,35 @@ virtio_mmio_common_attach(struct virtio_
 	vsc->sc_bus_endian= READ_ENDIAN;
 	vsc->sc_struct_endian = STRUCT_ENDIAN;
 
-	ver = virtio_mmio_reg_read(sc, VIRTIO_MMIO_VERSION);
-	switch (ver) {
+	sc->sc_mmio_vers = virtio_mmio_reg_read(sc, VIRTIO_MMIO_VERSION);
+	switch (sc->sc_mmio_vers) {
 	case 1:
 		/* we could use PAGE_SIZE, but virtio(4) assumes 4KiB for now */
 		virtio_mmio_reg_write(sc,
 		VIRTIO_MMIO_V1_GUEST_PAGE_SIZE, VIRTIO_PAGE_SIZE);
 		vsc->sc_ops = &virtio_mmio_v1_ops;
+		/*
+		 * MMIO v1 ("legacy") is documented in the VirtIO 0.9.x
+		 * draft(s) and uses the same page-oriented queue setup,
+		 * so that's what we'll report as the VirtIO version.
+		 */
+		virtio_vers = 0;
 		break;
 
 	case 2:
 		vsc->sc_ops = &virtio_mmio_v2_ops;
+		/*
+		 * MMIO v2 is documented in the VirtIO 1.0 spec.
+		 */
+		virtio_vers = 1;
 		break;
 
 	default:
 		aprint_error_dev(vsc->sc_dev,
-		"unknown version 0x%08x; giving up\n", ver);
+		"unknown version 0x%08x; giving up\n", sc->sc_mmio_vers);
 		return;
 	}
-	aprint_normal_dev(self, "VirtIO-MMIO v%d\n", ver);
+	aprint_normal_dev(self, "VirtIO-MMIO-v%u\n", sc->sc_mmio_vers);
 
 	id = virtio_mmio_reg_read(sc, VIRTIO_MMIO_DEVICE_ID);
 	if (id == 0) {
@@ -302,7 +319,7 @@ virtio_mmio_common_attach(struct virtio_
 		return;
 	}
 
-	virtio_print_device_type(self, id, ver);
+	virtio_print_device_type(self, id, virtio_vers);
 
 	/* set up our device config tag */
 	vsc->sc_devcfg_iosize = sc->sc_iosize - VIRTIO_MMIO_CONFIG;
@@ -347,21 +364,89 @@ virtio_mmio_common_detach(struct virtio_
 
 /*
  * Feature negotiation.
+ *
+ * We fold pre-VirtIO-1.0 feature negotiation into this single routine
+ * because the "legacy" (MMIO-v1) also had the feature sel registers.
  */
 static void
 virtio_mmio_negotiate_features(struct virtio_softc *vsc, uint64_t
 driver_features)
 {
 	struct virtio_mmio_softc *sc = (struct virtio_mmio_softc *)vsc;
-	uint32_t r;
+	device_t self = vsc->sc_dev;
+	uint64_t saved_driver_features = driver_features;
+	uint64_t device_features, negotiated;
+	uint32_t device_status;
+
+	driver_features |= VIRTIO_F_VERSION_1;
+	vsc

CVS commit: src/sys/dev/virtio

2024-01-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan  6 06:59:33 UTC 2024

Modified Files:
src/sys/dev/virtio: virtio_mmio.c virtio_mmiovar.h

Log Message:
Perform VirtIO 1.0 feature negotation in the MMIO transport.  This is
required for HV's that have MMIO-v2 and don't support transitional devices.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/virtio/virtio_mmio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/virtio/virtio_mmiovar.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/x68k

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:31:20 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: mfp.c
src/sys/arch/x68k/include: param.h
src/sys/arch/x68k/x68k: locore.s

Log Message:
x68k: Make _delay() argument to microseconds.
'<< 8' is just a magnification factor and should not be visible
from the outside.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x68k/dev/mfp.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/include/param.h
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/x68k/x68k/locore.s

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

Modified files:

Index: src/sys/arch/x68k/dev/mfp.c
diff -u src/sys/arch/x68k/dev/mfp.c:1.31 src/sys/arch/x68k/dev/mfp.c:1.32
--- src/sys/arch/x68k/dev/mfp.c:1.31	Sat Jan  6 05:24:33 2024
+++ src/sys/arch/x68k/dev/mfp.c	Sat Jan  6 05:31:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mfp.c,v 1.31 2024/01/06 05:24:33 isaki Exp $	*/
+/*	$NetBSD: mfp.c,v 1.32 2024/01/06 05:31:19 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1998 NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.31 2024/01/06 05:24:33 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.32 2024/01/06 05:31:19 isaki Exp $");
 
 #include 
 #include 
@@ -165,7 +165,7 @@ mfp_calibrate_delay(void)
 	for (delay_divisor = 140; delay_divisor > 0; delay_divisor--) {
 		mfp_set_tcdr(255-0);
 		mfp_set_tcdcr(0x70); /* 1/200 delay mode */
-		_delay(1 << 8);
+		_delay(1);
 		mfp_set_tcdcr(0); /* stop timer */
 		if ((255 - mfp_get_tcdr()) > 200)
 			break;	/* got it! */

Index: src/sys/arch/x68k/include/param.h
diff -u src/sys/arch/x68k/include/param.h:1.30 src/sys/arch/x68k/include/param.h:1.31
--- src/sys/arch/x68k/include/param.h:1.30	Mon May 31 14:38:57 2021
+++ src/sys/arch/x68k/include/param.h	Sat Jan  6 05:31:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.30 2021/05/31 14:38:57 simonb Exp $	*/
+/*	$NetBSD: param.h,v 1.31 2024/01/06 05:31:19 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
 #if defined(_KERNEL) && !defined(_LOCORE)
 #include 
 
-#define	delay(us)	_delay((us) << 8)
+#define	delay(us)	_delay(us)
 #define DELAY(us)	delay(us)
 
 void	_delay(u_int);

Index: src/sys/arch/x68k/x68k/locore.s
diff -u src/sys/arch/x68k/x68k/locore.s:1.125 src/sys/arch/x68k/x68k/locore.s:1.126
--- src/sys/arch/x68k/x68k/locore.s:1.125	Wed Dec 27 03:03:42 2023
+++ src/sys/arch/x68k/x68k/locore.s	Sat Jan  6 05:31:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.125 2023/12/27 03:03:42 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.126 2024/01/06 05:31:19 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -852,13 +852,14 @@ LmotommuC:
 /*
  * _delay(u_int N)
  *
- * Delay for at least (N/256) microseconds.
+ * Delay for at least N microseconds.
  * This routine depends on the variable:  delay_divisor
  * which should be set based on the CPU clock rate.
  */
 ENTRY_NOPROFILE(_delay)
-	| %d0 = arg = (usecs << 8)
+	| %d0 = (usecs * a certain magnification factor)
 	movl	%sp@(4),%d0
+	lsll	#8,%d0
 	| %d1 = delay_divisor
 	movl	_C_LABEL(delay_divisor),%d1
 L_delay:



CVS commit: src/sys/arch/x68k

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:31:20 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: mfp.c
src/sys/arch/x68k/include: param.h
src/sys/arch/x68k/x68k: locore.s

Log Message:
x68k: Make _delay() argument to microseconds.
'<< 8' is just a magnification factor and should not be visible
from the outside.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x68k/dev/mfp.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/include/param.h
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/x68k/x68k/locore.s

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



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

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:24:34 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: mfp.c

Log Message:
Remove a duplicated extern declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/dev/mfp.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/x68k/dev

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:24:34 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: mfp.c

Log Message:
Remove a duplicated extern declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/dev/mfp.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/x68k/dev/mfp.c
diff -u src/sys/arch/x68k/dev/mfp.c:1.30 src/sys/arch/x68k/dev/mfp.c:1.31
--- src/sys/arch/x68k/dev/mfp.c:1.30	Wed Dec 20 00:40:44 2023
+++ src/sys/arch/x68k/dev/mfp.c	Sat Jan  6 05:24:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mfp.c,v 1.30 2023/12/20 00:40:44 thorpej Exp $	*/
+/*	$NetBSD: mfp.c,v 1.31 2024/01/06 05:24:33 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1998 NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.30 2023/12/20 00:40:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfp.c,v 1.31 2024/01/06 05:24:33 isaki Exp $");
 
 #include 
 #include 
@@ -149,7 +149,6 @@ mfp_init(void)
 }
 
 extern int delay_divisor;
-void	_delay(u_int);
 
 static void
 mfp_calibrate_delay(void)



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

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:16:57 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: if_ne_intio.c

Log Message:
White space cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x68k/dev/if_ne_intio.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/x68k/dev/if_ne_intio.c
diff -u src/sys/arch/x68k/dev/if_ne_intio.c:1.19 src/sys/arch/x68k/dev/if_ne_intio.c:1.20
--- src/sys/arch/x68k/dev/if_ne_intio.c:1.19	Fri Jun 22 04:17:41 2018
+++ src/sys/arch/x68k/dev/if_ne_intio.c	Sat Jan  6 05:16:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_intio.c,v 1.19 2018/06/22 04:17:41 msaitoh Exp $	*/
+/*	$NetBSD: if_ne_intio.c,v 1.20 2024/01/06 05:16:57 isaki Exp $	*/
 
 /*
  * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ne_intio.c,v 1.19 2018/06/22 04:17:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_intio.c,v 1.20 2024/01/06 05:16:57 isaki Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -111,13 +111,13 @@ ne_intio_match(device_t parent, cfdata_t
 		return 0;
 
 	/* Map I/O space */
-	if (bus_space_map(iot, ia->ia_addr, NE2000_NPORTS*2,
+	if (bus_space_map(iot, ia->ia_addr, NE2000_NPORTS * 2,
 			BUS_SPACE_MAP_SHIFTED_EVEN, &ioh))
 		return 0;
 
 	asict = iot;
-	if (bus_space_subregion(iot, ioh, NE2000_ASIC_OFFSET*2,
-			NE2000_ASIC_NPORTS*2, &asich))
+	if (bus_space_subregion(iot, ioh, NE2000_ASIC_OFFSET * 2,
+			NE2000_ASIC_NPORTS * 2, &asich))
 		goto out;
 
 	/* Look for an NE2000 compatible card */
@@ -145,15 +145,15 @@ ne_intio_attach(device_t parent, device_
 	aprint_normal(": Nereid Ethernet\n");
 
 	/* Map I/O space */
-	if (bus_space_map(iot, ia->ia_addr, NE2000_NPORTS*2,
-			BUS_SPACE_MAP_SHIFTED_EVEN, &ioh)){
+	if (bus_space_map(iot, ia->ia_addr, NE2000_NPORTS * 2,
+			BUS_SPACE_MAP_SHIFTED_EVEN, &ioh)) {
 		aprint_error_dev(self, "can't map I/O space\n");
 		return;
 	}
 
 	asict = iot;
-	if (bus_space_subregion(iot, ioh, NE2000_ASIC_OFFSET*2,
-			NE2000_ASIC_NPORTS*2, &asich)) {
+	if (bus_space_subregion(iot, ioh, NE2000_ASIC_OFFSET * 2,
+			NE2000_ASIC_NPORTS * 2, &asich)) {
 		aprint_error_dev(self, "can't subregion I/O space\n");
 		return;
 	}



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

2024-01-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan  6 05:16:57 UTC 2024

Modified Files:
src/sys/arch/x68k/dev: if_ne_intio.c

Log Message:
White space cleanup.


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

2024-01-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan  6 00:26:26 UTC 2024

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
Add Mercusys NW150US V2 USB support

No changes needed, other than recognizing it as working.

>From Daeil Lee in PR/57819


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_urtwn.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/usb

2024-01-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan  6 00:26:26 UTC 2024

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
Add Mercusys NW150US V2 USB support

No changes needed, other than recognizing it as working.

>From Daeil Lee in PR/57819


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_urtwn.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/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.107 src/sys/dev/usb/if_urtwn.c:1.108
--- src/sys/dev/usb/if_urtwn.c:1.107	Tue Aug  1 07:04:16 2023
+++ src/sys/dev/usb/if_urtwn.c	Sat Jan  6 00:26:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.107 2023/08/01 07:04:16 mrg Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.107 2023/08/01 07:04:16 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -215,6 +215,7 @@ static const struct urtwn_dev {
 	/* URTWN_RTL8188E */
 	URTWN_RTL8188E_DEV(DLINK, DWA125D1),
 	URTWN_RTL8188E_DEV(ELECOM, WDC150SU2M),
+	URTWN_RTL8188E_DEV(MERCUSYS, MW150USV2),
 	URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV),
 	URTWN_RTL8188E_DEV(REALTEK, RTL8188EU),
 	URTWN_RTL8188E_DEV(ABOCOM, RTL8188EU),



CVS commit: src/sys/dev/usb

2024-01-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan  6 00:24:37 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen usbdevs


To generate a diff of this commit:
cvs rdiff -u -r1.803 -r1.804 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.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/usb

2024-01-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan  6 00:24:07 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add Mercusys and Mercusys MW150USV2

>From Daeil Lee in PR/57819


To generate a diff of this commit:
cvs rdiff -u -r1.811 -r1.812 src/sys/dev/usb/usbdevs

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/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.811 src/sys/dev/usb/usbdevs:1.812
--- src/sys/dev/usb/usbdevs:1.811	Sun Dec 24 02:42:51 2023
+++ src/sys/dev/usb/usbdevs	Sat Jan  6 00:24:07 2024
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.811 2023/12/24 02:42:51 gutteridge Exp $
+$NetBSD: usbdevs,v 1.812 2024/01/06 00:24:07 maya Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -586,6 +586,7 @@ vendor HIROSE		0x2631	Hirose Electric
 vendor ONEPLUS		0x2717	ONEPLUS
 vendor NHJ		0x2770	NHJ
 vendor PLANEX		0x2c02	Planex Communications
+vendor MERCUSYS		0x2c4e	Mercusys
 vendor VIDZMEDIA	0x3275	VidzMedia Pte Ltd
 vendor AEI		0x3334	AEI
 vendor HANK		0x3353	Hank Connection
@@ -2288,6 +2289,9 @@ product MELCO WLIUCGNM		0x01a2	WLI-UC-GN
 product MELCO WLIUCGNM2T	0x01ee	WLI-UC-GNM2T
 product MELCO WIU2300D		0x0241	WI-U2-300D
 
+/* Mercusys products */
+product	MERCUSYS MW150USV2	0x0102	MW150US V2
+
 /* Merlin products */
 product MERLIN V620		0x1110	Merlin V620
 



CVS commit: src/sys/dev/usb

2024-01-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Jan  6 00:24:07 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add Mercusys and Mercusys MW150USV2

>From Daeil Lee in PR/57819


To generate a diff of this commit:
cvs rdiff -u -r1.811 -r1.812 src/sys/dev/usb/usbdevs

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



CVS commit: src/usr.bin/make/unit-tests

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 23:36:45 UTC 2024

Modified Files:
src/usr.bin/make/unit-tests: var-op-shell.mk

Log Message:
tests/make: test long shell commands via Cmd_Exec


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/var-op-shell.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/var-op-shell.mk
diff -u src/usr.bin/make/unit-tests/var-op-shell.mk:1.7 src/usr.bin/make/unit-tests/var-op-shell.mk:1.8
--- src/usr.bin/make/unit-tests/var-op-shell.mk:1.7	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/var-op-shell.mk	Fri Jan  5 23:36:45 2024
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-shell.mk,v 1.7 2023/06/01 20:56:35 rillig Exp $
+# $NetBSD: var-op-shell.mk,v 1.8 2024/01/05 23:36:45 rillig Exp $
 #
 # Tests for the != variable assignment operator, which runs its right-hand
 # side through the shell.
@@ -91,4 +91,22 @@ OUTPUT!=	echo ''
 OUTPUT!=	echo ''
 .MAKEFLAGS: -d0
 
+
+# Since main.c 1.607 from 2024-01-05, long shell commands are not run directly
+# via '$shell -c $command', they are first written to a temporary file that is
+# then fed to the shell via '$shell $tmpfile'.
+OUTPUT_SHORT!=	echo "$$0"
+OUTPUT_LONG!=	echo "$$0" || : ${:U:range=1000}
+# When running '$shell -c $command', '$0' in the shell evaluates to the name
+# of the shell.
+.if ${OUTPUT_SHORT} != ${.SHELL:T}
+.  error
+.endif
+# When running '$shell $tmpfile', '$0' in the shell evaluates to the name of
+# the temporary file.
+.if !${OUTPUT_LONG:M*/make*}
+.  error
+.endif
+
+
 all:



CVS commit: src/usr.bin/make/unit-tests

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 23:36:45 UTC 2024

Modified Files:
src/usr.bin/make/unit-tests: var-op-shell.mk

Log Message:
tests/make: test long shell commands via Cmd_Exec


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/var-op-shell.mk

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



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 23:22:06 UTC 2024

Modified Files:
src/usr.bin/make: compat.c job.c main.c make.c parse.c str.c suff.c
var.c

Log Message:
make: miscellaneous cleanups


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/usr.bin/make/compat.c
cvs rdiff -u -r1.462 -r1.463 src/usr.bin/make/job.c
cvs rdiff -u -r1.607 -r1.608 src/usr.bin/make/main.c
cvs rdiff -u -r1.261 -r1.262 src/usr.bin/make/make.c
cvs rdiff -u -r1.714 -r1.715 src/usr.bin/make/parse.c
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/make/str.c
cvs rdiff -u -r1.376 -r1.377 src/usr.bin/make/suff.c
cvs rdiff -u -r1.1092 -r1.1093 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 23:22:06 UTC 2024

Modified Files:
src/usr.bin/make: compat.c job.c main.c make.c parse.c str.c suff.c
var.c

Log Message:
make: miscellaneous cleanups


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/usr.bin/make/compat.c
cvs rdiff -u -r1.462 -r1.463 src/usr.bin/make/job.c
cvs rdiff -u -r1.607 -r1.608 src/usr.bin/make/main.c
cvs rdiff -u -r1.261 -r1.262 src/usr.bin/make/make.c
cvs rdiff -u -r1.714 -r1.715 src/usr.bin/make/parse.c
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/make/str.c
cvs rdiff -u -r1.376 -r1.377 src/usr.bin/make/suff.c
cvs rdiff -u -r1.1092 -r1.1093 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.251 src/usr.bin/make/compat.c:1.252
--- src/usr.bin/make/compat.c:1.251	Tue Dec 26 20:09:42 2023
+++ src/usr.bin/make/compat.c	Fri Jan  5 23:22:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.251 2023/12/26 20:09:42 sjg Exp $	*/
+/*	$NetBSD: compat.c,v 1.252 2024/01/05 23:22:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.251 2023/12/26 20:09:42 sjg Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.252 2024/01/05 23:22:06 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -107,10 +107,8 @@ CompatDeleteTarget(GNode *gn)
 	if (gn != NULL && !GNode_IsPrecious(gn) &&
 	(gn->type & OP_PHONY) == 0) {
 		const char *file = GNode_VarTarget(gn);
-
-		if (!opts.noExecute && unlink_file(file) == 0) {
+		if (!opts.noExecute && unlink_file(file) == 0)
 			Error("*** %s removed", file);
-		}
 	}
 }
 
@@ -132,9 +130,8 @@ CompatInterrupt(int signo)
 		/* Run .INTERRUPT only if hit with interrupt signal. */
 		if (signo == SIGINT) {
 			GNode *gn = Targ_FindNode(".INTERRUPT");
-			if (gn != NULL) {
+			if (gn != NULL)
 Compat_Make(gn, gn);
-			}
 		}
 	}
 
@@ -360,9 +357,8 @@ Compat_RunCommand(const char *cmdp, GNod
 	while ((retstat = wait(&reason)) != cpid) {
 		if (retstat > 0)
 			JobReapChild(retstat, reason, false); /* not ours? */
-		if (retstat == -1 && errno != EINTR) {
+		if (retstat == -1 && errno != EINTR)
 			break;
-		}
 	}
 
 	if (retstat < 0)

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.462 src/usr.bin/make/job.c:1.463
--- src/usr.bin/make/job.c:1.462	Fri Dec 29 12:59:43 2023
+++ src/usr.bin/make/job.c	Fri Jan  5 23:22:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.462 2023/12/29 12:59:43 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.463 2024/01/05 23:22:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -141,7 +141,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.462 2023/12/29 12:59:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.463 2024/01/05 23:22:06 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -928,12 +928,10 @@ JobWriteCommand(Job *job, ShellWriter *w
 	escCmd = shell->hasErrCtl ? NULL : EscapeShellDblQuot(xcmd);
 
 	if (!cmdFlags.echo) {
-		if (job->echo && run && shell->hasEchoCtl) {
+		if (job->echo && run && shell->hasEchoCtl)
 			ShellWriter_EchoOff(wr);
-		} else {
-			if (shell->hasErrCtl)
-cmdFlags.echo = true;
-		}
+		else if (shell->hasErrCtl)
+			cmdFlags.echo = true;
 	}
 
 	if (cmdFlags.ignerr) {
@@ -2182,11 +2180,10 @@ Shell_GetNewline(void)
 void
 Job_SetPrefix(void)
 {
-	if (targPrefix != NULL) {
+	if (targPrefix != NULL)
 		free(targPrefix);
-	} else if (!Var_Exists(SCOPE_GLOBAL, ".MAKE.JOB.PREFIX")) {
+	else if (!Var_Exists(SCOPE_GLOBAL, ".MAKE.JOB.PREFIX"))
 		Global_Set(".MAKE.JOB.PREFIX", "---");
-	}
 
 	targPrefix = Var_Subst("${.MAKE.JOB.PREFIX}",
 	SCOPE_GLOBAL, VARE_WANTRES);
@@ -2484,18 +2481,9 @@ Job_ParseShell(char *line)
 		 * its word and copy it to a new location. In either case,
 		 * we need to record the path the user gave for the shell.
 		 */
+		char *name = path + (str_basename(path) - path);
 		shellPath = path;
-		path = strrchr(path, '/');
-		if (path == NULL) {
-			path = UNCONST(shellPath);
-		} else {
-			path++;
-		}
-		if (newShell.name != NULL) {
-			shellName = newShell.name;
-		} else {
-			shellName = path;
-		}
+		shellName = newShell.name != NULL ? newShell.name : name;
 		if (!fullSpec) {
 			if ((sh = FindShellByName(shellName)) == NULL) {
 Parse_Error(PARSE_WARNING,
@@ -2592,11 +2580,10 @@ Job_Finish(void)
 	GNode *endNode = Targ_GetEndNode();
 	if (!Lst_IsEmpty(&endNode->commands) ||
 	!Lst_IsEmpty(&endNode->children)) {
-		if (job_errors != 0) {
+		if (job_errors != 0)
 			Error("Errors reported so .END ignored");
-		} else {
+		else
 			JobRun(endNode);
-	

CVS commit: src/usr.bin/make

2024-01-05 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Jan  5 22:20:07 UTC 2024

Modified Files:
src/usr.bin/make: main.c

Log Message:
Cmd_Exec use tempfile if cmd is too big

To avoid blowing commandline/env limits, if "cmd"
is more than 1000 bytes, write it to a file and pass that
to shell.

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.606 -r1.607 src/usr.bin/make/main.c

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

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.606 src/usr.bin/make/main.c:1.607
--- src/usr.bin/make/main.c:1.606	Wed Dec 27 00:45:37 2023
+++ src/usr.bin/make/main.c	Fri Jan  5 22:20:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.606 2023/12/27 00:45:37 sjg Exp $	*/
+/*	$NetBSD: main.c,v 1.607 2024/01/05 22:20:07 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.606 2023/12/27 00:45:37 sjg Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.607 2024/01/05 22:20:07 sjg Exp $");
 #if defined(MAKE_NATIVE)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1705,14 +1705,38 @@ Cmd_Exec(const char *cmd, char **error)
 	char *output;
 	char *p;
 	int saved_errno;
+	char cmd_file[MAXPATHLEN];
+	size_t cmd_len;
+	int cmd_fd = -1;
 
 	if (shellPath == NULL)
 		Shell_Init();
 
+	cmd_len = strlen(cmd);
+	if (cmd_len > 1000) {
+		cmd_fd = mkTempFile(NULL, cmd_file, sizeof(cmd_file));
+		if (cmd_fd >= 0) {
+			ssize_t n;
+
+			n = write(cmd_fd, cmd, cmd_len);
+			close(cmd_fd);
+			if (n < (ssize_t)cmd_len) {
+unlink(cmd_file);
+cmd_fd = -1;
+			}
+		}
+	}
+
 	args[0] = shellName;
-	args[1] = "-c";
-	args[2] = cmd;
-	args[3] = NULL;
+	if (cmd_fd >= 0) {
+		args[1] = cmd_file;
+		args[2] = NULL;
+	} else {
+		cmd_file[0] = '\0';
+		args[1] = "-c";
+		args[2] = cmd;
+		args[3] = NULL;
+	}
 	DEBUG1(VAR, "Capturing the output of command \"%s\"\n", cmd);
 
 	if (pipe(pipefds) == -1) {
@@ -1775,6 +1799,8 @@ Cmd_Exec(const char *cmd, char **error)
 		"Couldn't read shell's output for \"", cmd, "\"");
 	else
 		*error = NULL;
+	if (cmd_file[0] != '\0')
+		unlink(cmd_file);
 	return output;
 }
 
@@ -2129,7 +2155,7 @@ getTmpdir(void)
 
 /*
  * Create and open a temp file using "pattern".
- * If out_fname is provided, set it to a copy of the filename created.
+ * If tfile is provided, set it to a copy of the filename created.
  * Otherwise unlink the file once open.
  */
 int



CVS commit: src/usr.bin/make

2024-01-05 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Jan  5 22:20:07 UTC 2024

Modified Files:
src/usr.bin/make: main.c

Log Message:
Cmd_Exec use tempfile if cmd is too big

To avoid blowing commandline/env limits, if "cmd"
is more than 1000 bytes, write it to a file and pass that
to shell.

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.606 -r1.607 src/usr.bin/make/main.c

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



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 21:56:55 UTC 2024

Modified Files:
src/usr.bin/make: str.h var.c

Log Message:
make: clean up string functions

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/str.h
cvs rdiff -u -r1.1091 -r1.1092 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/str.h
diff -u src/usr.bin/make/str.h:1.18 src/usr.bin/make/str.h:1.19
--- src/usr.bin/make/str.h:1.18	Fri Jan  5 21:51:27 2024
+++ src/usr.bin/make/str.h	Fri Jan  5 21:56:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.h,v 1.18 2024/01/05 21:51:27 rillig Exp $	*/
+/*	$NetBSD: str.h,v 1.19 2024/01/05 21:56:55 rillig Exp $	*/
 
 /*
  Copyright (c) 2021 Roland Illig 
@@ -76,27 +76,24 @@ typedef struct StrMatchResult {
 } StrMatchResult;
 
 
+/* Return a string that is the sole owner of str. */
 MAKE_INLINE FStr
-FStr_Init(const char *str, void *freeIt)
+FStr_InitOwn(char *str)
 {
 	FStr fstr;
 	fstr.str = str;
-	fstr.freeIt = freeIt;
+	fstr.freeIt = str;
 	return fstr;
 }
 
-/* Return a string that is the sole owner of str. */
-MAKE_INLINE FStr
-FStr_InitOwn(char *str)
-{
-	return FStr_Init(str, str);
-}
-
 /* Return a string that refers to the shared str. */
 MAKE_INLINE FStr
 FStr_InitRefer(const char *str)
 {
-	return FStr_Init(str, NULL);
+	FStr fstr;
+	fstr.str = str;
+	fstr.freeIt = NULL;
+	return fstr;
 }
 
 MAKE_INLINE void
@@ -190,7 +187,7 @@ Substring_SkipFirst(Substring sub, char 
 }
 
 MAKE_STATIC const char *
-Substring_LastIndex(Substring sub, char ch)
+Substring_FindLast(Substring sub, char ch)
 {
 	const char *p;
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1091 src/usr.bin/make/var.c:1.1092
--- src/usr.bin/make/var.c:1.1091	Fri Jan  5 21:51:27 2024
+++ src/usr.bin/make/var.c	Fri Jan  5 21:56:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1091 2024/01/05 21:51:27 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1092 2024/01/05 21:56:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1091 2024/01/05 21:51:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1092 2024/01/05 21:56:55 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -1328,7 +1328,7 @@ ModifyWord_Tail(Substring word, SepBuf *
 static void
 ModifyWord_Suffix(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED)
 {
-	const char *lastDot = Substring_LastIndex(word, '.');
+	const char *lastDot = Substring_FindLast(word, '.');
 	if (lastDot != NULL)
 		SepBuf_AddRange(buf, lastDot + 1, word.end);
 }
@@ -1339,7 +1339,7 @@ ModifyWord_Root(Substring word, SepBuf *
 {
 	const char *lastDot, *end;
 
-	lastDot = Substring_LastIndex(word, '.');
+	lastDot = Substring_FindLast(word, '.');
 	end = lastDot != NULL ? lastDot : word.end;
 	SepBuf_AddRange(buf, word.start, end);
 }



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 21:56:55 UTC 2024

Modified Files:
src/usr.bin/make: str.h var.c

Log Message:
make: clean up string functions

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/str.h
cvs rdiff -u -r1.1091 -r1.1092 src/usr.bin/make/var.c

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



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 21:51:27 UTC 2024

Modified Files:
src/usr.bin/make: str.h var.c

Log Message:
make: inline Substring_Sub

Remove redundant assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/str.h
cvs rdiff -u -r1.1090 -r1.1091 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/str.h
diff -u src/usr.bin/make/str.h:1.17 src/usr.bin/make/str.h:1.18
--- src/usr.bin/make/str.h:1.17	Fri Jun 23 04:56:54 2023
+++ src/usr.bin/make/str.h	Fri Jan  5 21:51:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.h,v 1.17 2023/06/23 04:56:54 rillig Exp $	*/
+/*	$NetBSD: str.h,v 1.18 2024/01/05 21:51:27 rillig Exp $	*/
 
 /*
  Copyright (c) 2021 Roland Illig 
@@ -154,14 +154,6 @@ Substring_Eq(Substring sub, Substring st
 	   memcmp(sub.start, str.start, len) == 0;
 }
 
-MAKE_STATIC Substring
-Substring_Sub(Substring sub, size_t start, size_t end)
-{
-	assert(start <= Substring_Length(sub));
-	assert(end <= Substring_Length(sub));
-	return Substring_Init(sub.start + start, sub.start + end);
-}
-
 MAKE_STATIC bool
 Substring_HasPrefix(Substring sub, Substring prefix)
 {

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1090 src/usr.bin/make/var.c:1.1091
--- src/usr.bin/make/var.c:1.1090	Fri Dec 29 14:57:00 2023
+++ src/usr.bin/make/var.c	Fri Jan  5 21:51:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1090 2023/12/29 14:57:00 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1091 2024/01/05 21:51:27 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1090 2023/12/29 14:57:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1091 2024/01/05 21:51:27 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4222,7 +4222,8 @@ FindLocalLegacyVar(Substring varname, GN
 	if (strchr("@%?*!<>", varname.start[0]) == NULL)
 		return NULL;
 
-	v = VarFindSubstring(Substring_Sub(varname, 0, 1), scope, false);
+	v = VarFindSubstring(Substring_Init(varname.start, varname.start + 1),
+	scope, false);
 	if (v == NULL)
 		return NULL;
 



CVS commit: src/usr.bin/make

2024-01-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jan  5 21:51:27 UTC 2024

Modified Files:
src/usr.bin/make: str.h var.c

Log Message:
make: inline Substring_Sub

Remove redundant assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/str.h
cvs rdiff -u -r1.1090 -r1.1091 src/usr.bin/make/var.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/vax/vax

2024-01-05 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Fri Jan  5 17:29:29 UTC 2024

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

Log Message:
Include leds.h to make /dev/leds work.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/machdep.c

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

Modified files:

Index: src/sys/arch/vax/vax/machdep.c
diff -u src/sys/arch/vax/vax/machdep.c:1.196 src/sys/arch/vax/vax/machdep.c:1.197
--- src/sys/arch/vax/vax/machdep.c:1.196	Thu Jun 11 19:20:46 2020
+++ src/sys/arch/vax/vax/machdep.c	Fri Jan  5 17:29:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.196 2020/06/11 19:20:46 ad Exp $	 */
+/* $NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $	 */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196 2020/06/11 19:20:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.197 2024/01/05 17:29:29 hans Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -130,6 +130,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #endif
 
+#include "leds.h"
 #include "smg.h"
 #include "ksyms.h"
 



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

2024-01-05 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Fri Jan  5 17:29:29 UTC 2024

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

Log Message:
Include leds.h to make /dev/leds work.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/vax/vax/machdep.c

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



CVS commit: src/lib/libc/gen

2024-01-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jan  5 09:41:58 UTC 2024

Modified Files:
src/lib/libc/gen: fixunstfdi_ieee754.c fixunstfsi_ieee754.c

Log Message:
fixunstf[sd]i_ieee754: Explicitly include stddef.h for size_t

Fix build for mips{,n}64. Note that stddef.h has been implicitly
included via eabi.h for aarch64, on the other hand.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/gen/fixunstfdi_ieee754.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/fixunstfsi_ieee754.c

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



CVS commit: src/lib/libc/gen

2024-01-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Jan  5 09:41:58 UTC 2024

Modified Files:
src/lib/libc/gen: fixunstfdi_ieee754.c fixunstfsi_ieee754.c

Log Message:
fixunstf[sd]i_ieee754: Explicitly include stddef.h for size_t

Fix build for mips{,n}64. Note that stddef.h has been implicitly
included via eabi.h for aarch64, on the other hand.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/gen/fixunstfdi_ieee754.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/fixunstfsi_ieee754.c

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

Modified files:

Index: src/lib/libc/gen/fixunstfdi_ieee754.c
diff -u src/lib/libc/gen/fixunstfdi_ieee754.c:1.1 src/lib/libc/gen/fixunstfdi_ieee754.c:1.2
--- src/lib/libc/gen/fixunstfdi_ieee754.c:1.1	Sat Jul  9 02:30:27 2011
+++ src/lib/libc/gen/fixunstfdi_ieee754.c	Fri Jan  5 09:41:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fixunstfdi_ieee754.c,v 1.1 2011/07/09 02:30:27 matt Exp $	*/
+/*	$NetBSD: fixunstfdi_ieee754.c,v 1.2 2024/01/05 09:41:58 rin Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,10 +31,11 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fixunstfdi_ieee754.c,v 1.1 2011/07/09 02:30:27 matt Exp $");
+__RCSID("$NetBSD: fixunstfdi_ieee754.c,v 1.2 2024/01/05 09:41:58 rin Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/lib/libc/gen/fixunstfsi_ieee754.c
diff -u src/lib/libc/gen/fixunstfsi_ieee754.c:1.2 src/lib/libc/gen/fixunstfsi_ieee754.c:1.3
--- src/lib/libc/gen/fixunstfsi_ieee754.c:1.2	Sun Aug  5 04:28:58 2012
+++ src/lib/libc/gen/fixunstfsi_ieee754.c	Fri Jan  5 09:41:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fixunstfsi_ieee754.c,v 1.2 2012/08/05 04:28:58 matt Exp $	*/
+/*	$NetBSD: fixunstfsi_ieee754.c,v 1.3 2024/01/05 09:41:58 rin Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,10 +31,11 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fixunstfsi_ieee754.c,v 1.2 2012/08/05 04:28:58 matt Exp $");
+__RCSID("$NetBSD: fixunstfsi_ieee754.c,v 1.3 2024/01/05 09:41:58 rin Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
+#include 
 #include 
 #include 
 #include