CVS commit: src/sys/ddb

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:57:49 UTC 2024

Modified Files:
src/sys/ddb: db_proc.c

Log Message:
Fix column alignment in ps/w output


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/ddb/db_proc.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/ddb/db_proc.c
diff -u src/sys/ddb/db_proc.c:1.14 src/sys/ddb/db_proc.c:1.15
--- src/sys/ddb/db_proc.c:1.14	Mon Jan 11 07:49:04 2021
+++ src/sys/ddb/db_proc.c	Mon Jan 22 07:57:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_proc.c,v 1.14 2021/01/11 07:49:04 simonb Exp $	*/
+/*	$NetBSD: db_proc.c,v 1.15 2024/01/22 07:57:48 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2020 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.14 2021/01/11 07:49:04 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_proc.c,v 1.15 2024/01/22 07:57:48 skrll Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -161,7 +161,7 @@ db_show_all_procs(db_expr_t addr, bool h
 		"PPID", "PGRP", "UID", "FLAGS", "LWPS", "COMMAND", "WAIT");
 		break;
 	case 'w':
-		db_printf("PID  %4s %16s %8s %4s %-12s%s\n",
+		db_printf("PID   %4s %16s %8s %4s %-16s %s\n",
 		"LID", "COMMAND", "EMUL", "PRI", "WAIT-MSG",
 		"WAIT-CHANNEL");
 		break;
@@ -262,7 +262,7 @@ db_show_all_procs(db_expr_t addr, bool h
 db_nbuf[MAXCOMLEN] = '\0';
 
 db_printf(
-"%c%4d %16s %8s %4d %-12s %-18lx\n",
+"%c%4d %16s %8s %4d %-16s %-18lx\n",
 (run ? '>' : ' '), l.l_lid,
 p.p_comm, db_nbuf,
 l.l_priority, wbuf, (long)l.l_wchan);



CVS commit: src/sys/ddb

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:57:49 UTC 2024

Modified Files:
src/sys/ddb: db_proc.c

Log Message:
Fix column alignment in ps/w output


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/ddb/db_proc.c

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:15:25 UTC 2024

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

Log Message:
Don't duplicate PIM_CPU_BITS in one printf.

PIM_CPU_HPMC_BITS already includes PIM_CPU_HPMC_BITS


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

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

Modified files:

Index: src/sys/arch/hppa/hppa/machdep.c
diff -u src/sys/arch/hppa/hppa/machdep.c:1.18 src/sys/arch/hppa/hppa/machdep.c:1.19
--- src/sys/arch/hppa/hppa/machdep.c:1.18	Thu Sep 29 06:39:59 2022
+++ src/sys/arch/hppa/hppa/machdep.c	Mon Jan 22 07:15:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.18 2022/09/29 06:39:59 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.19 2024/01/22 07:15:25 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2022/09/29 06:39:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2024/01/22 07:15:25 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -1563,7 +1563,7 @@ hppa_pim_dump(int check_type, void *data
 		PIM_WORD("\n\n\tCheck Type", checks->pim_check_type,
 			PIM_CHECK_BITS);
 		PIM_WORD("\n\tCPU State", checks->pim_check_cpu_state,
-			PIM_CPU_BITS PIM_CPU_HPMC_BITS);
+			PIM_CPU_HPMC_BITS);
 		PIM_WORD("\n\tCache Check", checks->pim_check_cache,
 			PIM_CACHE_BITS);
 		PIM_WORD("\n\tTLB Check", checks->pim_check_tlb,



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:15:25 UTC 2024

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

Log Message:
Don't duplicate PIM_CPU_BITS in one printf.

PIM_CPU_HPMC_BITS already includes PIM_CPU_HPMC_BITS


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

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:10:54 UTC 2024

Modified Files:
src/sys/arch/hppa/hppa: pim.h

Log Message:
Fix one by one bugs I committed back in 2009.  Spotted by rillig@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/pim.h

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan 22 07:10:54 UTC 2024

Modified Files:
src/sys/arch/hppa/hppa: pim.h

Log Message:
Fix one by one bugs I committed back in 2009.  Spotted by rillig@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/pim.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/hppa/hppa/pim.h
diff -u src/sys/arch/hppa/hppa/pim.h:1.2 src/sys/arch/hppa/hppa/pim.h:1.3
--- src/sys/arch/hppa/hppa/pim.h:1.2	Mon Apr 15 20:45:08 2019
+++ src/sys/arch/hppa/hppa/pim.h	Mon Jan 22 07:10:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pim.h,v 1.2 2019/04/15 20:45:08 skrll Exp $	*/
+/*	$NetBSD: pim.h,v 1.3 2024/01/22 07:10:54 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -138,10 +138,10 @@ struct hppa_pim_checks {
 #define	PIM_CHECK_ASSISTS	(1 << 28)
 #define	PIM_CHECK_BITS		\
 	"\177\020"		/* New bitmask format */	\
-	"b\040cache\0"		/* bit 31 */			\
-	"b\037tlb\0"		/* bit 30 */			\
-	"b\036bus\0"		/* bit 29 */			\
-	"b\035assists\0"	/* bit 28 */
+	"b\037cache\0"		/* bit 31 */			\
+	"b\036tlb\0"		/* bit 30 */			\
+	"b\035bus\0"		/* bit 29 */			\
+	"b\034assists\0"	/* bit 28 */
 
 	/*
 	 * The CPU State.  In addition to the common PIM_CPU_
@@ -157,13 +157,13 @@ struct hppa_pim_checks {
 #define	PIM_CPU_TRV	(1 << 25)
 #define	PIM_CPU_BITS		\
 	"\177\020"		/* New bitmask format */	\
-	"b\040iqv\0"		/* bit 31 */			\
-	"b\037iqf\0"		/* bit 30 */			\
-	"b\036ipv\0"		/* bit 29 */			\
-	"b\035grv\0"		/* bit 28 */			\
-	"b\034crv\0"		/* bit 27 */			\
-	"b\033srv\0"		/* bit 26 */			\
-	"b\032trv\0"		/* bit 25 */
+	"b\037iqv\0"		/* bit 31 */			\
+	"b\036iqf\0"		/* bit 30 */			\
+	"b\035ipv\0"		/* bit 29 */			\
+	"b\034grv\0"		/* bit 28 */			\
+	"b\033crv\0"		/* bit 27 */			\
+	"b\032srv\0"		/* bit 26 */			\
+	"b\031trv\0"		/* bit 25 */
 #define	PIM_CPU_HPMC_TL(cs)	(((cs) >> 4) & 0x3)
 #define	PIM_CPU_HPMC_HD		(1 << 3)
 #define	PIM_CPU_HPMC_SIS	(1 << 2)
@@ -189,14 +189,14 @@ struct hppa_pim_checks {
 #define	PIM_CACHE_PADD(cc)	((cc) & 0x000f)
 #define	PIM_CACHE_BITS		\
 	"\177\020"		/* New bitmask format */	\
-	"b\040icc\0"		/* bit 31 */			\
-	"b\039dcc\0"		/* bit 30 */			\
-	"b\038tc\0"		/* bit 29 */			\
-	"b\037dc\0"		/* bit 28 */			\
-	"b\036crg\0"		/* bit 27 */			\
-	"b\035lc\0"		/* bit 26 */			\
-	"b\034rcc\0"		/* bit 25 */			\
-	"f\000\032paddr\0"	/* bit 0 .. 23 */
+	"b\037icc\0"		/* bit 31 */			\
+	"b\036dcc\0"		/* bit 30 */			\
+	"b\035tc\0"		/* bit 29 */			\
+	"b\034dc\0"		/* bit 28 */			\
+	"b\033crg\0"		/* bit 27 */			\
+	"b\032lc\0"		/* bit 26 */			\
+	"b\031rcc\0"		/* bit 25 */			\
+	"f\000\030paddr\0"	/* bit 0 .. 23 */
 
 	/* The TLB Check word. */
 	uint32_t	pim_check_tlb;
@@ -207,11 +207,11 @@ struct hppa_pim_checks {
 #define	PIM_TLB_TNF	(1 << 27)
 #define	PIM_TLB_BITS		\
 	"\177\020"		/* New bitmask format */	\
-	"b\040itc\0"		/* bit 31 */			\
-	"b\039dtc\0"		/* bit 30 */			\
-	"b\038trg\0"		/* bit 29 */			\
-	"b\037tuc\0"		/* bit 28 */			\
-	"b\036tnf\0"		/* bit 27 */			\
+	"b\037itc\0"		/* bit 31 */			\
+	"b\036dtc\0"		/* bit 30 */			\
+	"b\035trg\0"		/* bit 29 */			\
+	"b\034tuc\0"		/* bit 28 */			\
+	"b\033tnf\0"		/* bit 27 */			\
 
 	/* The Bus Check word. */
 	uint32_t	pim_check_bus;
@@ -238,7 +238,7 @@ struct hppa_pim_checks {
 	uint32_t	pim_check_assist;
 #define	PIM_ASSIST_COC		(1 << 31)
 #define	PIM_ASSIST_SC		(1 << 30)
-#define	PIM_ASSIST_BITS		"\020\040COC\037SC"
+#define	PIM_ASSIST_BITS		"\020\037COC\036SC"
 
 	uint32_t	pim_check_reserved_1;
 



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

2024-01-21 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jan 22 06:28:49 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: sbcvar.h

Log Message:
Missing '\'

Many thnanks rillig@

XXX-pullup10.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mac68k/dev/sbcvar.h

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

Modified files:

Index: src/sys/arch/mac68k/dev/sbcvar.h
diff -u src/sys/arch/mac68k/dev/sbcvar.h:1.13 src/sys/arch/mac68k/dev/sbcvar.h:1.14
--- src/sys/arch/mac68k/dev/sbcvar.h:1.13	Sat Feb 18 13:28:05 2023
+++ src/sys/arch/mac68k/dev/sbcvar.h	Mon Jan 22 06:28:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbcvar.h,v 1.13 2023/02/18 13:28:05 nat Exp $	*/
+/*	$NetBSD: sbcvar.h,v 1.14 2024/01/22 06:28:49 nat Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -82,7 +82,7 @@ struct sbc_softc {
 #define	SBC_RESELECT		0x04	/* Allow disconnect/reselect */
 #define	SBC_PDMA_NO_WRITE	0x08	/* No PDMA for writes */
 #define	SBC_OPTIONS_MASK (SBC_PDMA_NO_WRITE|SBC_RESELECT|SBC_INTR|SBC_PDMA)
-#define	SBC_OPTIONS_BITS	"\10\4NOWRITE3RESELECT\2INTR\1PDMA"
+#define	SBC_OPTIONS_BITS	"\10\4NOWRITE\3RESELECT\2INTR\1PDMA"
 
 extern int	sbc_debug;
 extern int	sbc_link_flags;



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

2024-01-21 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jan 22 06:28:49 UTC 2024

Modified Files:
src/sys/arch/mac68k/dev: sbcvar.h

Log Message:
Missing '\'

Many thnanks rillig@

XXX-pullup10.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mac68k/dev/sbcvar.h

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



CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Jan 22 00:11:21 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): restore empty string in snprintb_m example

Restore the empty string at the end of snprintb_m output that was
accidentally removed along with empty string placeholders in the
format strings.  While here, move that example to be next to its
snprintb counterpart.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.28 src/lib/libutil/snprintb.3:1.29
--- src/lib/libutil/snprintb.3:1.28	Sun Jan 21 23:57:49 2024
+++ src/lib/libutil/snprintb.3	Mon Jan 22 00:11:21 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.28 2024/01/21 23:57:49 uwe Exp $
+.\" $NetBSD: snprintb.3,v 1.29 2024/01/22 00:11:21 uwe Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -304,6 +304,19 @@ snprintb(buf, buflen,
 \(rA "0x800f0701"
 .Ed
 .Pp
+The same example using snprintb_m:
+.Bd -literal -offset indent
+snprintb_m(buf, buflen,
+"\e177\e020"
+"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
+"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exfFIFTEEN\e0"
+"b\ex1fMSB\e0",
+0x800f0701, 34)
+\(rA "0x800f0701\e0"
+   "0x800f0701\e0"
+   ""
+.Ed
+.Pp
 A more complex example from
 .In sys/mman.h
 that uses the both bit position
@@ -360,19 +373,7 @@ snprintb(buf, buflen, MAP_FMT, 0x0d00123
 \(rA "0xd001234"
 
 snprintb(buf, buflen, MAP_FMT, 0x2e00)
-\(rA "0xd001234<0x2e00
-.Ed
-.Pp
-An example using snprintb_m:
-.Bd -literal -offset indent
-snprintb_m(buf, buflen,
-"\e177\e020"
-"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
-"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exfFIFTEEN\e0"
-"b\ex1fMSB\e0" "\e0",
-0x800f0701, 34)
-\(rA "0x800f0701\e0"
-   "0x800f0701\e0"
+\(rA "0xd001234<0x2e00"
 .Ed
 .Sh ERRORS
 .Fn snprintb



CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Jan 22 00:11:21 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): restore empty string in snprintb_m example

Restore the empty string at the end of snprintb_m output that was
accidentally removed along with empty string placeholders in the
format strings.  While here, move that example to be next to its
snprintb counterpart.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libutil/snprintb.3

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



CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 21 23:57:49 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): update mmap example

Bring over the prettier version of the mmap format string that we have
in the header file for some time now.  Clarify that the final NUL of
the new format string is supplied by the compiler, g/c explicit final
\0 from the example that had it.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libutil/snprintb.3

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



CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 21 23:57:49 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): update mmap example

Bring over the prettier version of the mmap format string that we have
in the header file for some time now.  Clarify that the final NUL of
the new format string is supplied by the compiler, g/c explicit final
\0 from the example that had it.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.27 src/lib/libutil/snprintb.3:1.28
--- src/lib/libutil/snprintb.3:1.27	Sun Jan 21 23:44:30 2024
+++ src/lib/libutil/snprintb.3	Sun Jan 21 23:57:49 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.27 2024/01/21 23:44:30 uwe Exp $
+.\" $NetBSD: snprintb.3,v 1.28 2024/01/21 23:57:49 uwe Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -260,6 +260,10 @@ The new format string is terminated by a
 .Tn NUL
 character at the end, following that delimiting the last
 bit-position\(endescription pair.
+This
+.Tn NUL
+is supplied by the compiler to terminate the string literal and
+doesn't need to be written explicitly.
 .Sh RETURN VALUES
 The
 .Fn snprintb
@@ -295,7 +299,7 @@ snprintb(buf, buflen,
 "b\e0LSB\e0" "b\e1BITONE\e0"
 "f\e4\e4NIBBLE2\e0"
 "f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exfFIFTEEN\e0"
-"b\ex1fMSB\e0" "\e0",
+"b\ex1fMSB\e0",
 0x800f0701)
 \(rA "0x800f0701"
 .Ed
@@ -303,53 +307,58 @@ snprintb(buf, buflen,
 A more complex example from
 .In sys/mman.h
 that uses the both bit position
-.Sq b
+.Sq Cm b
 formatting as well as the
-.Sq F
-multi-field formatting with a default case:
+.Sq Cm F
+multibit field formatting with a default case
+.Pq Sq Cm \&* :
 .Bd -literal -offset indent
-#define MAP_FMT	"\e177\e020\e
-b\e0SHARED\e0\e
-b\e1PRIVATE\e0\e
-b\e2COPY\e0\e
-b\e4FIXED\e0\e
-b\e5RENAME\e0\e
-b\e6NORESERVE\e0\e
-b\e7INHERIT\e0\e
-b\e11HASSEMAPHORE\e0\e
-b\e12TRYFIXED\e0\e
-b\e13WIRED\e0\e
-F\e14\e1\e0\e
-:\e0FILE\e0\e
-:\e1ANONYMOUS\e0\e
-b\e15STACK\e0\e
-F\e30\e010\e0\e
-:\e000ALIGN=NONE\e0\e
-:\e012ALIGN=1KB\e0\e
-:\e013ALIGN=2KB\e0\e
-:\e014ALIGN=4KB\e0\e
-:\e015ALIGN=8KB\e0\e
-:\e016ALIGN=16KB\e0\e
-:\e017ALIGN=32KB\e0\e
-:\e020ALIGN=64KB\e0\e
-:\e021ALIGN=128KB\e0\e
-:\e022ALIGN=256KB\e0\e
-:\e023ALIGN=512KB\e0\e
-:\e024ALIGN=1MB\e0\e
-:\e030ALIGN=16MB\e0\e
-:\e034ALIGN=256MB\e0\e
-:\e040ALIGN=4GB\e0\e
-:\e044ALIGN=64GB\e0\e
-:\e050ALIGN=1TB\e0\e
-:\e054ALIGN=16TB\e0\e
-:\e060ALIGN=256TB\e0\e
-:\e064ALIGN=4PB\e0\e
-:\e070ALIGN=64PB\e0\e
-:\e074ALIGN=256PB\e0\e
-*ALIGN=2^%jd\e0\e
-"
+#define MAP_FMT "\e177\e020"  \e
+"b\e0"  "SHARED\e0"   \e
+"b\e1"  "PRIVATE\e0"  \e
+"b\e2"  "COPY\e0" \e
+"b\e4"  "FIXED\e0"\e
+"b\e5"  "RENAME\e0"   \e
+"b\e6"  "NORESERVE\e0"\e
+"b\e7"  "INHERIT\e0"  \e
+"b\e11" "HASSEMAPHORE\e0" \e
+"b\e12" "TRYFIXED\e0" \e
+"b\e13" "WIRED\e0"\e
+"F\e14\e1\e0"  \e
+":\e0" "FILE\e0"  \e
+":\e1" "ANONYMOUS\e0" \e
+"b\e15" "STACK\e0"\e
+"F\e30\e010\e0"\e
+":\e000" "ALIGN=NONE\e0"  \e
+":\e012" "ALIGN=1KB\e0"   \e
+":\e013" "ALIGN=2KB\e0"   \e
+":\e014" "ALIGN=4KB\e0"   \e
+":\e015" "ALIGN=8KB\e0"   \e
+":\e016" "ALIGN=16KB\e0"  \e
+":\e017" "ALIGN=32KB\e0"  \e
+":\e020" "ALIGN=64KB\e0"  \e
+":\e021" "ALIGN=128KB\e0" \e
+":\e022" "ALIGN=256KB\e0" \e
+":\e023" "ALIGN=512KB\e0" \e
+":\e024" "ALIGN=1MB\e0"   \e
+":\e025" "ALIGN=2MB\e0"   \e
+":\e026" "ALIGN=4MB\e0"   \e
+":\e027" "ALIGN=8MB\e0"   \e
+":\e030" "ALIGN=16MB\e0"  \e
+":\e034" "ALIGN=256MB\e0" \e
+":\e040" "ALIGN=4GB\e0"   \e
+":\e044" "ALIGN=64GB\e0"  \e
+":\e050" "ALIGN=1TB\e0"   \e
+":\e054" "ALIGN=16TB\e0"  \e
+":\e060" "ALIGN=256TB\e0" \e
+":\e064" "ALIGN=4PB\e0"   \e
+":\e070" "ALIGN=64PB\e0"  \e
+

CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 21 23:44:30 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): try to improve narration

Try to make the narration more coherent.  Make the old and new
syntaxes easy to distinguish and go out of our way to highlight that
the old syntax uses 1-based bit positions.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.26 src/lib/libutil/snprintb.3:1.27
--- src/lib/libutil/snprintb.3:1.26	Sun Jan 21 22:06:46 2024
+++ src/lib/libutil/snprintb.3	Sun Jan 21 23:44:30 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.26 2024/01/21 22:06:46 rillig Exp $
+.\" $NetBSD: snprintb.3,v 1.27 2024/01/21 23:44:30 uwe Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,14 +57,46 @@ of size
 .Fa buflen ,
 using a specified radix and an interpretation of
 the bits within that integer as though they were flags.
-The buffer is always NUL-terminated.
+The buffer is always
+.Tn NUL Ns -terminated.
 If the buffer
 .Fa buf
 is too small to hold the formatted output,
 .Fn snprintb
 will fill as much as it can, and return the number of bytes
 that it would have written if the buffer were long enough excluding the
-terminating NUL.
+terminating
+.Tn NUL .
+.Pp
+The
+.Fn snprintb_m
+function accepts an additional
+.Fa max
+argument.
+If this argument is zero, the
+.Fn snprintb_m
+function returns exactly the same results in the
+.Fa buf
+as the
+.Fn snprintb
+function.
+If the
+.Fa max
+argument has a non-zero value, it represents the maximum length of a
+formatted string.
+If the formatted string would require more than
+.Fa max
+characters, the
+.Fn snprintb_m
+function returns multiple formatted strings in the output buffer
+.Fa buf .
+Each string is
+.Tn NUL Ns -terminated ,
+and the last string is followed by an
+additional
+.Tn NUL
+character
+.Pq or, if you prefer, a zero-length string .
 .Pp
 The decoding directive string
 .Fa fmt
@@ -80,7 +112,7 @@ formatting is that it is capable of hand
 The first character of
 .Fa fmt
 may be
-.Li \e177 ,
+.Ql \e177 ,
 indicating that the remainder of the format string follows the
 .Dq new
 syntax.
@@ -91,142 +123,143 @@ output numeral base in which the bitfiel
 Recognized radix values
 .Pq in C escape-character format
 are
-.Li \e10
+.Ql \e10
 .Pq octal ,
-.Li \e12
+.Ql \e12
 .Pq decimal ,
 and
-.Li \e20
+.Ql \e20
 .Pq hexadecimal .
 .Pp
 The remaining characters in
 .Fa fmt
 are interpreted as a list of bit-position\(endescription pairs.
 From here the syntaxes diverge.
+.
+.Ss Old Syntax
 .Pp
 The
 .Dq old
 format syntax is series of bit-position\(endescription pairs.
-Each begins with a binary character value that represents the position
-of the bit being described.
-A bit position value of one describes the least significant bit.
+.Pp
+Each description begins with a binary character value that represents
+the position of the bit being described.
+.Pp
+.Sy NB :
+the bit positions in the old syntax are
+.Em 1-based\^ !
+A bit position value of 1
+.Pq Ql \e1
+describes the least significant bit.
 Whereas a position value of 32
-.Pq octal 40, hexadecimal 20, the ASCII space character
+.Po octal
+.Ql \e040 ,
+hexadecimal
+.Ql \ex20 ,
+the ASCII space character
+.Pc
 describes the most significant bit.
+The old syntax is limited to 32-bit values.
+.Pp
+The remaining characters are the description to print should the bit
+being described be set.
 .Pp
-The remaining characters in a bit-position\(endescription pair are the
-characters to print should the bit being described be set.
 Description strings are delimited by the next bit position value character
 encountered
 .Pq distinguishable by its value being \*[Le] 32 ,
 or the end of the decoding directive string itself.
+.
+.Ss New Syntax
 .Pp
 For the
 .Dq new
-format syntax, a bit-position\(endescription begins with a field type
-followed by a binary bit-position and possibly a field length.
-The least significant bit is bit-position zero, unlike the
-.Dq old
-syntax where it is one.
-.Bl -tag -width "x"
-.It Cm b\eB
-Describes a bit position.
-The bit-position
-.Fa B
-indicates the corresponding bit, as in the
-.Dq old
-format.
-.It Cm f\eB\eL
+format syntax, a field description begins with a field type followed
+by a binary field position and possibly a field length.
+The bit positions are 0-based,
+the least significant bit is bit-position zero.
+Each description is terminated by a
+.Tn NUL
+byte.
+.
+.Bl -tag -width Cm
+.
+.It Cm b\e Ns Ar B
+Describes a single bit at bit-position
+.Ar B .
+The remaining characters are the description to print should the bit
+being described be set.
+This field description is similar in function to the old format.

CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Jan 21 23:44:30 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb(3): try to improve narration

Try to make the narration more coherent.  Make the old and new
syntaxes easy to distinguish and go out of our way to highlight that
the old syntax uses 1-based bit positions.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libutil/snprintb.3

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



CVS commit: src/lib/libutil

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 22:06:46 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: remove empty string literals from examples

Suggested by uwe@, as gaps in bitmasks are quite common and thus
shouldn't clutter the code.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.25 src/lib/libutil/snprintb.3:1.26
--- src/lib/libutil/snprintb.3:1.25	Sun Jan 21 21:31:23 2024
+++ src/lib/libutil/snprintb.3	Sun Jan 21 22:06:46 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.25 2024/01/21 21:31:23 rillig Exp $
+.\" $NetBSD: snprintb.3,v 1.26 2024/01/21 22:06:46 rillig Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -247,9 +247,9 @@ snprintb(buf, buflen, "\e10\e2BITTWO\e1B
 
 snprintb(buf, buflen,
 "\e20"
-"\ex10NOTBOOT" "\ex0fFPP" "\ex0eSDVMA" ""
+"\ex10NOTBOOT" "\ex0fFPP" "\ex0eSDVMA"
 "\ex0cVIDEO" "\ex0bLORES" "\ex0aFPA" "\ex09DIAG"
-"" "\ex07CACHE" "\ex06IOCACHE" "\ex05LOOPBACK"
+"\ex07CACHE" "\ex06IOCACHE" "\ex05LOOPBACK"
 "\ex04DBGCACHE",
 0xe860)
 \(rA "0xe860"
@@ -331,7 +331,6 @@ snprintb_m(buf, buflen,
 0x800f0701, 34)
 \(rA "0x800f0701\e0"
"0x800f0701\e0"
-   ""
 .Ed
 .Sh ERRORS
 .Fn snprintb



CVS commit: src/lib/libutil

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 22:06:46 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: remove empty string literals from examples

Suggested by uwe@, as gaps in bitmasks are quite common and thus
shouldn't clutter the code.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libutil/snprintb.3

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



Re: CVS commit: src/lib/libutil

2024-01-21 Thread Valery Ushakov
On Sun, Jan 21, 2024 at 21:31:23 +, Roland Illig wrote:

> and also didn't make it clear that a few bits were omitted from
> having descriptions.

I dislike this part.  It's internally inconsistent as it doesn't add
the placeholders for the low bits; and in many real-life scenarios
there will be *lots* of gaps in the defined bits, so implying in the
man page that the placeholders are good style just places the people
in a situation where they have to make the sensible thing, but go
against the style suggested in the man page.  I don't think that's
helpful.

Please, can we remove the placeholders from this example?

-uwe


CVS commit: src/lib/libutil

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 21:31:23 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: fix examples

The first example broke the format string at boundaries that didn't
highlight the structure of the format string and also didn't make it
clear that a few bits were omitted from having descriptions.

The second example contained an off-by-one error for SIXTEEN, which was
actually FIFTEEN.

The snprintb_m example repeated the above off-by-one error, and its
output was shown wrong, due to concatenated escape sequences.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.24 src/lib/libutil/snprintb.3:1.25
--- src/lib/libutil/snprintb.3:1.24	Thu Jul 30 21:23:36 2020
+++ src/lib/libutil/snprintb.3	Sun Jan 21 21:31:23 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.24 2020/07/30 21:23:36 uwe Exp $
+.\" $NetBSD: snprintb.3,v 1.25 2024/01/21 21:31:23 rillig Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 6, 2019
+.Dd January 21, 2024
 .Dt SNPRINTB 3
 .Os
 .Sh NAME
@@ -246,21 +246,25 @@ snprintb(buf, buflen, "\e10\e2BITTWO\e1B
 \(rA "03"
 
 snprintb(buf, buflen,
-   "\e20\ex10NOTBOOT\ex0f" "FPP\ex0eSDVMA\ex0cVIDEO"
-   "\ex0bLORES\ex0a" "FPA\ex09" "DIAG\ex07" "CACHE"
-   "\ex06IOCACHE\ex05LOOPBACK\ex04" "DBGCACHE",
-   0xe860)
+"\e20"
+"\ex10NOTBOOT" "\ex0fFPP" "\ex0eSDVMA" ""
+"\ex0cVIDEO" "\ex0bLORES" "\ex0aFPA" "\ex09DIAG"
+"" "\ex07CACHE" "\ex06IOCACHE" "\ex05LOOPBACK"
+"\ex04DBGCACHE",
+0xe860)
 \(rA "0xe860"
 .Ed
 .Pp
 An example of the new formatting style:
 .Bd -literal -offset indent
 snprintb(buf, buflen,
-   "\e177\e020b\e0LSB\e0b\e1_BITONE\e0f\e4\e4NIBBLE2\e0"
-   "f\ex10\e4BURST\e0=\e4FOUR\e0=\exfSIXTEEN\e0"
-   "b\ex1fMSB\e0\e0",
-   0x800f0701)
-\(rA "0x800f0701"
+"\e177\e020"
+"b\e0LSB\e0" "b\e1BITONE\e0"
+"f\e4\e4NIBBLE2\e0"
+"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exfFIFTEEN\e0"
+"b\ex1fMSB\e0" "\e0",
+0x800f0701)
+\(rA "0x800f0701"
 .Ed
 .Pp
 A more complex example from
@@ -320,11 +324,14 @@ snprintb(buf, buflen, MAP_FMT, 0x2e0
 An example using snprintb_m:
 .Bd -literal -offset indent
 snprintb_m(buf, buflen,
-   "\e177\e020b\e0LSB\e0b\e1_BITONE\e0f\e4\e4NIBBLE2\e0"
-   "f\ex10\e4BURST\e0=\e4FOUR\e0=\exfSIXTEEN\e0"
-   "b\ex1fMSB\e0\e0",
-   0x800f0701, 34)
-\(rA "0x800f0701\e00x800f0701\e0"
+"\e177\e020"
+"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
+"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exfFIFTEEN\e0"
+"b\ex1fMSB\e0" "\e0",
+0x800f0701, 34)
+\(rA "0x800f0701\e0"
+   "0x800f0701\e0"
+   ""
 .Ed
 .Sh ERRORS
 .Fn snprintb



CVS commit: src/lib/libutil

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 21:31:23 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: fix examples

The first example broke the format string at boundaries that didn't
highlight the structure of the format string and also didn't make it
clear that a few bits were omitted from having descriptions.

The second example contained an off-by-one error for SIXTEEN, which was
actually FIFTEEN.

The snprintb_m example repeated the above off-by-one error, and its
output was shown wrong, due to concatenated escape sequences.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libutil/snprintb.3

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



Re: CVS commit: src/bin/date

2024-01-21 Thread Robert Elz
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...

kre


Re: CVS commit: src/bin/date

2024-01-21 Thread Roland Illig
Am 21.01.2024 um 19:16 schrieb Christos Zoulas:
> In article ,
> Valery Ushakov   wrote:
>> On Sun, Jan 21, 2024 at 11:55:56 -0500, Christos Zoulas wrote:
>>
>>> Consider providing parsedate(3) in libcompat, but then we'd need
>>> yacc...
>>
>> We already have yacc in tools - src/tools/yacc
>
> 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?

From my understanding, tools/yacc runs in the host environment and
target the same host environment, as its output is used by tools/lint1,
which runs in the host environment but targets the target environment.

Or might the output from tools/yacc even be platform-independent?

Roland



CVS commit: src/lib/libm

2024-01-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 21 18:53:19 UTC 2024

Modified Files:
src/lib/libm: Makefile
src/lib/libm/ld80: e_rem_pio2l.h
src/lib/libm/src: math_private.h namespace.h
Added Files:
src/lib/libm/ld128: b_expl.c b_logl.c b_tgammal.c e_lgammal_r.c
e_powl.c invtrig.c invtrig.h k_cosl.c k_cospil.h k_expl.h k_sinl.c
k_sinpil.h k_tanl.c s_cexpl.c s_cospil.c s_erfl.c s_exp2l.c
s_expl.c s_logl.c s_nanl.c s_sinpil.c s_tanpil.c
src/lib/libm/ld80: b_expl.c b_logl.c b_tgammal.c e_lgammal_r.c e_powl.c
invtrig.c invtrig.h k_cosl.c k_cospil.h k_expl.h k_sinl.c
k_sinpil.h k_tanl.c s_cexpl.c s_cospil.c s_erfl.c s_exp2l.c
s_expl.c s_logl.c s_nanl.c s_sinpil.c s_tanpil.c
src/lib/libm/src: b_tgammal.c e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c
e_atanhl.c e_coshl.c e_hypotl.c e_lgammal.c e_lgammal_r.c e_powl.c
e_remainderl.c e_sinhl.c invtrig.c k_cosdf.c k_cospi.h k_sindf.c
k_sinpi.h k_tandf.c s_asinhl.c s_atanl.c s_cargl.c s_clogl.c
s_cosl.c s_cospi.c s_cospif.c s_cospil.c s_erfl.c s_exp2l.c
s_expl.c s_logl.c s_remquol.c s_sinl.c s_sinpi.c s_sinpif.c
s_sinpil.c s_tanhl.c s_tanl.c s_tanpi.c s_tanpif.c s_tanpil.c

Log Message:
Bring in more long double functions from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/lib/libm/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libm/ld128/b_expl.c \
src/lib/libm/ld128/b_logl.c src/lib/libm/ld128/b_tgammal.c \
src/lib/libm/ld128/e_lgammal_r.c src/lib/libm/ld128/e_powl.c \
src/lib/libm/ld128/invtrig.c src/lib/libm/ld128/invtrig.h \
src/lib/libm/ld128/k_cosl.c src/lib/libm/ld128/k_cospil.h \
src/lib/libm/ld128/k_expl.h src/lib/libm/ld128/k_sinl.c \
src/lib/libm/ld128/k_sinpil.h src/lib/libm/ld128/k_tanl.c \
src/lib/libm/ld128/s_cexpl.c src/lib/libm/ld128/s_cospil.c \
src/lib/libm/ld128/s_erfl.c src/lib/libm/ld128/s_exp2l.c \
src/lib/libm/ld128/s_expl.c src/lib/libm/ld128/s_logl.c \
src/lib/libm/ld128/s_nanl.c src/lib/libm/ld128/s_sinpil.c \
src/lib/libm/ld128/s_tanpil.c
cvs rdiff -u -r0 -r1.1 src/lib/libm/ld80/b_expl.c src/lib/libm/ld80/b_logl.c \
src/lib/libm/ld80/b_tgammal.c src/lib/libm/ld80/e_lgammal_r.c \
src/lib/libm/ld80/e_powl.c src/lib/libm/ld80/invtrig.c \
src/lib/libm/ld80/invtrig.h src/lib/libm/ld80/k_cosl.c \
src/lib/libm/ld80/k_cospil.h src/lib/libm/ld80/k_expl.h \
src/lib/libm/ld80/k_sinl.c src/lib/libm/ld80/k_sinpil.h \
src/lib/libm/ld80/k_tanl.c src/lib/libm/ld80/s_cexpl.c \
src/lib/libm/ld80/s_cospil.c src/lib/libm/ld80/s_erfl.c \
src/lib/libm/ld80/s_exp2l.c src/lib/libm/ld80/s_expl.c \
src/lib/libm/ld80/s_logl.c src/lib/libm/ld80/s_nanl.c \
src/lib/libm/ld80/s_sinpil.c src/lib/libm/ld80/s_tanpil.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/ld80/e_rem_pio2l.h
cvs rdiff -u -r0 -r1.1 src/lib/libm/src/b_tgammal.c \
src/lib/libm/src/e_acoshl.c src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c src/lib/libm/src/e_atan2l.c \
src/lib/libm/src/e_atanhl.c src/lib/libm/src/e_coshl.c \
src/lib/libm/src/e_hypotl.c src/lib/libm/src/e_lgammal.c \
src/lib/libm/src/e_lgammal_r.c src/lib/libm/src/e_powl.c \
src/lib/libm/src/e_remainderl.c src/lib/libm/src/e_sinhl.c \
src/lib/libm/src/invtrig.c src/lib/libm/src/k_cosdf.c \
src/lib/libm/src/k_cospi.h src/lib/libm/src/k_sindf.c \
src/lib/libm/src/k_sinpi.h src/lib/libm/src/k_tandf.c \
src/lib/libm/src/s_asinhl.c src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_cargl.c src/lib/libm/src/s_clogl.c \
src/lib/libm/src/s_cosl.c src/lib/libm/src/s_cospi.c \
src/lib/libm/src/s_cospif.c src/lib/libm/src/s_cospil.c \
src/lib/libm/src/s_erfl.c src/lib/libm/src/s_exp2l.c \
src/lib/libm/src/s_expl.c src/lib/libm/src/s_logl.c \
src/lib/libm/src/s_remquol.c src/lib/libm/src/s_sinl.c \
src/lib/libm/src/s_sinpi.c src/lib/libm/src/s_sinpif.c \
src/lib/libm/src/s_sinpil.c src/lib/libm/src/s_tanhl.c \
src/lib/libm/src/s_tanl.c src/lib/libm/src/s_tanpi.c \
src/lib/libm/src/s_tanpif.c src/lib/libm/src/s_tanpil.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.17 -r1.18 src/lib/libm/src/namespace.h

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



Re: CVS commit: src/bin/date

2024-01-21 Thread Christos Zoulas
In article ,
Valery Ushakov   wrote:
>On Sun, Jan 21, 2024 at 11:55:56 -0500, Christos Zoulas wrote:
>
>> Consider providing parsedate(3) in libcompat, but then we'd need
>> yacc...
>
>We already have yacc in tools - src/tools/yacc

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?

christos



Re: CVS commit: src/bin/date

2024-01-21 Thread Valery Ushakov
On Sun, Jan 21, 2024 at 11:55:56 -0500, Christos Zoulas wrote:

> Consider providing parsedate(3) in libcompat, but then we'd need
> yacc...

We already have yacc in tools - src/tools/yacc

-uwe


CVS commit: src/bin/date

2024-01-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 21 16:55:56 UTC 2024

Modified Files:
src/bin/date: date.c

Log Message:
Handle -d %Y%m%d in the tools version. This is used in the release notes
Makefile.inc when BUILDID is specified. Consider providing parsedate(3)
in libcompat, but then we'd need yacc...


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/bin/date/date.c

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

Modified files:

Index: src/bin/date/date.c
diff -u src/bin/date/date.c:1.65 src/bin/date/date.c:1.66
--- src/bin/date/date.c:1.65	Wed May 31 13:56:54 2023
+++ src/bin/date/date.c	Sun Jan 21 11:55:56 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: date.c,v 1.65 2023/05/31 17:56:54 kim Exp $ */
+/* $NetBSD: date.c,v 1.66 2024/01/21 16:55:56 christos Exp $ */
 
 /*
  * Copyright (c) 1985, 1987, 1988, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)date.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: date.c,v 1.65 2023/05/31 17:56:54 kim Exp $");
+__RCSID("$NetBSD: date.c,v 1.66 2024/01/21 16:55:56 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -98,8 +98,8 @@ main(int argc, char *argv[])
 			nflag = 1;
 			break;
 		case 'd':
-#ifndef HAVE_NBTOOL_CONFIG_H
 			rflag = 1;
+#ifndef HAVE_NBTOOL_CONFIG_H
 			tval = parsedate(optarg, NULL, NULL);
 			if (tval == -1) {
 errx(EXIT_FAILURE,
@@ -107,6 +107,19 @@ main(int argc, char *argv[])
 			}
 			break;
 #else
+			/* handle MMDD, or fail */
+			{
+struct tm tm;
+char *p;
+memset(, 0, sizeof(tm));
+p = strptime(optarg, "%Y%m%d", );
+if (*p == '\0'
+&& tm.tm_year >= 0 && tm.tm_year < 1000
+&& tm.tm_mon >= 0 && tm.tm_mon <= 11
+&& tm.tm_mday >= 1 && tm.tm_mday <= 31
+&& (tval = mktime()) != -1)
+	break;
+			}
 			errx(EXIT_FAILURE,
 			"-d not supported in the tool version");
 #endif



CVS commit: src/bin/date

2024-01-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 21 16:55:56 UTC 2024

Modified Files:
src/bin/date: date.c

Log Message:
Handle -d %Y%m%d in the tools version. This is used in the release notes
Makefile.inc when BUILDID is specified. Consider providing parsedate(3)
in libcompat, but then we'd need yacc...


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/bin/date/date.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-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 16:32:41 UTC 2024

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

Log Message:
make: refactor CondParser_Term to be inlinable

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/usr.bin/make/cond.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/cond.c
diff -u src/usr.bin/make/cond.c:1.360 src/usr.bin/make/cond.c:1.361
--- src/usr.bin/make/cond.c:1.360	Sun Jan 21 15:22:55 2024
+++ src/usr.bin/make/cond.c	Sun Jan 21 16:32:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.360 2024/01/21 15:22:55 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.361 2024/01/21 16:32:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.360 2024/01/21 15:22:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.361 2024/01/21 16:32:41 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -867,12 +867,13 @@ CondParser_Term(CondParser *par, bool do
 {
 	CondResult res;
 	Token t;
+	bool neg = false;
 
-	t = CondParser_Token(par, doEval);
-	if (t == TOK_TRUE)
-		return CR_TRUE;
-	if (t == TOK_FALSE)
-		return CR_FALSE;
+	while ((t = CondParser_Token(par, doEval)) == TOK_NOT)
+		neg = !neg;
+
+	if (t == TOK_TRUE || t == TOK_FALSE)
+		return neg == (t == TOK_FALSE) ? CR_TRUE : CR_FALSE;
 
 	if (t == TOK_LPAREN) {
 		res = CondParser_Or(par, doEval);
@@ -880,16 +881,7 @@ CondParser_Term(CondParser *par, bool do
 			return CR_ERROR;
 		if (CondParser_Token(par, doEval) != TOK_RPAREN)
 			return CR_ERROR;
-		return res;
-	}
-
-	if (t == TOK_NOT) {
-		res = CondParser_Term(par, doEval);
-		if (res == CR_TRUE)
-			res = CR_FALSE;
-		else if (res == CR_FALSE)
-			res = CR_TRUE;
-		return res;
+		return neg == (res == CR_FALSE) ? CR_TRUE : CR_FALSE;
 	}
 
 	return CR_ERROR;



CVS commit: src/usr.bin/make

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 16:32:41 UTC 2024

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

Log Message:
make: refactor CondParser_Term to be inlinable

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/usr.bin/make/cond.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-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 15:22:55 UTC 2024

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

Log Message:
make: clean up parsing of conditions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/cond.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-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 15:22:55 UTC 2024

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

Log Message:
make: clean up parsing of conditions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/cond.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/cond.c
diff -u src/usr.bin/make/cond.c:1.359 src/usr.bin/make/cond.c:1.360
--- src/usr.bin/make/cond.c:1.359	Fri Dec 29 12:59:43 2023
+++ src/usr.bin/make/cond.c	Sun Jan 21 15:22:55 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.359 2023/12/29 12:59:43 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.360 2024/01/21 15:22:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.359 2023/12/29 12:59:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.360 2024/01/21 15:22:55 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -937,20 +937,6 @@ CondParser_Or(CondParser *par, bool doEv
 	return res;
 }
 
-static CondResult
-CondParser_Eval(CondParser *par)
-{
-	CondResult res;
-
-	DEBUG1(COND, "CondParser_Eval: %s\n", par->p);
-
-	res = CondParser_Or(par, true);
-	if (res != CR_ERROR && CondParser_Token(par, false) != TOK_EOF)
-		return CR_ERROR;
-
-	return res;
-}
-
 /*
  * Evaluate the condition, including any side effects from the
  * expressions in the condition. The condition consists of &&, ||, !,
@@ -974,7 +960,10 @@ CondEvalExpression(const char *cond, boo
 	par.curr = TOK_NONE;
 	par.printedError = false;
 
-	rval = CondParser_Eval();
+	DEBUG1(COND, "CondParser_Eval: %s\n", par.p);
+	rval = CondParser_Or(, true);
+	if (par.curr != TOK_EOF)
+		rval = CR_ERROR;
 
 	if (rval == CR_ERROR && eprint && !par.printedError)
 		Parse_Error(PARSE_FATAL, "Malformed conditional (%s)", cond);



CVS commit: src/sys/dev/fdt

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 15:10:08 UTC 2024

Modified Files:
src/sys/dev/fdt: fdt_boot.c

Log Message:
Include  for struct mbr_sector


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdt_boot.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/fdt/fdt_boot.c
diff -u src/sys/dev/fdt/fdt_boot.c:1.5 src/sys/dev/fdt/fdt_boot.c:1.6
--- src/sys/dev/fdt/fdt_boot.c:1.5	Fri Jan 19 09:09:04 2024
+++ src/sys/dev/fdt/fdt_boot.c	Sun Jan 21 15:10:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdt_boot.c,v 1.5 2024/01/19 09:09:04 skrll Exp $	*/
+/*	$NetBSD: fdt_boot.c,v 1.6 2024/01/21 15:10:07 kre Exp $	*/
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -56,13 +56,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_boot.c,v 1.5 2024/01/19 09:09:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_boot.c,v 1.6 2024/01/21 15:10:07 kre Exp $");
 
 #include "opt_efi.h"
 #include "opt_md.h"
 
 #include 
 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/dev/fdt

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 15:10:08 UTC 2024

Modified Files:
src/sys/dev/fdt: fdt_boot.c

Log Message:
Include  for struct mbr_sector


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdt_boot.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-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 15:02:17 UTC 2024

Modified Files:
src/usr.bin/make: for.c var.c

Log Message:
make: clean up redundant 'const' from automatic variables

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/usr.bin/make/for.c
cvs rdiff -u -r1.1094 -r1.1095 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/for.c
diff -u src/usr.bin/make/for.c:1.177 src/usr.bin/make/for.c:1.178
--- src/usr.bin/make/for.c:1.177	Sun Nov 19 22:50:11 2023
+++ src/usr.bin/make/for.c	Sun Jan 21 15:02:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.177 2023/11/19 22:50:11 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.178 2024/01/21 15:02:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -58,7 +58,7 @@
 #include "make.h"
 
 /*	"@(#)for.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: for.c,v 1.177 2023/11/19 22:50:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.178 2024/01/21 15:02:17 rillig Exp $");
 
 
 typedef struct ForLoop {
@@ -434,7 +434,7 @@ static void
 ForLoop_SubstVarShort(ForLoop *f, unsigned int firstItem, Buffer *body,
 		  const char *p, const char **inout_mark)
 {
-	const char ch = *p;
+	char ch = *p;
 	const char **vars;
 	size_t i;
 

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1094 src/usr.bin/make/var.c:1.1095
--- src/usr.bin/make/var.c:1.1094	Sun Jan  7 11:39:04 2024
+++ src/usr.bin/make/var.c	Sun Jan 21 15:02:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1094 2024/01/07 11:39:04 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1095 2024/01/21 15:02:17 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.1094 2024/01/07 11:39:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1095 2024/01/21 15:02:17 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4279,7 +4279,7 @@ ParseVarnameLong(
 	bool dynamic = false;
 
 	const char *p = *pp;
-	const char *const start = p;
+	const char *start = p;
 	char endc = startc == '(' ? ')' : '}';
 
 	p += 2;			/* skip "${" or "$(" or "y(" */



CVS commit: src/usr.bin/make

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 15:02:17 UTC 2024

Modified Files:
src/usr.bin/make: for.c var.c

Log Message:
make: clean up redundant 'const' from automatic variables

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/usr.bin/make/for.c
cvs rdiff -u -r1.1094 -r1.1095 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/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:59:18 UTC 2024

Modified Files:
src/usr.bin/xlint: Makefile.inc

Log Message:
lint: on lint itself, disable query for const variables again

It suffixes to perform this check on demand.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/Makefile.inc

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



CVS commit: src/usr.bin/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:59:18 UTC 2024

Modified Files:
src/usr.bin/xlint: Makefile.inc

Log Message:
lint: on lint itself, disable query for const variables again

It suffixes to perform this check on demand.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/Makefile.inc

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/xlint/Makefile.inc
diff -u src/usr.bin/xlint/Makefile.inc:1.26 src/usr.bin/xlint/Makefile.inc:1.27
--- src/usr.bin/xlint/Makefile.inc:1.26	Sun Jan 21 14:21:34 2024
+++ src/usr.bin/xlint/Makefile.inc	Sun Jan 21 14:59:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.26 2024/01/21 14:21:34 rillig Exp $
+#	$NetBSD: Makefile.inc,v 1.27 2024/01/21 14:59:18 rillig Exp $
 
 .include 
 
@@ -31,4 +31,3 @@ LINTFLAGS+=	-aa	# warn about all lossy c
 LINTFLAGS+=	-e	# strict enum mode
 LINTFLAGS+=	-T	# strict bool mode
 LINTFLAGS+=	-w	# treat warnings as errors
-LINTFLAGS+=	-q18	# list const parameters and local variables



CVS commit: src/usr.bin/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:21:34 UTC 2024

Modified Files:
src/usr.bin/xlint: Makefile.inc
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: clean up redundant const from parameters and local variables

These were leftovers from splitting large functions into smaller
functions, to ensure that variables were not unintentionally reassigned.
Those refactorings are finished, and the extra help from the compiler is
no longer necessary.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/xlint/Makefile.inc
cvs rdiff -u -r1.387 -r1.388 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.595 -r1.596 src/usr.bin/xlint/lint1/tree.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/xlint/Makefile.inc
diff -u src/usr.bin/xlint/Makefile.inc:1.25 src/usr.bin/xlint/Makefile.inc:1.26
--- src/usr.bin/xlint/Makefile.inc:1.25	Thu Jan 11 04:45:20 2024
+++ src/usr.bin/xlint/Makefile.inc	Sun Jan 21 14:21:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.25 2024/01/11 04:45:20 rillig Exp $
+#	$NetBSD: Makefile.inc,v 1.26 2024/01/21 14:21:34 rillig Exp $
 
 .include 
 
@@ -31,3 +31,4 @@ LINTFLAGS+=	-aa	# warn about all lossy c
 LINTFLAGS+=	-e	# strict enum mode
 LINTFLAGS+=	-T	# strict bool mode
 LINTFLAGS+=	-w	# treat warnings as errors
+LINTFLAGS+=	-q18	# list const parameters and local variables

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.387 src/usr.bin/xlint/lint1/decl.c:1.388
--- src/usr.bin/xlint/lint1/decl.c:1.387	Sat Jan 20 10:02:31 2024
+++ src/usr.bin/xlint/lint1/decl.c	Sun Jan 21 14:21:34 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.387 2024/01/20 10:02:31 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.388 2024/01/21 14:21:34 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.387 2024/01/20 10:02:31 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.388 2024/01/21 14:21:34 rillig Exp $");
 #endif
 
 #include 
@@ -932,7 +932,7 @@ check_type(sym_t *sym)
  * implementation-defined type".
  */
 static void
-check_bit_field_type(sym_t *dsym, type_t **const inout_tp, tspec_t *inout_t)
+check_bit_field_type(sym_t *dsym, type_t **inout_tp, tspec_t *inout_t)
 {
 	type_t *tp = *inout_tp;
 	tspec_t t = *inout_t;
@@ -976,7 +976,7 @@ check_bit_field_type(sym_t *dsym, type_t
 }
 
 static void
-check_bit_field(sym_t *dsym, tspec_t *inout_t, type_t **const inout_tp)
+check_bit_field(sym_t *dsym, tspec_t *inout_t, type_t **inout_tp)
 {
 
 	check_bit_field_type(dsym, inout_tp, inout_t);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.595 src/usr.bin/xlint/lint1/tree.c:1.596
--- src/usr.bin/xlint/lint1/tree.c:1.595	Thu Jan 11 23:26:39 2024
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan 21 14:21:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.595 2024/01/11 23:26:39 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.596 2024/01/21 14:21:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.595 2024/01/11 23:26:39 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.596 2024/01/21 14:21:34 rillig Exp $");
 #endif
 
 #include 
@@ -2670,11 +2670,11 @@ check_unconst_function(const type_t *lst
 
 static bool
 check_assign_void_pointer_compat(op_t op, int arg,
- const type_t *const ltp, tspec_t const lt,
- const type_t *const lstp, tspec_t const lst,
- const tnode_t *const rn,
- const type_t *const rtp, tspec_t const rt,
- const type_t *const rstp, tspec_t const rst)
+ const type_t *ltp, tspec_t lt,
+ const type_t *lstp, tspec_t lst,
+ const tnode_t *rn,
+ const type_t *rtp, tspec_t rt,
+ const type_t *rstp, tspec_t rst)
 {
 	if (!(lt == PTR && rt == PTR && (lst == VOID || rst == VOID ||
 	 types_compatible(lstp, rstp,
@@ -2713,8 +2713,8 @@ check_assign_void_pointer_compat(op_t op
 
 static bool
 check_assign_pointer_integer(op_t op, int arg,
-			 const type_t *const ltp, tspec_t const lt,
-			 const type_t *const rtp, tspec_t const rt)
+			 const type_t *ltp, tspec_t lt,
+			 const type_t *rtp, tspec_t rt)
 {
 
 	if (!((lt == PTR && is_integer(rt)) || (is_integer(lt) && rt == PTR)))



CVS commit: src/usr.bin/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:21:34 UTC 2024

Modified Files:
src/usr.bin/xlint: Makefile.inc
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: clean up redundant const from parameters and local variables

These were leftovers from splitting large functions into smaller
functions, to ensure that variables were not unintentionally reassigned.
Those refactorings are finished, and the extra help from the compiler is
no longer necessary.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/xlint/Makefile.inc
cvs rdiff -u -r1.387 -r1.388 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.595 -r1.596 src/usr.bin/xlint/lint1/tree.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/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:11:52 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: main1.c
src/usr.bin/xlint/xlint: lint.1

Log Message:
lint: create .ln output file even when queries are enabled

This allows to configure lint flags in mk.conf globally for a whole
NetBSD build.  Previously, this would have made the build fail due to
missing .ln files.

The previous use case of rerunning lint with or without queries is easy
enough to achieve by doing a 'make clean', in the same way as for lint
warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/xlint/lint.1

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/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.78 src/usr.bin/xlint/lint1/main1.c:1.79
--- src/usr.bin/xlint/lint1/main1.c:1.78	Sun Dec  3 18:17:41 2023
+++ src/usr.bin/xlint/lint1/main1.c	Sun Jan 21 14:11:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.78 2023/12/03 18:17:41 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.79 2024/01/21 14:11:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: main1.c,v 1.78 2023/12/03 18:17:41 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.79 2024/01/21 14:11:52 rillig Exp $");
 #endif
 
 #include 
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
 
 
 	/* initialize output */
-	outopen(any_query_enabled ? "/dev/null" : argv[1]);
+	outopen(argv[1]);
 
 #ifdef DEBUG
 	setvbuf(stdout, NULL, _IONBF, 0);

Index: src/usr.bin/xlint/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.64 src/usr.bin/xlint/xlint/lint.1:1.65
--- src/usr.bin/xlint/xlint/lint.1:1.64	Sat Aug 26 10:43:53 2023
+++ src/usr.bin/xlint/xlint/lint.1	Sun Jan 21 14:11:52 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.64 2023/08/26 10:43:53 rillig Exp $
+.\" $NetBSD: lint.1,v 1.65 2024/01/21 14:11:52 rillig Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -30,7 +30,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 2, 2023
+.Dd January 21, 2024
 .Dt LINT 1
 .Os
 .Sh NAME
@@ -356,10 +356,6 @@ that may be interesting to look at on a 
 The most convenient way to run queries on a source file is to run:
 .Pp
 .Dl make LINT=\*qlint \-q3,5,7\*q source.ln
-.Pp
-To allow this command to be run repeatedly, the option
-.Fl q
-prevents creating the .ln file.
 .It Fl R Ar old=new
 Remap
 .Ar old



CVS commit: src/usr.bin/xlint

2024-01-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 21 14:11:52 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: main1.c
src/usr.bin/xlint/xlint: lint.1

Log Message:
lint: create .ln output file even when queries are enabled

This allows to configure lint flags in mk.conf globally for a whole
NetBSD build.  Previously, this would have made the build fail due to
missing .ln files.

The previous use case of rerunning lint with or without queries is easy
enough to achieve by doing a 'make clean', in the same way as for lint
warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/xlint/lint.1

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



CVS commit: src/distrib/utils/embedded

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 13:10:55 UTC 2024

Modified Files:
src/distrib/utils/embedded/conf: wii.conf
Added Files:
src/distrib/utils/embedded/files: evbppc_wii_icon.png

Log Message:
wii: Add 128x48 icon to SD card image


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/wii.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/evbppc_wii_icon.png

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



CVS commit: src/distrib/utils/embedded

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 13:10:55 UTC 2024

Modified Files:
src/distrib/utils/embedded/conf: wii.conf
Added Files:
src/distrib/utils/embedded/files: evbppc_wii_icon.png

Log Message:
wii: Add 128x48 icon to SD card image


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/wii.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/evbppc_wii_icon.png

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

Modified files:

Index: src/distrib/utils/embedded/conf/wii.conf
diff -u src/distrib/utils/embedded/conf/wii.conf:1.2 src/distrib/utils/embedded/conf/wii.conf:1.3
--- src/distrib/utils/embedded/conf/wii.conf:1.2	Sun Jan 21 10:28:25 2024
+++ src/distrib/utils/embedded/conf/wii.conf	Sun Jan 21 13:10:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: wii.conf,v 1.2 2024/01/21 10:28:25 jmcneill Exp $
+# $NetBSD: wii.conf,v 1.3 2024/01/21 13:10:55 jmcneill Exp $
 # Nintendo Wii customization script used by mkimage
 #
 board=wii
@@ -52,6 +52,7 @@ populate() {
 
 	# Metadata for HBC
 	cp ${DIR}/files/evbppc_wii_meta.xml ${mnt}/boot/apps/netbsd/meta.xml
+	cp ${DIR}/files/evbppc_wii_icon.png ${mnt}/boot/apps/netbsd/icon.png
 
 	# Add swap space
 	rm -f ${mnt}${swap_file}

Added files:

Index: src/distrib/utils/embedded/files/evbppc_wii_icon.png
Binary files are different



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

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 13:05:29 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: vireg.h wiifb.c
Added Files:
src/sys/arch/evbppc/wii/dev: viio.h

Log Message:
wii: Add NTSC 480p support.

In addition to this, add VIIO_{GET,SET}REGS ioctl support to allow for
poking at video interface registers from userland. This is helpful for
debugging display issues.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbppc/wii/dev/viio.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/dev/vireg.h \
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/vireg.h
diff -u src/sys/arch/evbppc/wii/dev/vireg.h:1.1 src/sys/arch/evbppc/wii/dev/vireg.h:1.2
--- src/sys/arch/evbppc/wii/dev/vireg.h:1.1	Sat Jan 20 21:36:00 2024
+++ src/sys/arch/evbppc/wii/dev/vireg.h	Sun Jan 21 13:05:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vireg.h,v 1.1 2024/01/20 21:36:00 jmcneill Exp $ */
+/* $NetBSD: vireg.h,v 1.2 2024/01/21 13:05:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -163,7 +163,8 @@
 
 /* [2B] VISEL - VI DTV Status Register */
 #define VI_VISEL	0x6e
-#define	 VI_VISEL_SEL	__BIT(2)
+#define	 VI_VISEL_SEL			__BIT(2)
+#define	 VI_VISEL_COMPONENT_CABLE	__BIT(0)
 
 /* [2B] VI_HSCALINGW - Horizontal Scaling Width */
 #define VI_HSCALINGW	0x70
Index: src/sys/arch/evbppc/wii/dev/wiifb.c
diff -u src/sys/arch/evbppc/wii/dev/wiifb.c:1.1 src/sys/arch/evbppc/wii/dev/wiifb.c:1.2
--- src/sys/arch/evbppc/wii/dev/wiifb.c:1.1	Sat Jan 20 21:36:00 2024
+++ src/sys/arch/evbppc/wii/dev/wiifb.c	Sun Jan 21 13:05:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wiifb.c,v 1.1 2024/01/20 21:36:00 jmcneill Exp $ */
+/* $NetBSD: wiifb.c,v 1.2 2024/01/21 13:05:29 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.1 2024/01/20 21:36:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.2 2024/01/21 13:05:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.
 
 #include "mainbus.h"
 #include "vireg.h"
+#include "viio.h"
 
 #define	WIIFB_ERROR_BLINK_INTERVAL	100
 
@@ -179,30 +180,22 @@ static void
 wiifb_init(struct wiifb_softc *sc)
 {
 	uint16_t dcr;
+	uint16_t visel;
 
-#if notyet
 	/* Read current display format and interlaced settings. */
 	dcr = RD2(sc, VI_DCR);
-	sc->sc_format = __SHIFTOUT(dcr, VI_DCR_FMT);
-	sc->sc_interlaced = (dcr & VI_DCR_NIN) == 0;
+	if ((dcr & VI_DCR_ENB) != 0) {
+		sc->sc_format = __SHIFTOUT(dcr, VI_DCR_FMT);
+		sc->sc_interlaced = (dcr & VI_DCR_NIN) == 0;
+	} else {
+		visel = RD2(sc, VI_VISEL);
+		sc->sc_format = VI_DCR_FMT_NTSC;
+		sc->sc_interlaced = (visel & VI_VISEL_COMPONENT_CABLE) == 0;
+	}
 
 	/* Reset video interface. */
 	WR2(sc, VI_DCR, dcr | VI_DCR_RST);
 	WR2(sc, VI_DCR, dcr & ~VI_DCR_RST);
-#else
-	/* Force NTSC 480i and reset video interface. */
-	dcr = RD2(sc, VI_DCR);
-	dcr |= VI_DCR_RST;
-	WR2(sc, VI_DCR, dcr);
-	dcr &= ~VI_DCR_RST;
-	dcr &= ~VI_DCR_FMT;
-	dcr |= __SHIFTIN(VI_DCR_FMT_NTSC, VI_DCR_FMT);
-	dcr &= ~VI_DCR_NIN;
-	WR2(sc, VI_DCR, dcr);
-
-	sc->sc_format = VI_DCR_FMT_NTSC;
-	sc->sc_interlaced = 1;
-#endif
 }
 
 static void
@@ -219,7 +212,7 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 	sc->sc_curmode = _modes[modeidx];
 
 	if (modeidx == WIIFB_MODE_INDEX(VI_DCR_FMT_NTSC, 1)) {
-		/* Magic numbers from YAGCD. */
+		/* NTSC 480i Magic numbers from YAGCD. */
 		WR2(sc, VI_VTR, 0x0f06);
 		WR4(sc, VI_HTR0, 0x476901AD);
 		WR4(sc, VI_HTR1, 0x02EA5140);
@@ -227,6 +220,15 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 		WR4(sc, VI_VTE, 0x00020019);
 		WR4(sc, VI_BBOI, 0x410C410C);
 		WR4(sc, VI_BBEI, 0x40ED40ED);
+	} else if (modeidx == WIIFB_MODE_INDEX(VI_DCR_FMT_NTSC, 0)) {
+		/* NTSC 480p */
+		WR2(sc, VI_VTR, 0x1e0c);
+		WR4(sc, VI_HTR0, 0x476901ad);
+		WR4(sc, VI_HTR1, 0x030a4940);
+		WR4(sc, VI_VTO, 0x00060030);
+		WR4(sc, VI_VTE, 0x00060030);
+		WR4(sc, VI_BBOI, 0x81d881d8);
+		WR4(sc, VI_BBEI, 0x81d881d8);
 	} else {
 		/*
 		 * Display mode is not supported. Blink the slot LED to
@@ -242,7 +244,12 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 	__SHIFTIN(strides, VI_PICCONF_STRIDES) |
 	__SHIFTIN(reads, VI_PICCONF_READS));
 
-	WR2(sc, VI_HSR, __SHIFTIN(256, VI_HSR_STP));
+	/* Horizontal scaler configuration */
+	if (interlaced) {
+		WR2(sc, VI_HSR, __SHIFTIN(256, VI_HSR_STP));
+	} else {
+		WR2(sc, VI_HSR, __SHIFTIN(244, VI_HSR_STP) | VI_HSR_HS_EN);
+	}
 
 	/* Video clock configuration */
 	WR2(sc, VI_VICLK,
@@ -281,6 +288,7 @@ wiifb_ioctl(void *v, void *vs, u_long cm
 	struct wiifb_softc *sc = v;
 	struct wsdisplayio_bus_id *busid;
 	struct wsdisplayio_fbinfo *fbi;
+	struct vi_regs *vr;
 
 	switch (cmd) {
 	case WSDISPLAYIO_GTYPE:
@@ -306,6 +314,35 @@ wiifb_ioctl(void *v, void *vs, u_long cm
 		

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

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 13:05:29 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: vireg.h wiifb.c
Added Files:
src/sys/arch/evbppc/wii/dev: viio.h

Log Message:
wii: Add NTSC 480p support.

In addition to this, add VIIO_{GET,SET}REGS ioctl support to allow for
poking at video interface registers from userland. This is helpful for
debugging display issues.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbppc/wii/dev/viio.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbppc/wii/dev/vireg.h \
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/lib/libc/net

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 12:58:10 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Unwrap a line which wasn't wrapped before it had an __UNCONST() added
to it, and now that that is gone again, doesn't need wrapping any more.

That line is now unaltered from what it was 3 revs ago (bit for bit).

NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libc/net/getaddrinfo.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/net

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 12:58:10 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Unwrap a line which wasn't wrapped before it had an __UNCONST() added
to it, and now that that is gone again, doesn't need wrapping any more.

That line is now unaltered from what it was 3 revs ago (bit for bit).

NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libc/net/getaddrinfo.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/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.126 src/lib/libc/net/getaddrinfo.c:1.127
--- src/lib/libc/net/getaddrinfo.c:1.126	Sat Jan 20 16:18:56 2024
+++ src/lib/libc/net/getaddrinfo.c	Sun Jan 21 12:58:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.127 2024/01/21 12:58:10 kre Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.127 2024/01/21 12:58:10 kre Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -1440,8 +1440,7 @@ explore_numeric_scope(const struct addri
 			if (cur->ai_family != AF_INET6)
 continue;
 			sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr;
-			if (ip6_str2scopeid(scope, sin6, )
-			== -1) {
+			if (ip6_str2scopeid(scope, sin6, ) == -1) {
 free(hostname2);
 return EAI_NODATA; /* XXX: is return OK? */
 			}



CVS commit: src/distrib/utils/embedded/conf

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 10:28:25 UTC 2024

Modified Files:
src/distrib/utils/embedded/conf: wii.conf

Log Message:
build fix: use dd with count=1 for compat with NetBSD dd(1)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/wii.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/wii.conf
diff -u src/distrib/utils/embedded/conf/wii.conf:1.1 src/distrib/utils/embedded/conf/wii.conf:1.2
--- src/distrib/utils/embedded/conf/wii.conf:1.1	Sat Jan 20 21:35:59 2024
+++ src/distrib/utils/embedded/conf/wii.conf	Sun Jan 21 10:28:25 2024
@@ -1,4 +1,4 @@
-# $NetBSD: wii.conf,v 1.1 2024/01/20 21:35:59 jmcneill Exp $
+# $NetBSD: wii.conf,v 1.2 2024/01/21 10:28:25 jmcneill Exp $
 # Nintendo Wii customization script used by mkimage
 #
 board=wii
@@ -55,8 +55,8 @@ populate() {
 
 	# Add swap space
 	rm -f ${mnt}${swap_file}
-	dd if=/dev/zero of=${mnt}${swap_file} bs=1 count=0 \
-	seek=$((${swap_size_MB} * 1024 * 1024))
+	dd if=/dev/zero of=${mnt}${swap_file} bs=1 count=1 \
+	seek=$((${swap_size_MB} * 1024 * 1024 - 1))
 	echo ".${swap_file} type=file uname=root gname=wheel mode=0600" \
 >> "$tmp/selected_sets"
 }



CVS commit: src/distrib/utils/embedded/conf

2024-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 21 10:28:25 UTC 2024

Modified Files:
src/distrib/utils/embedded/conf: wii.conf

Log Message:
build fix: use dd with count=1 for compat with NetBSD dd(1)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/wii.conf

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:48:21 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
Make this compile without MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/fdt/intc_fdt.c

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

Modified files:

Index: src/sys/arch/riscv/fdt/intc_fdt.c
diff -u src/sys/arch/riscv/fdt/intc_fdt.c:1.5 src/sys/arch/riscv/fdt/intc_fdt.c:1.6
--- src/sys/arch/riscv/fdt/intc_fdt.c:1.5	Sun Jan 21 08:41:00 2024
+++ src/sys/arch/riscv/fdt/intc_fdt.c	Sun Jan 21 08:48:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intc_fdt.c,v 1.5 2024/01/21 08:41:00 skrll Exp $	*/
+/*	$NetBSD: intc_fdt.c,v 1.6 2024/01/21 08:48:21 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.5 2024/01/21 08:41:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.6 2024/01/21 08:48:21 skrll Exp $");
 
 #include 
 
@@ -57,7 +57,6 @@ static const struct device_compatible_en
 
 struct intc_irqhandler;
 struct intc_irq;
-struct intc_softc;
 
 typedef int (*intcih_t)(void *);
 
@@ -121,6 +120,20 @@ static const char * const intc_sources[I
 	"(reserved)"
 };
 
+#ifndef MULTIPROCESSOR
+struct intc_fdt_softc *intc_sc;
+#endif
+
+
+static inline struct intc_fdt_softc *
+intc_getsc(struct cpu_info *ci)
+{
+#ifdef MULTIPROCESSOR
+	return ci->ci_intcsoftc;
+#else
+	return intc_sc;
+#endif
+}
 
 static void *
 intc_intr_establish(struct intc_fdt_softc *sc, u_int source, u_int ipl,
@@ -246,7 +259,7 @@ intc_intr_handler(struct trapframe *tf, 
 
 	KASSERT(CAUSE_INTERRUPT_P(cause));
 
-	struct intc_fdt_softc * const sc = ci->ci_intcsoftc;
+	struct intc_fdt_softc * const sc = intc_getsc(ci);
 
 	ci->ci_intr_depth++;
 	ci->ci_data.cpu_nintr++;
@@ -334,13 +347,15 @@ intc_attach(device_t parent, device_t se
 	sc->sc_dev = self;
 	sc->sc_ci = ci;
 	sc->sc_hartid = ci->ci_cpuid;
-	ci->ci_intcsoftc = sc;
 
 	intc_intr_establish(sc, IRQ_SUPERVISOR_TIMER, IPL_SCHED, IST_MPSAFE,
 	riscv_timer_intr, NULL, "clock");
 #ifdef MULTIPROCESSOR
+	ci->ci_intcsoftc = sc;
 	intc_intr_establish(sc, IRQ_SUPERVISOR_SOFTWARE, IPL_HIGH, IST_MPSAFE,
 	riscv_ipi_intr, NULL, "ipi");
+#else
+	intc_sc = sc;
 #endif
 }
 



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:48:21 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
Make this compile without MULTIPROCESSOR


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/fdt/intc_fdt.c

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:41:00 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
Remove an empty line


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/fdt/intc_fdt.c

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

Modified files:

Index: src/sys/arch/riscv/fdt/intc_fdt.c
diff -u src/sys/arch/riscv/fdt/intc_fdt.c:1.4 src/sys/arch/riscv/fdt/intc_fdt.c:1.5
--- src/sys/arch/riscv/fdt/intc_fdt.c:1.4	Sun Jan 21 08:39:50 2024
+++ src/sys/arch/riscv/fdt/intc_fdt.c	Sun Jan 21 08:41:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intc_fdt.c,v 1.4 2024/01/21 08:39:50 skrll Exp $	*/
+/*	$NetBSD: intc_fdt.c,v 1.5 2024/01/21 08:41:00 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.4 2024/01/21 08:39:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.5 2024/01/21 08:41:00 skrll Exp $");
 
 #include 
 
@@ -208,7 +208,6 @@ intc_fdt_disestablish(device_t dev, void
 #if 0
 	struct intc_fdt_softc * const sc = device_private(dev);
 #endif
-
 }
 
 static bool



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:41:00 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
Remove an empty line


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/fdt/intc_fdt.c

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:39:50 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
spaces -> tab


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/fdt/intc_fdt.c

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



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

2024-01-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 21 08:39:50 UTC 2024

Modified Files:
src/sys/arch/riscv/fdt: intc_fdt.c

Log Message:
spaces -> tab


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/fdt/intc_fdt.c

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

Modified files:

Index: src/sys/arch/riscv/fdt/intc_fdt.c
diff -u src/sys/arch/riscv/fdt/intc_fdt.c:1.3 src/sys/arch/riscv/fdt/intc_fdt.c:1.4
--- src/sys/arch/riscv/fdt/intc_fdt.c:1.3	Mon Dec 25 13:21:30 2023
+++ src/sys/arch/riscv/fdt/intc_fdt.c	Sun Jan 21 08:39:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intc_fdt.c,v 1.3 2023/12/25 13:21:30 skrll Exp $	*/
+/*	$NetBSD: intc_fdt.c,v 1.4 2024/01/21 08:39:50 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.3 2023/12/25 13:21:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intc_fdt.c,v 1.4 2024/01/21 08:39:50 skrll Exp $");
 
 #include 
 
@@ -313,7 +313,7 @@ intc_attach(device_t parent, device_t se
 	const int phandle = faa->faa_phandle;
 
 	int error = fdtbus_register_interrupt_controller(self, phandle,
-_fdt_funcs);
+	_fdt_funcs);
 	if (error) {
 		aprint_error(": couldn't register with fdtbus: %d\n", error);
 		return;